Fix T41921: MapUV node alpha setting broken.

The UV values includes the image width/height now. To restore the
previous method as close as possible (even though it is not documented
anywhere how this is supposed to work), we have to ignore this scaling.
This commit is contained in:
Lukas Tönne 2014-09-23 16:57:11 +02:00
parent ed4075cb34
commit 82c90a44c2

@ -62,7 +62,7 @@ void MapUVOperation::executePixelSampled(float output[4], float x, float y, Pixe
*/ */
float du = len_v2(deriv[0]); float du = len_v2(deriv[0]);
float dv = len_v2(deriv[1]); float dv = len_v2(deriv[1]);
float factor = 1.0f - threshold * (du + dv); float factor = 1.0f - threshold * (du / m_inputColorProgram->getWidth() + dv / m_inputColorProgram->getHeight());
if (factor < 0.f) alpha = 0.f; if (factor < 0.f) alpha = 0.f;
else alpha *= factor; else alpha *= factor;