Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transparency will render under reflective surface #4

Open
cAyou opened this issue Jan 29, 2021 · 6 comments
Open

Transparency will render under reflective surface #4

cAyou opened this issue Jan 29, 2021 · 6 comments

Comments

@cAyou
Copy link

cAyou commented Jan 29, 2021

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
Copy link
Author

cAyou commented Jan 29, 2021

Maybe it's because of this?
image

@ColinLeung-NiloCat
Copy link
Owner

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

@cAyou
Copy link
Author

cAyou commented Jan 29, 2021

I tried BeforeRenderingTransparents and it worked well!

@cAyou cAyou closed this as completed Jan 29, 2021
@cAyou cAyou reopened this Jan 29, 2021
@cAyou
Copy link
Author

cAyou commented Jan 29, 2021

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
Copy link
Author

cAyou commented Feb 1, 2021

Any idea @ColinLeung-NiloCat ?

@Serika-Chan
Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants