/* * Add the path to <GL3/gl3.h> to the CMake compiler flags, CMAKE_CXX_FLAGS and CMAKE_CXX_FLAGS_DEBUG (for release and debug builds; others if you use other build configurations). The text to add should look something like this: /I 揅:\GLHeader? The folder GLHeader should contain a subfolder GL3, which in turn contains gl3.h. * Enable the following CMake variable: OSG_GL3_AVAILABLE * Disable the following CMake variables: OSG_GL1_AVAILABLE OSG_GL2_AVAILABLE OSG_GLES1_AVAILABLE OSG_GLES2_AVAILABLE OSG_GL_DISPLAYLISTS_AVAILABLE OSG_GL_FIXED_FUNCTION_AVAILABLE OSG_GL_MATRICES_AVAILABLE OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE OSG_GL_VERTEX_FUNCS_AVAILABLE **/
osg::ref_ptr< osg::GraphicsContext > gc1 = setWindowed(viewer1); gc1->getState()->setUseModelViewAndProjectionUniforms(true); gc1->getState()->setUseVertexAttributeAliasing(true);
osg_ModelViewProjectionMatrix 這個Uniform參數要麼用GL3的設置編譯底層庫, 要麼加這兩句設置ui