Added lit particle emissive support.

This commit is contained in:
Justin Marshall
2026-05-24 14:07:55 -07:00
parent 56bb2f004f
commit 4e6d4a281f
49 changed files with 34640 additions and 87 deletions
+19
View File
@@ -252,6 +252,9 @@ static bool IsParticleStageToken(const idToken& token) {
if (!token.Icmp("fadeColor")) {
return true;
}
if (!token.Icmp("emissive") || !token.Icmp("emsive")) {
return true;
}
if (!token.Icmp("offset")) {
return true;
}
@@ -582,6 +585,16 @@ idParticleStage* idDeclParticle::ParseParticleStage(idLexer& src) {
stage->fadeColor[3] = src.ParseFloat();
continue;
}
if (!token.Icmp("emissive") || !token.Icmp("emsive")) {
if (src.ReadTokenOnLine(&token)) {
token.StripQuotes();
stage->emissive = atof(token.c_str());
}
else {
stage->emissive = 1.0f;
}
continue;
}
if (!token.Icmp("offset")) {
stage->offset[0] = src.ParseFloat();
stage->offset[1] = src.ParseFloat();
@@ -874,6 +887,9 @@ void idDeclParticle::WriteStage( idFile *f, idParticleStage *stage ) {
f->WriteFloatString( "\t\tcolor \t\t\t\t%.3f %.3f %.3f %.3f\n", stage->color.x, stage->color.y, stage->color.z, stage->color.w );
f->WriteFloatString( "\t\tfadeColor \t\t\t%.3f %.3f %.3f %.3f\n", stage->fadeColor.x, stage->fadeColor.y, stage->fadeColor.z, stage->fadeColor.w );
if ( stage->emissive > 0.0f ) {
f->WriteFloatString( "\t\temissive \t\t\t%.3f\n", stage->emissive );
}
f->WriteFloatString( "\t\toffset \t\t\t\t%.3f %.3f %.3f\n", stage->offset.x, stage->offset.y, stage->offset.z );
f->WriteFloatString( "\t\tgravity \t\t\t" );
@@ -996,6 +1012,7 @@ idParticleStage::idParticleStage( void ) {
// idParticleParm aspect
color.Zero();
fadeColor.Zero();
emissive = 0.0f;
fadeInFraction = 0.0f;
fadeOutFraction = 0.0f;
fadeIndexFraction = 0.0f;
@@ -1071,6 +1088,7 @@ void idParticleStage::Default() {
fadeColor.y = 0.0f;
fadeColor.z = 0.0f;
fadeColor.w = 0.0f;
emissive = 0.0f;
fadeInFraction = 0.1f;
fadeOutFraction = 0.25f;
fadeIndexFraction = 0.0f;
@@ -1698,6 +1716,7 @@ void idParticleStage::operator=( const idParticleStage &src ) {
aspect = src.aspect;
color = src.color;
fadeColor = src.fadeColor;
emissive = src.emissive;
fadeInFraction = src.fadeInFraction;
fadeOutFraction = src.fadeOutFraction;
fadeIndexFraction = src.fadeIndexFraction;