UnityURP-MobileScreenSpacePlanarReflection icon indicating copy to clipboard operation
UnityURP-MobileScreenSpacePlanarReflection copied to clipboard

Transparency will render under reflective surface

Open cAyou opened this issue 5 years ago • 6 comments

Hi! I tried to use the reflection shader on a flat surface, and it worked well, but as soon as I popped some particles on top of it they were rendered behind the reflective surface. Is there any way to fix that? Thanks!

Unity 219.4.16f1 (LTS)

Screenshot 2021-01-29 114211

cAyou avatar Jan 29 '21 16:01 cAyou

Maybe it's because of this? image

cAyou avatar Jan 29 '21 16:01 cAyou

yes, you need to edit the draw timing of the reflective surface

ColinLeung-NiloCat avatar Jan 29 '21 19:01 ColinLeung-NiloCat

I tried BeforeRenderingTransparents and it worked well!

cAyou avatar Jan 29 '21 20:01 cAyou

I went a bit too fast here, the result is quite different when using BeforeRenderingTransparents.

AfterRenderingTransparents: image

BeforeRenderingTransparents: image

Edit: I also tried all the other modes, but none worked as expected. Is this even possible? That's a huge problem for the game I want to use it.

cAyou avatar Jan 29 '21 20:01 cAyou

Any idea @ColinLeung-NiloCat ?

cAyou avatar Feb 01 '21 15:02 cAyou

@cAyou SSPR requires DepthTexture(Copy Depth , Event : AfterRenderingSkybox) and OpaqueTexture(Copy Color, Event : BeforeRenderingTransparents). When you set SSPR event to BeforeRenderingTransparents, the pass will execute before copy color, which leads to the black result. You must make sure the copy color pass has been executed before SSPR pass. The easier way is to set the copy color pass execute in AfterRenderingSkybox. image

Serika-Chan avatar Mar 02 '21 03:03 Serika-Chan