Quick Set-up for HLSL
Info
The HLSL setup is identical to what we did in ShaderGraph setup;
-
Create Texture2D
-
Change reference name to have prefix '_BakeGrad_'
-
Make the shader use the custom editor "EvernullTools.GradientGUI"
-
Use it as any other Gradient Texture
Shader "Unlit/gradientInputTutorial"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_BakeGrad_GradientTexture ("Texture", 2D) = "white" {}
// -------> This texture has the prefix '_BakeGrad_' <-------
}
SubShader
{
Tags { // ... some shader tags ... // }
LOD 100
Pass
{
CGPROGRAM
{
// ... some shader code ... //
return color;
}
ENDCG
}
}
CustomEditor "EvernullTools.GradientGUI"
// -------> Shader is using CustomEditor: "EvernullTools.GradientGUI" <-------
}