Sunday, 15 September 2013

Reading WebGLRenderTarget pixel data in Three.js

Reading WebGLRenderTarget pixel data in Three.js

I have created a sculptable terrain with height displacements using GLSL
shaders in Three.js. It's done via two THREE.WebGLRenderTargets to
accumulate the sculpted heights in a fragment shader. The vertices of the
mesh are then displaced with this texture via vertex texture fetching in a
vertex shader.
However, I need the updated terrain to be a collision for a CPU-based
rigid body system. How do I get the updated height data from a
THREE.WebGLRenderTarget?

No comments:

Post a Comment