I have received two texture objects containing position and normal data:
var tx1 = gpuCompute.getCurrentRenderTarget( positionVariable ).texture;
var tx2 = gpuCompute.getCurrentRenderTarget( normalVariable ).texture;
These textures are generated using GPUComputationRenderer
in three.js
as shown in the example gpgpu/protoplanet
(1).
My goal is to convert them into WebGLBuffer objects for rendering, like so:
gl.bindBuffer(gl.ARRAY_BUFFER, tx1);
gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, 3, gl.FLOAT, false, 0, 0);
gl.bindBuffer(gl.ARRAY_BUFFER, tx2);
gl.vertexAttribPointer(shaderProgram.vertexNormalAttribute, 3, gl.FLOAT, false, 0, 0);
However, a direct assignment doesn't work. I'm wondering if there's another way to achieve this. Below, you can see the format of these two objects (tx1 from threejs, tx2 from WebGL). Thank you.
(1)