Collision free instance painting

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Collision free instance painting

Postby Julio Jerez » Thu Jan 20, 2022 12:00 am

oh wow, it is amazing the kind of trick that those race tracer can do. it fooled me.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Collision free instance painting

Postby JoeJ » Thu Jan 20, 2022 6:49 pm

Julio Jerez wrote:it fooled me.

Because you thought they'd do gaussian passes?
Then you are kind of right, due to denoising smoothing out the noisy RT image. :wink:

Bird, can you say what's the BVH building cost for something like 1 million particles?
Do you think Optix has more options here than DXR?
Black boxed BVH is preventing me from using HW RT, so maybe it's worth to see what Optix has, if only to get a clue about the future of RT APIs.
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Collision free instance painting

Postby Bird » Thu Jan 20, 2022 7:40 pm

Do you think Optix has more options here than DXR

Sorry, I know nothing about DXR but here's a little bit of useful info on an NVIDIA blog
https://developer.nvidia.com/blog/how-t ... h-optix-7/

can you say what's the BVH building cost for something like 1 million particles

Maybe a couple of ms at most as far as I can tell. I made 1 million Newton particles and zoomed in so the whole screen is filled with particles. OptiX renders in about 22 ms. When I run the Newton sim, render jumps a couple of ms to around 24 ms. During each tick, I'm currently making OptiX rebuild the whole particle geometry acceleration structure(GAS). There is an option to just update the GAS if the particles haven't changed to drastically which I haven't tried yet. My pathtracer is very basic, doesn't do transparency yet and just uses ImageBasedLighting for illumination. It does use OptiX's AI denoiser which puts a dent in performance for sure.

If you're interested in checking out OptiX, I highly recommend using Shocker's most excellent wrapper. OptiX is a very complex beast especially if, like me, you have had no prior experience with Cuda programming.
https://github.com/shocker-0x15/OptiX_Utility
Bird
 
Posts: 623
Joined: Tue Nov 22, 2011 1:27 am

Re: Collision free instance painting

Postby Julio Jerez » Fri Jan 21, 2022 3:02 pm

Untitled.png
Untitled.png (80.91 KiB) Viewed 13145 times
alright, before moving on, I added these two functions to the particle sets.

bool GetAsynUpdate() const;
void SetAsynUpdate(bool update);

we have them set to play asyn, but that could lead to a false sense of performance.
when paying async, a background task does no has to respect the frame time boundaries,
this is good for stuff that is mostly for visual effects, like particles.

but this can only be useful is the update does not now take too long, for example an app can say I can update particles at half the fps and make up with interpolation. However, if the updates take say 100's of ms, them is will not look good.

this is where those functions come to help, by setting it to play synchronous with the physics them the update will sync every time and you get one frame one display.
with that metric the app can adjust the effect, like using fewer particles for a different solver.

and since they play async, solve solver can be faster than others,
we will see how teh Opencl solve have with this operation.

playing synchronous with the physics the frame looks like this, for 64 k particles.
Untitled.png
Untitled.png (80.91 KiB) Viewed 13145 times


I added the setting to the UI, so that people can see the difference.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Collision free instance painting

Postby Bird » Fri Jan 21, 2022 4:28 pm

I'm getting around 2300 fps in Async mode and around 110 fps with it off. But the sandbox demo frame rate doesn't change when you switch modes;

It looks like you have a hardwired invisible ground plane that the particles are colliding with. Is there a way to disable that? Will the particles collide with any static body yet?

In my app some particles are intersecting on initial setup. It seems like ndGaussianRandom is giving different results here than the sandbox demo
Attachments
intersecting_particles.jpg
intersecting_particles.jpg (144.7 KiB) Viewed 13142 times
Bird
 
Posts: 623
Joined: Tue Nov 22, 2011 1:27 am

Re: Collision free instance painting

Postby Julio Jerez » Fri Jan 21, 2022 5:37 pm

Bird wrote:It looks like you have a hardwired invisible ground plane that the particles are colliding with. Is there a way to disable that? Will the particles collide with any static body yet


Yes that is true until I get around the collision.
The foor is at 1 unit a o e the floor so that I can see what is going on edge on.

The guassian number is not really a true gaussian, it a pseudo one.
Basically is uses a theorem called the central mean, which state that the average some of random numbers with flat probability density tend to a guessing distribution.

But for that it need to average lot of values and I an only averaging four. I think.

Another way to get a better gaussian is to just get a random value with a flat probably density, a pich the guassian from the gausian distribution curve, but is also very expensive.

I do not really put too much effort on those utility because they are not part of the engine. To me, they are good enought for these demos.


Yes the particle will collide thither two type of object.
One will be arbritrat collision tree, made of triangle.
The other will be cluste of particles.
The closet of pati le will be representation of a body in the world.
Ex, say we have a body in the word that ha a box collision.

What we do is that a flood fill algorithm populate the volume of the box with particle.
Each particle will have a label to identify the rigid body.
We trow that array in the pool and let the Sim runs.

The particle particle collision come of the sph simulation for free.
These particles all have the same ID. We use that to either premier motion, or to calculate the next force they will assert of the body. The we get that a apply to the rigid body.

It is to the app to control how big or how small bodies in liquid will can be.

Effect like buoyancy come out the simulation for free..
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 19 guests

cron