Hi Art, I think floats should be OK. I'll need to review the API to see about compatibility issues.
Robert. On Sun, Nov 30, 2008 at 6:54 PM, Art Tevs <[EMAIL PROTECTED]> wrote: > OK, > > I've tested now different cases and found out that the best way is to change > the double into float in the osg::Viewport. I think the precision given by > floats is big enough for any viewport computation. Using of float will also > reduce the run overhead required for handling with doubles on a 32bit system. > Even more; cuda compiled applications doesn't read out any nonsense values > out of viewports anymore. > Hence I propose to use floats there instead of doubles. Or maybe use doubles > only if compiled for 64 bits. > > What do you think about that, Robert? > > Art > > > > --- Art Tevs <[EMAIL PROTECTED]> schrieb am So, 30.11.2008: > >> Von: Art Tevs <[EMAIL PROTECTED]> >> Betreff: Re: [osg-users] osg::Viewport doubles??? >> An: "OpenSceneGraph Users" <osg-users@lists.openscenegraph.org> >> Datum: Sonntag, 30. November 2008, 18:06 >> Hi Robert, >> >> OK, I see, however I ran into troubles using CUDA together >> with doubles in viewports. The problem is that CUDA compiler >> invokes gcc with -malign-double parameter, which isn't >> the same as for osg. Hence whenever I want to access the >> values of a viewport in a CUDA code (actually C-code >> compiled with gcc by cuda compiler) I am not able to get >> proper values out of it. Hence one of the applications >> (either CUDA compiler ;) ) or OSG has to go in the direction >> of the other by either removing -malign-doubles (which I >> think wouldn't be done so easyly) or by adding this >> parameter to OSG compilation. However the second case >> isn't also a good solution, I think. >> >> I tried to implement the viewport with int and it works >> fine. I think also using floats instead of doubles would be >> also fine (because no alignment is needed). Currently I am >> checking the case with float and also want to try to compile >> osg with -malign-doubles. Let see if it does help. I would >> let you know more soon... >> >> Art >> >> --- Robert Osfield <[EMAIL PROTECTED]> schrieb >> am So, 30.11.2008: >> >> > Von: Robert Osfield <[EMAIL PROTECTED]> >> > Betreff: Re: [osg-users] osg::Viewport doubles??? >> > An: [EMAIL PROTECTED], "OpenSceneGraph >> Users" <osg-users@lists.openscenegraph.org> >> > Datum: Sonntag, 30. November 2008, 17:17 >> > Hi Art, >> > >> > On Sun, Nov 30, 2008 at 3:59 PM, Art Tevs >> > <[EMAIL PROTECTED]> wrote: >> > > Shouldn't then the method, which scales the >> > viewport, take care of casting? >> > > Because based on OpenGL Specification viewport is >> per >> > definition an integer value. >> > >> > Not quite, it's not about passing data to OpenGL, >> > it's about handling >> > resizing down and back up again of viewports, if you >> do >> > this with >> > int's then you can never recover the original size >> of >> > the viewport >> > because of rounding. >> > >> > Robert. >> >> >> >> _______________________________________________ >> osg-users mailing list >> osg-users@lists.openscenegraph.org >> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org