Revision 1585ba24
Added by Leszek Koltunski over 5 years ago
src/main/java/org/distorted/examples/aroundtheworld/AroundTheWorldEffectsManager.java | ||
---|---|---|
78 | 78 |
|
79 | 79 |
// Fragment effects: |
80 | 80 |
// a) change color of the skin to more brown and less red (CHROMA) |
81 |
private Static4D aSkinColorRegion; |
|
81 |
private Static3D aSkinColorCenter; |
|
82 |
private Static3D aSkinColorRegion; |
|
82 | 83 |
private Static3D aChromaSkin; |
83 | 84 |
private Static1D aChromaSkinFactor; |
84 | 85 |
private Dynamic1D aChromaSkinDyn; |
85 | 86 |
// b) darken both eyes (2 x SMOOTH_CHROMA) |
86 |
private Static4D aLEyeColorRegion, aREyeColorRegion; |
|
87 |
private Static3D aLEyeColorCenter, aREyeColorCenter; |
|
88 |
private Static3D aLEyeColorRegion, aREyeColorRegion; |
|
87 | 89 |
private Static3D aChromaEyes; |
88 | 90 |
private Static1D aChromaEyesFactor; |
89 | 91 |
private Dynamic1D aChromaEyesDyn; |
... | ... | |
117 | 119 |
private Dynamic2D bLipsDyn; |
118 | 120 |
// Fragment effects |
119 | 121 |
// a) make the whole face darker (CHROMA) |
120 |
private Static4D bSkinColorRegion; |
|
122 |
private Static3D bSkinColorCenter; |
|
123 |
private Static3D bSkinColorRegion; |
|
121 | 124 |
private Static3D bChromaSkin; |
122 | 125 |
private Static1D bChromaSkinFactor; |
123 | 126 |
private Dynamic1D bChromaSkinDyn; |
124 | 127 |
// b) move both eyes back to whiteness (2 x SMOOTH CHROMA) |
125 |
private Static4D bLEyeColorRegion, bREyeColorRegion; |
|
128 |
private Static3D bLEyeColorCenter, bREyeColorCenter; |
|
129 |
private Static3D bLEyeColorRegion, bREyeColorRegion; |
|
126 | 130 |
private Static3D bChromaEyes; |
127 | 131 |
private Static1D bChromaEyesFactor; |
128 | 132 |
private Dynamic1D bChromaEyesDyn; |
129 | 133 |
// c) darken both pupils (2 x SMOOTH_CHROMA) |
130 |
private Static4D bLPupilColorRegion, bRPupilColorRegion; |
|
134 |
private Static3D bLPupilColorCenter, bRPupilColorCenter; |
|
135 |
private Static3D bLPupilColorRegion, bRPupilColorRegion; |
|
131 | 136 |
private Static3D bChromaPupil; |
132 | 137 |
private Static1D bChromaPupilFactor; |
133 | 138 |
private Dynamic1D bChromaPupilDyn; |
... | ... | |
188 | 193 |
aEyebrowsDyn.add(aEyebrowsFactor); |
189 | 194 |
|
190 | 195 |
// Fragment Effects |
191 |
aSkinColorRegion = new Static4D(300,300,600,600); |
|
192 |
aLEyeColorRegion = new Static4D(172,230,29,25); |
|
193 |
aREyeColorRegion = new Static4D(423,230,29,25); |
|
196 |
aSkinColorCenter = new Static3D(300,300,0); |
|
197 |
aSkinColorRegion = new Static3D(600,600,600); |
|
198 |
aLEyeColorCenter = new Static3D(172,230,0); |
|
199 |
aLEyeColorRegion = new Static3D(29,25,25); |
|
200 |
aREyeColorCenter = new Static3D(423,230,0); |
|
201 |
aREyeColorRegion = new Static3D(29,25,25); |
|
194 | 202 |
|
195 | 203 |
aChromaSkin = new Static3D(0.5f, 0.5f, 0.5f); |
196 | 204 |
aChromaEyes = new Static3D(0.5f, 0.14f, 0.14f); |
... | ... | |
235 | 243 |
bLipsDyn.add(bLipsFactor); |
236 | 244 |
|
237 | 245 |
// Fragment Effects |
238 |
bSkinColorRegion = new Static4D(300,300,600,600); |
|
239 |
bLEyeColorRegion = new Static4D(158,241,55,24); |
|
240 |
bREyeColorRegion = new Static4D(436,241,55,24); |
|
241 |
bLPupilColorRegion = new Static4D(166,230,28,23); |
|
242 |
bRPupilColorRegion = new Static4D(431,230,28,23); |
|
246 |
bSkinColorCenter = new Static3D(300,300,0); |
|
247 |
bSkinColorRegion = new Static3D(600,600,600); |
|
248 |
bLEyeColorCenter = new Static3D(158,241,0); |
|
249 |
bLEyeColorRegion = new Static3D(55,24,50); |
|
250 |
bREyeColorCenter = new Static3D(436,241,0); |
|
251 |
bREyeColorRegion = new Static3D(55,24,50); |
|
252 |
bLPupilColorCenter = new Static3D(166,230,0); |
|
253 |
bLPupilColorRegion = new Static3D(28,23,25); |
|
254 |
bRPupilColorCenter = new Static3D(431,230,0); |
|
255 |
bRPupilColorRegion = new Static3D(28,23,25); |
|
243 | 256 |
|
244 | 257 |
bChromaSkin = new Static3D(0.4f, 0.25f, 0.25f); |
245 | 258 |
bChromaEyes = new Static3D(1.0f, 1.0f, 1.0f); |
... | ... | |
269 | 282 |
effects.apply( new VertexEffectSink(wLipsDyn, wLipsCenter, wLipsRegion) ); |
270 | 283 |
|
271 | 284 |
// ASIANNESS |
272 |
effects.apply( new VertexEffectDistort(aLipsNoseDyn, aLipsNoseCenter, aLipsNoseRegion) );
|
|
273 |
effects.apply( new VertexEffectPinch(aNoseBroaderDyn, aNoseBroaderCenter, aNoseBroaderRegion) ); |
|
274 |
effects.apply( new VertexEffectDistort( aNostrilsDyn, aNostrilsCenter, aNostrilsRegion) );
|
|
275 |
effects.apply( new VertexEffectSwirl( aLEyeDyn, aLEyeCenter, aEyesRegion) );
|
|
276 |
effects.apply( new VertexEffectSwirl( aREyeDyn, aREyeCenter, aEyesRegion) );
|
|
277 |
effects.apply( new VertexEffectDistort( aEyebrowsDyn, aEyebrowsCenter, aEyebrowsRegion) );
|
|
285 |
effects.apply( new VertexEffectDistort(aLipsNoseDyn , aLipsNoseCenter , aLipsNoseRegion ) );
|
|
286 |
effects.apply( new VertexEffectPinch (aNoseBroaderDyn, aNoseBroaderCenter, aNoseBroaderRegion) );
|
|
287 |
effects.apply( new VertexEffectDistort( aNostrilsDyn , aNostrilsCenter , aNostrilsRegion ) );
|
|
288 |
effects.apply( new VertexEffectSwirl ( aLEyeDyn , aLEyeCenter , aEyesRegion ) );
|
|
289 |
effects.apply( new VertexEffectSwirl ( aREyeDyn , aREyeCenter , aEyesRegion ) );
|
|
290 |
effects.apply( new VertexEffectDistort( aEyebrowsDyn , aEyebrowsCenter , aEyebrowsRegion ) );
|
|
278 | 291 |
|
279 |
effects.apply( new FragmentEffectChroma( aChromaSkinDyn, aChromaSkin, aSkinColorRegion, false) ); |
|
280 |
effects.apply( new FragmentEffectChroma( aChromaEyesDyn, aChromaEyes, aLEyeColorRegion, true ) ); |
|
281 |
effects.apply( new FragmentEffectChroma( aChromaEyesDyn, aChromaEyes, aREyeColorRegion, true ) ); |
|
292 |
effects.apply( new FragmentEffectChroma( aChromaSkinDyn, aChromaSkin, aSkinColorCenter, aSkinColorRegion, false) );
|
|
293 |
effects.apply( new FragmentEffectChroma( aChromaEyesDyn, aChromaEyes, aLEyeColorCenter, aLEyeColorRegion, true ) );
|
|
294 |
effects.apply( new FragmentEffectChroma( aChromaEyesDyn, aChromaEyes, aREyeColorCenter, aREyeColorRegion, true ) );
|
|
282 | 295 |
|
283 | 296 |
// BLACKNESS |
284 |
effects.apply( new VertexEffectPinch( bFaceDyn, bFaceCenter, bFaceRegion ) );
|
|
285 |
effects.apply( new VertexEffectDistort( bTipLowerDyn, bTipLowerCenter, bTipLowerRegion ) );
|
|
286 |
effects.apply( new VertexEffectPinch( bWholeNoseDyn, bWholeNoseCenter, bWholeNoseRegion ) );
|
|
287 |
effects.apply( new VertexEffectPinch( bNoseBroaderDyn, bNoseBroaderCenter, bNoseBroaderRegion ) ); |
|
288 |
effects.apply( new VertexEffectPinch( bLipsDyn, bLipsCenter, bLipsRegion ) );
|
|
289 |
|
|
290 |
effects.apply( new FragmentEffectChroma( bChromaSkinDyn, bChromaSkin, bSkinColorRegion, false ) );
|
|
291 |
effects.apply( new FragmentEffectChroma( bChromaEyesDyn, bChromaEyes, bLEyeColorRegion, true ) );
|
|
292 |
effects.apply( new FragmentEffectChroma( bChromaEyesDyn, bChromaEyes, bREyeColorRegion, true ) );
|
|
293 |
effects.apply( new FragmentEffectChroma( bChromaPupilDyn, bChromaPupil, bLPupilColorRegion, true) );
|
|
294 |
effects.apply( new FragmentEffectChroma( bChromaPupilDyn, bChromaPupil, bRPupilColorRegion, true) );
|
|
297 |
effects.apply( new VertexEffectPinch ( bFaceDyn , bFaceCenter , bFaceRegion ) );
|
|
298 |
effects.apply( new VertexEffectDistort( bTipLowerDyn , bTipLowerCenter , bTipLowerRegion ) );
|
|
299 |
effects.apply( new VertexEffectPinch ( bWholeNoseDyn , bWholeNoseCenter , bWholeNoseRegion ) );
|
|
300 |
effects.apply( new VertexEffectPinch ( bNoseBroaderDyn, bNoseBroaderCenter, bNoseBroaderRegion ) );
|
|
301 |
effects.apply( new VertexEffectPinch ( bLipsDyn , bLipsCenter , bLipsRegion ) );
|
|
302 |
|
|
303 |
effects.apply( new FragmentEffectChroma( bChromaSkinDyn , bChromaSkin , bSkinColorCenter , bSkinColorRegion , false ) );
|
|
304 |
effects.apply( new FragmentEffectChroma( bChromaEyesDyn , bChromaEyes , bLEyeColorCenter , bLEyeColorRegion , true ) );
|
|
305 |
effects.apply( new FragmentEffectChroma( bChromaEyesDyn , bChromaEyes , bREyeColorCenter , bREyeColorRegion , true ) );
|
|
306 |
effects.apply( new FragmentEffectChroma( bChromaPupilDyn, bChromaPupil, bLPupilColorCenter, bLPupilColorRegion, true ) );
|
|
307 |
effects.apply( new FragmentEffectChroma( bChromaPupilDyn, bChromaPupil, bRPupilColorCenter, bRPupilColorRegion, true ) );
|
|
295 | 308 |
|
296 | 309 |
effects.apply( new FragmentEffectContrast(bContrastDyn) ); |
297 | 310 |
} |
Also available in: Unified diff
Make the Fragment effects truly 3D: change their 4D 'region' into a 3D 'center' (a point in 3D) and 3D 'region' (which is now a set of 3 radii defining an ellipsoid around the center)
Also corresponding changes to the applications.