I am not new to unity but i have very VERY little experience with the shaders in unity and this question probably has a simple answer. i am trying to have two skyboxes blend together as time passes and to do this i need to connect a day cycle code’s “timeOfDay” variable with the “_Blend” property in the shader. my problem is that i need to place code into the shader and by looking at examples im pretty sure you need to start the code with “CGPROGAM” and end it with “ENDCG” but whenever i place “ENDCG” it gives me the error Parse error: Syntax error, unexpected “}” but whenever i remove whatever the error is it gives me another one, either attacking another bracket or attacking the fallback.
Shader "Custom/SkyboxFading" {
Properties
{
_Tint ("Tint Color", Color) = (.5, .5, .5, .5)
_Tint1 ("Tint Color one", Color) = (.5, .5, .5, .5)
_Tint2 ("Tint Color two", Color) = (.5, .5, .5, .5)
_Blend ("Blend", Range(0.0, 1.0)) = 0.5
_Skybox1 ("Skybox one", Cube) = ""
_Skybox2 ("Skybox two", Cube) = ""
}
SubShader
{
Tags { "Queue" = "Background" }
Cull Off
Fog { Mode Off }
Lighting Off
Color [_Tint]
Pass
{
SetTexture [_Skybox1] { combine texture }
SetTexture [_Skybox2] { constantColor (0,0,0,[_Blend]) combine texture lerp(constant) previous }
SetTexture [_Skybox2] { combine previous +- primary, previous * primary }
}
CGPROGRAM
ENDCG
}
Fallback "Custom/Skybox", 1
}
this is whats causing the problem. i have no code in between the CG’s but it was causing the problem even when the code was there.