/usr/share/radiance/metals.cal is in radiance-materials 4R1+20120125-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | {
Complex indices of refraction for 4 metals:
copper
gold
aluminum
silver
Data borrowed from Andrew Glassner's book, "Principles of
Digital Image Synthesis" from Morgan Kaufmann
publishers.
The functions below permit the computation of
spectral reflectance at any incident angle and
wavelength in the 380-775 nm range.
}
spec_copper(ct,wl) : spec_refl(copper_nr,copper_ni,ct,wl);
spec_gold(ct,wl) : spec_refl(gold_nr,gold_ni,ct,wl);
spec_aluminum(ct,wl) : spec_refl(aluminum_nr,aluminum_ni,ct,wl);
spec_silver(ct,wl) : spec_refl(silver_nr,silver_ni,ct,wl);
{
Fresnel's equations
}
sq(x) : x*x;
Sqrt(x) : if(x,sqrt(x),0);
fuvA(ct,nr,nk) : sq(nr)*(1-sq(nk)) - (1-sq(ct));
fuvB(ct,nr,nk) : sqrt(sq(fuvA(ct,nr,nk)) + 4*sq(sq(nr)*nk));
fu2(ct,nr,nk) : (fuvA(ct,nr,nk) + fuvB(ct,nr,nk))/2;
fv2(ct,nr,nk) : (-fuvA(ct,nr,nk) + fuvB(ct,nr,nk))/2;
fperp2(ct,nr,nk) : (sq(ct-sqrt(fu2(ct,nr,nk))) + fv2(ct,nr,nk)) /
(sq(ct+sqrt(fu2(ct,nr,nk))) + fv2(ct,nr,nk));
fpara2(ct,nr,nk) : (sq(sq(nr)*(1-sq(nk))*ct - sqrt(fu2(ct,nr,nk))) +
sq(2*sq(nr)*nk*ct - Sqrt(fv2(ct,nr,nk)))) /
(sq(sq(nr)*(1-sq(nk))*ct + sqrt(fu2(ct,nr,nk))) +
sq(2*sq(nr)*nk*ct + Sqrt(fv2(ct,nr,nk))));
fresnel2(ct,nr,nk) : (fperp2(ct,nr,nk) + fpara2(ct,nr,nk))/2;
spec_refl(nrf,nif,ct,wl) : fresnel2(ct,nrf(wl),nif(wl)/nrf(wl));
{
Complex refractive index interpolation functions
for our metals.
}
interp_arr2`(i,x,f):(i+1-x)*f(i)+(x-i)*f(i+1);
interp_arr`(x,f):if(x-1,if(f(0)-x,interp_arr2`(floor(x),x,f),f(f(0))),f(1));
copper_nr`p24653(i):select(i,1.18828,1.18828,1.1871,
1.185312,1.183702,1.182223,1.180822,1.179452,1.178062,1.176602,
1.175023,1.173274,1.171306,1.169114,1.166702,1.164034,1.161139,
1.158046,1.154787,1.15139,1.150639,1.151381,1.151354,1.150138,
1.147313,1.142456,1.135149,1.12497,1.114585,1.102313,1.085276,
1.062659,1.034637,1.003658,0.965898,0.921582,0.870931,0.812255,
0.740885,0.667504,0.595384,0.527793,0.468,0.415458,0.372648,
0.338234,0.310878,0.289246,0.272,0.256103,0.243055,0.232653,
0.224696,0.218982,0.215308,0.213646,0.213653,0.21435,0.215,
0.214749,0.214074,0.21333,0.21272,0.21238,0.212566,0.213295,
0.214605,0.21645,0.218648,0.221044,0.223483,0.225852,0.228145,
0.230367,0.232522,0.234613,0.236647,0.238625,0.240554,0.242437);
copper_nr(x):interp_arr`((x-380)/5+1,copper_nr`p24653);
copper_ni`p24653(i):select(i,2.078662,2.078662,2.09304,
2.117618,2.142816,2.168463,2.194386,2.220412,2.246369,2.272084,
2.297387,2.322103,2.346061,2.369725,2.393291,2.415747,2.43704,
2.457114,2.475917,2.493393,2.511981,2.5307,2.547674,2.562687,
2.575524,2.58597,2.593811,2.59883,2.599943,2.598045,2.594923,
2.591761,2.58795,2.579443,2.575114,2.576699,2.585936,2.603536,
2.627422,2.660953,2.703188,2.753184,2.81,2.875556,2.945518,
3.018414,3.092775,3.167127,3.24,3.312184,3.381591,3.448394,
3.512766,3.57488,3.634911,3.693233,3.750162,3.805661,3.86,
3.91448,3.967796,4.019675,4.069952,4.118678,4.166057,4.212465,
4.258351,4.30398,4.349268,4.394238,4.438778,4.48251,4.525993,
4.569252,4.612311,4.655197,4.697934,4.740548,4.783062,4.825503);
copper_ni(x):interp_arr`((x-380)/5+1,copper_ni`p24653);
gold_nr`p24653(i):select(i,1.678455,1.678455,1.675263,
1.666817,1.658,1.649184,1.640737,1.634183,1.629351,1.622275,
1.612759,1.59989,1.579005,1.548932,1.510154,1.464924,1.417717,
1.374532,1.325871,1.268297,1.195681,1.110843,1.021396,0.933039,
0.84688,0.767504,0.695794,0.631604,0.571663,0.516924,0.469422,
0.429107,0.395941,0.369509,0.348463,0.33137,0.316801,0.303023,
0.288205,0.273748,0.259998,0.2473,0.236,0.226102,0.217697,
0.210535,0.204364,0.198936,0.194,0.188606,0.183521,0.178812,
0.174544,0.170786,0.167605,0.165016,0.163,0.161554,0.160597,
0.160049,0.159829,0.159855,0.160027,0.160222,0.160515,0.160903,
0.161383,0.161953,0.162609,0.163349,0.164163,0.165023,0.165954,
0.166952,0.16801,0.169122,0.170283,0.171487,0.172728,0.174);
gold_nr(x):interp_arr`((x-380)/5+1,gold_nr`p24653);
gold_ni`p24653(i):select(i,1.953596,1.953596,1.953178,
1.953892,1.956,1.958108,1.958822,1.957185,1.952822,1.945549,
1.93636,1.925744,1.912865,1.897096,1.87876,1.860113,1.841519,
1.821149,1.805653,1.797055,1.790414,1.790218,1.80338,1.832168,
1.875281,1.93352,2.004628,2.085559,2.177679,2.276178,2.374557,
2.469264,2.557729,2.640573,2.714364,2.779947,2.838163,2.883275,
2.896406,2.904831,2.909502,2.911371,2.91139,2.91051,2.909684,
2.909863,2.912,2.917045,2.925952,2.939671,2.959155,2.985355,
3.019223,3.061712,3.113773,3.179622,3.260394,3.348767,3.442244,
3.53833,3.634528,3.728342,3.817474,3.900933,3.978438,4.050759,
4.118664,4.182923,4.244306,4.303581,4.361628,4.419346,4.476388,
4.532793,4.588597,4.643842,4.698567,4.752808,4.806607,4.86);
gold_ni(x):interp_arr`((x-380)/5+1,gold_ni`p24653);
aluminum_nr`p24654(i):select(i,0.459522,0.459522,
0.464578,0.477268,0.49,0.502732,0.515422,0.528027,0.54054,
0.553012,0.565131,0.577244,0.589948,0.603591,0.618,0.632493,
0.646781,0.660667,0.674693,0.689087,0.703759,0.718931,0.734853,
0.751561,0.769,0.786605,0.786342,0.784987,0.806091,0.844815,
0.878276,0.898602,0.915377,0.934823,0.958,0.981445,1.002914,
1.024224,1.046286,1.070014,1.09594,1.123162,1.15,1.176546,1.2,
1.22,1.243866,1.27122,1.3,1.32833,1.356345,1.384367,1.411292,
1.439278,1.47,1.502859,1.53467,1.566741,1.6,1.634324,1.670565,
1.708526,1.747843,1.787991,1.83,1.872679,1.919912,1.972871,
2.030324,2.090685,2.153505,2.220514,2.285233,2.345712,2.4,
2.45085,2.499693,2.545931,2.589417,2.63);
aluminum_nr(x):interp_arr`((x-380)/5+1,aluminum_nr`p24654);
aluminum_ni`p24654(i):select(i,4.712543,4.712543,
4.737463,4.799026,4.86,4.920975,4.982537,5.046061,5.111395,
5.175306,5.233723,5.288472,5.344414,5.405324,5.47,5.531815,
5.592108,5.653007,5.714261,5.775548,5.836021,5.896012,5.956376,
6.017607,6.08,6.138476,6.196043,6.255528,6.318217,6.382319,
6.443884,6.502451,6.563588,6.63103,6.69,6.743231,6.801953,
6.861834,6.919963,6.977149,7.034889,7.092927,7.15,7.206569,
7.26,7.31,7.364944,7.422566,7.48,7.535376,7.588417,7.639844,
7.690237,7.740152,7.79,7.841236,7.896558,7.953478,8.01,
8.066238,8.11997,8.17108,8.21945,8.265363,8.31,8.354383,
8.40055,8.452595,8.501185,8.543206,8.575872,8.598589,8.611949,
8.618302,8.62,8.623612,8.625132,8.622376,8.614337,8.6);
aluminum_ni(x):interp_arr`((x-380)/5+1,aluminum_ni`p24654);
silver_nr`p24654(i):select(i,0.172643,0.172643,0.172179,
0.172143,0.173,0.173857,0.173821,0.171576,0.167032,0.162298,
0.159271,0.158423,0.157828,0.155916,0.15216,0.147613,0.143045,
0.138757,0.135317,0.132764,0.131138,0.130306,0.130009,0.129992,
0.130061,0.130105,0.130103,0.130043,0.130125,0.130219,0.130091,
0.129646,0.128675,0.126824,0.124775,0.122763,0.121029,0.119768,
0.119005,0.118838,0.119176,0.119927,0.121,0.122437,0.124046,
0.125766,0.127538,0.129303,0.131,0.132869,0.13459,0.136141,
0.137502,0.138652,0.13957,0.14011,0.140229,0.140185,0.14005,
0.139897,0.139801,0.139833,0.140154,0.141061,0.142139,0.143315,
0.144516,0.145667,0.146695,0.147527,0.148028,0.147986,0.147682,
0.147174,0.146517,0.145769,0.144987,0.144227,0.143545,0.143);
silver_nr(x):interp_arr`((x-380)/5+1,silver_nr`p24654);
silver_ni`p24654(i):select(i,1.801357,1.801357,1.824736,
1.886179,1.95,2.013821,2.075264,2.132024,2.183605,2.231833,
2.278383,2.324504,2.371326,2.420021,2.470635,2.520932,2.569545,
2.615768,2.660014,2.702999,2.744957,2.786577,2.828568,2.871323,
2.916154,2.961894,3.007563,3.052436,3.095771,3.137532,3.178189,
3.218184,3.257945,3.297745,3.337667,3.377699,3.41783,3.458226,
3.499347,3.540295,3.58086,3.620832,3.66,3.697,3.733363,
3.769467,3.805689,3.842407,3.88,3.919219,3.959434,4.000389,
4.041828,4.083495,4.125135,4.166709,4.208175,4.249203,4.289791,
4.329939,4.369645,4.408909,4.447676,4.485809,4.523594,4.561111,
4.598441,4.635663,4.672859,4.710108,4.747403,4.784542,4.82189,
4.859458,4.897254,4.935289,4.973571,5.012111,5.050918,5.09);
silver_ni(x):interp_arr`((x-380)/5+1,silver_ni`p24654);
|