mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 14:02:59 +00:00 
			
		
		
		
	fixed numerical artifacts in Nil
This commit is contained in:
		| @@ -408,7 +408,8 @@ namespace nilv { | |||||||
|  |  | ||||||
|       "for(int it=0; it<50; it++) {" |       "for(int it=0; it<50; it++) {" | ||||||
|         "float w = (wmin + wmax) / 2.;" |         "float w = (wmin + wmax) / 2.;" | ||||||
|         "float z = b * b * (s + (sin(w) - w)/(cos(w) - 1.)) + w;" |         // the formula after ':' produces visible numerical artifacts for w~0 | ||||||
|  |         "float z = b * b * (s + (abs(w) < .1 ? w/3. + w*w*w/90. + w*w*w*w*w/2520.: (sin(w) - w)/(cos(w) - 1.))) + w;" | ||||||
|         "if(h[2] > z) wmin = w;" |         "if(h[2] > z) wmin = w;" | ||||||
|         "else wmax = w;" |         "else wmax = w;" | ||||||
|         "}" |         "}" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue