mirror of
				https://bitbucket.org/mfeemster/fractorium.git
				synced 2025-10-31 01:10:24 -04:00 
			
		
		
		
	Force all float literals in opencl variations to correct precision
This avoids 'ambiguous call' errors on mac. It's probably not necessary to have changed every single instance, only the ones in functions with multiple signatures. However, it was easier and safer to do this automatically than manually.
This commit is contained in:
		| @ -30,7 +30,7 @@ public: | ||||
| 		intmax_t varIndex = IndexInXform(); | ||||
|  | ||||
| 		ss << "\t{\n" | ||||
| 		   << "\t\treal_t t = xform->m_VariationWeights[" << varIndex << "] / sqrt(precalcSumSquares + 1.0);\n" | ||||
| 		   << "\t\treal_t t = xform->m_VariationWeights[" << varIndex << "] / sqrt(precalcSumSquares + T(1.0));\n" | ||||
| 		   << "\n" | ||||
| 		   << "\t\tvOut.x = vIn.x * t;\n" | ||||
| 		   << "\t\tvOut.y = vIn.y * t;\n" | ||||
| @ -209,8 +209,8 @@ public: | ||||
| 		   << "\t\t{\n" | ||||
| 		   << "\t\t	real_t vx = vIn.x;\n" | ||||
| 		   << "\t\t	real_t vy = vIn.y;\n" | ||||
| 		   << "\t\t	real_t cx = (floor(vx / " << bwrapsCellsize << ") + 0.5) * " << bwrapsCellsize << ";\n" | ||||
| 		   << "\t\t	real_t cy = (floor(vy / " << bwrapsCellsize << ") + 0.5) * " << bwrapsCellsize << ";\n" | ||||
| 		   << "\t\t	real_t cx = (floor(vx / " << bwrapsCellsize << ") + T(0.5)) * " << bwrapsCellsize << ";\n" | ||||
| 		   << "\t\t	real_t cy = (floor(vy / " << bwrapsCellsize << ") + T(0.5)) * " << bwrapsCellsize << ";\n" | ||||
| 		   << "\t\t	real_t lx = vx - cx;\n" | ||||
| 		   << "\t\t	real_t ly = vy - cy;\n" | ||||
| 		   << "\n" | ||||
| @ -497,8 +497,8 @@ public: | ||||
| 		   << "\t\treal_t x = floor(vIn.x * " << invSize << ");\n" | ||||
| 		   << "\t\treal_t y = floor(vIn.y * " << invSize << ");\n" | ||||
| 		   << "\n" | ||||
| 		   << "\t\tvOut.x = " << v << " * (x + " << blurPixelizeScale << " * (MwcNext01(mwc) - 0.5) + 0.5);\n" | ||||
| 		   << "\t\tvOut.y = " << v << " * (y + " << blurPixelizeScale << " * (MwcNext01(mwc) - 0.5) + 0.5);\n" | ||||
| 		   << "\t\tvOut.x = " << v << " * (x + " << blurPixelizeScale << " * (MwcNext01(mwc) - T(0.5)) + T(0.5));\n" | ||||
| 		   << "\t\tvOut.y = " << v << " * (y + " << blurPixelizeScale << " * (MwcNext01(mwc) - T(0.5)) + T(0.5));\n" | ||||
| 		   << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" | ||||
| 		   << "\t}\n"; | ||||
|  | ||||
| @ -517,7 +517,7 @@ protected: | ||||
| 		string prefix = Prefix(); | ||||
|  | ||||
| 		m_Params.clear(); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_BlurPixelizeSize,  prefix + "blur_pixelize_size", T(0.1), REAL, EPS)); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_BlurPixelizeSize,  prefix + "blur_pixelize_size", T(T(0.1)), REAL, EPS)); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_BlurPixelizeScale, prefix + "blur_pixelize_scale", 1)); | ||||
| 		m_Params.push_back(ParamWithName<T>(true, &m_V,	      prefix + "blur_pixelize_v"));//Precalc. | ||||
| 		m_Params.push_back(ParamWithName<T>(true, &m_InvSize, prefix + "blur_pixelize_inv_size")); | ||||
| @ -756,7 +756,7 @@ public: | ||||
| 		   << "\t\t	if (" << bcbw << " != 0)\n" | ||||
| 		   << "\t\t	{\n" | ||||
| 		   << "\t\t		real_t ang = atan2(y, x);\n" | ||||
| 		   << "\t\t		real_t omega = (0.2 * " << bcbw << " * MwcNext01(mwc)) + 1;\n" | ||||
| 		   << "\t\t		real_t omega = (T(0.2) * " << bcbw << " * MwcNext01(mwc)) + 1;\n" | ||||
| 		   << "\t\t		real_t px = omega * cos(ang);\n" | ||||
| 		   << "\t\t		real_t py = omega * sin(ang);\n" | ||||
| 		   << "\n" | ||||
| @ -892,8 +892,8 @@ public: | ||||
| 		string v = "parVars[" + ToUpper(m_Params[i++].Name()) + index;//Precalcs only, no params. | ||||
|  | ||||
| 		ss << "\t{\n" | ||||
| 		   << "\t\tvOut.x = " << v << " * (MwcNext01(mwc) - 0.5);\n" | ||||
| 		   << "\t\tvOut.y = " << v << " * (MwcNext01(mwc) - 0.5);\n" | ||||
| 		   << "\t\tvOut.x = " << v << " * (MwcNext01(mwc) - T(0.5));\n" | ||||
| 		   << "\t\tvOut.y = " << v << " * (MwcNext01(mwc) - T(0.5));\n" | ||||
| 		   << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" | ||||
| 		   << "\t}\n"; | ||||
|  | ||||
| @ -996,7 +996,7 @@ public: | ||||
|  | ||||
| 		ss << "\t{\n" | ||||
| 		   << "\t\tvOut.x = vOut.y = 0;\n" | ||||
| 		   << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) - 2.0);\n" | ||||
| 		   << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) - T(2.0));\n" | ||||
| 		   << "\t}\n"; | ||||
|  | ||||
| 		return ss.str(); | ||||
| @ -1151,7 +1151,7 @@ public: | ||||
|  | ||||
| 		ss << "\t{\n" | ||||
| 		   << "\t\treal_t angle = MwcNext01(mwc) * M_2PI;\n" | ||||
| 		   << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) - 2.0);\n" | ||||
| 		   << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] * (MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) + MwcNext01(mwc) - T(2.0));\n" | ||||
| 		   << "\t\treal_t angle2 = MwcNext01(mwc) * M_PI;\n" | ||||
| 		   << "\t\treal_t sina = sin(angle);\n" | ||||
| 		   << "\t\treal_t cosa = cos(angle);\n" | ||||
| @ -1244,7 +1244,7 @@ public: | ||||
|  | ||||
| 		ss << "\t{\n" | ||||
| 		   << "\t\treal_t r2 = precalcSumSquares + SQR(vIn.z);\n" | ||||
| 		   << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] / Zeps(r2 * " << c2 << " + " << c2x << " * vIn.x - " << c2y << " * vIn.y + " << c2z << " * vIn.z + 1.0);\n" | ||||
| 		   << "\t\treal_t r = xform->m_VariationWeights[" << varIndex << "] / Zeps(r2 * " << c2 << " + " << c2x << " * vIn.x - " << c2y << " * vIn.y + " << c2z << " * vIn.z + T(1.0));\n" | ||||
| 		   << "\n" | ||||
| 		   << "\t\tvOut.x = r * (vIn.x + " << cx << " * r2);\n" | ||||
| 		   << "\t\tvOut.y = r * (vIn.y - " << cy << " * r2);\n" | ||||
| @ -1423,8 +1423,8 @@ public: | ||||
| 		string cr   = "parVars[" + ToUpper(m_Params[i++].Name()) + index; | ||||
|  | ||||
| 		ss << "\t{\n" | ||||
| 		   << "\t\treal_t roundX = (real_t)(int)(vIn.x >= 0 ? (int)(vIn.x + 0.5) : (int)(vIn.x - 0.5));\n" | ||||
| 		   << "\t\treal_t roundY = (real_t)(int)(vIn.y >= 0 ? (int)(vIn.y + 0.5) : (int)(vIn.y - 0.5));\n" | ||||
| 		   << "\t\treal_t roundX = (real_t)(int)(vIn.x >= 0 ? (int)(vIn.x + T(0.5)) : (int)(vIn.x - T(0.5)));\n" | ||||
| 		   << "\t\treal_t roundY = (real_t)(int)(vIn.y >= 0 ? (int)(vIn.y + T(0.5)) : (int)(vIn.y - T(0.5)));\n" | ||||
| 		   << "\t\treal_t offsetX = vIn.x - roundX;\n" | ||||
| 		   << "\t\treal_t offsetY = vIn.y - roundY;\n" | ||||
| 		   << "\n" | ||||
| @ -1486,9 +1486,9 @@ protected: | ||||
| 		string prefix = Prefix(); | ||||
|  | ||||
| 		m_Params.clear(); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_C,     prefix + "boarders2_c", T(0.5))); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_Left,  prefix + "boarders2_left", T(0.5))); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_Right, prefix + "boarders2_right", T(0.5))); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_C,     prefix + "boarders2_c", T(T(0.5)))); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_Left,  prefix + "boarders2_left", T(T(0.5)))); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_Right, prefix + "boarders2_right", T(T(0.5)))); | ||||
| 		m_Params.push_back(ParamWithName<T>(true, &m_AbsC, prefix + "boarders2_cabs"));//Precalc. | ||||
| 		m_Params.push_back(ParamWithName<T>(true, &m_Cl,   prefix + "boarders2_cl")); | ||||
| 		m_Params.push_back(ParamWithName<T>(true, &m_Cr,   prefix + "boarders2_cr")); | ||||
| @ -1653,9 +1653,9 @@ protected: | ||||
| 		string prefix = Prefix(); | ||||
|  | ||||
| 		m_Params.clear(); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_X,    prefix + "checks_x", T(0.5))); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_Y,    prefix + "checks_y", T(0.5))); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_Size, prefix + "checks_size", T(0.5))); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_X,    prefix + "checks_x", T(T(0.5)))); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_Y,    prefix + "checks_y", T(T(0.5)))); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_Size, prefix + "checks_size", T(T(0.5)))); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_Rnd,  prefix + "checks_rnd")); | ||||
| 		m_Params.push_back(ParamWithName<T>(true, &m_Cs,  prefix + "checks_cs"));//Precalc. | ||||
| 		m_Params.push_back(ParamWithName<T>(true, &m_Cx,  prefix + "checks_cx")); | ||||
| @ -1941,8 +1941,8 @@ public: | ||||
| 		string vv2     = "parVars[" + ToUpper(m_Params[i++].Name()) + index; | ||||
|  | ||||
| 		ss << "\t{\n" | ||||
| 		   << "\t\treal_t x = 0.5 * vIn.x + 0.5;\n" | ||||
| 		   << "\t\treal_t y = 0.5 * vIn.y + 0.5;\n" | ||||
| 		   << "\t\treal_t x = T(0.5) * vIn.x + T(0.5);\n" | ||||
| 		   << "\t\treal_t y = T(0.5) * vIn.y + T(0.5);\n" | ||||
| 		   << "\t\treal_t bx = Fabsmod(" << fr << " * x);\n" | ||||
| 		   << "\t\treal_t by = Fabsmod(" << fr << " * y);\n" | ||||
| 		   << "\t\treal_t oscnapx = Foscn(" << amountX << ", " << px << ");\n" | ||||
| @ -2172,7 +2172,7 @@ public: | ||||
| 			   << "\t\tvOut.x = vOut.y = vOut.z = 0;\n" | ||||
| 			   << "\n" | ||||
| 			   << "\t\tif (MwcNext01(mwc) < " << rootFace << ")\n" | ||||
| 			   << "\t\t	outPoint->m_Z = max(xform->m_VariationWeights[" << varIndex << "], 0.0);\n" | ||||
| 			   << "\t\t	outPoint->m_Z = max(xform->m_VariationWeights[" << varIndex << "], T(0.0));\n" | ||||
| 			   << "\t\telse\n" | ||||
| 			   << "\t\t	outPoint->m_Z = xform->m_VariationWeights[" << varIndex << "] * MwcNext01(mwc);\n" | ||||
| 			   << "\t}\n"; | ||||
| @ -2184,7 +2184,7 @@ public: | ||||
| 			   << "\t\tvOut.y = vIn.y;\n" | ||||
| 			   << "\n" | ||||
| 			   << "\t\tif (MwcNext01(mwc) < " << rootFace << ")\n" | ||||
| 			   << "\t\t	vOut.z = max(xform->m_VariationWeights[" << varIndex << "], 0.0);\n" | ||||
| 			   << "\t\t	vOut.z = max(xform->m_VariationWeights[" << varIndex << "], T(0.0));\n" | ||||
| 			   << "\t\telse\n" | ||||
| 			   << "\t\t	vOut.z = xform->m_VariationWeights[" << varIndex << "] * MwcNext01(mwc);\n" | ||||
| 			   << "\t}\n"; | ||||
| @ -2199,7 +2199,7 @@ protected: | ||||
| 		string prefix = Prefix(); | ||||
|  | ||||
| 		m_Params.clear(); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_RootFace, prefix + "extrude_root_face", T(0.5))); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_RootFace, prefix + "extrude_root_face", T(T(0.5)))); | ||||
| 	} | ||||
|  | ||||
| private: | ||||
| @ -2236,7 +2236,7 @@ public: | ||||
|  | ||||
| 		ss << "\t{\n" | ||||
| 		   << "\t\treal_t a = M_2PI / (precalcSqrtSumSquares + 1);\n" | ||||
| 		   << "\t\treal_t r = (precalcAtanyx * M_1_PI + 1) * 0.5;\n" | ||||
| 		   << "\t\treal_t r = (precalcAtanyx * M_1_PI + 1) * T(0.5);\n" | ||||
| 		   << "\t\treal_t s = sin(a);\n" | ||||
| 		   << "\t\treal_t c = cos(a);\n" | ||||
| 		   << "\n" | ||||
| @ -2293,11 +2293,11 @@ public: | ||||
| 		   << "\t\treal_t temp = vIn.y * " << natLog << ";\n" | ||||
| 		   << "\t\treal_t snum1 = sin(temp);\n" | ||||
| 		   << "\t\treal_t cnum1 = cos(temp);\n" | ||||
| 		   << "\t\ttemp = (vIn.x * M_PI + vIn.y * " << natLog << ") * -1.0;\n" | ||||
| 		   << "\t\ttemp = (vIn.x * M_PI + vIn.y * " << natLog << ") * -T(1.0);\n" | ||||
| 		   << "\t\treal_t snum2 = sin(temp);\n" | ||||
| 		   << "\t\treal_t cnum2 = cos(temp);\n" | ||||
| 		   << "\t\treal_t eradius1 = exp(vIn.x * " << natLog << ");\n" | ||||
| 		   << "\t\treal_t eradius2 = exp((vIn.x * " << natLog << " - vIn.y * M_PI) * -1.0);\n" | ||||
| 		   << "\t\treal_t eradius2 = exp((vIn.x * " << natLog << " - vIn.y * M_PI) * -T(1.0));\n" | ||||
| 		   << "\n" | ||||
| 		   << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * (eradius1 * cnum1 - eradius2 * cnum2) * " << five << ";\n" | ||||
| 		   << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * (eradius1 * snum1 - eradius2 * snum2) * " << five << ";\n" | ||||
| @ -2480,7 +2480,7 @@ public: | ||||
| 		   << "\n" | ||||
| 		   << "\t\tif (r > 1)\n" | ||||
| 		   << "\t\t{\n" | ||||
| 		   << "\t\t	if (MwcNext01(mwc) > 0.5)\n" | ||||
| 		   << "\t\t	if (MwcNext01(mwc) > T(0.5))\n" | ||||
| 		   << "\t\t	{\n" | ||||
| 		   << "\t\t		d = sqrt(r + vIn.x);\n" | ||||
| 		   << "\t\t		vOut.x = " << v2 << " * d;\n" | ||||
| @ -2496,7 +2496,7 @@ public: | ||||
| 		   << "\t\t}\n" | ||||
| 		   << "\t\telse\n" | ||||
| 		   << "\t\t{\n" | ||||
| 		   << "\t\t	if (MwcNext01(mwc) > 0.5)\n" | ||||
| 		   << "\t\t	if (MwcNext01(mwc) > T(0.5))\n" | ||||
| 		   << "\t\t	{\n" | ||||
| 		   << "\t\t		d = sqrt(r + vIn.x);\n" | ||||
| 		   << "\t\t		vOut.x = -(" << v2 << " * d);\n" | ||||
| @ -4279,12 +4279,12 @@ public: | ||||
| 		   << "\t\treal_t x2cx = " << c2x << " * vIn.x;\n" | ||||
| 		   << "\t\treal_t y2cy = " << c2y << " * vIn.y;\n" | ||||
| 		   << "\t\treal_t z2cz = " << c2z << " * vIn.z;\n" | ||||
| 		   << "\t\treal_t val = Zeps(" << c2 << " * r2 - x2cx - y2cy - z2cz + 1.0);\n" | ||||
| 		   << "\t\treal_t val = Zeps(" << c2 << " * r2 - x2cx - y2cy - z2cz + T(1.0));\n" | ||||
| 		   << "\t\treal_t d = xform->m_VariationWeights[" << varIndex << "] / val;\n" | ||||
| 		   << "\n" | ||||
| 		   << "\t\tvOut.x = d * (vIn.x * " << s2x << " + " << cx << " * (y2cy + z2cz - r2 - 1.0));\n" | ||||
| 		   << "\t\tvOut.y = d * (vIn.y * " << s2y << " + " << cy << " * (x2cx + z2cz - r2 - 1.0));\n" | ||||
| 		   << "\t\tvOut.z = d * (vIn.z * " << s2z << " + " << cz << " * (y2cy + x2cx - r2 - 1.0));\n" | ||||
| 		   << "\t\tvOut.x = d * (vIn.x * " << s2x << " + " << cx << " * (y2cy + z2cz - r2 - T(1.0)));\n" | ||||
| 		   << "\t\tvOut.y = d * (vIn.y * " << s2y << " + " << cy << " * (x2cx + z2cz - r2 - T(1.0)));\n" | ||||
| 		   << "\t\tvOut.z = d * (vIn.z * " << s2z << " + " << cz << " * (y2cy + x2cx - r2 - T(1.0)));\n" | ||||
| 		   << "\t}\n"; | ||||
|  | ||||
| 		return ss.str(); | ||||
| @ -4708,7 +4708,7 @@ protected: | ||||
| 		m_Params.clear(); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_Frequency, prefix + "ripple_frequency", 2)); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_Velocity,  prefix + "ripple_velocity", 1)); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_Amplitude, prefix + "ripple_amplitude", T(0.5))); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_Amplitude, prefix + "ripple_amplitude", T(T(0.5)))); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_CenterX,   prefix + "ripple_centerx")); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_CenterY,   prefix + "ripple_centery")); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_Phase,     prefix + "ripple_phase")); | ||||
| @ -4784,8 +4784,8 @@ public: | ||||
| 		ss << "\t{\n" | ||||
| 		   << "\t\treal_t c0 = " << ax << " / (1 + exp(" << sx << " * vIn.x));\n" | ||||
| 		   << "\t\treal_t c1 = " << ay << " / (1 + exp(" << sy << " * vIn.y));\n" | ||||
| 		   << "\t\treal_t x = (2 * (c0 - 0.5));\n" | ||||
| 		   << "\t\treal_t y = (2 * (c1 - 0.5));\n" | ||||
| 		   << "\t\treal_t x = (2 * (c0 - T(0.5)));\n" | ||||
| 		   << "\t\treal_t y = (2 * (c1 - T(0.5)));\n" | ||||
| 		   << "\n" | ||||
| 		   << "\t\tvOut.x = " << vv << " * x;\n" | ||||
| 		   << "\t\tvOut.y = " << vv << " * y;\n" | ||||
| @ -4935,8 +4935,8 @@ protected: | ||||
| 		string prefix = Prefix(); | ||||
|  | ||||
| 		m_Params.clear(); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_AmpX,  prefix + "sinusgrid_ampx", T(0.5))); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_AmpY,  prefix + "sinusgrid_ampy", T(0.5))); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_AmpX,  prefix + "sinusgrid_ampx", T(T(0.5)))); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_AmpY,  prefix + "sinusgrid_ampy", T(T(0.5)))); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_FreqX, prefix + "sinusgrid_freqx", 1)); | ||||
| 		m_Params.push_back(ParamWithName<T>(&m_FreqY, prefix + "sinusgrid_freqy", 1)); | ||||
| 		m_Params.push_back(ParamWithName<T>(true, &m_Fx, prefix + "sinusgrid_fx"));//Precalc. | ||||
| @ -5002,8 +5002,8 @@ public: | ||||
| 		string distort = "parVars[" + ToUpper(m_Params[i++].Name()) + index; | ||||
|  | ||||
| 		ss << "\t{\n" | ||||
| 		   << "\t\treal_t x = vIn.x * xform->m_VariationWeights[" << varIndex << "] * 0.05;\n" | ||||
| 		   << "\t\treal_t y = vIn.y * xform->m_VariationWeights[" << varIndex << "] * 0.05;\n" | ||||
| 		   << "\t\treal_t x = vIn.x * xform->m_VariationWeights[" << varIndex << "] * T(0.05);\n" | ||||
| 		   << "\t\treal_t y = vIn.y * xform->m_VariationWeights[" << varIndex << "] * T(0.05);\n" | ||||
| 		   << "\t\treal_t x2 = SQR(x);\n" | ||||
| 		   << "\t\treal_t y2 = SQR(y);\n" | ||||
| 		   << "\t\treal_t xPlusy = x + y;\n" | ||||
| @ -5202,8 +5202,8 @@ public: | ||||
| 		   << "\t\treal_t yn = r * sina;\n" | ||||
| 		   << "\t\treal_t siny = sin(" << freqX << " * yn);\n" | ||||
| 		   << "\t\treal_t sinx = sin(" << freqY << " * xn);\n" | ||||
| 		   << "\t\treal_t dx = xn + 0.5 * (" << scaleX << " * siny + fabs(xn) * " << incX << " * siny);\n" | ||||
| 		   << "\t\treal_t dy = yn + 0.5 * (" << scaleY << " * sinx + fabs(yn) * " << incY << " * sinx);\n" | ||||
| 		   << "\t\treal_t dx = xn + T(0.5) * (" << scaleX << " * siny + fabs(xn) * " << incX << " * siny);\n" | ||||
| 		   << "\t\treal_t dy = yn + T(0.5) * (" << scaleY << " * sinx + fabs(yn) * " << incY << " * sinx);\n" | ||||
| 		   << "\n" | ||||
| 		   << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * dx;\n" | ||||
| 		   << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * dy;\n" | ||||
| @ -5418,7 +5418,7 @@ public: | ||||
| 		   << "\t\treal_t dot02 = " << a << " * vIn.x + " << b << " * vIn.y;\n" | ||||
| 		   << "\t\treal_t dot11 = SQR(" << c << ") + SQR(" << d << ");\n" | ||||
| 		   << "\t\treal_t dot12 = " << c << " * vIn.x + " << d << " * vIn.y;\n" | ||||
| 		   << "\t\treal_t invDenom = 1.0 / (dot00 * dot11 - dot01 * dot01);\n" | ||||
| 		   << "\t\treal_t invDenom = T(1.0) / (dot00 * dot11 - dot01 * dot01);\n" | ||||
| 		   << "\t\treal_t u = (dot11 * dot02 - dot01 * dot12) * invDenom;\n" | ||||
| 		   << "\t\treal_t v = (dot00 * dot12 - dot01 * dot02) * invDenom;\n" | ||||
| 		   << "\t\treal_t um = sqrt(SQR(u) + SQR(vIn.x)) * Sign(u);\n" | ||||
| @ -5531,8 +5531,8 @@ public: | ||||
| 		intmax_t varIndex = IndexInXform(); | ||||
|  | ||||
| 		ss << "\t{\n" | ||||
| 		   << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sin(vIn.x) * (cosh(vIn.y) + 1.0) * Sqr(sin(vIn.x));\n" | ||||
| 		   << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * cos(vIn.x) * (cosh(vIn.y) + 1.0) * Sqr(sin(vIn.x));\n" | ||||
| 		   << "\t\tvOut.x = xform->m_VariationWeights[" << varIndex << "] * sin(vIn.x) * (cosh(vIn.y) + T(1.0)) * Sqr(sin(vIn.x));\n" | ||||
| 		   << "\t\tvOut.y = xform->m_VariationWeights[" << varIndex << "] * cos(vIn.x) * (cosh(vIn.y) + T(1.0)) * Sqr(sin(vIn.x));\n" | ||||
| 		   << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" | ||||
| 		   << "\t}\n"; | ||||
|  | ||||
| @ -5568,8 +5568,8 @@ public: | ||||
| 		ss << "\t{\n" | ||||
| 		   << "\t\treal_t d = xform->m_VariationWeights[" << varIndex << "] / precalcSumSquares;\n" | ||||
| 		   << "\n" | ||||
| 		   << "\t\tvOut.x = d * sin(vIn.x) * (cosh(vIn.y) + 1.0) * Sqr(sin(vIn.x));\n" | ||||
| 		   << "\t\tvOut.y = d * cos(vIn.x) * (cosh(vIn.y) + 1.0) * Sqr(sin(vIn.x));\n" | ||||
| 		   << "\t\tvOut.x = d * sin(vIn.x) * (cosh(vIn.y) + T(1.0)) * Sqr(sin(vIn.x));\n" | ||||
| 		   << "\t\tvOut.y = d * cos(vIn.x) * (cosh(vIn.y) + T(1.0)) * Sqr(sin(vIn.x));\n" | ||||
| 		   << "\t\tvOut.z = xform->m_VariationWeights[" << varIndex << "] * vIn.z;\n" | ||||
| 		   << "\t}\n"; | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Simon Detheridge
					Simon Detheridge