Culling and Bullet
2 posters
Culling and Bullet
Hi,
it seems to me resource culling is based on the object's sio2 coordinates saved in _SIO2object->_SIO2transform->loc. For physical objects, however, their "real" coordinates are computed by bullet and stored in _btRigidBody. Bullet's coordinates are transferred to sio2 coordinates in sio2ObjectRender, but this method is not called if the object has been culled. It seems this is a problem if Bullet moves the object back into the frustum: since the object is culled based on its (old) sio2 coordinates, it never gets the updated Bullet coordinates that would prevent it from being culled again. So objects that once were outside the frustum and are moved inside the frustum by Bullet are not shown.
it seems to me resource culling is based on the object's sio2 coordinates saved in _SIO2object->_SIO2transform->loc. For physical objects, however, their "real" coordinates are computed by bullet and stored in _btRigidBody. Bullet's coordinates are transferred to sio2 coordinates in sio2ObjectRender, but this method is not called if the object has been culled. It seems this is a problem if Bullet moves the object back into the frustum: since the object is culled based on its (old) sio2 coordinates, it never gets the updated Bullet coordinates that would prevent it from being culled again. So objects that once were outside the frustum and are moved inside the frustum by Bullet are not shown.
Faikus- Posts : 23
Join date : 2009-05-26
Location : Berlin
Re: Culling and Bullet
Like in tutorial06
sio2ResourceRender( sio2->_SIO2resource,
sio2->_SIO2window,
sio2->_SIO2camera,
SIO2_RENDER_SOLID_OBJECT | SIO2_RENDER_CLIPPED_OBJECT );
This will force the clipped object to update their physic matrix, but not render them if they are out of the frustum...
sio2ResourceRender( sio2->_SIO2resource,
sio2->_SIO2window,
sio2->_SIO2camera,
SIO2_RENDER_SOLID_OBJECT | SIO2_RENDER_CLIPPED_OBJECT );
This will force the clipped object to update their physic matrix, but not render them if they are out of the frustum...
Re: Culling and Bullet
Ok, that works. Is the flag SIO2_RENDER_CLIPPED_OBJECT supposed to be used in all scenarios with physics objects? Is there another reason for this flag? Why, for example, doesn't the engine just update sio2's coordinates for all physical objects from their bullet coordinates at the end of sio2PhysicRender?
Faikus- Posts : 23
Join date : 2009-05-26
Location : Berlin
Similar topics
» Bullet for 2D
» Frustum culling and shadows
» Upgrading Bullet
» Culling failing on duplicated objects
» 2 Questions: Clear Buffer and Backface culling
» Frustum culling and shadows
» Upgrading Bullet
» Culling failing on duplicated objects
» 2 Questions: Clear Buffer and Backface culling
Permissions in this forum:
You cannot reply to topics in this forum