Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

can we do liquid simulations with the new graphics?
Started by vik_b_it Oct 20 2013 09:18 PM

16 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

vik_b_it

[GLOBAL: userInfoPane.html]
vik_b_it
  • Contributor

  • 243 posts
  • Corona SDK

Hi,

 

Can we create water simulations like in the game 'Where is my water?'

 

 

Thanks

 

Vik



[TOPIC: post.html]
#2

rakoonic2

[GLOBAL: userInfoPane.html]
rakoonic2
  • Contributor

  • 503 posts
  • Corona SDK

The core game mechanic looks like it'd be tricky (but maybe not impossible) to implement using physics.



[TOPIC: post.html]
#3

piotrz55

[GLOBAL: userInfoPane.html]
piotrz55
  • Contributor

  • 754 posts
  • Corona SDK

You get tools, but such things you must implement yourself :D



[TOPIC: post.html]
#4

borgb

[GLOBAL: userInfoPane.html]
borgb
  • Contributor

  • 291 posts
  • Corona SDK

I was playing abit with the filters and such trying to simulate lava flowing. Still abit to go but there are possibilities. Need alot of optimization though. Quick test here:

 



[TOPIC: post.html]
#5

Daniel W.

[GLOBAL: userInfoPane.html]
Daniel W.
  • Contributor

  • 249 posts
  • Corona SDK

Wow! That's a really cool effect.



[TOPIC: post.html]
#6

ingemar

[GLOBAL: userInfoPane.html]
ingemar
  • Corona Geek

  • 2,733 posts
  • Enterprise

@borgb

 

Nice!



[TOPIC: post.html]
#7

DavidRangel

[GLOBAL: userInfoPane.html]
DavidRangel
  • Moderator

  • 888 posts
  • Corona Staff

Very nice!



[TOPIC: post.html]
#8

rakoonic2

[GLOBAL: userInfoPane.html]
rakoonic2
  • Contributor

  • 503 posts
  • Corona SDK

Very nice indeed :D Add in some sort of ripple effect for a heat haze!



[TOPIC: post.html]
#9

borgb

[GLOBAL: userInfoPane.html]
borgb
  • Contributor

  • 291 posts
  • Corona SDK

thanks! :)

Yeah, there is still missing some things, was also thinking about some smoke particles. And I havent tried it on device yet because I fear it will be abit slow as is ;) but its nonetheless fun to play with the new effects! It makes me want to learn more about fluid and particles.



[TOPIC: post.html]
#10

TandG

[GLOBAL: userInfoPane.html]
TandG
  • Contributor

  • 421 posts
  • Corona SDK

That looks great!

 

I knocked up a wave / splash simulation the other day to test a few things in graphics 2.0, its not pourable water like you asked for... but it does work well for splashing about in!

 

http://www.screencast.com/t/0BncADRhN

 

It still needs  a few fixes to make it look more realistic, but on the positive side it runs well on my iPad! 

 

 



[TOPIC: post.html]
#11

Danny

[GLOBAL: userInfoPane.html]
Danny
  • Corona Geek

  • 2,597 posts
  • Corona Staff

I was playing abit with the filters and such trying to simulate lava flowing. Still abit to go but there are possibilities. Need alot of optimization though. Quick test here:

 

 

 

That looks great!

 

I knocked up a wave / splash simulation the other day to test a few things in graphics 2.0, its not pourable water like you asked for... but it does work well for splashing about in!

 

http://www.screencast.com/t/0BncADRhN

 

It still needs  a few fixes to make it look more realistic, but on the positive side it runs well on my iPad! 

 

 

Nice work guys!



[TOPIC: post.html]
#12

vik_b_it

[GLOBAL: userInfoPane.html]
vik_b_it
  • Contributor

  • 243 posts
  • Corona SDK

@borgb,

 

Wow that looks really awesome.. any chance of a peak at the code? and also its looks like it is actually flowing after hitting the edges.. is physics involved at all?



[TOPIC: post.html]
#13

vik_b_it

[GLOBAL: userInfoPane.html]
vik_b_it
  • Contributor

  • 243 posts
  • Corona SDK

@TandG,

 

Looks nice.... see for one of my levels... that would be awesome as an underwater scene.. I also noticed Major magnet has some underwater scenes.,.. wonder how they did that?



[TOPIC: post.html]
#14

borgb

[GLOBAL: userInfoPane.html]
borgb
  • Contributor

  • 291 posts
  • Corona SDK

@TandG,

nice wave and splash! :)

 

@vik_b_it,

there is not much code really, just me playing around .That test is with physics yes. Just some semi transparent dots getting pushed out with filters applied to them. I had a combination of saturation, zoomblur and exposure I belive it was under that test. Then I just had some variation to the values applied and a transition to these so the lava changed. I also used a small radius to the particles physics compared to the particle image so they "melted" togheter abit and had some linear damping applied.



[TOPIC: post.html]
#15

rakoonic2

[GLOBAL: userInfoPane.html]
rakoonic2
  • Contributor

  • 503 posts
  • Corona SDK

These are great samples, keep 'em coming!

 

@borgb - have you thought about the bloom filter for lighting? I haven't actually checked what it does but the description implies it should be some kind of lighting bloom, so brighter stuff should sorta go overbright. Or maybe try additive instead of normal mode for the lava, so it also brightens and merges.



[TOPIC: post.html]
#16

Daniel W.

[GLOBAL: userInfoPane.html]
Daniel W.
  • Contributor

  • 249 posts
  • Corona SDK

I would love to get a sneak peek at the code even if there isn't much there.



[TOPIC: post.html]
#17

borgb

[GLOBAL: userInfoPane.html]
borgb
  • Contributor

  • 291 posts
  • Corona SDK

@rakoonic 

I tried with bloom filter once but couldn't quite get it to work, will have to look into it some more. To much new stuff to play with and not enough time ;)

 

@Daniel W.

the filter setup that I used was something like this:

 

local kernel = {}
kernel.language = "glsl"
 
kernel.category = "filter"
kernel.name = "glowing"
 
kernel.graph =
{
   nodes = {
      saturate = { effect="filter.saturate", input1="paint1" },
      blur = { effect="filter.zoomBlur", input1="saturate" },      
      exposure = { effect="filter.exposure", input1="blur" },    
 
   },
   output = "exposure",
}
 
return kernel
 
the physics for the particles:
        physics.addBody( lava[iNr], {radius = rad, density = 10, friction = 0, bounce = 0 } )
        lava[iNr].isFixedRotation = false
        lava[iNr].linearDamping = 1.5
        lava[iNr].angularDamping = 4

 

other is just playing with values. I had a spawn rate of about one particle every 80ms or so. I don't have the exact code for that example because I have long since tweaked and changed stuff and tried other things. Was just a test scene for filters :)




[topic_controls]
[/topic_controls]