Hi I'm getting an error in one my pixel shaders, implicit truncation of vector type.
Here is the code causing the error:
float3 colour = 0;
float3 ppColour = SceneTexture.Sample(PointSample, ppIn.UV);
float4 col = SceneTexture.Sample(PointSample, ppIn.UV);
float intensity = 0.0f;
float r = SceneTexture.Sample(PointSample, ppIn.UV).r;
float g = SceneTexture.Sample(PointSample, ppIn.UV).g;
float b = SceneTexture.Sample(PointSample, ppIn.UV).b;
float a = SceneTexture.Sample(PointSample, ppIn.UV).a;
intensity = r + g + b + a;
if (intensity > 5.0f)
{
for (int count = 0; count < 13; count++)
{
colour += SceneTexture.Sample(TrilinearSampler, ppIn.UV + PixelKernel[count] * BlurStrength) * BlurWeights[count];
}
return float4(colour, 1.0f);
}
return float4(ppColour, 1.0f);
If I comment out intensity = r + g + b + a; then the project compiles. Can anyone see what I'm doing wrong, thanks.
colour += SceneTexture.Sample(TrilinearSampler, ppIn.UV + PixelKernel[count] * BlurStrength) * BlurWeights[count];
tocolour += SceneTexture.Sample(TrilinearSampler, ppIn.UV + PixelKernel[count] * BlurStrength).
xyz* BlurWeights[count];
– Qwrk