Chams for CS1.6
I hope you like
the concept:
Quote:
hook StudioRenderModel
check for a valid entity ( not only player models are drawn here )
call glDepthFunc with GL_GREATER
apply your changes for the model part which is not visible
call StudioRenderFinal
call glDepthFunc with GL_LESS
apply your changes for the model part which is visible
call StudioRenderFinal
don't call the original StudioRenderModel func
|
Here are some screenshots with various styles: (like wireframe,glowshell,blending)
hxxp://gemini.ge.ohost.de/CS16_Chams/
I prefer green & red glowshells
and 2 code examples:
Wireframe Chams
PHP Code:
NAKED_VOID xStudioRenderModel( void )
{
_asm
{
PUSH ESI
MOV ESI,ECX
PUSH 0
CALL DWORD PTR DS:[0x1A33008] ; SetForceFaceFlags
MOV EAX, DWORD PTR DS:[ESI+0x30]; CurrentEntity
MOV pCurrentEnt,EAX
PUSH EAX
CALL [bIsEntValid]
ADD ESP,8
TEST AL,AL
JE __NotValid
//==============================================================
// Draw the non visible part of the Model
PUSH 0x204 ; GL_GREATER
CALL DWORD PTR DS:[0x27B3C08] ; glDepthFunc
PUSH 0x1B01 ; GL_LINE
PUSH 0x408 ; GL_FRONT_AND_BACK
CALL DWORD PTR DS:[0x27B3E98] ; glPolygonMode
MOV ECX,ESI
MOV EAX,DWORD PTR DS:[ESI]
CALL DWORD PTR DS:[EAX+0x4C] ; StudioRenderFinal ( non visible part )
//==============================================================
// Draw the visible part of the Model
PUSH 0x201 ; GL_LESS
CALL DWORD PTR DS:[0x27B3C08] ; glDepthFunc
PUSH 0x1B02 ; GL_FILL
PUSH 0x408 ; GL_FRONT_AND_BACK
CALL DWORD PTR DS:[0x27B3E98] ; glPolygonMode
__NotValid:
MOV ECX,ESI
MOV EAX,DWORD PTR DS:[ESI]
CALL DWORD PTR DS:[EAX+0x4C] ; StudioRenderFinal ( visible part )
POP ESI
RET
}
}
Glowshell Chams
PHP Code:
NAKED_VOID xStudioRenderModel( void )
{
_asm
{
PUSH ESI
MOV ESI,ECX
PUSH 0
CALL DWORD PTR DS:[0x1A33008] ; SetForceFaceFlags
MOV EAX, DWORD PTR DS:[ESI+0x30]; CurrentEntity
MOV pCurrentEnt,EAX
PUSH EAX
CALL [bIsEntValid]
ADD ESP,8
TEST AL,AL
JE __NotValid
//==============================================================
// Draw the normal Model
//MOV EAX, DWORD PTR DS:[pCurrentEnt]
//MOV DWORD PTR DS:[EAX+0x304],0 ; rendermode = kRenderFxNone
//MOV ECX,ESI
//MOV EAX,DWORD PTR DS:[ESI]
//CALL DWORD PTR DS:[EAX+0x4C] ; StudioRenderFinal
//==============================================================
// Draw the non visible part of the Model with a red Glowshell
PUSH 0x204 ; GL_GREATER
CALL DWORD PTR DS:[0x27B3C08] ; glDepthFunc
CALL DWORD PTR DS:[0x1A3301C] ; SetChromeOrigin
PUSH 2 ; STUDIO_NF_CHROME
CALL DWORD PTR DS:[0x1A33008] ; SetForceFaceFlags
MOV EDX,DWORD PTR DS:[ESI+0x58]
MOV EAX,DWORD PTR DS:[0x1A1C320]
PUSH 0
PUSH EDX ; m_pChromeSprite
CALL DWORD PTR DS:[EAX+0x2C] ; SpriteTexture
ADD ESP,0x0C
MOV EAX, DWORD PTR DS:[pCurrentEnt]
MOV BYTE PTR DS:[EAX+0x300],0x0FF
MOV BYTE PTR DS:[EAX+0x301],0
MOV BYTE PTR DS:[EAX+0x302],0
MOV DWORD PTR DS:[EAX+0x2FC],0x32
MOV DWORD PTR DS:[EAX+0x304],0x13
MOV ECX,ESI
MOV EAX,DWORD PTR DS:[ESI]
CALL DWORD PTR DS:[EAX+0x4C] ; StudioRenderFinal ( non visible part )
//==============================================================
// Draw the visible part of the Model with a green Glowshell
PUSH 0x201 ; GL_LESS
CALL DWORD PTR DS:[0x27B3C08] ; glDepthFunc
MOV EAX, DWORD PTR DS:[pCurrentEnt]
MOV BYTE PTR DS:[EAX+0x300],0
MOV BYTE PTR DS:[EAX+0x301],0x0FF
MOV BYTE PTR DS:[EAX+0x302],0
__NotValid:
MOV ECX,ESI
MOV EAX,DWORD PTR DS:[ESI]
CALL DWORD PTR DS:[EAX+0x4C] ; StudioRenderFinal ( visible part )
POP ESI
RET
}
}
hf :D
credits:
patrick ( he inspired me for the way how I hook studiorendermodel)