I have enabled volume light on the light source and cast shadows on the fluid actor, but it only casts shadows on itself and not on other actors. What is the problem?
Hi guys, I hope you’re doing well!
This issue was a true challenge to solve, but I may have something. In a nutshell, the fluid generated by a Niagara System is a “heterogeneous volume”, and the shadow casting of such a volume is handled separately from the classical mesh volume. Consequently, there is often a checkbox “Cast Volumetric Shadows” that manages this particular shadow casting, aside from the classical “Cast Shadows”. The tricky detail lies in the Project Settings: do not forget to check “Shadow Casting”, under “Heterogeneous Volumes”, in order to activate this particular shadow casting.
To help you in understanding the solution, here is a minimal example to really get the important settings to set (tested with version 5.7.4 of Unreal Engine). In a brand new blank project:
- In the “Plugins” window, activate the “NiagaraFluids” plugin and restart the project.
- In the content browser, create a new Niagara System using the “Grid3D_Gas_Master_Emitter” template.
- Place the Niagara System within the level as an actor: the shadow is cast only on itself but not on the environment (the main problem).
- In Project Settings, search for “Shadow Casting” (under “Heterogeneous Volumes”) and check it.
- In the Niagara actor settings (the actor selected in the level, NOT the emitter of the Niagara System selected in the content browser), search for “Cast Shadow” (under “Lighting”) and check it.
- Let the smoke shadow fly!
Note:
The cast shadow is the one generated by the default Directional Light. To make the shadow cast by any other light (Point Light, Spot Light, Rect Light), ensure to check ALL following settings in the light details:
- “Cast Shadows”.
- “Cast Dynamic Shadows”.
- “Cast Volumetric Shadows”.
All these settings are indeed checked by default for the Directional Light, but “Cast Volumetric Shadows” is not for the other light types.
Summary:
- In Project Settings, check “Shadow Casting” (under “Heterogeneous Volumes”).
- In the Niagara actor settings, check “Cast Shadow” (under “Lighting”).
- In the light actor settings, check “Cast Shadows”, “Cast Dynamic Shadows”, and “Cast Volumetric Shadows”.
Hope this will help, and have a lovely day!
