Few questions about optimization
Hi!
These are my questions:
1.in my engine i use the sqrt function.
I think that it is expensive for the cpu,
there is a way to optimize this function?
2.I have implemented frustum culling in my engine.
In my implementation i check if the four vertices of a box are in the frustum.
If at least one is in the frustum, the object that is in the box is draw. But when the object is too large the vertices are out of the frustum,and so nevertheless the camera is forward the object, this is not draw.
There is a way to avoid this situation?
3.Is more strong Hulk or Think?
Thanks.
2
1- you can use square distances. structure your code such that you only do the sqrt if you absolutely need to.
2- its faster to check against a sphere, plus it will eliminate your big box bug because you cant just check the vertices, you need to do the full polygon to polygon intersection tests to eliminate all the cases, hence it being cheaper to just use a bounding sphere..
2- its faster to check against a sphere, plus it will eliminate your big box bug because you cant just check the vertices, you need to do the full polygon to polygon intersection tests to eliminate all the cases, hence it being cheaper to just use a bounding sphere..
3 - It should be obvious that The Hulk is far stronger than The Thing (except maybe the gray hulk - that would be a draw) but The Thing has natural armour in the form of his rocky skin which could protect him from attacks that may damage The Hulk. Of course, The Thing is also a pussy and probably scared of kittens so overall I think the Hulk has the advantage. Glad I could clear that up for you.
-
Geocyte Has Committed Suicide.
-
Geocyte Has Committed Suicide.
Kenny Hoff has done some good work with box-frustum culling.
http://www.cs.unc.edu/~hoff/research/vfculler/boxvfc/boxvfc.html
Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
http://www.cs.unc.edu/~hoff/research/vfculler/boxvfc/boxvfc.html
Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
Thanks for all answers. I have implemented frustum culling against bounding sphere and i am more quit knowing that hulk is
always the number one.
Now i have another doubt.
The object has three different dimension for each axis, so the
bounding sphere around the object has three radius (so it is an
ellipsoid) and or i check against all three (this in my opinion is not simple), or i check only the biggest one (but i think that this is not too optimized).
tnx.
always the number one.
Now i have another doubt.
The object has three different dimension for each axis, so the
bounding sphere around the object has three radius (so it is an
ellipsoid) and or i check against all three (this in my opinion is not simple), or i check only the biggest one (but i think that this is not too optimized).
tnx.
I would personally just check the big sphere... or split long things into 2 or 3 spheres, but any more than that, and you''re going to be wasting more time doing frustrum culling, than you would if you''d of just drawn it in the first place (obviuosly, this depends on the graphics card, and cpu, but you get what i''m saying).
Billy - BillyB@mrsnj.com
Billy - BillyB@mrsnj.com
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement