unknowncheats uc-forum.com ucdownloads ucdownloads.com

Go Back   UC-Tutorials - Multiplayer Game Hacking and Cheat Tutorials > First-Person Shooters > Quake Series > Quake Live

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

Reply
 
Thread Tools Display Modes
  #1  
Old 02-25-2010, 03:23 AM
disco disco is offline
Super Moderator
 
Join Date: Feb 2010
Posts: 271
Default Dynamic Shaders

Posted by stealth93.




After looking through tr_shader.c from the Q3 source I noticed that s_shaderText is a string of all the shaders loaded from the pk3s by the game. To add our own shader defitions all we need to do concatenate our dynamic shaders to this string before registering our local shaders.

Example:
Code:
// Offset is for linux v1.0.263

strcat(*((char **)(quakeLiveLibAddress + 0x315500)), "\nbottom\n{\ndeformVertexes \
wave 100 sin 0 0 0 0\n{\nblendfunc GL_SRC_ALPHA GL_SRC_ALPHA\nmap *white\n \
rgbGen entity\n}\n}\ntop\n{\ndeformVertexes wave 100 sin 0 0 0 0\n{\nmap *white\n \
rgbGen entity\n}\n}\n");

qlhShader_top = orig_RE_RegisterShader("top");
qlhShader_bottom = orig_RE_RegisterShader("bottom");
A printf of s_shaderText to console after concatenating:
Code:
.
.
.
textures/sfx2/jumppad_q1metal7_98
{
qer_editorimage textures/sfx2/bouncepad_q1metal7_98.tga
surfaceparm nodamage
q3map_lightimage textures/sfx/jumppadsmall.tga
q3map_surfacelight 1000
nopicmip
{
map textures/sfx2/bouncepad_q1metal7_98.tga
rgbGen identity
}
{
map $lightmap
rgbGen identity
blendfunc gl_dst_color gl_zero
}
{
map textures/sfx/bouncepad01b_layer1.tga
blendfunc gl_one gl_one
rgbGen wave sin .5 .5 0 1.5
}
{
clampmap textures/sfx/jumppadsmall.tga
blendfunc gl_one gl_one
tcMod stretch sin 1.2 .8 0 1.5
rgbGen wave square .5 .5 .25 1.5
}
}
bottom
{
deformVertexes wave 100 sin 0 0 0 0
{
blendfunc GL_SRC_ALPHA GL_SRC_ALPHA
map *white
rgbGen entity
}
}
top
{
deformVertexes wave 100 sin 0 0 0 0
{
map *white
rgbGen entity
}
}
Its there!
Example in action attached. This should work for other Q3 based games aswell.


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
dynamic, shaders

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 02:47 AM.


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