how to NOT render behind geometry using the same shader

Node-based Shader Editor

how to NOT render behind geometry using the same shader

Postby Snatcher » Mon Aug 13, 2018 6:45 pm

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)
Snatcher
 
Posts: 2
Joined: Mon Aug 13, 2018 6:31 pm

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

Postby Amplify_Borba » Tue Aug 14, 2018 9:01 am

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!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

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

Postby Snatcher » Tue Aug 14, 2018 11:37 am

Thanks for the quick response! that was exactly was i was looking for.
Snatcher
 
Posts: 2
Joined: Mon Aug 13, 2018 6:31 pm

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

Postby Amplify_Borba » Tue Aug 14, 2018 2:09 pm

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!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am


Return to Amplify Shader Editor

Who is online

Users browsing this forum: No registered users and 0 guests

cron