3d particles

Community Forums/Showcase/3d particles

AdamStrange(Posted 2015) [#1]


Just a quick shot showing the 3d particles are now operational. nThat's not strictly true, the base code is working with depth system buffers and map lighting.

the depth system means that the particles will be behind other 3d objects (check out the door and frame)

The smoke? is orange cause that was what I was using as a test color. It does rise, but there is no scaling etc.

I like the thought of opening a door and fog coming out?

Hot of the press...


Derron(Posted 2015) [#2]
I like the thought of opening a door and fog coming out?


This was what I thought too.
But I think to make the fog "want to pour out of the room" it might need to have more density in the other room ... so it is "forced" to move.

Currently it looks a bit more like if you placed a fog bomb right in the door arc.

BTW the orange is really vivid - like a player color.


I think it will reeeeallly improve visuals if you place that "fog" above lava areas ... or a really light and high-transparency one above water (you know ... cold area, warm water ...)

Think that it might look awesome (read: awaiting screenshots to proof the assumption :p).


Keep on improving.


bye
Ron


Steve Elliott(Posted 2015) [#3]

a fog bomb right in the door



Like one of Gfk's after a particularly hot curry :)


AdamStrange(Posted 2015) [#4]
Little steps:
I've linked the particles into the wind system. So lets assume you leave a trail (as above)

If you cross the particle stream/trail or go through it in any way, the particles respond and move in the correct direction (you can define how much this is applied)

Here's a shot of it in operation:



Derron(Posted 2015) [#5]
Currently I assume you add some "force" to the fog when an object moves through it.

It can be a bit tricky but normally you do not just push it forward, but also "outwards" (to the left and right) in a bit "curling" movement. All of this depends of course on the thickness of the fog and the "glue" holding particles together or not.

To see how things move you might just take some marmelade/jar/sauce and put in on a dish. then move your finger through it -- as if you push the fog. This will show how it should behave.
This whill additionally have a bit of an effect for the "z"-axix (fog is on spot X already and you push new fog at this spot - either the fog 2 moves fog 1 away in the movement direction, or it pulls it up or down a bit). So you might experiment a bit with z-axis-changes too (gravity + upwards+force). Of course "gravity" also needs the particles to have some kind of dimension (so they recognize it when reaching a dense surface).


But like you said: little steps, so see above just as a "brainstorming idea" rather than harsh critics.


bye
Ron


AdamStrange(Posted 2015) [#6]
you add some "force" to the fog when an object moves through it.

Nope. There is an underlying 'wind' vector map that is inherent (inbuilt) directly into the map. When any character moves, they modify this map.

The map has it's own internal vector system that propagates wind to other cells automatically. it even decays wind movement.

Each particle hooks directly into this wind map changing the particle movement

The particle system has full gravity, but I haven't activated it as yet. The only thing a particle currently has is a default size and it's x,y,z location.


Derron(Posted 2015) [#7]
@decay
I do not know if I described my thought understandable.
The basic idea is, that moving straight along the X-axis does not only add to the wind-"tiles" along the x-axis, but also a bit on the y-axis (left and right)


I tried to draw it:

   A B C
1    °
2  \ | /
3  - o -
4  / ^ \
5


Figure with force "^" is moving towards the little dot.
When moving from B4 to B3 it pushes the fog on B3 towards B2...
but not completely, a bit of the "o" fog will go to all other areas.
Depending on the forces on A2, C2, A3, C3, and so on.
To keep it easy you could split it off using some relative amounts, so A2 gets 10%, B2 gets 80% and C2 gets 10% too.
If doing so, you also have to think of your back!
When moving from B4 to B3 you take wind with you - so just take 80% from B5 and 10% from each A5 and C5.

Of course you could even make it more complicated/"real" but as long as you simulate a bit, people will feel way more immersed into it (your current implementation already improves that).

Even my suggestion adds some recursive functionality (10% of wind go to a side tile - which moves wind on this tile ... and so on). I think you should clamp changes then to some minimum strength to reach until stopping propagating the change to other tiles/array entries.


bye
Ron


AdamStrange(Posted 2015) [#8]
Already ahead of you with the clamping.

The key thing is speed of processing, in one cycle all cells must be logically updated and wind propagated.

This is done with no recursion needed and minimal math so becomes very quick to process :)

But good points raised :)


Matty(Posted 2015) [#9]
Might be worth looking up a couple of things like

:Reynolds number, Newtonian fluids, Bernoulli equation and Navier Stokes equation. .. fluid mechanics 101 sort of stuff. ..not that you have to solve all of these but a basic grasp may give you some ideas. ..


AdamStrange(Posted 2015) [#10]
Fluid mechanic is a bit more than I need, but great to look at :)

Just got the soft particles fully operational. So no hard edges where particles meet 3d surfaces - smooth blends all the way :)



I've also added wall/door blocking. So particles won't drift through walls, etc.

Means particles can do their thing in a locked closed room and then flow out if the door is opened



the red skull on the door means you will need to have a red key to open it!


Derron(Posted 2015) [#11]
This is a skull? looks more like a mask (which fits too .. if it resembles eg a "cult").

Have you thought about adding the fog-thingy to water/lava to add atmosphere ?

I understand that you "just" create a particle system so things like "fire" will surely improve visually with some particles added and mixed.

Regarding fire ... is it influenced by the wind vectors too?
If you have "wind creating" elements in the levels (eg. the door to the "outside") it might influence things somehow.
If you "explode" something in the middle of a room, the wind should move accordingly so that fire in corners is "pushed" towards the corner.

If you have a torch in the units hand, it should have inertance regarding movement (more correct: it is heavily influenced by "air" so you could reuse the existing wind-effects).

I can assume that these small things really add to the overall visual look. But I think it comes with the costs of performance decrease.


bye
Ron


AdamStrange(Posted 2015) [#12]
yep the particle system is very flexible, so adding it to lava etc is no problem. I'm just debugging the drawing at the moment, then I will directly integrate particles into the 3d editor so you will be able to design them. I can also use the behaviours and controls from Avares (the old particle editor) along with the concepts designed.

things like fire, sparks, smoke, bubbles, leaves, explosions - whatever are very easy to set up :)

Yep (also on fire being affected by wind). You can set how much the particles are affected by wind (and that could also be by time too). so a particle could start life not being affected by wind and end up being affected.

None of this will hurt performance :)

Map checking is also now implemented, so particles will follow the map correctly and behave as liquid flowing down.



You can see this in action here and also show how the particles blend to the corners nicely.


Why0Why(Posted 2015) [#13]
I really like the look(and the orange color for a magic effect.)


Derron(Posted 2015) [#14]
Hmm, think you replace the image -- it was not there after I read your reply... hmm

Is the dwarf in the air or standing a bit on the next stair already?

This screen shows how much additional effects influence else boring looking patterns ... variety :p
Similar to decorations/decals (like leafs floating around - albeit this does not fit to the scenery).

Did you think of reusing the particle and wind system for some things like little insects crouching over the ground (they could use the wind as movement path and specific tiles as despawn point upon colliding).


Aboves "crouching fog" looks like there is some witches pot hidden with magical fog coming out of the "whatever she cooked" soup.


Cannot await to see screens/anis when things come together (particles, lighting, etc.) your work is surely coming along nicely.


bye
Ron


AdamStrange(Posted 2015) [#15]
Is the dwarf in the air or standing a bit on the next stair already?
. Yep, characters always stay on the topmost tile they are on. Also when the main character moves, it is 'picked up'

little insects crouching over the ground
That is such a good idea - I hadn't thought of that sort of thing. But now it's on my radar :)


Xilvan(Posted 2015) [#16]
These smoke particles
looks awesome!


RemiD(Posted 2015) [#17]
With such smoke/dust particles you could create a "monster" similar to the one in Lost : https://www.youtube.com/watch?v=TaqbyekJHHs&t=03m46s


AdamStrange(Posted 2015) [#18]
lol, sure could :)

I'm just integrating the system into the 3d editor so everything is unified.

it's a very flexible system based on 64 user selected particle types.


AdamStrange(Posted 2015) [#19]
Here is the first look at the new particle system UI in Rameses:






You can see the 3 base editing systems: Particles, curve and color

And here are the first 3d shots of it in operation in the GL window:



Still work to be done on activating color and also making the UI context sensitive so that controls enable and disable correctly.

I tried to make the UI as logical as possible and also visual, but as with anything particle related, nothing is straight forward


feeble1(Posted 2015) [#20]
I really like your work!


AdamStrange(Posted 2015) [#21]
Here is a quick animated version with 2 particle systems:


One is for the smoke and one for the fire.

colour is set for start, middle and end. with the middle being able to be reset:



and here are some quick tests:


So the system is now basically finished. I need to do some housekeeping, tidy up the default particles and also some further integration work now like loading/saving, etc.





Derron(Posted 2015) [#22]
Think "fire" is a bit more complicated than just using a gradient. For now it looks like a smokey flag of "Belgium" or "Germany" :p

But I understand that this was just "a quick example". Just wanted to hop in for you to recognize that your thread does not go down unread.

colour is set for start, middle and end. with the middle being able to be reset


I did not get this correctly. You have a 3 step gradient. And are able to reset it in the middle? Why not just use a 2 step gradient in this case? Or did you mean something different?


bye
Ron


AdamStrange(Posted 2015) [#23]
You have a 3 step gradient. And are able to reset it in the middle? Why not just use a 2 step gradient in this case?

Yep, it's 3 step, but the middle step can be repositioned. E.G. near the start or end, or anywhere in-between
You just click and drag the middle step


Derron(Posted 2015) [#24]
Ah, yes, so a value between 0.0-1.0 (like weighting).

Wouldnt call that a "reset" but a "shift" of the median point.


So you define 3 colors and a "median point" (float 0.0-1.0) which states at which point color 2 is reached ?


bye
Ron


AdamStrange(Posted 2015) [#25]
Yep, 3 points and a median:

Here's the UI



The middle (median) point you just click and drag to new point


Derron(Posted 2015) [#26]
If you can imagine usage for it you could extend it to be concatenated
a-b-c [concat] c-d-e .... like in the gradient setups of paint programs.

This allows for similar effects as if you place some kind of "timing value" at each of the color steps. Eg a short period of red, then a long green one ending with a blue
0% red ...
at 10% green
at 90% green (#2)
at 90% blue


Of course: if you do not see need for it now,do not hassle with it and save some spare time :p


bye
Ron


AdamStrange(Posted 2015) [#27]
Here's some more flame fx.



There are two particle systems being used. one has normal alpha mapping and the other color saturation. When both are used together you get a much better look.

I have shown systems on a dark and light backgrounds so you can see how they function.

So far the UI is now fully operational, just the load and save routines need to be done.

Systems can also be added to groups with the additional animation controls being valid for the particle location. Also Particles in groups only use one particle system, so no duplicates are added.


BlitzSupport(Posted 2015) [#28]

Just got the soft particles fully operational. So no hard edges where particles meet 3d surfaces - smooth blends all the way


That's awesome... even most triple-A games haven't been able to pull this off for the last 10-15 years!


AdamStrange(Posted 2015) [#29]
That's awesome... even most triple-A games haven't been able to pull this off for the last 10-15 years!


I thought that was standard now?

It's not too hard. based on a deferred render and depth buffer. where a particle is far behind don't draw, do a fade as you come nearer.

If anyone wants to play (OS X only). Feedback would be very welcome :)


Rick Nasher(Posted 2015) [#30]
Very nice.


AdamStrange(Posted 2015) [#31]
just been on an optimising run and I've split the particle system into 3 passes:
1. simple particles
2. flat complex particles
3. facing complex particles

Both the complex particles are full operational.

The simple will be a reduced set with much fewer options and will be faster and not have multiple particle types or set color. just simple scale, alpha and rotate.


Derron(Posted 2015) [#32]
You could create particle groups or let the emitter decide about color (i assume there are less emitters than particles :p). Same for scale, alpha etc. So you could have really stupid particles (particleBase) and only extended particles have these other components (of course not in the likes of the "component pattern").


bye
Ron


AdamStrange(Posted 2015) [#33]
@Deron. Im already with you on that front. Particles have a color (complex), or no color (simple). But both can be colored by when rendered. You just need to change the render color :)

And yep, particles are separate from emitters.

Just dealing with faux-gravity now :) All good


Derron(Posted 2015) [#34]
@AdaStrange ( :p )
With emitter color I meant some kind of animated color ... so the emitter fades colors and all particles just follow it - or coloring according to particle age (so the longer they exist, the more green they get - or the more transparent when talking about alpha/transparency).
Your description more sounds like if the emitter has some kind of "baseColor" it could adjust.
Maybe it is better to think of it as if the color/alpha/...adjustments are done on a "per group" base. So particles could be a bunch within a group all behaving similar. But then you could also just have an emitter for each of these groups ... hmm.


Just dealing with faux-gravity now :) All good


Ideally wind-emitters are based on force emitters (but have added turbulence?) but you added them to the ground - what about adding "gravity" to it too (I mean, the wind has a velocity in 3D - which is already including gravity - either on being zVelocity=0 or incorporating the 9.81 already) ?


bye
Ron


AdamStrange(Posted 2015) [#35]
OK, the load and save is finished and I can start to debug outside of the 3d editor in a live situation. This means slightly different particle update routines to take account of heights, walls, etc.
Here is the first test "The Green Altar!"

and here is a static view showing the true resolution (gif compacts colors)


So. what is shown is a single (grey/white) system. The altar has 3 lights (green at the top and lower yellow and orange) which are pulsing.

The system is being emitted from a single point at the top of the altar. it has gravity applied and also features full height avoidance. sideways culling is to implemented. You can see how the particles flow, pool and cascade down the sides of the altar.

All in all, a good first attempt?


Derron(Posted 2015) [#36]
I like that "still shot" ... pulsating is a bit "too much" for me.

But I like that "flow" - I can imagine "acid pools" "lava pools" etc looking great with some kind of "fog" (warm water in cold area like)


bye
Ron