[Release] Direct3D Dual Coloured Chams Per Side - be certain your target is hittable!

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Chuck E

Coder
Dank Tier Donator
Nobleman
Jan 2, 2013
122
588
1
Dual Colour Chams
(One colour for when behind an object, another colour when view not obstructed)


A Chuck E WTF Situation!


DON'T WASTE THOSE ROUNDS!

SHOOT FLESH NOT STEEL!



With Chucky's dual cham man finder (oo err), you'll be able to tell if that enemy you are aiming at is not running about behind an obstacle.

Two day's worth of research and I finally got enough info together to be able to put this together. A lot of head butting off walls was done. Headache, headache, fun though :)

It is built on Fleep's Wallhack and Chams hack from the tutorials,specifically:
Fleep's Wallhack and Chams directx tutorial

It creates/uses an Occlusion query ( CreateQuery() and D3DQUERYTYPE_OCCLUSION) to work out how many pixels of the object are visible (not obstructed by another object). This value, stored in the DWORD variable numberOfVisiblePixels, can be altered to best reflect how you want the use of the colours to work. At which point it should use the colour for when the object is hidden and when to use the colour when the object is not hidden.

In the below images you can see that I have used Red and Yellow for the marines/SAS, and Blue and Green for the Spetznas/Opfor.
Red – marines/SAS that are not behind an object
Yellow – marines/SAS that are behind an object
Blue – Spetznas that are not behind an object
Green - Spetznas/Opfor that are behind an object

COD4_Dual_colour1_chams1.jpg
Above you see one soldier in clear view thus coloured red, and the other soldier coloured yellow, because he is hidden behind the crates.
You can change the colours to whatever you want, just check out the code sections below. Have some fun, figure it out, and learn :)

COD4_Dual_colour1_chams2.jpg

COD4_Dual_colour1_chams3.jpg

WHAT YOU'LL NEED / THE CODE

There are 4 sections of code that you'll need to use for this. And 3 files where you'll need to make alterations/addition to the contents.

In brief:

1) Hacks.cpp
- ApplyWallhack () function
2) Hacks.h
- Byte arrow of colours (colours for our textures)
- declaration of texture variables
3) d3d9dev.cpp
- BeginScene() function, containing our additional CreateTecture code

In detail:

1) HACKS.CPP (The result of my research :) - built on Fleep's work)

ApplyWallhack() code – replace the function that is in Hacks.cpp (see Fleep's Wallhack and Chams tutorial - GuidedHacking.com)

C++:
/*    // DUAL COLOURED CHAMS (HIDDEN/VISIBLE)
    // ====================================
    This function applies the wallhack and chams to the player models
    - it also will paint the model with a different colour dependent on whether or not the model is behind an obstacle (don't waste that ammo!)


    SPETZNAS/OPFOR model NOT hidden - BLUE
    SPETZNAS/OPFOR model hidden - GREEN


    MARINES/SAS model NOT hidden - RED
    MARINES/SAS model hidden - YELLOW
 */
void Hacks::ApplyWallhack(IDirect3DDevice9 *d3dDevice, D3DPRIMITIVETYPE device, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount)
{
    // this is used to test for occlusion of the player model/texture - is it hidden ?
    LPDIRECT3DQUERY9 queryOcclusion  = NULL;
    // this will hold the number of pixels of the player model that are visible (not blocked by an obstruction)
    DWORD numberOfVisiblePixels; 
    
    // PROCESS SPZNAS/OPFOR MODEL
    // --------------------------
    if (SPETZNAS_OPFOR) // we are dealing with the Spetznas/Opfor model
    {
        // start the check for occlusion of the current model
        d3dDevice->CreateQuery(D3DQUERYTYPE_OCCLUSION, &queryOcclusion);
        queryOcclusion->Issue(D3DISSUE_BEGIN);
        {
            // render the object so that we can see how many pixels are visible (note: the Z Buffer is active)
            d3dDevice->DrawIndexedPrimitive(device, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
        }
        queryOcclusion->Issue(D3DISSUE_END);
        // Now find out how many pixels of the texture are visible
        // - iterate through the entire object (all of its pixels)
        while(queryOcclusion->GetData( (void*)&numberOfVisiblePixels, sizeof(DWORD), D3DGETDATA_FLUSH) == S_FALSE);
        
        if (numberOfVisiblePixels < 3) // IS THE TEXTURE (of the player model) BEHIND AN OBSTACLE?
        {
            d3dDevice->SetRenderState(D3DRS_ZENABLE, false); // Disable Z Buffer, so that we can paint the model and see the result
            d3dDevice->SetTexture(0, textGreen); // set all textures for Spetsnaz and Opfor to green when behind an obstacle
            d3dDevice->DrawIndexedPrimitive(device, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount); // draw the texture
            d3dDevice->SetRenderState(D3DRS_ZENABLE, true); // re-enable the Z Buffer 
        }
        else // Player model is NOT behind an obstacle
        {
            d3dDevice->SetRenderState(D3DRS_ZENABLE, false); // Disable Z Buffer, so that we can paint the model and see the result
            d3dDevice->SetTexture(0, textBlue); // set all textures for Spetsnaz and Opfor to blue when NOT behind an obstacle
            d3dDevice->DrawIndexedPrimitive(device, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount); // draw the texture
            d3dDevice->SetRenderState(D3DRS_ZENABLE, true); // re-enable the Z Buffer 
        }
    }
    // PROCESS MARINES/SAS MODEL
    // -------------------------
    else if (MARINES_SAS) // we are dealing with the Marines/SAS model
    {
        // start the check for occlusion of the current model
        d3dDevice->CreateQuery(D3DQUERYTYPE_OCCLUSION, &queryOcclusion);
        queryOcclusion->Issue(D3DISSUE_BEGIN);
        {
            // render the object so that we can see how many pixels are visible (note: the Z Buffer is active)
            d3dDevice->DrawIndexedPrimitive(device, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
        }
        queryOcclusion->Issue(D3DISSUE_END);
        // Now find out how many pixels of the texture are visible
        // - iterate through the entire object (all of its pixels)
        while(queryOcclusion->GetData( (void*)&numberOfVisiblePixels, sizeof(DWORD), D3DGETDATA_FLUSH) == S_FALSE );
        
        if (numberOfVisiblePixels < 3) // IS THE PLAYER MODEL BEHIND AN OBSTACLE?
        {
            d3dDevice->SetRenderState(D3DRS_ZENABLE, false); // Disable Z Buffer, so that we can paint the model and see the result
            d3dDevice->SetTexture(0, textYellow); // Paint model yellow as it is behind an obstacle
            d3dDevice->DrawIndexedPrimitive(device, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount); // draw the texture
            d3dDevice->SetRenderState(D3DRS_ZENABLE, true); // re-enable the Z Buffer 
        }
        else // Player model is NOT behind an obstacle
        {
            d3dDevice->SetRenderState(D3DRS_ZENABLE, false); // Disable Z Buffer, so that we can paint the model and see the result
            d3dDevice->SetTexture(0, textRed); // Paint model red as it is NOT behind an obstable
            d3dDevice->DrawIndexedPrimitive(device, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount); // draw the texture
            d3dDevice->SetRenderState(D3DRS_ZENABLE, true); // re-enable the Z Buffer 
        }
    }    
    // Tidy up :-) 
    if( queryOcclusion != NULL )
        queryOcclusion->Release();
}
 
Last edited:

Chuck E

Coder
Dank Tier Donator
Nobleman
Jan 2, 2013
122
588
1
2) HACKS.H (2 lots of code for this file) NOT MY WORK (creeperdam nicked it for me) :)

(i) BYTE array containing the colours for the chams - located at the start of the file

C++:
// DEFINITIONS FOR OUR CHAMS

// Colours we can use - Blue, Red, Yellow, Green, Pink, Turquoise, Orangem White, Black
const BYTE bBlue[60] = //Blue
{
   0x42, 0x4D, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
   0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
   0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x12, 0x0B, 0x00, 0x00, 0x12, 0x0B, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0xFF, 0x00, 0x00, 0x00, 0x00, 0x00
};

const BYTE bRed[60] = //red
{
   0x42, 0x4D, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
   0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
   0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x12, 0x0B, 0x00, 0x00, 0x12, 0x0B, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0xFF, 0x00, 0x00, 0x00 
};

const BYTE bYellow[60] = //yellow
{
   0x42, 0x4D, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
   0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
   0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x12, 0x0B, 0x00, 0x00, 0x12, 0x0B, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00
};

const BYTE bGreen[60] = //green
{
   0x42, 0x4D, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
   0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
   0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x12, 0x0B, 0x00, 0x00, 0x12, 0x0B, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x20, 0xA0, 0x00, 0x00, 0xFF, 0xFF
};

const BYTE bPink[58] = //pink
{
   0x42, 0x4D, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
   0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
   0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x80, 0x00, 0xFF, 0x00
};

const BYTE bTur[60] = //turquoise
{
   0x42, 0x4D, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
   0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
   0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x12, 0x0B, 0x00, 0x00, 0x12, 0x0B, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00
};

const BYTE bOrange[60] = //orange
{
   0x42, 0x4D, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
   0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
   0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x12, 0x0B, 0x00, 0x00, 0x12, 0x0B, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x10, 0x80, 0xF0, 0xB0, 0x00, 0x00
};

const BYTE bWhite[58] = //White
{
   0x42, 0x4D, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
   0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
   0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0xFF, 0xFF, 0xFF, 0x00
};

const BYTE bBlack[58] = {
    0x42, 0x4D, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 
    0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x18, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

(ii) Declare/add the texture variables - this is in the Hacks class definition of the file.

C++:
    //our colours For the chams textures    
    //Spetznas and opfor
    LPDIRECT3DTEXTURE9 textRed;
    LPDIRECT3DTEXTURE9 textYellow;
    //Marines and SAS
    LPDIRECT3DTEXTURE9 textBlue;
    LPDIRECT3DTEXTURE9 textGreen;
    
    LPDIRECT3DTEXTURE9 textPink;
    LPDIRECT3DTEXTURE9 textTurquoise;
    LPDIRECT3DTEXTURE9 textOrange;
    LPDIRECT3DTEXTURE9 textWhite;
    LPDIRECT3DTEXTURE9 textBlack;

3) D3D9DEV.CPP

The create texture code for the BeginScene() function. Creates the coloured textures that you can use for the chams.

C++:
HRESULT APIENTRY hkIDirect3DDevice9::BeginScene() {
    static bool RunOnce = true;
    if(RunOnce)
    {
        RunOnce = false;
        //initialize our colours here
        hacks.CreateTexture(m_pD3Ddev,(LPCVOID)&bRed, sizeof(bRed), &hacks.textRed);
        hacks.CreateTexture(m_pD3Ddev,(LPCVOID)&bGreen, sizeof(bGreen), &hacks.textGreen);
        hacks.CreateTexture(m_pD3Ddev,(LPCVOID)&bBlue, sizeof(bBlue), &hacks.textBlue);
        hacks.CreateTexture(m_pD3Ddev,(LPCVOID)&bWhite, sizeof(bWhite), &hacks.textWhite);
        
        hacks.CreateTexture(m_pD3Ddev,(LPCVOID)&bYellow, sizeof(bYellow), &hacks.textYellow);
        hacks.CreateTexture(m_pD3Ddev,(LPCVOID)&bPink, sizeof(bPink), &hacks.textPink);
        hacks.CreateTexture(m_pD3Ddev,(LPCVOID)&bTur, sizeof(bTur), &hacks.textTurquoise);
        hacks.CreateTexture(m_pD3Ddev,(LPCVOID)&bOrange, sizeof(bOrange), &hacks.textOrange);
        hacks.CreateTexture(m_pD3Ddev,(LPCVOID)&bBlack, sizeof(bBlack), &hacks.textBlack);


        hacks.InitializeMenuItems();
    }


    return m_pD3Ddev->BeginScene();
}

Sources of information
Fleep's Wallhack and Cham's tutorial (see above for link).
MSDN for CreateQuery and Occlusion

Dedication and thanks:
Fleep, for an excellent site :)
creeperdam,(my little assistant in this exercise) for being my ideas man and sounding board whilst tracking down how to achieve this hack
Anyone out there on the interweb, who is able to put out useful information we all understand and can make use of.
(MSDN really needs to follow such people's example, lol)
 
Last edited:

Syperus

RTFM
Meme Tier VIP
Dank Tier Donator
Oct 29, 2012
432
2,638
7
Nice release! A Chuck E WTF Situation. lmao love it. I'mma have to try this out. I haven't tried any d3d hacks yet. Might as well give it a go. Thanks
 

Chuck E

Coder
Dank Tier Donator
Nobleman
Jan 2, 2013
122
588
1
Nice release! A Chuck E WTF Situation. lmao love it. I'mma have to try this out. I haven't tried any d3d hacks yet. Might as well give it a go. Thanks
lol thanks :)

That took a good long while to find out what needed to be done. Mainly because I did not know what to search for. Then yesterday I came across "occlusion" related to rendering 3D objects on the screen. So put in a few searches containing that word, and finally got what I needed.

It definitely makes a big difference in-game. You can track the enemy, and fire when you know the bullet won't be stopped by a vehicle or some other impenetrable obstruction.

Next, or soonish, I'd like to look into Super Bullets :) They are hilarious to use. Kill people in tanks, on board ships, high up through many levels of a building, or through hills. Sooooo funny.

I think I should sort out my own look for the menu first, and do some OllyDbg work, ready for the Bots section if we are lucky enough to have one included. If we are, I'll probably devote most of my hack/bot creation/research time to bot creation :)
 

Syperus

RTFM
Meme Tier VIP
Dank Tier Donator
Oct 29, 2012
432
2,638
7
ready for the Bots section if we are lucky enough to have one included. If we are, I'll probably devote most of my hack/bot creation/research time to bot creation :)
Yea I'm working on a bot template right now, along with another project. I go back and forth between projects when I get tired or frustrated with one I work on the other for awhile. Helps me keep my sanity. But yea I'll be releasing the bot template once I get it finished.
 

Chuck E

Coder
Dank Tier Donator
Nobleman
Jan 2, 2013
122
588
1
Yea I'm working on a bot template right now, along with another project. I go back and forth between projects when I get tired or frustrated with one I work on the other for awhile. Helps me keep my sanity. But yea I'll be releasing the bot template once I get it finished.
I do that too... one moment on one project the next on another. It's usually because I get bored. I get bored quite quickly, but so far, amazingly, that has not happened with this hobby. It looks like I have found my ideal hobby.

I look forward to seeing that template, and will hopefully, in time, contribute my own. I'm looking forward to making a start on a game engine, with the objective of being able to use it for any game. Plug-n-play type game engine. MMORPG type of game that is.

Actually, thinking about it, I have more than one thing on the go as far as this hobby is concerned...

D3D Menu (design my own)
Super Bullets (not started yet, gonna read up on it some today)
OllyDbg training
Payday the Heist game trainer/hack (searching addresses at the moment)
Aimbot (at the thinking about it stage, lol)
Crosshair (implement Fleep's but design my own look - partly done)

I should try and focus on one thing, and get it done. I think the tougher I find something the more likely I'll complete it. I just go into mega focused/stubborn mode, searching and figuring things out, until I have the answer. Which is what happened with the dual coloured chams.

Anyway, back to it... Gonna finish the crosshair now. Ah, just remembered, I also need to read up on hooking :)
 

Syperus

RTFM
Meme Tier VIP
Dank Tier Donator
Oct 29, 2012
432
2,638
7
Sounds good. Not sure what language you were planning on developing your game/game system in, but if you do any C# programming I know XNA is a decent system to develop games on. Let me know if you need any books/resources. I have tons of books/tutorials/sources I purchased/acquired on programming, reverse engineering, designing your own games/game engines, and several other topics.
 

c5

Kim Kong Trasher
Dank Tier VIP
Dank Tier Donator
Jul 19, 2012
1,188
12,638
76
Sounds good. Not sure what language you were planning on developing your game/game system in, but if you do any C# programming I know XNA is a decent system to develop games on. Let me know if you need any books/resources. I have tons of books/tutorials/sources I purchased/acquired on programming, reverse engineering, designing your own games/game engines, and several other topics.
I guess building a d3d framework from scratch for a simple game will be a "delightful" task for Chucky. From my previous experience with XNA, I didn't really like it. It's all easy and nice to use but ehh not for me. I like to have full control :)
 

Syperus

RTFM
Meme Tier VIP
Dank Tier Donator
Oct 29, 2012
432
2,638
7
From my previous experience with XNA, I didn't really like it. It's all easy and nice to use but ehh not for me. I like to have full control :)
I agree. I too would want full control. XNA is nice though for people first learning about creating games. They learn the concepts behind what goes into creating a game. But if he's building a d3d framework I don't think he'll need XNA.
 

Chuck E

Coder
Dank Tier Donator
Nobleman
Jan 2, 2013
122
588
1
Oops, sorry, I meant bot engine, not game engine :eek:

Must have not had my wake up coffee when I posted that, or at least not enough, lol

I'm planning on sticking with C++ from here on in for anything I do, except for web development.

C# is used a hell of a lot these days. All the Buddy Bots are developed in that language, but I'm gonna stick with C++
 

ELExTrO

Newbie
Full Member
Dec 4, 2012
26
274
0
this method is a bit retard and can be done in fewer lines of code and even better it can be done witha drawindexedprimitive hook :p

C++:
  if(opt.chams.main)
		{
			if ( Stride == 32 )
			{
		pDevice->SetRenderState(D3DRS_ZENABLE,false);
		if(opt.chams.chams1==1)pDevice->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_ARGB(255,255,0,0));
		if(opt.chams.chams1==2)pDevice->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_ARGB(255,0,0,255));
		if(opt.chams.chams1==3)pDevice->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_ARGB(255,0,255,0));
		if(opt.chams.chams1==4)pDevice->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_ARGB(255,255,255,0));
		if(opt.chams.chams1==5)pDevice->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_ARGB(255,0,255,255));
		if(opt.chams.chams1==6)pDevice->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_ARGB(255,255,0,255));
		pDrawIndexedPrimitive(pDevice,pType D3DparamvalX,nMinIndex,nNumVertices,nStartIndex,nPrimitiveCount);
		pDevice->SetRenderState(D3DRS_ZENABLE,true);
		if(opt.chams.chams2==1)pDevice->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_ARGB(255,255,0,0));
        if(opt.chams.chams2==2)pDevice->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_ARGB(255,0,0,255));
		if(opt.chams.chams2==3)pDevice->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_ARGB(255,0,255,0));
		if(opt.chams.chams2==4)pDevice->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_ARGB(255,255,255,0));
		if(opt.chams.chams2==5)pDevice->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_ARGB(255,0,255,255));
		if(opt.chams.chams2==6)pDevice->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_ARGB(255,255,0,255));
		}
 
  }
 
Last edited:

A200K

Newbie
Full Member
Sep 11, 2012
9
1,088
0
Wouldn't it be easier to render the player twice? One time with zbuffer off and the first colour, then with the zbuffer on and the second colour... This will give it almost the same effect and it can be done with just a few lines...

e.g:

C++:
pDevice->SetRenderState(D3DRS_ZENABLE, false);
pDevice->SetTexture(0,Red);
pDevice->DrawIndexedPrimitive(device,BaseVertexIndex,MinVertexIndex,NumVertices,startIndex,primCount); 
pDevice->SetRenderState(D3DRS_ZENABLE, true); 
pDevice->SetTexture(0,Green);
pDevice->DrawIndexedPrimitive(device,BaseVertexIndex,MinVertexIndex,NumVertices,startIndex,primCount);
Result:
ex.jpg
 
Last edited:

emistz

Jr.Coder
Dank Tier Donator
Nobleman
May 3, 2013
71
338
0
Wouldn't it be easier to render the player twice? One time with zbuffer off and the first colour, then with the zbuffer on and the second colour... This will give it almost the same effect and it can be done with just a few lines...

e.g:

C++:
pDevice->SetRenderState(D3DRS_ZENABLE, false);
pDevice->SetTexture(0,Red);
pDevice->DrawIndexedPrimitive(device,BaseVertexIndex,MinVertexIndex,NumVertices,startIndex,primCount); 
pDevice->SetRenderState(D3DRS_ZENABLE, true); 
pDevice->SetTexture(0,Green);
pDevice->DrawIndexedPrimitive(device,BaseVertexIndex,MinVertexIndex,NumVertices,startIndex,primCount);
Result:
View attachment 1908
That's neat. Whatever performance hit you take from the double rendering of the model is probably negligible unless you got a bunch of models on the screen.
 

WiTH

Jr.Coder
Full Member
Nobleman
May 24, 2012
58
458
1
Like A200k said, the zbuffer method is easier and used more often. Still, i've never seen the Occlusion method, so thanks for the tutorial Chuck.
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods League of Legends Accounts