Trying to wrap my head around the FBO technique following along Nicolas Barradeau's FBO Particles blog post.
-
Use WebGL1Renderer, otherwise the WebGLRenderer that now uses WebGL2 by default,
gl.getExtension()
will always returnnull
and and error will be thrown when we check for support. -
Within the FBO class update method, when updating the texture uniform value, don't set it to render texture object but use its
.texture
property instead. Like so :// NOPE particles.material.uniforms.positions.value = rtt; // YEP particles.material.uniforms.positions.value = rtt.texture;
-
update the
BufferGeometry.addAttribute
method toBufferGeometry.setAttribute
. Syntax stays the same. -
Enable the
WEBGL_color_buffer_float
extension to maximise portability and get rid of warning.gl.getExtension("WEBGL_color_buffer_float");