Cool, I upped the max polys TO 768 and this was the result:
[youtube]-B5djNAkrM4[/youtube]
I was considering making modifications to the railtrail code so that it deteched smoke puffs that were too close, but I didn't even really change the amount of objects in the rail trail. I just turned cg_oldrail off, then changed the asset used, and replaced the old rail beam with the lightning beam, and set cg_railtrailtime to something like 50ms.
My main goal is to make the Q3 effects look as realistic as possible without actually adding any new assets. I replaced effects from the sg, mg, and plasma too, and they look WAAAY better. The size of plasma projectiles are randomized, so they flicker. MG bullets emit randomized small lights when hitting surfaces, and the duration is about 100ms, instead of whatever ridiculously large number they were before.
I also replaced the default rocket launcher with something much nicer using randomized particle effects, but I won't show it since it's not 100% done. They actually look really, really nice imho. Way better than the default rocket launcher effects, imho, which are nostalgic, but never made any real sense. I actually really want to make like a smoke entity list, so that if you shoot rockets or rails past any smoke, they'll all get pushed away from the oncoming projectile, or explosion. That'd be sweet.
Thanks for the super technical reply. I don't really know about the renderer at all. I've been trying to mess with it for my VR mod (
https://www.youtube.com/watch?v=ua75r1zfuzg&t=14s), but I haven't figured out how to get warping right. I don't know anything about image buffers or anything like that.
Btw, are you working on an ET project? If you are, and are looking for someone to mess with default effects, let me know. I'm also fully competent in character creation, though my interests have always been in getting a really good IK and animation system set up with Q3A movement speed. I enjoy character art, but am more in love with making art look really really nice using code.
Here's the new railtrail code:
Code: Select all
void CG_RailTrail (clientInfo_t *ci, vec3_t start, vec3_t end) {
vec3_t axis[36], move, move2, next_move, vec, temp;
float len;
int i, j, skip;
float groupRand;
localEntity_t *le;
refEntity_t *re;
float scaleRand;
float posOffs;
float posRand;
float colRand;
int randomize;
int randomizeRadius;
int randomizeDistance;
int randomizeMaxDist;
int lastRandDist;
int shift;
float lerp;
float oldScale;
float oldDist;
float scale;
#define RADIUS 4
#define ROTATION 1
#define SPACING 5
oldScale = 0;
shift = 0;
start[2] -4;
VectorCopy (start, move);
VectorSubtract (end, start, vec);
len = VectorNormalize (vec);
PerpendicularVector(temp, vec);
for (i = 0 ; i < 36; i++) {
RotatePointAroundVector(axis[i], vec, temp, i * 10);//banshee 2.4 was 10
}
le = CG_AllocLocalEntity();
re = &le->refEntity;
le->leType = LE_FADE_RGB;
le->startTime = cg.time;
le->endTime = cg.time + cg_railTrailTime.value;
le->lifeRate = 1.0 / (le->endTime - le->startTime);
re->shaderTime = cg.time / 1000.0f;
re->reType = RT_RAIL_CORE;
//re->customShader = cgs.media.railCoreShader;
re->customShader = cgs.media.lightningShader;
VectorCopy(start, re->origin);
VectorCopy(end, re->oldorigin);
re->shaderRGBA[0] = ci->color1[0] * 255;
re->shaderRGBA[1] = ci->color1[1] * 255;
re->shaderRGBA[2] = ci->color1[2] * 255;
re->shaderRGBA[3] = 255;
le->color[0] = ci->color1[0] * 0.75;
le->color[1] = ci->color1[1] * 0.75;
le->color[2] = ci->color1[2] * 0.75;
le->color[3] = 1.0f;
AxisClear( re->axis );
VectorMA(move, 20, vec, move);
VectorCopy(move, next_move);
VectorScale (vec, SPACING, vec);
if (cg_oldRail.integer != 0) {
// nudge down a bit so it isn't exactly in center
re->origin[2] -= 8;
re->oldorigin[2] -= 8;
return;
}
skip = -1;
lastRandDist = 0;
randomizeMaxDist = 750;
randomizeDistance = rand() % randomizeMaxDist;
j = 18;
//Com_Printf("%f\n", len);
//Com_Printf("%i\n", ((((int)len)-(((int)len) % SPACING)) / SPACING));
//Com_Printf("%i\n\n", (((int)len) % SPACING));
for (i = 0; i < len; i += SPACING) {
if (i != skip) {
if(i>randomizeDistance){
lastRandDist = i;
randomizeDistance = (rand() % randomizeMaxDist) + lastRandDist;
//randomizeDistance = 0;
if(randomizeDistance > len){
randomizeDistance = (int)len;
}
shift = rand() % 360;
//Com_Printf("%i\n", randomizeDistance);
}
//scaleRandomizeTime
skip = i + SPACING;
le = CG_AllocLocalEntity();
re = &le->refEntity;
le->leFlags = LEF_PUFF_DONT_SCALE;
le->leType = LE_MOVE_SCALE_FADE;
le->startTime = cg.time;
le->endTime = cg.time + (i>>1) + fabs((crandom() * 2000)) + 2000;
le->lifeRate = 1.0 / (le->endTime - le->startTime);
//posOffs = 0;
//randomize = 0;
posOffs = 1;
randomize = 1;
if(randomize == 1){
scaleRand = 1;
posRand = 1;
colRand = 1;
} else {
scaleRand = 0;
posRand = 0;
colRand = 0;
}
scaleRand = 1;
//shift = 0;
scale = 30;
scale = fabs(( (.1 * sinf(DEG2RAD(i+shift)) * .25) + sinf(DEG2RAD((i/10) + shift)))) * scale;
oldScale = LerpPositionTemp(oldScale, scale, .75);
//Com_Printf("%f\n", (oldScale/40)-.5);
re->shaderTime = cg.time / 1000.0f;
re->reType = RT_SPRITE;
re->radius = ( scaleRand * (crandom() * 1.5) * oldScale) + 10;
re->rotation = rand() % 360;
re->customShader = cgs.media.shotgunSmokePuffShader;
//re->shaderRGBA[0] = ci->color2[0] * 255;
//re->shaderRGBA[1] = ci->color2[1] * 255;
//re->shaderRGBA[2] = ci->color2[2] * 255;
le->radius = 100;
groupRand = crandom();
re->shaderRGBA[0] = (colRand * (groupRand * 50)) +155;
re->shaderRGBA[1] = (colRand * (groupRand * 50)) +155;
re->shaderRGBA[2] = (colRand * (groupRand * 50)) +155;
re->shaderRGBA[3] = 255;
//le->color[0] = ci->color2[0] * 0.75;
//le->color[1] = ci->color2[1] * 0.75;
//le->color[2] = ci->color2[2] * 0.75;
le->color[0] = 0.75;
le->color[1] = 0.75;
le->color[2] = 0.75;
//le->color[3] = (colRand * (fabs(crandom() * .5 )-.75)) + 1;
//le->color[3] = .75;
le->color[3] = 1;
le->pos.trType = TR_LINEAR;
le->pos.trTime = cg.time;
VectorCopy( move, move2);
VectorMA(move2, RADIUS * ((oldScale/30) -.5) , axis[j], move2);
VectorCopy(move2, le->pos.trBase);
le->pos.trDelta[0] = axis[j][0]* ((oldScale /40) * posOffs * 50) ;
le->pos.trDelta[1] = axis[j][1]* ((oldScale /40) * posOffs * 50) ;
le->pos.trDelta[2] = axis[j][2]* ((oldScale /40) * posOffs * 50) + 10;
}
VectorAdd (move, vec, move);
j = j + ROTATION < 36 ? j + ROTATION : (j + ROTATION) % 36;
}
}