Hello.
Let me start off by saying I am pretty new to shaders and Amplify Shader. I am trying to modify the XRay shader that comes with the examples in the Unity package. My goal is to make a shader that has the xray effect on objects that are behind other objects, but renders nothing if the object is not behind other objects. I have a non-Amplify shader that works like this, but I'm trying to get better at using Amplify, so I want to replicate this in my Amplify shader.
Any help would be appreciated!
Thanks.
Help with XRay Shader
- Amplify_Borba
- Posts: 1239
- Joined: Mon Jul 24, 2017 9:50 am
Re: Help with XRay Shader
Hello, thank you for getting in touch and for your support!
It's possible to achieve the effect you intend with some tweaks to the XRay sample, however, you must first update ASE to the latest build currently available on our website, due to a recent bug fix that can cause the following setup to throw an error.

You'll have to set the Blend mode to Custom, Type and Queue to Transparent, in order to enable the Opacity port.
Then proceed to remove the Outline node, connect its Color input to the Emission port and the Alpha to the Opacity port.
Make sure that the Blend RGB is set to Alpha Blend, and within the Depth tab set the ZWrite Mode to Off, ZTest Mode to Greater or Equal, and turn off the Extra Depth Pass.
Please let me know if this helps, thanks!
It's possible to achieve the effect you intend with some tweaks to the XRay sample, however, you must first update ASE to the latest build currently available on our website, due to a recent bug fix that can cause the following setup to throw an error.

You'll have to set the Blend mode to Custom, Type and Queue to Transparent, in order to enable the Opacity port.
Then proceed to remove the Outline node, connect its Color input to the Emission port and the Alpha to the Opacity port.
Make sure that the Blend RGB is set to Alpha Blend, and within the Depth tab set the ZWrite Mode to Off, ZTest Mode to Greater or Equal, and turn off the Extra Depth Pass.
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!
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
-
alex.turner
- Posts: 2
- Joined: Mon Jul 09, 2018 10:13 pm
Re: Help with XRay Shader
Thank you so much! That works exactly how I expect it to. I really appreciate the quick response!
- Amplify_Borba
- Posts: 1239
- Joined: Mon Jul 24, 2017 9:50 am
Re: Help with XRay Shader
Glad we could help!
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!
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!
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!