This commit is contained in:
mfeemster
2015-03-21 16:28:42 -07:00
10 changed files with 286 additions and 271 deletions

View File

@ -45,7 +45,7 @@ public:
string z = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
ss << "\t{\n"
<< "\t\treal_t t = 0.25 * (precalcSumSquares + SQR(vIn.z)) + 1;\n"
<< "\t\treal_t t = (real_t)(0.25) * (precalcSumSquares + SQR(vIn.z)) + 1;\n"
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] / t;\n"
<< "\n"
<< "\t\tvOut.x = vIn.x * r * " << x << ";\n"
@ -158,12 +158,12 @@ public:
string seed = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
ss << "\t{\n"
<< "\t\tint m = (int)floor(0.5 * vIn.x / " << sc << ");\n"
<< "\t\tint n = (int)floor(0.5 * vIn.y / " << sc << ");\n"
<< "\t\tint m = (int)floor((real_t)(0.5) * vIn.x / " << sc << ");\n"
<< "\t\tint n = (int)floor((real_t)(0.5) * vIn.y / " << sc << ");\n"
<< "\t\treal_t x = vIn.x - (m * 2 + 1) * " << sc << ";\n"
<< "\t\treal_t y = vIn.y - (n * 2 + 1) * " << sc << ";\n"
<< "\t\treal_t u = Zeps(Hypot(x, y));\n"
<< "\t\treal_t v = (0.3 + 0.7 * CircleLinearDiscreteNoise2(m + 10, n + 3)) * " << sc << ";\n"
<< "\t\treal_t v = ((real_t)(0.3) + (real_t)(0.7) * CircleLinearDiscreteNoise2(m + 10, n + 3)) * " << sc << ";\n"
<< "\t\treal_t z1 = CircleLinearDiscreteNoise2((int)(m + " << seed << "), n);\n"
<< "\n"
<< "\t\tif ((z1 < " << dens1 << ") && (u < v))\n"
@ -320,8 +320,8 @@ public:
<< "\t\t{\n"
<< "\t\t x = " << x << " * (1 - 2 * MwcNext01(mwc));\n"
<< "\t\t y = " << y << " * (1 - 2 * MwcNext01(mwc));\n"
<< "\t\t m = (int)floor(0.5 * x / " << sc << ");\n"
<< "\t\t n = (int)floor(0.5 * y / " << sc << ");\n"
<< "\t\t m = (int)floor((real_t)(0.5) * x / " << sc << ");\n"
<< "\t\t n = (int)floor((real_t)(0.5) * y / " << sc << ");\n"
<< "\t\t x = x - (m * 2 + 1) * " << sc << ";\n"
<< "\t\t y = y - (n * 2 + 1) * " << sc << ";\n"
<< "\t\t u = Hypot(x, y);\n"
@ -329,7 +329,7 @@ public:
<< "\t\t if (++iters > 10)\n"
<< "\t\t break;\n"
<< "\t\t}\n"
<< "\t\twhile ((CircleRandDiscreteNoise2((int)(m + " << seed << "), n) > " << dens << ") || (u > (0.3 + 0.7 * CircleRandDiscreteNoise2(m + 10, n + 3)) * " << sc << "));\n"
<< "\t\twhile ((CircleRandDiscreteNoise2((int)(m + " << seed << "), n) > " << dens << ") || (u > ((real_t)(0.3) + (real_t)(0.7) * CircleRandDiscreteNoise2(m + 10, n + 3)) * " << sc << "));\n"
<< "\n"
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (x + (m * 2 + 1) * " << sc << ");\n"
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (y + (n * 2 + 1) * " << sc << ");\n"
@ -445,14 +445,14 @@ public:
<< "\n"
<< "\t\tCircleTrans1Trans(" << x << ", " << y << ", vIn.x, vIn.y, &ux, &uy);\n"
<< "\n"
<< "\t\tint m = (int)floor(0.5 * ux / " << sc << ");\n"
<< "\t\tint n = (int)floor(0.5 * uy / " << sc << ");\n"
<< "\t\tint m = (int)floor((real_t)(0.5) * ux / " << sc << ");\n"
<< "\t\tint n = (int)floor((real_t)(0.5) * uy / " << sc << ");\n"
<< "\n"
<< "\t\tx = ux - (m * 2 + 1) * " << sc << ";\n"
<< "\t\ty = uy - (n * 2 + 1) * " << sc << ";\n"
<< "\t\tu = Hypot(x, y);\n"
<< "\n"
<< "\t\tif ((CircleTrans1DiscreteNoise2((int)(m + " << seed << "), n) > " << dens << ") || (u > (0.3 + 0.7 * CircleTrans1DiscreteNoise2(m + 10, n + 3)) * " << sc << "))\n"
<< "\t\tif ((CircleTrans1DiscreteNoise2((int)(m + " << seed << "), n) > " << dens << ") || (u > ((real_t)(0.3) + (real_t)(0.7) * CircleTrans1DiscreteNoise2(m + 10, n + 3)) * " << sc << "))\n"
<< "\t\t{\n"
<< "\t\t ux = ux;\n"
<< "\t\t uy = uy;\n"
@ -485,8 +485,8 @@ public:
"\n"
"void CircleTrans1Trans(real_t a, real_t b, real_t x, real_t y, real_t* x1, real_t* y1)\n"
"{\n"
" *x1 = (x - a) * 0.5 + a;\n"
" *y1 = (y - b) * 0.5 + b;\n"
" *x1 = (x - a) * T(0.5) + a;\n"
" *y1 = (y - b) * T(0.5) + b;\n"
"}\n"
"\n"
"void CircleTrans1CircleR(real_t mx, real_t my, real_t sc, real_t seed, real_t dens, real_t* ux, real_t* vy, uint2* mwc)\n"
@ -498,10 +498,10 @@ public:
" {\n"
" x = fabs(mx) * (1 - 2 * MwcNext01(mwc));\n"
" y = fabs(my) * (1 - 2 * MwcNext01(mwc));\n"
" m = (int)floor(0.5 * x / sc);\n"
" n = (int)floor(0.5 * y / sc);\n"
" m = (int)floor(T(0.5) * x / sc);\n"
" n = (int)floor(T(0.5) * y / sc);\n"
" alpha = M_2PI * MwcNext01(mwc);\n"
" u = 0.3 + 0.7 * CircleTrans1DiscreteNoise2(m + 10, n + 3);\n"
" u = T(0.3) + T(0.7) * CircleTrans1DiscreteNoise2(m + 10, n + 3);\n"
" x = u * cos(alpha);\n"
" y = u * sin(alpha);\n"
"\n"
@ -681,7 +681,7 @@ public:
ss << "\t{\n"
<< "\t\tint useNode = MwcNext(mwc) & 7;\n"
<< "\t\treal_t exnze, wynze, znxy;\n"
<< "\t\treal_t lattd = xform->m_VariationWeights[" << varIndex << "] * 0.5;\n"
<< "\t\treal_t lattd = xform->m_VariationWeights[" << varIndex << "] * (real_t)(0.5);\n"
<< "\t\treal_t px, py, pz;\n"
<< "\n"
<< "\t\texnze = 1 - (" << smoothStyle << " * (1 - (cos(atan2(vIn.x, vIn.z)))));\n"
@ -690,7 +690,7 @@ public:
<< "\t\tif (" << smoothStyle << " > 1)\n"
<< "\t\t znxy = 1 - (" << smoothStyle << " * (1 - ((exnze + wynze) / 2 * " << smoothStyle << ")));\n"
<< "\t\telse\n"
<< "\t\t znxy = 1 - (" << smoothStyle << " * (1 - ((exnze + wynze) * 0.5)));\n";
<< "\t\t znxy = 1 - (" << smoothStyle << " * (1 - ((exnze + wynze) * (real_t)(0.5))));\n";
if (m_VarType == VARTYPE_PRE)
{
@ -915,7 +915,7 @@ public:
<< "\t\t{\n"
<< "\t\t exnze = cos(atan2(vIn.x, vIn.z));\n"
<< "\t\t wynze = sin(atan2(vIn.y, vIn.z));\n"
<< "\t\t znxy = (exnze + wynze) * 0.5;\n"
<< "\t\t znxy = (exnze + wynze) * (real_t)(0.5);\n"
<< "\t\t}\n"
<< "\t\telse\n"
<< "\t\t{\n"
@ -1045,8 +1045,8 @@ public:
intmax_t varIndex = IndexInXform();
ss << "\t{\n"
<< "\t\treal_t expx = exp(vIn.x) * 0.5;\n"
<< "\t\treal_t expnx = 0.25 / expx;\n"
<< "\t\treal_t expx = exp(vIn.x) * (real_t)(0.5);\n"
<< "\t\treal_t expnx = (real_t)(0.25) / expx;\n"
<< "\t\treal_t boot = vIn.z == 0 ? precalcAtanyx : vIn.z;\n"
<< "\t\treal_t tmp = xform->m_VariationWeights[" << varIndex << "] / (expx + expnx - (cos(vIn.y) * cos(boot)));\n"
<< "\n"
@ -1117,8 +1117,8 @@ public:
<< "\t\treal_t cv = cos(vIn.y);\n"
<< "\t\treal_t cucv = cu * cv;\n"
<< "\t\treal_t sucv = su * cv;\n"
<< "\t\treal_t x = pow(fabs(cucv), " << xpow << ") + (cucv * " << xpow << ") + (0.25 * atOmegaX);\n"
<< "\t\treal_t y = pow(fabs(sucv), " << ypow << ") + (sucv * " << ypow << ") + (0.25 * atOmegaY);\n"
<< "\t\treal_t x = pow(fabs(cucv), " << xpow << ") + (cucv * " << xpow << ") + ((real_t)(0.25) * atOmegaX);\n"
<< "\t\treal_t y = pow(fabs(sucv), " << ypow << ") + (sucv * " << ypow << ") + ((real_t)(0.25) * atOmegaY);\n"
<< "\t\treal_t z = pow(fabs(sv), " << zpow << ") + sv * " << zpow << ";\n"
<< "\n"
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * x;\n"
@ -1373,13 +1373,13 @@ public:
<< "\n"
<< "\t\t vOut.x = r * vIn.x;\n"
<< "\t\t vOut.y = r * vIn.y;\n"
<< "\t\t vOut.z = r * efTez * 0.5;\n"
<< "\t\t vOut.z = r * efTez * (real_t)(0.5);\n"
<< "\t\t}\n"
<< "\t\telse\n"
<< "\t\t{\n"
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * vIn.x;\n"
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * vIn.y;\n"
<< "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * efTez * 0.5;\n"
<< "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * efTez * (real_t)(0.5);\n"
<< "\t\t}\n"
<< "\t}\n";
@ -1442,7 +1442,7 @@ public:
string tilt = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
ss << "\t{\n"
<< "\t\treal_t t = precalcSumSquares * 0.25 + 1;\n"
<< "\t\treal_t t = precalcSumSquares * (real_t)(0.25) + 1;\n"
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] / t;\n"
<< "\n"
<< "\t\tvOut.x = vIn.x * r * " << x << ";\n"
@ -1510,7 +1510,7 @@ public:
string scale = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
ss << "\t{\n"
<< "\t\treal_t avgxy = (vIn.x + vIn.y) * 0.5;\n"
<< "\t\treal_t avgxy = (vIn.x + vIn.y) * (real_t)(0.5);\n"
<< "\n"
<< "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (vIn.x + " << scale << " * sin(vIn.y * " << freq << "));\n"
<< "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (vIn.y + " << scale << " * sin(vIn.x * " << freq << "));\n"
@ -1571,7 +1571,7 @@ public:
string thickness = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
ss << "\t{\n"
<< "\t\tint sl = (int)(MwcNext01(mwc) * " << slices << " + 0.5);\n"
<< "\t\tint sl = (int)(MwcNext01(mwc) * " << slices << " + (real_t)(0.5));\n"
<< "\t\treal_t a = " << rotation << " + M_2PI * (sl + MwcNext01(mwc) * " << thickness << ") / " << slices << ";\n"
<< "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * MwcNext01(mwc);\n"
<< "\n"
@ -1863,8 +1863,8 @@ public:
<< "\t\tconst real_t xrng = vIn.x / " << xdist << ";\n"
<< "\t\tconst real_t yrng = vIn.y / " << ydist << ";\n"
<< "\n"
<< "\t\tvOut.x = " << xw << " * ((xrng - (int)xrng) * " << xwidth << " + (int)xrng + (0.5 - xpos) * " << onemx << ");\n"
<< "\t\tvOut.y = " << yw << " * ((yrng - (int)yrng) * " << ywidth << " + (int)yrng + (0.5 - ypos) * " << onemy << ");\n"
<< "\t\tvOut.x = " << xw << " * ((xrng - (int)xrng) * " << xwidth << " + (int)xrng + ((real_t)(0.5) - xpos) * " << onemx << ");\n"
<< "\t\tvOut.y = " << yw << " * ((yrng - (int)yrng) * " << ywidth << " + (int)yrng + ((real_t)(0.5) - ypos) * " << onemy << ");\n"
<< "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n"
<< "\t}\n";
@ -1983,7 +1983,7 @@ public:
string py = "parVars[" + ToUpper(m_Params[i++].Name()) + index;
ss << "\t{\n"
<< "\t\treal_t b = xform->m_VariationWeights[" << varIndex << "] / (precalcSumSquares * 0.25 + 1);\n"
<< "\t\treal_t b = xform->m_VariationWeights[" << varIndex << "] / (precalcSumSquares * (real_t)(0.25) + 1);\n"
<< "\t\treal_t roundX = rint(vIn.x);\n"
<< "\t\treal_t roundY = rint(vIn.y);\n"
<< "\t\treal_t offsetX = vIn.x - roundX;\n"
@ -1992,10 +1992,10 @@ public:
<< "\t\tvOut.x = vIn.x * b;\n"
<< "\t\tvOut.y = vIn.y * b;\n"
<< "\n"
<< "\t\tif (MwcNext01(mwc) >= 0.75)\n"
<< "\t\tif (MwcNext01(mwc) >= (real_t)(0.75))\n"
<< "\t\t{\n"
<< "\t\t vOut.x += xform->m_VariationWeights[" << varIndex << "] * (offsetX * 0.5 + roundX);\n"
<< "\t\t vOut.y += xform->m_VariationWeights[" << varIndex << "] * (offsetY * 0.5 + roundY);\n"
<< "\t\t vOut.x += xform->m_VariationWeights[" << varIndex << "] * (offsetX * (real_t)(0.5) + roundX);\n"
<< "\t\t vOut.y += xform->m_VariationWeights[" << varIndex << "] * (offsetY * (real_t)(0.5) + roundY);\n"
<< "\t\t}\n"
<< "\t\telse\n"
<< "\t\t{\n"
@ -2003,26 +2003,26 @@ public:
<< "\t\t {\n"
<< "\t\t if (offsetX >= 0)\n"
<< "\t\t {\n"
<< "\t\t vOut.x += xform->m_VariationWeights[" << varIndex << "] * (offsetX * 0.5 + roundX + " << x << ");\n"
<< "\t\t vOut.y += xform->m_VariationWeights[" << varIndex << "] * (offsetY * 0.5 + roundY + " << y << " * offsetY / offsetX);\n"
<< "\t\t vOut.x += xform->m_VariationWeights[" << varIndex << "] * (offsetX * (real_t)(0.5) + roundX + " << x << ");\n"
<< "\t\t vOut.y += xform->m_VariationWeights[" << varIndex << "] * (offsetY * (real_t)(0.5) + roundY + " << y << " * offsetY / offsetX);\n"
<< "\t\t }\n"
<< "\t\t else\n"
<< "\t\t {\n"
<< "\t\t vOut.x += xform->m_VariationWeights[" << varIndex << "] * (offsetX * 0.5 + roundX - " << y << ");\n"
<< "\t\t vOut.y += xform->m_VariationWeights[" << varIndex << "] * (offsetY * 0.5 + roundY - " << y << " * offsetY / offsetX);\n"
<< "\t\t vOut.x += xform->m_VariationWeights[" << varIndex << "] * (offsetX * (real_t)(0.5) + roundX - " << y << ");\n"
<< "\t\t vOut.y += xform->m_VariationWeights[" << varIndex << "] * (offsetY * (real_t)(0.5) + roundY - " << y << " * offsetY / offsetX);\n"
<< "\t\t }\n"
<< "\t\t }\n"
<< "\t\t else\n"
<< "\t\t {\n"
<< "\t\t if (offsetY >= 0)\n"
<< "\t\t {\n"
<< "\t\t vOut.y += xform->m_VariationWeights[" << varIndex << "] * (offsetY * 0.5 + roundY + " << y << ");\n"
<< "\t\t vOut.x += xform->m_VariationWeights[" << varIndex << "] * (offsetX * 0.5 + roundX + offsetX / offsetY * " << y << ");\n"
<< "\t\t vOut.y += xform->m_VariationWeights[" << varIndex << "] * (offsetY * (real_t)(0.5) + roundY + " << y << ");\n"
<< "\t\t vOut.x += xform->m_VariationWeights[" << varIndex << "] * (offsetX * (real_t)(0.5) + roundX + offsetX / offsetY * " << y << ");\n"
<< "\t\t }\n"
<< "\t\t else\n"
<< "\t\t {\n"
<< "\t\t vOut.y += xform->m_VariationWeights[" << varIndex << "] * (offsetY * 0.5 + roundY - " << y << ");\n"
<< "\t\t vOut.x += xform->m_VariationWeights[" << varIndex << "] * (offsetX * 0.5 + roundX - offsetX / offsetY * " << x << ");\n"
<< "\t\t vOut.y += xform->m_VariationWeights[" << varIndex << "] * (offsetY * (real_t)(0.5) + roundY - " << y << ");\n"
<< "\t\t vOut.x += xform->m_VariationWeights[" << varIndex << "] * (offsetX * (real_t)(0.5) + roundX - offsetX / offsetY * " << x << ");\n"
<< "\t\t }\n"
<< "\t\t }\n"
<< "\t\t}\n"
@ -2181,8 +2181,8 @@ public:
<< "\t\tconst real_t ay = MwcNext0505(mwc);\n"
<< "\t\tconst real_t az = MwcNext0505(mwc);\n"
<< "\t\tconst real_t r = sqrt(Sqr(vIn.x - " << x0 << ") + Sqr(vIn.y - " << y0 << ") + Sqr(vIn.z - " << z0 << "));\n"
<< "\t\tconst real_t rc = ((" << invert << " != 0 ? max(1 - r, 0.0) : max(r, 0.0)) - " << minDist << ") * " << internalScatter << ";\n"
<< "\t\tconst real_t rs = max(rc, 0.0);\n"
<< "\t\tconst real_t rc = ((" << invert << " != 0 ? max(1 - r, (real_t)(0.0)) : max(r, (real_t)(0.0))) - " << minDist << ") * " << internalScatter << ";\n"
<< "\t\tconst real_t rs = max(rc, (real_t)(0.0));\n"
<< "\n"
<< "\t\treal_t sigma, phi, rad, sigmas, sigmac, phis, phic;\n"
<< "\t\treal_t scale, denom;\n"
@ -2209,7 +2209,7 @@ public:
<< "\t\t vOut.z = xform->m_VariationWeights[" << varIndex << "] * (rad * sigmas);\n"
<< "\t\t break;\n"
<< "\t\t case 2:\n"
<< "\t\t scale = Clamp(rs, 0, 0.9) + 0.1;\n"
<< "\t\t scale = Clamp(rs, 0, (real_t)(0.9)) + (real_t)(0.1);\n"
<< "\t\t denom = 1 / scale;\n"
<< "\t\t vOut.x = xform->m_VariationWeights[" << varIndex << "] * Lerp(vIn.x, floor(vIn.x * denom) + scale * ax, " << mulX << " * rs) + " << mulX << " * pow(ax, " << boxPow << ") * rs * denom;\n"
<< "\t\t vOut.y = xform->m_VariationWeights[" << varIndex << "] * Lerp(vIn.y, floor(vIn.y * denom) + scale * ay, " << mulY << " * rs) + " << mulY << " * pow(ay, " << boxPow << ") * rs * denom;\n"
@ -2361,8 +2361,8 @@ public:
<< "\t\tconst real_t randz = MwcNext0505(mwc);\n"
<< "\t\tconst real_t randc = MwcNext0505(mwc);\n"
<< "\t\tconst real_t distA = sqrt(Sqr(vIn.x - " << x0 << ") + Sqr(vIn.y - " << y0 << ") + Sqr(vIn.z - " << z0 << "));\n"
<< "\t\tconst real_t distB = " << invert << " != 0 ? max(1 - distA, 0.0) : max(distA, 0.0);\n"
<< "\t\tconst real_t dist = max((distB - " << minDist << ") * " << rMax<< ", 0.0);\n"
<< "\t\tconst real_t distB = " << invert << " != 0 ? max(1 - distA, (real_t)(0.0)) : max(distA, (real_t)(0.0));\n"
<< "\t\tconst real_t dist = max((distB - " << minDist << ") * " << rMax<< ", (real_t)(0.0));\n"
<< "\n"
<< "\t\tswitch ((int)" << type << ")\n"
<< "\t\t{\n"
@ -2370,7 +2370,7 @@ public:
<< "\t\t vOut.x = vIn.x + " << mulX << " * randx * dist;\n"
<< "\t\t vOut.y = vIn.y + " << mulY << " * randy * dist;\n"
<< "\t\t vOut.z = vIn.z + " << mulZ << " * randz * dist;\n"
<< "\t\t outPoint->m_ColorX = fabs(fmod(outPoint->m_ColorX + " << mulC << " * randc * dist, 1.0));\n"
<< "\t\t outPoint->m_ColorX = fabs(fmod(outPoint->m_ColorX + " << mulC << " * randc * dist, (real_t)(1.0)));\n"
<< "\t\t break;\n"
<< "\t\t case 1:\n"
<< "\t\t if (vIn.x == 0 && vIn.y == 0 && vIn.z == 0)\n"
@ -2393,7 +2393,7 @@ public:
<< "\t\t vOut.x = r * sigmac * phic;\n"
<< "\t\t vOut.y = r * sigmac * phis;\n"
<< "\t\t vOut.z = r * sigmas;\n"
<< "\t\t outPoint->m_ColorX = fabs(fmod(outPoint->m_ColorX + " << mulC << " * randc * dist, 1.0));\n"
<< "\t\t outPoint->m_ColorX = fabs(fmod(outPoint->m_ColorX + " << mulC << " * randc * dist, (real_t)(1.0)));\n"
<< "\t\t }\n"
<< "\t\t break;\n"
<< "\t\t case 2:\n"
@ -2409,7 +2409,7 @@ public:
<< "\t\t vOut.x = vIn.x + " << mulX << " * rad * sigmac * phic;\n"
<< "\t\t vOut.y = vIn.y + " << mulY << " * rad * sigmac * phis;\n"
<< "\t\t vOut.z = vIn.z + " << mulZ << " * rad * sigmas;\n"
<< "\t\t outPoint->m_ColorX = fabs(fmod(outPoint->m_ColorX + " << mulC << " * randc * dist, 1.0));\n"
<< "\t\t outPoint->m_ColorX = fabs(fmod(outPoint->m_ColorX + " << mulC << " * randc * dist, (real_t)(1.0)));\n"
<< "\t\t break;\n"
<< "\t\t }\n"
<< "\t\t}\n"
@ -2584,7 +2584,7 @@ public:
<< "\t\t break;\n"
<< "\t\t}\n"
<< "\n"
<< "\t\tconst real_t dist = max(((" << invertDist << " != 0 ? max(1 - radius, 0.0) : max(radius, 0.0)) - " << minDist << ") * " << rMax << ", 0.0);\n"
<< "\t\tconst real_t dist = max(((" << invertDist << " != 0 ? max(1 - radius, (real_t)(0.0)) : max(radius, (real_t)(0.0))) - " << minDist << ") * " << rMax << ", (real_t)(0.0));\n"
<< "\n"
<< "\t\tswitch ((int)" << blurType << ")\n"
<< "\t\t{\n"
@ -2601,7 +2601,7 @@ public:
<< "\t\t vOut.x = vIn.x + " << mulX << " * rad * sigmac * phic;\n"
<< "\t\t vOut.y = vIn.y + " << mulY << " * rad * sigmac * phis;\n"
<< "\t\t vOut.z = vIn.z + " << mulZ << " * rad * sigmas;\n"
<< "\t\t outPoint->m_ColorX = fabs(fmod(outPoint->m_ColorX + " << mulC << " * randc * dist, 1.0));\n"
<< "\t\t outPoint->m_ColorX = fabs(fmod(outPoint->m_ColorX + " << mulC << " * randc * dist, (real_t)(1.0)));\n"
<< "\t\t }\n"
<< "\t\t break;\n"
<< "\t\tcase 1:\n"
@ -2625,7 +2625,7 @@ public:
<< "\t\t vOut.x = r * sigmac * phic;\n"
<< "\t\t vOut.y = r * sigmac * phis;\n"
<< "\t\t vOut.z = r * sigmas;\n"
<< "\t\t outPoint->m_ColorX = fabs(fmod(outPoint->m_ColorX + " << mulC << " * randc * dist, 1.0));\n"
<< "\t\t outPoint->m_ColorX = fabs(fmod(outPoint->m_ColorX + " << mulC << " * randc * dist, (real_t)(1.0)));\n"
<< "\t\t }\n"
<< "\t\t break;\n"
<< "\t\tcase 2:\n"
@ -2635,7 +2635,7 @@ public:
<< "\t\t vOut.x = vIn.x + LogMap(" << mulX << ") * LogScale(randx) * coeff,\n"
<< "\t\t vOut.y = vIn.y + LogMap(" << mulY << ") * LogScale(randy) * coeff,\n"
<< "\t\t vOut.z = vIn.z + LogMap(" << mulZ << ") * LogScale(randz) * coeff,\n"
<< "\t\t outPoint->m_ColorX = fabs(fmod(outPoint->m_ColorX + LogMap(" << mulC << ") * LogScale(randc) * coeff, 1.0));\n"
<< "\t\t outPoint->m_ColorX = fabs(fmod(outPoint->m_ColorX + LogMap(" << mulC << ") * LogScale(randc) * coeff, (real_t)(1.0)));\n"
<< "\t\t }\n"
<< "\t\t break;\n"
<< "\t\t}\n"