Jump to content
  • Advertisement
Sign in to follow this  
Naruto-kun

Retrieve view and projection matrices

This topic is 2110 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys

 

I have hooked into the ID3D10Device instance of a game and am attempting to retrieve the view, projection, and world matrices from it in order to determine the camera position. But i cant seem to locate a way to get hold of active ID3D10Effect instances from the device.

 

Anyone got any ideas?

 

Thanks

JB

Share this post


Link to post
Share on other sites
Advertisement


But i cant seem to locate a way to get hold of active ID3D10Effect instances from the device.

 

That is since the ID3D10Effect-interface is merely a manager for states, resources etc... and not directly aligned to the device at all. You'd have to use VSGetConstantBuffer, though this requires trial and error or at least a knowledge of what register the view-projection matrix is at. Alternatively, you can try running the game in PIX and saving a frame with F12, this will let you look at all the API and Draw calls and from there on on all the device settings at each call.

Share this post


Link to post
Share on other sites

That is since the ID3D10Effect-interface is merely a manager for states, resources etc... and not directly aligned to the device at all. You'd have to use VSGetConstantBuffer, though this requires trial and error or at least a knowledge of what register the view-projection matrix is at. Alternatively, you can try running the game in PIX and saving a frame with F12, this will let you look at all the API and Draw calls and from there on on all the device settings at each call.

 

Yep. World, view and projection matrices are not treated specially by the device. In the fixed-function pipeline it was possible to get them from the device, because the application was setting them using device->SetTransform(). But in shaders, those matrices can be "anywhere".

Btw, the application can even mutliply them together into one matrix before sending them to the GPU (or at least the view and projection together), if the shaders don't need them separately. They really are just another values stored in the float4 constant buffers, so you'll have to find out which buffers they are in.

Share this post


Link to post
Share on other sites

Only catch I have run into is PIX refuses to work with it. The program reports that it cannot be used with Direct3D profiling/Analysis tools.

 

It was developed quite a few years ago...pre 2009. Any alternative debuggers?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!