Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/draw.cc')
-rw-r--r--src/render/draw.cc35
1 files changed, 24 insertions, 11 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc
index 9ebe2cc..4cf5571 100644
--- a/src/render/draw.cc
+++ b/src/render/draw.cc
@@ -939,21 +939,27 @@ void draw_pass_model_fx(float elapsed)
continue; // next light
}
}
-
- // default alpha is 0.8
- a = 0.8f;
+
+ // entity color overrides light color
+ // light color overrides engine color
if (light->entity()) {
color.assign(entity->color());
+ } else if (light->has_color()) {
+ color.assign(light->color());
} else if (light->engine()) {
color.assign(entity->model()->enginecolor());
- a *= thrust;
} else {
color.assign(light->color());
}
+
+ // default alpha is 0.8, engine flag alters alpha
+ a = 0.8f;
+ if (light->engine()) {
+ a *= thrust;
+ }
color.a = a;
- location.assign(entity->location() + (entity->axis() * light->location()) * modelscale);
-
+ location.assign(entity->location() + (entity->axis() * light->location()) * modelscale);
light_size = light->radius() * modelscale;
// track OpenGL state changes
@@ -1010,24 +1016,31 @@ void draw_pass_model_fx(float elapsed)
// calulcate viewing angle factor
flare_axis.assign(entity->axis() * flare->axis());
a = math::absf(dotproduct(flare_axis.forward(), Camera::axis().forward()));
- if (a < 0.01f) {
+ if (a < 0.001f) {
continue; // next flare
}
- // alpha decreases with viewing angle
- a *= 0.8f;
+ // entity color overrides light color
+ // light color overrides engine color
if (flare->entity()) {
color.assign(entity->color());
+ } else if (flare->has_color()) {
+ color.assign(flare->color());
} else if (flare->engine()) {
color.assign(entity->model()->enginecolor());
- a *= thrust;
} else {
color.assign(flare->color());
}
+
+ // default alpha is 0.8, engine flag alters alpha
+ // alpha decreases with viewing angle
+ a *= 0.8f;
+ if (flare->engine()) {
+ a *= thrust;
+ }
color.a = a;
location.assign(entity->location() + (entity->axis() * flare->location()) * modelscale );
-
light_size = flare->radius() * modelscale;
// track OpenGL state changes