Render queue on Shader Graphs seems to be ignored
I am trying to make a simple material that makes an outline effect. My plan is to have a smooth version of 3D models that are supposed to have this material. Because they are smooth - they have no duplicate vertices - they can be scaled up with a material / shader without artifacts. The outline model is, of course, supposed to be rendered before the main model. The main model is supposed to be rendered on top of the outline. I don't think there exist a way to change default Render queue for a Shader Graph, but there is a property for changing Render queue on materials made with Shader Graphs, but it doesn't seem to change anything. The outline model has the correct shape and size, but I can't get it to be rendered before the main model. How do I change the order the models are rendered? The outline model has been moved for illustration purposes. In shader programming, there is the ZWrite On/Off, which I can't find a way to change that either in Shaderlab. I think Render queue has precedence over ZWrite anyway.
Anything shader/graphics related you gotta ask on forum.
btw if you look through Unity Default shader code on archive. You might find what you are looking for.
Answer by LeonardNS · Oct 08, 2018 at 12:17 PM
This might not be very helpful for others later, but I managed to solve the problem. I took the autogenerated shader from ShaderForge and manually changed 'Cull Back' to 'Cull Front', aka 'hide front faces'. When the two objects are in the same place this will give the outline effect.
Your answer
Follow this Question
Related Questions
Unity equivalent to glDepthMask or alternative? 0 Answers
Outline on Sprite Mask when switching from Discard to Alpha 1 Answer
Shader with BW gradient mask and cutoff for projector 0 Answers
Shadowcaster Fragment Shader Discard 0 Answers
What is the best way to make grass shader only effective where near the camera? 0 Answers