diff options
author | Ton Roosendaal <ton@blender.org> | 2007-11-23 17:48:26 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2007-11-23 17:48:26 +0300 |
commit | af26256da477025d95af5138809d5d07f124d37d (patch) | |
tree | 13d985db03f09474a5a51db27a9dad09480565b5 | |
parent | 885593ca21e2c8cc6f15eb9c1cd841c1fa20fa4b (diff) |
Bugfix #7802
Fixed very old annoyance in alpha render: when using alpha textures images,
nicely premulled as Blender wants it, you still got dark outlines at the
edges. This because the blender shading pipeline also premultiplies.
Solution: de-premul image texture colors after sampling.
-rw-r--r-- | source/blender/render/intern/source/imagetexture.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c index 82abab62637..ff0b5f3d3cb 100644 --- a/source/blender/render/intern/source/imagetexture.c +++ b/source/blender/render/intern/source/imagetexture.c @@ -968,5 +968,14 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec, float *dxt, f texres->nor[2] = 2.f*(texres->tb - 0.5f); } + /* de-premul, this is being premulled in shade_input_do_shade() */ + if(texres->ta!=1.0f && texres->ta!=0.0f) { + fx= 1.0f/texres->ta; + texres->tr*= fx; + texres->tg*= fx; + texres->tb*= fx; + } + + return retval; } |