Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Strange shadow rendering issue when world-space UI element is visible (URP)
#2
(29-10-2020, 01:04 PM)Softscale Wrote: I'm in the process of upgrading a project to use URP, and ran into an odd issue with the fluid renderer - the shadows received by the fluid seem to render differently depending on whether there is a world-space UI element like image, text, button, etc. visible to the camera.

I noticed this in a project with Obi 5.6, Unity 2019.4.13f1, and URP 7.5.1, but confirmed that it also occurs on the latest versions (Unity 2020.1.11f1, URP 8.2.0).

I was able to recreate this in a new project, see a video showing the issue here:
https://i.imgur.com/UQhTqK3.mp4

To recreate this:
- make a solver and fluid emitter with default values (unchecking "Render" on the ObiParticleRenderer).
- create a Canvas with a render mode of World Space, and give it at least one child UI element like a Text. Make sure this text field is visible somewhere in the scene.
- set the Environment Lighting Source to Gradient or Color, instead of Skybox.
- in the ObiFluidRendererFeature, set Transparency to something less than 1. In the demo video, I set Transparency to 0. I had also set the Ambient Multiplier to 6 to exaggerate the effect, but it seems to occur whenever the Ambient Multiplier is non-zero.

The bug seems to be related to ambient lighting - when any camera (editor or game) has a world-space UI element within its view, any shadows falling on the fluid are tinted with the selected ambient color for the scene, but otherwise are very dark.

Hi,

Will try to reproduce this and get back to you. The fluid shaders take ambient lighting, including any attenuation due to shadows, from Unity's own shader API (not calculating it ourselves), so chances are this is a bug in URP rather than the fluid renderer.

This is what the shader does to get ambient lighting:
Code:
half3 ambient = SampleSH(worldNormal) * _AmbientMultiplier;

_AmbientMultiplier is a material parameter, and SampleSH() is implemented by the URP, so it's a black box for us. Whatever color is returned by this function is used as the ambient color.
Reply


Messages In This Thread
RE: Strange shadow rendering issue when world-space UI element is visible (URP) - by josemendez - 29-10-2020, 01:54 PM