Segan Software Occlusion Culling

    About SeganSOC
    How to use
    Functions and Procedures
    Downloads

    Post a Comment
    Home






Locations of visitors to this page

  How to use Segan Software Occlusion Culling ?

  It's so easy to use. programmer can walk through these steps:
We can implement SeganSoftwareMesh in our Scene Manager or our 3D Objects representative occluder in SOC system.
To create a software mesh use SSOC_Mesh_Create and to destroy it use SSOC_Mesh_Destroy.
After we create a software mesh we should fill it by our objects triangles. to do this, we must lock the software mesh by calling SSOC_Mesh_Lock and insert triangles by calling SSOC_Mesh_AddFace.
After adding all faces to software mesh we should call SSOC_Mesh_Unlock to unlock software mesh. but we can simplify our software mesh by calling SSOC_Mesh_Simplify and identify precision. this is very useful and highly recommended to use this method to increase performance.
In continue of initializing software mesh, we can use SSOC_Mesh_ToBuffer to serialize software mesh and SSOC_Mesh_FromBuffer to deserialize that in future

  Notice that our application is responsible to manage scene and software Meshes creation. Software Renderer and Software Meshes are completely independent from each other.
  After creating our software mesh, now we can test and draw them in Software Renderer.

Initialize SOC by calling SSOC_Initialize and set the size of Software Surface.
Set Matrices and Options for software renderer. we can use these Options and combination of them to define the behavior of Software Renderer:

SSOC_METHOD_AVERAGEZ : Instead of Z calculated for each pixel, the center triangle is used.
SSOC_METHOD_REALZ : In this method, the exact value of Z for each pixel is calculated. Therefore, This is most slower method of system.
SSOC_METHOD_AUTO : In this method, based on the triangle area and distance, the system is considered the appropriate method for drawing triangles.
SSOC_CULL_NONE : Back face of triangles will be draw in this method.
SSOC_IGNORE_HORIZONTAL : Triangles which are lie on the floor (horizontal triangles) will not draw.
SSOC_TEST_COUNT : The system will avoid continue of testing by finding first pixel visibility by default so use this option to get total pixels drawn.
Clear the surface and prepare it to draw new frame.
Test objects to see if they are visible in the scene.
If the Test passed, draw visible objects on the surface.