Project

General

Profile

« Previous | Next » 

Revision e78a30fd

Added by Leszek Koltunski about 7 years ago

Progress with Transform Feedback.

View differences:

src/main/java/org/distorted/library/MeshObject.java
44 44
   int[] mNorVBO = new int[1];
45 45
   int[] mTexVBO = new int[1];
46 46

  
47
   int[] mPosTBO = new int[1]; // Transform Feedback
48

  
47 49
   final float zFactor; // strange workaround for the fact that we need to somehow store the 'depth'
48 50
                        // of the Mesh. Used in DistortedEffects. See DistortedTexture.getDepth().
49 51

  
......
84 86
       GLES30.glBufferData(GLES30.GL_ARRAY_BUFFER, dataLength*    TEX_DATA_SIZE*BYTES_PER_FLOAT, mMeshTexture  , GLES30.GL_STATIC_READ);
85 87
       }
86 88

  
89
     if( mPosTBO[0]<0 )
90
       {
91
       GLES30.glBindBuffer(GLES30.GL_TRANSFORM_FEEDBACK_BUFFER, mPosTBO[0]);
92
       GLES30.glBufferData(GLES30.GL_TRANSFORM_FEEDBACK_BUFFER, dataLength*POSITION_DATA_SIZE*BYTES_PER_FLOAT, null, GLES30.GL_STATIC_READ);
93
       GLES30.glBindBuffer(GLES30.GL_TRANSFORM_FEEDBACK_BUFFER, 0);
94
       }
95

  
87 96
     GLES30.glBindBuffer(GLES30.GL_ARRAY_BUFFER, 0);
88 97
     }
89 98

  
......
107 116
       GLES30.glDeleteBuffers(1, mTexVBO, 0);
108 117
       mTexVBO[0] = -1;
109 118
       }
119
     if( mPosTBO[0]>=0 )
120
       {
121
       GLES30.glDeleteBuffers(1, mPosTBO, 0);
122
       mPosTBO[0] = -1;
123
       }
110 124
     }
111 125

  
112 126
///////////////////////////////////////////////////////////////////////////////////////////////////
......
116 130
     mPosVBO[0] = -1;
117 131
     mNorVBO[0] = -1;
118 132
     mTexVBO[0] = -1;
133
     mPosTBO[0] = -1;
119 134
     }
120 135

  
121 136
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff