Revision 687263cc
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/examples/movingglow/MovingGlowRenderer.java | ||
---|---|---|
76 | 76 |
mRootW = 5*LEAF_SIZE; |
77 | 77 |
mRootH = 5*LEAF_SIZE; |
78 | 78 |
|
79 |
mLeaf = new DistortedTexture(LEAF_SIZE,LEAF_SIZE);
|
|
80 |
DistortedTexture surface = new DistortedTexture(mRootW,mRootH);
|
|
79 |
mLeaf = new DistortedTexture(); |
|
80 |
DistortedTexture surface = new DistortedTexture(); |
|
81 | 81 |
MeshBase mesh = new MeshRectangles(1,1); |
82 | 82 |
|
83 |
DistortedNode root = new DistortedNode(surface, new DistortedEffects(), mesh); |
|
83 |
DistortedNode root = new DistortedNode(surface, new DistortedEffects(mRootW,mRootH,0), mesh);
|
|
84 | 84 |
|
85 | 85 |
Static3D moveVector = new Static3D(0.55f*LEAF_SIZE, (mRootH-LEAF_SIZE)/2, 0); |
86 | 86 |
Static1D chromaLevel= new Static1D(0.5f); |
... | ... | |
91 | 91 |
|
92 | 92 |
for(int j=0; j<NUM_LEAVES; j++) |
93 | 93 |
{ |
94 |
mLeafEffects[j] = new DistortedEffects(); |
|
94 |
mLeafEffects[j] = new DistortedEffects(LEAF_SIZE,LEAF_SIZE,0);
|
|
95 | 95 |
mLeafEffects[j].apply(leafMove); |
96 | 96 |
mLeafEffects[j].apply( new MatrixEffectRotate(new Static1D(j*(360/NUM_LEAVES)), axis, center) ); |
97 | 97 |
mLeafEffects[j].apply( new FragmentEffectChroma(chromaLevel, new Static3D(colors[3*j],colors[3*j+1], colors[3*j+2])) ); |
Also available in: Unified diff
Move the 'pre-multiply mesh before applying any effects' thing from [(Xsize of texture, Ysize of texture) x Mesh's zFactor] to Effects.setStretch(sx,sy,sz)