culling, renderables and scaling

Started by
21 comments, last by cozzie 10 years ago

The performance is really good but the main point with the algorithm is the simplicity and versatility. It work also for world/view space aabb and child nodes. It's also does not depend your camera code. Also its more accurate than AABB methods. For static objects you can calculate world space AABB and save matrix matrix mul.

For special purpose case like voxel engine you can even optimize it even more. You can use matrix that include voxel size and center offset from 3d index so you precalculate extent part and result is frustum vs aabb test that cost same amount than normal frustum vs point.

Advertisement

Thanks, nice to learn more. This gives me input to think about how I can improve in my engine.

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

@Kalle; just a short update, I've managed to save quite some 'bytes' per bounding box.

Some vectors were just waste (AABBsize == OBBsize), and some are only necessary when creating the AABB, so now I simply created them on the stack.

The 8 AABB corners and OBB corners I still got in place, because I don't know how to 'save them'. Because per frame I transform the AABB corners to OBB corners, to determine the worldpace AABB size. I could probably save that, only if I would cull in local/ modelspace as you suggested.


typedef struct BOUNDINGBOX
{
	D3DXVECTOR3 AABBcenter;
	D3DXVECTOR3 AABBsize;
	D3DXVECTOR3 AABBcorners[8];

	D3DXVECTOR3 OBBcenter;		// OBB in worldspace now
	D3DXVECTOR3 OBBcorners[8];
	
	D3DXVECTOR3 AABBworldsize;	// AABB in worldspace, uses P/N-vertex 

	bool		created;

	BOUNDINGBOX():created(false) { };
} BOUNDINGBOX;

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

This topic is closed to new replies.

Advertisement