• Create Account

### #Actuald0nuts

Posted 22 January 2013 - 09:47 AM

Sorry for the confusion. Let me try rewording it. With the simplest shader just outputing a color, it fills the screen. But when I project the points by multiplying by the modelviewproj and check if they are within the bounds of the screen, only the top corner projects into this range. Am I misunderstanding something about projection?

And I tried this fragment shader with just pass-through texture coordinates and am still getting all black.

ShadowVisualDataPixelOutput ret;

float depth = tex2D(depthTex, pdi.texture).x;
if (depth == 0.0f) {
ret.color = float4(0,0,0,0);
return ret;
} else {
ret.color = float4(depth, depth, depth, 1);
return ret;
}

### #1d0nuts

Posted 22 January 2013 - 09:46 AM

Sorry for the confusion. Let me try rewording it. With the simplest shader just outputing a color, it fills the screen. But when I project the points by multiplying by the modelviewproj and check if they are within the bounds of the screen, only the top corner projects into this range. Am I misunderstanding something about projection?

And I tried this fragment shader and am still getting all black.

ShadowVisualDataPixelOutput ret;

float depth = tex2D(depthTex, pdi.texture).x;
if (depth == 0.0f) {
ret.color = float4(0,0,0,0);
return ret;
} else {
ret.color = float4(depth, depth, depth, 1);
return ret;
}

PARTNERS