Blender V4.5
bsdf_util.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2009-2010 Sony Pictures Imageworks Inc., et al. All Rights Reserved.
2 * SPDX-FileCopyrightText: 2011-2022 Blender Foundation
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 * Adapted code from Open Shading Language. */
7
8#pragma once
9
10#include "kernel/types.h"
11
13
14#include "util/color.h"
15
17
18/* Compute fresnel reflectance for perpendicular (aka S-) and parallel (aka P-) polarized light.
19 * If requested by the caller, r_phi is set to the phase shift on reflection.
20 * Also returns the dot product of the refracted ray and the normal as `cos_theta_t`, as it is
21 * used when computing the direction of the refracted ray. */
23 const float eta,
24 ccl_private float *r_cos_theta_t,
25 ccl_private float2 *r_phi)
26{
27 kernel_assert(!isnan_safe(cos_theta_i));
28
29 /* Using Snell's law, calculate the squared cosine of the angle between the surface normal and
30 * the transmitted ray. */
31 const float eta_cos_theta_t_sq = sqr(eta) - (1.0f - sqr(cos_theta_i));
32 if (eta_cos_theta_t_sq <= 0) {
33 /* Total internal reflection. */
34 if (r_phi) {
35 /* The following code would compute the proper phase shift on TIR.
36 * However, for the current user of this computation (the iridescence code),
37 * this doesn't actually affect the result, so don't bother with the computation for now.
38 *
39 * `const float fac = sqrtf(1.0f - sqr(cosThetaI) - sqr(eta));`
40 * `r_phi->x = -2.0f * atanf(fac / cosThetaI);`
41 * `r_phi->y = -2.0f * atanf(fac / (cosThetaI * sqr(eta)));`
42 */
43 *r_phi = zero_float2();
44 }
45 return one_float2();
46 }
47
48 cos_theta_i = fabsf(cos_theta_i);
49 /* Relative to the surface normal. */
50 const float cos_theta_t = -safe_sqrtf(eta_cos_theta_t_sq) / eta;
51
52 if (r_cos_theta_t) {
53 *r_cos_theta_t = cos_theta_t;
54 }
55
56 /* Amplitudes of reflected waves. */
57 const float r_s = (cos_theta_i + eta * cos_theta_t) / (cos_theta_i - eta * cos_theta_t);
58 const float r_p = (cos_theta_t + eta * cos_theta_i) / (eta * cos_theta_i - cos_theta_t);
59
60 if (r_phi) {
61 *r_phi = make_float2(r_s < 0.0f, r_p < 0.0f) * M_PI_F;
62 }
63
64 /* Return squared amplitude to get the fraction of reflected energy. */
65 return make_float2(sqr(r_s), sqr(r_p));
66}
67
68/* Compute fresnel reflectance for unpolarized light. */
69ccl_device_forceinline float fresnel_dielectric(const float cos_theta_i,
70 const float eta,
71 ccl_private float *r_cos_theta_t)
72{
73 return average(fresnel_dielectric_polarized(cos_theta_i, eta, r_cos_theta_t, nullptr));
74}
75
76/* Refract the incident ray, given the cosine of the refraction angle and the relative refractive
77 * index of the incoming medium w.r.t. the outgoing medium. */
79 const float3 normal,
80 const float cos_theta_t,
81 const float inv_eta)
82{
83 return (inv_eta * dot(normal, incident) + cos_theta_t) * normal - inv_eta * incident;
84}
85
86ccl_device float fresnel_dielectric_cos(const float cosi, const float eta)
87{
88 // compute fresnel reflectance without explicitly computing
89 // the refracted direction
90 const float c = fabsf(cosi);
91 float g = eta * eta - 1 + c * c;
92 if (g > 0) {
93 g = sqrtf(g);
94 const float A = (g - c) / (g + c);
95 const float B = (c * (g + c) - 1) / (c * (g - c) + 1);
96 return 0.5f * A * A * (1 + B * B);
97 }
98 return 1.0f; // TIR(no refracted component)
99}
100
101/* Approximates the average single-scattering Fresnel for a given IOR.
102 * This is defined as the integral over 0...1 of 2*cosI * F(cosI, eta) d_cosI, with F being
103 * the real dielectric Fresnel.
104 * The implementation here uses a numerical fit from "Revisiting Physically Based Shading
105 * at Imageworks" by Christopher Kulla and Alejandro Conty. */
107{
108 if (eta < 1.0f) {
109 return 0.997118f + eta * (0.1014f - eta * (0.965241f + eta * 0.130607f));
110 }
111 return (eta - 1.0f) / (4.08567f + 1.00071f * eta);
112}
113
114ccl_device Spectrum fresnel_conductor(const float cosi, const Spectrum eta, const Spectrum k)
115{
116 const Spectrum cosi2 = make_spectrum(cosi * cosi);
117 const Spectrum one = make_spectrum(1.0f);
118 const Spectrum tmp_f = eta * eta + k * k;
119 const Spectrum tmp = tmp_f * cosi2;
120 const Spectrum Rparl2 = (tmp - (2.0f * eta * cosi) + one) / (tmp + (2.0f * eta * cosi) + one);
121 const Spectrum Rperp2 = (tmp_f - (2.0f * eta * cosi) + cosi2) /
122 (tmp_f + (2.0f * eta * cosi) + cosi2);
123 return (Rparl2 + Rperp2) * 0.5f;
124}
125
126/* Computes the average single-scattering Fresnel for the F82 metallic model. */
128{
129 return mix(F0, one_spectrum(), 1.0f / 21.0f) - B * (1.0f / 126.0f);
130}
131
132/* Precompute the B term for the F82 metallic model, given a tint factor. */
134{
135 /* In the classic F82 model, the F82 input directly determines the value of the Fresnel
136 * model at ~82°, similar to F0 and F90.
137 * With F82-Tint, on the other hand, the value at 82° is the value of the classic Schlick
138 * model multiplied by the tint input.
139 * Therefore, the factor follows by setting F82Tint(cosI) = FSchlick(cosI) - b*cosI*(1-cosI)^6
140 * and F82Tint(acos(1/7)) = FSchlick(acos(1/7)) * f82_tint and solving for b. */
141 const float f = 6.0f / 7.0f;
142 const float f5 = sqr(sqr(f)) * f;
143 const Spectrum F_schlick = mix(F0, one_spectrum(), f5);
144 return F_schlick * (7.0f / (f5 * f)) * (one_spectrum() - tint);
145}
146
147/* Precompute the B term for the F82 metallic model, given the F82 value. */
149{
150 const float f = 6.0f / 7.0f;
151 const float f5 = sqr(sqr(f)) * f;
152 const Spectrum F_schlick = mix(F0, one_spectrum(), f5);
153 return (7.0f / (f5 * f)) * (F_schlick - F82);
154}
155
156/* Approximates the average single-scattering Fresnel for a physical conductor. */
158{
159 /* In order to estimate Fss of the conductor, we fit the F82 model to it based on the
160 * value at 0° and ~82° and then use the analytic expression for its Fss. */
161 const Spectrum F0 = fresnel_conductor(1.0f, eta, k);
162 const Spectrum F82 = fresnel_conductor(1.0f / 7.0f, eta, k);
163 return saturate(fresnel_f82_Fss(F0, fresnel_f82_B(F0, F82)));
164}
165
166ccl_device float ior_from_F0(const float f0)
167{
168 const float sqrt_f0 = sqrtf(clamp(f0, 0.0f, 0.99f));
169 return (1.0f + sqrt_f0) / (1.0f - sqrt_f0);
170}
171
172ccl_device float F0_from_ior(const float ior)
173{
174 return sqr((ior - 1.0f) / (ior + 1.0f));
175}
176
177ccl_device float schlick_fresnel(const float u)
178{
179 const float m = clamp(1.0f - u, 0.0f, 1.0f);
180 const float m2 = m * m;
181 return m2 * m2 * m; // pow(m, 5)
182}
183
184/* Calculate the fresnel color, which is a blend between white and the F0 color */
186 const float3 H,
187 const float ior,
188 Spectrum F0)
189{
190 /* Compute the real Fresnel term and remap it from real_F0..1 to F0..1.
191 * The reason why we use this remapping instead of directly doing the
192 * Schlick approximation mix(F0, 1.0, (1.0-cosLH)^5) is that for cases
193 * with similar IORs (e.g. ice in water), the relative IOR can be close
194 * enough to 1.0 that the Schlick approximation becomes inaccurate. */
195 const float real_F = fresnel_dielectric_cos(dot(L, H), ior);
196 const float real_F0 = fresnel_dielectric_cos(1.0f, ior);
197
198 return mix(F0, one_spectrum(), inverse_lerp(real_F0, 1.0f, real_F));
199}
200
201/* If the shading normal results in specular reflection in the lower hemisphere, raise the shading
202 * normal towards the geometry normal so that the specular reflection is just above the surface.
203 * Only used for glossy materials. */
205{
206 const float3 R = 2 * dot(N, I) * N - I;
207
208 const float Iz = dot(I, Ng);
209 kernel_assert(Iz >= 0);
210
211 /* Reflection rays may always be at least as shallow as the incoming ray. */
212 const float threshold = min(0.9f * Iz, 0.01f);
213 if (dot(Ng, R) >= threshold) {
214 return N;
215 }
216
217 /* Form coordinate system with Ng as the Z axis and N inside the X-Z-plane.
218 * The X axis is found by normalizing the component of N that's orthogonal to Ng.
219 * The Y axis isn't actually needed.
220 */
221 const float3 X = safe_normalize_fallback(N - dot(N, Ng) * Ng, N);
222
223 /* Calculate N.z and N.x in the local coordinate system.
224 *
225 * The goal of this computation is to find a N' that is rotated towards Ng just enough
226 * to lift R' above the threshold (here called t), therefore dot(R', Ng) = t.
227 *
228 * According to the standard reflection equation,
229 * this means that we want dot(2*dot(N', I)*N' - I, Ng) = t.
230 *
231 * Since the Z axis of our local coordinate system is Ng, dot(x, Ng) is just x.z, so we get
232 * 2*dot(N', I)*N'.z - I.z = t.
233 *
234 * The rotation is simple to express in the coordinate system we formed -
235 * since N lies in the X-Z-plane, we know that N' will also lie in the X-Z-plane,
236 * so N'.y = 0 and therefore dot(N', I) = N'.x*I.x + N'.z*I.z .
237 *
238 * Furthermore, we want N' to be normalized, so N'.x = sqrt(1 - N'.z^2).
239 *
240 * With these simplifications, we get the equation
241 * 2*(sqrt(1 - N'.z^2)*I.x + N'.z*I.z)*N'.z - I.z = t,
242 * or
243 * 2*sqrt(1 - N'.z^2)*I.x*N'.z = t + I.z * (1 - 2*N'.z^2),
244 * after rearranging terms.
245 * Raise both sides to the power of two and substitute terms with
246 * a = I.x^2 + I.z^2,
247 * b = 2*(a + Iz*t),
248 * c = (Iz + t)^2,
249 * we obtain
250 * 4*a*N'.z^4 - 2*b*N'.z^2 + c = 0.
251 *
252 * The only unknown here is N'.z, so we can solve for that.
253 *
254 * The equation has four solutions in general, two can immediately be discarded because they're
255 * negative so N' would lie in the lower hemisphere; one solves
256 * 2*sqrt(1 - N'.z^2)*I.x*N'.z = -(t + I.z * (1 - 2*N'.z^2))
257 * instead of the original equation (before squaring both sides).
258 * Therefore only one root is valid.
259 */
260
261 const float Ix = dot(I, X);
262
263 const float a = sqr(Ix) + sqr(Iz);
264 const float b = 2.0f * (a + Iz * threshold);
265 const float c = sqr(threshold + Iz);
266
267 /* In order that the root formula solves 2*sqrt(1 - N'.z^2)*I.x*N'.z = t + I.z - 2*I.z*N'.z^2,
268 * Ix and (t + I.z * (1 - 2*N'.z^2)) must have the same sign (the rest terms are non-negative by
269 * definition). */
270 const float Nz2 = (Ix < 0) ? 0.25f * (b + safe_sqrtf(sqr(b) - 4.0f * a * c)) / a :
271 0.25f * (b - safe_sqrtf(sqr(b) - 4.0f * a * c)) / a;
272
273 const float Nx = safe_sqrtf(1.0f - Nz2);
274 const float Nz = safe_sqrtf(Nz2);
275
276 return Nx * X + Nz * Ng;
277}
278
279/* Do not call #ensure_valid_specular_reflection if the primitive type is curve or if the geometry
280 * normal and the shading normal is the same. */
282 const float3 N)
283{
284 if ((sd->flag & SD_USE_BUMP_MAP_CORRECTION) == 0) {
285 return N;
286 }
287 if ((sd->type & PRIMITIVE_CURVE) || isequal(sd->Ng, N)) {
288 return N;
289 }
290 return ensure_valid_specular_reflection(sd->Ng, sd->wi, N);
291}
292
293/* Principled Hair albedo and absorption coefficients. */
295 const float azimuthal_roughness)
296{
297 const float x = azimuthal_roughness;
298 return (((((0.245f * x) + 5.574f) * x - 10.73f) * x + 2.532f) * x - 0.215f) * x + 5.969f;
299}
300
302bsdf_principled_hair_sigma_from_reflectance(const Spectrum color, const float azimuthal_roughness)
303{
304 const Spectrum sigma = log(color) /
306 return sigma * sigma;
307}
308
310 const float pheomelanin)
311{
312 const float3 eumelanin_color = make_float3(0.506f, 0.841f, 1.653f);
313 const float3 pheomelanin_color = make_float3(0.343f, 0.733f, 1.924f);
314
315 return eumelanin * rgb_to_spectrum(eumelanin_color) +
316 pheomelanin * rgb_to_spectrum(pheomelanin_color);
317}
318
319/* Computes the weight for base closure(s) which are layered under another closure.
320 * layer_albedo is an estimate of the top layer's reflectivity, while weight is the closure weight
321 * of the entire base+top combination. */
323 const Spectrum weight)
324{
325 return weight * saturatef(1.0f - reduce_max(safe_divide_color(layer_albedo, weight)));
326}
327
328/* ******** Thin-film iridescence implementation ********
329 *
330 * Based on "A Practical Extension to Microfacet Theory for the Modeling of Varying Iridescence"
331 * by Laurent Belcour and Pascal Barla.
332 * https://belcour.github.io/blog/research/publication/2017/05/01/brdf-thin-film.html.
333 */
334
346{
347 const float phase = M_2PI_F * OPD * 1e-9f;
348 const float3 val = make_float3(5.4856e-13f, 4.4201e-13f, 5.2481e-13f);
349 const float3 pos = make_float3(1.6810e+06f, 1.7953e+06f, 2.2084e+06f);
350 const float3 var = make_float3(4.3278e+09f, 9.3046e+09f, 6.6121e+09f);
351
352 float3 xyz = val * sqrt(M_2PI_F * var) * cos(pos * phase + shift) * exp(-sqr(phase) * var);
353 xyz.x += 1.64408e-8f * cosf(2.2399e+06f * phase + shift) * expf(-4.5282e+09f * sqr(phase));
354 return xyz / 1.0685e-7f;
355}
356
358 const float T121, const float R12, const float R23, const float OPD, const float phi)
359{
360 if (R23 == 1.0f) {
361 /* Shortcut for TIR on the bottom interface. */
362 return one_float3();
363 }
364
365 const float R123 = R12 * R23;
366 const float r123 = sqrtf(R123);
367 const float Rs = sqr(T121) * R23 / (1.0f - R123);
368
369 /* Perform summation over path order differences (equation 10). */
370 float3 R = make_float3(R12 + Rs); /* C0 */
371 float Cm = (Rs - T121);
372 /* Truncate after m=3, higher differences have barely any impact. */
373 for (int m = 1; m < 4; m++) {
374 Cm *= r123;
375 R += Cm * 2.0f * iridescence_lookup_sensitivity(m * OPD, m * phi);
376 }
377 return R;
378}
379
381 float eta1,
382 float eta2,
383 float eta3,
384 float cos_theta_1,
385 const float thickness,
386 ccl_private float *r_cos_theta_3)
387{
388 /* For films below 30nm, the wave-optic-based Airy summation approach no longer applies,
389 * so blend towards the case without coating. */
390 if (thickness < 30.0f) {
391 eta2 = mix(eta1, eta2, smoothstep(0.0f, 30.0f, thickness));
392 }
393
394 float cos_theta_2;
395 float2 phi12;
396 float2 phi23;
397
398 /* Compute reflection at the top interface (ambient to film). */
399 const float2 R12 = fresnel_dielectric_polarized(cos_theta_1, eta2 / eta1, &cos_theta_2, &phi12);
400 if (isequal(R12, one_float2())) {
401 /* TIR at the top interface. */
402 return one_spectrum();
403 }
404
405 /* Compute optical path difference inside the thin film. */
406 const float OPD = -2.0f * eta2 * thickness * cos_theta_2;
407
408 /* Compute reflection at the bottom interface (film to medium). */
410 -cos_theta_2, eta3 / eta2, r_cos_theta_3, &phi23);
411 if (isequal(R23, one_float2())) {
412 /* TIR at the bottom interface.
413 * All the Airy summation math still simplifies to 1.0 in this case. */
414 return one_spectrum();
415 }
416
417 /* Compute helper parameters. */
418 const float2 T121 = one_float2() - R12;
419 const float2 phi = make_float2(M_PI_F, M_PI_F) - phi12 + phi23;
420
421 /* Perform Airy summation and average the polarizations. */
422 float3 R = mix(iridescence_airy_summation(T121.x, R12.x, R23.x, OPD, phi.x),
423 iridescence_airy_summation(T121.y, R12.y, R23.y, OPD, phi.y),
424 0.5f);
425
426 /* Color space conversion here is tricky.
427 * In theory, the correct thing would be to compute the spectral color matching functions
428 * for the RGB channels, take their Fourier transform in wavelength parametrization, and
429 * then use that in iridescence_lookup_sensitivity().
430 * To avoid this complexity, the code here instead uses the reference implementation's
431 * Gaussian fit of the CIE XYZ curves. However, this means that at this point, R is in
432 * XYZ values, not RGB.
433 * Additionally, since I is a reflectivity, not a luminance, the spectral color matching
434 * functions should be multiplied by the reference illuminant. Since the fit is based on
435 * the "raw" CIE XYZ curves, the reference illuminant implicitly is a constant spectrum,
436 * meaning Illuminant E.
437 * Therefore, we can't just use the regular XYZ->RGB conversion here, we need to include
438 * a chromatic adaption from E to whatever the white point of the working color space is.
439 * The proper way to do this would be a Von Kries-style transform, but to keep it simple,
440 * we just multiply by the white point here.
441 *
442 * NOTE: The reference implementation sidesteps all this by just hard-coding a XYZ->CIE RGB
443 * matrix. Since CIE RGB uses E as its white point, this sidesteps the chromatic adaption
444 * topic, but the primary colors don't match (unless you happen to actually work in CIE RGB.)
445 */
446 R *= make_float3(kernel_data.film.white_xyz);
447 return saturate(xyz_to_rgb(kg, R));
448}
449
MINLINE float safe_sqrtf(float a)
#define X
#define A
ccl_device float3 maybe_ensure_valid_specular_reflection(ccl_private ShaderData *sd, const float3 N)
Definition bsdf_util.h:281
ccl_device_inline float3 iridescence_airy_summation(const float T121, const float R12, const float R23, const float OPD, const float phi)
Definition bsdf_util.h:357
ccl_device float ior_from_F0(const float f0)
Definition bsdf_util.h:166
ccl_device float fresnel_dielectric_cos(const float cosi, const float eta)
Definition bsdf_util.h:86
ccl_device float schlick_fresnel(const float u)
Definition bsdf_util.h:177
ccl_device float F0_from_ior(const float ior)
Definition bsdf_util.h:172
ccl_device_inline Spectrum bsdf_principled_hair_sigma_from_reflectance(const Spectrum color, const float azimuthal_roughness)
Definition bsdf_util.h:302
ccl_device Spectrum fresnel_conductor(const float cosi, const Spectrum eta, const Spectrum k)
Definition bsdf_util.h:114
ccl_device_inline float bsdf_principled_hair_albedo_roughness_scale(const float azimuthal_roughness)
Definition bsdf_util.h:294
ccl_device Spectrum fresnel_iridescence(KernelGlobals kg, float eta1, float eta2, float eta3, float cos_theta_1, const float thickness, ccl_private float *r_cos_theta_3)
Definition bsdf_util.h:380
ccl_device_inline Spectrum fresnel_f82_B(const Spectrum F0, const Spectrum F82)
Definition bsdf_util.h:148
ccl_device_inline Spectrum fresnel_f82_Fss(const Spectrum F0, const Spectrum B)
Definition bsdf_util.h:127
ccl_device_inline Spectrum fresnel_conductor_Fss(const Spectrum eta, const Spectrum k)
Definition bsdf_util.h:157
ccl_device_inline float fresnel_dielectric_Fss(const float eta)
Definition bsdf_util.h:106
ccl_device_forceinline float fresnel_dielectric(const float cos_theta_i, const float eta, ccl_private float *r_cos_theta_t)
Definition bsdf_util.h:69
ccl_device_inline Spectrum iridescence_lookup_sensitivity(const float OPD, const float shift)
Definition bsdf_util.h:345
ccl_device float3 ensure_valid_specular_reflection(const float3 Ng, const float3 I, float3 N)
Definition bsdf_util.h:204
ccl_device_inline Spectrum bsdf_principled_hair_sigma_from_concentration(const float eumelanin, const float pheomelanin)
Definition bsdf_util.h:309
ccl_device_inline float3 refract_angle(const float3 incident, const float3 normal, const float cos_theta_t, const float inv_eta)
Definition bsdf_util.h:78
ccl_device_forceinline Spectrum interpolate_fresnel_color(const float3 L, const float3 H, const float ior, Spectrum F0)
Definition bsdf_util.h:185
ccl_device_inline Spectrum closure_layering_weight(const Spectrum layer_albedo, const Spectrum weight)
Definition bsdf_util.h:322
ccl_device_inline Spectrum fresnel_f82tint_B(const Spectrum F0, const Spectrum tint)
Definition bsdf_util.h:133
CCL_NAMESPACE_BEGIN ccl_device float2 fresnel_dielectric_polarized(float cos_theta_i, const float eta, ccl_private float *r_cos_theta_t, ccl_private float2 *r_phi)
Definition bsdf_util.h:22
ccl_device_inline Spectrum safe_divide_color(Spectrum a, Spectrum b, const float fallback=0.0f)
Definition color.h:388
reduce_max(value.rgb)") DEFINE_VALUE("REDUCE(lhs
dot(value.rgb, luminance_coefficients)") DEFINE_VALUE("REDUCE(lhs
#define kernel_assert(cond)
#define kernel_data
#define ccl_device_forceinline
#define one_spectrum
#define ccl_device
#define M_2PI_F
#define make_spectrum(f)
#define ccl_private
const ThreadKernelGlobalsCPU * KernelGlobals
#define ccl_device_inline
#define M_PI_F
#define cosf(x)
#define expf(x)
#define CCL_NAMESPACE_END
#define saturatef(x)
ccl_device_forceinline float3 make_float3(const float x, const float y, const float z)
ccl_device_forceinline float2 make_float2(const float x, const float y)
#define fabsf(x)
#define sqrtf(x)
uint pos
#define log
#define exp
#define cos
#define sqrt
constexpr T clamp(T, U, U) RET
#define mix(a, b, c)
Definition hash.h:35
@ SD_USE_BUMP_MAP_CORRECTION
@ PRIMITIVE_CURVE
ccl_device_inline Spectrum rgb_to_spectrum(const float3 rgb)
ccl_device_inline bool isnan_safe(const float f)
Definition math_base.h:342
ccl_device_inline float sqr(const float a)
Definition math_base.h:600
ccl_device_inline float inverse_lerp(const float a, const float b, const float x)
Definition math_base.h:507
MINLINE float smoothstep(float edge0, float edge1, float x)
ccl_device_inline float2 one_float2()
Definition math_float2.h:18
CCL_NAMESPACE_BEGIN ccl_device_inline float2 zero_float2()
Definition math_float2.h:13
ccl_device_inline float average(const float2 a)
ccl_device_inline bool isequal(const float2 a, const float2 b)
ccl_device_inline float3 safe_normalize_fallback(const float3 a, const float3 fallback)
ccl_device_inline float3 one_float3()
Definition math_float3.h:24
#define N
#define B
#define R
#define L
#define H(x, y, z)
color xyz_to_rgb(float x, float y, float z)
Definition node_color.h:73
#define I
#define saturate(a)
Definition smaa.cc:315
#define min(a, b)
Definition sort.cc:36
float x
float y
float x
Definition sky_float3.h:27
float3 Spectrum