Hi Stephan, I did the changes in a moment of despair when my not so good OSG developer forces our app to use OpenGL 3.2. He was able to make it run without using GLSL 1.5 so I stop doing changes (OpenGL is not my speciality). I can look at the changes and some emails later today to find exactly what I accomplished at the end (but not too much).
Best regards, David On Sep 13, 2012, at 15:51 , Stephan Maximilian Huber wrote: > Hi David, Robert + Paul, > > @David, I tried your code on my end and I am getting a lot of OpenGL > errors, too. Did you get it running on your end? > > Some of the errors I get (captured with the open gl profiler) > > glEnable(GL_LIGHTING) -- GL_INVALID_ENUM > glEnableVertexAttribArray(0) -- GL_INVALID_OPERATION > glVertexAttribPointerARB(0, 3, GL_FLOAT, 0, 0, 0x7fce66003e00) -- > GL_INVALID_OPERATION > glDrawArrays(GL_TRIANGLE_STRIP, 0, 3) -- GL_INVALID_OPERATION > > So basically all serious open gl commands throw an error :) According to > the OpenGL profiler the context seems correct: > > GL_RENDERER: ATI Radeon HD 5770 OpenGL Engine > GL_VENDOR: ATI Technologies Inc. > GL_VERSION: 3.2 ATI-7.18.18 > kCGLCPGPUFragmentProcessing: GL_TRUE > kCGLCPGPUVertexProcessing: GL_TRUE > > and I get the correct clear-color displaying in the window ;-) > > > Any idea what might go wrong? > > cheers, > > Stephan > > > Am 03.03.12 01:10, schrieb David Garcia: >> >> Hi Robert, Paul, >> >> >> On Mar 2, 2012, at 16:33 , Robert Osfield <[email protected] >> <mailto:[email protected]>> wrote: >> >>> Looking at the osgsimplegl3 example it doesn't itself create a Material or >>> TexGen so I think these inappropriate StateAttribute are part of the scene >>> graph you are loading. Could it be cow.osg by any chance :-) >> >> Yes, of course :)… >> >> Following Paul advice I try osgWorks (2.0.0) teapot. I got different errors. >> In >> the state I have add to extract more information: >> gc->getState()->setCheckForGLErrors(osg::State::ONCE_PER_ATTRIBUTE); >> >> The output is in the zip file (errors.txt). >> >> >>>> >>> OpenGL defines CGL functions. I will check later today if it is required. >>> >> >> The include is not required. >> >>> >>> I have not be able to found another way to activate it without using this >>> enum. Rumors are that Mountain Lion will support extra values making the >>> code uglier. Another solution will be to use the value of the enum >>> (NSOpenGLPFAOpenGLProfile is 99 and NSOpenGLProfileVersion3_2Core is >>> 0x3200) but seems even less elegant. >>> >>> >>> Perhaps moving this discussion on to osg-users and try to catch the >>> attention >>> of other OSX devs to see what they think. I'd like to had a solution that >>> will handle future revs of OSX and the SDK as well as be backwards >>> compatible. >>> >> >> As the versions seems defined by a enum I cannot see any solution other than >> giant IF. And requires an ifdef because the SDK of 10.6 doesn't have the >> enum >> (neither defines NSOpenGLPFAOpenGLProfile). >> >> I coded a different version that mirrors the structure of the Win32 version. >> The >> code now is: >> >> std::istringstream istr( _traits->glContextVersion ); >> unsigned int major, minor; >> unsigned char dot; >> istr >> major >> dot >> minor; >> >> if( OSG_GL3_FEATURES ){ >> if( major < 3 ){ >> OSG_NOTIFY( osg::WARN ) << "GL3: Non-GL3 version number: " << >> _traits->glContextVersion << std::endl; >> }else{ >> OSG_NOTIFY( osg::INFO ) << "GL3: Attempting to create OpenGL3 context." << >> std::endl; >> OSG_NOTIFY( osg::INFO ) << "GL3: version: " << _traits->glContextVersion << >> std::endl; >> >> #if defined(OSG_GL3_AVAILABLE) >> attr[i++] = NSOpenGLPFAOpenGLProfile; >> attr[i++] = NSOpenGLProfileVersion3_2Core; >> #endif >> } >> } >> >> >> So, find the new version of GL (no include, correct order for the >> define GL3_PROTOTYPES) and code to activate 3.2 if the version requested is >> 3.0 >> or higher. As soon as Apple updates Mountain Lion with OpenGL 4.1 support, I >> can >> rewrite the code (but 4.1 support is still a rumor). >> >> Thanks, >> >> David >> >> >> >> >> >> >> >> >> >> >> >> _______________________________________________ >> osg-submissions mailing list >> [email protected] >> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org >> > David Garcia Technical Director
_______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
