Meshbuffer culling.
Meshbuffer culling.
The meshbuffer rendering isn't culled anywhere?
Because they could use, at least, the view frustum culling as they have their own bounding box and all, but the rendering code of the static meshes (for instance) doesn't cull them, and it could happen perfectly that the meshbuffer was completely out of the view, but still the draw call would be issued.
Because they could use, at least, the view frustum culling as they have their own bounding box and all, but the rendering code of the static meshes (for instance) doesn't cull them, and it could happen perfectly that the meshbuffer was completely out of the view, but still the draw call would be issued.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
overall we need a new method of culling, I do not see why irrlicht doesn't employ occlusion queries which after all are easy to do (which I am going to implement in my engine).
http://http.developer.nvidia.com/GPUGem ... _ch29.html
Also you could use hierarchical Z, where you downscale the Z buffer and download the data outside of "driver->begin" and "driver->end" and use it to discard nodes at bounding box level (use the right size map so the bounding box Max and Min are preferably in the same pixel or in adjacent ones).
http://http.developer.nvidia.com/GPUGem ... _ch29.html
Also you could use hierarchical Z, where you downscale the Z buffer and download the data outside of "driver->begin" and "driver->end" and use it to discard nodes at bounding box level (use the right size map so the bounding box Max and Min are preferably in the same pixel or in adjacent ones).
where is that function/class/functionality? i would love to try that.hybrid wrote:Irrlicht has Occlusion queries since Irrlicht 1.7 Maybe live with the present, not with the pastdevsh wrote:overall we need a new method of culling, I do not see why irrlicht doesn't employ occlusion queries which after all are easy to do
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
@bitplane: I don't know... Maybe it could be useful that the video driver knew also something about the currently active camera, or that there was any way to know the view Frustum from the meshbuffers
The occlusion queries can be found in the IVideoDriver. This is not on the current API reference in the web though... (copied from IVideoDriver.h)
This method uses the OQ to calculate the visibility of the meshes dynamically. I don't know how hard would it be to port to Irrlicht.
http://citeseerx.ist.psu.edu/viewdoc/do ... 1&type=pdf
The occlusion queries can be found in the IVideoDriver. This is not on the current API reference in the web though... (copied from IVideoDriver.h)
Code: Select all
//! Create occlusion query.
/** Use node for identification and mesh for occlusion test. */
virtual void createOcclusionQuery(scene::ISceneNode* node,
const scene::IMesh* mesh=0) =0;
Code: Select all
//! Remove occlusion query.
virtual void removeOcclusionQuery(scene::ISceneNode* node) =0;
Code: Select all
//! Remove all occlusion queries.
virtual void removeAllOcclusionQueries() =0;
Code: Select all
//! Run occlusion query. Draws mesh stored in query.
/** If the mesh shall not be rendered visible, use
overrideMaterial to disable the color and depth buffer. */
virtual void runOcclusionQuery(scene::ISceneNode* node, bool visible=false) =0;
Code: Select all
//! Run all occlusion queries. Draws all meshes stored in queries.
/** If the meshes shall not be rendered visible, use
overrideMaterial to disable the color and depth buffer. */
virtual void runAllOcclusionQueries(bool visible=false) =0;
Code: Select all
//! Update occlusion query. Retrieves results from GPU.
/** If the query shall not block, set the flag to false.
Update might not occur in this case, though */
virtual void updateOcclusionQuery(scene::ISceneNode* node, bool block=true) =0;
Code: Select all
//! Update all occlusion queries. Retrieves results from GPU.
/** If the query shall not block, set the flag to false.
Update might not occur in this case, though */
virtual void updateAllOcclusionQueries(bool block=true) =0;
Code: Select all
//! Return query result.
/** Return value is the number of visible pixels/fragments.
The value is a safe approximation, i.e. can be larger than the
actual value of pixels. */
virtual u32 getOcclusionQueryResult(scene::ISceneNode* node) const =0;
http://citeseerx.ist.psu.edu/viewdoc/do ... 1&type=pdf
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
well not really. old hardware can't afford that. so having it as an option is perfectly valid at least for me.devsh wrote:well we know one thing that needs to be done... enabling the occlusion queries by default in the pipeline (surprised irrlicht doesnt do that automatically...)
AND updating the API reference
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.