Gamua / Starling-Extension-Particle-System

A particle system for the Starling framework, compatible with the "Particle Designer" from 71squared.com
Other
323 stars 146 forks source link

Cannot make Sun to work, neither Jellyfish #30

Closed tadeubas closed 6 years ago

tadeubas commented 6 years ago

Hi Daniel,

I've tried to see all the Demo examples, but Sun doesn't work at all and Jellyfish works with squares (see the image below): bug-jellyfish

I got sun to work only when changed the .pex file blendFunc:

//FROM
  <blendFuncSource value="772"/>
  <blendFuncDestination value="771"/>

//TO
  <blendFuncSource value="770"/>
  <blendFuncDestination value="772"/>

Image of sun "working" with the changes in blendFunction: sun

I am using FD to compile the project with Flex + AIR 4.6.0 + 23.0.0, compiled the project with -swf-version=34, using FP sa debugger (latest version: 28) and Starling v2.1 that says [Starling] Context ready. Display Driver: DirectX11 (Baseline Extended). Any ideas of what I'm missing?

tadeubas commented 6 years ago

linking to Daniel: @PrimaryFeather

PrimaryFeather commented 6 years ago

tl;dr: The following code should fix the issue:

stage.color = 0xff000000;

In the past, Starling's background had an alpha value of 1.0 per default, but this was counter-intuitive for some users, so I changed the default to 0.0. This, however, changes the output of some blend factor combinations (i.e. blend modes). The line above changes the alpha with which the back buffer is cleared to 1.0, and thus restores the original behavior.

Please let me know if that fixe this issue for you! (If it doesn't, please also try upgrading to the latest 2.3 version of Starling.)

PrimaryFeather commented 6 years ago

(I just added that information to the particle system's wiki page, too.)

tadeubas commented 6 years ago

@PrimaryFeather If you see on the init() function of your demo code, this is already defined on line 58 stage.color = 0xff000000;. removing this line I've got this on sun and jellyfish: sun

jellyfish

tadeubas commented 6 years ago

Adding a Quad addChild(new Quad(600, 600, 0x00000000)); on the line 58 I've got this: sun-blacksquare

jellyfish-blacksquare

Is this the correct behavior?

tadeubas commented 6 years ago

Testing with Starling 2.3, with or without the line stage.color = 0xff000000; I've got the same behaviour as the version 2.1 adding the Quad. I think you could remove the information of the stage.color and add the information to use Starling 2.3 😛

Thanks Daniel!

PrimaryFeather commented 6 years ago

Hmhm, that's weird, then something else must have changed that caused compatibility issues. But I'm glad to hear it works now! :smile:

PrimaryFeather commented 6 years ago

(Oh, and yes: quad behind the object will also fix those blend mode issues!)