Orthographic depth
Posted: Tue Feb 19, 2019 4:17 am
Hi there,
I'm trying to recreate a toon water shader that uses depth for the water colour and edge foam but I'm having some issues using it with an orthographic camera.
https://roystan.net/articles/toon-water.html https://github.com/IronWarrior/ToonWate ... ter.shader
When in perspective mode it looks like the depth texture is getting fetched correctly
The rear plane is actually angles underneath the water, and the tilemap underneath that has a missing tile hence the large dar square.
However in orthographic mode it looks like the depth map needs some kind of transform done to it, rather than the plane of water having a linear color it fades in the z axis when there is nothing underneath it.
I've read a couple of posts on here that say I should not convert the depth texture to linear (as it already is linear), I am also adjusting the clipping planes to bring the texture resolution up. I've also tried adding some controls to my shader to adjust the clipping plane and depth but I still think the problem lies in the Z axis.
Here's my node graph:
Any advice on how to get this working in orthographic perspective?
Many thanks,
Edd
I'm trying to recreate a toon water shader that uses depth for the water colour and edge foam but I'm having some issues using it with an orthographic camera.
https://roystan.net/articles/toon-water.html https://github.com/IronWarrior/ToonWate ... ter.shader
When in perspective mode it looks like the depth texture is getting fetched correctly
The rear plane is actually angles underneath the water, and the tilemap underneath that has a missing tile hence the large dar square.
However in orthographic mode it looks like the depth map needs some kind of transform done to it, rather than the plane of water having a linear color it fades in the z axis when there is nothing underneath it.
I've read a couple of posts on here that say I should not convert the depth texture to linear (as it already is linear), I am also adjusting the clipping planes to bring the texture resolution up. I've also tried adding some controls to my shader to adjust the clipping plane and depth but I still think the problem lies in the Z axis.
Here's my node graph:
Any advice on how to get this working in orthographic perspective?
Many thanks,
Edd