OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Float vs double in BOUNDINGSPHERE and BOUNDINGBOX


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
dieslower81
User


Joined: 15 Feb 2010
Posts: 38

PostPosted: Fri Jun 29, 2018 4:00 am    Post subject:
Float vs double in BOUNDINGSPHERE and BOUNDINGBOX
Reply with quote

Hi,

Is there a reason why OSG_USE_FLOAT_BOUNDINGBOX and OSG_USE_FLOAT_BOUNDINGSPHERE are set to YES in cmake by default?

Since most CPUs now use doubles natively and emulate floats, making float calculations a little slower, would it not be better for OSG speed and performance to have these options be set to OFF by default?

Doubles would take up more RAM but what is more important for intersection speeds in OSG, RAM use or CPU number crunching?

_________________
Thank you,
--Maxim
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12093

PostPosted: Fri Jun 29, 2018 5:20 am    Post subject:
Float vs double in BOUNDINGSPHERE and BOUNDINGBOX
Reply with quote

Hi Maxim,

The default to BoundingBoxf and BoundingSphref is partly a historical reason.

Scene graphs traversals are memory bandwidth limited so you only want
to pay for the extra memory size if there is specific value in doing
so.

Robert.
On Fri, 29 Jun 2018 at 05:00, Maxim Stere <> wrote:
Quote:

Hi,

Is there a reason why OSG_USE_FLOAT_BOUNDINGBOX and OSG_USE_FLOAT_BOUNDINGSPHERE are set to YES in cmake by default?

Since most CPUs now use doubles natively and emulate floats, making float calculations a little slower, would it not be better for OSG speed and performance to have these options be set to OFF by default?

Doubles would take up more RAM but what is more important for intersection speeds in OSG, RAM use or CPU number crunching?

------------------------
Thank you,
--Maxim

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74219#74219








------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
dieslower81
User


Joined: 15 Feb 2010
Posts: 38

PostPosted: Fri Jun 29, 2018 11:50 am    Post subject:
Reply with quote

Correct,

But since system memory is fairly large now days, and cheap, would the performance bottleneck be in the RAM or the CPU?

Do we need to test this to see if Doubles vs Floats do a speedup in OSG?

_________________
Thank you,
--Maxim
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Setting vertex attribute array of float Bruno Oliveira General 1 Mon Mar 20, 2017 9:55 am View latest post
No new posts support for double precission in shad... Trajce Nikolov NICK General 0 Fri Apr 29, 2016 9:02 am View latest post
No new posts Float 32 bit texture map pleopard General 2 Wed Jan 20, 2016 8:34 pm View latest post
No new posts how to set width and Stipple of a osg... lq37 General 3 Tue Oct 27, 2015 4:21 pm View latest post
No new posts Transform BoundingSphere by matrix ut... scrawl Submission 1 Fri Apr 10, 2015 2:52 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP