Another update: on some platforms, we can get rid of temporary framebuffers entirely for effects that do not use cross-sampling. Most effects do not use cross-sampling, so this significantly improves the performance of effects, especially popular ones like Overlay and Screen.
This is achieved by using memory barriers on platforms that support it (such as console platforms, and Direct3D 11/OpenGL with glTextureBarrier). This allows us to read a texture while writing to it at the same time, so a temporary framebuffer isn't necessary. WebGL does not support memory barriers, which may be a reason why the regular Construct runtimes do not perform this optimization.
As described in the effect compositor writeup from Ashley, objects sometime require predrawing in the standard runtimes, such as when objects are rotated. By using the right texture coordinates for the background texture, we can also skip this step, removing another case where temporary framebuffers are used.
In Chowdren, there are now only a few situations where a temporary framebuffer is required:
- When a layer has 'force own texture', is not fully opaque, or uses an effect, a temporary framebuffer is needed to render the intermediate result.
- When an object uses a cross-sampling effect (such as WarpMask, WaterBg), a partial copy of the background is made.
Headbang Games
Please check your inbox :)