GetTransform() costly?
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?
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement