Water shader rendering on top of Sprite3D
Asked Answered
D

3

0

Hello, hope you guys are doing ok.

I am trying to render a Sprite3D (for some popups like "Talk to this NPC"), and for some reason, the water shader that I am using is rendering on top of the Sprite3D.

I tried to set the Alpha Cut of the Sprite3D and it kinda works but looks terrible.

Alpha cut set to discard:

Alpha cut set to opaque prepass:

Default:

Does anyone have any idea on how to fix this? Am I just dumb?

Debauch answered 8/12, 2021 at 11:14 Comment(0)
A
0

Try to increase sprite material's Render Priority value. Make it larger than water material's priority.

Altruist answered 8/12, 2021 at 11:23 Comment(0)
D
0

I created the material inside the Material Override property in the Sprite3D, set the Albedo Texture to use a ViewportTexture.

After some tweaking it seems to be working, it's just blurring now because of the DOF, but that's on me haha

I tried to remove the ViewportTexture from the Sprite3D Texture property, but it stopped working. Is this correct?

Anyway, thanks for pointing me in the right direction =)

Debauch answered 8/12, 2021 at 11:44 Comment(0)
A
0

I made a typo in the above post. Typed 'increate' instead of 'increase'

The thing is, when you have two (or more) materials that have transparency in them, the engine can get confused over what to render first. By setting their Render Priority properties to different values, you can specify the display order of such objects (larger priority renders over lower priority). Since you always want the sprite to be drawn over everything else, you should set its Render Priority to the highest value.

Altruist answered 8/12, 2021 at 12:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.