When using a Single Layer Water Shader, a common issue you'll experience is with Directional Light casting harsh shadows from nearby geometry. These shadows appear incorrectly on the water plane, creating an unnatural effect.
In this post, I'll show you how to fix this. We'll explore the setup, analyze the issue and provide step-by-step solutions, including ray-traced shadows, alternative lighting methods, and configuration tweaks.
When a Directional Light casts shadows onto a water plane that uses Single Layer Water Material - blocky, hard shadows appear on the water surface, which shouldn't happen.
Water is semi-transparent, so harsh shadows from geometry should not be visible on its surface.
To diagnose the problem, let's review the setup:
The issue comes from the Directional Light. It doesn't seem to handle shadows correctly on top of Single Layer Water shader.
Below are 3 solutions to address this problem.
Using Ray Traced shadows resolves the issue by accurately rendering shadows on the water plane, ensuring the water behaves as expected without harsh shadows.
Select the Directional Light in your scene. In the light's properties, locate the "Cast Ray Trace Shadows" setting (under the "Ray Tracing" category). Change it from "Use Project Settings" to "Enabled."
This immediately corrects the shadow issue, allowing the water to appear transparent where shadows previously appeared.
You can enable Ray Trace Shadows Globally. Go to Edit > Project Settings and search for "Ray Tracing".
Enable the "Ray Trace Shadows" option.
This applies Ray Trace shadows across the project, ensuring consistent behavior for all Directional Lights.
Note: an RTX-compatible graphics card is required for Ray Tracing and Ray Tracing must be enabled in the project settings.
With ray-traced shadows enabled, the water plane no longer shows harsh shadows from nearby geometry, behaving as expected. This is the most effective solution for projects that support ray tracing.
Since the Directional Light causes the issue, one solution is to eliminate it and use interior lights, such as point lights, rectangle lights, or spotlights, which work correctly with Single Layer Water shaders.
This approach restricts your lighting design, as Directional Lights are essential for outdoor scenes. Use this solution only when interior lighting is sufficient for your scene.
Another alternative is to replace the Directional Light with a Sky Light using an HDRI (High Dynamic Range Image) to light the scene. This eliminates the shadow issue while providing natural lighting.
Delete the directional light from the scene then add or select a Sky Light in your scene.
Disable "Realtime Capture" in the skylight settings and set the "Source Type" to "SLS Specified Cubemap." Then choose an HDRI cube map to light the environment.
The HDRI-lit scene eliminates harsh shadows on the water plane, provides realistic reflections and maintains a natural look. This solution doesn't require Ray Tracing to be used.
Another viable option is to soften shadows by adjusting the Directional Light Source Angle.
Select the Directional Light and increase the "Source Angle" property. Higher values soften contact shadows on Static Meshes.
The only problem is it doesn't soften the shadows on the water plane. You'll need to enable 3 console commands.
Here is how.
Close your project in the editor. In the Epic Games Launcher, go to the Library tab, right-click your project, and select "Show in Folder."
Navigate to the Config folder and open DefaultEngine.ini (make a backup first).
Locate the last r. console command (e.g., r.LumenHardware).
Add the following three commands below it:
Save the file and reopen your project.
Increase the source angle again to see softer shadows on both Static Meshes and the water plane.
Limitations: This solution only works for shallow water, where the bottom surface (e.g., landscape or static mesh) is visible.
Harsh shadows persist on deeper water, making this a limited fix.
For the best results, enable Ray Traced Shadows if your hardware supports it.
If not, consider HDRI lighting or interior lights to achieve realistic water rendering.
For shallow water, tweaking the source angle with console commands can be a quick fix. Experiment with these solutions to find the best fit for your scene.
If you liked the environment assets that were used in this tutorial, take a look at Environment Asset Pack: UE5 Modular Infinity Tiled Rooms and Pools Environment.
This is a very easy-to-use modular UE5 environment asset pack of interior tiled rooms and pools.It will allow you to create variety of interior liminal space layouts and change their visual look with 58 unique Static Meshes and 9 different Material Instances using UE5.
Home Terms of Use/Trademarks/Disclaimers Privacy Policy Donate About Contact
All content on this website is copyrighted ©2008-2024 World of Level Design LLC. All rights reserved.
Duplication and distribution is illegal and strictly prohibited.
World of Level Design LLC is an independent company. World of Level Design website, its tutorials and products are not endorsed, sponsored or approved by any mentioned companies on this website in any way. All content is based on my own personal experimentation, experience and opinion. World of Level Design™ and 11 Day Level Design™ are trademarks of AlexG.
Template powered by w3.css