Arnklit / Waterways

A tool to generate river meshes with flow and foam maps based on bezier curves.
https://github.com/Arnklit/WaterGenGodotDemo
MIT License
1.05k stars 72 forks source link

Issue with transparent objects #9

Closed Mercadud closed 3 years ago

Mercadud commented 3 years ago

Describe the bug Inability to see transparent objects in front of Water/Lava

To Reproduce Steps to reproduce the behaviour:

  1. create an object with the transparent flag checked
  2. add the river node behind and make it whatever shape you want
  3. in-game the parts of the transparent mesh that are in front of the river doesn't seem to be visible, but the rest should be fine

Expected behaviour the transparent mesh is supposed to show as expected, transparent

Screenshots expected (view from editor): image current issue (in-game): image

Environment

thanks in advance

Mercadud commented 3 years ago

update: I think it depends on which direction you look at the object it rebecomes visible depending on which angle you look at it. might be because of the surrounding objects tho

Arnklit commented 3 years ago

I believe this is as expected. The lava is being rendered as a transparent object, to be able to do depth effects. so if you want transparent objects to display correctly in front of it you'll have to check "Depth Draw Mode -> Opaque Pre-Pass" on the material. Or if it's a custom shader, add the "depth_draw_always" render_mode.

Mercadud commented 3 years ago

changing the Depth Draw Mode to Opaque Pre-Pass on the object in front doesn't seem to have the desired effect.

Arnklit commented 3 years ago

You might have to set the render priority of your transparent material to something higher that 0 for it to render in front of the lava as well.

Mercadud commented 3 years ago

ok perfect that works, for the people that are having the same issue:

  1. Depth Draw Mode -> Opaque Pre-Pass
  2. make render priority higher than the river