1 |
7ba38011
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
// Copyright 2016 Leszek Koltunski //
|
3 |
|
|
// //
|
4 |
71c8884f
|
Leszek Koltunski
|
// This file is part of Distorted. //
|
5 |
7ba38011
|
Leszek Koltunski
|
// //
|
6 |
71c8884f
|
Leszek Koltunski
|
// Distorted is free software: you can redistribute it and/or modify //
|
7 |
7ba38011
|
Leszek Koltunski
|
// it under the terms of the GNU General Public License as published by //
|
8 |
|
|
// the Free Software Foundation, either version 2 of the License, or //
|
9 |
|
|
// (at your option) any later version. //
|
10 |
|
|
// //
|
11 |
71c8884f
|
Leszek Koltunski
|
// Distorted is distributed in the hope that it will be useful, //
|
12 |
7ba38011
|
Leszek Koltunski
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
13 |
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
14 |
|
|
// GNU General Public License for more details. //
|
15 |
|
|
// //
|
16 |
|
|
// You should have received a copy of the GNU General Public License //
|
17 |
71c8884f
|
Leszek Koltunski
|
// along with Distorted. If not, see <http://www.gnu.org/licenses/>. //
|
18 |
7ba38011
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
19 |
|
|
|
20 |
|
|
package org.distorted.examples.aroundtheworld;
|
21 |
|
|
|
22 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
23 |
|
|
|
24 |
fa9b6494
|
Leszek Koltunski
|
import org.distorted.library.effect.FragmentEffectChroma;
|
25 |
|
|
import org.distorted.library.effect.FragmentEffectContrast;
|
26 |
|
|
import org.distorted.library.effect.VertexEffectDistort;
|
27 |
|
|
import org.distorted.library.effect.VertexEffectPinch;
|
28 |
|
|
import org.distorted.library.effect.VertexEffectSink;
|
29 |
|
|
import org.distorted.library.effect.VertexEffectSwirl;
|
30 |
01782e85
|
Leszek Koltunski
|
import org.distorted.library.main.DistortedEffects;
|
31 |
4b34bb08
|
Leszek Koltunski
|
import org.distorted.library.type.Dynamic1D;
|
32 |
7ba38011
|
Leszek Koltunski
|
import org.distorted.library.type.Dynamic3D;
|
33 |
4b34bb08
|
Leszek Koltunski
|
import org.distorted.library.type.Static1D;
|
34 |
7ba38011
|
Leszek Koltunski
|
import org.distorted.library.type.Static3D;
|
35 |
|
|
import org.distorted.library.type.Static4D;
|
36 |
|
|
|
37 |
|
|
class AroundTheWorldEffectsManager
|
38 |
|
|
{
|
39 |
b3a555a7
|
Leszek Koltunski
|
private float mWhiteness, mBlackness, mAsianness; // those always sum up to 1
|
40 |
|
|
|
41 |
|
|
// WHITENESS
|
42 |
|
|
// Vertex effects:
|
43 |
|
|
// a) make the lips smaller (SINK)
|
44 |
04fe7f80
|
Leszek Koltunski
|
private Static4D wLipsRegion;
|
45 |
|
|
private Static3D wLipsCenter;
|
46 |
b3a555a7
|
Leszek Koltunski
|
private Static1D wLipsFactor;
|
47 |
|
|
private Dynamic1D wLipsDyn;
|
48 |
|
|
|
49 |
|
|
// ASIANNESS
|
50 |
|
|
// Vertex Effects:
|
51 |
|
|
// a) move lips & nose higher (DISTORT)
|
52 |
04fe7f80
|
Leszek Koltunski
|
private Static4D aLipsNoseRegion;
|
53 |
|
|
private Static3D aLipsNoseCenter;
|
54 |
b3a555a7
|
Leszek Koltunski
|
private Static3D aLipsNoseFactor;
|
55 |
|
|
private Dynamic3D aLipsNoseDyn;
|
56 |
|
|
// b) make the nose broader (PINCH)
|
57 |
04fe7f80
|
Leszek Koltunski
|
private Static4D aNoseBroaderRegion;
|
58 |
|
|
private Static3D aNoseBroaderCenter;
|
59 |
5e23b17b
|
Leszek Koltunski
|
private Static3D aNoseBroaderFactor;
|
60 |
|
|
private Dynamic3D aNoseBroaderDyn;
|
61 |
b3a555a7
|
Leszek Koltunski
|
// c) make the nostrils more visible (DISTORT)
|
62 |
04fe7f80
|
Leszek Koltunski
|
private Static4D aNostrilsRegion;
|
63 |
|
|
private Static3D aNostrilsCenter;
|
64 |
b3a555a7
|
Leszek Koltunski
|
private Static3D aNostrilsFactor;
|
65 |
|
|
private Dynamic3D aNostrilsDyn;
|
66 |
|
|
// d) rotate eyes (2 x SWIRL)
|
67 |
04fe7f80
|
Leszek Koltunski
|
private Static4D aEyesRegion;
|
68 |
|
|
private Static3D aLEyeCenter, aREyeCenter;
|
69 |
b3a555a7
|
Leszek Koltunski
|
private Static1D aLEyeFactor, aREyeFactor;
|
70 |
|
|
private Dynamic1D aLEyeDyn, aREyeDyn;
|
71 |
|
|
// e) move eyebrow higher (DISTORT)
|
72 |
04fe7f80
|
Leszek Koltunski
|
private Static4D aEyebrowsRegion;
|
73 |
|
|
private Static3D aEyebrowsCenter;
|
74 |
b3a555a7
|
Leszek Koltunski
|
private Static3D aEyebrowsFactor;
|
75 |
|
|
private Dynamic3D aEyebrowsDyn;
|
76 |
|
|
|
77 |
|
|
// Fragment effects:
|
78 |
|
|
// a) change color of the skin to more brown and less red (CHROMA)
|
79 |
1585ba24
|
Leszek Koltunski
|
private Static3D aSkinColorCenter;
|
80 |
|
|
private Static3D aSkinColorRegion;
|
81 |
b3a555a7
|
Leszek Koltunski
|
private Static3D aChromaSkin;
|
82 |
|
|
private Static1D aChromaSkinFactor;
|
83 |
|
|
private Dynamic1D aChromaSkinDyn;
|
84 |
|
|
// b) darken both eyes (2 x SMOOTH_CHROMA)
|
85 |
1585ba24
|
Leszek Koltunski
|
private Static3D aLEyeColorCenter, aREyeColorCenter;
|
86 |
|
|
private Static3D aLEyeColorRegion, aREyeColorRegion;
|
87 |
b3a555a7
|
Leszek Koltunski
|
private Static3D aChromaEyes;
|
88 |
|
|
private Static1D aChromaEyesFactor;
|
89 |
|
|
private Dynamic1D aChromaEyesDyn;
|
90 |
|
|
|
91 |
|
|
// BLACKNESS
|
92 |
04fe7f80
|
Leszek Koltunski
|
// Vertex Effects
|
93 |
|
|
// a) make the whole face broader (PINCH)
|
94 |
|
|
private Static4D bFaceRegion;
|
95 |
|
|
private Static3D bFaceCenter;
|
96 |
5e23b17b
|
Leszek Koltunski
|
private Static3D bFaceFactor;
|
97 |
|
|
private Dynamic3D bFaceDyn;
|
98 |
04fe7f80
|
Leszek Koltunski
|
// b) tip of the nose lower (DISTORT)
|
99 |
|
|
private Static4D bTipLowerRegion;
|
100 |
|
|
private Static3D bTipLowerCenter;
|
101 |
|
|
private Static3D bTipLowerFactor;
|
102 |
|
|
private Dynamic3D bTipLowerDyn;
|
103 |
|
|
// c) broaden the whole nose: (PINCH)
|
104 |
|
|
private Static4D bWholeNoseRegion;
|
105 |
|
|
private Static3D bWholeNoseCenter;
|
106 |
5e23b17b
|
Leszek Koltunski
|
private Static3D bWholeNoseFactor;
|
107 |
|
|
private Dynamic3D bWholeNoseDyn;
|
108 |
04fe7f80
|
Leszek Koltunski
|
// d) broaden the tip of the nose some more: (PINCH)
|
109 |
|
|
private Static4D bNoseBroaderRegion;
|
110 |
|
|
private Static3D bNoseBroaderCenter;
|
111 |
5e23b17b
|
Leszek Koltunski
|
private Static3D bNoseBroaderFactor;
|
112 |
|
|
private Dynamic3D bNoseBroaderDyn;
|
113 |
04fe7f80
|
Leszek Koltunski
|
// 3) make lips higher: (PINCH)
|
114 |
|
|
private Static4D bLipsRegion;
|
115 |
|
|
private Static3D bLipsCenter;
|
116 |
5e23b17b
|
Leszek Koltunski
|
private Static3D bLipsFactor;
|
117 |
|
|
private Dynamic3D bLipsDyn;
|
118 |
04fe7f80
|
Leszek Koltunski
|
// Fragment effects
|
119 |
|
|
// a) make the whole face darker (CHROMA)
|
120 |
1585ba24
|
Leszek Koltunski
|
private Static3D bSkinColorCenter;
|
121 |
|
|
private Static3D bSkinColorRegion;
|
122 |
04fe7f80
|
Leszek Koltunski
|
private Static3D bChromaSkin;
|
123 |
|
|
private Static1D bChromaSkinFactor;
|
124 |
|
|
private Dynamic1D bChromaSkinDyn;
|
125 |
|
|
// b) move both eyes back to whiteness (2 x SMOOTH CHROMA)
|
126 |
1585ba24
|
Leszek Koltunski
|
private Static3D bLEyeColorCenter, bREyeColorCenter;
|
127 |
|
|
private Static3D bLEyeColorRegion, bREyeColorRegion;
|
128 |
04fe7f80
|
Leszek Koltunski
|
private Static3D bChromaEyes;
|
129 |
|
|
private Static1D bChromaEyesFactor;
|
130 |
|
|
private Dynamic1D bChromaEyesDyn;
|
131 |
|
|
// c) darken both pupils (2 x SMOOTH_CHROMA)
|
132 |
1585ba24
|
Leszek Koltunski
|
private Static3D bLPupilColorCenter, bRPupilColorCenter;
|
133 |
|
|
private Static3D bLPupilColorRegion, bRPupilColorRegion;
|
134 |
04fe7f80
|
Leszek Koltunski
|
private Static3D bChromaPupil;
|
135 |
|
|
private Static1D bChromaPupilFactor;
|
136 |
|
|
private Dynamic1D bChromaPupilDyn;
|
137 |
287a5475
|
Leszek Koltunski
|
// d) all those chroma effects have reduced contrast - bring it back
|
138 |
|
|
private Static1D bContrastFactor;
|
139 |
|
|
private Dynamic1D bContrastDyn;
|
140 |
4b34bb08
|
Leszek Koltunski
|
|
141 |
7ba38011
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
142 |
|
|
|
143 |
2f20ae3a
|
Leszek Koltunski
|
AroundTheWorldEffectsManager()
|
144 |
7ba38011
|
Leszek Koltunski
|
{
|
145 |
b3a555a7
|
Leszek Koltunski
|
mWhiteness = 1;
|
146 |
2f20ae3a
|
Leszek Koltunski
|
mBlackness = 0;
|
147 |
|
|
mAsianness = 0;
|
148 |
7ba38011
|
Leszek Koltunski
|
|
149 |
b3a555a7
|
Leszek Koltunski
|
// WHITENESS
|
150 |
|
|
// Vertex Effects
|
151 |
9e7b6dbd
|
Leszek Koltunski
|
wLipsRegion = new Static4D(0,0,0,100);
|
152 |
e50f49b6
|
Leszek Koltunski
|
wLipsCenter = new Static3D(3,-200,0);
|
153 |
b3a555a7
|
Leszek Koltunski
|
wLipsFactor = new Static1D(0.7f);
|
154 |
|
|
wLipsDyn = new Dynamic1D();
|
155 |
|
|
wLipsDyn.add(wLipsFactor);
|
156 |
|
|
|
157 |
|
|
// ASIANNESS
|
158 |
|
|
// Vertex Effects
|
159 |
9e7b6dbd
|
Leszek Koltunski
|
aLipsNoseRegion = new Static4D(0,0,0,267);
|
160 |
e50f49b6
|
Leszek Koltunski
|
aLipsNoseCenter = new Static3D(3,260,0);
|
161 |
b3a555a7
|
Leszek Koltunski
|
aLipsNoseDyn = new Dynamic3D();
|
162 |
|
|
aLipsNoseFactor = new Static3D(0,0,0);
|
163 |
|
|
aLipsNoseDyn.add(aLipsNoseFactor);
|
164 |
|
|
|
165 |
9e7b6dbd
|
Leszek Koltunski
|
aNoseBroaderRegion = new Static4D(0,0,0,130);
|
166 |
e50f49b6
|
Leszek Koltunski
|
aNoseBroaderCenter = new Static3D(3,-7,0);
|
167 |
5e23b17b
|
Leszek Koltunski
|
aNoseBroaderDyn = new Dynamic3D();
|
168 |
|
|
aNoseBroaderFactor = new Static3D(0,0,90);
|
169 |
b3a555a7
|
Leszek Koltunski
|
aNoseBroaderDyn.add(aNoseBroaderFactor);
|
170 |
|
|
|
171 |
9e7b6dbd
|
Leszek Koltunski
|
aNostrilsRegion = new Static4D(0,0,0,60);
|
172 |
e50f49b6
|
Leszek Koltunski
|
aNostrilsCenter = new Static3D(3,-36,0);
|
173 |
b3a555a7
|
Leszek Koltunski
|
aNostrilsDyn = new Dynamic3D();
|
174 |
|
|
aNostrilsFactor = new Static3D(0,0,0);
|
175 |
|
|
aNostrilsDyn.add(aNostrilsFactor);
|
176 |
|
|
|
177 |
9e7b6dbd
|
Leszek Koltunski
|
aEyesRegion = new Static4D(0,0,0,83);
|
178 |
e50f49b6
|
Leszek Koltunski
|
aLEyeCenter = new Static3D(-121,70,0);
|
179 |
|
|
aREyeCenter = new Static3D( 123,70,0);
|
180 |
b3a555a7
|
Leszek Koltunski
|
aLEyeDyn = new Dynamic1D();
|
181 |
|
|
aREyeDyn = new Dynamic1D();
|
182 |
|
|
aLEyeFactor = new Static1D(0);
|
183 |
|
|
aREyeFactor = new Static1D(0);
|
184 |
|
|
aLEyeDyn.add(aLEyeFactor);
|
185 |
|
|
aREyeDyn.add(aREyeFactor);
|
186 |
|
|
|
187 |
9e7b6dbd
|
Leszek Koltunski
|
aEyebrowsRegion = new Static4D(0,0,0,142);
|
188 |
e50f49b6
|
Leszek Koltunski
|
aEyebrowsCenter = new Static3D(3,200,0);
|
189 |
b3a555a7
|
Leszek Koltunski
|
aEyebrowsDyn = new Dynamic3D();
|
190 |
|
|
aEyebrowsFactor = new Static3D(0,0,0);
|
191 |
|
|
aEyebrowsDyn.add(aEyebrowsFactor);
|
192 |
|
|
|
193 |
|
|
// Fragment Effects
|
194 |
e50f49b6
|
Leszek Koltunski
|
aSkinColorCenter = new Static3D(3,0,0);
|
195 |
1585ba24
|
Leszek Koltunski
|
aSkinColorRegion = new Static3D(600,600,600);
|
196 |
e50f49b6
|
Leszek Koltunski
|
aLEyeColorCenter = new Static3D(-125,70,0);
|
197 |
1585ba24
|
Leszek Koltunski
|
aLEyeColorRegion = new Static3D(29,25,25);
|
198 |
e50f49b6
|
Leszek Koltunski
|
aREyeColorCenter = new Static3D(126,70,0);
|
199 |
1585ba24
|
Leszek Koltunski
|
aREyeColorRegion = new Static3D(29,25,25);
|
200 |
b3a555a7
|
Leszek Koltunski
|
|
201 |
|
|
aChromaSkin = new Static3D(0.5f, 0.5f, 0.5f);
|
202 |
|
|
aChromaEyes = new Static3D(0.5f, 0.14f, 0.14f);
|
203 |
|
|
aChromaSkinFactor = new Static1D(0.0f);
|
204 |
|
|
aChromaEyesFactor = new Static1D(0.0f);
|
205 |
|
|
|
206 |
|
|
aChromaSkinDyn = new Dynamic1D();
|
207 |
|
|
aChromaSkinDyn.add(aChromaSkinFactor);
|
208 |
|
|
aChromaEyesDyn = new Dynamic1D();
|
209 |
|
|
aChromaEyesDyn.add(aChromaEyesFactor);
|
210 |
04fe7f80
|
Leszek Koltunski
|
|
211 |
|
|
// BLACKNESS
|
212 |
|
|
// Vertex Effects
|
213 |
9e7b6dbd
|
Leszek Koltunski
|
bFaceRegion = new Static4D(0,0,0,600);
|
214 |
e50f49b6
|
Leszek Koltunski
|
bFaceCenter = new Static3D(3,0,0);
|
215 |
5e23b17b
|
Leszek Koltunski
|
bFaceFactor = new Static3D(1.0f,0.0f,90.0f);
|
216 |
|
|
bFaceDyn = new Dynamic3D();
|
217 |
04fe7f80
|
Leszek Koltunski
|
bFaceDyn.add(bFaceFactor);
|
218 |
|
|
|
219 |
9e7b6dbd
|
Leszek Koltunski
|
bTipLowerRegion = new Static4D(0,0,0,41);
|
220 |
e50f49b6
|
Leszek Koltunski
|
bTipLowerCenter = new Static3D(3,-93,0);
|
221 |
04fe7f80
|
Leszek Koltunski
|
bTipLowerFactor = new Static3D(0,0,0);
|
222 |
|
|
bTipLowerDyn = new Dynamic3D();
|
223 |
|
|
bTipLowerDyn.add(bTipLowerFactor);
|
224 |
|
|
|
225 |
9e7b6dbd
|
Leszek Koltunski
|
bWholeNoseRegion = new Static4D(0,0,0,130);
|
226 |
e50f49b6
|
Leszek Koltunski
|
bWholeNoseCenter = new Static3D(3,-57,0);
|
227 |
5e23b17b
|
Leszek Koltunski
|
bWholeNoseFactor = new Static3D(1.0f,0.0f,90.0f);
|
228 |
|
|
bWholeNoseDyn = new Dynamic3D();
|
229 |
04fe7f80
|
Leszek Koltunski
|
bWholeNoseDyn.add(bWholeNoseFactor);
|
230 |
|
|
|
231 |
9e7b6dbd
|
Leszek Koltunski
|
bNoseBroaderRegion = new Static4D(0,0,0,95);
|
232 |
e50f49b6
|
Leszek Koltunski
|
bNoseBroaderCenter = new Static3D(3,-108,0);
|
233 |
5e23b17b
|
Leszek Koltunski
|
bNoseBroaderFactor = new Static3D(1.0f,0.0f,90.0f);
|
234 |
|
|
bNoseBroaderDyn = new Dynamic3D();
|
235 |
04fe7f80
|
Leszek Koltunski
|
bNoseBroaderDyn.add(bNoseBroaderFactor);
|
236 |
|
|
|
237 |
a4d59c0b
|
Leszek Koltunski
|
bLipsRegion = new Static4D(0,-96,0,118);
|
238 |
e50f49b6
|
Leszek Koltunski
|
bLipsCenter = new Static3D(3,-158,0);
|
239 |
5e23b17b
|
Leszek Koltunski
|
bLipsFactor = new Static3D(1.0f,90.0f,0.0f);
|
240 |
|
|
bLipsDyn = new Dynamic3D();
|
241 |
04fe7f80
|
Leszek Koltunski
|
bLipsDyn.add(bLipsFactor);
|
242 |
|
|
|
243 |
e50f49b6
|
Leszek Koltunski
|
// 594 x 600
|
244 |
|
|
|
245 |
04fe7f80
|
Leszek Koltunski
|
// Fragment Effects
|
246 |
e50f49b6
|
Leszek Koltunski
|
bSkinColorCenter = new Static3D(3,0,0);
|
247 |
1585ba24
|
Leszek Koltunski
|
bSkinColorRegion = new Static3D(600,600,600);
|
248 |
e50f49b6
|
Leszek Koltunski
|
bLEyeColorCenter = new Static3D(-139,59,0);
|
249 |
1585ba24
|
Leszek Koltunski
|
bLEyeColorRegion = new Static3D(55,24,50);
|
250 |
e50f49b6
|
Leszek Koltunski
|
bREyeColorCenter = new Static3D(139,59,0);
|
251 |
1585ba24
|
Leszek Koltunski
|
bREyeColorRegion = new Static3D(55,24,50);
|
252 |
e50f49b6
|
Leszek Koltunski
|
bLPupilColorCenter = new Static3D(-131,70,0);
|
253 |
1585ba24
|
Leszek Koltunski
|
bLPupilColorRegion = new Static3D(28,23,25);
|
254 |
e50f49b6
|
Leszek Koltunski
|
bRPupilColorCenter = new Static3D(134,70,0);
|
255 |
1585ba24
|
Leszek Koltunski
|
bRPupilColorRegion = new Static3D(28,23,25);
|
256 |
04fe7f80
|
Leszek Koltunski
|
|
257 |
287a5475
|
Leszek Koltunski
|
bChromaSkin = new Static3D(0.4f, 0.25f, 0.25f);
|
258 |
04fe7f80
|
Leszek Koltunski
|
bChromaEyes = new Static3D(1.0f, 1.0f, 1.0f);
|
259 |
287a5475
|
Leszek Koltunski
|
bChromaPupil = new Static3D(0.4f, 0.14f, 0.14f);
|
260 |
04fe7f80
|
Leszek Koltunski
|
bChromaSkinFactor = new Static1D(0.0f);
|
261 |
|
|
bChromaPupilFactor = new Static1D(0.0f);
|
262 |
|
|
bChromaEyesFactor = new Static1D(0.0f);
|
263 |
287a5475
|
Leszek Koltunski
|
bContrastFactor = new Static1D(0.0f);
|
264 |
04fe7f80
|
Leszek Koltunski
|
|
265 |
|
|
bChromaSkinDyn = new Dynamic1D();
|
266 |
|
|
bChromaSkinDyn.add(bChromaSkinFactor);
|
267 |
|
|
bChromaEyesDyn = new Dynamic1D();
|
268 |
|
|
bChromaEyesDyn.add(bChromaEyesFactor);
|
269 |
|
|
bChromaPupilDyn = new Dynamic1D();
|
270 |
|
|
bChromaPupilDyn.add(bChromaPupilFactor);
|
271 |
287a5475
|
Leszek Koltunski
|
bContrastDyn = new Dynamic1D();
|
272 |
|
|
bContrastDyn.add(bContrastFactor);
|
273 |
7ba38011
|
Leszek Koltunski
|
}
|
274 |
|
|
|
275 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
276 |
|
|
|
277 |
d04a4886
|
Leszek Koltunski
|
synchronized void apply(DistortedEffects effects)
|
278 |
7ba38011
|
Leszek Koltunski
|
{
|
279 |
2f20ae3a
|
Leszek Koltunski
|
setRace(mBlackness, mAsianness);
|
280 |
7ba38011
|
Leszek Koltunski
|
|
281 |
b3a555a7
|
Leszek Koltunski
|
// WHITENESS
|
282 |
fa9b6494
|
Leszek Koltunski
|
effects.apply( new VertexEffectSink(wLipsDyn, wLipsCenter, wLipsRegion) );
|
283 |
b3a555a7
|
Leszek Koltunski
|
|
284 |
|
|
// ASIANNESS
|
285 |
1585ba24
|
Leszek Koltunski
|
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 ) );
|
291 |
4b34bb08
|
Leszek Koltunski
|
|
292 |
1585ba24
|
Leszek Koltunski
|
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 ) );
|
295 |
b3a555a7
|
Leszek Koltunski
|
|
296 |
|
|
// BLACKNESS
|
297 |
1585ba24
|
Leszek Koltunski
|
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 ) );
|
308 |
fa9b6494
|
Leszek Koltunski
|
|
309 |
|
|
effects.apply( new FragmentEffectContrast(bContrastDyn) );
|
310 |
7ba38011
|
Leszek Koltunski
|
}
|
311 |
|
|
|
312 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
313 |
|
|
|
314 |
2f20ae3a
|
Leszek Koltunski
|
synchronized void setRace(float blackness, float asianness)
|
315 |
7ba38011
|
Leszek Koltunski
|
{
|
316 |
b3a555a7
|
Leszek Koltunski
|
mWhiteness = 1 - blackness - asianness;
|
317 |
2f20ae3a
|
Leszek Koltunski
|
mAsianness = asianness;
|
318 |
04fe7f80
|
Leszek Koltunski
|
mBlackness = blackness;
|
319 |
7ba38011
|
Leszek Koltunski
|
|
320 |
b3a555a7
|
Leszek Koltunski
|
// WHITENESS
|
321 |
|
|
wLipsFactor.set(1.0f-0.3f*mWhiteness);
|
322 |
|
|
|
323 |
|
|
// ASIANNESS
|
324 |
bcbd5b45
|
Leszek Koltunski
|
aLipsNoseFactor.set1(23.0f*mAsianness);
|
325 |
|
|
aNoseBroaderFactor.set0(1.0f+0.85f*mAsianness);
|
326 |
|
|
aNostrilsFactor.set1(12.0f*mAsianness);
|
327 |
287a5475
|
Leszek Koltunski
|
aLEyeFactor.set(+10.0f*mAsianness);
|
328 |
|
|
aREyeFactor.set(-10.0f*mAsianness);
|
329 |
bcbd5b45
|
Leszek Koltunski
|
aEyebrowsFactor.set1(40.0f*mAsianness);
|
330 |
b3a555a7
|
Leszek Koltunski
|
|
331 |
|
|
aChromaSkinFactor.set(0.2f*mAsianness);
|
332 |
|
|
aChromaEyesFactor.set(0.7f*mAsianness);
|
333 |
|
|
|
334 |
|
|
// BLACKNESS
|
335 |
bcbd5b45
|
Leszek Koltunski
|
bFaceFactor.set0(1.0f + 0.1f*mBlackness);
|
336 |
|
|
bTipLowerFactor.set1(-23.0f*mBlackness);
|
337 |
|
|
bWholeNoseFactor.set0(1.0f+0.5f*mBlackness);
|
338 |
|
|
bNoseBroaderFactor.set0(1.0f+0.38f*mBlackness);
|
339 |
|
|
bLipsFactor.set0(1.0f+1.0f*mBlackness);
|
340 |
04fe7f80
|
Leszek Koltunski
|
|
341 |
287a5475
|
Leszek Koltunski
|
bChromaSkinFactor.set(0.75f*mBlackness);
|
342 |
|
|
bChromaEyesFactor.set(0.2f*mBlackness);
|
343 |
|
|
bChromaPupilFactor.set(0.6f*mBlackness);
|
344 |
|
|
|
345 |
|
|
bContrastFactor.set(1.0f+1.5f*mBlackness);
|
346 |
7ba38011
|
Leszek Koltunski
|
}
|
347 |
|
|
}
|