Render only called when on screen

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
dutt
Posts: 8
Joined: Tue Sep 21, 2010 10:10 am

Render only called when on screen

Post by dutt »

I recently realised that my render() on my scene nodes are being called even when the objects aren't on screen, is there a standard way in the engine of culling those that aren't visible? I thought it was done automatically, was kind of surprised to see them called.
DarkDepths
Posts: 126
Joined: Sun Apr 02, 2006 1:21 am
Location: Canada

Post by DarkDepths »

I also thought they should be culled by Irrlicht automatically... are you sure they are actually be drawn? From what I know, Irrlicht culls be testing each Scene Node's position, so is it possible that what you are seeing is just Irrlicht checking whether they are in the frustum or not?


Also, check out Sudi's OctreeSceneManager, it's in the code snippets.
dutt
Posts: 8
Joined: Tue Sep 21, 2010 10:10 am

Post by dutt »

I put a cout in my FlyingObjectSceneNode::render() to see how the position changed over time, and it keeps printing out even when the node isn't visible.

Alright, thanks for the tip about the scene manager, I'll put it in soon. What algoritm, does the default one use?
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

Before rendering:

Code: Select all

this->setAutomaticCulling(irr::scene::EAC_FRUSTUM_BOX)
That makes the object be culled by the camera's view and its bounding box. I'm not sure if Irrlicht automatically culls custom scene nodes, but this definitely works.
dutt
Posts: 8
Joined: Tue Sep 21, 2010 10:10 am

Post by dutt »

Lonesome Ducky wrote:Before rendering:

Code: Select all

this->setAutomaticCulling(irr::scene::EAC_FRUSTUM_BOX)
That makes the object be culled by the camera's view and its bounding box. I'm not sure if Irrlicht automatically culls custom scene nodes, but this definitely works.
Ah, great. That did it. Thanks for the help :)
Post Reply