【问题标题】:How to make this code work on Mesa3d?如何让这段代码在 Mesa3d 上运行?
【发布时间】:2011-03-01 20:16:22
【问题描述】:

此 GLSL 代码在 ATI 的 OpenGL 中编译和运行无警告:

void main()
{
  vec4 tmp = gl_ModelViewMatrix * gl_Vertex;
  tmp.xyz = tmp.xyz / (1 - tmp.w);
  tmp.w = 1;
  gl_Position = gl_ProjectionMatrix * tmp;
  gl_FrontColor = gl_Color;
}

为什么它会因台面而失败?如何解密该错误消息并使其符合 Mesa 的实现?

Compilation log:
0:1(88): error: Could not implicitly convert operands to arithmetic operator
0:1(89): error: Operands to arithmetic operators must be numeric
0:1(97): error: type mismatch

【问题讨论】:

  • 我认为 88、89 和 97 可能是着色器列表中的字符/字节偏移量。
  • 你能在这两种情况下都尝试使用1.0而不是1吗?

标签: opengl glsl mesa


【解决方案1】:

尝试将您的 1s 更改为 1.0s。

【讨论】:

    猜你喜欢
    • 2014-08-11
    • 2020-03-06
    • 2017-04-25
    • 2018-07-30
    • 1970-01-01
    • 2017-07-10
    • 1970-01-01
    • 1970-01-01
    • 2014-09-14
    相关资源
    最近更新 更多