Revision 8392dc7b
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/examples/transparency/TransparencyRenderer.java | ||
---|---|---|
26 | 26 |
import org.distorted.library.effect.MatrixEffectQuaternion; |
27 | 27 |
import org.distorted.library.effect.MatrixEffectScale; |
28 | 28 |
import org.distorted.library.effect.PostprocessEffectBlur; |
29 |
import org.distorted.library.effect.VertexEffectScale; |
|
29 | 30 |
import org.distorted.library.main.DistortedLibrary; |
30 | 31 |
import org.distorted.library.main.DistortedEffects; |
31 | 32 |
import org.distorted.library.main.DistortedNode; |
... | ... | |
75 | 76 |
mView = v; |
76 | 77 |
|
77 | 78 |
MeshRectangles mesh = new MeshRectangles(1,1); |
78 |
mesh.setStretch(OBJ_SIZE,OBJ_SIZE,0); |
|
79 | 79 |
|
80 | 80 |
mQuat1 = new Static4D(0,0,0,1); // unity |
81 | 81 |
mQuat2 = new Static4D(0,0,0,1); // quaternions |
... | ... | |
111 | 111 |
mEffects[i] = new DistortedEffects(); |
112 | 112 |
mEffects[i].apply(mBlur[i]); |
113 | 113 |
mEffects[i].apply(alpha[i]); |
114 |
mEffects[i].apply( new VertexEffectScale(new Static3D(OBJ_SIZE,OBJ_SIZE,0) ) ); |
|
114 | 115 |
mEffects[i].apply(new MatrixEffectMove(mMoveVector[i])); |
115 | 116 |
mEffects[i].apply(quatEffect2); |
116 | 117 |
mEffects[i].apply(quatEffect1); |
... | ... | |
192 | 193 |
mTex[i].setColor(OBJECTS[NUM * i + 3]); |
193 | 194 |
} |
194 | 195 |
|
196 |
VertexEffectScale.enable(); |
|
195 | 197 |
PostprocessEffectBlur.enable(); |
196 | 198 |
FragmentEffectAlpha.enable(); |
197 | 199 |
|
... | ... | |
210 | 212 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
211 | 213 |
{ |
212 | 214 |
float size= 0.02f*OBJ_SIZE; |
213 |
mScreenMin = width<height ? width:height;
|
|
215 |
mScreenMin = Math.min(width, height);
|
|
214 | 216 |
|
215 | 217 |
float factor = 0.65f*mScreenMin/OBJ_SIZE; |
216 | 218 |
mScale.set(factor,factor,factor); |
Also available in: Unified diff
Convert the third app, Transparency, to the new MeshBase.setStretch-less API ( use VertexEffectScale instead )