diff options
author | Wilrik de Loose <wilrik@wilrik.nl> | 2008-01-09 15:04:24 (GMT) |
---|---|---|
committer | Wilrik de Loose <wilrik@wilrik.nl> | 2008-01-09 15:04:24 (GMT) |
commit | 19104903490d2c67f9b385804a7f89df8f6fc48c (patch) | |
tree | 5996af7dddde1e4ae3513cfebf8d2c99d281cae5 /Smoke/palette.c | |
parent | eac915db1c03ec7a59286d529ca578cf11b21650 (diff) | |
download | 2iv35-19104903490d2c67f9b385804a7f89df8f6fc48c.zip 2iv35-19104903490d2c67f9b385804a7f89df8f6fc48c.tar.gz 2iv35-19104903490d2c67f9b385804a7f89df8f6fc48c.tar.bz2 |
nieuwe colormap fire
Diffstat (limited to 'Smoke/palette.c')
-rw-r--r-- | Smoke/palette.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/Smoke/palette.c b/Smoke/palette.c index 91b944f..a17c143 100644 --- a/Smoke/palette.c +++ b/Smoke/palette.c @@ -155,30 +155,14 @@ static struct color4f trip_like_i_do(float value) return return_value; } + static struct color4f colormap_fire(float value) { struct color4f return_value; - /* Colormap Fire - * A fire effect deals with two parts, first a drop from red to yellow (halfway) - * during which time the Red component remains full e.g. 1. The Green component is - * slowly added to turn the red into orange, and then yellow (R & G =Y). After this - * point, the Red and Green component (e.g. yellow) have to drop simulataniously - * to go from yellow down to black. - */ - return_value.r = 0; - return_value.b = 0; - return_value.g = 0; - if (value <= (0.01)) { - /* whilst value is 0 - 0.5 both red and green equally change to create yellow */ - return_value.r = return_value.g = value; - } else { - /* whilst value is 0.5 - 1 Red is always fully on while the Green component is - * added in steps to go from red to orange to yellow. - */ - return_value.g = 0.9f - value; - return_value.r = 0.8f; // not 1, makes red deeper, more intense - } + return_value.r = value; + return_value.g = value / 5.0f; + return_value.b = 0.0f; return return_value; } |