PatchedD3D Shader Skinhack

Posts 115 of 18 · Page 1 of 2
D3D Shader Skinhack
I noticed while playing WarZ that chams sucked ass, huge ass. So I dug through my old sources and found that there is in fact something we can do about it. In Battlefield 1942, the Zbuffer wasnt used properly for the player models, and it caused chams to be annoying in that game. Someone posted a shader fix for it that worked. I worked it into D3D9 and in WarZ it seems to do the trick!

Before:


After:



Bonus cool stuff can be done too!





Just hook SetVertexShaderConstantF

Code:
//DECLARE THE STRUCT

typedef float vec_t;
typedef vec_t vec3_t[3];
typedef vec_t vec4_t[4];
typedef struct vshader_s
{
    vec4_t zcrap;
    vec4_t zcrap1;
    float depth_1; 
    float depth_2; 
    float depth_3;
    float depth_4;
    vec4_t zcrap3;
    vec4_t zcrap4;
    vec4_t zcrap5;
    vec4_t zcrap6;
    vec4_t zcrap7;
    float a_r;
    float a_g;
    float a_b;
    float a_a;
}
vshader_t; 
vshader_t m_verTex;

//inside your SetVertexShaderConstantF()hook---
vshader_t *pv = (vshader_t*)pConstantData;
        m_verTex = *pv;

//inside your DrawIndexedPrimitve()hook---
if(m_Stride==32)
{
m_verTex.depth_4 = 1.0f;
pDevice->SetVertexShaderConstantF(2,(CONST float *)&m_verTex,1);
SetModelColor(pDevice,7,0.3,0.3,0.3,7,0.3,0.3,0.3);
}

Still a little buggy, the other depth buffers hold some valuable information I haven't found yet, was able to get a proper cham on their left legs... not the whole body yet, so just a skin hack for now.

Credits:
Everett
Sobeit for the SetModelColor() function.
I'm a little dumb, could you post a tut? Anyway, looks like some great stuff.
Quote Originally Posted by tigerblood69 View Post
I'm a little dumb, could you post a tut? Anyway, looks like some great stuff.

This is for coders so they can make hacks

Quote Originally Posted by St4rkz View Post
how do i use the codes? can someone explain please
You have to know c++

Quote Originally Posted by Dortmund1909 View Post
When can I download this thing?
This is a code that you can use to make chams
Game was in alpha and hackers already, so annoying.
Now its time to join in xD
how do i use the codes? can someone explain please
Really useful , tnaks
Quote Originally Posted by gaahrodrigues View Post
you create one link for download?
There is no download? This is a code so you can make a cham hack for warz
Thank for the code
you make one tuturial for a how to use this code?
Quote Originally Posted by gaahrodrigues View Post
you make one tuturial for a how to use this code?
Its pointless if you dont know c++
Please make one tuturial for a how to use this code!
Quote Originally Posted by gaahrodrigues View Post
Please make one tuturial for a how to use this code!
I ALREADY TOLD YOU ITS NOT POINT IF YOU DONT KNOW HOW TO CODE
Posts 115 of 18 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?