Search Issue Tracker
By Design
Votes
0
Found in [Package]
7.3.1
Issue ID
1238959
Regression
No
Gradient property can't be Exposed from the ShaderGraph
How to reproduce:
1. Open the attached GradientPropertyShaderGraphBug.png project
2. Go to the Project window-> open Issue.shadergraph
Actual: Inspect that there is no way to Expose Issue shader graph Gradient property (see the GradientPropertyShaderGraphBug.png attached in. the Edit section)
Expected: It is possible to Expose Gradient property
Reproducible with: 2019.3, 2020.2
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Profiler - Taking you to the wrong section when using 'show'
- Draw Renderers custom pass doesn't work with SSGI
- WebCamTexture does not set the requested resolution when used in WebGL
- Editor default Stylesheet/Matching Selector buttons in Debugger don't do anything
- Graphics.DrawMeshNow stops rendering Render Texture after a few frames when viewed in the Player
Llockham-Industries
Nov 11, 2021 03:28
As a workaround, you can always generate a 1px tall, x pixels wide texture to represent a gradient, then pass that to the shader. Then you would sample the texture using the x-co-ord, like you would a gradient.
It's an additional texture sample, which isn't ideal, but it's easy to setup. Wouldn't be difficult to write an editor script to generate a texture out of a Unity gradient either. Then you would just have a collection of them on hand to re-use as desired. You could even organise them in the project like you would other assets.
It can also optionally benefit from mipmaps. So if you have fine bands of color in your gradient that might appear noisy/cause aliasing from a distant, these can be blurred out/softened as the camera gets further from the rendered object. This can be turned of in the textures settings though too.
mitaywalle
Sep 27, 2021 08:02
https://gist.github.com/mattatz/a8c697e212b653ca9ce966797bb93a3c
Noizedrop
Aug 31, 2021 18:14
this kind of destroys the whole purpose of having gradients... you could do extremly smart shaders that are not a hell to maintain
AndrewStyan
Aug 21, 2021 02:26
Damn. Why is this property not exposed?
Neogene
Feb 25, 2021 07:51
The only way to customize it using exposed properties in shader graph is:
1) use a black/white gradient
2) create n exposed color inputs
2) multiply the sample gradient output with these colors using "mask" to define in with area use the proper color.
This adds complexity to the shader, it was so simply to expose but dunno why they decided to do this.
Nodrap
Jul 17, 2020 14:15
Well this is a real slap in the face. Is it by design or unavailable by another parts design? I cannot believe that someone "designed" it to not be exposed as it is clearly a gap in the usually user friendly functionality of Unity.
Perhaps the bug is the issue tracker should have another category of resolution as saying this is "by design" must surely be wrong and no better than ignoring Unity's users.