Hi Phil, Stephan
> > > I have two particular issues which I've encountered so far. The first is > that on iOS retina-display devices (currently iPhone 4 and iPod Touch 4G) > the graphics are being rendered only half-size. I saw some discussion on > this in earlier posts, but I can't see any fixes for this in the current > repo. Does anyone have a fix coded up waiting for testing? > > As Stephan rightly says I have a version with this working (attached) The problem lies with the device screen size. Stephan seems to have to use screen bounds (in points) where as for the retina displays we need to use sceen size (in pixels). The problem lines are around line 77 of IPhoneUtils.mm. Stephan if you could take a look at those changes and possibly just add an if !3.2 statement or the like then I think we are ok, but I think we need someone with both device types. > > The second issue is that I'm not seeing animation on some animated OSG > models. Are there known issues with animation in the current port? > I've used basic animation exported from 3ds max into a .osg file (haven't tried .ive) seems to work ok for me. I've also had software skinning with osgAnimation working. Could the problem lie with your static imports i.e. are you using .osg but not adding USE_DOTOSGWRAPPER(AnimationPath) Just a guess. > I'd like to help out where possible with this port, and I have a bunch of > devices I can test on. > > * display-size bug for retina-displays > * FBO-rendering is not working correctly > Having someone with a few devices would be great as I'm just doing this as a hobby and it's getting rather expensive :). As Stephan says we still have the above two problems, I've almost fixed the FBO problem so I recon if you have mutliple devices (especially an IPad) it would be great if you could help put with the retina display problems. I assume this is for osgART (you work for ARToolWorks right). I've been using the open source ARToolkit at the moment (ported a version myself, is there anything else available). I'm getting great performance and almost have time to use render to texture and some post processing (although with out rtt the fps is sooo smooth). I'd be really keen to help out with any problems you have with the AR side of things, e.g You'll find there is a bug in versions > 2.9.8 when using subload callbacks for npot textures. Things I'd be keen to learn about are the different camera res' on different devices, I have an IPod 4th gen and although you can request 640x480 and 1280x720 explicitly the other res' are just called things like PHOTO which I have no idea if it ends up the same res on a 3gs for example. Anyhow I guess those are less OSG related and more AR, so on that side of things feel free to email me direct. Cheers Tom
/* * IphoneUtils.h * OpenSceneGraph * * Created by Thomas Hogarth on 25.11.09. * * By default we create a full res buffer across all devices and if now viewContentScaleFator is given We use the screens ScaleFactor. * This means that for backward compatibility you need to set the windowData _viewContentScaleFactor to 1.0f and set the screen res to the * res that of the older gen device. * http://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/SupportingResolutionIndependence/SupportingResolutionIndependence.html#//apple_ref/doc/uid/TP40007072-CH10-SW11 * */ #ifdef __APPLE__ #ifndef IPHONE_UTILS_HEADER_ #define IPHONE_UTILS_HEADER_ #ifdef __OBJC__ @class UIScreen; #else class UIScreen; #endif #include <osg/DeleteHandler> #include <osg/GraphicsContext> #include <osgViewer/GraphicsWindow> namespace osgIPhone { struct IPhoneWindowingSystemInterface : public osg::GraphicsContext::WindowingSystemInterface { public: IPhoneWindowingSystemInterface(); /** dtor */ ~IPhoneWindowingSystemInterface(); /** @return count of attached screens */ virtual unsigned int getNumScreens(const osg::GraphicsContext::ScreenIdentifier& si) ; virtual void getScreenSettings(const osg::GraphicsContext::ScreenIdentifier& si, osg::GraphicsContext::ScreenSettings & resolution); virtual void enumerateScreenSettings(const osg::GraphicsContext::ScreenIdentifier& screenIdentifier, osg::GraphicsContext::ScreenSettingsList & resolutionList); virtual bool setScreenSettings (const osg::GraphicsContext::ScreenIdentifier & si, const osg::GraphicsContext::ScreenSettings & settings); /** returns screen-ndx containing rect x,y,w,h, not_tes...@tom */ unsigned int getScreenContaining(int x, int y, int w, int h); //IPhone specific // //return the UIScreen object asscoiated with the passed ScreenIdentifier //returns nil if si isn't found UIScreen* getUIScreen(const osg::GraphicsContext::ScreenIdentifier& si); // //Get the contents scale factor of the screen, this is the scale factor required //to convert points to pixels on this screen bool getScreenContentScaleFactor(const osg::GraphicsContext::ScreenIdentifier& si, float& scaleFactor); // //Get the screens size in points, docs state a point is roughly 1/160th of an inch bool getScreenSizeInPoints(const osg::GraphicsContext::ScreenIdentifier& si, osg::Vec2& pointSize); protected: /** implementation of setScreenResolution */ //IPad can have extenal screens which we can request a res for //the main screen screenNum 0 can not currently have its res changed //as it only has one mode (might change though and this should still handle it) bool setScreenResolutionImpl(const osg::GraphicsContext::ScreenIdentifier& screenIdentifier, unsigned int width, unsigned int height); /** implementation of setScreenRefreshRate, currently can't set refresh rate of IPhone*/ bool setScreenRefreshRateImpl(const osg::GraphicsContext::ScreenIdentifier& screenIdentifier, double refreshRate); template<class PixelBufferImplementation, class GraphicsWindowImplementation> osg::GraphicsContext* createGraphicsContextImplementation(osg::GraphicsContext::Traits* traits) { if (traits->pbuffer) { osg::ref_ptr<PixelBufferImplementation> pbuffer = new PixelBufferImplementation(traits); if (pbuffer->valid()) return pbuffer.release(); else return 0; } else { osg::ref_ptr<GraphicsWindowImplementation> window = new GraphicsWindowImplementation(traits); if (window->valid()) return window.release(); else return 0; } } private: }; template <class WSI> struct RegisterWindowingSystemInterfaceProxy { RegisterWindowingSystemInterfaceProxy() { osg::GraphicsContext::setWindowingSystemInterface(new WSI); } ~RegisterWindowingSystemInterfaceProxy() { if (osg::Referenced::getDeleteHandler()) { osg::Referenced::getDeleteHandler()->setNumFramesToRetainObjects(0); osg::Referenced::getDeleteHandler()->flushAll(); } osg::GraphicsContext::setWindowingSystemInterface(0); } }; } #endif #endif // __APPLE__
IPhoneUtils.mm
Description: Binary data
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

