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

Effects are visible through the water surface #698

Open
Einheit-101 opened this issue Nov 11, 2018 · 8 comments
Open

Effects are visible through the water surface #698

Einheit-101 opened this issue Nov 11, 2018 · 8 comments
Labels
bug Something isn't working
Milestone

Comments

@Einheit-101
Copy link

Einheit-101 commented Nov 11, 2018

Describe the bug
This old rendering bug is annoying for a long time now. Effects ignore the water in front of them.

To reproduce

  1. Go to editor
  2. Go into water
  3. crun x, y, z = getElementPosition(me) createEffect("prt_bubble", x, y, z-1, 0, 0, 0, 2000)
  4. See bubbles being drawn in front of water

Expected behaviour
Effects should render correctly

Screenshots
image

Multi Theft Auto v1.5.6-release-15932 (Windows)

Additional context
Is there maybe a shader that can be applied to effects textures that fixes this issue?

@Wolfee-J
Copy link

This is due to the rending order.

@botder botder added the bug Something isn't working label Nov 13, 2018
@AlexTMjugador
Copy link
Member

If what CodyJL said is right, maybe using setWaterDrawnLast makes a difference?

@Einheit-101
Copy link
Author

No! Effects are still in front of water with setWaterDrawnLast(true)

@Einheit-101
Copy link
Author

Einheit-101 commented Nov 27, 2018

Creating a simple shader and adding this code into the main pass does actually solve this issue:
ZEnable = true;
ZWriteEnable = true;
ZFunc = 4;

...however since water is now writing to depth buffer, it causes zfighting with anything that is close and planar to it (including boat wake and other water effects).

image

I think the final solution would be applying another shader to these water effects (duh...) that gives them so much depth bias that they will draw on top of the water surface...

@Wolfee-J
Copy link

Can you check if that shader fixes the bug of not being able to see water through car windows @Einheit-101

@Einheit-101
Copy link
Author

Einheit-101 commented Nov 27, 2018

Sure. It doesnt fix the issue.
Default GTA Water with simple zWriteEnable shader:

image

Water still not visible through car window, but water surface can be illuminated by dynamic lighting

Complex water shader with zWriteEnable = same.

image

Water doesnt just refuse to render through car windows, actually it doesnt render through vehicles at all.
image

@Wolfee-J
Copy link

Alright, reconfirms my belief that SAs rendering order is crap.

@Einheit-101
Copy link
Author

setWaterDrawnLast on top of this shader doesnt work either. It looks like the water is simply culled away. Yes, GTA render order is messed up.

@botder botder added this to the Backlog milestone Mar 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants