new Physx

Re: new Physx

Postby ikam » Tuesday, 01.July 2014, 08:08

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.
You do not have the required permissions to view the files attached to this post.
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: new Physx

Postby Skinnytorus » Tuesday, 01.July 2014, 08:25

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?
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: new Physx

Postby ikam » Tuesday, 01.July 2014, 09:47

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...
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: new Physx

Postby Skinnytorus » Tuesday, 01.July 2014, 10:35

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?
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: new Physx

Postby CybeREX » Tuesday, 01.July 2014, 13:22

Here is another PhysX scenes.
You do not have the required permissions to view the files attached to this post.
CybeREX
Demomaker
Demomaker
 
Posts: 153
Joined: Thursday, 03.April 2014, 07:44

Re: new Physx

Postby ikam » Tuesday, 01.July 2014, 15:08

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 ;)
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: new Physx

Postby Skinnytorus » Tuesday, 01.July 2014, 19:05

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).
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: new Physx

Postby ikam » Tuesday, 01.July 2014, 19:19

fixed crash and memory leaks in physx_particle branch.

Yea, I'll try to do my best ;)
You do not have the required permissions to view the files attached to this post.
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: new Physx

Postby Skinnytorus » Tuesday, 01.July 2014, 19:42

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...
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: new Physx

Postby ikam » Tuesday, 01.July 2014, 19:54

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.
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: new Physx

Postby Skinnytorus » Tuesday, 01.July 2014, 20:14

Yes... A bit like RenderTarget ;)
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: new Physx

Postby Skinnytorus » Tuesday, 01.July 2014, 21:20

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?
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: new Physx

Postby Skinnytorus » Wednesday, 02.July 2014, 20:23

Yep. The latest build shows that GPU particles mode freezes wz4. Can it be fixed?
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: new Physx

Postby ikam » Thursday, 03.July 2014, 05:54

I put a parameter in physx to swithc between cpu/gpu, wainting to identify precisly why it freeze.
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: new Physx

Postby Skinnytorus » Thursday, 03.July 2014, 12:28

That is exactly what I wanted to communicate. Turning on GPU particles causes occasional freezes.
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46


Return to Development and contribution



Who is online

Users browsing this forum: No registered users and 1 guest

cron