The RFL file format was used by Wavefront's Advanced Visualizer software to store "spectral curve data", which is essentially a way to encode the response of a material to different wavelengths of light.
The docs for the MTL file format frequently refer to this format, but never seem to include the documentation for the format.
To that end, I have acquired some sample files in this format and will attempt to document the format based on what I see in the samples.
RFL files are plain-text, ASCII-encoded files.
Blank lines, and lines starting with #
or !
are ignored.
Each entry in an RFL file consists of two numbers, separated by whitespace and terminated by a new line:
- A wavelength of light, in nanometres, usually seen as an integer but quite possibly accepting any decimal number.
- A floating point number indicating the relative response to that kind of light. For RFL files used for materials, this value seems to be constrained to the range 0.0 to 1.0. For RFL files used for light sources, the value can exceed 1.0.
Example:
450 .470
450nm light bounces off this surface retaining 47% of its brightness.
If you have a wavelength of light which doesn't have its own entry, you could interpolate the nearby entries to find a suitable value. (Simple linear interpolation is probably good enough?)
A couple of files contain the following extra entries:
n .44
k 3.2
Because they are named n
and k
it is almost certainly relating to the
refractive index, but the problem is, the refractive index differs at
different wavelengths, so it is impossible to make good use of the data.