Cartographic furniture & styling (3-D)¶
The 3-D (PyVista) tier draws the same cartographic furniture a 2-D map does, plus the lighting and export a
true-3-D scene needs. This notebook walks through the verbs that frame, annotate, light and export a scene —
domain, graticule, scale_bar, north_arrow, attribution, labels, sun/shadows/ambient_occlusion,
bivariate, basemap, export_vector and scene bundles — each explained before it is shown.
Every scene here is built off-screen (headless), with synthetic data, so the notebook runs anywhere with no files and, where a step needs the network, guards it.
import numpy as np
from digitalearth.base.sources import get_source
from digitalearth.three_d import Scene3D
# A synthetic geographic relief over Europe, so the framing and the graticule have lon/lat to work with.
lon = np.linspace(-10.0, 30.0, 40)
lat = np.linspace(35.0, 60.0, 30)
relief = np.add.outer(np.cos(np.radians(lat)), np.sin(np.radians(lon)))
source = get_source(relief, x=lon, y=lat)
scene = Scene3D(off_screen=True, crs=4326)
scene.terrain(source, z_exaggeration=8.0)
scene.screenshot().shape
(768, 1024, 3)
Framing — domain¶
domain points the camera at a named region or an explicit (west, south, east, north) box, reprojected into
the scene's display CRS through pyramids. It frames the view without flattening the relief.
scene.domain("europe")
scene.screenshot().shape
(768, 1024, 3)
Graticule — graticule¶
A latitude/longitude grid, labelled along its edges. lon_step/lat_step (or spacing for a square grid) set
the interval; the lines are reprojected into the display CRS so the grid lies on the data.
scene.graticule(spacing=10.0)
scene.layer_ids
['graticule-1', 'terrain-1']
Scale bar, north arrow, attribution¶
A ground-distance scale bar (which switches the view to orthographic — the only projection it is honest in), a camera-aware north arrow, and a corner credit line, so a rendered scene carries its own context.
scene.scale_bar()
scene.north_arrow()
scene.attribution("© Natural Earth")
scene.screenshot().shape
(768, 1024, 3)
Labels — labels¶
Label a feature collection from one of its columns, each label on a filled halo so it reads against the scene.
import geopandas as gpd
from shapely.geometry import Point
cities = gpd.GeoDataFrame(
{"name": ["Paris", "Berlin", "Madrid"]},
geometry=[Point(2.35, 48.85), Point(13.4, 52.52), Point(-3.7, 40.42)],
crs=4326,
)
scene.labels(cities, "name")
scene.layer_ids
['graticule-1', 'terrain-1', 'labels-1']
Lighting — sun, shadows, ambient_occlusion¶
Rasterization-grade relief shading: a directional sun placed by azimuth and elevation, plus cast shadows and ambient occlusion. (This is not path tracing — VTK is a rasterizer — but it gives relief real depth.)
scene.sun(azimuth=135.0, elevation=25.0)
scene.shadows()
scene.ambient_occlusion()
scene.screenshot().shape
2026-11-28 16:30:35.297 ( 1.746s) [ 7E435A4C8780] vtkShaderProgram.cxx:1282 ERR| vtkShaderProgram (0x60d19ef479e0): 1: #version 150
2: #ifdef GL_ES
3: #ifdef GL_FRAGMENT_PRECISION_HIGH
4: precision highp float;
5: precision highp sampler2D;
6: precision highp sampler3D;
7: #else
8: precision mediump float;
9: precision mediump sampler2D;
10: precision mediump sampler3D;
11: #endif
12: #define texelFetchBuffer texelFetch
13: #define texture1D texture
14: #define texture2D texture
15: #define texture3D texture
16: #else // GL_ES
17: #define highp
18: #define mediump
19: #define lowp
20: #if __VERSION__ >= 150
21: #define texelFetchBuffer texelFetch
22: #define texture1D texture
23: #define texture2D texture
24: #define texture3D texture
25: #endif
26: #endif // GL_ES
27: #define varying in
28:
29:
30: // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
31: // SPDX-License-Identifier: BSD-3-Clause
32: // Template for the polydata mappers fragment shader
33:
34: uniform int PrimitiveIDOffset;
35:
36:
37:
38: // VC position of this fragment
39: //VTK::PositionVC::Dec
40:
41: // Camera prop
42: uniform int cameraParallel;
43:
44:
45: // optional color passed in from the vertex shader, vertexColor
46: uniform float ambientIntensity; // the material ambient
47: uniform float diffuseIntensity; // the material diffuse
48: uniform float opacityUniform; // the fragment opacity
49: uniform vec3 ambientColorUniform; // ambient color
50: uniform vec3 diffuseColorUniform; // diffuse color
51:
52:
53: // optional surface normal declaration
54: //VTK::Normal::Dec
55:
56: // extra lighting parameters
57: uniform vec3 lightColor0;
58: uniform vec3 lightDirectionVC0; // normalized
59:
60: uniform float depthC;
61: vec2 calcShadow(in vec4 vert,
62: in sampler2D shadowMap,
63: in mat4 shadowTransform,
64: in float attenuation,
65: in int shadowParallel,
66: in float sNearZ, in float sFarZ)
67: {
68: vec4 shadowCoord = shadowTransform*vert;
69: float expFactor = 8.0;
70: float thickness = 0.0;
71: if(shadowCoord.w > 0.0)
72: {
73: vec2 projected = shadowCoord.xy/shadowCoord.w;
74: if(projected.x >= 0.0 && projected.x <= 1.0
75: && projected.y >= 0.0 && projected.y <= 1.0)
76: {
77: float ldepth = shadowCoord.z;
78: if (shadowParallel == 0) { ldepth = (shadowCoord.w - sNearZ)/(sFarZ - sNearZ); }
79: float depthCExpActual = exp(- depthC*ldepth);
80: float depthCExpBlured = texture2D(shadowMap,projected).r;
81: expFactor = depthCExpBlured * depthCExpActual;
82: float depth = log(depthCExpBlured)/depthC;
83: thickness = clamp(ldepth - depth, 0.0, 1.0)*(sFarZ - sNearZ);
84: if (expFactor > 1.0) { expFactor = 1.0; }
85: }
86: }
87: return vec2(1.0 - attenuation + attenuation*expFactor, thickness);
88: }
89: uniform int shadowParallel0;
90: uniform float shadowNearZ0;
91: uniform float shadowFarZ0;
92: uniform float shadowAttenuation0;
93: uniform sampler2D shadowMap0;
94: uniform mat4 shadowTransform0;
95:
96:
97: // Texture maps
98: //VTK::TMap::Dec
99:
100: // Texture coordinates
101: //VTK::TCoord::Dec
102:
103: // picking support
104: //VTK::Picking::Dec
105:
106: // Depth Peeling Support
107: //VTK::DepthPeeling::Dec
108:
109: // clipping plane vars
110: //VTK::Clip::Dec
111:
112: // the output of this shader
113: out vec4 fragOutput0;
114:
115:
116: // Apple Bug
117: //VTK::PrimID::Dec
118:
119: // handle coincident offsets
120: //VTK::Coincident::Dec
121:
122: // Value raster
123: //VTK::ValuePass::Dec
124:
125: // surface with edges
126: //VTK::Edges::Dec
127:
128: void main()
129: {
130: // VC position of this fragment. This should not branch/return/discard.
131: //VTK::PositionVC::Impl
132:
133: // Place any calls that require uniform flow (e.g. dFdx) here.
134: //VTK::UniformFlow::Impl
135:
136: // Set gl_FragDepth here (gl_FragCoord.z by default)
137: //VTK::Depth::Impl
138:
139: // Early depth peeling abort:
140: //VTK::DepthPeeling::PreColor
141:
142: // Apple Bug
143: //VTK::PrimID::Impl
144:
145: //VTK::Clip::Impl
146:
147: //VTK::ValuePass::Impl
148:
149: vec3 ambientColor = ambientIntensity * ambientColorUniform;
150: vec3 diffuseColor = diffuseIntensity * diffuseColorUniform;
151: float opacity = opacityUniform;
152:
153:
154: //VTK::Edges::Impl
155:
156: // Generate the normal if we are not passed in one
157: //VTK::Normal::Impl
158:
159: //VTK::PBR::Impl
160:
161: vec2 factor0 = calcShadow(vertexVC, shadowMap0, shadowTransform0, shadowAttenuation0, shadowParallel0, shadowNearZ0, shadowFarZ0);
162: fragOutput0 = vec4(ambientColor + diffuseColor, opacity);
163: //VTK::Light::Impl
164:
165:
166:
167: //VTK::TCoord::Impl
168:
169: if (fragOutput0.a <= 0.0)
170: {
171: discard;
172: }
173:
174: //VTK::DepthPeeling::Impl
175:
176: //VTK::Picking::Impl
177:
178: // handle coincident offsets
179: //VTK::Coincident::Impl
180: }
ERROR:root:1: #version 150
2: #ifdef GL_ES
3: #ifdef GL_FRAGMENT_PRECISION_HIGH
4: precision highp float;
5: precision highp sampler2D;
6: precision highp sampler3D;
7: #else
8: precision mediump float;
9: precision mediump sampler2D;
10: precision mediump sampler3D;
11: #endif
12: #define texelFetchBuffer texelFetch
13: #define texture1D texture
14: #define texture2D texture
15: #define texture3D texture
16: #else // GL_ES
17: #define highp
18: #define mediump
19: #define lowp
20: #if __VERSION__ >= 150
21: #define texelFetchBuffer texelFetch
22: #define texture1D texture
23: #define texture2D texture
24: #define texture3D texture
25: #endif
26: #endif // GL_ES
27: #define varying in
28:
29:
30: // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
31: // SPDX-License-Identifier: BSD-3-Clause
32: // Template for the polydata mappers fragment shader
33:
34: uniform int PrimitiveIDOffset;
35:
36:
37:
38: // VC position of this fragment
39: //VTK::PositionVC::Dec
40:
41: // Camera prop
42: uniform int cameraParallel;
43:
44:
45: // optional color passed in from the vertex shader, vertexColor
46: uniform float ambientIntensity; // the material ambient
47: uniform float diffuseIntensity; // the material diffuse
48: uniform float opacityUniform; // the fragment opacity
49: uniform vec3 ambientColorUniform; // ambient color
50: uniform vec3 diffuseColorUniform; // diffuse color
51:
52:
53: // optional surface normal declaration
54: //VTK::Normal::Dec
55:
56: // extra lighting parameters
57: uniform vec3 lightColor0;
58: uniform vec3 lightDirectionVC0; // normalized
59:
60: uniform float depthC;
61: vec2 calcShadow(in vec4 vert,
62: in sampler2D shadowMap,
63: in mat4 shadowTransform,
64: in float attenuation,
65: in int shadowParallel,
66: in float sNearZ, in float sFarZ)
67: {
68: vec4 shadowCoord = shadowTransform*vert;
69: float expFactor = 8.0;
70: float thickness = 0.0;
71: if(shadowCoord.w > 0.0)
72: {
73: vec2 projected = shadowCoord.xy/shadowCoord.w;
74: if(projected.x >= 0.0 && projected.x <= 1.0
75: && projected.y >= 0.0 && projected.y <= 1.0)
76: {
77: float ldepth = shadowCoord.z;
78: if (shadowParallel == 0) { ldepth = (shadowCoord.w - sNearZ)/(sFarZ - sNearZ); }
79: float depthCExpActual = exp(- depthC*ldepth);
80: float depthCExpBlured = texture2D(shadowMap,projected).r;
81: expFactor = depthCExpBlured * depthCExpActual;
82: float depth = log(depthCExpBlured)/depthC;
83: thickness = clamp(ldepth - depth, 0.0, 1.0)*(sFarZ - sNearZ);
84: if (expFactor > 1.0) { expFactor = 1.0; }
85: }
86: }
87: return vec2(1.0 - attenuation + attenuation*expFactor, thickness);
88: }
89: uniform int shadowParallel0;
90: uniform float shadowNearZ0;
91: uniform float shadowFarZ0;
92: uniform float shadowAttenuation0;
93: uniform sampler2D shadowMap0;
94: uniform mat4 shadowTransform0;
95:
96:
97: // Texture maps
98: //VTK::TMap::Dec
99:
100: // Texture coordinates
101: //VTK::TCoord::Dec
102:
103: // picking support
104: //VTK::Picking::Dec
105:
106: // Depth Peeling Support
107: //VTK::DepthPeeling::Dec
108:
109: // clipping plane vars
110: //VTK::Clip::Dec
111:
112: // the output of this shader
113: out vec4 fragOutput0;
114:
115:
116: // Apple Bug
117: //VTK::PrimID::Dec
118:
119: // handle coincident offsets
120: //VTK::Coincident::Dec
121:
122: // Value raster
123: //VTK::ValuePass::Dec
124:
125: // surface with edges
126: //VTK::Edges::Dec
127:
128: void main()
129: {
130: // VC position of this fragment. This should not branch/return/discard.
131: //VTK::PositionVC::Impl
132:
133: // Place any calls that require uniform flow (e.g. dFdx) here.
134: //VTK::UniformFlow::Impl
135:
136: // Set gl_FragDepth here (gl_FragCoord.z by default)
137: //VTK::Depth::Impl
138:
139: // Early depth peeling abort:
140: //VTK::DepthPeeling::PreColor
141:
142: // Apple Bug
143: //VTK::PrimID::Impl
144:
145: //VTK::Clip::Impl
146:
147: //VTK::ValuePass::Impl
148:
149: vec3 ambientColor = ambientIntensity * ambientColorUniform;
150: vec3 diffuseColor = diffuseIntensity * diffuseColorUniform;
151: float opacity = opacityUniform;
152:
153:
154: //VTK::Edges::Impl
155:
156: // Generate the normal if we are not passed in one
157: //VTK::Normal::Impl
158:
159: //VTK::PBR::Impl
160:
161: vec2 factor0 = calcShadow(vertexVC, shadowMap0, shadowTransform0, shadowAttenuation0, shadowParallel0, shadowNearZ0, shadowFarZ0);
162: fragOutput0 = vec4(ambientColor + diffuseColor, opacity);
163: //VTK::Light::Impl
164:
165:
166:
167: //VTK::TCoord::Impl
168:
169: if (fragOutput0.a <= 0.0)
170: {
171: discard;
172: }
173:
174: //VTK::DepthPeeling::Impl
175:
176: //VTK::Picking::Impl
177:
178: // handle coincident offsets
179: //VTK::Coincident::Impl
180: }
2026-11-28 16:30:35.299 ( 1.748s) [ 7E435A4C8780] vtkShaderProgram.cxx:1283 ERR| vtkShaderProgram (0x60d19ef479e0): 0:161(28): error: `vertexVC' undeclared
0:161(17): error: no matching function for call to `calcShadow(error, sampler2D, mat4, float, int, float, float)'; candidates are:
0:161(17): error: vec2 calcShadow(vec4, sampler2D, mat4, float, int, float, float)
ERROR:root:0:161(28): error: `vertexVC' undeclared
0:161(17): error: no matching function for call to `calcShadow(error, sampler2D, mat4, float, int, float, float)'; candidates are:
0:161(17): error: vec2 calcShadow(vec4, sampler2D, mat4, float, int, float, float)
ERROR:root:Could not set shader program
2026-11-28 16:30:35.299 ( 1.749s) [ 7E435A4C8780]vtkOpenGLPolyDataMapper:2771 ERR| vtkOpenGLPolyDataMapper (0x60d19e371420): Could not set shader program
2026-11-28 16:30:35.300 ( 1.750s) [ 7E435A4C8780]vtkOpenGLVertexArrayObj:262 ERR| vtkOpenGLVertexArrayObject (0x60d19e5c4110): attempt to add attribute without a bound program for attribute vertexMC
ERROR:root:attempt to add attribute without a bound program for attribute vertexMC
ERROR:root:Error setting 'vertexMC' in shader VAO.
2026-11-28 16:30:35.301 ( 1.751s) [ 7E435A4C8780]vtkOpenGLVertexBufferOb:267 ERR| vtkOpenGLVertexBufferObjectGroup (0x60d19e333020): Error setting 'vertexMC' in shader VAO.
(768, 1024, 3)
Bivariate styling — bivariate¶
Two variables encoded as one colour from an n×n matrix: each variable is cut into classes by the shared classifier, and the class pair picks a colour. The classification is engine-neutral; the tier drapes the resulting image on a ground plane.
a = np.add.outer(np.linspace(0.0, 1.0, 30), np.linspace(0.0, 1.0, 40))
b = np.add.outer(np.linspace(1.0, 0.0, 30), np.linspace(0.0, 1.0, 40))
bivariate_scene = Scene3D(off_screen=True)
bivariate_scene.bivariate(a, b)
shape = bivariate_scene.screenshot().shape
bivariate_scene.close()
shape
(768, 1024, 3)
Basemap — basemap¶
Web-map tiles draped under the scene as ground cover. Tiles are Web Mercator, so draw the scene in EPSG:3857 for them to line up. This cell reaches the network, so it is guarded — it renders when a tile server is reachable and reports a skip otherwise.
mercator = Scene3D(off_screen=True, crs=3857)
try:
mercator.basemap("CartoDB.Positron", bbox=(-10.0, 35.0, 30.0, 60.0), zoom=3)
print("basemap drawn:", mercator.layer_ids)
except Exception as error: # offline, or the tile server is unreachable
print("basemap skipped (no network):", type(error).__name__)
finally:
mercator.close()
basemap drawn: ['basemap']
Export — vector graphics and scene bundles¶
export_vector writes the view as SVG/PDF/EPS through VTK's GL2PS exporter (a high-resolution raster master is
screenshot(scale=N)). save_bundle writes the whole scene to a versioned zip — but a bundle stores a
description, so it needs path- or URL-backed data; a scene built from in-memory arrays is refused, which this
cell shows.
import os
import tempfile
folder = tempfile.mkdtemp()
scene.export_vector(os.path.join(folder, "scene.svg"))
print("vector export written:", os.path.exists(os.path.join(folder, "scene.svg")))
try:
scene.save_bundle(os.path.join(folder, "scene.dez"))
except ValueError as error:
print("in-memory scene is not bundleable:", str(error).split(";")[0][:72], "...")
2026-11-28 16:30:35.998 ( 2.448s) [ 7E435A4C8780] vtkOpenGLState.cxx:627 WARN| Attempt to set draw buffers from a Framebuffer Object that is not bound. 2026-11-28 16:30:36.021 ( 2.470s) [ 7E435A4C8780] vtkOpenGLState.cxx:627 WARN| Attempt to set draw buffers from a Framebuffer Object that is not bound. 2026-11-28 16:30:36.090 ( 2.540s) [ 7E435A4C8780] vtkShaderProgram.cxx:1282 ERR| vtkShaderProgram (0x60d19f726d10): 1: #version 150 2: #ifdef GL_ES 3: #ifdef GL_FRAGMENT_PRECISION_HIGH 4: precision highp float; 5: precision highp sampler2D; 6: precision highp sampler3D; 7: #else 8: precision mediump float; 9: precision mediump sampler2D; 10: precision mediump sampler3D; 11: #endif 12: #define texelFetchBuffer texelFetch 13: #define texture1D texture 14: #define texture2D texture 15: #define texture3D texture 16: #else // GL_ES 17: #define highp 18: #define mediump 19: #define lowp 20: #if __VERSION__ >= 150 21: #define texelFetchBuffer texelFetch 22: #define texture1D texture 23: #define texture2D texture 24: #define texture3D texture 25: #endif 26: #endif // GL_ES 27: #define varying in 28: 29: 30: // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 31: // SPDX-License-Identifier: BSD-3-Clause 32: // Template for the polydata mappers fragment shader 33: 34: uniform int PrimitiveIDOffset; 35: 36: 37: 38: // VC position of this fragment 39: //VTK::PositionVC::Dec 40: 41: // Camera prop 42: uniform int cameraParallel; 43: 44: 45: // optional color passed in from the vertex shader, vertexColor 46: uniform float ambientIntensity; // the material ambient 47: uniform float diffuseIntensity; // the material diffuse 48: uniform float opacityUniform; // the fragment opacity 49: uniform vec3 ambientColorUniform; // ambient color 50: uniform vec3 diffuseColorUniform; // diffuse color 51: 52: 53: // optional surface normal declaration 54: //VTK::Normal::Dec 55: 56: // extra lighting parameters 57: uniform vec3 lightColor0; 58: uniform vec3 lightDirectionVC0; // normalized 59: 60: uniform float depthC; 61: vec2 calcShadow(in vec4 vert, 62: in sampler2D shadowMap, 63: in mat4 shadowTransform, 64: in float attenuation, 65: in int shadowParallel, 66: in float sNearZ, in float sFarZ) 67: { 68: vec4 shadowCoord = shadowTransform*vert; 69: float expFactor = 8.0; 70: float thickness = 0.0; 71: if(shadowCoord.w > 0.0) 72: { 73: vec2 projected = shadowCoord.xy/shadowCoord.w; 74: if(projected.x >= 0.0 && projected.x <= 1.0 75: && projected.y >= 0.0 && projected.y <= 1.0) 76: { 77: float ldepth = shadowCoord.z; 78: if (shadowParallel == 0) { ldepth = (shadowCoord.w - sNearZ)/(sFarZ - sNearZ); } 79: float depthCExpActual = exp(- depthC*ldepth); 80: float depthCExpBlured = texture2D(shadowMap,projected).r; 81: expFactor = depthCExpBlured * depthCExpActual; 82: float depth = log(depthCExpBlured)/depthC; 83: thickness = clamp(ldepth - depth, 0.0, 1.0)*(sFarZ - sNearZ); 84: if (expFactor > 1.0) { expFactor = 1.0; } 85: } 86: } 87: return vec2(1.0 - attenuation + attenuation*expFactor, thickness); 88: } 89: uniform int shadowParallel0; 90: uniform float shadowNearZ0; 91: uniform float shadowFarZ0; 92: uniform float shadowAttenuation0; 93: uniform sampler2D shadowMap0; 94: uniform mat4 shadowTransform0; 95: 96: 97: // Texture maps 98: //VTK::TMap::Dec 99: 100: // Texture coordinates 101: //VTK::TCoord::Dec 102: 103: // picking support 104: //VTK::Picking::Dec 105: 106: // Depth Peeling Support 107: //VTK::DepthPeeling::Dec 108: 109: // clipping plane vars 110: //VTK::Clip::Dec 111: 112: // the output of this shader 113: out vec4 fragOutput0; 114: out vec4 fragOutput1; 115: out vec4 fragOutput2; 116: 117: 118: // Apple Bug 119: //VTK::PrimID::Dec 120: 121: // handle coincident offsets 122: //VTK::Coincident::Dec 123: 124: // Value raster 125: //VTK::ValuePass::Dec 126: 127: // surface with edges 128: //VTK::Edges::Dec 129: 130: void main() 131: { 132: // VC position of this fragment. This should not branch/return/discard. 133: //VTK::PositionVC::Impl 134: 135: // Place any calls that require uniform flow (e.g. dFdx) here. 136: //VTK::UniformFlow::Impl 137: 138: // Set gl_FragDepth here (gl_FragCoord.z by default) 139: //VTK::Depth::Impl 140: 141: // Early depth peeling abort: 142: //VTK::DepthPeeling::PreColor 143: 144: // Apple Bug 145: //VTK::PrimID::Impl 146: 147: //VTK::Clip::Impl 148: 149: //VTK::ValuePass::Impl 150: 151: vec3 ambientColor = ambientIntensity * ambientColorUniform; 152: vec3 diffuseColor = diffuseIntensity * diffuseColorUniform; 153: float opacity = opacityUniform; 154: 155: 156: //VTK::Edges::Impl 157: 158: // Generate the normal if we are not passed in one 159: //VTK::Normal::Impl 160: 161: //VTK::PBR::Impl 162: 163: vec2 factor0 = calcShadow(vertexVC, shadowMap0, shadowTransform0, shadowAttenuation0, shadowParallel0, shadowNearZ0, shadowFarZ0); 164: fragOutput0 = vec4(ambientColor + diffuseColor, opacity); 165: //VTK::Light::Impl 166: 167: 168: fragOutput1 = vec4(0.0, 0.0, 0.0, 0.0); 169: fragOutput2 = vec4(0.0, 0.0, 0.0, 0.0); 170: 171: 172: 173: 174: //VTK::TCoord::Impl 175: 176: if (fragOutput0.a <= 0.0) 177: { 178: discard; 179: } 180: 181: //VTK::DepthPeeling::Impl 182: 183: //VTK::Picking::Impl 184: 185: // handle coincident offsets 186: //VTK::Coincident::Impl 187: } ERROR:root:1: #version 150 2: #ifdef GL_ES 3: #ifdef GL_FRAGMENT_PRECISION_HIGH 4: precision highp float; 5: precision highp sampler2D; 6: precision highp sampler3D; 7: #else 8: precision mediump float; 9: precision mediump sampler2D; 10: precision mediump sampler3D; 11: #endif 12: #define texelFetchBuffer texelFetch 13: #define texture1D texture 14: #define texture2D texture 15: #define texture3D texture 16: #else // GL_ES 17: #define highp 18: #define mediump 19: #define lowp 20: #if __VERSION__ >= 150 21: #define texelFetchBuffer texelFetch 22: #define texture1D texture 23: #define texture2D texture 24: #define texture3D texture 25: #endif 26: #endif // GL_ES 27: #define varying in 28: 29: 30: // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 31: // SPDX-License-Identifier: BSD-3-Clause 32: // Template for the polydata mappers fragment shader 33: 34: uniform int PrimitiveIDOffset; 35: 36: 37: 38: // VC position of this fragment 39: //VTK::PositionVC::Dec 40: 41: // Camera prop 42: uniform int cameraParallel; 43: 44: 45: // optional color passed in from the vertex shader, vertexColor 46: uniform float ambientIntensity; // the material ambient 47: uniform float diffuseIntensity; // the material diffuse 48: uniform float opacityUniform; // the fragment opacity 49: uniform vec3 ambientColorUniform; // ambient color 50: uniform vec3 diffuseColorUniform; // diffuse color 51: 52: 53: // optional surface normal declaration 54: //VTK::Normal::Dec 55: 56: // extra lighting parameters 57: uniform vec3 lightColor0; 58: uniform vec3 lightDirectionVC0; // normalized 59: 60: uniform float depthC; 61: vec2 calcShadow(in vec4 vert, 62: in sampler2D shadowMap, 63: in mat4 shadowTransform, 64: in float attenuation, 65: in int shadowParallel, 66: in float sNearZ, in float sFarZ) 67: { 68: vec4 shadowCoord = shadowTransform*vert; 69: float expFactor = 8.0; 70: float thickness = 0.0; 71: if(shadowCoord.w > 0.0) 72: { 73: vec2 projected = shadowCoord.xy/shadowCoord.w; 74: if(projected.x >= 0.0 && projected.x <= 1.0 75: && projected.y >= 0.0 && projected.y <= 1.0) 76: { 77: float ldepth = shadowCoord.z; 78: if (shadowParallel == 0) { ldepth = (shadowCoord.w - sNearZ)/(sFarZ - sNearZ); } 79: float depthCExpActual = exp(- depthC*ldepth); 80: float depthCExpBlured = texture2D(shadowMap,projected).r; 81: expFactor = depthCExpBlured * depthCExpActual; 82: float depth = log(depthCExpBlured)/depthC; 83: thickness = clamp(ldepth - depth, 0.0, 1.0)*(sFarZ - sNearZ); 84: if (expFactor > 1.0) { expFactor = 1.0; } 85: } 86: } 87: return vec2(1.0 - attenuation + attenuation*expFactor, thickness); 88: } 89: uniform int shadowParallel0; 90: uniform float shadowNearZ0; 91: uniform float shadowFarZ0; 92: uniform float shadowAttenuation0; 93: uniform sampler2D shadowMap0; 94: uniform mat4 shadowTransform0; 95: 96: 97: // Texture maps 98: //VTK::TMap::Dec 99: 100: // Texture coordinates 101: //VTK::TCoord::Dec 102: 103: // picking support 104: //VTK::Picking::Dec 105: 106: // Depth Peeling Support 107: //VTK::DepthPeeling::Dec 108: 109: // clipping plane vars 110: //VTK::Clip::Dec 111: 112: // the output of this shader 113: out vec4 fragOutput0; 114: out vec4 fragOutput1; 115: out vec4 fragOutput2; 116: 117: 118: // Apple Bug 119: //VTK::PrimID::Dec 120: 121: // handle coincident offsets 122: //VTK::Coincident::Dec 123: 124: // Value raster 125: //VTK::ValuePass::Dec 126: 127: // surface with edges 128: //VTK::Edges::Dec 129: 130: void main() 131: { 132: // VC position of this fragment. This should not branch/return/discard. 133: //VTK::PositionVC::Impl 134: 135: // Place any calls that require uniform flow (e.g. dFdx) here. 136: //VTK::UniformFlow::Impl 137: 138: // Set gl_FragDepth here (gl_FragCoord.z by default) 139: //VTK::Depth::Impl 140: 141: // Early depth peeling abort: 142: //VTK::DepthPeeling::PreColor 143: 144: // Apple Bug 145: //VTK::PrimID::Impl 146: 147: //VTK::Clip::Impl 148: 149: //VTK::ValuePass::Impl 150: 151: vec3 ambientColor = ambientIntensity * ambientColorUniform; 152: vec3 diffuseColor = diffuseIntensity * diffuseColorUniform; 153: float opacity = opacityUniform; 154: 155: 156: //VTK::Edges::Impl 157: 158: // Generate the normal if we are not passed in one 159: //VTK::Normal::Impl 160: 161: //VTK::PBR::Impl 162: 163: vec2 factor0 = calcShadow(vertexVC, shadowMap0, shadowTransform0, shadowAttenuation0, shadowParallel0, shadowNearZ0, shadowFarZ0); 164: fragOutput0 = vec4(ambientColor + diffuseColor, opacity); 165: //VTK::Light::Impl 166: 167: 168: fragOutput1 = vec4(0.0, 0.0, 0.0, 0.0); 169: fragOutput2 = vec4(0.0, 0.0, 0.0, 0.0); 170: 171: 172: 173: 174: //VTK::TCoord::Impl 175: 176: if (fragOutput0.a <= 0.0) 177: { 178: discard; 179: } 180: 181: //VTK::DepthPeeling::Impl 182: 183: //VTK::Picking::Impl 184: 185: // handle coincident offsets 186: //VTK::Coincident::Impl 187: }
2026-11-28 16:30:36.091 ( 2.541s) [ 7E435A4C8780] vtkShaderProgram.cxx:1283 ERR| vtkShaderProgram (0x60d19f726d10): 0:163(28): error: `vertexVC' undeclared
0:163(17): error: no matching function for call to `calcShadow(error, sampler2D, mat4, float, int, float, float)'; candidates are:
0:163(17): error: vec2 calcShadow(vec4, sampler2D, mat4, float, int, float, float)
ERROR:root:0:163(28): error: `vertexVC' undeclared
0:163(17): error: no matching function for call to `calcShadow(error, sampler2D, mat4, float, int, float, float)'; candidates are:
0:163(17): error: vec2 calcShadow(vec4, sampler2D, mat4, float, int, float, float)
2026-11-28 16:30:36.092 ( 2.542s) [ 7E435A4C8780]vtkOpenGLPolyDataMapper:2771 ERR| vtkOpenGLPolyDataMapper (0x60d19e371420): Could not set shader program
ERROR:root:Could not set shader program
ERROR:root:attempt to add attribute without a bound program for attribute vertexMC
2026-11-28 16:30:36.093 ( 2.542s) [ 7E435A4C8780]vtkOpenGLVertexArrayObj:262 ERR| vtkOpenGLVertexArrayObject (0x60d19e5c4110): attempt to add attribute without a bound program for attribute vertexMC
2026-11-28 16:30:36.093 ( 2.543s) [ 7E435A4C8780]vtkOpenGLVertexBufferOb:267 ERR| vtkOpenGLVertexBufferObjectGroup (0x60d19e333020): Error setting 'vertexMC' in shader VAO.
ERROR:root:Error setting 'vertexMC' in shader VAO.
ERROR:root:1: #version 150
2: #ifndef GL_ES
3: #define highp
4: #define mediump
5: #define lowp
6: #define texelFetchBuffer texelFetch
7: #endif // GL_ES
8: #define attribute in
9: #define varying out
10:
11:
12: // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
13: // SPDX-License-Identifier: BSD-3-Clause
14:
15: in vec4 vertexMC;
16:
17:
18:
19: // frag position in VC
20: //VTK::PositionVC::Dec
21:
22: // optional normal declaration
23: //VTK::Normal::Dec
24:
25: // extra lighting parameters
26: //VTK::Light::Dec
27:
28: // Texture coordinates
29: //VTK::TCoord::Dec
30:
31: // material property values
32: //VTK::Color::Dec
33:
34: // clipping plane vars
35: //VTK::Clip::Dec
36:
37: // camera and actor matrix values
38: uniform mat4 MCDCMatrix;
39:
40: // Apple Bug
41: //VTK::PrimID::Dec
42:
43: // Value raster
44: //VTK::ValuePass::Dec
45:
46: // picking support
47: //VTK::Picking::Dec
48:
49: // Surface with edges on GLES 3.0
50: //VTK::EdgesGLES30::Dec
51:
52: // PointSize on GLES 3.0
53: //VTK::PointSizeGLES30::Dec
54:
55: // LineWidth on GLES 3.0
56: //VTK::LineWidthGLES30::Dec
57:
58: void main()
59: {
60: //VTK::CustomBegin::Impl
61:
62: //VTK::PointSizeGLES30::Impl
63:
64: //VTK::Color::Impl
65:
66: //VTK::Normal::Impl
67:
68: //VTK::TCoord::Impl
69:
70: //VTK::Clip::Impl
71:
72: //VTK::PrimID::Impl
73:
74: gl_Position = MCDCMatrix * vertexMC;
75:
76:
77: //VTK::LineWidthGLES30::Impl
78:
79: //VTK::ValuePass::Impl
80:
81: //VTK::Light::Impl
82:
83: //VTK::Picking::Impl
84:
85: //VTK::CustomEnd::Impl
86:
87: //VTK::EdgesGLES30::Impl
88: }
2026-11-28 16:30:36.394 ( 2.843s) [ 7E435A4C8780] vtkShaderProgram.cxx:1282 ERR| vtkShaderProgram (0x60d19f726d10): 1: #version 150
2: #ifndef GL_ES
3: #define highp
4: #define mediump
5: #define lowp
6: #define texelFetchBuffer texelFetch
7: #endif // GL_ES
8: #define attribute in
9: #define varying out
10:
11:
12: // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
13: // SPDX-License-Identifier: BSD-3-Clause
14:
15: in vec4 vertexMC;
16:
17:
18:
19: // frag position in VC
20: //VTK::PositionVC::Dec
21:
22: // optional normal declaration
23: //VTK::Normal::Dec
24:
25: // extra lighting parameters
26: //VTK::Light::Dec
27:
28: // Texture coordinates
29: //VTK::TCoord::Dec
30:
31: // material property values
32: //VTK::Color::Dec
33:
34: // clipping plane vars
35: //VTK::Clip::Dec
36:
37: // camera and actor matrix values
38: uniform mat4 MCDCMatrix;
39:
40: // Apple Bug
41: //VTK::PrimID::Dec
42:
43: // Value raster
44: //
VTK::ValuePass::Dec
45:
46: // picking support
47: //VTK::Picking::Dec
48:
49: // Surface with edges on GLES 3.0
50: //VTK::EdgesGLES30::Dec
51:
52: // PointSize on GLES 3.0
53: //VTK::PointSizeGLES30::Dec
54:
55: // LineWidth on GLES 3.0
56: //VTK::LineWidthGLES30::Dec
57:
58: void main()
59: {
60: //VTK::CustomBegin::Impl
61:
62: //VTK::PointSizeGLES30::Impl
63:
64: //VTK::Color::Impl
65:
66: //VTK::Normal::Impl
67:
68: //VTK::TCoord::Impl
69:
70: //VTK::Clip::Impl
71:
72: //VTK::PrimID::Impl
73:
74: gl_Position = MCDCMatrix * vertexMC;
75:
76:
77: //VTK::LineWidthGLES30::Impl
78:
79: //VTK::ValuePass::Impl
80:
81: //VTK::Light::Impl
82:
83: //VTK::Picking::Impl
84:
85: //VTK::CustomEnd::Impl
86:
87: //VTK::EdgesGLES30::Impl
88: }
ERROR:root:
2026-11-28 16:30:36.395 ( 2.844s) [ 7E435A4C8780] vtkShaderProgram.cxx:1283 ERR| vtkShaderProgram (0x60d19f726d10): 2026-11-28 16:30:36.396 ( 2.846s) [ 7E435A4C8780]vtkOpenGLPolyDataMapper:2771 ERR| vtkOpenGLPolyDataMapper (0x60d19e371420): Could not set shader program ERROR:root:Could not set shader program
ERROR:root:attempt to add attribute without a bound program for attribute vertexMC
2026-11-28 16:30:36.397 ( 2.847s) [ 7E435A4C8780]vtkOpenGLVertexArrayObj:262 ERR| vtkOpenGLVertexArrayObject (0x60d19e5c4110): attempt to add attribute without a bound program for attribute vertexMC
2026-11-28 16:30:36.398 ( 2.848s) [ 7E435A4C8780]vtkOpenGLVertexBufferOb:267 ERR| vtkOpenGLVertexBufferObjectGroup (0x60d19e333020): Error setting 'vertexMC' in shader VAO.
ERROR:root:Error setting 'vertexMC' in shader VAO.
ERROR:root:1: #version 150
2: #ifndef GL_ES
3: #define highp
4: #define mediump
5: #define lowp
6: #define texelFetchBuffer texelFetch
7: #endif // GL_ES
8: #define attribute in
9: #define varying out
10:
11:
12: // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
13: // SPDX-License-Identifier: BSD-3-Clause
14:
15: in vec4 vertexMC;
16:
17:
18:
19: // frag position in VC
20: //VTK::PositionVC::Dec
21:
22: // optional normal declaration
23: //VTK::Normal::Dec
24:
25: // extra lighting parameters
26: //VTK::Light::Dec
27:
28: // Texture coordinates
29: //VTK::TCoord::Dec
30:
31: // material property values
32: //VTK::Color::Dec
33:
34: // clipping plane vars
35: //VTK::Clip::Dec
36:
37: // camera and actor matrix values
38: uniform mat4 MCDCMatrix;
39:
40: // Apple Bug
41: //VTK::PrimID::Dec
42:
43: // Value raster
44: //VTK::ValuePass::Dec
45:
46: // picking support
47: //VTK::Picking::Dec
48:
49: // Surface with edges on GLES 3.0
50: //VTK::EdgesGLES30::Dec
51:
52: // PointSize on GLES 3.0
53: //VTK::PointSizeGLES30::Dec
54:
55: // LineWidth on GLES 3.0
56: //VTK::LineWidthGLES30::Dec
57:
58: void main()
59: {
60: //VTK::CustomBegin::Impl
61:
62: //VTK::PointSizeGLES30::Impl
63:
64: //VTK::Color::Impl
65:
66: //VTK::Normal::Impl
67:
68: //VTK::TCoord::Impl
69:
70: //VTK::Clip::Impl
71:
72: //VTK::PrimID::Impl
73:
74: gl_Position = MCDCMatrix * vertexMC;
75:
76:
77: //VTK::LineWidthGLES30::Impl
78:
79: //VTK::ValuePass::Impl
80:
81: //VTK::Light::Impl
82:
83: //VTK::Picking::Impl
84:
85: //VTK::CustomEnd::Impl
86:
87: //VTK::EdgesGLES30::Impl
88: }
2026-11-28 16:30:36.554 ( 3.004s) [ 7E435A4C8780] vtkShaderProgram.cxx:1282 ERR| vtkShaderProgram (0x60d19f726d10): 1: #version 150
2: #ifndef GL_ES
3: #define highp
4: #define mediump
5: #define lowp
6: #define texelFetchBuffer texelFetch
7: #endif // GL_ES
8: #define attribute in
9: #define varying out
10:
11:
12: // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
13: // SPDX-License-Identifier: BSD-3-Clause
14:
15: in vec4 vertexMC;
16:
17:
18:
19: // frag position in VC
20: //VTK::PositionVC::Dec
21:
22: // optional normal declaration
23: //VTK::Normal::Dec
24:
25: // extra lighting parameters
26: //VTK::Light::Dec
27:
28: // Texture coordinates
29: //VTK::TCoord::Dec
30:
31: // material property values
32: //VTK::Color::Dec
33:
34: // clipping plane vars
35: //VTK::Clip::Dec
36:
37: // camera and actor matrix values
38: uniform mat4 MCDCMatrix;
39:
40: // Apple Bug
41: //VTK::PrimID::Dec
42:
43: // Value raster
44: //VTK::ValuePass::Dec
45:
46: // picking support
47: //VTK::Picking::Dec
48:
49: // Surface with edges on GLES 3.0
50: //VTK::EdgesGLES30::Dec
51:
52: // PointSize on GLES 3.0
53: //VTK::PointSizeGLES30::Dec
54:
55: // LineWidth on GLES 3.0
56: //VTK::LineWidthGLES30::Dec
57:
58: void main()
59: {
60: //VTK::CustomBegin::Impl
61:
62: //VTK::PointSizeGLES30::Impl
63:
64: //VTK::Color::Impl
65:
66: //VTK::Normal::Impl
67:
68: //VTK::TCoord::Impl
69:
70: //VTK::Clip::Impl
71:
72: //VTK::PrimID::Impl
73:
74: gl_Position = MCDCMatrix * vertexMC;
75:
76:
77: //VTK::LineWidthGLES30::Impl
78:
79: //VTK::ValuePass::Impl
80:
81: //VTK::Light::Impl
82:
83: //VTK::Picking::Impl
84:
85: //VTK::CustomEnd::Impl
86:
87: //VTK::EdgesGLES30::Impl
88: }
ERROR:root:
2026-11-28 16:30:36.555 ( 3.005s) [ 7E435A4C8780] vtkShaderProgram.cxx:1283 ERR| vtkShaderProgram (0x60d19f726d10):
2026-11-28 16:30:36.556 ( 3.005s) [ 7E435A4C8780]vtkOpenGLPolyDataMapper:2771 ERR| vtkOpenGLPolyDataMapper (0x60d19e371420): Could not set shader program
ERROR:root:Could not set shader program
ERROR:root:attempt to add attribute without a bound program for attribute vertexMC
2026-11-28 16:30:36.556 ( 3.006s) [ 7E435A4C8780]vtkOpenGLVertexArrayObj:262 ERR| vtkOpenGLVertexArrayObject (0x60d19e5c4110): attempt to add attribute without a bound program for attribute vertexMC
ERROR:root:Error setting 'vertexMC' in shader VAO.
2026-11-28 16:30:36.557 ( 3.006s) [ 7E435A4C8780]vtkOpenGLVertexBufferOb:267 ERR| vtkOpenGLVertexBufferObjectGroup (0x60d19e333020): Error setting 'vertexMC' in shader VAO.
ERROR:root:1: #version 150
2: #ifndef GL_ES
3: #define highp
4: #define mediump
5: #define lowp
6: #define texelFetchBuffer texelFetch
7: #endif // GL_ES
8: #define attribute in
9: #define varying out
10:
11:
12: // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
13: // SPDX-License-Identifier: BSD-3-Clause
14:
15: in vec4 vertexMC;
16:
17:
18:
19: // frag position in VC
20: //VTK::PositionVC::Dec
21:
22: // optional normal declaration
23: //VTK::Normal::Dec
24:
25: // extra lighting parameters
26: //VTK::Light::Dec
27:
28: // Texture coordinates
29: //VTK::TCoord::Dec
30:
31: // material property values
32: //VTK::Color::Dec
33:
34: // clipping plane vars
35: //VTK::Clip::Dec
36:
37: // camera and actor matrix values
38: uniform mat4 MCDCMatrix;
39:
40: // Apple Bug
41: //VTK::PrimID::Dec
42:
43: // Value raster
44: //VTK::ValuePass::Dec
45:
46: // picking support
47: //VTK::Picking::Dec
48:
49: // Surface with edges on GLES 3.0
50: //VTK::EdgesGLES30::Dec
51:
52: // PointSize on GLES 3.0
53: //VTK::PointSizeGLES30::Dec
54:
55: // LineWidth on GLES 3.0
56: //VTK::LineWidthGLES30::Dec
57:
58: void main()
59: {
60: //VTK::CustomBegin::Impl
61:
62: //VTK::PointSizeGLES30::Impl
63:
64: //VTK::Color::Impl
65:
66: //VTK::Normal::Impl
67:
68: //VTK::TCoord::Impl
69:
70: //VTK::Clip::Impl
71:
72: //VTK::PrimID::Impl
73:
74: gl_Position = MCDCMatrix * vertexMC;
75:
76:
77: //VTK::LineWidthGLES30::Impl
78:
79: //VTK::ValuePass::Impl
80:
81: //VTK::Light::Impl
82:
83: //VTK::Picking::Impl
84:
85: //VTK::CustomEnd::Impl
86:
87: //VTK::EdgesGLES30::Impl
88: }
2026-11-28 16:30:36.720 ( 3.170s) [ 7E435A4C8780] vtkShaderProgram.cxx:1282 ERR| vtkShaderProgram (0x60d19f726d10): 1: #version 150
2: #ifndef GL_ES
3: #define highp
4: #define mediump
5: #define lowp
6: #define texelFetchBuffer texelFetch
7: #endif // GL_ES
8: #define attribute in
9: #define varying out
10:
11:
12: // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
13: // SPDX-License-Identifier: BSD-3-Clause
14:
15: in vec4 vertexMC;
16:
17:
18:
19: // frag position in VC
20: //VTK::PositionVC::Dec
21:
22: // optional normal declaration
23: //VTK::Normal::Dec
24:
25: // extra lighting parameters
26: //VTK::Light::Dec
27:
28: // Texture coordinates
29: //VTK::TCoord::Dec
30:
31: // material property values
32: //VTK::Color::Dec
33:
34: // clipping plane vars
35: //VTK::Clip::Dec
36:
37: // camera and actor matrix values
38: uniform mat4 MCDCMatrix;
39:
40: // Apple Bug
41: //VTK::PrimID::Dec
42:
43: // Value raster
44: //VTK::ValuePass::Dec
45:
46: // picking support
47: //VTK::Picking::Dec
48:
49: // Surface with edges on GLES 3.0
50: //VTK::EdgesGLES30::Dec
51:
52: // PointSize on GLES 3.0
53: //VTK::PointSizeGLES30::Dec
54:
55: // LineWidth on GLES 3.0
56: //VTK::LineWidthGLES30::Dec
57:
58: void main()
59: {
60: //VTK::CustomBegin::Impl
61:
62: //VTK::PointSizeGLES30::Impl
63:
64: //VTK::Color::Impl
65:
66: //VTK::Normal::Impl
67:
68: //VTK::TCoord::Impl
69:
70: //VTK::Clip::Impl
71:
72: //VTK::PrimID::Impl
73:
74: gl_Position = MCDCMatrix * vertexMC;
75:
76:
77: //VTK::LineWidthGLES30::Impl
78:
79: //VTK::ValuePass::Impl
80:
81: //VTK::Light::Impl
82:
83: //VTK::Picking::Impl
84:
85: //VTK::CustomEnd::Impl
86:
87: //VTK::EdgesGLES30::Impl
88: }
ERROR:root:
2026-11-28 16:30:36.721 ( 3.171s) [ 7E435A4C8780] vtkShaderProgram.cxx:1283 ERR| vtkShaderProgram (0x60d19f726d10):
2026-11-28 16:30:36.722 ( 3.172s) [ 7E435A4C8780]vtkOpenGLPolyDataMapper:2771 ERR| vtkOpenGLPolyDataMapper (0x60d19e371420): Could not set shader program
ERROR:root:Could not set shader program
ERROR:root:attempt to add attribute without a bound program for attribute vertexMC
2026-11-28 16:30:36.723 ( 3.172s) [ 7E435A4C8780]vtkOpenGLVertexArrayObj:262 ERR| vtkOpenGLVertexArrayObject (0x60d19e5c4110): attempt to add attribute without a bound program for attribute vertexMC
2026-11-28 16:30:36.723 ( 3.173s) [ 7E435A4C8780]vtkOpenGLVertexBufferOb:267 ERR| vtkOpenGLVertexBufferObjectGroup (0x60d19e333020): Error setting 'vertexMC' in shader VAO.
ERROR:root:Error setting 'vertexMC' in shader VAO.
ERROR:root:1: #version 150
2: #ifndef GL_ES
3: #define highp
4: #define mediump
5: #define lowp
6: #define texelFetchBuffer texelFetch
7: #endif // GL_ES
8: #define attribute in
9: #define varying out
10:
11:
12: // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
13: // SPDX-License-Identifier: BSD-3-Clause
14:
15: in vec4 vertexMC;
16:
17:
18:
19: // frag position in VC
20: //VTK::PositionVC::Dec
21:
22: // optional normal declaration
23: //VTK::Normal::Dec
24:
25: // extra lighting parameters
26: //VTK::Light::Dec
27:
28: // Texture coordinates
29: //VTK::TCoord::Dec
30:
31: // material property values
32: //VTK::Color::Dec
33:
34: // clipping plane vars
35: //VTK::Clip::Dec
36:
37: // camera and actor matrix values
38: uniform mat4 MCDCMatrix;
39:
40: // Apple Bug
41: //VTK::PrimID::Dec
42:
43: // Value raster
44: //VTK::ValuePass::Dec
45:
46: // picking support
47: //VTK::Picking::Dec
48:
49: // Surface with edges on GLES 3.0
50: //VTK::EdgesGLES30::Dec
51:
52: // PointSize on GLES 3.0
53: //VTK::PointSizeGLES30::Dec
54:
55: // LineWidth on GLES 3.0
56: //VTK::LineWidthGLES30::Dec
57:
58: void main()
59: {
60: //VTK::CustomBegin::Impl
61:
62: //VTK::PointSizeGLES30::Impl
63:
64: //VTK::Color::Impl
65:
66: //VTK::Normal::Impl
67:
68: //VTK::TCoord::Impl
69:
70: //VTK::Clip::Impl
71:
72: //VTK::PrimID::Impl
73:
74: gl_Position = MCDCMatrix * vertexMC;
75:
76:
77: //VTK::LineWidthGLES30::Impl
78:
79: //VTK::ValuePass::Impl
80:
81: //VTK::Light::Impl
82:
83: //VTK::Picking::Impl
84:
85: //VTK::CustomEnd::Impl
86:
87: //VTK::EdgesGLES30::Impl
88: }
2026-11-28 16:30:36.939 ( 3.388s) [ 7E435A4C8780] vtkShaderProgram.cxx:1282 ERR| vtkShaderProgram (0x60d19f726d10): 1: #version 150
2: #ifndef GL_ES
3: #define highp
4: #define mediump
5: #define lowp
6: #define texelFetchBuffer texelFetch
7: #endif // GL_ES
8: #define attribute in
9: #define varying out
10:
11:
12: // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
13: // SPDX-License-Identifier: BSD-3-Clause
14:
15: in vec4 vertexMC;
16:
17:
18:
19: // frag position in VC
20: //VTK::PositionVC::Dec
21:
22: // optional normal declaration
23: //VTK::Normal::Dec
24:
25: // extra lighting parameters
26: //VTK::Light::Dec
27:
28: // Texture coordinates
29: //VTK::TCoord::Dec
30:
31: // material property values
32: //VTK::Color::Dec
33:
34: // clipping plane vars
35: //VTK::Clip::Dec
36:
37: // camera and actor matrix values
38: uniform mat4 MCDCMatrix;
39:
40: // Apple Bug
41: //VTK::PrimID::Dec
42:
43: // Value raster
44: //
VTK::ValuePass::Dec
45:
46: // picking support
47: //VTK::Picking::Dec
48:
49: // Surface with edges on GLES 3.0
50: //VTK::EdgesGLES30::Dec
51:
52: // PointSize on GLES 3.0
53: //VTK::PointSizeGLES30::Dec
54:
55: // LineWidth on GLES 3.0
56: //VTK::LineWidthGLES30::Dec
57:
58: void main()
59: {
60: //VTK::CustomBegin::Impl
61:
62: //VTK::PointSizeGLES30::Impl
63:
64: //VTK::Color::Impl
65:
66: //VTK::Normal::Impl
67:
68: //VTK::TCoord::Impl
69:
70: //VTK::Clip::Impl
71:
72: //VTK::PrimID::Impl
73:
74: gl_Position = MCDCMatrix * vertexMC;
75:
76:
77: //VTK::LineWidthGLES30::Impl
78:
79: //VTK::ValuePass::Impl
80:
81: //VTK::Light::Impl
82:
83: //VTK::Picking::Impl
84:
85: //VTK::CustomEnd::Impl
86:
87: //VTK::EdgesGLES30::Impl
88: }
2026-11-28 16:30:36.940 ( 3.390s) [ 7E435A4C8780] vtkShaderProgram.cxx:1283 ERR| vtkShaderProgram (0x60d19f726ERROR:root:
d10):
2026-11-28 16:30:36.941 ( 3.390s) [ 7E435A4C8780]vtkOpenGLPolyDataMapper:2771 ERR| vtkOpenGLPolyDataMapper (0x60d19e371420): Could not set shader program
ERROR:root:Could not set shader program
2026-11-28 16:30:36.941 ( 3.391s) [ 7E435A4C8780]vtkOpenGLVertexArrayObj:262 ERR| vtkOpenGLVertexArrayObject (0x60d19e5c4110): attempt to add attribute without a bound program for attribute vertexMC
ERROR:root:attempt to add attribute without a bound program for attribute vertexMC
ERROR:root:Error setting 'vertexMC' in shader VAO.
vector export written: True in-memory scene is not bundleable: save_bundle(): source 'terrain-1' is 'object:68ca81e5abc2:terrain-1', wh ...
2026-11-28 16:30:36.943 ( 3.392s) [ 7E435A4C8780]vtkOpenGLVertexBufferOb:267 ERR| vtkOpenGLVertexBufferObjectGroup (0x60d19e333020): Error setting 'vertexMC' in shader VAO.
One-call framing — quickmap(backend="3d")¶
quickmap wires the framing (and, for an EPSG:3857 scene, the basemap) into one call. Guarded, since the
input shape and any basemap fetch depend on the environment.
from digitalearth import quickmap
try:
quick = quickmap(relief, backend="3d", domain="europe")
print("quickmap 3-D layers:", quick.layer_ids)
quick.close()
except Exception as error:
print("quickmap demo skipped:", type(error).__name__)
scene.close()
quickmap demo skipped: TypeError