Generating Ray-Traced Caustic Effects in Unreal Engine 4, Part 1

Originally published at: https://developer.nvidia.com/blog/generating-ray-traced-caustic-effects-in-unreal-engine-4-part-1/

Caustics are common optical phenomenon in the real world. From the sloshing sparkles by water surfaces to the curved highlights in the backlight of clear glass, they are everywhere. However, simulating accurate caustic in 3D graphics is not an easy job. For those who have been involved in creating ray tracers, you might know that…

  • If you get a 404 error when visiting the github NVRTX_Caustics repo, please ensure that you have signed in github and registered your github account at UE official page:

It will grant you the access to Epic’s official UE4 repos and NVIDIA’s folks.

  • The NVRTX_Caustics branch of UE4 is based on the UE4.25.3 NVRTX branch. The upgrade for 4.25.4 and 4.26 will be available soon.

  • The sample scenes used in this post can be found at the following places:

Executable demos: https://drive.google.com/drive/folders/10MRz-_jcL5pxotvJAXD46Cik6Bm2bo9g

Assets and projects: https://drive.google.com/drive/folders/1p_gx2_WvyRL7smwcsGy6ja8NQTqe_J02

If you have any question on the algorithms, source, performance and usages of mesh caustics, please ask here.

3 Likes

Do you have any plans to fix the bug that translucent objects are displayed incorrectly in reflections?
And what about ray tracing subsurface scattering?
Looking forward to your reply. Thx!

To show translucent objects in reflections, you can use the following command lines to enable full binary tree of reflection+refraction bounces, which allow the refractions to be seen in reflections:

  • r.RayTracing.Reflections.ReflectedTranslucencyMode - Sets the method to render the reflected translucent objects (default 0)
    • 0 - emissive only
    • 1 - enable shading
    • 2 - enable shading & refraction
    • 3 - enable shading, refraction & absorption
  • r.RayTracing.Reflections.ReflectedTranslucencyMaxBounces - Sets the maximum number of ray traced translucency bounces (default 8)
  • r.RayTracing.Reflections.ReflectedTranslucencyTransmissionThreshold - Stops ray traced translucency process if the accumulated transmission is lower than this threshlod (default 0.1)

Ray tracing subsurface scattering is still under researching stage. We are working behind it now.

1 Like

Has anyone seen this make error before with the NvRTX_Caustics-4.26 branch?

What could be the fix?

[2/613] Compile Module.Engine.35_of_48.cpp
In file included from /mnt/2.26/Engine/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/Engine/Module.Engine.11_of_48.cpp:11:
/mnt/2.26/Engine/Source/Runtime/Engine/Private/Components/LightComponent.cpp:321:4: error: field ‘bTiledDeferredLightingSupported’ will be initialized after field ‘bAffectWaterCaustics’ [-Werror,-Wreorder-ctor]
, bTiledDeferredLightingSupported(false)
^

Ubunbtu Linux Kernel 5.4.0-66-generic
NVIDIA Driver Version: 460.73.01
CUDA Version: 11.2, and an RTX 3090

Thanks in advance,
Gregory

Reporting back that building on Windows with different hardware produces the exact same errors. I wonder how people are successfully building this?