Frstrum and culling

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
ZeRaW
Posts: 9
Joined: Wed Dec 27, 2006 12:44 am

Frstrum and culling

Post by ZeRaW »

hello.
I have been decoding and playing with irrlicht.
I noticed that frstrum is calculated using intersections between planes while it
can be done faster from the view and projection matrices.
also the culling is pretty fast but really not that accurate (it does not have any of the special cases). anyways, it can be fast but still accurate using 3 conditions instead of the 1 used. (3 if statements)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Fermat did not have enough space on the margin of his paper to present the proof, but you might just post some code in the code snippets or bug forum. This would help much more than just claiming to have something better. It would be even better to show some test code and some numbers how much faster it will be. It's sometimes astonishing that good ideas are cleaner, but slower in the end. I can also move this topic if you just post in here...
ZeRaW
Posts: 9
Joined: Wed Dec 27, 2006 12:44 am

Post by ZeRaW »

you r right, i will implement and build my idea then we discuss it
ZeRaW
Posts: 9
Joined: Wed Dec 27, 2006 12:44 am

Post by ZeRaW »

after further reading into the code i do not know how i missed it
but the frustrum is actualling being built from the projection and view matrices.
If i understand it correctly, it transforms the frsutrum into a normal box and for each cull test, the node aabb is tested if it interestcs with the frsutrum aabb. in a single if codition.
bool intersectsWithBox(const aabbox3d<T>& other) const
{
return (MinEdge <= other.MaxEdge && MaxEdge >= other.MinEdge);
}

so yes i agree now after seeing the code that irrlicht does a gr8 job for a general case.
for more specific cases like testing against the view frustrum which is not an aabb other methods kick in. of course they might be slower but it depends on the application.
ZeRaW
Posts: 9
Joined: Wed Dec 27, 2006 12:44 am

Post by ZeRaW »

Post Reply