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.03k stars 68 forks source link

Water shader does not work with an orthogonal camera #8

Closed kelteseth closed 3 years ago

kelteseth commented 3 years ago

Describe the bug Buggy rendering in our Global Game Jam project: https://gitlab.com/kelteseth/globalgamejam2021

To Reproduce Steps to reproduce the behavior:

  1. Go to Camera and change it to orthogonal camera

Expected behavior A clear and concise description of what you expected to happen. Water shader

Screenshots If applicable, add screenshots to help explain your problem.

grafik orthogonal camera: grafik

Environment

Thanks! ❤

Arnklit commented 3 years ago

Hmm interesting, never tested it with the orthogonal cameras. I guess the depth tests I perform for the water are acting incorrectly in ortho.

I can have a look at this tomorrow morning and see if it's possible to make a variant of the shader that fixes this.

Arnklit commented 3 years ago

Turned out to be a pretty easy fix. The fix is in the dev branch.

Simply replace the river.shader file in your addons/waterways/shaders folder with this one:

https://github.com/Arnklit/Waterways/blob/dev/addons/waterways/shaders/river.shader

Or just replace your entire Waterways add-on folder with a copy of the add-on downloaded from the dev branch:

https://github.com/Arnklit/Waterways/tree/dev

If you could let me know if it works alright I would really appreciate it.

kelteseth commented 3 years ago

@Arnklit thanks works wonderful 🐱‍🏍✨✨✨ grafik

Arnklit commented 3 years ago

Awesome. Your game looks amazing!