Project

General

Profile

« Previous | Next » 

Revision 96345c94

Added by Leszek Koltunski almost 4 years ago

Extend the MeshBase.setTextureMaps API so that we are able to set a single texture map to a single texture component, or a few consecutive at a time, not necessarily starting from component 0.

View differences:

src/main/java/org/distorted/examples/deferredjob/DeferredJobRenderer.java
204 204
      MeshBase[] tmp = new MeshBase[2];
205 205

  
206 206
      tmp[0] = new MeshJoined(meshes);
207
      tmp[0].setTextureMap(lTextureMaps);
207
      tmp[0].setTextureMap(lTextureMaps,0);
208 208

  
209 209
      VertexEffectMove   effect0 = new VertexEffectMove  ( new Static3D(0,0,0.5f) );
210 210
      VertexEffectRotate effect1 = new VertexEffectRotate( new Static1D(180), new Static3D(1,0,0), new Static3D(0,0,0) );
......
217 217
      tmp[0].apply(effect1);
218 218

  
219 219
      tmp[1] = tmp[0].copy(true);
220
      tmp[1].setTextureMap(rTextureMaps);
220
      tmp[1].setTextureMap(rTextureMaps,0);
221 221

  
222 222
      tmp[0].mergeEffComponents();
223 223
      tmp[1].mergeEffComponents();
src/main/java/org/distorted/examples/meshjoin/MeshJoinRenderer.java
222 222
      Static4D[] textureMaps = new Static4D[MESHES];
223 223
      for(int i=0; i<MESHES; i++) textureMaps[i] = new Static4D(i*0.25f,0.0f,0.25f,1.0f);
224 224
      MeshBase result = new MeshJoined(meshes);
225
      result.setTextureMap(textureMaps);
225
      result.setTextureMap(textureMaps,0);
226 226

  
227 227
      Static3D a0 = new Static3D(         0,        1,       0 );
228 228
      Static3D a1 = new Static3D(         0,  -1.0f/3, 2*SQ2/3 );
src/main/java/org/distorted/examples/singlemesh/SingleMeshRenderer.java
358 358
      for(int i=0; i<NUM_CUBITS; i++)
359 359
        {
360 360
        cubits[i].apply( new MatrixEffectMove(CUBIT_MOVES[i]), 1,0);
361
        cubits[i].setTextureMap(TEXTURE_MAP[i]);
361
        cubits[i].setTextureMap(TEXTURE_MAP[i],0);
362 362
        }
363 363

  
364 364
      MeshBase result = new MeshJoined(cubits);

Also available in: Unified diff