Project

General

Profile

« Previous | Next » 

Revision f80337b5

Added by Leszek Koltunski about 7 years ago

Revert "Some progress with Transform Feedback. Still many bugs all over."

This reverts commit 79921db22e4ff5a3b2e6e3466a39445f5607a695.

View differences:

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

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

  
50 49
   final float zFactor; // strange workaround for the fact that we need to somehow store the 'depth'
51 50
                        // of the Mesh. Used in DistortedEffects. See DistortedTexture.getDepth().
......
84 83
       {
85 84
       GLES30.glGenBuffers(1, mTexVBO, 0);
86 85
       GLES30.glBindBuffer(GLES30.GL_ARRAY_BUFFER, mTexVBO[0]);
87
       GLES30.glBufferData(GLES30.GL_ARRAY_BUFFER, dataLength*     TEX_DATA_SIZE*BYTES_PER_FLOAT, mMeshTexture  , GLES30.GL_STATIC_DRAW);
86
       GLES30.glBufferData(GLES30.GL_ARRAY_BUFFER, dataLength*    TEX_DATA_SIZE*BYTES_PER_FLOAT, mMeshTexture  , GLES30.GL_STATIC_DRAW);
88 87
       }
89 88

  
90 89
     if( mPosTBO[0]<0 )
......
93 92
       GLES30.glBufferData(GLES30.GL_TRANSFORM_FEEDBACK_BUFFER, dataLength*POSITION_DATA_SIZE*BYTES_PER_FLOAT, null, GLES30.GL_STATIC_READ);
94 93
       GLES30.glBindBuffer(GLES30.GL_TRANSFORM_FEEDBACK_BUFFER, 0);
95 94
       }
96
     if( mNorTBO[0]<0 )
97
       {
98
       GLES30.glBindBuffer(GLES30.GL_TRANSFORM_FEEDBACK_BUFFER, mNorTBO[0]);
99
       GLES30.glBufferData(GLES30.GL_TRANSFORM_FEEDBACK_BUFFER, dataLength*  NORMAL_DATA_SIZE*BYTES_PER_FLOAT, null, GLES30.GL_STATIC_READ);
100
       GLES30.glBindBuffer(GLES30.GL_TRANSFORM_FEEDBACK_BUFFER, 0);
101
       }
102 95

  
103 96
     GLES30.glBindBuffer(GLES30.GL_ARRAY_BUFFER, 0);
104 97
     }
......
128 121
       GLES30.glDeleteBuffers(1, mPosTBO, 0);
129 122
       mPosTBO[0] = -1;
130 123
       }
131
     if( mNorTBO[0]>=0 )
132
       {
133
       GLES30.glDeleteBuffers(1, mNorTBO, 0);
134
       mNorTBO[0] = -1;
135
       }
136 124
     }
137 125

  
138 126
///////////////////////////////////////////////////////////////////////////////////////////////////
......
143 131
     mNorVBO[0] = -1;
144 132
     mTexVBO[0] = -1;
145 133
     mPosTBO[0] = -1;
146
     mNorTBO[0] = -1;
147 134
     }
148 135

  
149 136
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff