OSG打印错误Warning: detected OpenGL error ‘invalid operation‘ at after RenderBin::draw(..)

出现这个错误的原因主要是设置了opengl识别不了的uniform导致。比灯光,深度测试等等,关闭这些uniform可以消除这个错误。否则就得自己定义uniform,不要使用osg自带的uniform字段。

关闭打印

#include <osg\State>
osg::setNotifyLevel(osg::NotifySeverity::ALWAYS);

转发自:https://www.cnblogs.com/lyggqm/p/14558219.html

出现错误的地方;
转发自:https://blog.csdn.net/hankern/article/details/112552654

osg/Viewport.cpp
void Viewport::apply(State&) const
{
    glViewport( static_cast<GLint>(_x),static_cast<GLint>(_y),
                static_cast<GLsizei>(_width),static_cast<GLsizei>(_height) );
}
osg/State 
       enum CheckForGLErrors
        {
            /** NEVER_CHECK_GL_ERRORS hints that OpenGL need not be checked for, this
                is the fastest option since checking for errors does incur a small overhead.*/
            NEVER_CHECK_GL_ERRORS,
            /** ONCE_PER_FRAME means that OpenGL errors will be checked for once per
                frame, the overhead is still small, but at least OpenGL errors that are occurring
                will be caught, the reporting isn't fine grained enough for debugging purposes.*/
            ONCE_PER_FRAME,
            /** ONCE_PER_ATTRIBUTE means that OpenGL errors will be checked for after
                every attribute is applied, allow errors to be directly associated with
                particular operations which makes debugging much easier.*/
            ONCE_PER_ATTRIBUTE
        };
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值