Prism Caustics

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.
Starjukker
Posts: 5
Joined: Thu Apr 28, 2022 9:18 pm

Prism Caustics

Post by Starjukker »

Hello!
I've been trying to figure out volumes and caustics in LuxCore for the past week or so but nothing seems to work in my case.
I have a scene with a simple prism and a laser: a classic dispersion scene. I have two issues with it though:
  • The reflected light from the glass is much brighter than the light emitted from the laser (to the point where it's always pure white and overexposed). The emitted light is fuzzy and creates a lot of noise while the reflected light is pure and really looks like a laser.
  • The SDS issue where I don't see the light inside the prism. I tried using Bidir, enabling caustics cache, using volumes, not using volumes, but nothing seems to work. The only hack I could come up with is to clip the top face and literally look inside, but it's only that: a hack (not shown on the attached render).
Prism Test.png
Please help me figure out what I'm doing wrong and teach me the ways of LuxCore.
Thank you!
Attachments
Tiangle_prism.blend
(933.12 KiB) Downloaded 121 times
CodeHD
Donor
Donor
Posts: 437
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: Prism Caustics

Post by CodeHD »

Hi,

There are two parts to your laser not being visible before the prism:
1) You need a more elaborate volume assignment. Currently you only have asigned interior volumes to the bounding cube and the prism. Howver, you need to at least (in this case) also specify an exterior volume to the prism. LuxCore determines the volume always from the object that a ray hits. So the first ray hits the prism, the prism has no exterior volume defined, so there is not scattering.
2) For some reason I never fully understood (or bothered to folow up), the first ray of light tracing is not visible. So you need to place a thin slab of glass directly in front of the lasers.

For the SDS issue, cache should be the only working "proper" solution, but it still takes long to render. See if you get results with a better volume setup first.
p1.png
p2.png
epilectrolytics
Donor
Donor
Posts: 790
Joined: Thu Oct 04, 2018 6:06 am

Re: Prism Caustics

Post by epilectrolytics »

As already mentioned above, a proper volume setup is crucial.
- homogenous volume with scattering and IOR>1 assigned via pointer as interior to the prism
- homogenous volume with scattering and IOR=1 assigned via pointer as exterior to the prism, as interior to the volume cube and also checked for the laser
- choose BiDir engine with metropolis sampling, only fast way to render the primary laser beam
- choose PhotonGI caustic cache for SDS inside glass, setup is tricky because somehow the checkboxes are missing with BiDir engine:
switch to path engine and check PhotonGI cache for the glass volume, uncheck for cube volume, then switch back to BiDir
- SDS is the bottleneck and needs sample step=1 and large values for size and photon count but small values for lookup
- make cube and prism smaller for less volume to calculate, also reduce path depth for slight speedup.

still the whole thing renders slowly...
EDIT: Increasing scattering scale of glass volume to 0.25 speeds up the render, but the higher the scale, the "foggier" the glass.
screenshot.jpg
Tiangle_prism2.blend.zip
(112.41 KiB) Downloaded 138 times
Last edited by epilectrolytics on Sat Apr 30, 2022 9:38 am, edited 1 time in total.
epilectrolytics
Donor
Donor
Posts: 790
Joined: Thu Oct 04, 2018 6:06 am

Re: Prism Caustics

Post by epilectrolytics »

CodeHD wrote: Sat Apr 30, 2022 7:25 am 2) For some reason I never fully understood (or bothered to folow up), the first ray of light tracing is not visible.
It is a very improbable path for eye tracing:
- a scatter event needs to happen right inside the laser beam (from random distribution in the whole volume area)
- the scattering angle must point right to the laser (small area of the scattering sphere)

Therefore only light tracing as with BiDir or forced by your trick with the glass will do.
Path CPU wit metropolis sampling will also render the primary ray albeit slowly.
Starjukker
Posts: 5
Joined: Thu Apr 28, 2022 9:18 pm

Re: Prism Caustics

Post by Starjukker »

Thank you very much for the detailed replies, I really appreciate it!
Starjukker
Posts: 5
Joined: Thu Apr 28, 2022 9:18 pm

Re: Prism Caustics

Post by Starjukker »

epilectrolytics wrote: Sat Apr 30, 2022 8:10 am As already mentioned above, a proper volume setup is crucial.
- homogenous volume with scattering and IOR>1 assigned via pointer as interior to the prism
- homogenous volume with scattering and IOR=1 assigned via pointer as exterior to the prism, as interior to the volume cube and also checked for the laser
- choose BiDir engine with metropolis sampling, only fast way to render the primary laser beam
- choose PhotonGI caustic cache for SDS inside glass, setup is tricky because somehow the checkboxes are missing with BiDir engine:
switch to path engine and check PhotonGI cache for the glass volume, uncheck for cube volume, then switch back to BiDir
- SDS is the bottleneck and needs sample step=1 and large values for size and photon count but small values for lookup
- make cube and prism smaller for less volume to calculate, also reduce path depth for slight speedup.

still the whole thing renders slowly...
EDIT: Increasing scattering scale of glass volume to 0.25 speeds up the render, but the higher the scale, the "foggier" the glass.
The attachment screenshot.jpg is no longer available
Tiangle_prism_Attempt_2.blend
(924.26 KiB) Downloaded 105 times
So I tried recreating the scene you attached from scratch and it still doesn't work somehow. There is something I'm missing I'm sure, but I tried everything, it seems, nothing helps.
Also, your post says "check PhotonGI cache for the glass volume, uncheck for cube volume" but it's the other way around in the scene you attached. Anyway, either way doesn't work for me.
Tiangle_prism_Attempt_2.blend
(924.26 KiB) Downloaded 105 times
epilectrolytics
Donor
Donor
Posts: 790
Joined: Thu Oct 04, 2018 6:06 am

Re: Prism Caustics

Post by epilectrolytics »

Starjukker wrote: Fri May 13, 2022 5:43 pm So I tried recreating the scene you attached from scratch and it still doesn't work somehow.
In your file the photon cache is not checked for the glass volume.
Somehow you cannot see this with BiDir engine so switch to path engine first.
Now you can see the "use PhotonGI Cache" checkbox in the volume node:
screenshot1.jpg
Check that box and the beam inside the glass will appear:
screenshot2.jpg
When you switch to BiDir again the setting will stay even without the checkbox displayed:
screenshot3.jpg
(scattering scale raised to 0.3 for faster rendering)
Starjukker
Posts: 5
Joined: Thu Apr 28, 2022 9:18 pm

Re: Prism Caustics

Post by Starjukker »

epilectrolytics wrote: Sat May 14, 2022 3:08 pm Now you can see the "use PhotonGI Cache" checkbox in the volume node:
All this time I thought you meant the checkbox in the advanced menu of the material output node, which is greyed out for Bidir. I got it to work now, thanks a lot for your help!
epilectrolytics
Donor
Donor
Posts: 790
Joined: Thu Oct 04, 2018 6:06 am

Re: Prism Caustics

Post by epilectrolytics »

Starjukker wrote: Mon May 16, 2022 6:43 amthe checkbox in the advanced menu of the material output node
This activates cache entries on the material surface, which is independent from volume entries controlled by the checkbox in the volume node.
The invisibility or grayed-out display of those settings in BiDir is a bug IMHO.
Martini
Posts: 125
Joined: Fri Nov 23, 2018 11:36 am
Location: Australia

Re: Prism Caustics

Post by Martini »

epilectrolytics wrote: Mon May 16, 2022 11:13 am
Starjukker wrote: Mon May 16, 2022 6:43 amthe checkbox in the advanced menu of the material output node
This activates cache entries on the material surface, which is independent from volume entries controlled by the checkbox in the volume node.
The invisibility or grayed-out display of those settings in BiDir is a bug IMHO.
The bug:
https://github.com/LuxCoreRender/BlendL ... issues/773

The fix:
https://github.com/LuxCoreRender/BlendLuxCore/pull/774


Now instead, you get a warning telling you to enable PhotonGI Cache if it's not enabled:
Image


And if it is enabled, you can use it!
Image


:D
AMD Ryzen Threadripper PRO 5995WX 64-Cores | 2x Gigabyte RTX 4090 Gaming OC
ASUS Pro WS WRX80E-SAGE SE WIFI | 256GB Kingston Server Premier ECC Unbuffered DDR4
Post Reply