Hello,
I've been adding some simple fog code to all my shaders for my current project, and I've been successful up until now when I'm trying to add it to my billboarded trees.
Through debugging I'm getting this really weird phenomenon.
in my pixel shader when I have the code
BBPixelToFrame BillboardPS(BBVertexToPixel PSIn) : COLOR0
{
BBPixelToFrame Output = (BBPixelToFrame)0;
Output.Color = tex2D(textureSampler, PSIn.TexCoord);
float4 dullColor2 = float4(.875f, 0.95f, .973f, 1);
float Distance = .5f; //ordinarily it would be distance(xCamPos,PSIn.Position) or something and I would divide and clamp it
Output.Color = lerp(Output.Color, dullColor2,Distance);
return Output;
}
It shades the Trees Fine
However when I change "float Distance = .5f;" to "float Distance = (1/2)" it doesn't shade the images at all.
BBPixelToFrame BillboardPS(BBVertexToPixel PSIn) : COLOR0
{
BBPixelToFrame Output = (BBPixelToFrame)0;
Output.Color = tex2D(textureSampler, PSIn.TexCoord);
float4 dullColor2 = float4(.875f, 0.95f, .973f, 1);
float Distance = (1/2);
Output.Color = lerp(Output.Color, dullColor2,Distance);
return Output;
}
This makes no sense to me.... as this has never been a problem in my other shaders
-Thanks for any help,
Justin