Scirra / Construct-feature-requests

A place to submit feature requests and suggestions for Construct.
https://www.construct.net
11 stars 1 forks source link

[SDK 2.0] Add method to push/pop gfx state (gl state / webgpu state) to support alternative renderers to mix w/ C3 render #237

Open MikalDev opened 5 months ago

MikalDev commented 5 months ago

Reviewed guidelines

Checked for duplicate suggestions

Summary

Add a method to use during Draw() to push/pop current gfx state, so another renderer can draw to the current gfx context to mix with C3 render. For example, the current Spine addon batch renders all the spine characters to textures that can be used with normal C3 draw calls.

This could also be done with other renderers for special effects or alternate renders mixed with C3 rendering.

Possible workarounds or alternatives

Do manual push/pop of gfx state. I do this with the spine webgl currently for webgl2, but it does not take into account possible changes in the future implementations of the C3 render.

Proposed solution

Add gfx push/pop method. for webgl2/webgpu state.

Why is this idea important?

To enable additional renders, such as webgl2 Spine render, Babylon, Three, etc. to mix with C3 render.

Additional remarks

No response

MikalDev commented 4 months ago

Further discussion on why this is important. This is to continue to support the existing Spine C3 addon for WebGL for C3. Is is needed in V2, because it will take some time for an official Spine addon with C3 V2 SDK is made.

After the V2 SDK becomes stable and more complete. The Esoteric SW team will work on creating an 'official' C3 Spine Addon using the V2 SDK (they have a couple of requests for V2 SDK to support this addon, which I will help document) Since this new addon will use V2 SDK, it will support both webGL and webGPU

skymen commented 4 months ago

I want to add that I've been experimenting with an Effekseer addon for Construct 3 that also relies on having access to this. https://twitter.com/skymen75/status/1765325784099750192