Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-05-01 16:59:54 +0000
committerStijn Buys <ingar@osirion.org>2008-05-01 16:59:54 +0000
commita22542f273de28d06ecaf2bd6fd741821e98512b (patch)
tree54ed82cf99f8bfe517c3ab418e1f62beac688d96 /src/render
parent4e5343ce9aa83a5c0b04bf744dd287fb56ff39fc (diff)
lights offset and frequency
Diffstat (limited to 'src/render')
-rw-r--r--src/render/draw.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc
index d125420..741eb3d 100644
--- a/src/render/draw.cc
+++ b/src/render/draw.cc
@@ -392,7 +392,7 @@ void draw_pass_model_lights()
gl::begin(gl::Quads);
- const float light_size = 0.0625;
+
for (std::map<unsigned int, core::Entity *>::iterator it=core::Entity::registry.begin(); it != core::Entity::registry.end(); it++) {
core::Entity *entity = (*it).second;
@@ -400,9 +400,15 @@ void draw_pass_model_lights()
if ( test_drawfx_distance(entity) && (entity->model()->model_light.size())) {
for (std::list<core::Light *>::iterator lit = entity->model()->model_light.begin(); lit != entity->model()->model_light.end(); lit++) {
- if (!(*lit)->strobe() || (( core::application()->time() - floorf(core::application()->time()) ) < 0.5f)) {
+ // strobe frequency
+ float t = 1.0f;
+ if ((*lit)->strobe())
+ t = (core::application()->time() + entity->fuzz() + (*lit)->offset()) * (*lit)->frequency();
+
+ if (!(*lit)->strobe() || (( t - floorf(t)) < 0.5f)) {
math::Vector3f location = entity->location() + (entity->axis() * (*lit)->location());
float n = dotproduct(camera_axis.forward(), (camera_eye-location));
+ float light_size = 0.0625 * (*lit)->radius();
if (n < 0) {
math::Color color((*lit)->color());