Material Property Attributes
This isn’t documented yet. Shader Graph now allows you to set property attributes and take advantage of built-in and custom property drawers.
This includes:
Enum - Makes a float display as a drop down, by either providing a list of label/value pairs, or a C# Enum type.
IntSlider / PowerSlider, changes the behavior of a Slider (float).
Read Only - this sets a [PerRendererData] attribute on the property and make it appear read-only.
Custom Attributes - allows setting custom attributes to use custom property drawers. Check out the samples for examples.
Dynamic Keywords
You can now set the declaration type of a Keyword to “Dynamic”, and greatly reduce the number of shader variants when the cost of branching is low.
All this is already available in 6000.2.0a10.
Your feedback is very welcome.
Thanks.
I would really love if we could hide settings like “show if” or such to make the inspector nicer.
Also please add a nicer styling for fold-out with a border around the group so things can be more separated
Also adding a Note or better tooltip options would be really helpful. Remember shaders are tool to be used for the team. I need ways to explain and make the GUI as polished and understandable as possible.
What we want the most from Shader graph itself is:
An easy way to access the AO Pass if possible, that would open up a lot of possibilities for better graphics
Working examples of Biplanar mapping, to prevent the large overhead from triplanar mapping. The biplanar sample seemed to break with unity 6. Unreal is now implementing dithered triplanar mapping which just requires 1 sample. Working on terrain shaders this will be a godsend.
A normal from height node which dosn’t have the pixelization artefact from DDX/DDY(?) making it unusable
Knowing in which context a node is not available. Depth only available before transparent or however it works should be explained and blocked in the wrong context.
@AndreaGalet We are still working on Shader Graph 2, and yes, it’s using Graph Toolkit.
@EricFFG Thank you for the great suggestions. Happy to report that many of these are already in various stages of development and will be coming in future releases.
I also would like to suggest to handle gradients with a bit more grace.
having them only as static structs in the shader is nice for quick tests but in real world application its quite cumbersome and involves either building a custom gradient node or too much photoshop fondling just to get the color values right. It’s one of those small annoying things that just add up to be frustrating over time. I know that would involve some serious work but maybe for SG2?
In the MaterialPropertyDrawer sample, there’s also an example of a HelpBox PropertyDecorator that adds a HelpBox above a property. We don’t have any means to specify a tooltip in ShaderLab at the moment, but improvements in this area are under consideration.
I’m going to open a new thread dedicated to customizing Material Editor.
Yes, like @BenCloward said, we are working on SG2 and will share more information when we can.
SG2 is not only a complete rewrite of Shader Graph using Graph Tool Kit (GTK), but also leverages Block Shaders. Indeed, forward compatibility, while not trivial, is high on the priority list.
Now, to share some thoughts on our prioritization strategy. We appreciate that SG1 is what you, the users, are using today, and will be using for some time until SG2 eventually reaches feature parity and is considered the default. So while we won’t invest engineering time in adding features we already have in SG2 – like portals – we still want to improve with SG1, for it gives us the opportunity to deliver improvements sooner in every version.
This sets requirements for SG2, helps us evaluate UX design challenges early on, and allows us to take your feedback, all while improving your experience.
Thanks for your feedback. We do have plans for this.
Ah no, that’s an ambiguous term.
Portals are also called get/set nodes. They help making graphs cleaner.
Regarding Stencil Buffer, it is supported in the Fullscreen targets (both URP and HDRP) but missing from other targets. While adding support for Stencil settings to material targets (Unlit, Lit) is sttill under consideration, most of what can be done with this can already be done using RenderObjects Renderer Feature (URP), or DrawRenderers Custom Pass (HDRP), without the complexity and limitations of using the Stencil Buffer.
We do appreciate that in some cases Stencil settings are useful nonetheless. It’s why it’s still on the roadmap.
Get / Set is the most important feature for shader graph, nothing else comes even close.
Ive already given up with the hope, not having it for all these years is just ridiculous.
Seeing the Lit shader example remade in SG from the Unity shader sample should have been the final wake up call, its such a horrible mess. Do we really have to wait for Shader graph 2 to have basic organization?
These are the types of things where people go “Did anyone ever test this with a real production example”. It cant be so hard to pass through a variable through 2 nodes but if nobody ever makes a shader large enough to need it at unity, then its no surprise it dosn’t get added in years.
Im sorry for this tone but this is just so detached from reality.
It like if C# was not allowing to wrap code in functions, its just insane.
I appreciate your concerns.
We will soon share some news about more improvements, some of which will make it easier to organize your work in Shader Graph.
Thanks for your feedback.
PLEASE stop saying this. I keep seeing Unity employees parroting this but it’s 100% inaccurate. Utilizing the stencil buffer for the purposes of masking various effects is enormously more efficient than executing an entire second render pass for the same effects. Stop suggesting it as an alternative, as it is so much slower it should be criminal to even make the comparison. Just implement stencils! Shaderlab supports it!
Thank you for the update. Are there any thoughts to adding an orientation overlay in the Shader Graph main preview? When previewing changes is would be helpful to see how the mesh is currently oriented especially since the mesh can be rotated with the main preview.