Revision caf7ce0a
Added by Leszek Koltunski about 3 years ago
src/main/java/org/distorted/examples/triblur/TriblurRenderer.java | ||
---|---|---|
56 | 56 |
|
57 | 57 |
class TriblurRenderer implements GLSurfaceView.Renderer, DistortedLibrary.ExceptionListener |
58 | 58 |
{ |
59 |
private static final int NUM = 6; // 6 ints (x,y,z,R,G,B) each describe 1 object below |
|
60 |
|
|
61 |
private static final int[] OBJECTS = |
|
59 |
private static final int[][] OBJECTS = |
|
62 | 60 |
{ |
63 |
-130, 0, 0, 255, 0, 0, // x,y,z, R,G,B
|
|
64 |
0, 0, 0, 255, 255, 0, //
|
|
65 |
+130, 0, 0, 0, 255, 0, //
|
|
61 |
{-130, 0, 0, 255, 0, 0}, // x,y,z, R,G,B
|
|
62 |
{ 0, 0, 0, 255, 255, 0}, //
|
|
63 |
{+130, 0, 0, 0, 255, 0}, //
|
|
66 | 64 |
}; |
67 | 65 |
|
68 |
private static final int NUM_OBJECTS = OBJECTS.length/NUM;
|
|
66 |
private static final int NUM_OBJECTS = OBJECTS.length; |
|
69 | 67 |
private static final int OBJ_SIZE = 100; |
70 | 68 |
|
71 | 69 |
private final GLSurfaceView mView; |
... | ... | |
125 | 123 |
|
126 | 124 |
for(int i=0; i<NUM_OBJECTS; i++) |
127 | 125 |
{ |
128 |
moveVector[i] = new Static3D(OBJECTS[NUM*i ], OBJECTS[NUM*i+1], OBJECTS[NUM*i+2]);
|
|
129 |
chromaVector[i] = new Static3D(OBJECTS[NUM*i+3], OBJECTS[NUM*i+4], OBJECTS[NUM*i+5]);
|
|
126 |
moveVector[i] = new Static3D(OBJECTS[i][0], OBJECTS[i][1], OBJECTS[i][2]);
|
|
127 |
chromaVector[i] = new Static3D(OBJECTS[i][3], OBJECTS[i][4], OBJECTS[i][5]);
|
|
130 | 128 |
mEffectHaloRadius[i]= new Static2D(10,10); |
131 | 129 |
mEffectHalo[i] = new Static1D(10); |
132 | 130 |
mBlur[i] = new PostprocessEffectBlur(mEffectHaloRadius[i] ); |
133 | 131 |
mGlow[i] = new PostprocessEffectGlow(mEffectHaloRadius[i], new Static4D(1.0f,1.0f,1.0f,0.5f) ); |
134 |
mBord[i] = new PostprocessEffectBorder(mEffectHalo[i], new Static4D(0.0f,0.0f,0.0f,0.9f) );
|
|
132 |
mBord[i] = new PostprocessEffectBorder(mEffectHalo[i], new Static4D(0.0f,0.0f,0.0f,0.8f) );
|
|
135 | 133 |
chroma[i] = new FragmentEffectChroma( new Static1D(0.3f), chromaVector[i]); |
136 | 134 |
effects[i] = new DistortedEffects(); |
137 | 135 |
effects[i].apply(chroma[i]); |
Also available in: Unified diff
Minor