I have the following shader configuration code :
uint gBlendValue = 0xffffff00; Terrain.Effect.GetVariableByName("gBlendValue").AsScalar().Set(gBlendValue); And I have the following shader code :
// extract blend weights from gBlendValue - produces bVn values in the range [0,1] float bV1 = ((gBlendValue >> 24) & 0xff)/255.0; float bV2 = ((gBlendValue >> 16) & 0xff)/255.0; float bV3 = ((gBlendValue >> 8) & 0xff)/255.0; float bV4 = (gBlendValue & 0xff)/255.0; // sum lerped blends float3 finalColor = float3(0,0,0); finalColor += lerp(float3(0,0,0), float3(1,0,0), bV1); finalColor += lerp(float3(0,0,0), float3(0,1,0), bV2); finalColor += lerp(float3(0,0,0), float3(0,0,1), bV3); // return finalColor return float4(finalColor,1); But this doesn't behave as expected. The geometry is a dark red, when it should be white. What the turtle is going on here.