Page 1 of 1

how to NOT render behind geometry using the same shader

PostPosted: Mon Aug 13, 2018 6:45 pm
by Snatcher
Hi, im making a stylized water shader based on the ASE template, everything is looking great, my problem is that if a mesh is behind other water mesh, they both render and the opacity adds, so it looks brighter.
I remember the old "Water4" shader from unity, and this doesnt happen i think, if a mesh is over other with the same shader, it only renders de nearest to the camera.
Example: Image
How can i fix this with ASE? (sorry if this is a simple thing, im starting with shaders)

Re: how to NOT render behind geometry using the same shader

PostPosted: Tue Aug 14, 2018 9:01 am
by Amplify_Borba
Hey there, thank you for getting in touch and for your support!

Although I'm not familiar with the mentioned water shader, you may achieve this by setting a higher Render Queue on what you wish to be drawn later, so in this situation the plane that is behind would have it's value higher so it's rendered after the one on top, effectively eliminating that blend.

In the example below, both surfaces use the same shader and have a different material, so they can hold different settings, and I've left the top one's Render Queue at its default value of 3000, setting the one below to 3001.

Image

Please let me know if this helps, thanks!

Re: how to NOT render behind geometry using the same shader

PostPosted: Tue Aug 14, 2018 11:37 am
by Snatcher
Thanks for the quick response! that was exactly was i was looking for.

Re: how to NOT render behind geometry using the same shader

PostPosted: Tue Aug 14, 2018 2:09 pm
by Amplify_Borba
Glad to be of assistance!

Have you had the chance to rate and review Amplify Shader Editor? It would be awesome if you could share your experience with the Unity community, the Unity Asset Store thrives on user interaction and direct feedback.
Every bit helps, your feedback is extremely valuable to us!

Feel free to get back in touch if you have any further questions, thanks!