More Fluorescence
A Fluorescent Material Model for Non-Spectral Editing & Rendering
Thursday 9am - 10:30amWest Building, Rooms 301-305

Spectrum Li(Ray ray, Sampler sampler)
{
/* Intersect scene with ray and obtain surface BSDF */
BSDF bsdf;
/* Only highlighting BSDF sampling strategy */
[...]
// Sample the outgoing direction
ray.wo = bsdf.sample(ray.wo, sampler);
// Sample the outgoing wavelength
// Consumes one random number
ray.wavelength = bsdf.rerad.sample(ray.wavelength, sampler);
return Li(ray, sampler)
}
def ReduceRerad(R: np.array):
S = CMF('XYZ_CIE_2006.csv') # (N,3)
Sb = np.linalg.pinv(S @ S.T) @ S # (N,3)
r = S.T @ R @ Sb # (3,3)
return r
Color DirectLi(Ray ray, Sampler sampler)
{
/* Intersect scene with ray and obtain surface BSDF */
BSDF bsdf;
/* Direct illumination only samples the light */
Color l = sample_light(ray.wo, ray.p, sampler);
/* Matrix multiplication using HLSL syntax */
Color li = mul(bsdf.rerad, l);
return li;
}
def MatrixFromVector(r : Vector):
# Build a 3D tensor from a triplet basis (3 x 3 x 3)
R = np.concatenate([
(S.T @ np.diag(S[:,0]) @ Sb)[..., None],
(S.T @ np.diag(S[:,1]) @ Sb)[..., None],
(S.T @ np.diag(S[:,2]) @ Sb)[..., None]
], axis=-1)
return R @ r