Changeset 3721
 Timestamp:
 Dec 23, 2014, 3:02:35 PM (7 years ago)
 Location:
 trunk
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/demos/test/simplex.cpp
r3720 r3721 43 43 { 44 44 float p = 0.5f * s.Interp(zoom * vec2(i, j)); 45 #if 045 #if 1 46 46 for (int k = 2; k < 128; k *= 2) 47 47 p += 0.5f / k * s.Interp(zoom * k * vec2(i, j)); 48 //p += 0.5f / k * lol::abs(s.Interp(zoom * k * vec2(i, j))); 48 49 #endif 49 50 data[i][j] = vec4(saturate(0.5f + p), 0.f, 0.f, 1.f); 
trunk/src/lol/math/simplex_interpolator.h
r3720 r3721 73 73 vec_t<float, N> const &gradient = this>m_gradients[origin]; 74 74 75 // FIXME: where does the 0.75 come from? 76 float dist = 0.5f  0.75f * sqlength(delta); 75 /* We use 4/3 because the maximum radius of influence for 76 * a given corner is sqrt(3/4). FIXME: check whether this 77 * holds for higher dimensions. */ 78 float dist = 1.0f  4.f / 3.f * sqlength(delta); 77 79 if (dist > 0) 78 80 { … … 89 91 } 90 92 91 // Approximative scaling factor “100” seems to work well92 // ie. gives a max value of 1 (a bit more in fact) for normed gradients93 93 // FIXME: another paper uses the value 70 for dimension 2, 32 for 94 94 // dimension 3, and 27 for dimension 4; find where this comes from. 95 return result * 100.f;95 return result * 70.f / 16.f; 96 96 } 97 97
Note: See TracChangeset
for help on using the changeset viewer.