Sign in to follow this  
DarkZoulz

GetTransform() costly?

Recommended Posts

DarkZoulz    106
Is it a heavy operation to get and set transformation matrices in D3D? I mean, can I throughout the engine use a device->GetTransform(D3DTS_WORLD, &matrix) to retrieve the world transform, or should I store it locally and get that copy every time I need it?

Share this post


Link to post
Share on other sites
circlesoft    1178
SetTransform() is pretty costly, as this entails a state change - GetTransform(), not so much. Remember that if you have a pure device, you can't use most IDirect3DDevice::Get*() calls. Generally, it is more flexible (and better design) to store the transforms yourself. Otherwise, you could be calling GetTransform() multiple times per frame, ect.

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