forked from elfrank/virtual-texturing
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
executable file
·156 lines (147 loc) · 5.29 KB
/
index.html
File metadata and controls
executable file
·156 lines (147 loc) · 5.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<!DOCTYPE html>
<html>
<head>
<meta charset="iso-8859-15">
<title>Virtual Textures | Example</title>
<link rel="stylesheet" type="text/css" href="examples/css/main.css">
<script src="examples/jsm/stats.min.js"></script>
</head>
<body>
<div class="container background">
<div class="header"></div>
<div class="content">
<div id="canvas_container"></div>
</div>
</div>
<script type="module">
import { APP } from './examples/jsm/Main.js';
import { IIPSource } from './src/Sources/IIPSource.js';
import { WMTSSource } from './src/Sources/WMTSSource.js';
import { WMSSource } from './src/Sources/WMSSource.js';
import { IIIFSource } from './src/Sources/IIIFSource.js';
import { COGSource } from './src/Sources/COGSource.js';
import { PlaneGeometry, FloatType, RedFormat } from './examples/jsm/three.module.js';
var config = [
{
tileClamp: 0.5,
pageCount: [16,16],
tileDeterminationRatio: 0.25,
source: new WMTSSource({
version: '1.0.0',
tileMatrixSet: 'PM',
wmts: 'https://data.geopf.fr/wmts',
layer: 'ORTHOIMAGERY.ORTHOPHOTOS',
width: 256,
height: 256,
padding: 0,
minMipMapLevel: 0,
maxMipMapLevel: 9,
})
},
{
tileClamp: 0.5,
pageCount: [32,32],
tileDeterminationRatio: 0.125,
source: {
getUrl(tile) {
const pageNumber = tile.x + tile.y * ( 1 << tile.z );
return './examples/models/terrain/tiles/diffuse/' + tile.z + '-' + pageNumber + ".jpg";
},
width: 128,
height: 128,
padding: 4,
minMipMapLevel: 0,
maxMipMapLevel: 4,
}
},
{
tileClamp: 0.5,
pageCount: [16,16],
tileDeterminationRatio: 0.125,
source: new COGSource({
id: 'https://data.geopf.fr/chunk/telechargement/download/pva/2219-0441/IGNF_PVA_1-0__1922-10-27__C2219-0441_1922_NP1_5007.tif',
padding: 0,
}),
},
{
tileClamp: 0.5,
pageCount: [16,16],
tileDeterminationRatio: 0.125,
source: new IIIFSource({
id: 'https://codh.rois.ac.jp/pmjt/iiif/200003080/200003080_00010.tif',
padding: 2,
}),
},
{
tileClamp: 0.5,
pageCount: [16,16],
tileDeterminationRatio: 0.125,
source: new IIIFSource({
id: 'https://gallica.bnf.fr/iiif/ark:/12148/btv1b530951700/f1',
padding: 0,
}),
},
{
tileClamp: 0.5,
pageCount: [16,16],
tileDeterminationRatio: 0.1,
source: new WMSSource({
wms: 'https://wms.gebco.net/mapserv?',
layer: 'gebco_latest',
crs: 'EPSG:4326',
bbox: [-180,-90,180,90],
width: 256,
height: 256,
padding: 10,
minMipMapLevel: 0,
maxMipMapLevel: 7,
})
},
{
tileClamp: 0.5,
pageCount: [16,16],
tileDeterminationRatio: 0.1,
source: new WMTSSource({
wmts: 'https://data.geopf.fr/wmts',
layer: 'ELEVATION.ELEVATIONGRIDCOVERAGE.SRTM3',
tileMatrixSet: 'WGS84G',
mimeType: 'image/x-bil;bits=32',
width: 256,
height: 256,
padding: 0,
format: RedFormat,
type: FloatType,
minMipMapLevel: 1,
maxMipMapLevel: 10,
tileMatrixSetLimits: {
"1": { "minTileRow": 0, "maxTileRow": 1, "minTileCol": 0, "maxTileCol": 4 },
"2": { "minTileRow": 0, "maxTileRow": 3, "minTileCol": 0, "maxTileCol": 8 },
"3": { "minTileRow": 1, "maxTileRow": 6, "minTileCol": 0, "maxTileCol": 16 },
"4": { "minTileRow": 2, "maxTileRow": 12, "minTileCol": 0, "maxTileCol": 32 },
"5": { "minTileRow": 5, "maxTileRow": 25, "minTileCol": 0, "maxTileCol": 64 },
"6": { "minTileRow": 10, "maxTileRow": 51, "minTileCol": 0, "maxTileCol": 128 },
"7": { "minTileRow": 20, "maxTileRow": 103, "minTileCol": 0, "maxTileCol": 256 },
"8": { "minTileRow": 41, "maxTileRow": 207, "minTileCol": 0, "maxTileCol": 512 },
"9": { "minTileRow": 82, "maxTileRow": 415, "minTileCol": 0, "maxTileCol": 1024 },
"10": { "minTileRow": 164, "maxTileRow": 830, "minTileCol": 0, "maxTileCol": 2048 }
}
})
}
];
const app = new APP();
app.start();
function start(conf) {
const aspect = conf.source.size ? conf.source.size[1]/conf.source.size[0] : 1;
var geometry = new PlaneGeometry(100, 100*aspect, 1024);
app.load(geometry, conf);
app.run();
window.vt = app.virtualTexture; // for console inspection
}
const params = new URL(document.location).searchParams;
const conf = config[parseInt(params.get("config")) || 0];
if (conf.source.init) conf.source.init().then(() => start(conf));
else start(conf);
</script>
</body>
</head>
</html>