Revision 0df17fad
Added by Leszek Koltunski almost 8 years ago
src/main/java/org/distorted/library/EffectNames.java | ||
---|---|---|
22 | 22 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
23 | 23 |
/** |
24 | 24 |
* Names of Effects one can apply to DistortedObjects. |
25 |
* <p> |
|
26 |
* Effect's 'unity' is a set of values which |
|
25 | 27 |
*/ |
26 | 28 |
public enum EffectNames |
27 | 29 |
{ |
28 | 30 |
// EFFECT NAME /////// EFFECT TYPE ////////////// UNITY ///////////////////////// |
29 |
|
|
31 |
|
|
32 |
///////////////////////////////////////////////////////////////////////////////// |
|
33 |
// MATRIX EFFECTS. |
|
34 |
// Always 7 Uniforms: 4 per-effect interpolated values + 3 dimensional center. |
|
35 |
/** |
|
36 |
* Rotate the whole Object around a center point (in angle-axis notation). |
|
37 |
* <p> |
|
38 |
* 7 Uniforms: (angle,axisX,axisY,axisZ,centerX,centerY,centerZ) |
|
39 |
* Unity: angle==0 |
|
40 |
*/ |
|
30 | 41 |
ROTATE ( EffectTypes.MATRIX , new float[] {0.0f} ), |
31 |
QUATERNION ( EffectTypes.MATRIX , new float[] {0.0f,0.0f,0.0f} ), // quaternion is a unity iff its axis (x,y,z) is (0,0,0) |
|
42 |
/** |
|
43 |
* Rotate the whole Object around a center point (in quaternion notation). |
|
44 |
* <p> |
|
45 |
* 7 Uniforms: (quatX,quatY,quatZ,quatW,centerX,centerY,centerZ) |
|
46 |
* Unity: (quatX,quatY,quatZ) = (0,0,0) |
|
47 |
*/ |
|
48 |
QUATERNION ( EffectTypes.MATRIX , new float[] {0.0f,0.0f,0.0f} ), |
|
49 |
/** |
|
50 |
* Move the whole Object by a vector. |
|
51 |
* <p> |
|
52 |
* 7 Uniforms: (vectorX,vectorY,vectorZ,UNUSED,UNUSED,UNUSED,UNUSED) |
|
53 |
* Unity: (vectorX,vectorY,vectorZ) = (0,0,0) |
|
54 |
*/ |
|
32 | 55 |
MOVE ( EffectTypes.MATRIX , new float[] {0.0f,0.0f,0.0f} ), |
56 |
/** |
|
57 |
* Scale the whole Object independently in all 3 dimensions. |
|
58 |
* <p> |
|
59 |
* 7 Uniforms: (scaleX,scaleY,scaleZ,UNUSED,UNUSED,UNUSED,UNUSED) |
|
60 |
* Unity: (scaleX,scaleY,scaleZ) = (1,1,1) |
|
61 |
*/ |
|
33 | 62 |
SCALE ( EffectTypes.MATRIX , new float[] {1.0f,1.0f,1.0f} ), |
63 |
/** |
|
64 |
* Shear the whole Object in 3 dimensions around a center point. |
|
65 |
* <p> |
|
66 |
* 7 Uniforms: (shearX,shearY,shearZ,UNUSED,centerX,centerY,centerZ) |
|
67 |
* Unity: (shearX,shearY,shearZ) = (0,0,0) |
|
68 |
*/ |
|
34 | 69 |
SHEAR ( EffectTypes.MATRIX , new float[] {0.0f,0.0f,0.0f} ), |
35 | 70 |
// add new Matrix effects here... |
36 |
|
|
71 |
|
|
72 |
///////////////////////////////////////////////////////////////////////////////// |
|
73 |
// VERTEX EFFECTS |
|
74 |
// Always 9 Uniforms: 3 per-effect interpolated values, 4-dimensional Region, |
|
75 |
// 2-dimensional center of the effect. |
|
76 |
/** |
|
77 |
* Apply a 3D vector of force to area around a point on the surface of the Object. |
|
78 |
* <p> |
|
79 |
* 9 Uniforms: (forceX,forceY,forceZ,regionX,regionY,regionRX,regionRY,centerX,centerY) |
|
80 |
* Unity: (forceX,forceY,forceZ) = (0,0,0) |
|
81 |
*/ |
|
37 | 82 |
DISTORT ( EffectTypes.VERTEX , new float[] {0.0f,0.0f,0.0f} ), // keep this the first VERT effect (reason: getType) |
83 |
/** |
|
84 |
* Deform the whole Object by applying a 2D vector of force to a center point. |
|
85 |
* <p> |
|
86 |
* 9 Uniforms: (forceX,forceY,UNUSED,UNUSED,UNUSED,UNUSED,UNUSED,centerX,centerY) |
|
87 |
* Unity: (forceX,forceY) = (0,0) |
|
88 |
*/ |
|
38 | 89 |
DEFORM ( EffectTypes.VERTEX , new float[] {0.0f,0.0f} ), |
90 |
/** |
|
91 |
* Pull (or push away) all points around a center point to (from) it. |
|
92 |
* <p> |
|
93 |
* 9 Uniforms: (sinkFactor,UNUSED,UNUSED,regionX,regionY,regionRX,regionRY,centerX,centerY) |
|
94 |
* Unity: sinkFactor = 1 |
|
95 |
*/ |
|
39 | 96 |
SINK ( EffectTypes.VERTEX , new float[] {1.0f} ), |
97 |
/** |
|
98 |
* Smoothly rotate a limited area around a center point. |
|
99 |
* <p> |
|
100 |
* 9 Uniforms: (swirlAngle,UNUSED,UNUSED,regionX,regionY,regionRX,regionRY,centerX,centerY) |
|
101 |
* Unity: swirlAngle = 0 |
|
102 |
*/ |
|
40 | 103 |
SWIRL ( EffectTypes.VERTEX , new float[] {0.0f} ), |
41 |
WAVE ( EffectTypes.VERTEX , new float[] {0.0f} ), |
|
42 | 104 |
// add new Vertex Effects here... |
43 |
|
|
105 |
|
|
106 |
///////////////////////////////////////////////////////////////////////////////// |
|
107 |
// FRAGMENT EFFECTS |
|
108 |
// Always 8 Uniforms: 4-per effect interpolated values, 4 dimensional Region. |
|
109 |
/** |
|
110 |
* Create square-shaped macroblocks. |
|
111 |
* <p> |
|
112 |
* 8 Uniforms: (macroblockSize,UNUSED,UNUSED,UNUSED, regionX, regionY, regionRX, regionRY) |
|
113 |
* Unity: macroblockSize = 1 |
|
114 |
*/ |
|
44 | 115 |
MACROBLOCK ( EffectTypes.FRAGMENT, new float[] {1.0f} ), // keep this the first FRAG effect (reason: getType) |
116 |
/** |
|
117 |
* Make a given Region (partially) transparent. |
|
118 |
* <p> |
|
119 |
* 8 Uniforms: (transparencyLevel,UNUSED,UNUSED,UNUSED, regionX, regionY, regionRX, regionRY) |
|
120 |
* Unity: transparencyLevel = 1 |
|
121 |
*/ |
|
45 | 122 |
ALPHA ( EffectTypes.FRAGMENT, new float[] {1.0f} ), |
123 |
/** |
|
124 |
* Make a given Region (partially) transparent. |
|
125 |
* Effect smoothly fades towards the edges of the region. |
|
126 |
* <p> |
|
127 |
* 8 Uniforms: (transparencyLevel,UNUSED,UNUSED,UNUSED, regionX, regionY, regionRX, regionRY) |
|
128 |
* Unity: transparencyLevel = 1 |
|
129 |
*/ |
|
46 | 130 |
SMOOTH_ALPHA ( EffectTypes.FRAGMENT, new float[] {1.0f} ), |
131 |
/** |
|
132 |
* Blend current color in the texture with a given color. |
|
133 |
* <p> |
|
134 |
* 8 Uniforms: (blendLevel,colorR,colorG,colorB, regionX, regionY, regionRX, regionRY) |
|
135 |
* Unity: blendLevel = 0 |
|
136 |
*/ |
|
47 | 137 |
CHROMA ( EffectTypes.FRAGMENT, new float[] {0.0f} ), |
138 |
/** |
|
139 |
* Smoothly blend current color in the texture with a given color. |
|
140 |
* <p> |
|
141 |
* 8 Uniforms: (blendLevel,colorR,colorG,colorB, regionX, regionY, regionRX, regionRY) |
|
142 |
* Unity: blendLevel = 0 |
|
143 |
*/ |
|
48 | 144 |
SMOOTH_CHROMA ( EffectTypes.FRAGMENT, new float[] {0.0f} ), |
145 |
/** |
|
146 |
* Change brightness level of a given Region. |
|
147 |
* <p> |
|
148 |
* 8 Uniforms: (brightnessLevel,UNUSED,UNUSED,UNUSED, regionX, regionY, regionRX, regionRY) |
|
149 |
* Unity: brightnessLevel = 1 |
|
150 |
*/ |
|
49 | 151 |
BRIGHTNESS ( EffectTypes.FRAGMENT, new float[] {1.0f} ), |
152 |
/** |
|
153 |
* Smoothly change brightness level of a given Region. |
|
154 |
* <p> |
|
155 |
* 8 Uniforms: (brightnessLevel,UNUSED,UNUSED,UNUSED, regionX, regionY, regionRX, regionRY) |
|
156 |
* Unity: brightnessLevel = 1 |
|
157 |
*/ |
|
50 | 158 |
SMOOTH_BRIGHTNESS( EffectTypes.FRAGMENT, new float[] {1.0f} ), |
159 |
/** |
|
160 |
* Change saturation level of a given Region. |
|
161 |
* <p> |
|
162 |
* 8 Uniforms: (saturationLevel,UNUSED,UNUSED,UNUSED, regionX, regionY, regionRX, regionRY) |
|
163 |
* Unity: saturationLevel = 1 |
|
164 |
*/ |
|
51 | 165 |
SATURATION ( EffectTypes.FRAGMENT, new float[] {1.0f} ), |
166 |
/** |
|
167 |
* Smoothly change saturation level of a given Region. |
|
168 |
* <p> |
|
169 |
* 8 Uniforms: (saturationLevel,UNUSED,UNUSED,UNUSED, regionX, regionY, regionRX, regionRY) |
|
170 |
* Unity: saturationLevel = 1 |
|
171 |
*/ |
|
52 | 172 |
SMOOTH_SATURATION( EffectTypes.FRAGMENT, new float[] {1.0f} ), |
173 |
/** |
|
174 |
* Change contrast level of a given Region. |
|
175 |
* <p> |
|
176 |
* 8 Uniforms: (contrastLevel,UNUSED,UNUSED,UNUSED, regionX, regionY, regionRX, regionRY) |
|
177 |
* Unity: contrastLevel = 1 |
|
178 |
*/ |
|
53 | 179 |
CONTRAST ( EffectTypes.FRAGMENT, new float[] {1.0f} ), |
54 |
SMOOTH_CONTRAST ( EffectTypes.FRAGMENT, new float[] {1.0f} ), |
|
55 |
HUE ( EffectTypes.FRAGMENT, new float[] {0.0f} ), |
|
56 |
SMOOTH_HUE ( EffectTypes.FRAGMENT, new float[] {0.0f} ); |
|
180 |
/** |
|
181 |
* Smoothly change contrast level of a given Region. |
|
182 |
* <p> |
|
183 |
* 8 Uniforms: (contrastLevel,UNUSED,UNUSED,UNUSED, regionX, regionY, regionRX, regionRY) |
|
184 |
* Unity: contrastLevel = 1 |
|
185 |
*/ |
|
186 |
SMOOTH_CONTRAST ( EffectTypes.FRAGMENT, new float[] {1.0f} ); |
|
57 | 187 |
// add new Fragment effects here... |
58 | 188 |
|
59 | 189 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
- Javadoc for EffectNames
- make Matrix effects consistent with the rest (center of effect as last parameter!)
- bugfix for yesterday's bugfix (we only want to send 'EFFECT_REMOVED' messages if it was really the Application that called 'abortAll' and not when we are cleaning up everything)