flyover / spine-c2-plugin

A Construct 2 plugin for creating a Spine animation object.
MIT License
27 stars 5 forks source link

WebGL Premultiply Conflict with C2 #2

Closed Fromageinteractif closed 8 years ago

Fromageinteractif commented 8 years ago

When a Spine object is in a layout with, for instance, a Construct 2 Sprite object, then the OpenGL premultiply feature seems to turn back on "automatically" gl.pixelStorei(gl["UNPACK_PREMULTIPLY_ALPHA_WEBGL"], true) When the same Spine object is in a layout without any Construct 2 Sprite objects, then the OpenGL premultiply feature stays on the right setting from the Spine export gl.pixelStorei(gl["UNPACK_PREMULTIPLY_ALPHA_WEBGL"], false)

This issue is fixable by editing the c2runtime.js after having exported it in html5, but it would be better to be supported straight away in C2.

flyover commented 8 years ago

I wanted to modify the Construct 2 WebGL context as little as possible; using whatever defaults they use. There is an option in the Spine exporter, when exporting an atlas, where you can premultiply alpha into the output image.

Fromageinteractif commented 8 years ago

Yes this is the thing. When I add a sprite object into the construct 2 layout it seems that construct 2 then ignore the premultiply option from spine export. I will send you an example in the other topic.