minor change to r47872, multiply both values as unsigned ints before converting to...
authorCampbell Barton <ideasman42@gmail.com>
Thu, 14 Jun 2012 10:03:23 +0000 (10:03 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 14 Jun 2012 10:03:23 +0000 (10:03 +0000)
source/blender/compositor/operations/COM_GlareFogGlowOperation.cpp

index 0c2ae96aa51e5fd00746a5bd8831f440ff311736..a91445be4b5b49a2e665231e6ef4aa38f8e49364 100644 (file)
@@ -382,14 +382,14 @@ void GlareFogGlowOperation::generateGlare(float *data, MemoryBuffer *inputTile,
        BLI_init_rcti(&kernelRect, 0, sz, 0, sz);
        ckrn = new MemoryBuffer(NULL, &kernelRect);
 
-       scale = 0.25f * sqrtf((float)sz * sz);
+       scale = 0.25f * sqrtf((float)(sz * sz));
 
        for (y = 0; y < sz; ++y) {
-               v = 2.f * (y / (float)sz) - 1.f;
+               v = 2.f * (y / (float)sz) - 1.0f;
                for (x = 0; x < sz; ++x) {
-                       u = 2.f * (x / (float)sz) - 1.f;
+                       u = 2.f * (x / (float)sz) - 1.0f;
                        r = (u * u + v * v) * scale;
-                       d = -sqrtf(sqrtf(sqrtf(r))) * 9.f;
+                       d = -sqrtf(sqrtf(sqrtf(r))) * 9.0f;
                        fcol[0] = expf(d * cs_r), fcol[1] = expf(d * cs_g), fcol[2] = expf(d * cs_b);
                        // linear window good enough here, visual result counts, not scientific analysis
                        //w = (1.f-fabs(u))*(1.f-fabs(v));