Skip to main content
gamedev.net
🔒 Locked

Shadow Map

Started by KDSBest Apr 7, 2007 at 11:32 AM 0 replies 1.1k views
Original Post
KDSBest
KDSBest
Hi, i rendered my shadow map with that shaders.

void main(	in float4 position : POSITION,
		out float4 positionOUT : POSITION,
		out float3 lightVector : TEXCOORD0,
		uniform float4 lightPosition,
		const uniform float4x4 model_view_projection_matrix)
{
	positionOUT = mul(model_view_projection_matrix, position);
	lightVector = lightPosition.xyz -  (position.xyz);
}

void main(
		in float4 positionOUT : POSITION,
		in float4 lightVector : TEXCOORD0,
		out float4 color : COLOR
)
{
	float fDepth = dot(lightVector, lightVector);
	color = float4(floor(fDepth) / 256.0, frac(fDepth), frac(fDepth), frac(fDepth));
}
The Result looks like this: http://img404.imageshack.us/img404/9282/shadowmapft0.jpg It is just a plane on the floor and a cube nearer to the light. Is this right??? Because my calculation is wrong. I rendered 6 sides with my FBO Cube Map and do everything like GPU Gems said. My only Question is: Is the look of the Shadow map Right??? If No, what can be wrong? [Edited by - KDSBest on April 7, 2007 12:43:17 PM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.