diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-07-05 14:18:59 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-07-05 14:18:59 +0400 |
commit | c9f667a92e492636ee6989c9cefda3c6caafc843 (patch) | |
tree | 51a553d6bc3bd86627f596e0958a02dfc80de179 /source/blender/render | |
parent | 0f58a4c798a01975b78d17d8dc25efa4ec3a1cdf (diff) |
texture saturation option.
we'll need a do-version bump soon or this will convert 0.0 saturation to 1.0 on load.
Diffstat (limited to 'source/blender/render')
-rw-r--r-- | source/blender/render/intern/include/texture.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/render/intern/include/texture.h b/source/blender/render/intern/include/texture.h index 3e6fc8c5677..436b365b352 100644 --- a/source/blender/render/intern/include/texture.h +++ b/source/blender/render/intern/include/texture.h @@ -40,7 +40,13 @@ if(texres->tr<0.0) texres->tr= 0.0; \ texres->tg= tex->gfac*((texres->tg-0.5)*tex->contrast+tex->bright-0.5); \ if(texres->tg<0.0) texres->tg= 0.0; \ texres->tb= tex->bfac*((texres->tb-0.5)*tex->contrast+tex->bright-0.5); \ -if(texres->tb<0.0) texres->tb= 0.0; +if(texres->tb<0.0) texres->tb= 0.0; \ +if(tex->saturation != 1.0f) { \ + float _hsv[3]; \ + rgb_to_hsv(texres->tr, texres->tg, texres->tb, _hsv, _hsv+1, _hsv+2); \ + _hsv[1] *= tex->saturation; \ + hsv_to_rgb(_hsv[0], _hsv[1], _hsv[2], &texres->tr, &texres->tg, &texres->tb); \ +} \ struct HaloRen; |