Quantcast
Channel: Questions in topic: "hlsl"
Viewing all articles
Browse latest Browse all 206

HLSL Shader gives error, output parameter 'Direction' not completely initialized

$
0
0
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.

Viewing all articles
Browse latest Browse all 206

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>