osgearth_viewer works, but with a simple line of code only a white globe appears. #2418
Unanswered
IngoKleefeld
asked this question in
Support Q&A
Replies: 1 comment
-
Ingo, #include <osgEarth/GLUtils>
...
viewer.setRealizeOperation(new GL3RealizeOperation()); I also recommend you call this function to activate some other helpful features: #include <osgEarth/ExampleResources>
...
MapNodeHelper().configureView(&viewer); Hope this helps :) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am working with osg 3.6.5 (GL2 and not GL3!) and osgEarth 3.5, both created with vcpkg. If I now start osgearth_viewer with a simple earth-file, then everything works.
But if I now use the following lines of code, the earth remains white and I get an error message for the shaders for the Rex engine.
I can see that the tiles load correctly. However, if I now add a 3D model, texts or images via osg, these are displayed correctly. Only the globe itself remains white.
osgEarth::initialize();
// initialize a viewer:
osgViewer::Viewer viewer;
// add a TMS imagery layer:
auto layer = new osgEarth::TMSImageLayer();
layer->setURL("I:/EarthMaps/BlueMarbleNG/tms.xml");
layer->setTMSType("google");
auto mapNode = new MapNode();
mapNode->getMap()->addLayer(layer);
viewer.setSceneData(mapNode);
viewer.setCameraManipulator(new EarthManipulator());
return viewer.run();
For example, this error:
Compiling A :VERTEX source:
1: #version 460
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: }
VERTEX glCompileShader "oe_rex_init_model" FAILED
VERTEX Shader "oe_rex_init_model" infolog:
0(25) : error C7616: global variable gl_MultiTexCoord0 is removed after version 140
osgearth_version --caps
[osgearth warning] [Capabilities] Warning, OpenSceneGraph does not define OSG_GL3_AVAILABLE; the application may not function properly
[osgearth info] [Capabilities] osgEarth Version: 3.5.0 build 149
[osgearth info] [Capabilities] OSG Version: 3.6.5
[osgearth info] [Capabilities] GDAL Version: 3.7.2
[osgearth info] [Capabilities] GPU Vendor: NVIDIA Corporation
[osgearth info] [Capabilities] GPU Renderer: NVIDIA GeForce GTX 980 Ti/PCIe/SSE2
[osgearth info] [Capabilities] GL/Driver Version: 4.6.0 NVIDIA 536.40 (460)
[osgearth info] [Capabilities] GL Core Profile: no
I have already tried it with the master branch, same behavior.
What have I forgotten to set? What is the trick?
Beta Was this translation helpful? Give feedback.
All reactions