Suppose I render a Mesh with a ShaderMaterial.
Further suppose the fragment shader has the following form:
layout(location = 1) out vec4 gObjectPick;
// ...
// shader code setting gl_FragColor and gObjectPick
// ...
Is it possible to “read the pixels” of gObjectPick without doing another render using THREE.WebGLRenderTarget?
Another question: what is the relationship between “location = 1” and THREE.WebGLRenderTarget? Maybe it’s something that falls outside the three.js API?
Thanks that was helpful, but I’m still trying to understand how this can be a single render.
Suppose we create a render target with two textures and render our scene. Don’t we need another render e.g. of another scene containing a single full-screen quad?