I’ve been following a tutorial over a cel shader and I’ve been getting an error that only I seem to have. The error says,
Shader error in 'Master': 'MainLight_float': output parameter 'Direction' not completely initialized at Assets/Shaders/Lighting.hlsl(1) (on glcore)
The function MainLight_float looks like this:
void MainLight_float(float3 WorldPos, out float3 Direction, out float3 Color,
out float DistanceAtten, out float ShadowAtten)
{
#ifdef SHADERGRAPH_PREVIEW
Direction = normalize(float3(0.5f, 0.5f, 0.25f));
Color = float3(1.0f, 1.0f, 1.0f);
DistanceAtten = 1.0f;
ShadowAtten = 1.0f;
#else
float4 shadowCoord = TransformWorldToShadowCoord(WorldPos);
Light mainLight = GetMainLight(shadowCoord);
Direction = mainLight.direction;
Color = mainLight.color;
DistanceAtten = mainLight.distanceAttenuation;
ShadowAtten = mainLight.shadowAttenuation;
#endif
}
I have no idea what to do, as it definitely looks completely initialized to me. Help would be appreciated.