Skybuck Flying
2014-03-29 04:50:20 UTC
Hello,
I am using this Direct3D 9 interception DLL and callback DLL:
http://graphics.stanford.edu/~mdfisher/D3D9Interceptor.html
I want to use it to intercepts Star Trek Online DirectX Direct3D 9 calls to
reduce the ammount of geometry the game draws.
So far I have tried to modify he following routines in d3d9Callback.cpp by
adding if statements:
(HOW THE FUCK CAN I PASTE CODE IN STACKOVERFLOW ?!)
(SINCE STACK OVERFLOW SUCKS SO MUCH I LL TRY NEWSGROUPS TOO ;):))
D3D9CALLBACK_API bool ReportDrawPrimitive(D3DPRIMITIVETYPE PrimitiveType,
UINT StartVertex, UINT PrimitiveCount)
{
if(g_ReportingEvents)
{
g_Context->Files.CurrentFrameAllEvents << "DrawPrimitive\n";
}
if (PrimitiveCount >= 1)
{
PrimitiveCount = 1;
}
return g_Context->Managers.Render.DrawPrimitive(PrimitiveType,
StartVertex, PrimitiveCount);
}
D3D9CALLBACK_API bool ReportDrawIndexedPrimitive(D3DPRIMITIVETYPE
PrimitiveType, INT BaseVertexIndex, UINT MinIndex, UINT NumVertices, UINT
StartIndex, UINT PrimitiveCount)
{
if(g_ReportingEvents)
{
g_Context->Files.CurrentFrameAllEvents << "DrawIndexedPrimitive
Type=" << PrimitiveType << " BaseVertexIndex=" << BaseVertexIndex << "
MinIndex=" << MinIndex;
g_Context->Files.CurrentFrameAllEvents << " NumVertices=" <<
NumVertices << " StartIndex=" << StartIndex << " PrimitiveCount=" <<
PrimitiveCount << endl;
}
if (NumVertices >= 3)
{
NumVertices = 3;
}
if (PrimitiveCount >= 1)
{
PrimitiveCount = 1;
}
return g_Context->Managers.Render.DrawIndexedPrimitive(PrimitiveType,
BaseVertexIndex, MinIndex, NumVertices, StartIndex, PrimitiveCount);
}
Anyway... the if statements are an attempt to reduce the number of vertices,
primitives or whatever.
I am totally clueless about Direct3D 9 and also stackoverflow.
So I seek help/advise from Direct3D 9 experts... what is the best possible
option to reduce geometry for a game like Star Trek Online by intercepting
API calls ?
I also used PIX to spy on the Direct3D calls there are many many.... I am
not sure which calls are responsible for drawing all the geometry here is a
short example:
1872131 <0x061975D8>
IDirect3DDevice9::DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, 8383, 0,
16128) 139171121469
^ To me this looks like some draw call... I could be wrong though...
Either the callback DLL is not intercepting these calls properly or I need
to modify other draw calls ?
I tried setting parameters to zero that caused a crash... so it does seem to
be intercepted...
Thus perhaps I need to intercept other direct3d calls to try and reduce
geometry ?
Please advise how Direct3D 9 api interception can be used to reduce graphics
load if at all possible.
I am not sure if modifieing the models is possible... file format for 3d
models may be unknown or a lot of work to do... falling this api
interception trick... that option may be explored next...
Bye,
Skybuck.
I am using this Direct3D 9 interception DLL and callback DLL:
http://graphics.stanford.edu/~mdfisher/D3D9Interceptor.html
I want to use it to intercepts Star Trek Online DirectX Direct3D 9 calls to
reduce the ammount of geometry the game draws.
So far I have tried to modify he following routines in d3d9Callback.cpp by
adding if statements:
(HOW THE FUCK CAN I PASTE CODE IN STACKOVERFLOW ?!)
(SINCE STACK OVERFLOW SUCKS SO MUCH I LL TRY NEWSGROUPS TOO ;):))
D3D9CALLBACK_API bool ReportDrawPrimitive(D3DPRIMITIVETYPE PrimitiveType,
UINT StartVertex, UINT PrimitiveCount)
{
if(g_ReportingEvents)
{
g_Context->Files.CurrentFrameAllEvents << "DrawPrimitive\n";
}
if (PrimitiveCount >= 1)
{
PrimitiveCount = 1;
}
return g_Context->Managers.Render.DrawPrimitive(PrimitiveType,
StartVertex, PrimitiveCount);
}
D3D9CALLBACK_API bool ReportDrawIndexedPrimitive(D3DPRIMITIVETYPE
PrimitiveType, INT BaseVertexIndex, UINT MinIndex, UINT NumVertices, UINT
StartIndex, UINT PrimitiveCount)
{
if(g_ReportingEvents)
{
g_Context->Files.CurrentFrameAllEvents << "DrawIndexedPrimitive
Type=" << PrimitiveType << " BaseVertexIndex=" << BaseVertexIndex << "
MinIndex=" << MinIndex;
g_Context->Files.CurrentFrameAllEvents << " NumVertices=" <<
NumVertices << " StartIndex=" << StartIndex << " PrimitiveCount=" <<
PrimitiveCount << endl;
}
if (NumVertices >= 3)
{
NumVertices = 3;
}
if (PrimitiveCount >= 1)
{
PrimitiveCount = 1;
}
return g_Context->Managers.Render.DrawIndexedPrimitive(PrimitiveType,
BaseVertexIndex, MinIndex, NumVertices, StartIndex, PrimitiveCount);
}
Anyway... the if statements are an attempt to reduce the number of vertices,
primitives or whatever.
I am totally clueless about Direct3D 9 and also stackoverflow.
So I seek help/advise from Direct3D 9 experts... what is the best possible
option to reduce geometry for a game like Star Trek Online by intercepting
API calls ?
I also used PIX to spy on the Direct3D calls there are many many.... I am
not sure which calls are responsible for drawing all the geometry here is a
short example:
1872131 <0x061975D8>
IDirect3DDevice9::DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, 8383, 0,
16128) 139171121469
^ To me this looks like some draw call... I could be wrong though...
Either the callback DLL is not intercepting these calls properly or I need
to modify other draw calls ?
I tried setting parameters to zero that caused a crash... so it does seem to
be intercepted...
Thus perhaps I need to intercept other direct3d calls to try and reduce
geometry ?
Please advise how Direct3D 9 api interception can be used to reduce graphics
load if at all possible.
I am not sure if modifieing the models is possible... file format for 3d
models may be unknown or a lot of work to do... falling this api
interception trick... that option may be explored next...
Bye,
Skybuck.