Full spectral.

Use this forum for general user support and related questions.
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
Post Reply
Skywise
Posts: 2
Joined: Wed Oct 02, 2019 7:13 am

Full spectral.

Post by Skywise »

Any plans to restore full spectral capabilities to Lux? Way back with LuxRender
that was a major selling point for me to choose it as my render engine of choice.

But I just discovered that the new LuxCoreRender is not fully spectral and only fakes
it.

I only dabble in rendering and was away from it for a few years. Finally getting back
into it. But I only just now noticed the loss of this feature when I decided to
re-create my Pink Floyd prism logo from 12 years ago so I can render it bigger, only
to be stymied why the rainbow was all wonky.

After some quick research I found the discussions on this so just wanted to chime in
and add my voice to those desiring this feature.

I never noticed before on anything else I did, but now that I know, I will always feel
that my images aren't 'perfect', as my interest is in photorealism, and accurate
dispersion is an important element to that.

Brian


LuxRender
LuxRender
LuxCoreRender
LuxCoreRender
bnzs1
Posts: 8
Joined: Sun Jan 20, 2019 9:31 pm

Re: Full spectral.

Post by bnzs1 »

hi
not fully spectral and only fakes it
I wonder what makes you think that?
is there somewhere a table-comparison of some functions that are not supported in the LuxCoreRender?
as opposite i can quote this viewtopic.php?p=15472#p15472 "LuxCore does spectral rendering on demand, only when required, both with BiDir and Path: the end result is the same of old LuxRender but it has far less noise and it is a lot faster"
+
something similar to your statement has already been discussed here
viewtopic.php?t=2255

as well as already is written above:
Please upload a testscene that allows developers to reproduce the problem, and attach some ...
Skywise
Posts: 2
Joined: Wed Oct 02, 2019 7:13 am

Re: Full spectral.

Post by Skywise »

not fully spectral and only fakes it
I wonder what makes you think that?
One of the developers themselves, B.Y.O.B. viewtopic.php?p=4745#p4745: "LuxCore does not support spectral rendering currently. The glass materials uses some tricks to simulate it, which are activated if the "dispersion" value of the glass is greater than 0." and viewtopic.php?p=4756#p4756 "Old "Classic" LuxRender is indeed spectral, but it is no longer developed. The new LuxCore(Render) is currently an RGB renderer."

Also, reference the following Github ticket: Incorrect color spectrum https://github.com/LuxCoreRender/LuxCore/issues/262, which references some specific code as a source of the problem with violet not dispersing/rendering correctly.

And as requested, a sample scene and file.

LaserPrism2.png
LaserPrism2.blend
(1.58 MiB) Downloaded 1305 times

Sample of 'laser' lights going a through a prism and the dispersion hitting a screen. Volume scattering is used to visualize light beams.

The first 7 are lights colored using RGB values in the usual ROYGBIV rainbow. I can forgive the violet/purple one splitting into red and blue as, since it was defined using RGB, how is the render engine to know violet from purple?

The next 14 are emissive light panels. Each is using irregular data to define the spectral output. Each is 10 nanometers wide centered on wavelengths 650nm through 390nm at 20nm intervals.

Note the lack of smooth change in dispersal pattern from left to right. Only that each dispersion is composed of varying intensities of red, green, and blue. Yellow and cyan are absent in the dispersed light, being composed instead of combinations of red/green and green/blue. On the far right where violet is, the dispersion is only blue and dispersion never changes regardless of wavelength. Also note that there is always some red present just past green whenever there is any red involved (notably in orange).

It is quite apparent that the light source spectral data is converted to approximate RGB values, then those RGB values are used to calculate the dispersion disregarding the actual spectral content. The resulting rays are themselves RGB values with no spectral content. Else why would a pure yellow spectral light source disperse into two bands of red and green with no yellow content?

BTW, Blender 4.0.2, LuxCoreBlend 2.8.

Brian
kintuX
Posts: 814
Joined: Wed Jan 10, 2018 2:37 am

Re: Full spectral.

Post by kintuX »

Sad, but true...
User avatar
FarbigeWelt
Donor
Donor
Posts: 1060
Joined: Sun Jul 01, 2018 12:07 pm
Location: Switzerland
Contact:

Re: Full spectral.

Post by FarbigeWelt »

Strange Discussion because here a typical Prism render looks well:
viewtopic.php?t=6105
Light and Word designing Creator - www.farbigewelt.ch - aka quantenkristall || #luxcorerender
MacBook Air with M1
CodeHD
Developer
Developer
Posts: 482
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: Full spectral.

Post by CodeHD »

FarbigeWelt wrote: Sun May 25, 2025 11:55 am Strange Discussion because here a typical Prism render looks well:
viewtopic.php?t=6105
There is nothing strange at all. If you compare the setups in the post you link and the GitBub issue linked above in this thread, you will see they use quite different setup paths.
In the "GitHub-setup" (specifically the sketch and result I present there), it is a symmetric setup: Equilateral prism, light entering and exit at close to the same angle to the respective surfaces.
Consequence of this: Both surfaces contribute equally to the dispersion effect.

I the thread linked by you, the light enters at a steep angle, and the primary dispersion exits basically normal to the surface.
Consequence of this: Only the first surface contributes notably to the dispersion effect.

Another not so obvious side-effect is performance. The more glass surfaces with dispersion a beam goes through, the less effective the rendering will be. For example: randomly drawing a red color at surface 1 leads to RGB value (1,0,0). Randomly drawing green at the second surface leads to RGB (0,0,0) --> The sample is dropped. The more surfaces are involved, the more rays by chance end up black. Just render a laser straight through 30 sheets of glass with IOR like at 1.00001m, thn compare Dipsersion=0 to Diserpsion=0.000001. I.e. A glass that has almost no effect, just enabling/disabling the dispersion mode. File attached
Attachments
Dispersion_inefficiency.blend
(1.11 MiB) Downloaded 189 times
User avatar
FarbigeWelt
Donor
Donor
Posts: 1060
Joined: Sun Jul 01, 2018 12:07 pm
Location: Switzerland
Contact:

Re: Dispersion Inefficiency

Post by FarbigeWelt »

CodeHD wrote: Mon May 26, 2025 8:38 am
FarbigeWelt wrote: Sun May 25, 2025 11:55 am Strange Discussion because here a typical Prism render looks well:
viewtopic.php?t=6105
A glass that has almost no effect, just enabling/disabling the dispersion mode. File attached
I did not understand your attached scene ..

I setup a scene with 15 thin glasses, world, camera, light volume clear with priority 0. A body with material null and volume homogenous with priority 10 multi scattering. A white Laser and a light grey floor. I also setup different materials for the glass to easy switch its properties.
Indeed with some Dispersion Laser intensity drops faster passing several glass bodies than without dispersion. However if glass bodies have 100% reflection even more light gets spread.
No Dispersion, No Reflection, No Floor
No Dispersion, No Reflection, No Floor
No Dispersion, No Reflection, Floor
No Dispersion, No Reflection, Floor
No Dispersion, Reflection, Floor
No Dispersion, Reflection, Floor
Dispersion, Reflection, Floor
Dispersion, Reflection, Floor
Dispersion, No Reflection, Floor
Dispersion, No Reflection, Floor
Test_Dispersive Glass.blend.zip
Scene
(136.14 KiB) Downloaded 192 times
EDIT
If Material Output, Advanced, Shadow is set to Value 1.0 Laser does not transmit what I did not expect.
No Dispersion, No Reflection, Shadow Value 1.0, No Floor
No Dispersion, No Reflection, Shadow Value 1.0, No Floor
Light and Word designing Creator - www.farbigewelt.ch - aka quantenkristall || #luxcorerender
MacBook Air with M1
CodeHD
Developer
Developer
Posts: 482
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: Dispersion Inefficiency

Post by CodeHD »

FarbigeWelt wrote: Mon May 26, 2025 1:36 pm I setup a scene with 15 thin glasses, world, camera, light volume clear with priority 0. A body with material null and volume homogenous with priority 10 multi scattering. A white Laser and a light grey floor. I also setup different materials for the glass to easy switch its properties.
Indeed with some Dispersion Laser intensity drops faster passing several glass bodies than without dispersion. However if glass bodies have 100% reflection even more light gets spread.
I don't see anything in the scene you attached that is a significant difference to my scene. Anyways, you noticed the general point I was making, so I guess we are on the same page.

About the impact of reflection, I don't see anything wrong there. With reflection, less light passes each glass sheet so the intensity drop off is faster. Beyond that, I don't think it is safe to judge at these noise levels.

When I sugested to use an IOR just above 1 (IOR = 1.00...01), that effectively does the same thing: Ensure (almost) no reflection. Additionally it would cause refractions at an angle
For this scene with a laser at 90 degrees to the glass sheets, effectively it is the saem as what you did with the refelction color set to black, so no real difference between your and my setup.
FarbigeWelt wrote: Mon May 26, 2025 1:36 pm EDIT
If Material Output, Advanced, Shadow is set to Value 1.0 Laser does not transmit what I did not expect.
Test_Glasses_noDispersion_noReflection_noShadow_noFloor, Metropolis, 64 Samples.png
Agreed, at first glance I would not expect this either.

Another note: This kind of setup doesn't require BiDir Engine to work. The result should be mostly the same when using light tracing - at least as far as the directly visiable beam is concerned.
However, it is not equivalent, Light tracing seems to make up some energy after several glass sheets when using dispersion.
User avatar
FarbigeWelt
Donor
Donor
Posts: 1060
Joined: Sun Jul 01, 2018 12:07 pm
Location: Switzerland
Contact:

Re: Dispersion Inefficiency

Post by FarbigeWelt »

CodeHD wrote: Mon May 26, 2025 3:51 pm I don't see anything in the scene you attached that is a significant difference to my scene. Anyways, you noticed the general point I was making, so I guess we are on the same page.
I agree mostly. I don't understand your Camera settings. With your scene Final Render renders only a tiny square of the whole scene.
Volume settings are different to my scene. I don't how LuxCore handles External homogenous volumes.
Instead of a scattering volume to show the beam I switched the laser to a narrow area light and moved the floor to intersect with the beam.
Now there isn't much light intensity dropping left. It looks like there is an issue with volumes as you noted in a different post.
Area Light intersecting with Floor
Area Light intersecting with Floor
Test_Dispersive Glass.blend.zip
Updated Scene
(130.54 KiB) Downloaded 189 times
Light and Word designing Creator - www.farbigewelt.ch - aka quantenkristall || #luxcorerender
MacBook Air with M1
User avatar
FarbigeWelt
Donor
Donor
Posts: 1060
Joined: Sun Jul 01, 2018 12:07 pm
Location: Switzerland
Contact:

Re: Full Spectrum Dispersion "missing"

Post by FarbigeWelt »

CodeHD wrote: Mon May 26, 2025 3:51 pm
Another note: This kind of setup doesn't require BiDir Engine to work.
The result should be mostly the same when using light tracing - at least as far as the directly visiable beam is concerned.
Well, for some setups it makes quite a difference whetter one uses BiDir or Path with Light Tracing.:geek:

Back to topic. The light source in this scene is a plane with an emissive matte material. It uses an irregular data set for yellow.
Indeed yellow is simulated as a mixture of green and red. A full spectral renderer wouldn't do that.
BiDir
BiDir
Path and Light Tracing
Path and Light Tracing
Test_Prism_Dispersion.blend.zip
Scene
(134.75 KiB) Downloaded 190 times

Another note:
Unused Material seems to get lost by saving but not their corresponding Nodes. To avoid this lost a fake user (shield) has to be defined for all materials not connected to an object. I may open an issue for that in Github if it is not a standard Blender behavior. :roll:
Loosing Materials but not their Nodes
Loosing Materials but not their Nodes
Light and Word designing Creator - www.farbigewelt.ch - aka quantenkristall || #luxcorerender
MacBook Air with M1
Post Reply