How to get MRT textures from WebGLMultisampleRenderTarget

webgl2
#1

Hi! First of all i want to say thank you for the webgl2 implementation in three.js.

I try to use webgl2 MRT implementation, wrote simple test glsl 3 fragment shader with 3 output colors :

#version 300 es
precision highp float;
out vec4 fragColor[3];
void main()
{
fragColor[0] = vec4(0.0,1.0,0.0,1.0);
fragColor[1] = vec4(0.0,0.0,1.0,1.0);
fragColor[2] = vec4(0.1,0.0,0.0,1.0);
}

The first variable (fragColor[0]) I can access via standard procedure like from any WebGLRenderTarget (ShaderPass.target.texture), but others…
So my question - is it possible to get all outputs as textures like first one with the “native” Three.JS code? Or I need to go to raw webgl code and get them from canvas.context?

Thank you

0 Likes

#2

three.js supports multi-sampled render targets but not multiple render targets (MRT) so far. These are two different features. There might be a new THREE.WebGLMultiRenderTarget class as some point, see this PR.

0 Likes