Page 1 of 1

Luxcore for automotive light simulation

Posted: Sun Feb 10, 2019 9:35 pm
by santelelle
Hi all,

I'm trying to use luxcore engine to simulate how the light is distributed using various shapes of trasparent plastic (as in moder cars lights).

In order to better understand the light behaviours, i would like to see how a single laser beam behave (visualizing also it's path in both air and plastic).
I found this forum thread viewtopic.php?f=4&t=573 but I cannot reproduce it in an easy way.

My problem is that I cannot see how light move inside the plastic part (IOR 1.5).
As far as I have understood the right setup for this should be:

engine bidir with metropolis sampler, orthographic camera

-single laser beam
-glass material
-interior volume with scattering (IOR1.5) [glass volume]
-exterior volume with scattering (IOR1.0) [dust volume]
-camera volume set to [dust volume]
-world volume set to [dust volume]

In this way I can only see the light (with correct reflection and refraction) outside the plastic part, and not inside (image1).
Image

I could find a workaround using a cube with inner volume set to [dust volume] and touching the plastic part on the front part. The other settings remain unchanged. In this way i could achieve (image2), but I'm not sure it's the right way to do this. There is also a dark area in the first refraction that seems strange to me. There is a screeshot where the larger cube is the [dust volume].
Image
Image

What I'm doing wrong?
You can find attached also the blender file.

Thanks for the help,
Emanuele

Re: Luxcore for automotive light simulation

Posted: Mon Feb 11, 2019 9:13 am
by Dade
santelelle wrote: Sun Feb 10, 2019 9:35 pm In this way I can only see the light (with correct reflection and refraction) outside the plastic part, and not inside (image1).
This is a limitation of BiDir, it can not render SDS (Specular-Diffuse-Specular) paths. BiDir is unable to connect the light exiting from the the glass (i.e. specular surface) directly to the camera.

You need BiDir with VM (Vertex Merging) or the upcoming PhotonGI caustic cache to be able to render the laser inside the glass.

However there is a little dirty trick you can use to work with plain BiDir: just delete the the glass surface facing the camera, this will transform the paths form SDS in just SD (indeed, remove also the dust box). The result will be:

laser.jpg
The idea is that will be like if the camera was inside the glass (because the rays will never hit the exit surface) so you will be able to see the green laser.

Re: Luxcore for automotive light simulation

Posted: Mon Feb 11, 2019 2:10 pm
by santelelle
Thank you very much Dade!

Is "BiDir with VM" already available? Because I cannot find where to enable it in blender.

I really like the trick you proposed, but it can cause some problems in my setup because I would loose some reflections if the lights are not planar with the removed face. Anyway it's very helpful in the current situation.

Many thanks,

Emanuele

Re: Luxcore for automotive light simulation

Posted: Mon Feb 11, 2019 2:21 pm
by santelelle
Edit: If I render with the cube without the frontal face it's correctly rendered with green color. If I use the real time rendered view the color become purple. Is the real time render view reliable?

Re: Luxcore for automotive light simulation

Posted: Mon Feb 11, 2019 2:29 pm
by Dade
santelelle wrote: Mon Feb 11, 2019 2:10 pm Is "BiDir with VM" already available? Because I cannot find where to enable it in blender.
There is an experimental version but is unsupported (and hidden in Blender as you have noticed). I would avoid it. The under construction v2.2 with PhotonGI may be a better long term solution.
santelelle wrote: Mon Feb 11, 2019 2:10 pm I really like the trick you proposed, but it can cause some problems in my setup because I would loose some reflections if the lights are not planar with the removed face. Anyway it's very helpful in the current situation.
There may be another trick you could use: try to place the camera near clipping plane to "cut" the front face. By doing different renderings, with different distances of the near clipping plane, you can have different slice views. It would be like doing a CAT (computerized axial tomography) of the simulation.

Re: Luxcore for automotive light simulation

Posted: Mon Feb 11, 2019 2:30 pm
by Dade
santelelle wrote: Mon Feb 11, 2019 2:21 pm Edit: If I render with the cube without the frontal face it's correctly rendered with green color. If I use the real time rendered view the color become purple. Is the real time render view reliable?
The preview is usually done with path tracing, have you switched to BiDir the preview mode too ?

Re: Luxcore for automotive light simulation

Posted: Mon Feb 11, 2019 2:53 pm
by B.Y.O.B.
His preview is using Bidir, it's in the stats on the top of the screenshot.

Also don't forget the arbitrary clipping plane: https://wiki.luxcorerender.org/BlendLux ... ping_Plane

Re: Luxcore for automotive light simulation

Posted: Mon Feb 11, 2019 4:34 pm
by santelelle
Found a weird thing,

If I witch from orthographic view to perspective view the color of the scattering passes from purple to green (the right scattering colour should be green).

In the render, both camera type give me the right green scattering. There is something strange also in the Gain parameter of the camera for the orthograpic, I have to set it very low (0.0001) in order to obtain a good image, but with low gain I see nothing in the real time rendering (the auto brightness is of course disabled)

Not a big problem anyway :)

Thanks,
Emanuele

Re: Luxcore for automotive light simulation

Posted: Tue Feb 12, 2019 4:13 pm
by CodeHD
Hi santelelle,

You could also check out the following threads for some helpful info. There might be more in the forum but I just remember these because I was active in them ;)

viewtopic.php?f=4&t=793
viewtopic.php?f=4&t=801
viewtopic.php?f=4&t=791

Your last post sounds a bit like what I worte in the second link above (which I never followed up I just realised :D )