Navigation

 Rocket Trail Colours Feature Type: Coding Tutorials     Added: 05/01  
  Author: Corven 

Something fun to play with. There’s a simple way to changing the rocket trail colours, all client side.

Coloured Trails

Code to be Added or Changed

cg_weapons.c

Open up cg_weapons.c and scroll down a bit and you will find the CG_RocketTrail heading. Near the bottom you will see this code:

smoke = CG_SmokePuff( lastPos, up,
wi->trailRadius,
1, 1, 1, 0.33,
wi->wiTrailTime,
t,
0,
cgs.media.smokePuffShader );

The line that has the 1, 1, 1, 0.33, is the one we want to change, originally its all white. For example, change that line to:
1, 0, 0, 0.33, // = red
Rocket trails will now be red! Here are some more examples:
0, 0, 1, 0.33, // = blue
0, 1, 0, 0.33, // = green

As you probably have figured out by now, the first number is the red amount, the second is the green amount and the third is the blue amount. (the forth is the alpha value, for blending) You can change these values to see all sorts of different coloured rocket trails. Here’s one that really looks cool:
1, 1, 0, 0.33, // = yellow

Comments »



  Page 1

  Comments ( 0 )


  Features Index

  Home

Copyright © 2001 MGON International AB - Privacy statement