Hallo, first of, i just started to learn shader graph and visual effects graph.
I was making a visual effect that uses a voronoi shader i made with shader graph.
At first everything worked fine, till i reached a point where i change the color of the Visual effect at runtime via code(even when giving the very same hdr color).
When i do it in the inspector it does not happen.
When i do that, the Alpha seems to become much lower to the point where it becomes barly visible.
For debugging purposes i put my shader on a simple plane (without the visual effect). There it also looks really pale from the start.
So it seems the Visual effects graph increases the Alpha of the shader, but loses that when changing the color via script.
Left side(no change to the color). Right side after giving the Viusal Effect the exact same color via script.
Here is the color that i use:
The visual effect part that uses the voronoi shader just makes 1 constant particle quad and only alter the size, rotation and gives a exposed variable to change the color
The Shader
Is there some setting that would make the shader look the same on a plane, in the visual effect or after changing the color at runtime via script?
[ColorUsageAttribute(true,true)]
public Color swirl;
public void _myFunction()
{
visualEffect.SetVector4("SwirlColor", swirl);
}
I’m using Unity 2023.2.2f1