views:

76

answers:

1

I am writing Windows Hooks for DirectX 6.1. I want to intercept calls for EMBM (Environment Mapped Bump Mapping) and pass the data to own bump shader, so application which depend on EMBM will work correctly. The only problem is that DX 6.1 don't allow shaders at all. I can't simple replace Direct3DDevice3 with class from newer SDK, because it's methods uses different sets of arguments and application that use my hooked dll will crash. I do not know how to workaround through. I am not so good at DirectX (maybe there is more effective way to implement bump in DX 6.1 that will work on modern hardware?) Maybe it is possible to query some interface in D3Device that will allow me to use shaders?

Anything that could point me in right direction would be much appreciated.

+1  A: 

Each Direct 3D device derives directly from IUnknown so no you cannot QI from a v6 device to a v9 device.

The only way you can do what you want (above driver level) is to implement the entire v6 device and translate all calls to their v9 equivalents. Of course you then have a problem if the game implements embm via v7 or v8 ...

Goz