Page 1 of 1

Amplify Shader ZTest

PostPosted: Tue Oct 09, 2018 10:28 am
by londonstevey
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!

Re: Amplify Shader ZTest

PostPosted: Tue Oct 09, 2018 10:56 am
by Amplify_Borba
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!