0
\$\begingroup\$

When I try to divide my position.z by my position.w in HLSL I get as result always 1.0f or higher. Is this a common problem for some reason? When I divide my position.x or y by the w this works fine. But the divide for the z gives a wrong result. I use the view matrix for my camera and the projection matrix as i use it in the game because I want to create a depthmap from the cameraposition. Can anybody explain what I'm doing wrong? Do I need another view matrix?

\$\endgroup\$
  • 1
    \$\begingroup\$ I found out my lookat in my view layed before the draw point of the model which had influence on my z value. Now i've put my lookat further away and get a good result. \$\endgroup\$ – Berend Sep 18 '12 at 13:04
1
\$\begingroup\$

I found out my lookat in my view layed before the draw point of the model which had influence on my z value. Now i've put my lookat further away and get a good result.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.