Why can't ive format model texture show when turn on setUseVertexAttributeAliasing(true)?

63 views
Skip to first unread message

mirr...@gmail.com

unread,
Oct 15, 2020, 1:41:58 AM10/15/20
to OpenSceneGraph Users
env is system Win10 ,osg 3.6.4, osgearth 2.10.0,GTX1660 TI

Why is there an error in the model texture display when this function is turn on?

 const int width( 800 ), height( 450 );
    const std::string version( "4.3" );
    osg::ref_ptr< osg::GraphicsContext::Traits > traits = new osg::GraphicsContext::Traits();
    traits->x = 20; traits->y = 30;
    traits->width = width; traits->height = height;
    traits->windowDecoration = true;
    traits->doubleBuffer = true;
    traits->glContextVersion = version;
    traits->readDISPLAY();
    traits->setUndefinedScreenDetailsToDefaultScreen();
    osg::ref_ptr< osg::GraphicsContext > gc = osg::GraphicsContext::createGraphicsContext( traits.get() );
    if( !gc.valid() )
    {
        osg::notify( osg::FATAL ) << "Unable to create OpenGL v" << version << " context." << std::endl;
        return( 1 );
    }
Q20201012125957.png
Message has been deleted

OpenSceneGraph Users

unread,
Oct 16, 2020, 4:38:34 AM10/16/20
to OpenSceneGraph Users
Hi ?

OpenGL and OSG strandles and old fixed function pipeline era and shaders.  You can select a pure shaders subset of OpenGL at compile time and runtime, and you can also toggle on/off some mappings the OSG provide between the GL2.x GLSL built in variables and osg_ equivalents useful for GLES2.x/GL3.x+. 

The scene graphs you build for each of these scenarios will need to be different - you can't use fixed function pipeline state with a GL version that only supports shaders.  I know nothing about your particular .ive but my best guess is that it's not compatible with the subset of OpenGL you selecting.

Robert.

--
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/8f6c8efb-d2ee-46f3-a85c-3957fea0c828n%40googlegroups.com.
_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

mirr...@gmail.com

unread,
Oct 16, 2020, 11:07:38 PM10/16/20
to OpenSceneGraph Users
Thank you for your questions,    Do you mean to  use this  setUseVertexAttributeAliasing(true)  only in GL version that only supports shaders  ?  

OpenSceneGraph Users

unread,
Oct 18, 2020, 9:58:40 AM10/18/20
to OpenSceneGraph Users
On Sat, 17 Oct 2020 at 18:15, OpenSceneGraph Users <osg-...@lists.openscenegraph.org> wrote:
Thank you for your questions,    Do you mean to  use this  setUseVertexAttributeAliasing(true)  only in GL version that only supports shaders  ?  

Vertex aliasing only affects scene graphs that use shaders, they don't affect the OpenGl fixed function pipeline.

The OSG tests for shader support at runtime so even older versions of OpenGL prior to GL2 can use shaders.

However, if you build against GL core profile or GLES2.x of greater then there is no fixed function pipeline so all OSG usage will need to use shaders.

Robert. 
Reply all
Reply to author
Forward
0 new messages