Project

General

Profile

« Previous | Next » 

Revision 513b2e9c

Added by Leszek Koltunski almost 4 years ago

A lot of changes.

1) main vertex shader: remove support for degree_object. This functionality will hopefully come back when we introduce other than circular regions.
2) MeshBase: remove the need to set a Bounding box (this is the point of the whole thing - we wanted to get rid of this so that the advances in MeshJoined will be easier)
3) Set ground for removing the MeshBase.setStretch / getStretch (another thing needed to advance MeshJoined )
4) since we removed the Bounding box, we need to change the DEFORN effect to have 1 additional parameter, the 'radius' which takes over the function of the bounding box in the vertex shader.
5) since the'res no bounding box, simplify the postprocessing Halo (remove EffectQueueMatrix.magnify() )
6) adjust applications.

After this we will hopefully be ready to introduce MeshBase.preApply(VertexEffect), i.e. bending several simple Meshes with any VertexEffect - including the freshly-introduced PseudoMatrix-Vertex effects like VertexEffectScale - and then combining them into one MeshJoined.

View differences:

src/main/java/org/distorted/examples/objecttree/ObjectTreeRenderer.java
56 56
class ObjectTreeRenderer implements GLSurfaceView.Renderer
57 57
{
58 58
   private static final int NODE_FBO_SIZE = 300;
59
   private static final int GRID = 20;
59 60

  
60 61
   private GLSurfaceView mView;
61 62
   private DistortedEffects mEffectsNode, mEffectsGrid;
......
85 86

  
86 87
      mEffectsGrid = new DistortedEffects();
87 88

  
88
      float factor = NODE_FBO_SIZE/2;
89
      MatrixEffectScale scale = new MatrixEffectScale( new Static3D(factor,factor,factor/10) );
89
      float factor = NODE_FBO_SIZE/(2.0f*GRID);
90
      MatrixEffectScale scale = new MatrixEffectScale( new Static3D(factor,factor,factor) );
90 91
      mEffectsGrid.apply(scale);
91 92

  
92 93
      Dynamic1D rotDyn = new Dynamic1D(12000,0.0f);
......
99 100
      Dynamic1D sinkDyn = new Dynamic1D(3000,0.0f);
100 101
      sinkDyn.add(new Static1D(1.0f));
101 102
      sinkDyn.add(new Static1D(0.3f));
102
      VertexEffectSink sink = new VertexEffectSink(sinkDyn, new Static3D(0,0,0) );
103
      VertexEffectSink sink = new VertexEffectSink(sinkDyn, new Static3D(0,0,0), new Static4D(0,0,0,10) );
103 104
      mEffectsGrid.apply(sink);
104 105

  
105 106
      mScreen = new DistortedScreen();
......
179 180
      mLisaTexture.setTexture(bitmapLisa);
180 181
      mGridTexture.setTexture(bitmapGrid);
181 182

  
182
      final int GRID = 20;
183 183
      final Static4D mapFB = new Static4D(0.0f,0.0f,1.0f     ,1.0f     );
184 184
      final Static4D mapLR = new Static4D(0.0f,0.0f,1.0f/GRID,1.0f     );
185 185
      final Static4D mapTB = new Static4D(0.0f,0.0f,1.0f     ,1.0f/GRID);
186 186

  
187 187
      if( mMeshQuad ==null ) mMeshQuad = new MeshQuad();
188
      if( mMeshCubes==null ) mMeshCubes= new MeshCubes(GRID,GRID,1, mapFB, mapFB, mapLR, mapLR, mapTB, mapTB);
188
      if( mMeshCubes==null )
189
        {
190
        mMeshCubes= new MeshCubes(GRID,GRID,1, mapFB, mapFB, mapLR, mapLR, mapTB, mapTB);
191
        mMeshCubes.setStretch(GRID,GRID,1);
192
        }
193

  
189 194

  
190 195
      mRoot = new DistortedNode(mLisaTexture, mEffectsNode, mMeshQuad);
191 196
      mRoot.resizeFBO(NODE_FBO_SIZE,NODE_FBO_SIZE);

Also available in: Unified diff