Question

Is there any way to emit more then eg. 4 bytes from an GLSL fragment shader, if the implementation doesn't support multiple FBO buffer attachments or 'deep' buffer formats?

For example when using WebGL or OpenGL ES, being restricted to a RGBA output per fragment makes complex calculations extremely inefficient, if parts of the calculations have to be repeated in multiple passes to get more output channels.

Was it helpful?

Solution 2

No, there is no way efficiently output more then the usual channels. That means calculations with more outputs need to be done in more than one pass. Calculations with more than one output that share costly intermediate results may have the intermediate results computed as additional passes before, however the overhead will most likely eat up any performance advantage gained.

OTHER TIPS

What you output isn't measured in bytes, but in components. Each image can only store four components, therefore you can only output four components per output image.

If your hardware could output more data, then it would allow you to output to more images. It could expose that through an extension. If such an extension is not present, then the hardware can't, and therefore you can't either.

Note that NVIDIA has such an extension, so their ES enabled hardware might be able to do it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top