Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2007-11-23 17:48:26 +0300
committerTon Roosendaal <ton@blender.org>2007-11-23 17:48:26 +0300
commitaf26256da477025d95af5138809d5d07f124d37d (patch)
tree13d985db03f09474a5a51db27a9dad09480565b5 /source/blender/render/intern
parent885593ca21e2c8cc6f15eb9c1cd841c1fa20fa4b (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.
Diffstat (limited to 'source/blender/render/intern')
-rw-r--r--source/blender/render/intern/source/imagetexture.c9
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;
}