Project

General

Profile

« Previous | Next » 

Revision b5be333a

Added by Leszek Koltunski over 4 years ago

3 fixes for MeshBase.apply(VertexEffect).
This still does not work though.

View differences:

src/main/java/org/distorted/library/main/DistortedLibrary.java
482 482
      GLES30.glDrawArrays( GLES30.GL_POINTS, 0, num );
483 483
      InternalRenderState.restoreDrawing();
484 484
      GLES30.glEndTransformFeedback();
485
      GLES30.glBindBufferBase(GLES30.GL_TRANSFORM_FEEDBACK_BUFFER, 0, 0);
486

  
487 485
      mesh.copyTransformToVertex();
486
      GLES30.glBindBufferBase(GLES30.GL_TRANSFORM_FEEDBACK_BUFFER, 0, 0);
488 487
      }
489 488
    }
490 489

  
src/main/java/org/distorted/library/main/InternalBuffer.java
55 55
    recreate();
56 56
    }
57 57

  
58
///////////////////////////////////////////////////////////////////////////////////////////////////
59

  
60
  public int getIndex()
61
    {
62
    return mIndex[0];
63
    }
64

  
65 58
///////////////////////////////////////////////////////////////////////////////////////////////////
66 59
// must be called from a thread holding OpenGL Context.
67 60

  
src/main/java/org/distorted/library/mesh/MeshBase.java
273 273
     {
274 274
     float posX, posY, posZ, norX, norY, norZ;
275 275
     FloatBuffer feedback=null;
276
     ByteBuffer buffer = (ByteBuffer)GLES30.glMapBufferRange( GLES30.GL_TRANSFORM_FEEDBACK, 0, 6*4*mNumVertices,
277
                                                                GLES30.GL_MAP_READ_BIT);
276

  
277
     ByteBuffer buffer = (ByteBuffer)GLES30.glMapBufferRange( GLES30.GL_TRANSFORM_FEEDBACK_BUFFER, 0, TRAN_SIZE*mNumVertices,
278
                                                              GLES30.GL_MAP_READ_BIT);
278 279
     if( buffer!=null )
279 280
       {
280 281
       feedback = buffer.order(ByteOrder.nativeOrder()).asFloatBuffer();
281 282
       }
282 283
     else
283 284
       {
284
       Log.e("mesh", "print: failed to map tf buffer");
285
       int error = GLES30.glGetError();
286
       Log.e("mesh", "failed to map tf buffer, error="+error);
285 287
       }
286 288

  
287 289
     if( feedback!=null )
......
304 306
         mVertAttribs[vertex*VERT_ATTRIBS + NOR_ATTRIB + 2 ] = norZ;
305 307
         }
306 308
       }
309

  
310
     GLES30.glUnmapBuffer(GLES30.GL_TRANSFORM_FEEDBACK);
307 311
     }
308 312

  
309 313
///////////////////////////////////////////////////////////////////////////////////////////////////
......
346 350
 */
347 351
   public int getTFO()
348 352
     {
349
     return mTFO.getIndex();
353
     return mTFO.createImmediately(mNumVertices*TRAN_SIZE, null);
350 354
     }
351 355

  
352 356
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff