查看: 1406|回复: 1

osgearth运行实例tests失败

[复制链接]

该用户从未签到

发表于 2024-6-7 10:10:01 | 显示全部楼层 |阅读模式
我在安装完osgearth后想要运行文件夹的tests文件夹的程序,运行完只有背景的蓝色,没有模型。有没有遇到相同情况的大佬,球球了




指令: osgviewer gdaldem.earth
提示:
[osgEarth]* ASSERTION FAILURE (createMains @ ShaderFactory.cpp:170) state.getUseVertexAttributeAliasing() ...OpenSceneGraph vertex attribute aliasing must be enabled. Consider installing the GL3RealizeOperation in your viewer.
[osgEarth]* ASSERTION FAILURE (createMains @ ShaderFactory.cpp:173) state.getUseModelViewAndProjectionUniforms() ...OpenSceneGraph matrix uniforms must be enabled. Consider installing the GL3RealizeOperation in your viewer.
VERTEX glCompileShader "oe_rex_init_model" FAILED
VERTEX Shader "oe_rex_init_model" infolog:
0:24(19): error: `gl_MultiTexCoord0' undeclared
0:30(32): error: `gl_MultiTexCoord0' undeclared
0:30(32): error: type mismatch
0:30(28): error: cannot construct `int' from a non-numeric data type

VERTEX glCompileShader "oe_rex_normalMapVS" FAILED
VERTEX Shader "oe_rex_normalMapVS" infolog:
0:30(17): warning: `oe_layer_tilec' used uninitialized
0:35(33): error: `gl_NormalMatrix' undeclared
0:35(33): error: operands to arithmetic operators must be numeric
0:35(23): error: no matching function for call to `normalize(error)'; candidates are:
0:35(23): error:    float normalize(float)
0:35(23): error:    vec2 normalize(vec2)
0:35(23): error:    vec3 normalize(vec3)
0:35(23): error:    vec4 normalize(vec4)

VERTEX glCompileShader "oe_rex_morph" FAILED
VERTEX Shader "oe_rex_morph" infolog:
0:48(40): warning: `oe_layer_tilec' used uninitialized
0:51(29): error: `gl_ModelViewMatrix' undeclared
0:51(29): error: operands to arithmetic operators must be numeric
0:57(32): warning: `wouldBePositionView' used uninitialized
0:66(7): warning: `oe_terrain_vertexMarker' used uninitialized
0:68(62): warning: `vp_Normal' used uninitialized
0:70(34): error: `gl_MultiTexCoord1' undeclared
0:70(34): error: type mismatch
0:70(29): error: cannot construct `vec4' from a non-numeric data type
0:71(24): error: `gl_MultiTexCoord2' undeclared
0:71(24): error: type mismatch
0:76(30): warning: `oe_layer_tilec' used uninitialized
0:77(24): warning: `oe_layer_tilec' used uninitialized
0:78(28): warning: `oe_layer_tilec' used uninitialized
0:80(41): warning: `neighborVertexModel' used uninitialized
0:82(28): warning: `vp_Normal' used uninitialized
0:82(39): warning: `neighborNormal' used uninitialized
0:83(26): warning: `oe_layer_tilec' used uninitialized

VERTEX glCompileShader "main(vertex)" FAILED
VERTEX Shader "main(vertex)" infolog:
0:48(14): error: `gl_Vertex' undeclared
0:49(14): error: `gl_Normal' undeclared
0:50(13): error: `gl_Color' undeclared
0:54(14): error: `gl_ModelViewMatrix' undeclared
0:54(14): error: operands to arithmetic operators must be numeric
0:55(24): error: `gl_NormalMatrix' undeclared
0:55(24): error: operands to arithmetic operators must be numeric
0:55(14): error: no matching function for call to `normalize(error)'; candidates are:
0:55(14): error:    float normalize(float)
0:55(14): error:    vec2 normalize(vec2)
0:55(14): error:    vec3 normalize(vec3)
0:55(14): error:    vec4 normalize(vec4)
0:62(16): error: `gl_ProjectionMatrix' undeclared
0:62(16): error: operands to arithmetic operators must be numeric
0:63(35): warning: `oe_terrain_vertexMarker' used uninitialized
0:64(28): warning: `oe_layer_opacity' used uninitialized
0:65(30): warning: `oe_rex_morphFactor' used uninitialized
0:66(25): warning: `oe_layer_texc' used uninitialized
0:67(31): warning: `oe_layer_texcParent' used uninitialized
0:68(24): warning: `oe_normal_uv' used uninitialized
0:69(27): warning: `oe_UpVectorView' used uninitialized
0:70(30): warning: `oe_normal_binormal' used uninitialized
0:73(26): warning: `oe_layer_tilec' used uninitialized

glLinkProgram 0x55a6dda609f0"GDALDEMLayer" FAILED
Program "GDALDEMLayer" infolog:
error: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shader
[osgEarth]* [VirtualProgram] Program will not link!
[osgEarth]* ASSERTION FAILURE (createMains @ ShaderFactory.cpp:170) state.getUseVertexAttributeAliasing() ...OpenSceneGraph vertex attribute aliasing must be enabled. Consider installing the GL3RealizeOperation in your viewer.
[osgEarth]* ASSERTION FAILURE (createMains @ ShaderFactory.cpp:173) state.getUseModelViewAndProjectionUniforms() ...OpenSceneGraph matrix uniforms must be enabled. Consider installing the GL3RealizeOperation in your viewer.
VERTEX glCompileShader "main(vertex)" FAILED
VERTEX Shader "main(vertex)" infolog:
0:47(14): error: `gl_Vertex' undeclared
0:48(14): error: `gl_Normal' undeclared
0:49(13): error: `gl_Color' undeclared
0:52(14): error: `gl_ModelViewMatrix' undeclared
0:52(14): error: operands to arithmetic operators must be numeric
0:53(24): error: `gl_NormalMatrix' undeclared
0:53(24): error: operands to arithmetic operators must be numeric
0:53(14): error: no matching function for call to `normalize(error)'; candidates are:
0:53(14): error:    float normalize(float)
0:53(14): error:    vec2 normalize(vec2)
0:53(14): error:    vec3 normalize(vec3)
0:53(14): error:    vec4 normalize(vec4)
0:60(16): error: `gl_ProjectionMatrix' undeclared
0:60(16): error: operands to arithmetic operators must be numeric
0:61(35): warning: `oe_terrain_vertexMarker' used uninitialized
0:62(28): warning: `oe_layer_opacity' used uninitialized
0:63(30): warning: `oe_rex_morphFactor' used uninitialized
0:64(25): warning: `oe_layer_texc' used uninitialized
0:65(31): warning: `oe_layer_texcParent' used uninitialized
0:66(24): warning: `oe_normal_uv' used uninitialized
0:67(27): warning: `oe_UpVectorView' used uninitialized
0:68(30): warning: `oe_normal_binormal' used uninitialized
0:71(26): warning: `oe_layer_tilec' used uninitialized

glLinkProgram 0x55a6de32f500"Terrain image layer" FAILED
Program "Terrain image layer" infolog:
error: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shader
[osgEarth]* [VirtualProgram] Program will not link!
Segmentation fault (core dumped)
屏幕截图 2024-06-07 100657.png

该用户从未签到

发表于 2024-7-15 10:40:09 | 显示全部楼层
你可以以源码的方式自己写代码,其中添加这个代码:

setRealizeOperation(new osgEarth::GL3RealizeOperation());

如果还是不行,可能是编译的时候OpenGL的问题。需要知道你使用的 OSG 和 Osgearth 的版本信息。

如果你是基于最新vcpkg编译的话(2024-07-15),那么 OSG 365 和 Osgearth 3.5 需要添加 OPENGL3 的变量再编译。



您需要登录后才可以回帖 登录 | 注册

本版积分规则

OSG中国官方论坛-有您OSG在中国才更好

网站简介:osgChina是国内首个三维相关技术开源社区,旨在为国内更多的技术开发人员提供最前沿的技术资讯,为更多的三维从业者提供一个学习、交流的技术平台。

联系我们

  • 工作时间:09:00--18:00
  • 反馈邮箱:1315785073@qq.com
快速回复 返回顶部 返回列表