XNA 3.1

Discuss any questions about BEPUphysics or problems encountered.
schulzor2004
Posts: 29
Joined: Mon Jan 12, 2009 2:43 pm

Re: XNA 3.1

Post by schulzor2004 »

ok, this sounds like a good hint, I'll give it a try, I think, I can make something that deactives all objects, that are not around the character....

Do you have a time plan, when you will release version 0.10?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: XNA 3.1

Post by Norbo »

Not a definite date, no. It will probably be more than one week, but hopefully before mid July.
schulzor2004
Posts: 29
Joined: Mon Jan 12, 2009 2:43 pm

Re: XNA 3.1

Post by schulzor2004 »

ok, sounds great!
schulzor2004
Posts: 29
Joined: Mon Jan 12, 2009 2:43 pm

Fluid physics performance

Post by schulzor2004 »

Hallo,

As you can see in my Video, I have a fluid-component (the water basin). When this gets activated, the XBox Version gets suddenly very slow. As you can see there is one object within the fluid. When I put a second one in there it gets extremly slow. At this time only 3 Entities are active, the fluid and the two Box-Objects. Is there anything I have to think about, when using fluids on the XBox?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: XNA 3.1

Post by Norbo »

How much of a slowdown is it? A millisecond or two per frame, or more like 10-50 milliseconds? On the PC do you notice any similar, though smaller, slowdown?

Is the water's surface defined by only two triangles, or is it more? Keeping it very simple will help speed it up. How many samplesPerDimension (sixth fluid volume parameter) are you taking? This is a very large part of the overall computation, so keeping it at or below 8 on the Xbox is important. Nothing else immediately jumps out at me as a reason for poor Xbox performance. If you could provide a little code for how you set up the fluid volume I could run it and try to diagnose it further.
schulzor2004
Posts: 29
Joined: Mon Jan 12, 2009 2:43 pm

Re: XNA 3.1

Post by schulzor2004 »

Hard to say how much in ms (didn't measure it yet), but my FPS drops from smooth 30 fps down to 15 fps, here is a code snippet:

Code: Select all

      tris.Add(new Vector3[] { new Vector3(-basinWidth / 2, waterHeight, -basinLength / 2) + pos, new Vector3(basinWidth / 2, waterHeight, -basinLength / 2) + pos, new Vector3(-basinWidth / 2, waterHeight, basinLength / 2) + pos });
      tris.Add(new Vector3[] { new Vector3(-basinWidth / 2, waterHeight, basinLength / 2) + pos, new Vector3(basinWidth / 2, waterHeight, -basinLength / 2) + pos, new Vector3(basinWidth / 2, waterHeight, basinLength / 2) + pos });
      fluid = new FluidVolume(new Vector3(0, pos.Y + waterHeight, 0), Vector3.Up, tris, waterHeight, 20f, 8, .7f, .7f);
it is mostly from your demo code. I had to do trial and error to find out, what the parameters mean, I hav increased the density a little bit, so that my object did not fall through the fluid.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: XNA 3.1

Post by Norbo »

Copy and pasting that into the demos (which were very similar as you said) and running it with a few blocks in the water took only about 1-2 milliseconds per frame, so that implies the problem lies somewhere besides just fluid volume updating. When running the demos using only a few blocks do you observe similar results?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: XNA 3.1

Post by Norbo »

I've also tracked down and eliminated some unnecessary allocations which could have caused some GC 'jigs' when using the FluidVolume.
schulzor2004
Posts: 29
Joined: Mon Jan 12, 2009 2:43 pm

Re: XNA 3.1

Post by schulzor2004 »

Thanks for trying.... Mhh, I have to retry this and do some measurement...
schulzor2004
Posts: 29
Joined: Mon Jan 12, 2009 2:43 pm

Re: XNA 3.1

Post by schulzor2004 »

Hi,

how is it going on with Version 0.10? How long will it still take?

Thanks for answering!
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: XNA 3.1

Post by Norbo »

I'm aiming to have it out in the next few days. I'm on track so far, assuming I don't hit any showstopping bugs.
schulzor2004
Posts: 29
Joined: Mon Jan 12, 2009 2:43 pm

Re: XNA 3.1

Post by schulzor2004 »

ok, perfekt!
Post Reply