Closed vorg closed 5 years ago
So it breaks when postprocessing is on (even if all effects are set to false)
It looks like it's a bigger re-engineering because currently I always write to gl_FragData[1]
as long as MRT are available. This is messy and I should and shouldn't write there depending on the number or color attachemnts in the parent pass
As the number of params in drawMeshes is already big we should probably switch to opts object at the same time.
Technically this means we need configurable fragment outputs. Eg gl_FragData[0]:color, 1:normal. And if we are there why not allow 0:roughness, 0:AO.. for debugging.. although that could be handled in user space with snippet string replace... our shaders have already too many if defs
Material.frag has #define USE_DRAW_BUFFERS
by skybox doesn't.. which causes skybox.frag.js#L58 to never execute and render target at position 1 not written.
Skybox output was first added here https://github.com/pex-gl/pex-renderer/commit/d5740e035b55a425c508f431ebd7fb394ab42b2c#diff-3991c9c3206b207bfd2f9e34f26ad6c5R24 and wrapped in #ifdef USE_DRAW_BUFFERS
here https://github.com/pex-gl/pex-renderer/commit/3008f45d1d169e5830fd8ec2e0d2d7089aff16fa#diff-3991c9c3206b207bfd2f9e34f26ad6c5R27
FF
Error: WebGL warning: drawElements: Program has no frag output at location 1, but destination draw buffer has an attached image.
ChglDrawElements: buffer format and fragment output variable type incompatible