Fix T44548: Cycles Tube Mapping off / not compatible with BI
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 30 Apr 2015 09:21:32 +0000 (14:21 +0500)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 30 Apr 2015 09:27:16 +0000 (14:27 +0500)
Was a typo in original implementation, probably a result of some code reshuffle
happened for optimization reasons.

intern/cycles/util/util_math.h

index f48625ec95d176a9ee0dee1b06a0450c810dfe09..2262f8fdbb7fee0ac447b9a22ad48f7ea5a99e73 100644 (file)
@@ -1472,7 +1472,7 @@ ccl_device_inline float2 map_to_tube(const float3 co)
        len = sqrtf(co.x * co.x + co.y * co.y);
        if(len > 0.0f) {
                u = (1.0f - (atan2f(co.x / len, co.y / len) / M_PI_F)) * 0.5f;
-               v = (co.x + 1.0f) * 0.5f;
+               v = (co.z + 1.0f) * 0.5f;
        }
        else {
                u = v = 0.0f;