Jump to content

  • Log In with Google      Sign In   
  • Create Account


N01

Member Since 03 Sep 2013
Offline Last Active Private

Posts I've Made

In Topic: Nowhere-01, a surreal third-person survival horror inspired by Silent Hill

13 May 2014 - 11:21 PM

A few more screenshots, showing how later locations from the game look:

 

med_gallery_214055_762_23011.png

 

med_gallery_214055_762_630971.png

 

med_gallery_214055_762_1287532.png


In Topic: [PhysX] filterData for character controller.

18 September 2013 - 09:38 AM

in case someone's wondering, here's source of basic, quick and dirty reproduction case: http://pastie.org/private/exnuwpr2qrez9tigslt3bq

you can watch simulation with PVD, and notice, that unless you comment line 114:  "mCharacterFilterData.word0 = 1", character controller will fall through the "floor".

i'd like someone to point out possible mistake.


In Topic: PhysX - Scene scaling, object size, timestep and gravity inconsistency.

10 September 2013 - 08:30 AM

The objects in the PVD doesn't look like they've had this scaling. Gravity in the scene is 9.81 - which means you're using metres as your distance unit. Yet the box in the scene is 24m long - and similarly the capsules - if this is supposed to be a road with debris(?) it's absolutely huge, and no wonder everything moves in a way that looks like it's in slow motion.

 

yes, i've stated in that post(where i posted a clip from PVD), that PVD clip is before re-scaling scene to 1u=1m scale.

here's PVD clip with scene rescaled:

rghost.net/private/48675822/15cb958a221323afef1c3231e4bd4451


In Topic: PhysX - Scene scaling, object size, timestep and gravity inconsistency.

10 September 2013 - 08:06 AM

OK - well if 1 unit is, say 0.05m, then you need to set gravity to 9.81 / 0.05, and get rid of your time scaling.

 

That's not all though - you need to:

 

1. Pass in an appropriate set of scales when you create the physics SDK, since the defaults will be inappropriate. Look up physx::PxTolerancesScale

 

2. Increase the contact offset on the shapes you create - by a factor of 1/0.05. 

 

The second thing should get rid of the jittering. 

 

You also need to consider what density you want, and what your mass units are. If you want mass in kg, then you will have pretty weird densities, because you'll have a factor of 20^3.

 

A better option is to work in metres, kg and seconds - either by converting your source/game assets, or by scaling whenever you pass things across the PhysX API.

 

One general thing though - it really is (in my experience) worth trying to be quite precise when dealing with physics simulation. Even just to use a physics SDK you need to have a reasonable understanding of physics (what's the difference between force and impulse etc), and be quite careful - otherwise you may hack things into working, but in the future (e.g. if you change the timestep) it can all come back to haunt you! 

 

I'll try to have a look at the PVD later...

 

 

i did the latter, found precise scaling factor for the scene and rescaled while passing to PhysX. it shouldn't couse trouble in future(unlike other option), less fiddly and i already had this option programmed into my engine.


In Topic: PhysX - Scene scaling, object size, timestep and gravity inconsistency.

10 September 2013 - 07:18 AM

 

Wait, is that actually representative of your actual code? Those calls to sleep (especially in the physics thread) will not be doing you any good.

The accumulation loop you posted is design to run as quickly as possible (i.e. in a while(true) style loop) and fire the Physics events at the correct time. With the setup you have now the simulation will not be being called at the correct frequency due to differences in sleep time and the fact that your time deltas are going to be huge.

 

this is simplified code. but yes, my threads do sleep, but they also do take in account time they were busy with processing, so they don't sleep more than it's required. and my deltaTime is not really huge, it's always around 0.033sec with rare deviations of 0.001sec. this loop is not designed to run continuously, it's designed to compensate for elapsed time. the only case, then such organisation may cause trouble, is if processingThread cannot finish in given time of 30ms, but that is undesirable for application in general, so i shouldn't allow it to happen. and you generally don't want any continuous  thread to run without any sleeping, it is similarly irresponsible and dumb as using vsync to limit your framerate.


PARTNERS