Page 4 of 11

Re: new Physx

PostPosted: Tuesday, 01.July 2014, 08:08
by ikam
nice. I added some comments to optimize a bit your scene and save significant fps.
you also can play with scene flags in physx op to get different colliding behavior.

Re: new Physx

PostPosted: Tuesday, 01.July 2014, 08:25
by Skinnytorus
Guys, I'll check the scene later today. Thanks.
ikam
So... What's your plan as to the particle system? Any structure you have in mind? Types of emitters and modifiers?

Re: new Physx

PostPosted: Tuesday, 01.July 2014, 09:47
by ikam
Nothing really defined yet. I'm more on doing some test to show how all interacts.

What is great is that actual wz particle system can be binded to physx, it is exactly what I've done in the previous example. This allow to easily use classsic renderer like sprites, debris, marchingcubes... and the possibility to stack with others particles operators.

In the physx lib there is no provided emiters, only the managment of colliding particles with the physx world.
I could create dedicated emiters, but I'm thinking that it should be great to use wz actual existing ones (like ballistic...). I will do some test for that, else I will create new emitters.

I could get on input a wz particle operator and bind it to physx. It will result no more the original particle animation, but the physx simulation from original initial particles positions (and adding to this physx particles properties like gravity, forces, etc...). It is possible to add forces to particles, this is how particles are traveling by themselves over the world.

the main challenge for me now, is how to properly bind a physx operator with particle operators, I used a system of target as you can see, but it's not working correctly yet...

Re: new Physx

PostPosted: Tuesday, 01.July 2014, 10:35
by Skinnytorus
Man... As far as could understand from the actual code, there is no way to make original wz particles truly dynamic (unless you can tweak Sparkle ;)). They are ALL born before they are animated. No gradual particle birth mechanism is provided... I suggest you think of some sort of classic emitter (like in Trapcode Particular, or even in Blender). There is much particle code available on the web for free. What do you think of Apex particles?

Re: new Physx

PostPosted: Tuesday, 01.July 2014, 13:22
by CybeREX
Here is another PhysX scenes.

Re: new Physx

PostPosted: Tuesday, 01.July 2014, 15:08
by ikam
Skinnytorus: it should be possible to do something with actual wz particle system and the physx particles, worst I always can upgrade the wz article system to add eventual required data, but there is already a lifetime notion and a mechanism to get particles sources form operators above. I need to do some test...

CybeREX, nice builds ;)

Re: new Physx

PostPosted: Tuesday, 01.July 2014, 19:05
by Skinnytorus
CybeREX
Yey! Demolition rulezzzzz! :)

ikam
Yes, but there are certain aspects to pay attention to:
1) in wz4 all particles are considered born with no or random time values (e.g. in Ballistic : p->Time = rnd.Float(1)) In case we want animated emitters, particles should be assigned time values at birth (i.e. during simulation) or at least at their visualization.
2) Imho, we need some sort of an event system for particles (at least spawning or dying) on collision or at a certain time in particle life. Basically, an Event operator passing particle positions (and time?) into another emitter or modifier under certain conditions (collision/time).

Re: new Physx

PostPosted: Tuesday, 01.July 2014, 19:19
by ikam
fixed crash and memory leaks in physx_particle branch.

Yea, I'll try to do my best ;)

Re: new Physx

PostPosted: Tuesday, 01.July 2014, 19:42
by Skinnytorus
PhysxTarget is an Integrator? An interesting approach - very versatile, but on the other hand it doesn't fit into wz4 stacking concept. I can't think of any other approach... Maybe later...

Re: new Physx

PostPosted: Tuesday, 01.July 2014, 19:54
by ikam
I forgot to say, that the branch physx_particle require the "PhysX3GpuCHECKED_x86.dll" (in bin folder of physx lib) to run physx particle in GPU mode and gain a high bunch of fps If not present it will run in CPU mode.

for PhysxTarget, it contain a pointer to the physx scene variable, needed to create the particle system and to add it to the physx scene. I needed a way to get the physx scene data for the particle operator. It is simple to code and it allow to reuse this elsewhere than stacking particle operator directly to physx op. It's a bit like RenderTarget. Don't have any other solution for now, but don't hesistate if you have any idea.

Re: new Physx

PostPosted: Tuesday, 01.July 2014, 20:14
by Skinnytorus
Yes... A bit like RenderTarget ;)

Re: new Physx

PostPosted: Tuesday, 01.July 2014, 21:20
by Skinnytorus
A couple of bugs in the latest version:
1) positioning a rigid body is slowing down performance. Besides, simulation time is slower now. Is that OK?
2) wz4 freezes often.
I think it's the new sync methods or the GPU acceleration flag. Maybe we should make the GPU Physx Particles flag an option in wz4 or document options?

Re: new Physx

PostPosted: Wednesday, 02.July 2014, 20:23
by Skinnytorus
Yep. The latest build shows that GPU particles mode freezes wz4. Can it be fixed?

Re: new Physx

PostPosted: Thursday, 03.July 2014, 05:54
by ikam
I put a parameter in physx to swithc between cpu/gpu, wainting to identify precisly why it freeze.

Re: new Physx

PostPosted: Thursday, 03.July 2014, 12:28
by Skinnytorus
That is exactly what I wanted to communicate. Turning on GPU particles causes occasional freezes.