unknowncheats uc-forum.com ucdownloads ucdownloads.com

Go Back   UC-Tutorials - Multiplayer Game Hacking and Cheat Tutorials > Programming > Direct3D

- Sponsored Advertisement -
http://www.myfpscheats.com/


Reply
 
Thread Tools Display Modes
  #1  
Old 09-29-2007, 07:07 PM
t10101 t10101 is offline
Junior Member
 
Join Date: Sep 2007
Posts: 21
Default Fullbright chamz

by Where

First of all, this isn't made by me The credits go to "Where" from GD
I saw this wasn't posted yet.

Code:
HRESULT GenerateShader(IDirect3DDevice9 *pD3Ddev, IDirect3DPixelShader9 **pShader, float r, float g, float b )
{
    char szShader[ 64 ];
    ID3DXBuffer *pShaderBuf = NULL;	
	sprintf( szShader, "ps.1.1\ndef c0, %f, %f, %f, %f\nmov r0,c0", r, g, b, 1.0f );
    D3DXAssembleShader( szShader, sizeof( szShader ), NULL, NULL, 0, &pShaderBuf, NULL );
    if( FAILED( pD3Ddev->CreatePixelShader((const DWORD*)pShaderBuf->GetBufferPointer(), pShader)) )return E_FAIL;


    return S_OK;
}

After that you can use this

Code:
struct shaders
{
    IDirect3DPixelShader9 *sBlue, *sRed, *sPurple, *sOrange, *sWhite, *sGreen, *sYellow, *sPink, *sLBlue, *sLGreen, *sDGreen, *sLBlue2;
}; shaders sa;

void InitShaders( void )
{ }

#define scham( x, b, f ) if( x ) \
{ \
    m_pD3Ddev->SetRenderState( D3DRS_ZENABLE, FALSE ); \
    m_pD3Ddev->SetRenderState( D3DRS_ZFUNC, D3DCMP_NEVER ); \
    m_pD3Ddev->SetTexture( 0, NULL ); \
    m_pD3Ddev->SetPixelShader( NULL ); \
    m_pD3Ddev->SetPixelShader( f ); \
    m_pD3Ddev->DrawIndexedPrimitive( Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount ); \
    m_pD3Ddev->SetRenderState( D3DRS_ZENABLE, TRUE ); \
	m_pD3Ddev->SetRenderState( D3DRS_ZFUNC,D3DCMP_LESSEQUAL ); \
    m_pD3Ddev->SetPixelShader( b ); \
}
Then you can use it like this

Code:
scham( yourlogyouwishtocham) sa.scolournormal, sa.scolourWH);
and ofcourse you need to Generate those shaders too

Code:
GenerateShader( m_pD3Ddev, &sa.sBlue, 0.0f, 0.0f, 1.0f );
You'll see that those shaders are floats and need to be converted from the normal "GenerateTextures", but that is simple math

Enjoy !!
Reply With Quote
Reply

  • Submit Thread to Digg
  • Submit Thread to del.icio.us
  • Submit Thread to StumbleUpon
  • Submit Thread to Google
  • Submit Thread to Facebook
  • Submit Thread to My Yahoo!
  • Submit Thread to MySpace
  • Submit Thread to Twitter
  • Submit Thread to Reddit

Tags
chamz, fullbright

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 04:31 PM.