Spectral light and dispersion

Use this forum for general user support and related questions.
Post Reply
maxbraun
Posts: 2
Joined: Mon Nov 05, 2018 2:12 am

Spectral light and dispersion

Post by maxbraun » Mon Nov 05, 2018 3:17 am

Hi!

I've been working on an optical simulation where I'm sending a beam of light through a hole and then a prism to capture its dispersion. This has been working pretty well with LuxCoreRender and Blender. See the attached test render and nodes for the prism material. The lamp is currently an area lamp (with the laser setting on) and I'm using the bidirectional path tracer engine.

Now I would like to modify the lamp to use a custom spectrum. For example, I would like to get the effect that if I define a spectrum where there's no emission above 600 nm, the red part of the rainbow would disappear.

Is this behavior generally possible with LuxCoreRender, ideally from Blender? I found a few references that sounded like what I'm looking for, but I haven't been able to get it to work.

Is the right approach to define texture nodes on the lamp or not use a lamp at all and emit light from an object? I'm not sure how to do the former. For the latter, I was able to create a material using Irregular Data and Emission nodes and place an object where the light would be, but that seems to make the dispersion disappear altogether.

Thanks for any pointers!

Max
Attachments
spectrum.png
prism_nodes.png

User avatar
FarbigeWelt
Posts: 302
Joined: Sun Jul 01, 2018 12:07 pm
Location: Switzerland
Contact:

Re: Spectral light and dispersion

Post by FarbigeWelt » Mon Nov 05, 2018 7:38 am

There are different ways. What about defining RGB = 0,1,1 instead 1,1,1. Or use another node as color input e.g. Lights>Irregular Spectrum.
Microsoft Windows 10 Professional, intel i7 4770K, 32 GB, AMD R9 290x 4 GB, AMD R9 390x 8 GB
Instagrammer, please join #luxcorerender for your renderings.

User avatar
Dade
Developer
Posts: 1458
Joined: Mon Dec 04, 2017 8:36 pm

Re: Spectral light and dispersion

Post by Dade » Mon Nov 05, 2018 9:07 am

maxbraun wrote:
Mon Nov 05, 2018 3:17 am
Now I would like to modify the lamp to use a custom spectrum. For example, I would like to get the effect that if I define a spectrum where there's no emission above 600 nm, the red part of the rainbow would disappear.
LuxCoreRender does wave length related interactions "on-demand" (so it is not technically a full spectral render). At the moment, the only wave length related interaction has been implemented for glass dispersion.

However, for defining a spectrum with no emission above 600nm, the solution suggested FarbigeWelt should work: just use a an irregular data texture node (with a table of emissions for each wave length) as input of the light "color".
Support LuxCoreRender project with salts and bounties

User avatar
B.Y.O.B.
Developer
Posts: 1730
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Spectral light and dispersion

Post by B.Y.O.B. » Mon Nov 05, 2018 9:52 am

Since the laser light is not texturable, you will have to use a plane mesh (so you can use material nodes to do what Dade said).
However, a mesh light does not emit parallel light rays, so you will have to build a mesh tube around it.
Here is a thread with a file which was created for old LuxRender (you will have to re-create the materials, but you can see how to model the light and tube around it): http://www.luxrender.net/forum/viewtopi ... ser#p66844
I'm also attaching the file here in case the old forum goes down again.
Attachments
laser.zip
(155.86 KiB) Downloaded 4 times
Support LuxCoreRender project with salts and bounties

User avatar
Dade
Developer
Posts: 1458
Joined: Mon Dec 04, 2017 8:36 pm

Re: Spectral light and dispersion

Post by Dade » Mon Nov 05, 2018 10:25 am

B.Y.O.B. wrote:
Mon Nov 05, 2018 9:52 am
However, a mesh light does not emit parallel light rays, so you will have to build a mesh tube around it.
Using theta parameter of area light (and BiDir rendering), it should emit parallel rays :idea:
Support LuxCoreRender project with salts and bounties

User avatar
B.Y.O.B.
Developer
Posts: 1730
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Spectral light and dispersion

Post by B.Y.O.B. » Mon Nov 05, 2018 12:03 pm

Here's an example scene (using a foggy world volume to show the beam).
Attachments
2018-11-05_13-01-46.png
meshlight_laser.blend
(1.26 MiB) Downloaded 6 times
Support LuxCoreRender project with salts and bounties

maxbraun
Posts: 2
Joined: Mon Nov 05, 2018 2:12 am

Re: Spectral light and dispersion

Post by maxbraun » Thu Nov 08, 2018 5:31 am

Thanks for all the replies! I think I got what I was going for.

The crucial missing piece was that it seems like the Spread Angle in the Emission node needs to be set to exactly 0. Otherwise the dispersion just doesn't show up. I attached a new test render and the material nodes I used.

A few more things I was wondering about:
  • What kind of interpolation is used for the Irregular Data, between the data points and outside of the specified range?
  • Is the Irregular Data vector being normalized or used unmodified?
  • Using material emission as the light source seems to work just fine, but in case I wanted to do the same thing using a lamp, how would I go about that? I don't see a Show Nodes button like when I set the material on an object.
  • I would like to figure out how to use not only perfectly straight rays so that the left and right side of the rainbow become softer. How could I modify the light source to do that?
Attachments
blue.png
material_nodes.png

User avatar
B.Y.O.B.
Developer
Posts: 1730
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Spectral light and dispersion

Post by B.Y.O.B. » Thu Nov 08, 2018 9:13 am

maxbraun wrote:
Thu Nov 08, 2018 5:31 am
Using material emission as the light source seems to work just fine, but in case I wanted to do the same thing using a lamp, how would I go about that? I don't see a Show Nodes button like when I set the material on an object.
You can't use a lamp.
LuxCore's light sources are not node based, apart from the mesh light.
And since an area lamp is exactly the same as a mesh light, I decided it was not worth the effort to create a "use nodes" option for area lamps.
Support LuxCoreRender project with salts and bounties

Post Reply