Amplify Shader ZTest

Your feedback is very important to us. We are listening.

Amplify Shader ZTest

Postby londonstevey » Tue Oct 09, 2018 10:28 am

Hi, I've just downloaded the Amplify Shader for Unity and am loving it its so easy to use!
I'm creating a skiing game, where I have a slope with one material on a mesh, I've placing another mesh with a track on it over the top.This sits flush with the slope mesh, and has no collider. Because its so close to the below mesh I get flickering from the ZTest. Is there a way of creating a shader that will use the ZTest less than... but shift the test value by a small amount, so the track will always be on top? I've tried using the Offset Factor and Units but this seems to move the rendered material up. I want it to stay in the same place, but just always win the ZTest fight with the below mesh.
Thanks!
Attachments
amplifyshadertest.JPG
You'll see my attempt using offset, which then moves the material above the gate a bit
amplifyshadertest.JPG (59.32 KiB) Viewed 2694 times
londonstevey
 
Posts: 4
Joined: Tue Oct 09, 2018 10:15 am

Re: Amplify Shader ZTest

Postby Amplify_Borba » Tue Oct 09, 2018 10:56 am

Hello, thank you for getting in touch and for your support!

Have you tried setting the different Render Queue values for the track and the mesh on the material?

The track would have its value set higher so that it would be rendered later on, and you can offset it through the shader using the 'Queue Index' parameter or set it in the material itself:

Image

Image

In the above setup, setting the shader's 'Queue Index' to 1 and compiling would in turn have the material's Render Queue value set to 2001, for example.

You could also consider slightly moving the track away from the mesh, in a way that it would be nearly unnoticeable.

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


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests