float *v3f, *t2f, *c4f;
particletexture_t *tex;
float right[3], up[3], size, ca;
- float alphascale = (1.0f / 65536.0f) * cl_particles_alpha.value * r_refdef.view.colorscale;
+ float alphascale = (1.0f / 65536.0f) * cl_particles_alpha.value;
float particle_vertex3f[BATCHSIZE*12], particle_texcoord2f[BATCHSIZE*8], particle_color4f[BATCHSIZE*16];
RSurf_ActiveWorldEntity();
blendmode = p->blendmode;
- c4f[0] = p->color[0] * colormultiplier[0];
- c4f[1] = p->color[1] * colormultiplier[1];
- c4f[2] = p->color[2] * colormultiplier[2];
- c4f[3] = p->alpha * colormultiplier[3];
switch (blendmode)
{
case PBLEND_INVALID:
case PBLEND_INVMOD:
+ c4f[0] = p->color[0] * (1.0f / 256.0f);
+ c4f[1] = p->color[1] * (1.0f / 256.0f);
+ c4f[2] = p->color[2] * (1.0f / 256.0f);
+ c4f[3] = p->alpha * colormultiplier[3];
+ // additive and modulate can just fade out in fog (this is correct)
+ if (r_refdef.fogenabled)
+ c4f[3] *= RSurf_FogVertex(p->org);
+ // collapse alpha into color for these blends (so that the particlefont does not need alpha on most textures)
+ c4f[0] *= c4f[3];
+ c4f[1] *= c4f[3];
+ c4f[2] *= c4f[3];
+ c4f[3] = 1;
+ break;
case PBLEND_ADD:
+ c4f[0] = p->color[0] * colormultiplier[0];
+ c4f[1] = p->color[1] * colormultiplier[1];
+ c4f[2] = p->color[2] * colormultiplier[2];
+ c4f[3] = p->alpha * colormultiplier[3];
// additive and modulate can just fade out in fog (this is correct)
if (r_refdef.fogenabled)
c4f[3] *= RSurf_FogVertex(p->org);
c4f[3] = 1;
break;
case PBLEND_ALPHA:
+ c4f[0] = p->color[0] * colormultiplier[0];
+ c4f[1] = p->color[1] * colormultiplier[1];
+ c4f[2] = p->color[2] * colormultiplier[2];
+ c4f[3] = p->alpha * colormultiplier[3];
// note: lighting is not cheap!
if (particletype[p->typeindex].lighting)
{
// were darkened by fog already, and we should not add fog color
// (because the background was not darkened, there is no fog color
// that was lost behind it).
- R_Texture_AddLayer(t, false, GL_SRC_ALPHA, (t->currentmaterialflags & MATERIALFLAG_BLENDED) ? GL_ONE : GL_ONE_MINUS_SRC_ALPHA, TEXTURELAYERTYPE_FOG, t->currentskinframe->fog, &t->currenttexmatrix, r_refdef.fogcolor[0] / r_refdef.view.colorscale, r_refdef.fogcolor[1] / r_refdef.view.colorscale, r_refdef.fogcolor[2] / r_refdef.view.colorscale, t->lightmapcolor[3]);
+ R_Texture_AddLayer(t, false, GL_SRC_ALPHA, (t->currentmaterialflags & MATERIALFLAG_BLENDED) ? GL_ONE : GL_ONE_MINUS_SRC_ALPHA, TEXTURELAYERTYPE_FOG, t->currentskinframe->fog, &t->currenttexmatrix, r_refdef.fogcolor[0], r_refdef.fogcolor[1], r_refdef.fogcolor[2], t->lightmapcolor[3]);
}
}
float vertex3f[12*3];
float texcoord2f[12*2];
- RSurf_ActiveCustomEntity(&identitymatrix, &identitymatrix, 0, 0, r_lightningbeam_color_red.value * r_refdef.view.colorscale, r_lightningbeam_color_green.value * r_refdef.view.colorscale, r_lightningbeam_color_blue.value * r_refdef.view.colorscale, 1, 12, vertex3f, texcoord2f, NULL, NULL, NULL, NULL, 6, r_lightningbeamelement3i, r_lightningbeamelement3s, false, false);
+ RSurf_ActiveCustomEntity(&identitymatrix, &identitymatrix, 0, 0, r_lightningbeam_color_red.value, r_lightningbeam_color_green.value, r_lightningbeam_color_blue.value, 1, 12, vertex3f, texcoord2f, NULL, NULL, NULL, NULL, 6, r_lightningbeamelement3i, r_lightningbeamelement3s, false, false);
if (r_lightningbeam_qmbtexture.integer && r_lightningbeamqmbtexture == NULL)
r_lightningbeams_setupqmbtexture();