osgearth icon indicating copy to clipboard operation
osgearth copied to clipboard

shader errors running latest osgearth master (Intel GPU)

Open gwaldron opened this issue 2 years ago • 39 comments

Discussed in https://github.com/gwaldron/osgearth/discussions/2024

Originally posted by keince March 23, 2022 I pulled the latest osgearth master into my local repo and rebuilt the solution.

Now I'm getting the following errors during runtime...

C:\Users\shayne.tueller\osgearth\tests>osgearth_viewer --window 100 100 800 600 simple.earth
[osgEarth]  Hello, world.
Error reading file C:\Windows\Fonts\arial.ttf: file not handled
[osgEarth]  [Capabilities] Capabilities:
[osgEarth]  [Capabilities]   osgEarth Version:  3.2.0 build 132
[osgEarth]  [Capabilities]   OSG Version:       3.6.5
[osgEarth]  [Capabilities]   GDAL Version:      3.2.2
[osgEarth]  [Capabilities]   GEOS Version:      3.9.1
[osgEarth]  [Capabilities]   GPU Vendor:        NVIDIA Corporation
[osgEarth]  [Capabilities]   GPU Renderer:      GeForce GTX 1660 Ti/PCIe/SSE2
[osgEarth]  [Capabilities]   GL/Driver Version: 4.6.0 NVIDIA 462.75
[osgEarth]  [Capabilities]   GL Core Profile:   no
[osgEarth]  [Map] Map profile is: [srs=WGS84, min=-180,-90 max=180,90 ar=2:1 vdatum=geodetic]
[osgEarth]  [Map] [no cache]
[osgEarth]  [GDAL] Resolution= 0.175781x0.175781 max=0.175781
[osgEarth]  [GDAL] C:/Users/shayne.tueller/osgearth/data/world.tif max Data Level: 3
[osgEarth]  [TileLayer] Layer "World GeoTIFF" [srs=WGS 84, min=-180,-90 max=180,90 ar=2:1 vdatum=geodetic] [no cache]
[osgEarth]  [JobArena] Arena "oe.nodepager" concurrency=2
[osgEarth]  [JobArena] Arena "oe.nodepager" concurrency=4
[osgEarth]  [engine_rex] Activated!
[osgEarth]  [TerrainResources] Texture unit 0 reserved for Terrain Color
[osgEarth]  [TerrainResources] Texture unit 1 reserved for Terrain Elevation
[osgEarth]  [TerrainResources] Texture unit 2 reserved for Terrain Normals
[osgEarth]  [TerrainResources] Texture unit 3 reserved for Terrain Parent Color
[osgEarth]  [TerrainResources] Texture unit 4 reserved for Terrain Land Cover
[osgEarth]  [RexTerrainEngineNode] Creating 2 root keys.
[osgEarth]  [JobArena] Arena "oe.rex.loadtile" concurrency=4
[osgEarth]  [TileLayer] Layer "World GeoTIFF" Building data extents index with 1 extents
[osgEarth]  [MapNodeHelper] Activating logarithmic depth buffer (vertex-only) on main camera
[osgEarth]  [JobArena] Arena "oe.rex.createchild" concurrency=2
VERTEX glCompileShader "oe_logDepth_vert" FAILED
VERTEX Shader "oe_logDepth_vert" infolog:
0(10) : error C7616: global variable gl_ProjectionMatrix is removed after version 140

VERTEX glCompileShader "oe_rex_init_model" FAILED
VERTEX Shader "oe_rex_init_model" infolog:
0(26) : error C7616: global variable gl_MultiTexCoord0 is removed after version 140

VERTEX glCompileShader "oe_rex_normalMapVS" FAILED
VERTEX Shader "oe_rex_normalMapVS" infolog:
0(36) : error C7616: global variable gl_NormalMatrix is removed after version 140

VERTEX glCompileShader "oe_rex_morph" FAILED
VERTEX Shader "oe_rex_morph" infolog:
0(94) : error C7616: global variable gl_ModelViewMatrix is removed after version 140
0(124) : error C7616: global variable gl_MultiTexCoord1 is removed after version 140
0(125) : error C7616: global variable gl_MultiTexCoord2 is removed after version 140

VERTEX glCompileShader "main(vertex)" FAILED
VERTEX Shader "main(vertex)" infolog:
0(51) : error C7616: global variable gl_Vertex is removed after version 140
0(52) : error C7616: global variable gl_Normal is removed after version 140
0(53) : error C7616: global variable gl_Color is removed after version 140
0(57) : error C7616: global variable gl_ModelViewMatrix is removed after version 140
0(58) : error C7616: global variable gl_NormalMatrix is removed after version 140
0(65) : error C7616: global variable gl_ProjectionMatrix is removed after version 140

glLinkProgram 0000023735524F20"GDALImageLayer" FAILED
Program "GDALImageLayer" infolog:
Vertex info
-----------
0(10) : error C7616: global variable gl_ProjectionMatrix is removed after version 140
(0) : error C2003: incompatible options for link
0(26) : error C7616: global variable gl_MultiTexCoord0 is removed after version 140
(0) : error C2003: incompatible options for link
0(36) : error C7616: global variable gl_NormalMatrix is removed after version 140
(0) : error C2003: incompatible options for link
0(94) : error C7616: global variable gl_ModelViewMatrix is removed after version 140
0(124) : error C7616: global variable gl_MultiTexCoord1 is removed after version 140
0(125) : error C7616: global variable gl_MultiTexCoord2 is removed after version 140
(0) : error C2003: incompatible options for link
0(51) : error C7616: global variable gl_Vertex is removed after version 140
0(52) : error C7616: global variable gl_Normal is removed after version 140
0(53) : error C7616: global variable gl_Color is removed after version 140
0(57) : error C7616: global variable gl_ModelViewMatrix is removed after version 140
0(58) : error C7616: global variable gl_NormalMatrix is removed after version 140
0(65) : error C7616: global variable gl_ProjectionMatrix is removed after version 140
(0) : error C2003: incompatible options for link

Any idea what is causing these runtime errors?

gwaldron avatar Mar 23 '22 19:03 gwaldron

Curious, I'm not seeing any such errors. Do you have any env vars set?

gwaldron avatar Mar 24 '22 13:03 gwaldron

I am getting the following errors in Linux for latest osgEarth master.

VERTEX glCompileShader "oe_logDepth_vert" FAILED VERTEX Shader "oe_logDepth_vert" infolog: 0:3(12): warning: extension GL_ARB_gpu_shader5' unsupported in vertex shader 0:4(12): warning: extension GL_ARB_gpu_shader_int64' unsupported in vertex shader 0:10(6): error: gl_ProjectionMatrix' undeclared 0:10(6): error: operands of ==' must have the same type 0:12(27): error: gl_ProjectionMatrix' undeclared 0:12(19): error: no matching function for call to inverse(error)'; candidates are: 0:12(19): error: mat2 inverse(mat2) 0:12(19): error: mat3 inverse(mat3) 0:12(19): error: mat4 inverse(mat4) 0:13(18): warning: `clip2view' used uninitialized

VERTEX glCompileShader "oe_rex_init_model" FAILED VERTEX Shader "oe_rex_init_model" infolog: 0:3(12): warning: extension GL_ARB_gpu_shader5' unsupported in vertex shader 0:4(12): warning: extension GL_ARB_gpu_shader_int64' unsupported in vertex shader 0:26(19): error: `gl_MultiTexCoord0' undeclared

VERTEX glCompileShader "oe_rex_normalMapVS" FAILED VERTEX Shader "oe_rex_normalMapVS" infolog: 0:5(12): warning: extension GL_ARB_gpu_shader5' unsupported in vertex shader 0:6(12): warning: extension GL_ARB_gpu_shader_int64' unsupported in vertex shader 0:31(23): warning: oe_layer_tilec' used uninitialized 0:36(35): error: gl_NormalMatrix' undeclared 0:36(35): error: operands to arithmetic operators must be numeric 0:36(25): error: no matching function for call to `normalize(error)'; candidates are: 0:36(25): error: float normalize(float) 0:36(25): error: vec2 normalize(vec2) 0:36(25): error: vec3 normalize(vec3) 0:36(25): error: vec4 normalize(vec4)

VERTEX glCompileShader "oe_rex_morph" FAILED VERTEX Shader "oe_rex_morph" infolog: 0:6(12): warning: extension GL_ARB_gpu_shader5' unsupported in vertex shader 0:7(12): warning: extension GL_ARB_gpu_shader_int64' unsupported in vertex shader 0:91(40): warning: oe_layer_tilec' used uninitialized 0:94(29): error: gl_ModelViewMatrix' undeclared 0:94(29): error: operands to arithmetic operators must be numeric 0:100(32): warning: wouldBePositionView' used uninitialized 0:120(7): warning: oe_terrain_vertexMarker' used uninitialized 0:122(62): warning: vp_Normal' used uninitialized 0:124(34): error: gl_MultiTexCoord1' undeclared 0:124(34): error: type mismatch 0:124(29): error: cannot construct vec4' from a non-numeric data type 0:125(24): error: gl_MultiTexCoord2' undeclared 0:125(24): error: type mismatch 0:130(30): warning: oe_layer_tilec' used uninitialized 0:131(24): warning: oe_layer_tilec' used uninitialized 0:132(28): warning: oe_layer_tilec' used uninitialized 0:135(32): warning: oe_layer_tilec' used uninitialized 0:137(19): warning: neighborVertexModel' used uninitialized 0:141(28): warning: vp_Normal' used uninitialized 0:141(39): warning: `neighborNormal' used uninitialized

VERTEX glCompileShader "main(vertex)" FAILED VERTEX Shader "main(vertex)" infolog: 0:2(12): warning: extension GL_ARB_gpu_shader5' unsupported in vertex shader 0:3(12): warning: extension GL_ARB_gpu_shader_int64' unsupported in vertex shader 0:51(14): error: gl_Vertex' undeclared 0:52(14): error: gl_Normal' undeclared 0:53(13): error: gl_Color' undeclared 0:57(14): error: gl_ModelViewMatrix' undeclared 0:57(14): error: operands to arithmetic operators must be numeric 0:58(24): error: gl_NormalMatrix' undeclared 0:58(24): error: operands to arithmetic operators must be numeric 0:58(14): error: no matching function for call to normalize(error)'; candidates are: 0:58(14): error: float normalize(float) 0:58(14): error: vec2 normalize(vec2) 0:58(14): error: vec3 normalize(vec3) 0:58(14): error: vec4 normalize(vec4) 0:65(14): error: gl_ProjectionMatrix' undeclared 0:65(14): error: operands to arithmetic operators must be numeric 0:68(35): warning: oe_terrain_vertexMarker' used uninitialized 0:69(28): warning: oe_layer_opacity' used uninitialized 0:70(30): warning: oe_rex_morphFactor' used uninitialized 0:71(25): warning: oe_layer_texc' used uninitialized 0:72(31): warning: oe_layer_texcParent' used uninitialized 0:73(30): warning: oe_normalMapCoords' used uninitialized 0:74(27): warning: oe_UpVectorView' used uninitialized 0:75(32): warning: oe_normalMapBinormal' used uninitialized 0:78(26): warning: oe_layer_tilec' used uninitialized

glLinkProgram 0x7f979c01f220"ArcGISServerImageLayer" FAILED Program "ArcGISServerImageLayer" infolog: error: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shader Segmentation fault (core dumped)

serkanozkaymak avatar Mar 26 '22 19:03 serkanozkaymak

@keince Are you still experiencing this? Pull latest master and re-run osgearth_version --caps please.

gwaldron avatar Apr 05 '22 19:04 gwaldron

I get the following shader errors with the latest master.

[osgEarth] [Capabilities] Capabilities: [osgEarth] [Capabilities] osgEarth Version: 3.2.0 build 132 [osgEarth] [Capabilities] OSG Version: 3.6.5 [osgEarth] [Capabilities] GDAL Version: 3.4.1 [osgEarth] [Capabilities] GEOS Version: 3.10.0 [osgEarth] [Capabilities] GPU Vendor: Intel [osgEarth] [Capabilities] GPU Renderer: Intel(R) UHD Graphics [osgEarth] [Capabilities] GL/Driver Version: 4.6.0 - Build 30.0.101.1122 (460) [osgEarth] [Capabilities] GL Core Profile: no

VERTEX glCompileShader "oe_logDepth_vert" FAILED VERTEX Shader "oe_logDepth_vert" infolog: WARNING: 0:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported WARNING: 0:4: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported ERROR: 0:10: 'gl_ProjectionMatrix' : undeclared identifier ERROR: 0:10: 'gl_ProjectionMatrix' : left of '[' is not of type array, matrix, or vector ERROR: 0:10: '' : left of '[' is not of type array, matrix, or vector ERROR: 0:13: 'inverse' : no matching overloaded function found (using implicit conversion) ERROR: 0:13: 'inverse' : function is not known ERROR: 0:12: '=' : cannot convert from 'const float' to '4X4 matrix of highp float'

VERTEX Shader "oe_logDepth_vert" infolog: WARNING: 0:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported WARNING: 0:4: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported ERROR: 0:10: 'gl_ProjectionMatrix' : undeclared identifier ERROR: 0:10: 'gl_ProjectionMatrix' : left of '[' is not of type array, matrix, or vector ERROR: 0:10: '' : left of '[' is not of type array, matrix, or vector ERROR: 0:13: 'inverse' : no matching overloaded function found (using implicit conversion) ERROR: 0:13: 'inverse' : function is not known ERROR: 0:12: '=' : cannot convert from 'const float' to '4X4 matrix of highp float'

VERTEX Shader "oe_logDepth_vert" infolog: WARNING: 0:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported WARNING: 0:4: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported ERROR: 0:10: 'gl_ProjectionMatrix' : undeclared identifier ERROR: 0:10: 'gl_ProjectionMatrix' : left of '[' is not of type array, matrix, or vector ERROR: 0:10: '' : left of '[' is not of type array, matrix, or vector ERROR: 0:13: 'inverse' : no matching overloaded function found (using implicit conversion) ERROR: 0:13: 'inverse' : function is not known ERROR: 0:12: '=' : cannot convert from 'const float' to '4X4 matrix of highp float'

VERTEX glCompileShader "oe_rex_init_model" FAILED VERTEX Shader "oe_rex_init_model" infolog: WARNING: 0:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported WARNING: 0:4: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported ERROR: 0:26: 'gl_MultiTexCoord0' : undeclared identifier ERROR: 0:26: 'assign' : cannot convert from 'highp float' to '4-component vector of highp float'

VERTEX glCompileShader "oe_rex_init_model" FAILED VERTEX glCompileShader "oe_rex_init_model" FAILED VERTEX Shader "oe_rex_normalMapVS" infolog: WARNING: 2:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported WARNING: 2:4: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported ERROR: 2:34: 'gl_NormalMatrix' : undeclared identifier

VERTEX Shader "oe_rex_normalMapVS" infolog: WARNING: 2:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported WARNING: 2:4: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported ERROR: 2:34: 'gl_NormalMatrix' : undeclared identifier

ROR: 0:26: 'assign' : cannot convert from 'highp float' to '4-component vector of highp float'

VERTEX glCompileShader "oe_rex_morph" FAILED VERTEX Shader "oe_rex_morph" infolog: WARNING: 2:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported WARNING: 2:4: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported ERROR: 2:91: 'gl_ModelViewMatrix' : undeclared identifier ERROR: 2:121: 'gl_MultiTexCoord1' : undeclared identifier ERROR: 2:121: 'xyz' : vector field selection out of range ERROR: 2:122: 'constructor' : not enough data provided for construction ERROR: 2:122: 'gl_MultiTexCoord2' : undeclared identifier ERROR: 2:122: 'xyz' : vector field selection out of range ERROR: 2:122: '=' : cannot convert from 'highp float' to '3-component vector of highp float'

VERTEX Shader "oe_rex_morph" infolog: WARNING: 2:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported WARNING: 2:4: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported ERROR: 2:91: 'gl_ModelViewMatrix' : undeclared identifier ERROR: 2:121: 'gl_MultiTexCoord1' : undeclared identifier ERROR: 2:121: 'xyz' : vector field selection out of range ERROR: 2:122: 'constructor' : not enough data provided for construction ERROR: 2:122: 'gl_MultiTexCoord2' : undeclared identifier ERROR: 2:122: 'xyz' : vector field selection out of range ERROR: 2:122: '=' : cannot convert from 'highp float' to '3-component vector of highp float'

VERTEX Shader "oe_rex_normalMapVS" infolog: WARNING: 2:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported WARNING: 2:4: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported ERROR: 2:34: 'gl_NormalMatrix' : undeclared identifier

VERTEX Shader "oe_rex_normalMapVS" infolog: WARNING: 2:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported WARNING: 2:4: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported ERROR: 2:34: 'gl_NormalMatrix' : undeclared identifier

VERTEX Shader "main(vertex)" infolog: WARNING: 0:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported ERROR: 0:50: 'gl_Vertex' : undeclared identifier ERROR: 0:50: 'assign' : cannot convert from 'highp float' to '4-component vector of highp float' ERROR: 0:51: 'gl_Normal' : undeclared identifier ERROR: 0:51: 'assign' : cannot convert from 'highp float' to '3-component vector of highp float' ERROR: 0:52: 'gl_Color' : undeclared identifier ERROR: 0:52: 'assign' : cannot convert from 'highp float' to '4-component vector of highp float' ERROR: 0:56: 'gl_ModelViewMatrix' : undeclared identifier ERROR: 0:57: 'gl_NormalMatrix' : undeclared identifier ERROR: 0:64: 'gl_ProjectionMatrix' : undeclared identifier

VERTEX Shader "main(vertex)" infolog: WARNING: 0:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported ERROR: 0:50: 'gl_Vertex' : undeclared identifier ERROR: 0:50: 'assign' : cannot convert from 'highp float' to '4-component vector of highp float' ERROR: 0:51: 'gl_Normal' : undeclared identifier ERROR: 0:51: 'assign' : cannot convert from 'highp float' to '3-component vector of highp float' ERROR: 0:52: 'gl_Color' : undeclared identifier ERROR: 0:52: 'assign' : cannot convert from 'highp float' to '4-component vector of highp float' ERROR: 0:56: 'gl_ModelViewMatrix' : undeclared identifier ERROR: 0:57: 'gl_NormalMatrix' : undeclared identifier ERROR: 0:64: 'gl_ProjectionMatrix' : undeclared identifier

glLinkProgram VERTEX Shader VERTEX Shader "oe_rex_morph" infolog: WARNING: 2:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported WARNING: 2:4: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported ERROR: 2:91: 'gl_ModelViewMatrix' : undeclared identifier ERROR: 2:121: 'gl_MultiTexCoord1' : undeclared identifier ERROR: 2:121: 'xyz' : vector field selection out of range ERROR: 2:122: 'constructor' : not enough data provided for construction ERROR: 2:122: 'gl_MultiTexCoord2' : undeclared identifier ERROR: 2:122: 'xyz' : vector field selection out of range ERROR: 2:122: '=' : cannot convert from 'highp float' to '3-component vector of highp float'

Program "WMSImageLayer" infolog: Attached vertex shader is not compiled.

[osgEarth]* [VirtualProgram] Program will not link! VERTEX glCompileShader "main(vertex)" FAILED VERTEX Shader "main(vertex)" infolog: WARNING: 0:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported ERROR: 0:50: 'gl_Vertex' : undeclared identifier ERROR: 0:50: 'assign' : cannot convert from 'highp float' to '4-component vector of highp float' ERROR: 0:51: 'gl_Normal' : undeclared identifier ERROR: 0:51: 'assign' : cannot convert from 'highp float' to '3-component vector of highp float' ERROR: 0:52: 'gl_Color' : undeclared identifier ERROR: 0:52: 'assign' : cannot convert from 'highp float' to '4-component vector of highp float' ERROR: 0:56: 'gl_ModelViewMatrix' : undeclared identifier ERROR: 0:57: 'gl_NormalMatrix' : undeclared identifier ERROR: 0:64: 'gl_ProjectionMatrix' : undeclared identifier

glLinkProgram 000001EEA92824E0"WMSImageLayer" FAILED Program "WMSImageLayer" infolog: Attached vertex shader is not compiled.

[osgEarth]* [VirtualProgram] Program will not link!

nebsar avatar Apr 07 '22 01:04 nebsar

I tried it on another computer, and similar errors:

[osgEarth] [Capabilities] Capabilities: [osgEarth] [Capabilities] osgEarth Version: 3.2.0 build 132 [osgEarth] [Capabilities] OSG Version: 3.6.5 [osgEarth] [Capabilities] GDAL Version: 3.4.1 [osgEarth] [Capabilities] GEOS Version: 3.10.0 [osgEarth] [Capabilities] GPU Vendor: NVIDIA Corporation [osgEarth] [Capabilities] GPU Renderer: GeForce GT 650M/PCIe/SSE2 [osgEarth] [Capabilities] GL/Driver Version: 4.6.0 NVIDIA 425.31 (460) [osgEarth] [Capabilities] GL Core Profile: no

VERTEX glCompileShader "oe_logDepth_vert" FAILED VERTEX Shader "oe_logDepth_vert" infolog: 0(10) : error C7616: global variable gl_ProjectionMatrix is removed after version 140

VERTEX glCompileShader "oe_rex_init_model" FAILED VERTEX Shader "oe_rex_init_model" infolog: 0(26) : error C7616: global variable gl_MultiTexCoord0 is removed after version 140

VERTEX glCompileShader "oe_rex_normalMapVS" FAILED VERTEX Shader "oe_rex_normalMapVS" infolog: 0(36) : error C7616: global variable gl_NormalMatrix is removed after version 140

VERTEX glCompileShader "oe_rex_morph" FAILED VERTEX Shader "oe_rex_morph" infolog: 0(94) : error C7616: global variable gl_ModelViewMatrix is removed after version 140 0(124) : error C7616: global variable gl_MultiTexCoord1 is removed after version 140 0(125) : error C7616: global variable gl_MultiTexCoord2 is removed after version 140

VERTEX glCompileShader "main(vertex)" FAILED VERTEX Shader "main(vertex)" infolog: 0(50) : error C7616: global variable gl_Vertex is removed after version 140 0(51) : error C7616: global variable gl_Normal is removed after version 140 0(52) : error C7616: global variable gl_Color is removed after version 140 0(56) : error C7616: global variable gl_ModelViewMatrix is removed after version 140 0(57) : error C7616: global variable gl_NormalMatrix is removed after version 140 0(64) : error C7616: global variable gl_ProjectionMatrix is removed after version 140

glLinkProgram 0000012453714C90"WMSImageLayer" FAILED Program "WMSImageLayer" infolog: Vertex info

0(10) : error C7616: global variable gl_ProjectionMatrix is removed after version 140 (0) : error C2003: incompatible options for link 0(26) : error C7616: global variable gl_MultiTexCoord0 is removed after version 140 (0) : error C2003: incompatible options for link 0(36) : error C7616: global variable gl_NormalMatrix is removed after version 140 (0) : error C2003: incompatible options for link 0(94) : error C7616: global variable gl_ModelViewMatrix is removed after version 140 0(124) : error C7616: global variable gl_MultiTexCoord1 is removed after version 140 0(125) : error C7616: global variable gl_MultiTexCoord2 is removed after version 140 (0) : error C2003: incompatible options for link 0(50) : error C7616: global variable gl_Vertex is removed after version 140 0(51) : error C7616: global variable gl_Normal is removed after version 140 0(52) : error C7616: global variable gl_Color is removed after version 140 0(56) : error C7616: global variable gl_ModelViewMatrix is removed after version 140 0(57) : error C7616: global variable gl_NormalMatrix is removed after version 140 0(64) : error C7616: global variable gl_ProjectionMatrix is removed after version 140 (0) : error C2003: incompatible options for link

[osgEarth]* [VirtualProgram] Program will not link! [osgEarth]* SHADER oe_logDepth_vert infolog errors: 0: #version 460 1: #extension GL_ARB_gpu_shader_int64 : enable 2: #extension GL_ARB_gpu_shader_int64 : enable 3: #pragma vp_entryPoint oe_logDepth_vert 4: #pragma vp_location vertex_clip 5: #pragma vp_order 0.99 6: #define VP_STAGE_VERTEX 7: void oe_logDepth_vert(inout vec4 clip) 8: { 9: if (gl_ProjectionMatrix[3][3] == 0.0) // perspective only 10:>>> { 11: mat4 clip2view = inverse(gl_ProjectionMatrix); 12: vec4 farPoint = clip2view * vec4(0,0,1,1); 13: float FAR = -farPoint.z / farPoint.w; 14: float FC = 2.0 / log2(FAR + 1); 15: clip.z = (log2(max(1e-6, clip.w+1.0))*FC - 1.0) * clip.w; 16: } 17: }

[osgEarth]* SHADER oe_rex_init_model infolog errors: 0: #version 460 1: #extension GL_ARB_gpu_shader_int64 : enable 2: #extension GL_ARB_gpu_shader_int64 : enable 3: #pragma vp_name REX Engine - Init Model Space 4: #pragma vp_function oe_rex_init_model, vertex_model, first 5: #define VP_STAGE_VERTEX 6: // uniforms 7: uniform vec4 oe_terrain_color; 8: uniform vec4 oe_tile_key_u; 9: // outputs 10: vec4 vp_Color; 11: #pragma vp_varying_out vec4 vp_Color 12: vec4 oe_layer_tilec; 13: #pragma vp_varying_out vec4 oe_layer_tilec 14: vec4 oe_terrain_tessLevel; 15: #pragma vp_varying_out vec4 oe_terrain_tessLevel 16: float oe_rex_morphFactor; 17: #pragma vp_varying_out float oe_rex_morphFactor 18: int oe_terrain_vertexMarker; 19: #pragma vp_varying_out flat int oe_terrain_vertexMarker 20: // stage globals 21: vec4 oe_tile_key; 22: void oe_rex_init_model(inout vec4 vertexModel) 23: { 24: // Texture coordinate for the tile (always 0..1) 25: oe_layer_tilec = gl_MultiTexCoord0; 26:>>> // Extract the vertex type marker 27: oe_terrain_vertexMarker = int(oe_layer_tilec.z); 28: // Color of the underlying map geometry (untextured) 29: vp_Color = oe_terrain_color; 30: // initialize: 31: oe_rex_morphFactor = 0.0; 32: // tile key 33: oe_tile_key = oe_tile_key_u; 34: 35: // Default tessellation level (where applicable) 36: oe_terrain_tessLevel = vec4(1); 37: }

[osgEarth]* SHADER oe_rex_normalMapVS infolog errors: 0: #version 460 1: #extension GL_ARB_gpu_shader_int64 : enable 2: #extension GL_ARB_gpu_shader_int64 : enable 3: #pragma vp_entryPoint oe_rex_normalMapVS 4: #pragma vp_location vertex_view 5: #pragma vp_order 0.5 6: #pragma import_defines(OE_TERRAIN_RENDER_NORMAL_MAP) 7: #define VP_STAGE_VERTEX 8: uniform mat4 oe_tile_normalTexMatrix; 9: uniform vec2 oe_tile_elevTexelCoeff; 10: uniform mat4 oe_tile_elevationTexMatrix; 11: // stage globals 12: vec4 oe_layer_tilec; 13: vec2 oe_normalMapCoords; 14: #pragma vp_varying_out vec2 oe_normalMapCoords 15: vec3 oe_normalMapBinormal; 16: #pragma vp_varying_out vec3 oe_normalMapBinormal 17: void oe_rex_normalMapVS(inout vec4 unused) 18: { 19: #ifndef OE_TERRAIN_RENDER_NORMAL_MAP 20: return; 21: #endif 22: // calculate the sampling coordinates for the normal texture 23: //oe_normalMapCoords = (oe_tile_normalTexMatrix * oe_layer_tilec).st; 24: //oe_normalMapCoords = oe_layer_tilec.st 25: // * oe_tile_elevTexelCoeff.x * oe_tile_normalTexMatrix[0][0] 26: // + oe_tile_elevTexelCoeff.x * oe_tile_normalTexMatrix[3].st 27: // + oe_tile_elevTexelCoeff.y; 28: oe_normalMapCoords = oe_layer_tilec.st 29: * oe_tile_elevTexelCoeff.x * oe_tile_elevationTexMatrix[0][0] 30: + oe_tile_elevTexelCoeff.x * oe_tile_elevationTexMatrix[3].st 31: + oe_tile_elevTexelCoeff.y; 32: // send the bi-normal to the fragment shader 33: oe_normalMapBinormal = normalize(gl_NormalMatrix * vec3(0, 1, 0)); 34: }

[osgEarth]* SHADER oe_rex_morph infolog errors: 0: #version 460 1: #extension GL_ARB_gpu_shader_int64 : enable 2: #extension GL_ARB_gpu_shader_int64 : enable 3: #pragma vp_name REX Engine - Morphing 4: #pragma vp_entryPoint oe_rex_morph 5: #pragma vp_location vertex_model 6: #pragma vp_order 0.5 7: #pragma import_defines(OE_TERRAIN_MORPH_GEOMETRY) 8: #pragma import_defines(OE_TERRAIN_RENDER_ELEVATION) 9: #pragma import_defines(OE_IS_DEPTH_CAMERA) 10: #pragma import_defines(OE_ELEVATION_CONSTRAINT_TEX) 11: #pragma import_defines(OE_ELEVATION_CONSTRAINT_TEX_MATRIX) 12: #define VP_STAGE_VERTEX 13: vec3 vp_Normal; 14: #pragma vp_varying_out vec3 vp_Normal 15: vec4 oe_layer_tilec; 16: #pragma vp_varying_out vec4 oe_layer_tilec 17: float oe_rex_morphFactor; 18: #pragma vp_varying_out float oe_rex_morphFactor 19: int oe_terrain_vertexMarker; 20: #pragma vp_varying_out flat int oe_terrain_vertexMarker 21: uniform vec2 oe_tile_morph; 22: uniform float oe_tile_size; 23: // Constraint stuff 24: #ifdef OE_ELEVATION_CONSTRAINT_TEX 25: uniform sampler2DArray OE_ELEVATION_CONSTRAINT_TEX; 26: uniform mat4 OE_ELEVATION_CONSTRAINT_TEX_MATRIX; 27: #endif 28: uniform vec2 oe_tile_elevTexelCoeff; 29: #ifdef OE_IS_DEPTH_CAMERA 30: uniform mat4 oe_shadowToPrimaryMatrix; 31: #endif 32: // SDK functions: 33: float oe_terrain_getElevation(in vec2 uv); 34: // Vertex Markers: 35: #define VERTEX_VISIBLE 1 36: #define VERTEX_BOUNDARY 2 37: #define VERTEX_HAS_ELEVATION 4 38: #define VERTEX_SKIRT 8 39: #define VERTEX_CONSTRAINT 16 40: #ifdef OE_ELEVATION_CONSTRAINT_TEX 41: void moveToConstraint(in vec4 vertex, in vec4 layer_tilec, out vec4 newVertex, out vec4 new_layer_tilec) 42: { 43: // Don't constrain edges 44: if (any(equal(layer_tilec.st, vec2(0))) 45: || any(equal(layer_tilec.st, vec2(1))) 46: || OE_ELEVATION_CONSTRAINT_TEX_MATRIX[0][0] < .5) 47: { 48: newVertex = vertex; 49: new_layer_tilec = layer_tilec; 50: return; 51: } 52: vec2 elevc = layer_tilec.xy 53: * oe_tile_elevTexelCoeff.x * OE_ELEVATION_CONSTRAINT_TEX_MATRIX[0][0] // scale 54: + oe_tile_elevTexelCoeff.x * OE_ELEVATION_CONSTRAINT_TEX_MATRIX[3].st // bias 55: + oe_tile_elevTexelCoeff.y; 56: float tcMixer = 1.0; 57: vec4 dir = texture(OE_ELEVATION_CONSTRAINT_TEX, vec3(elevc, 0.0)); 58: if (OE_ELEVATION_CONSTRAINT_TEX_MATRIX[0][0] == 1.0) 59: { 60: vec4 dirInParent = texture(OE_ELEVATION_CONSTRAINT_TEX, vec3(elevc, 1.0)); 61: dir = mix(dir, dirInParent, oe_rex_morphFactor); 62: tcMixer = mix(1.0, 2.0, oe_rex_morphFactor); 63: } 64: else 65: { 66: tcMixer = 1.0/OE_ELEVATION_CONSTRAINT_TEX_MATRIX[0][0]; 67: } 68: newVertex = vertex; 69: newVertex.xy += dir.xy; 70: new_layer_tilec = layer_tilec; 71: new_layer_tilec.xy += dir.zw * tcMixer; 72: } 73: #else 74: void moveToConstraint(in vec4 vertex, in vec4 layer_tilec, out vec4 newVertex, out vec4 new_layer_tilec) 75: { 76: newVertex = vertex; 77: new_layer_tilec = layer_tilec; 78: } 79: #endif 80: // Compute a morphing factor based on model-space inputs: 81: float oe_rex_ComputeMorphFactor(in vec4 position, in vec3 up) 82: { 83: // Find the would be position of the vertex (the position the vertex would 84: // assume with no morphing) 85: vec4 wouldBePosition = position; 86: #ifdef OE_TERRAIN_RENDER_ELEVATION 87: float elev = oe_terrain_getElevation( oe_layer_tilec.st ); 88: wouldBePosition.xyz += upelev; 89: #endif 90: vec4 wouldBePositionView = gl_ModelViewMatrix * wouldBePosition; 91: #ifdef OE_IS_DEPTH_CAMERA 92: // For a depth camera, we have to compute the morphed position 93: // from the perspective of the primary camera so they match up: 94:>>> wouldBePositionView = oe_shadowToPrimaryMatrix * wouldBePositionView; 95: #endif 96: float fDistanceToEye = length(wouldBePositionView.xyz); // or just -z. 97: float fMorphLerpK = 1.0f - clamp( oe_tile_morph[0] - fDistanceToEye * oe_tile_morph[1], 0.0, 1.0 ); 98: return fMorphLerpK; 99: } 100: // In the transition from an LOD to the next lower LOD, morphing moves 101: // tile grid points that will disappear towards grid points that exist 102: // in the lower LOD. When the transition is complete 103: // (oe_rex_morphFactor == 1.0), those points are coincident. If we 104: // consider grid points numbered on x,y from 0 to tilesize - 1, then 105: // the points that survive have even x,y indices and don't move. The 106: // neighbor vertex coordinates and normals are passed in as vertex 107: // attributes, but the neighbor texture coordinates are calculated 108: // here. 109: // 110: // XXX constraints 111: void oe_rex_morph(inout vec4 vertexModel) 112: { 113: // compute the morphing factor to send down the pipe. 114: // we need this even if vertex-morphing is off since we use it for 115: // other things (like image blending) 116: if ((oe_terrain_vertexMarker & VERTEX_CONSTRAINT) == 0) 117: { 118: oe_rex_morphFactor = oe_rex_ComputeMorphFactor(vertexModel, vp_Normal); 119: #ifdef OE_TERRAIN_MORPH_GEOMETRY 120: vec4 neighborVertexModel = vec4(gl_MultiTexCoord1.xyz, 1.0); 121: vec3 neighborNormal = gl_MultiTexCoord2.xyz; 122: float halfSize = (0.5oe_tile_size)-0.5; 123: float twoOverHalfSize = 2.0/(oe_tile_size-1.0); 124: // Either 0 if point should not be morphed (in (x, y)), or the 125: // delta to the neighbor point. 126: vec2 fractionalPart = fract(oe_layer_tilec.st * halfSize) * twoOverHalfSize; 127: vec4 neighbor_tilec = oe_layer_tilec; 128: neighbor_tilec.st = clamp(oe_layer_tilec.st - fractionalPart, 0.0, 1.0); 129: // oe_layer_tilec.st = clamp(oe_layer_tilec.st - (fractionalPart * oe_rex_morphFactor), 0.0, 1.0); 130: vec4 newVertexModel, new_tilec; 131: moveToConstraint(vertexModel, oe_layer_tilec, newVertexModel, new_tilec); 132: vec4 newNeighborVertexModel, new_neighbor_tilec; 133: moveToConstraint(neighborVertexModel, neighbor_tilec, newNeighborVertexModel, new_neighbor_tilec); 134: // morph the vertex: 135: vertexModel.xyz = mix(newVertexModel.xyz, newNeighborVertexModel.xyz, oe_rex_morphFactor); 136: // morph the normal: 137: vp_Normal = normalize(mix(vp_Normal, neighborNormal, oe_rex_morphFactor)); 138: oe_layer_tilec.st = mix(new_tilec.st, new_neighbor_tilec.st, oe_rex_morphFactor); 139: #endif 140: } 141: else 142: { 143: oe_rex_morphFactor = 0.0; 144: } 145: }

[osgEarth]* SHADER main(vertex) infolog errors: 0: #version 460 1: #extension GL_ARB_gpu_shader_int64 : enable 2: #pragma vp_name VP Vertex Shader Main 3: // Vertex stage globals: 4: int oe_terrain_vertexMarker; 5: float oe_layer_opacity; 6: float oe_rex_morphFactor; 7: vec2 oe_layer_texc; 8: vec2 oe_layer_texcParent; 9: vec2 oe_normalMapCoords; 10: vec3 oe_UpVectorView; 11: vec3 oe_normalMapBinormal; 12: vec3 vp_Normal; 13: vec3 vp_VertexView; 14: vec4 oe_layer_tilec; 15: vec4 vp_Color; 16: vec4 vp_Vertex; 17: // Vertex stage outputs: 18: out VP_PerVertex { 19: flat int oe_terrain_vertexMarker; 20: float oe_layer_opacity; 21: float oe_rex_morphFactor; 22: vec2 oe_layer_texc; 23: vec2 oe_layer_texcParent; 24: vec2 oe_normalMapCoords; 25: vec3 oe_UpVectorView; 26: vec3 oe_normalMapBinormal; 27: vec3 vp_Normal; 28: vec3 vp_VertexView; 29: vec4 oe_layer_tilec; 30: vec4 vp_Color; 31: vec4 vp_Vertex; 32: } vp_out; 33: // Function declarations: 34: void oe_rex_init_model(inout vec4); 35: void oe_rex_morph(inout vec4); 36: void oe_VisibleLayer_initOpacity(inout vec4); 37: void oe_rex_init_view(inout vec4); 38: void oe_rex_applyElevation(inout vec4); 39: void oe_rex_imageLayer_VS(inout vec4); 40: void oe_rex_normalMapVS(inout vec4); 41: void oe_ClipPlane_vs(inout vec4); 42: void oe_logDepth_vert(inout vec4); 43: void main(void) 44: { 45: vp_Vertex = gl_Vertex; 46: vp_Normal = gl_Normal; 47: vp_Color = gl_Color; 48: oe_rex_init_model(vp_Vertex); 49: oe_rex_morph(vp_Vertex); 50:>>> oe_VisibleLayer_initOpacity(vp_Vertex); 51: vp_Vertex = gl_ModelViewMatrix * vp_Vertex; 52: vp_Normal = normalize(gl_NormalMatrix * vp_Normal); 53: vp_VertexView = vp_Vertex.xyz; 54: oe_rex_init_view(vp_Vertex); 55: oe_rex_applyElevation(vp_Vertex); 56: oe_rex_imageLayer_VS(vp_Vertex); 57: oe_rex_normalMapVS(vp_Vertex); 58: oe_ClipPlane_vs(vp_Vertex); 59: vp_Vertex = gl_ProjectionMatrix * vp_Vertex; 60: oe_logDepth_vert(vp_Vertex); 61: gl_Position = vp_Vertex; 62: vp_out.oe_terrain_vertexMarker = oe_terrain_vertexMarker; 63: vp_out.oe_layer_opacity = oe_layer_opacity; 64: vp_out.oe_rex_morphFactor = oe_rex_morphFactor; 65: vp_out.oe_layer_texc = oe_layer_texc; 66: vp_out.oe_layer_texcParent = oe_layer_texcParent; 67: vp_out.oe_normalMapCoords = oe_normalMapCoords; 68: vp_out.oe_UpVectorView = oe_UpVectorView; 69: vp_out.oe_normalMapBinormal = oe_normalMapBinormal; 70: vp_out.vp_Normal = vp_Normal; 71: vp_out.vp_VertexView = vp_VertexView; 72: vp_out.oe_layer_tilec = oe_layer_tilec; 73: vp_out.vp_Color = vp_Color; 74: vp_out.vp_Vertex = vp_Vertex; 75: }

nebsar avatar Apr 07 '22 01:04 nebsar

I'm seeing these errors as well on running the latest master.

I'm building with vcpkg on Windows and Visual Studio 2017. I'm also not building OpenSceneGraph explicitly which is built in vcpkg.

If memory serves, this has to do with CMake settings and turning off certain CMake variables for OpenSceneGraph and how shaders are used. Since I'm using vcpkg, not sure how to do this in the OSG.

Here's a discussion that is probably related to this problem... https://github.com/gwaldron/osgearth/issues/1227

-S

On 04/06/2022 7:18 PM Nebi Sarikaya ***@***.***> wrote:




I get the following shader errors with the latest master.

[osgEarth] [Capabilities] Capabilities:
[osgEarth] [Capabilities] osgEarth Version: 3.2.0 build 132
[osgEarth] [Capabilities] OSG Version: 3.6.5
[osgEarth] [Capabilities] GDAL Version: 3.4.1
[osgEarth] [Capabilities] GEOS Version: 3.10.0
[osgEarth] [Capabilities] GPU Vendor: Intel
[osgEarth] [Capabilities] GPU Renderer: Intel(R) UHD Graphics
[osgEarth] [Capabilities] GL/Driver Version: 4.6.0 - Build 30.0.101.1122 (460)
[osgEarth] [Capabilities] GL Core Profile: no

VERTEX glCompileShader "oe_logDepth_vert" FAILED
VERTEX Shader "oe_logDepth_vert" infolog:
WARNING: 0:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported
WARNING: 0:4: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported
ERROR: 0:10: 'gl_ProjectionMatrix' : undeclared identifier
ERROR: 0:10: 'gl_ProjectionMatrix' : left of '[' is not of type array, matrix, or vector
ERROR: 0:10: '' : left of '[' is not of type array, matrix, or vector
ERROR: 0:13: 'inverse' : no matching overloaded function found (using implicit conversion)
ERROR: 0:13: 'inverse' : function is not known
ERROR: 0:12: '=' : cannot convert from 'const float' to '4X4 matrix of highp float'

VERTEX Shader "oe_logDepth_vert" infolog:
WARNING: 0:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported
WARNING: 0:4: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported
ERROR: 0:10: 'gl_ProjectionMatrix' : undeclared identifier
ERROR: 0:10: 'gl_ProjectionMatrix' : left of '[' is not of type array, matrix, or vector
ERROR: 0:10: '' : left of '[' is not of type array, matrix, or vector
ERROR: 0:13: 'inverse' : no matching overloaded function found (using implicit conversion)
ERROR: 0:13: 'inverse' : function is not known
ERROR: 0:12: '=' : cannot convert from 'const float' to '4X4 matrix of highp float'

VERTEX Shader "oe_logDepth_vert" infolog:
WARNING: 0:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported
WARNING: 0:4: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported
ERROR: 0:10: 'gl_ProjectionMatrix' : undeclared identifier
ERROR: 0:10: 'gl_ProjectionMatrix' : left of '[' is not of type array, matrix, or vector
ERROR: 0:10: '' : left of '[' is not of type array, matrix, or vector
ERROR: 0:13: 'inverse' : no matching overloaded function found (using implicit conversion)
ERROR: 0:13: 'inverse' : function is not known
ERROR: 0:12: '=' : cannot convert from 'const float' to '4X4 matrix of highp float'

VERTEX glCompileShader "oe_rex_init_model" FAILED
VERTEX Shader "oe_rex_init_model" infolog:
WARNING: 0:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported
WARNING: 0:4: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported
ERROR: 0:26: 'gl_MultiTexCoord0' : undeclared identifier
ERROR: 0:26: 'assign' : cannot convert from 'highp float' to '4-component vector of highp float'

VERTEX glCompileShader "oe_rex_init_model" FAILED
VERTEX glCompileShader "oe_rex_init_model" FAILED
VERTEX Shader "oe_rex_normalMapVS" infolog:
WARNING: 2:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported
WARNING: 2:4: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported
ERROR: 2:34: 'gl_NormalMatrix' : undeclared identifier

VERTEX Shader "oe_rex_normalMapVS" infolog:
WARNING: 2:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported
WARNING: 2:4: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported
ERROR: 2:34: 'gl_NormalMatrix' : undeclared identifier

ROR: 0:26: 'assign' : cannot convert from 'highp float' to '4-component vector of highp float'

VERTEX glCompileShader "oe_rex_morph" FAILED
VERTEX Shader "oe_rex_morph" infolog:
WARNING: 2:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported
WARNING: 2:4: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported
ERROR: 2:91: 'gl_ModelViewMatrix' : undeclared identifier
ERROR: 2:121: 'gl_MultiTexCoord1' : undeclared identifier
ERROR: 2:121: 'xyz' : vector field selection out of range
ERROR: 2:122: 'constructor' : not enough data provided for construction
ERROR: 2:122: 'gl_MultiTexCoord2' : undeclared identifier
ERROR: 2:122: 'xyz' : vector field selection out of range
ERROR: 2:122: '=' : cannot convert from 'highp float' to '3-component vector of highp float'

VERTEX Shader "oe_rex_morph" infolog:
WARNING: 2:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported
WARNING: 2:4: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported
ERROR: 2:91: 'gl_ModelViewMatrix' : undeclared identifier
ERROR: 2:121: 'gl_MultiTexCoord1' : undeclared identifier
ERROR: 2:121: 'xyz' : vector field selection out of range
ERROR: 2:122: 'constructor' : not enough data provided for construction
ERROR: 2:122: 'gl_MultiTexCoord2' : undeclared identifier
ERROR: 2:122: 'xyz' : vector field selection out of range
ERROR: 2:122: '=' : cannot convert from 'highp float' to '3-component vector of highp float'

VERTEX Shader "oe_rex_normalMapVS" infolog:
WARNING: 2:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported
WARNING: 2:4: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported
ERROR: 2:34: 'gl_NormalMatrix' : undeclared identifier

VERTEX Shader "oe_rex_normalMapVS" infolog:
WARNING: 2:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported
WARNING: 2:4: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported
ERROR: 2:34: 'gl_NormalMatrix' : undeclared identifier

VERTEX Shader "main(vertex)" infolog:
WARNING: 0:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported
ERROR: 0:50: 'gl_Vertex' : undeclared identifier
ERROR: 0:50: 'assign' : cannot convert from 'highp float' to '4-component vector of highp float'
ERROR: 0:51: 'gl_Normal' : undeclared identifier
ERROR: 0:51: 'assign' : cannot convert from 'highp float' to '3-component vector of highp float'
ERROR: 0:52: 'gl_Color' : undeclared identifier
ERROR: 0:52: 'assign' : cannot convert from 'highp float' to '4-component vector of highp float'
ERROR: 0:56: 'gl_ModelViewMatrix' : undeclared identifier
ERROR: 0:57: 'gl_NormalMatrix' : undeclared identifier
ERROR: 0:64: 'gl_ProjectionMatrix' : undeclared identifier

VERTEX Shader "main(vertex)" infolog:
WARNING: 0:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported
ERROR: 0:50: 'gl_Vertex' : undeclared identifier
ERROR: 0:50: 'assign' : cannot convert from 'highp float' to '4-component vector of highp float'
ERROR: 0:51: 'gl_Normal' : undeclared identifier
ERROR: 0:51: 'assign' : cannot convert from 'highp float' to '3-component vector of highp float'
ERROR: 0:52: 'gl_Color' : undeclared identifier
ERROR: 0:52: 'assign' : cannot convert from 'highp float' to '4-component vector of highp float'
ERROR: 0:56: 'gl_ModelViewMatrix' : undeclared identifier
ERROR: 0:57: 'gl_NormalMatrix' : undeclared identifier
ERROR: 0:64: 'gl_ProjectionMatrix' : undeclared identifier

glLinkProgram VERTEX Shader VERTEX Shader "oe_rex_morph" infolog:
WARNING: 2:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported
WARNING: 2:4: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported
ERROR: 2:91: 'gl_ModelViewMatrix' : undeclared identifier
ERROR: 2:121: 'gl_MultiTexCoord1' : undeclared identifier
ERROR: 2:121: 'xyz' : vector field selection out of range
ERROR: 2:122: 'constructor' : not enough data provided for construction
ERROR: 2:122: 'gl_MultiTexCoord2' : undeclared identifier
ERROR: 2:122: 'xyz' : vector field selection out of range
ERROR: 2:122: '=' : cannot convert from 'highp float' to '3-component vector of highp float'

Program "WMSImageLayer" infolog:
Attached vertex shader is not compiled.

[osgEarth]* [VirtualProgram] Program will not link!
VERTEX glCompileShader "main(vertex)" FAILED
VERTEX Shader "main(vertex)" infolog:
WARNING: 0:3: '#extension' : 'GL_ARB_gpu_shader_int64' is not supported
ERROR: 0:50: 'gl_Vertex' : undeclared identifier
ERROR: 0:50: 'assign' : cannot convert from 'highp float' to '4-component vector of highp float'
ERROR: 0:51: 'gl_Normal' : undeclared identifier
ERROR: 0:51: 'assign' : cannot convert from 'highp float' to '3-component vector of highp float'
ERROR: 0:52: 'gl_Color' : undeclared identifier
ERROR: 0:52: 'assign' : cannot convert from 'highp float' to '4-component vector of highp float'
ERROR: 0:56: 'gl_ModelViewMatrix' : undeclared identifier
ERROR: 0:57: 'gl_NormalMatrix' : undeclared identifier
ERROR: 0:64: 'gl_ProjectionMatrix' : undeclared identifier

glLinkProgram 000001EEA92824E0"WMSImageLayer" FAILED
Program "WMSImageLayer" infolog:
Attached vertex shader is not compiled.

[osgEarth]* [VirtualProgram] Program will not link!

—
Reply to this email directly, view it on GitHub https://github.com/gwaldron/osgearth/issues/2025#issuecomment-1090979986 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ATC464OY5D5SPFGLLLDVWKLVDYZXLANCNFSM5RO5WQVQ .
You are receiving this because you were mentioned.Message ID: ***@***.***>

keince avatar Apr 08 '22 17:04 keince

Try grabbing the master osgearth and seeing if that fixes your issue. The issue is that the vcpkg osg isn't built with GL3 enabled. I'm working on a patch for that here: https://github.com/microsoft/vcpkg/pull/24026 In the meantime I added a change to osgearth that should get you up and running with the vcpkg version of osg.

jasonbeverage avatar Apr 08 '22 18:04 jasonbeverage

Thanks Jason. I'll give it a try...

-S

On 04/08/2022 12:04 PM Jason Beverage ***@***.***> wrote:




Try grabbing the master osgearth and seeing if that fixes your issue. The issue is that the vcpkg osg isn't built with GL3 enabled. I'm working on a patch for that here: microsoft/vcpkg#24026 https://github.com/microsoft/vcpkg/pull/24026
In the meantime I added a change to osgearth that should get you up and running with the vcpkg version of osg.

—
Reply to this email directly, view it on GitHub https://github.com/gwaldron/osgearth/issues/2025#issuecomment-1093146663 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ATC464MQTTJN2LMIT7O4KLDVEBYJTANCNFSM5RO5WQVQ .
You are receiving this because you were mentioned.Message ID: ***@***.***>

keince avatar Apr 08 '22 18:04 keince

Thank you Jason.

nebsar avatar Apr 08 '22 18:04 nebsar

So...I pulled master today and rebuilt. It runs without the aforementioned shader errors but now I'm seeing a different problem.

When I run osgearth_viewer annotation.earth it displays the readymap earth and annotations for a second and then quits for no reason. All other earth files load and run fine.

There are no reported errors on the console with OSGEARTH_NOTIFY_LEVEL=INFO set.

keince avatar Apr 09 '22 00:04 keince

So...I pulled master today and rebuilt. It runs without the aforementioned shader errors but now I'm seeing a different problem.

When I run osgearth_viewer annotation.earth it displays the readymap earth and annotations for a second and then quits for no reason. All other earth files load and run fine.

There are no reported errors on the console with OSGEARTH_NOTIFY_LEVEL=INFO set.

Same things happens to me. I try to run osgearth_annotations example and it shows up. After 1-2 seconds, it quits with no reason.

nebsar avatar Apr 09 '22 00:04 nebsar

Ok, I managed to build OSG with GL3 support and then build the master branch osgearth successfully. Everything seems to work fine. But I get shaderpipline disabled message on the console as below. By the way, I do not have any idea why the "Fontconfig error" started to show up. The font path seems correct. I know this is an osg question. But there is no answer to the question in osg forum. Any ideas?

GL3: Non-GL3 version number: 1.0 void StateSet::setGlobalDefaults() ShaderPipeline disabled.

Here is the version output: Fontconfig error: Cannot load default config file: No such file: (null) Error reading file C:/WINDOWS/fonts\mingliub.ttc: file not handled GL3: Non-GL3 version number: 1.0 [osgEarth] [Capabilities] Capabilities: [osgEarth] [Capabilities] osgEarth Version: 3.2.0 build 132 [osgEarth] [Capabilities] OSG Version: 3.7.0 [osgEarth] [Capabilities] GDAL Version: 3.4.1 [osgEarth] [Capabilities] GEOS Version: 3.10.0 [osgEarth] [Capabilities] GPU Vendor: Intel [osgEarth] [Capabilities] GPU Renderer: Intel(R) UHD Graphics [osgEarth] [Capabilities] GL/Driver Version: 4.6.0 - Build 30.0.101.1122 (460) [osgEarth] [Capabilities] GL Core Profile: no

nebsar avatar Apr 09 '22 09:04 nebsar

I tried other examples and some of them do not work properly because of the shader errors. Below message is from osgearth_bindless example:

GL3: Non-GL3 version number: 1.0 void StateSet::setGlobalDefaults() ShaderPipeline disabled. void StateSet::setGlobalDefaults() ShaderPipeline disabled. [osgEarth] Loaded bing.earth GL3: Non-GL3 version number: 1.0 COMPUTE glCompileShader "" FAILED COMPUTE Shader "" infolog: WARNING: 2:3: '#extension' : 'GL_NV_gpu_shader5' is not supported ERROR: 2:18: 'uint64_t' : syntax error syntax error

glLinkProgram 00000219B70BB9B0"" FAILED Program "" infolog: Attached compute shader is not compiled.

[osgEarth]* FATAL ASSERTION FAILURE (initialize @ Chonk.cpp:800) _glMultiDrawElementsIndirectBindlessNV != nullptr ...

nebsar avatar Apr 09 '22 19:04 nebsar

osgearth_picker example has the weird behaviour as in the video.

https://user-images.githubusercontent.com/5169314/162589659-5c6c66d9-a9fb-4170-a78a-2c5d23303771.mp4

nebsar avatar Apr 09 '22 19:04 nebsar

Are you trying to run with --nvgl or --gl4? I'm surprised that you're seeing osgEarth try to go down the NVGL Nvidia only GL path on an Intel graphics card.

jasonbeverage avatar Apr 09 '22 20:04 jasonbeverage

I am not adding any additional arguments other than the earth file and for some examples --sky while running the examples.

nebsar avatar Apr 10 '22 02:04 nebsar

After some research, I come up with the conclusion that, when OSG version 3.7.0 is built against GL3, "ShaderPipeline disabled" problem occurs. And most probably, this yields other shader errors. But I am still not sure. I applied everything in this discussion #1227 while building OSG 3.7.0 (master branch). But it did not help.

By the way, while building OSG from source, if OSG_TEXT_USE_FONTCONFIG is unchecked, "Fontconfig error: Cannot load default config file: No such file: (null)" error goes away.

nebsar avatar Apr 10 '22 05:04 nebsar

The osgearth_bindless example requires an NVIDIA card. I have updated the example to reflect this.

gwaldron avatar Apr 11 '22 12:04 gwaldron

The ShaderPipeline disabled message is probably not an issue. This is a new feature OSG added to let the user customize the default shaders; osgEarth does not make sure of it.

What new shader errors are you getting with your GL3 build?

gwaldron avatar Apr 11 '22 12:04 gwaldron

I've also pushed an update that attempts to detect the int64 extension availability -- you may be getting errors because the ShaderFactory was automatically trying to use this extension. Please grab an update and try again.

And thanks for your continued feedback -- we don't have an Intel GPU to test on atm so this is helpful.

gwaldron avatar Apr 11 '22 13:04 gwaldron

Yes Glenn. I am getting the new shader errors with GL3 build. osgearh_picker example's weird behaviour is also on GL3 build. I will try to run the examples with Nvidia as well. And no problem, as osgEarth has more capabilities with minimum bugs, this will also help me. Thanks.

nebsar avatar Apr 11 '22 13:04 nebsar

If you continue to get shader errors on Intel GPU (with the latest pushes) please post them here. Please use a basic setup (like osgearth_viewer simple.earth) for baseline testing.

gwaldron avatar Apr 11 '22 14:04 gwaldron

Ok I will.

nebsar avatar Apr 11 '22 15:04 nebsar

Here are the latest shader errors and osgEarth configuration info with GL3 built, when I run osgearth_viewer.exe with annotation.earth:

[osgEarth] [Capabilities] Realized graphics window for OpenGL operations. [osgEarth] [Capabilities] Capabilities: [osgEarth] [Capabilities] osgEarth Version: 3.2.0 build 132 [osgEarth] [Capabilities] OSG Version: 3.7.0 [osgEarth] [Capabilities] GDAL Version: 3.4.2 [osgEarth] [Capabilities] GEOS Version: 3.10.0 [osgEarth] [Capabilities] GPU Vendor: Intel [osgEarth] [Capabilities] GPU Renderer: Intel(R) UHD Graphics [osgEarth] [Capabilities] GL/Driver Version: 3.0.0 - Build 30.0.101.1122 (130) [osgEarth] [Capabilities] GL Core Profile: no [osgEarth] [Capabilities] Max GPU texture units = 32 [osgEarth] [Capabilities] Max varyings = 32 [osgEarth] [Capabilities] Max GPU texture coord indices = 8 [osgEarth] [Capabilities] Max GPU attributes = 16 [osgEarth] [Capabilities] Max texture size = 16384 [osgEarth] [Capabilities] GLSL = yes [osgEarth] [Capabilities] GLSL Version = 130 [osgEarth] [Capabilities] Texture arrays = yes [osgEarth] [Capabilities] draw instanced = no [osgEarth] [Capabilities] Texture buffers = yes [osgEarth] [Capabilities] Texture buffer max size = 134217728 [osgEarth] [Capabilities] Compression = ARB S3

Errors:

VERTEX glCompileShader "oe_logDepth_vert" FAILED VERTEX Shader "oe_logDepth_vert" infolog: WARNING: 0:3: '#extension' : 'GL_ARB_gpu_shader4' is not supported ERROR: 0:13: 'inverse' : no matching overloaded function found (using implicit conversion) ERROR: 0:13: 'inverse' : function is not known ERROR: 0:12: '=' : cannot convert from 'const float' to '4X4 matrix of highp float'

VERTEX glCompileShader "main(vertex)" FAILED VERTEX Shader "main(vertex)" infolog: WARNING: 0:3: '#extension' : 'GL_ARB_gpu_shader4' is not supported ERROR: 0:41: 'varying' : cannot be used with a block or a structure

FRAGMENT glCompileShader "main(fragment)" FAILED FRAGMENT Shader "main(fragment)" infolog: WARNING: 0:3: '#extension' : 'GL_ARB_gpu_shader4' is not supported ERROR: 0:23: 'varying' : cannot be used with a block or a structure

glLinkProgram 00000207526F1300"REX image layer" FAILED Program "REX image layer" infolog: Attached fragment shader is not compiled.

[osgEarth]* [VirtualProgram] Program will not link! VERTEX glCompileShader "oe_logDepth_vert" FAILED VERTEX Shader "oe_logDepth_vert" infolog: WARNING: 0:3: '#extension' : 'GL_ARB_gpu_shader4' is not supported ERROR: 0:13: 'inverse' : no matching overloaded function found (using implicit conversion) ERROR: 0:13: 'inverse' : function is not known ERROR: 0:12: '=' : cannot convert from 'const float' to '4X4 matrix of highp float'

VERTEX glCompileShader "main(vertex)" FAILED VERTEX Shader "main(vertex)" infolog: WARNING: 0:3: '#extension' : 'GL_ARB_gpu_shader4' is not supported ERROR: 0:41: 'varying' : cannot be used with a block or a structure

FRAGMENT glCompileShader "main(fragment)" FAILED FRAGMENT Shader "main(fragment)" infolog: WARNING: 0:3: '#extension' : 'GL_ARB_gpu_shader4' is not supported ERROR: 0:23: 'varying' : cannot be used with a block or a structure

glLinkProgram 0000020752763FD0"REX image layer" FAILED Program "REX image layer" infolog: Attached fragment shader is not compiled.

[osgEarth]* [VirtualProgram] Program will not link!

nebsar avatar Apr 13 '22 15:04 nebsar

I think this because when the osg is built with default functions OFF. And Intel HD does not support some shaders. You may see the GL config screenshot while I built the OSG with Cmake GUI in windows.

image

nebsar avatar Apr 13 '22 15:04 nebsar

Another note: If the OSG_GL_CONTEXT_VERSION is set to 3.0 beside the OPENGL_PROFILE as GL3, "GL3: Non-GL3 version number: 1.0" message on the command prompt goes away.

nebsar avatar Apr 13 '22 15:04 nebsar

Try setting your OSG_GL_CONTEXT_VERSION to 3.3, not sure where the 3.0 came from, did you manually set that?

When you build osg you really shouldn't need to set any of those build variables yourself. You should try building osg from the command line and pass in -DOPENGL_PROFILE=GL3 instead. I've got a vcpkg PR out that should hopefully make this easier in the future (https://github.com/microsoft/vcpkg/pull/24108).

You can also try setting the context version via an env var with set OSG_GL_CONTEXT_VERSION=3.3 or set OSG_GL_CONTEXT_VERSION=4.6

jasonbeverage avatar Apr 13 '22 15:04 jasonbeverage

Ok I will do that

nebsar avatar Apr 13 '22 15:04 nebsar

I build OSG from source to include some additional plugins such as fbx, ffmpeg

nebsar avatar Apr 13 '22 15:04 nebsar

Ok. Here is the capabilities info after building the OSG with OSG_GL_CONTEXT_VERSION=3.3. There are no shader errors anymore. But when I run the osgearth_viewer example with boston.earth and when the camera gets close to the Boston city and the buildings started to load, I get the following warning repeatedly:

Warning: detected OpenGL error 'invalid enumerant' at after RenderBin::draw(..)

Capabilities:

[osgEarth] [Capabilities] Realized graphics window for OpenGL operations. [osgEarth] [Capabilities] Capabilities: [osgEarth] [Capabilities] osgEarth Version: 3.2.0 build 132 [osgEarth] [Capabilities] OSG Version: 3.7.0 [osgEarth] [Capabilities] GDAL Version: 3.4.2 [osgEarth] [Capabilities] GEOS Version: 3.10.0 [osgEarth] [Capabilities] GPU Vendor: Intel [osgEarth] [Capabilities] GPU Renderer: Intel(R) UHD Graphics [osgEarth] [Capabilities] GL/Driver Version: 3.3.0 - Build 30.0.101.1122 (330) [osgEarth] [Capabilities] GL Core Profile: yes [osgEarth] [Capabilities] Max GPU texture units = 32 [osgEarth] [Capabilities] Max varyings = 32 [osgEarth] [Capabilities] Max GPU texture coord indices = 8 [osgEarth] [Capabilities] Max GPU attributes = 16 [osgEarth] [Capabilities] Max texture size = 16384 [osgEarth] [Capabilities] GLSL = yes [osgEarth] [Capabilities] GLSL Version = 330 [osgEarth] [Capabilities] Texture arrays = yes [osgEarth] [Capabilities] draw instanced = yes [osgEarth] [Capabilities] Texture buffers = yes [osgEarth] [Capabilities] Texture buffer max size = 134217728 [osgEarth] [Capabilities] Compression = ARB S3

nebsar avatar Apr 13 '22 18:04 nebsar