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.
This commit is contained in:
2007-11-23 14:48:26 +00:00
parent 885593ca21
commit af26256da4

View File

@@ -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;
}