Particle-based waterfall

Post your own tutorials, guides and demos.

Post » Sat Jan 31, 2009 12:34 pm

Nothing profound - just a simple particle waterfall, in case someone wants a waterfall in their game. :)

(Anyone else have any waterfalls to share? I've been trying to make a plasma-based waterfall, but at best it looks like a slow-moving stream trickling down a flat surface.)

http://www.mediafire.com/?ljiopddy3jn
B
5
S
2
G
4
Posts: 113
Reputation: 2,101

Post » Sat Jan 31, 2009 1:10 pm

Nice effect! You might want to try figuring out a way to use less than 15,000 particles though...
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,630

Post » Sat Jan 31, 2009 1:17 pm

Mmm, this slows down for me :(.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Sat Jan 31, 2009 1:36 pm

The splash effect at the bottom that uses 150 particles looks awesome! As for the water fall itself, that uses way too many particles lol. You could probably get decent results with a lot less and perhaps even using plasma...

But yeah, love the splash at the bottom!
B
4
S
2
G
5
Posts: 641
Reputation: 3,011

Post » Sat Jan 31, 2009 1:54 pm

Didn't slow down for me, looked pretty cool. I can see why this wouldn't be practical for in-game use though. Maybe a scrolling sprite with a Warp effect for the waterfall itself, but still using plasma?
B
2
S
2
G
5
Posts: 156
Reputation: 1,962

Post » Sat Jan 31, 2009 3:20 pm

15,000 particles is about equivalent to 3750 sprites in terms of rendering muscle, so it is going to be slow for a lot of people. Often you can achieve a similar effect with fewer particles by reducing the rate and increasing the particle size.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,630

Post » Sun Feb 01, 2009 1:37 pm

Hmm, you're right; it works just as well with half the particles at double the size! That's much better. :)

Is there an inbuilt reason that particles are more efficient than sprites to render? I've also been making a similar waterfall that's entirely event-based, using sprites.

http://www.mediafire.com/?wu4j5dtttub

(Not a very efficient waterfall, but I do need objects to interact with the particles. I'm eventually planning to have a swarm of objects chased through it, encountering some resistance and pushing the blobs of water aside.)
B
5
S
2
G
4
Posts: 113
Reputation: 2,101

Post » Sun Feb 01, 2009 3:53 pm

[quote="Mort":nuoqtudi]Is there an inbuilt reason that particles are more efficient than sprites to render?[/quote:nuoqtudi]
DirectX can draw a particle from a single vertex, but a sprite requires four. So the data to transfer to the GPU is about a quarter that of sprites.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,630

Post » Sun Feb 01, 2009 6:01 pm

Note though that if you use textured particles, you lose that speed increase :(.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Sun Feb 01, 2009 6:27 pm

It's only if you enable certain options like particle rotation, then it has to draw them like sprites... it can texture particles with one vertex just fine and it barely affects performance from my own profiling. Davo can tell you more about which options go to sprite-style rendering.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,630

Next

Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 0 guests