-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathlibnoise-bestest.diff
66 lines (60 loc) · 2.15 KB
/
libnoise-bestest.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
Index: libnoise/noise/src/interp.h
===================================================================
--- libnoise.orig/noise/src/interp.h 2009-06-07 18:50:45.000000000 +0200
+++ libnoise/noise/src/interp.h 2009-06-07 18:51:39.000000000 +0200
@@ -105,6 +105,18 @@
return (6.0 * a5) - (15.0 * a4) + (10.0 * a3);
}
+ inline double SCurve7 (double a)
+ {
+ double a2 = a * a;
+ //double a3 = a2 * a;
+ double a4 = a2 * a2;
+ double a5 = a4 * a;
+ double a6 = a4 * a2;
+ double a7 = a5 * a2;
+ //return 6.0*a5 - 15.0*a4 + 10.0*a3;
+ return -20.0*a7 + 70.0*a6 - 84.0*a5 + 35.0*a4;
+ }
+
// @}
}
Index: libnoise/noise/src/noisegen.cpp
===================================================================
--- libnoise.orig/noise/src/noisegen.cpp 2009-06-07 18:51:18.000000000 +0200
+++ libnoise/noise/src/noisegen.cpp 2009-06-07 18:51:39.000000000 +0200
@@ -86,6 +86,11 @@
ys = SCurve5 (y - (double)y0);
zs = SCurve5 (z - (double)z0);
break;
+ case QUALITY_BESTEST:
+ xs = SCurve7 (x - (double)x0);
+ ys = SCurve7 (y - (double)y0);
+ zs = SCurve7 (z - (double)z0);
+ break;
}
// Now calculate the noise values at each vertex of the cube. To generate
@@ -189,6 +194,11 @@
ys = SCurve5 (y - (double)y0);
zs = SCurve5 (z - (double)z0);
break;
+ case QUALITY_BESTEST:
+ xs = SCurve7 (x - (double)x0);
+ ys = SCurve7 (y - (double)y0);
+ zs = SCurve7 (z - (double)z0);
+ break;
}
// Now calculate the noise values at each vertex of the cube. To generate
Index: libnoise/noise/src/noisegen.h
===================================================================
--- libnoise.orig/noise/src/noisegen.h 2009-06-07 18:51:18.000000000 +0200
+++ libnoise/noise/src/noisegen.h 2009-06-07 18:51:39.000000000 +0200
@@ -55,7 +55,9 @@
/// image, there are no "creasing" artifacts in the resulting image. This
/// is because the first and second derivatives of that function are
/// continuous at integer boundaries.
- QUALITY_BEST = 2
+ QUALITY_BEST = 2,
+
+ QUALITY_BESTEST = 3
};