Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Kaimano

Few questions about optimization

This topic is 5879 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
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..

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!