Fix T40692, Checker Texture derivation on very large scales (1k).
It might still have a derivation on larger scales (10k or more), but we need some offset to avoid precision issues on unit coordinates.
This commit is contained in:
@@ -21,9 +21,9 @@
|
|||||||
|
|
||||||
float checker(point p)
|
float checker(point p)
|
||||||
{
|
{
|
||||||
p[0] = (p[0] + 0.00001) * 0.9999;
|
p[0] = (p[0] + 0.000001) * 0.999999;
|
||||||
p[1] = (p[1] + 0.00001) * 0.9999;
|
p[1] = (p[1] + 0.000001) * 0.999999;
|
||||||
p[2] = (p[2] + 0.00001) * 0.9999;
|
p[2] = (p[2] + 0.000001) * 0.999999;
|
||||||
|
|
||||||
int xi = (int)fabs(floor(p[0]));
|
int xi = (int)fabs(floor(p[0]));
|
||||||
int yi = (int)fabs(floor(p[1]));
|
int yi = (int)fabs(floor(p[1]));
|
||||||
|
@@ -21,9 +21,9 @@ CCL_NAMESPACE_BEGIN
|
|||||||
ccl_device_noinline float svm_checker(float3 p)
|
ccl_device_noinline float svm_checker(float3 p)
|
||||||
{
|
{
|
||||||
/* avoid precision issues on unit coordinates */
|
/* avoid precision issues on unit coordinates */
|
||||||
p.x = (p.x + 0.00001f)*0.9999f;
|
p.x = (p.x + 0.000001f)*0.999999f;
|
||||||
p.y = (p.y + 0.00001f)*0.9999f;
|
p.y = (p.y + 0.000001f)*0.999999f;
|
||||||
p.z = (p.z + 0.00001f)*0.9999f;
|
p.z = (p.z + 0.000001f)*0.999999f;
|
||||||
|
|
||||||
int xi = float_to_int(fabsf(floorf(p.x)));
|
int xi = float_to_int(fabsf(floorf(p.x)));
|
||||||
int yi = float_to_int(fabsf(floorf(p.y)));
|
int yi = float_to_int(fabsf(floorf(p.y)));
|
||||||
|
Reference in New Issue
Block a user