1 |
08f92d82
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
// Copyright 2016 Leszek Koltunski //
|
3 |
|
|
// //
|
4 |
71c8884f
|
Leszek Koltunski
|
// This file is part of Distorted. //
|
5 |
08f92d82
|
Leszek Koltunski
|
// //
|
6 |
71c8884f
|
Leszek Koltunski
|
// Distorted is free software: you can redistribute it and/or modify //
|
7 |
08f92d82
|
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 |
08f92d82
|
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 |
08f92d82
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
19 |
|
|
|
20 |
2ec2dc32
|
Leszek Koltunski
|
package org.distorted.examples.generic;
|
21 |
08f92d82
|
Leszek Koltunski
|
|
22 |
|
|
import android.graphics.Bitmap;
|
23 |
|
|
import android.graphics.BitmapFactory;
|
24 |
|
|
import android.opengl.GLSurfaceView;
|
25 |
|
|
|
26 |
|
|
import org.distorted.examples.R;
|
27 |
b88ec561
|
Leszek Koltunski
|
import org.distorted.library.effect.Effect;
|
28 |
|
|
import org.distorted.library.effect.EffectType;
|
29 |
06366d12
|
Leszek Koltunski
|
import org.distorted.library.effect.MatrixEffectMove;
|
30 |
|
|
import org.distorted.library.effect.MatrixEffectQuaternion;
|
31 |
|
|
import org.distorted.library.effect.MatrixEffectScale;
|
32 |
e3900503
|
Leszek Koltunski
|
import org.distorted.library.main.DistortedLibrary;
|
33 |
01782e85
|
Leszek Koltunski
|
import org.distorted.library.main.DistortedEffects;
|
34 |
|
|
import org.distorted.library.main.DistortedNode;
|
35 |
|
|
import org.distorted.library.main.DistortedScreen;
|
36 |
|
|
import org.distorted.library.main.DistortedTexture;
|
37 |
57d7fdba
|
Leszek Koltunski
|
import org.distorted.library.mesh.MeshBase;
|
38 |
698ad0a8
|
Leszek Koltunski
|
import org.distorted.library.mesh.MeshQuad;
|
39 |
e83350b4
|
Leszek Koltunski
|
import org.distorted.library.mesh.MeshSphere;
|
40 |
08f92d82
|
Leszek Koltunski
|
import org.distorted.library.type.Static3D;
|
41 |
|
|
import org.distorted.library.type.Static4D;
|
42 |
|
|
|
43 |
|
|
import java.io.IOException;
|
44 |
|
|
import java.io.InputStream;
|
45 |
|
|
|
46 |
|
|
import javax.microedition.khronos.egl.EGLConfig;
|
47 |
|
|
import javax.microedition.khronos.opengles.GL10;
|
48 |
|
|
|
49 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
50 |
|
|
|
51 |
46b26cdc
|
Leszek Koltunski
|
class GenericRenderer implements GLSurfaceView.Renderer
|
52 |
08f92d82
|
Leszek Koltunski
|
{
|
53 |
f86c9fb5
|
Leszek Koltunski
|
private static final float FOV = 30.0f;
|
54 |
af662543
|
leszek
|
private static final float NEAR = 0.1f;
|
55 |
|
|
|
56 |
08f92d82
|
Leszek Koltunski
|
private GLSurfaceView mView;
|
57 |
f6d884d5
|
Leszek Koltunski
|
private DistortedTexture mObjectTexture, mBackgroundTexture, mCenterTexture, mRegionTexture;
|
58 |
698ad0a8
|
Leszek Koltunski
|
private DistortedEffects mObjectEffects;
|
59 |
d218d64e
|
leszek
|
private DistortedScreen mScreen;
|
60 |
698ad0a8
|
Leszek Koltunski
|
private MeshQuad mRegionQuad, mCenterQuad, mBackgroundQuad;
|
61 |
fe59d375
|
Leszek Koltunski
|
private DistortedNode mCenterNode, mRegionNode;
|
62 |
698ad0a8
|
Leszek Koltunski
|
private float mObjWidth, mObjHeight, mObjDepth;
|
63 |
529054e9
|
Leszek Koltunski
|
private Static3D mCenterPoint, mRegionPoint, mScaleRegion;
|
64 |
|
|
private Static3D mMoveObject, mScaleObject, mScaleCenter, mMoveBackground, mScaleBackground;
|
65 |
fec27f16
|
Leszek Koltunski
|
private boolean mShowingCenter=false;
|
66 |
|
|
private boolean mShowingRegion=false;
|
67 |
1e7603bb
|
Leszek Koltunski
|
private float mFactorObj;
|
68 |
65f622c1
|
Leszek Koltunski
|
private int mWidth;
|
69 |
e83350b4
|
Leszek Koltunski
|
private float mFactor;
|
70 |
950511ed
|
Leszek Koltunski
|
|
71 |
833685d0
|
Leszek Koltunski
|
Static4D mQuat1, mQuat2;
|
72 |
d2337a3a
|
Leszek Koltunski
|
int mScreenMin;
|
73 |
833685d0
|
Leszek Koltunski
|
|
74 |
08f92d82
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
75 |
|
|
|
76 |
46b26cdc
|
Leszek Koltunski
|
GenericRenderer(GLSurfaceView v)
|
77 |
08f92d82
|
Leszek Koltunski
|
{
|
78 |
|
|
mView = v;
|
79 |
d40cfeb2
|
Leszek Koltunski
|
|
80 |
46b26cdc
|
Leszek Koltunski
|
GenericActivity2 act = (GenericActivity2)v.getContext();
|
81 |
e8b6aa95
|
Leszek Koltunski
|
|
82 |
06366d12
|
Leszek Koltunski
|
mMoveObject = new Static3D(0,0,0);
|
83 |
fec27f16
|
Leszek Koltunski
|
mScaleObject = new Static3D(1,1,1);
|
84 |
06366d12
|
Leszek Koltunski
|
mScaleCenter = new Static3D(1,1,1);
|
85 |
|
|
mMoveBackground = new Static3D(0,0,0);
|
86 |
|
|
mScaleBackground= new Static3D(1,1,1);
|
87 |
|
|
|
88 |
f6d884d5
|
Leszek Koltunski
|
mObjectTexture = act.getTexture();
|
89 |
687263cc
|
Leszek Koltunski
|
mBackgroundTexture = new DistortedTexture();
|
90 |
|
|
mCenterTexture = new DistortedTexture();
|
91 |
|
|
mRegionTexture = new DistortedTexture();
|
92 |
06366d12
|
Leszek Koltunski
|
|
93 |
1e7603bb
|
Leszek Koltunski
|
mFactorObj = 1.0f;
|
94 |
|
|
|
95 |
698ad0a8
|
Leszek Koltunski
|
mObjectEffects = act.getEffects();
|
96 |
|
|
DistortedEffects backgroundEffects = new DistortedEffects();
|
97 |
|
|
DistortedEffects centerEffects = new DistortedEffects();
|
98 |
|
|
DistortedEffects regionEffects = new DistortedEffects();
|
99 |
f6d884d5
|
Leszek Koltunski
|
|
100 |
698ad0a8
|
Leszek Koltunski
|
MeshBase mesh = act.getMesh();
|
101 |
|
|
mRegionQuad = new MeshQuad();
|
102 |
|
|
mCenterQuad = new MeshQuad();
|
103 |
|
|
mBackgroundQuad = new MeshQuad();
|
104 |
aac5c562
|
leszek
|
|
105 |
e83350b4
|
Leszek Koltunski
|
mFactor = mesh instanceof MeshSphere ? 1.0f : 0.7f;
|
106 |
|
|
|
107 |
687263cc
|
Leszek Koltunski
|
mObjWidth = act.getWidth();
|
108 |
|
|
mObjHeight= act.getHeight();
|
109 |
|
|
mObjDepth = act.getDepth();
|
110 |
d40cfeb2
|
Leszek Koltunski
|
|
111 |
833685d0
|
Leszek Koltunski
|
mQuat1 = new Static4D(0,0,0,1); // unity
|
112 |
|
|
mQuat2 = new Static4D(0,0,0,1); // quaternions
|
113 |
|
|
|
114 |
24991bc2
|
Leszek Koltunski
|
mCenterPoint= new Static3D(0,0,0);
|
115 |
|
|
mRegionPoint= new Static3D(0,0,0);
|
116 |
529054e9
|
Leszek Koltunski
|
mScaleRegion = new Static3D(0,0,0);
|
117 |
392e16fd
|
Leszek Koltunski
|
|
118 |
698ad0a8
|
Leszek Koltunski
|
mCenterNode = new DistortedNode(mCenterTexture, centerEffects, mCenterQuad);
|
119 |
|
|
mRegionNode = new DistortedNode(mRegionTexture, regionEffects, mRegionQuad);
|
120 |
fe59d375
|
Leszek Koltunski
|
|
121 |
e4330c89
|
Leszek Koltunski
|
mScreen = new DistortedScreen();
|
122 |
af662543
|
leszek
|
mScreen.setProjection(FOV, NEAR);
|
123 |
698ad0a8
|
Leszek Koltunski
|
mScreen.attach(mBackgroundTexture, backgroundEffects, mBackgroundQuad );
|
124 |
|
|
mScreen.attach(mObjectTexture , mObjectEffects , mesh );
|
125 |
06366d12
|
Leszek Koltunski
|
|
126 |
529054e9
|
Leszek Koltunski
|
Static3D rotateCen = new Static3D(0,0,0);
|
127 |
06366d12
|
Leszek Koltunski
|
|
128 |
529054e9
|
Leszek Koltunski
|
MatrixEffectQuaternion quat1cen = new MatrixEffectQuaternion(mQuat1, rotateCen);
|
129 |
|
|
MatrixEffectQuaternion quat2cen = new MatrixEffectQuaternion(mQuat2, rotateCen);
|
130 |
|
|
MatrixEffectMove centerMove = new MatrixEffectMove(mCenterPoint);
|
131 |
06366d12
|
Leszek Koltunski
|
|
132 |
698ad0a8
|
Leszek Koltunski
|
centerEffects.apply( new MatrixEffectScale(mScaleCenter) );
|
133 |
|
|
centerEffects.apply( centerMove );
|
134 |
529054e9
|
Leszek Koltunski
|
centerEffects.apply( new MatrixEffectMove(new Static3D(0,0,12)) );
|
135 |
698ad0a8
|
Leszek Koltunski
|
centerEffects.apply(quat2cen);
|
136 |
|
|
centerEffects.apply(quat1cen);
|
137 |
06366d12
|
Leszek Koltunski
|
|
138 |
529054e9
|
Leszek Koltunski
|
regionEffects.apply( new MatrixEffectScale(mScaleRegion) );
|
139 |
698ad0a8
|
Leszek Koltunski
|
regionEffects.apply( centerMove );
|
140 |
529054e9
|
Leszek Koltunski
|
regionEffects.apply( new MatrixEffectMove(mRegionPoint) );
|
141 |
|
|
regionEffects.apply( new MatrixEffectMove(new Static3D(0,0,10)) );
|
142 |
698ad0a8
|
Leszek Koltunski
|
regionEffects.apply(quat2cen);
|
143 |
|
|
regionEffects.apply(quat1cen);
|
144 |
06366d12
|
Leszek Koltunski
|
|
145 |
65f622c1
|
Leszek Koltunski
|
resetMatrixEffects();
|
146 |
|
|
|
147 |
e3900503
|
Leszek Koltunski
|
// quite tricky: move the background exactly to the FAR plane! (see InternalOutputSurface.setProjection() )
|
148 |
698ad0a8
|
Leszek Koltunski
|
backgroundEffects.apply(new MatrixEffectScale(mScaleBackground) );
|
149 |
|
|
backgroundEffects.apply(new MatrixEffectMove(mMoveBackground) );
|
150 |
f338550a
|
leszek
|
}
|
151 |
|
|
|
152 |
65f622c1
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
153 |
|
|
|
154 |
|
|
void resetMatrixEffects()
|
155 |
|
|
{
|
156 |
529054e9
|
Leszek Koltunski
|
Static3D rotateObj = new Static3D(0,0,0);
|
157 |
65f622c1
|
Leszek Koltunski
|
|
158 |
|
|
MatrixEffectQuaternion quat1obj = new MatrixEffectQuaternion(mQuat1, rotateObj);
|
159 |
|
|
MatrixEffectQuaternion quat2obj = new MatrixEffectQuaternion(mQuat2, rotateObj);
|
160 |
|
|
|
161 |
687263cc
|
Leszek Koltunski
|
mObjectEffects.apply(quat2obj);
|
162 |
|
|
mObjectEffects.apply(quat1obj);
|
163 |
|
|
mObjectEffects.apply( new MatrixEffectScale(mScaleObject) );
|
164 |
|
|
mObjectEffects.apply( new MatrixEffectMove(mMoveObject));
|
165 |
65f622c1
|
Leszek Koltunski
|
|
166 |
|
|
mQuat1.set(0,0,0,1);
|
167 |
|
|
mQuat2.set(0,0,0,1);
|
168 |
|
|
}
|
169 |
|
|
|
170 |
f338550a
|
leszek
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
171 |
|
|
|
172 |
0ab55f0c
|
Leszek Koltunski
|
void showRegionAndCenter(boolean showRegion, boolean showCenter)
|
173 |
f338550a
|
leszek
|
{
|
174 |
0ab55f0c
|
Leszek Koltunski
|
if( mShowingCenter!=showCenter )
|
175 |
98c04ab8
|
leszek
|
{
|
176 |
1e7603bb
|
Leszek Koltunski
|
if( showCenter )
|
177 |
|
|
{
|
178 |
|
|
if( mShowingRegion ) mScreen.detach(mRegionNode);
|
179 |
|
|
mScreen.attach(mCenterNode);
|
180 |
|
|
if( mShowingRegion ) mScreen.attach(mRegionNode);
|
181 |
|
|
}
|
182 |
|
|
else
|
183 |
|
|
{
|
184 |
|
|
mScreen.detach(mCenterNode);
|
185 |
|
|
}
|
186 |
0ab55f0c
|
Leszek Koltunski
|
|
187 |
|
|
mShowingCenter = showCenter;
|
188 |
|
|
}
|
189 |
|
|
|
190 |
|
|
if( mShowingRegion!=showRegion )
|
191 |
|
|
{
|
192 |
|
|
if( showRegion ) mScreen.attach(mRegionNode);
|
193 |
|
|
else mScreen.detach(mRegionNode);
|
194 |
|
|
|
195 |
|
|
mShowingRegion = showRegion;
|
196 |
98c04ab8
|
leszek
|
}
|
197 |
950511ed
|
Leszek Koltunski
|
}
|
198 |
|
|
|
199 |
65f622c1
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
200 |
|
|
|
201 |
|
|
public int getWidth()
|
202 |
|
|
{
|
203 |
|
|
return mWidth;
|
204 |
|
|
}
|
205 |
|
|
|
206 |
fc286c71
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
207 |
|
|
|
208 |
|
|
float getScaleFactor()
|
209 |
|
|
{
|
210 |
|
|
return mFactorObj;
|
211 |
|
|
}
|
212 |
|
|
|
213 |
950511ed
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
214 |
|
|
|
215 |
334c13fa
|
Leszek Koltunski
|
void setCenter(float x, float y, float z)
|
216 |
950511ed
|
Leszek Koltunski
|
{
|
217 |
334c13fa
|
Leszek Koltunski
|
mCenterPoint.set(mFactorObj*x,mFactorObj*y,mFactorObj*z);
|
218 |
08f92d82
|
Leszek Koltunski
|
}
|
219 |
|
|
|
220 |
6f779cd4
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
221 |
|
|
|
222 |
9e7b6dbd
|
Leszek Koltunski
|
void setRegion(float x, float y, float z, float r)
|
223 |
6f779cd4
|
Leszek Koltunski
|
{
|
224 |
698ad0a8
|
Leszek Koltunski
|
float factorReg = 2*mFactorObj*r/mRegionQuad.getStretchX();
|
225 |
1e7603bb
|
Leszek Koltunski
|
mRegionPoint.set(mFactorObj*x,mFactorObj*y, mFactorObj*z);
|
226 |
529054e9
|
Leszek Koltunski
|
mScaleRegion.set(factorReg,factorReg,factorReg);
|
227 |
6f779cd4
|
Leszek Koltunski
|
}
|
228 |
|
|
|
229 |
bddd4b2d
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
230 |
|
|
|
231 |
|
|
void useOIT(boolean use)
|
232 |
|
|
{
|
233 |
|
|
mScreen.setOrderIndependentTransparency(use);
|
234 |
|
|
}
|
235 |
|
|
|
236 |
08f92d82
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
237 |
56cbe1cf
|
Leszek Koltunski
|
|
238 |
|
|
public void onDrawFrame(GL10 glUnused)
|
239 |
08f92d82
|
Leszek Koltunski
|
{
|
240 |
fe59d375
|
Leszek Koltunski
|
mScreen.render(System.currentTimeMillis());
|
241 |
08f92d82
|
Leszek Koltunski
|
}
|
242 |
|
|
|
243 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
244 |
56cbe1cf
|
Leszek Koltunski
|
|
245 |
|
|
public void onSurfaceChanged(GL10 glUnused, int width, int height)
|
246 |
08f92d82
|
Leszek Koltunski
|
{
|
247 |
65f622c1
|
Leszek Koltunski
|
mWidth = width;
|
248 |
833685d0
|
Leszek Koltunski
|
mScreenMin = width<height ? width:height;
|
249 |
752c6b57
|
Leszek Koltunski
|
|
250 |
950511ed
|
Leszek Koltunski
|
float factorCen;
|
251 |
698ad0a8
|
Leszek Koltunski
|
float centerSize = mCenterQuad.getStretchX();
|
252 |
6f779cd4
|
Leszek Koltunski
|
|
253 |
261fe5bd
|
Leszek Koltunski
|
if( width*mObjHeight > height*mObjWidth ) // screen is more 'horizontal' than the Object
|
254 |
d40cfeb2
|
Leszek Koltunski
|
{
|
255 |
e83350b4
|
Leszek Koltunski
|
mFactorObj = (mFactor*height)/mObjHeight;
|
256 |
|
|
factorCen = (0.08f *height)/centerSize;
|
257 |
261fe5bd
|
Leszek Koltunski
|
}
|
258 |
d40cfeb2
|
Leszek Koltunski
|
else
|
259 |
|
|
{
|
260 |
e83350b4
|
Leszek Koltunski
|
mFactorObj = (mFactor*width)/mObjWidth;
|
261 |
|
|
factorCen = (0.08f *width)/centerSize;
|
262 |
d40cfeb2
|
Leszek Koltunski
|
}
|
263 |
|
|
|
264 |
529054e9
|
Leszek Koltunski
|
setCenter(0,0,0);
|
265 |
7126b262
|
Leszek Koltunski
|
setRegion(0.0f,0.0f,0.0f,0.25f*(mObjWidth+mObjHeight));
|
266 |
1e7603bb
|
Leszek Koltunski
|
|
267 |
529054e9
|
Leszek Koltunski
|
mMoveObject.set( 0, 0 , -mFactorObj*mObjDepth );
|
268 |
fec27f16
|
Leszek Koltunski
|
mScaleObject.set(mFactorObj,mFactorObj,mFactorObj);
|
269 |
06366d12
|
Leszek Koltunski
|
mScaleCenter.set(factorCen,factorCen,factorCen);
|
270 |
fce25d04
|
leszek
|
|
271 |
698ad0a8
|
Leszek Koltunski
|
float backgroundSize = mBackgroundQuad.getStretchX();
|
272 |
fce25d04
|
leszek
|
float factorBackX = ((float)width)/backgroundSize;
|
273 |
|
|
float factorBackY = ((float)height)/backgroundSize;
|
274 |
|
|
|
275 |
e3900503
|
Leszek Koltunski
|
// quite tricky: move the background exactly to the FAR plane! (see InternalOutputSurface.setProjection() )
|
276 |
529054e9
|
Leszek Koltunski
|
mMoveBackground.set( 0,0, -0.9f*height*(1.0f-NEAR)/(2.0f*(float)Math.tan(FOV*Math.PI/360)) );
|
277 |
06366d12
|
Leszek Koltunski
|
mScaleBackground.set( 2*factorBackX, 2*factorBackY, 1.0f );
|
278 |
fce25d04
|
leszek
|
|
279 |
392e16fd
|
Leszek Koltunski
|
mScreen.resize(width, height);
|
280 |
08f92d82
|
Leszek Koltunski
|
}
|
281 |
|
|
|
282 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
283 |
56cbe1cf
|
Leszek Koltunski
|
|
284 |
|
|
public void onSurfaceCreated(GL10 glUnused, EGLConfig config)
|
285 |
08f92d82
|
Leszek Koltunski
|
{
|
286 |
46b26cdc
|
Leszek Koltunski
|
GenericActivity2 act = (GenericActivity2)mView.getContext();
|
287 |
bcc8e016
|
Leszek Koltunski
|
|
288 |
f6d884d5
|
Leszek Koltunski
|
InputStream isB = act.getResources().openRawResource(R.raw.water);
|
289 |
|
|
InputStream isC = act.getResources().openRawResource(R.raw.center);
|
290 |
|
|
InputStream isR = act.getResources().openRawResource(R.raw.region);
|
291 |
71d8ad03
|
Leszek Koltunski
|
|
292 |
f6d884d5
|
Leszek Koltunski
|
Bitmap bitmapB,bitmapC,bitmapR;
|
293 |
08f92d82
|
Leszek Koltunski
|
|
294 |
|
|
try
|
295 |
|
|
{
|
296 |
f6d884d5
|
Leszek Koltunski
|
bitmapB = BitmapFactory.decodeStream(isB);
|
297 |
|
|
bitmapC = BitmapFactory.decodeStream(isC);
|
298 |
|
|
bitmapR = BitmapFactory.decodeStream(isR);
|
299 |
71d8ad03
|
Leszek Koltunski
|
}
|
300 |
08f92d82
|
Leszek Koltunski
|
finally
|
301 |
|
|
{
|
302 |
|
|
try
|
303 |
|
|
{
|
304 |
f6d884d5
|
Leszek Koltunski
|
isB.close();
|
305 |
|
|
isC.close();
|
306 |
|
|
isR.close();
|
307 |
9167cfd4
|
Leszek Koltunski
|
}
|
308 |
08f92d82
|
Leszek Koltunski
|
catch(IOException e) { }
|
309 |
|
|
}
|
310 |
|
|
|
311 |
f6d884d5
|
Leszek Koltunski
|
mObjectTexture.setTexture( act.getBitmap() );
|
312 |
|
|
mBackgroundTexture.setTexture(bitmapB);
|
313 |
|
|
mCenterTexture.setTexture(bitmapC);
|
314 |
|
|
mRegionTexture.setTexture(bitmapR);
|
315 |
950511ed
|
Leszek Koltunski
|
|
316 |
e3900503
|
Leszek Koltunski
|
DistortedLibrary.setMax(EffectType.VERTEX ,10);
|
317 |
|
|
DistortedLibrary.setMax(EffectType.FRAGMENT,10);
|
318 |
676c14da
|
Leszek Koltunski
|
|
319 |
b88ec561
|
Leszek Koltunski
|
Effect.enableEffects(EffectType.VERTEX);
|
320 |
|
|
Effect.enableEffects(EffectType.FRAGMENT);
|
321 |
|
|
Effect.enableEffects(EffectType.POSTPROCESS);
|
322 |
cdcbdbe3
|
Leszek Koltunski
|
|
323 |
08f92d82
|
Leszek Koltunski
|
try
|
324 |
|
|
{
|
325 |
e3900503
|
Leszek Koltunski
|
DistortedLibrary.onCreate(mView.getContext());
|
326 |
08f92d82
|
Leszek Koltunski
|
}
|
327 |
|
|
catch(Exception ex)
|
328 |
|
|
{
|
329 |
76a81b6a
|
Leszek Koltunski
|
android.util.Log.e("Effects3D", ex.getMessage() );
|
330 |
08f92d82
|
Leszek Koltunski
|
}
|
331 |
|
|
}
|
332 |
56cbe1cf
|
Leszek Koltunski
|
}
|