Revision 70a3f657
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/examples/feedback/FeedbackRenderer.java | ||
---|---|---|
118 | 118 |
Log.e("TransformFeedback", "exception creating feedback program: "+ex.getMessage()); |
119 | 119 |
} |
120 | 120 |
|
121 |
float[] floatData = { 2.0f, 4.0f, 9.0f, 16.0f, 25.0f, 100.0f };
|
|
121 |
float[] floatData = { 1.0f, 4.0f, 9.0f, 16.0f, 25.0f, 100.0f };
|
|
122 | 122 |
mBufferLength = floatData.length * 4; |
123 | 123 |
FloatBuffer data = ByteBuffer.allocateDirect(mBufferLength).order(ByteOrder.nativeOrder()).asFloatBuffer(); |
124 | 124 |
data.put(floatData).position(0); |
... | ... | |
127 | 127 |
GLES30.glGenBuffers(1, mVBO, 0); |
128 | 128 |
GLES30.glBindBuffer(GLES30.GL_ARRAY_BUFFER, mVBO[0]); |
129 | 129 |
GLES30.glBufferData(GLES30.GL_ARRAY_BUFFER, mBufferLength, data, GLES30.GL_STATIC_READ); |
130 |
GLES30.glBindBuffer(GLES30.GL_ARRAY_BUFFER, 0); |
|
130 | 131 |
|
131 | 132 |
mTBO = new int[1]; |
132 | 133 |
GLES30.glGenBuffers(1, mTBO, 0); |
133 | 134 |
GLES30.glBindBuffer(GLES30.GL_TRANSFORM_FEEDBACK_BUFFER, mTBO[0]); |
134 | 135 |
GLES30.glBufferData(GLES30.GL_TRANSFORM_FEEDBACK_BUFFER, mBufferLength, null, GLES30.GL_STATIC_READ); |
135 |
|
|
136 |
GLES30.glBindBuffer(GLES30.GL_ARRAY_BUFFER, 0); |
|
136 |
GLES30.glBindBuffer(GLES30.GL_TRANSFORM_FEEDBACK_BUFFER, 0); |
|
137 | 137 |
} |
138 | 138 |
} |
Also available in: Unified diff
Preparation for Transfer Feedback: Convert the meshes from client-side to VBOs.