Quake3World.com Forums
     Programming Discussion
        New Weapon Explosion Shader


Post new topicReply to topic
Login | Profile | | FAQ | Search | IRC




Print view Previous topic | Next topic 
Topic Starter Topic: New Weapon Explosion Shader

Grunt
Grunt
Joined: 27 Oct 2010
Posts: 71
PostPosted: 10-02-2012 02:54 PM           Profile Send private message  E-mail  Edit post Reply with quote


Hi d00ds, I am currently working on adding some new weapons to Quake 3. I want to assign a new weapon, based on the RL, a different explosion shader, but I can't figure out how to get the shader to work. (I'm a bit new with Q3 programming :) ) Thanks in advance :D



_________________
My Website:
Image


Top
                 

I'm the dude!
I'm the dude!
Joined: 04 Feb 2002
Posts: 12498
PostPosted: 10-02-2012 03:33 PM           Profile Send private message  E-mail  Edit post Reply with quote


Are you having problems with the shader script itself or having some kind of problem getting Q3 to work with your shader?



_________________
GtkRadiant | Q3Map2 | Shader Manual


Top
                 

Grunt
Grunt
Joined: 27 Oct 2010
Posts: 71
PostPosted: 10-02-2012 03:38 PM           Profile Send private message  E-mail  Edit post Reply with quote


This has nothing to do with the shader script. It puzzles me because I couldn't find an explosion shader for the RL or the GL. But, yes, I can't get the explosion to work with Q3. I haven't created an explosion shader since I could not find an explosion shader for the other weapons.



_________________
My Website:
Image


Top
                 

I'm the dude!
I'm the dude!
Joined: 04 Feb 2002
Posts: 12498
PostPosted: 10-02-2012 04:08 PM           Profile Send private message  E-mail  Edit post Reply with quote


Looks like they're in pak0.pk3/scripts/gfx.shader.

Code:
rocketExplosion
{
   cull disable
   {
      animmap 8 models/weaphits/rlboom/rlboom_1.tga  models/weaphits/rlboom/rlboom_2.tga models/weaphits/rlboom/rlboom_3.tga models/weaphits/rlboom/rlboom_4.tga models/weaphits/rlboom/rlboom_5.tga models/weaphits/rlboom/rlboom_6.tga models/weaphits/rlboom/rlboom_7.tga models/weaphits/rlboom/rlboom_8.tga
      rgbGen wave inversesawtooth 0 1 0 8
      blendfunc add
   }
   {
      animmap 8 models/weaphits/rlboom/rlboom_2.tga models/weaphits/rlboom/rlboom_3.tga models/weaphits/rlboom/rlboom_4.tga models/weaphits/rlboom/rlboom_5.tga models/weaphits/rlboom/rlboom_6.tga models/weaphits/rlboom/rlboom_7.tga models/weaphits/rlboom/rlboom_8.tga gfx/colors/black.tga
      rgbGen wave sawtooth 0 1 0 8
      blendfunc add
   }
}



_________________
GtkRadiant | Q3Map2 | Shader Manual


Top
                 

Grunt
Grunt
Joined: 27 Oct 2010
Posts: 71
PostPosted: 10-03-2012 02:49 AM           Profile Send private message  E-mail  Edit post Reply with quote


Haha, WOW I'm blind. Thanks anyway :D



_________________
My Website:
Image


Top
                 

Insane Quaker
Insane Quaker
Joined: 05 Mar 2010
Posts: 384
PostPosted: 10-03-2012 09:30 AM           Profile Send private message  E-mail  Edit post Reply with quote


So you haven't coded it in either? It's declared in cg_local.h:
Code:
   qhandle_t   rocketExplosionShader;


cg_weapons.c::CG_RegisterWeapon gets the game to load the shader and other weapon projectile assets into memory during level loading:

Code:
...
case WP_ROCKET_LAUNCHER:
      weaponInfo->missileModel = trap_R_RegisterModel( "models/ammo/rocket/rocket.md3" );
      weaponInfo->missileSound = trap_S_RegisterSound( "sound/weapons/rocket/rockfly.wav", qfalse );
      weaponInfo->missileTrailFunc = CG_RocketTrail;
      weaponInfo->missileDlight = 200;
      weaponInfo->wiTrailTime = 2000;
      weaponInfo->trailRadius = 64;
      
      MAKERGB( weaponInfo->missileDlightColor, 1, 0.75f, 0 );
      MAKERGB( weaponInfo->flashDlightColor, 1, 0.75f, 0 );

      weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/rocket/rocklf1a.wav", qfalse );
      cgs.media.rocketExplosionShader = trap_R_RegisterShader( "rocketExplosion" );
      break;
...


cg_weapons.c::CG_MissileHitWall handles the effect
Code:
...
case WP_ROCKET_LAUNCHER:
      mod = cgs.media.dishFlashModel;
      shader = cgs.media.rocketExplosionShader;
      sfx = cgs.media.sfx_rockexp;
      mark = cgs.media.burnMarkShader;
      radius = 64;
      light = 300;
      isSprite = qtrue;
      duration = 1000;
      lightColor[0] = 1;
      lightColor[1] = 0.75;
      lightColor[2] = 0.0;
      if (cg_oldRocket.integer == 0) {
         // explosion sprite animation
         VectorMA( origin, 24, dir, sprOrg );
         VectorScale( dir, 64, sprVel );

         CG_ParticleExplosion( "explode1", sprOrg, sprVel, 1400, 20, 30 );
      }
      break;
...




Top
                 
Quake3World.com | Forum Index | Programming Discussion


Post new topic Reply to topic


cron
Quake3World.com
© ZeniMax. Zenimax, QUAKE III ARENA, Id Software and associated trademarks are trademarks of the ZeniMax group of companies. All rights reserved.
This is an unofficial fan website without any affiliation with or endorsement by ZeniMax.
All views and opinions expressed are those of the author.