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)
Frstrum and culling
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
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...
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.
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.
here is the implementation
http://irrlicht.sourceforge.net/phpBB2/ ... p?p=100349
http://irrlicht.sourceforge.net/phpBB2/ ... p?p=100349