ColinLeung-NiloCat/UnityURP-MobileScreenSpacePlanarReflection

Transparency will render under reflective surface

cAyou opened this issue · 6 comments

cAyou commented

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 commented

Maybe it's because of this?
image

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

cAyou commented

I tried BeforeRenderingTransparents and it worked well!

cAyou commented

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
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