Jump to content

  • Log In with Google      Sign In   
  • Create Account

Retrieving data from current D3D9 context


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 -=cmaster.matso=-   Members   -  Reputation: 108

Like
0Likes
Like

Posted 02 March 2012 - 02:05 PM

Hi,
How can I get, say, projection matrix, from the current D3D9 context? By current I mean from a certain game, to which I am hooked through a DLL. Such thing is done i.e. in ENB Series, as far as I know.

Regards,
MK

Sponsor:

#2 InvalidPointer   Members   -  Reputation: 1435

Like
0Likes
Like

Posted 03 March 2012 - 09:19 AM

As far as I'm aware, there's a bit of extra magic going on whereupon shader constants are also examined and saved externally. Unfortunately there's no perfect way to do this w/ the programmable pipeline.
clb: At the end of 2012, the positions of jupiter, saturn, mercury, and deimos are aligned so as to cause a denormalized flush-to-zero bug when computing earth's gravitational force, slinging it to the sun.

#3 mhagain   Crossbones+   -  Reputation: 8000

Like
0Likes
Like

Posted 03 March 2012 - 10:51 AM

With the fixed pipeline you can use IDirect3DDevice9::GetTransform, and there are other Gets for other states available. You need to be aware that if the device was originally created as a Pure Device, many of these Gets won't work, however - if it can be captured in a State Block you can't Get it.

With the programmable pipeline there is no concept of "state" for many things; even a matrix could come from many different souces: it could be passed along with other vertex attributes, constructed on the fly in a shader, or any number of other ways. TextureStageState doesn't exist and Sampler State could be set via an Effect rather than SetSamplerState calls.

One thing you could do - if you know that the program uses Effects - is create an ID3DXEffectStateManager and use that to capture settings. But you'll never really get the full picture with a program using shaders.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#4 -=cmaster.matso=-   Members   -  Reputation: 108

Like
0Likes
Like

Posted 19 March 2012 - 07:24 AM

And what with the frame and depth data (from current framebuffer)? How to retrieve them?

#5 Evil Steve   Members   -  Reputation: 1983

Like
0Likes
Like

Posted 19 March 2012 - 08:14 AM

IDirect3DDevice9::GetBackBuffer and IDirect3DDevice9::GetDepthStencilSurface.

Steve Macpherson
Systems Programmer

Rockstar North





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS