ENB Performance on CA

Posts 115 of 16 · Page 1 of 2
ENB Performance on CA
Obviously CA doesn't really benefit from ENB like Skyrim and other pc game titles do, but it does hook and it does work very well


In the SS, i show the skyrim modded ENB dev console. It works flawlessly, allows for d3d debugging and fx file creation/modification. With the ability to create FX files and run them on CA, that opens us up to a whole new level of D3D abilities. CA already has FX files in the game directory in the "Shaders.rez" file. These are Bloom, Nightvision and a few others. By modifying these FX files, we were able to create mods like always have a cross hair, Color Correction, different game style effects and a lot more (see below for examples)

Sobel Mix

Advanced Zoom (would be great with snipers for a further look)


credits to @Drigien for these images and video

I don't exactly understand how ENB works, but this could be a lot of fun to include in future hacks
By any chance sir u have the source for this?
and it could be a shader hook it appears.

for those who do not know what a shader is, think of it like Vertex or Pixel programming on the gpu.
Quote Originally Posted by topblast View Post
By any chance sir u have the source for this?
and it could be a shader hook it appears.

for those who do not know what a shader is, think of it like Vertex or Pixel programming on the gpu.
as far as i know, ENB source is not public, the only thing that is is the ability to edit it's ini files. I'm sure there's a source somewhere out there, and it probably just takes the correct vTable hook to do this
'
a shader hook just requires the following
Code:
#define CreateVertexShader 91
#define SetVertexShader 92
#define CreatePixelShader 106
#define SetPixelShader 107
but i don't know how to read off of fx files in c++

currently creating a full vtable hook to see how ca likes it. just leaving out midfunction

update:
learned how to code fx directly into a d++ function. this is easy now LOL

basic pixel shader chams before fullbright add (working on it) and other FX tweaks are finished. may release soon


i was in game for about 35 minutes no crash, basic hook on SetPixelShader with a detour
Quote Originally Posted by supercarz1991 View Post
i was in game for about 35 minutes no crash, basic hook on SetPixelShader with a detour
Hmm, so GetStreamSource is used to get the stride right, but how do u get overlay the pixels, I dont know of a way to get the output of a pixel shader, into another, but a Vertex Shader, yea i can from what I know in VS_4.

Process the texture cords with a color overlay. What i am not sure about is dynamic colors as the shader is pretty much static to what the game inputs.
Quote Originally Posted by topblast View Post


Hmm, so GetStreamSource is used to get the stride right, but how do u get overlay the pixels, I dont know of a way to get the output of a pixel shader, into another, but a Vertex Shader, yea i can from what I know in VS_4.

Process the texture cords with a color overlay. What i am not sure about is dynamic colors as the shader is pretty much static to what the game inputs.
Code:
bool fCall = true;
IDirect3DPixelShader9 *Red, *Green;
LPDIRECT3DDEVICE9 g_pDevice = NULL;
IDirect3DPixelShader9 *Front,*Back;

HRESULT CreateMyShader(IDirect3DPixelShader9 **pShader, IDirect3DDevice9 *Device, float red, float green, float blue, float alpha )

//Just recalling colours

{
    ID3DXBuffer *MyBuffer = NULL;
    char MyShader[ 256 ];
    sprintf( MyShader, "ps.1.1\ndef c0, %f, %f, %f, %f\nmov r0,c0", red/255, green/255, blue/255, alpha/255 );
    D3DXAssembleShader( MyShader, sizeof( MyShader ), NULL, NULL, 0, &MyBuffer , NULL );
    if( FAILED( Device->CreatePixelShader((const DWORD*)MyBuffer ->GetBufferPointer(), pShader)) )return E_FAIL;
    return S_OK;

//Assigning shades to different characters... cant realy explain much further...

}

HRESULT GenerateShader( IDirect3DDevice9 *pDevice, IDirect3DPixelShader9 **pShader, float r, float g, float b, bool setzBuf ) 
    char szShader[ 256 ];
    ID3DXBuffer *pShaderBuf = NULL;

    sprintf( szShader, "ps.1.1\ndef c0, %f, %f, %f, %f\nmov r0,c0", r, g, b, 1.0f );
    if( D3DXAssembleShader( szShader, sizeof( szShader ), NULL, NULL, 0, &pShaderBuf, NULL ) == D3D_OK )
        pDevice->CreatePixelShader( ( const DWORD* )pShaderBuf->GetBufferPointer(), pShader );
    else
        return E_FAIL;

    return S_OK;
}

// in your dip

if(fCall)
  {
  CreateMyShader( &Front, pDevice,    255,     0,   0,   255 );
  CreateMyShader( &Back,  pDevice,    255,   255,   0,   255 );
  fCall = false;
  }

DWORD dwOldZEnable = D3DZB_TRUE; 
				pDevice->GetRenderState(D3DRS_ZENABLE, &dwOldZEnable); 
				pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
				pDevice->SetPixelShader( Red );  
				pDIP(pDevice, Type, BaseVertexIndex, MinIndex, NumVerts, StartIndex, PrimCount);
				pDevice->SetRenderState(D3DRS_ZENABLE, dwOldZEnable);
				pDevice->SetPixelShader( Green );
i'm looking into vertex shaders tomorrow. tired as hell. i'll have more info tomorrow when i can think straight
i understand now xD

Tho i wont recommend wasting time to learn PS 1.1, tho it might be useful
Quote Originally Posted by topblast View Post
i understand now xD

Tho i wont recommend wasting time to learn PS 1.1, tho it might be useful
actually already know it from modding we used to do shader mods all the time to draw crosshairs, do sobel filters, Zoom without scope.. just see the pix before. its all modding.




and its not hard to code all this in C++ at all or even read from an external FX file
still got the problem of most people to hook dip to get full control
Quote Originally Posted by topblast View Post
still got the problem of most people to hook dip to get full control
i dont even hae a dip hook in my base any more

If you dont have more than 1 color my way might be better without dip hooking
Quote Originally Posted by Ch40zz-C0d3r View Post
If you dont have more than 1 color my way might be better without dip hooking
i can do more than one color. I could do tie-die if i cared. I'd just have to code up the FX file, which isn't that hard, i'm just lazy. I like that cham because its so bright
i am not familiar with any ways of editing a model without hooking one of the draw functions or at-least something that is called around one of those draw functions for the model
Nice share this in pub, now, this will get detect any way, use until works guys.
Quote Originally Posted by XarutoUsoCrack View Post
Nice share this in pub, now, this will get detect any way, use until works guys.
the current method of hook i'm using is pure basic JMP. Not a detour of any sort, not a break point, it's just a JMP. So frankly as long as i don't open my mouth and post exactly which part of the vtable i currently hook, it'll take em awhile
Quote Originally Posted by supercarz1991 View Post
the current method of hook i'm using is pure basic JMP. Not a detour of any sort, not a break point, it's just a JMP. So frankly as long as i don't open my mouth and post exactly which part of the vtable i currently hook, it'll take em awhile
They didnt even fix my method and I mentioned how I did it + which directx function
BTW: A detours IS a simple basic JMP
Posts 115 of 16 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?