Sign in to follow this  
Followers 0
hflong325

The precision problem of matrix transformation

0 posts in this topic

Yesterday I found a problem of my demo, when the object and camera were far away from (0,0,0), such as  an object at (2000,2000,0) and camera at (2010,2000,0) , the accuracy of Z seemed to declined, lots of Z-Fighting problems appears.

 

The transform code of my model is:

 

output.oPosition=mul(output.oPosition,WorldMatrix);

output.oPosition=mul(output.oPosition,ViewProj);

 

When I change to :

 

output.oPosition=mul(output.oPosition,WorldViewProj);

 

It became just ok.

 

Sometimes I need to transform the object to the world space first and do some other transformations, so I'm afraid this problem will apear again,and I don't know why this two pieces of code have such a big difference.

Edited by dragon.R
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0