Luxcore for automotive light simulation

Use this forum for general user support and related questions.
Post Reply
santelelle
Posts: 4
Joined: Fri Feb 08, 2019 9:46 pm

Luxcore for automotive light simulation

Post by santelelle » Sun Feb 10, 2019 9:35 pm

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
Attachments
luxcore basic test 2.blend
(503.09 KiB) Downloaded 21 times

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

Re: Luxcore for automotive light simulation

Post by Dade » Mon Feb 11, 2019 9:13 am

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.
Support LuxCoreRender project with salts and bounties

santelelle
Posts: 4
Joined: Fri Feb 08, 2019 9:46 pm

Re: Luxcore for automotive light simulation

Post by santelelle » Mon Feb 11, 2019 2:10 pm

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

santelelle
Posts: 4
Joined: Fri Feb 08, 2019 9:46 pm

Re: Luxcore for automotive light simulation

Post by santelelle » 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?
Attachments
Cattura.PNG
Cattura2.PNG

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

Re: Luxcore for automotive light simulation

Post by Dade » Mon Feb 11, 2019 2:29 pm

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.
Support LuxCoreRender project with salts and bounties

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

Re: Luxcore for automotive light simulation

Post by Dade » Mon Feb 11, 2019 2:30 pm

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 ?
Support LuxCoreRender project with salts and bounties

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

Re: Luxcore for automotive light simulation

Post by B.Y.O.B. » Mon Feb 11, 2019 2:53 pm

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
Support LuxCoreRender project with salts and bounties

santelelle
Posts: 4
Joined: Fri Feb 08, 2019 9:46 pm

Re: Luxcore for automotive light simulation

Post by santelelle » Mon Feb 11, 2019 4:34 pm

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
Attachments
orthographic.PNG
perspective.PNG
luxcore basic test 3.blend
(503.47 KiB) Downloaded 18 times

CodeHD
Posts: 103
Joined: Tue Dec 11, 2018 12:38 pm

Re: Luxcore for automotive light simulation

Post by CodeHD » Tue Feb 12, 2019 4:13 pm

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 )

Post Reply