Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, The_Judge, Grant), 898 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
PhysX Custom Functionality #342554
09/29/10 07:47
09/29/10 07:47
Joined: Jul 2010
Posts: 13
Z
Zergling103 Offline OP
Newbie
Zergling103  Offline OP
Newbie
Z

Joined: Jul 2010
Posts: 13
Hi there,

I've run into a roadblock with my programming and I cannot continue until I've found a solution to the problem. The problem involves PhysX and executing custom code entirely on the GPU.

Here is a scenario similar to the one I'm faced with:

Imagine you wanted to create a simple particle simulation with particles bouncing off of in-game surfaces and such. For each physics cycle, you need the GPU to calculate the average position of all particles at the end of the cycle.

Is it possible to have something like this entirely performed on the GPU, even without using the CPU as a middle-man to instruct the GPU to calculate the average position?

My first idea would be to create a custom class for PhysX which integrates into the PhysX pipeline. This would likely require a DLL and a pointer to the PhysX interface used by 3DGS, through which I can customize the PhysX pipeline in C++.

But if this is not possible, my second thought was to perhaps write the customized code for CUDA, and get PhysX to cooperate with CUDA through a DLL.

I'm not sure. Have any pointers? Any help is -strongly- appreciated. Thank you.

-Steve

Re: PhysX Custom Functionality [Re: Zergling103] #342555
09/29/10 08:06
09/29/10 08:06
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Maybe this helps you: http://www.conitec.net/beta/physX_run.htm
However, I don't think that it is possible to remove the CPU as man in the middle because you need a way to fetch the current position of every particle and then submit it in another form again back to the GPU to render this.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: PhysX Custom Functionality [Re: WretchedSid] #342557
09/29/10 08:18
09/29/10 08:18
Joined: Jul 2010
Posts: 13
Z
Zergling103 Offline OP
Newbie
Zergling103  Offline OP
Newbie
Z

Joined: Jul 2010
Posts: 13
It looks like physX_run() returns "NxScene". I'm guessing this is a pointer to the PhysX interface. Might I be able to manipulate this interface in a DLL?

Also, it is pretty much mandatory that the CPU is not a middle-man in the operation because PhysX will perform cycles dozens or perhaps hundreds of times per frame, and therefore the evaluation is performed just as frequently. Involving the CPU in this will just kill performance, because the CPU is generally a lot slower, and I'd imagine that bussing the information back and forth from the GPU to the CPU creates latency that wouldn't be there otherwise.

Re: PhysX Custom Functionality [Re: Zergling103] #342559
09/29/10 08:32
09/29/10 08:32
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Argh, sorry, I had the wrong URL in the clipboard. Here is the right one http://www.conitec.net/beta/physX_load.htm
I think that this is a pointer to the physX interface, you can pass it to your DLL and use it there.

You are right, you don't need to grab the data every physics frame, but at least every render frame, where the CPU is still the man in the middle.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: PhysX Custom Functionality [Re: WretchedSid] #342560
09/29/10 08:39
09/29/10 08:39
Joined: Jul 2010
Posts: 13
Z
Zergling103 Offline OP
Newbie
Zergling103  Offline OP
Newbie
Z

Joined: Jul 2010
Posts: 13
Originally Posted By: JustSid
You are right, you don't need to grab the data every physics frame, but at least every render frame, where the CPU is still the man in the middle.


Thank you, that's a relief. But I'm still not sure on how I'd integrate my own custom code into the PhysX pipeline.

I think now that I have a pointer to work with I can slowly start to familiarize myself with PhysX's interface and eventually make custom code for it, but do you or does anyone else have any guidance in this? Thanks again.

Last edited by Zergling103; 09/29/10 08:41.
Re: PhysX Custom Functionality [Re: Zergling103] #342563
09/29/10 08:59
09/29/10 08:59
Joined: Jul 2010
Posts: 13
Z
Zergling103 Offline OP
Newbie
Zergling103  Offline OP
Newbie
Z

Joined: Jul 2010
Posts: 13
I'm applying for a copy of the PhysX SDK. Perhaps then I'll be able to develop my own code for it! laugh

If others see this thread and want to apply too, click here:

http://supportcenteronline.com/ics/support/mylogin.asp?task=signupform

Last edited by Zergling103; 09/29/10 09:01.

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1