source icon indicating copy to clipboard operation
source copied to clipboard

Supporting florescence.

Open CnlPepper opened this issue 8 years ago • 0 comments

Was racking my brains how to cleanly support florescence in a new redesign of the core of the ray tracer. The issue is the bsdf gains an extra dimension - for a given incoming and outgoing direction the bsdf is now a matrix of energy transferred and absorbed between incoming and outgoing wavelengths:

  • For non-florescent materials only the diagonal is populated.
  • Florescent material have off diagonal terms, but the matrix is generally sparse

Do not want to pass around a matrix or submatrix. Only wish to importance sample regions where florescence exists.

Propose to add a new method to materials like the sample direction for BSDFs that does the equivalent for wavelength e.g. wavelength(incoming_spectrum) and it returns a spectrum object defining the range to sample ith the next ray in the path. Most normal materials will just return the incoming spectrum.

The proposed spectrum sample must only be a shifted by delta_wavelength * N to keep the spectral quantisation consistent (maybe - need to think about this more). Or maybe we modify ray to hold the wavelength full range of the simulation in addition to the range it is sampling so the material can select a new wavelength range inside the full range. This last ideas means a UV florescence simulation would need a wavelength range set into the UV, even if the observer does not measure UV directly.... need to think if this is necessary... probably not.

All ideas, need to do a bit of maths and see if this all works.

CnlPepper avatar Oct 05 '17 20:10 CnlPepper