Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Questions about Particles Colors
Started by maximo97 Jun 05 2018 07:27 AM

7 replies to this topic
particles particles colors
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

maximo97

[GLOBAL: userInfoPane.html]
maximo97
  • Contributor

  • 205 posts
  • Corona SDK

Hi guys!

 

I wanted to have a liquid effect so I was trying out the particles I had not used yet.

I really like them a lot but there's something I do not understand:

 

If I combine, for example, a red particle with a blue one (unsing 

flags = { "water", "colorMixing" }

)

The particles behave as indicated in the documentation:

http://google.github.io/liquidfun/Programmers-Guide/html/md__chapter11__particles.html#pb

 

so reasoning in colors from 0 to 1 I will have two balls of color: (0.5, 0, 0.5).

How can I do though if I want to have two balls of color: (1, 0, 1)?

 

 

Edit:

I also tried adding a white particle but by doing two counts you understand that it is still not enough


Edited by maximo97, 05 June 2018 - 09:04 AM.


[TOPIC: post.html]
#2

maximo97

[GLOBAL: userInfoPane.html]
maximo97
  • Contributor

  • 205 posts
  • Corona SDK

Thinking about it better, the question can be more precise like this:

 

Given the particle color fusion rules, how can I mix particles to get a particle that (for example) has the following color : (1, 0, 1) ?



[TOPIC: post.html]
#3

davebollinger

[GLOBAL: userInfoPane.html]
davebollinger
  • Corona Geek

  • 1,167 posts
  • Enterprise

you're describing additive blending.   try setting the blend mode to "add", tho you may then get unwanted additive side-effects against the background (unless it's black).



[TOPIC: post.html]
#4

maximo97

[GLOBAL: userInfoPane.html]
maximo97
  • Contributor

  • 205 posts
  • Corona SDK

I know that attribute but as you said creates problems with backgrounds that are not black.

 

I was wondering then if there was another solution maybe mixing other particles...

 

Or any other idea



[TOPIC: post.html]
#5

davebollinger

[GLOBAL: userInfoPane.html]
davebollinger
  • Corona Geek

  • 1,167 posts
  • Enterprise

not natively supported that i'm aware of, so suspect you're unlikely to find a workaround.  (tho i'm no expert on liquidfun - it's just a crash-generator for me, gave up trying it long ago)

 

the only thing i can think of, and it's a long-shot, is to do your own color mixing, say in response to a collision event.  tho i'm not sure that you'll be able to access the other particle's color, might have to muck around with adding your own color values to "expose" them, then keeping them in sync as you mix, etc...  performance would probably be terrible, and it's all just conjecture, not tested at all, just for ideas.

 

i suppose if queryRegion actually gave you a callback (like liquidfun native does) you could iterate the particles, "dodging" their red/blue to saturate, but that's a non-starter with qR.  (and again, performance would probably be terrible)



[TOPIC: post.html]
#6

maximo97

[GLOBAL: userInfoPane.html]
maximo97
  • Contributor

  • 205 posts
  • Corona SDK

As I feared ....

 

Another annoying thing is not to have references to the single particle but only to the group....

 

I was thinking of creating something simple using physics and collision events (creating a physical body that mimics the particle) but I fear it would be more complicated than expected. Do you have any other advice?...



[TOPIC: post.html]
#7

davebollinger

[GLOBAL: userInfoPane.html]
davebollinger
  • Corona Geek

  • 1,167 posts
  • Enterprise

that's the best i can offer, maybe someone more experienced with liquidfun can chime in



[TOPIC: post.html]
#8

maximo97

[GLOBAL: userInfoPane.html]
maximo97
  • Contributor

  • 205 posts
  • Corona SDK

I understand, thanks the same!

 

I am waiting then




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: particles, particles colors