@shapediver/viewer.rendering-engine.rendering-engine-threejs 3.3.4 → 3.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +19 -20
- package/src/RenderingEngine.ts +0 -1336
- package/src/index.ts +0 -81
- package/src/injectors/Tag3dGeometryCreationInjector.ts +0 -154
- package/src/injectors/TextureUnifierInjector.ts +0 -214
- package/src/interfaces/ILoader.ts +0 -3
- package/src/interfaces/IPostProcessingEffectDefinitions.ts +0 -402
- package/src/interfaces/IRenderingEngine.ts +0 -48
- package/src/loaders/EnvironmentMapLoader.ts +0 -357
- package/src/loaders/GeometryLoader.ts +0 -585
- package/src/loaders/HTMLElementAnchorLoader.ts +0 -107
- package/src/loaders/LightLoader.ts +0 -171
- package/src/loaders/MaterialLoader.ts +0 -1413
- package/src/managers/CameraManager.ts +0 -178
- package/src/managers/EnvironmentGeometryManager.ts +0 -224
- package/src/managers/PostProcessingManager.ts +0 -1181
- package/src/managers/RenderingManager.ts +0 -657
- package/src/managers/SceneTracingManager.ts +0 -127
- package/src/managers/SceneTreeManager.ts +0 -576
- package/src/managers/postprocessing/GodRaysManager.ts +0 -52
- package/src/managers/postprocessing/OutlineManager.ts +0 -58
- package/src/managers/postprocessing/SSAARenderPass.ts +0 -339
- package/src/managers/postprocessing/SelectiveBloomManager.ts +0 -58
- package/src/managers/postprocessing/ao/ao/AOEffect.ts +0 -180
- package/src/managers/postprocessing/ao/ao/AOPass.ts +0 -128
- package/src/managers/postprocessing/ao/ao/shader/ao_compose.glsl +0 -17
- package/src/managers/postprocessing/ao/ao/shader/ao_compose.ts +0 -19
- package/src/managers/postprocessing/ao/hbao/HBAOEffect.ts +0 -41
- package/src/managers/postprocessing/ao/hbao/shader/hbao.glsl +0 -96
- package/src/managers/postprocessing/ao/hbao/shader/hbao.ts +0 -98
- package/src/managers/postprocessing/ao/hbao/shader/hbao_utils.glsl +0 -92
- package/src/managers/postprocessing/ao/hbao/shader/hbao_utils.ts +0 -95
- package/src/managers/postprocessing/ao/poissionDenoise/PoissionDenoisePass.ts +0 -259
- package/src/managers/postprocessing/ao/poissionDenoise/shader/poissionDenoise.glsl +0 -125
- package/src/managers/postprocessing/ao/poissionDenoise/shader/poissionDenoise.ts +0 -127
- package/src/managers/postprocessing/ao/ssao/SSAOEffect.ts +0 -106
- package/src/managers/postprocessing/ao/ssao/shader/ssao.glsl +0 -128
- package/src/managers/postprocessing/ao/ssao/shader/ssao.ts +0 -130
- package/src/managers/postprocessing/ao/utils/shader/basic.glsl +0 -6
- package/src/managers/postprocessing/ao/utils/shader/basic.ts +0 -8
- package/src/managers/postprocessing/ao/utils/shader/sampleBlueNoise.glsl +0 -36
- package/src/managers/postprocessing/ao/utils/shader/sampleBlueNoise.ts +0 -38
- package/src/managers/postprocessing/utils/CopyMaterial.ts +0 -130
- package/src/managers/postprocessing/utils/CopyShader.ts +0 -39
- package/src/managers/postprocessing/utils/FullScreenQuad.ts +0 -47
- package/src/managers/postprocessing/utils/NormalPass.ts +0 -222
- package/src/managers/postprocessing/utils/RenderPass.ts +0 -366
- package/src/materials/GemMaterial.ts +0 -268
- package/src/materials/MeshUnlitMaterialParameters.ts +0 -4
- package/src/materials/MultiPointsMaterial.ts +0 -646
- package/src/materials/SpecularGlossinessMaterial.ts +0 -182
- package/src/objects/SDBone.ts +0 -51
- package/src/objects/SDColor.ts +0 -54
- package/src/objects/SDData.ts +0 -44
- package/src/objects/SDObject.ts +0 -58
- package/src/shaders/PCSS.ts +0 -124
- package/src/shaders/gem.ts +0 -579
- package/src/shaders/gem_frag.glsl +0 -522
- package/src/shaders/gem_vert.glsl +0 -53
- package/src/shaders/multi_points.ts +0 -291
- package/src/shaders/multi_points_frag.glsl +0 -166
- package/src/shaders/multi_points_vert.glsl +0 -120
- package/src/styling/viewport-css.ts +0 -113
- package/src/styling/viewport.css +0 -111
- package/src/three/font.ts +0 -2
- package/src/three/geometries/TextGeometry.ts +0 -58
- package/src/three/loaders/FontLoader.ts +0 -205
- package/src/three/loaders/RGBELoader.ts +0 -496
- package/src/types/IThreejsData.ts +0 -16
- package/src/types/ThreejsData.ts +0 -43
- package/tsconfig.json +0 -20
|
@@ -1,291 +0,0 @@
|
|
|
1
|
-
export const vert = `
|
|
2
|
-
attribute float positionIndex;
|
|
3
|
-
flat varying int vMaterialIndex;
|
|
4
|
-
flat varying int vPositionIndex;
|
|
5
|
-
|
|
6
|
-
uniform float size_0;
|
|
7
|
-
uniform float size_1;
|
|
8
|
-
uniform float size_2;
|
|
9
|
-
uniform float size_3;
|
|
10
|
-
uniform float size_4;
|
|
11
|
-
uniform float size_5;
|
|
12
|
-
uniform float size_6;
|
|
13
|
-
uniform float size_7;
|
|
14
|
-
|
|
15
|
-
uniform bool sizeAttenuation_0;
|
|
16
|
-
uniform bool sizeAttenuation_1;
|
|
17
|
-
uniform bool sizeAttenuation_2;
|
|
18
|
-
uniform bool sizeAttenuation_3;
|
|
19
|
-
uniform bool sizeAttenuation_4;
|
|
20
|
-
uniform bool sizeAttenuation_5;
|
|
21
|
-
uniform bool sizeAttenuation_6;
|
|
22
|
-
uniform bool sizeAttenuation_7;
|
|
23
|
-
|
|
24
|
-
uniform highp usampler2D materialIndexDataTexture;
|
|
25
|
-
|
|
26
|
-
uniform float scale;
|
|
27
|
-
|
|
28
|
-
float getSize(int materialIndex) {
|
|
29
|
-
if ( materialIndex == 1 ) {
|
|
30
|
-
return size_1;
|
|
31
|
-
} else if ( materialIndex == 2 ) {
|
|
32
|
-
return size_2;
|
|
33
|
-
} else if ( materialIndex == 3 ) {
|
|
34
|
-
return size_3;
|
|
35
|
-
} else if ( materialIndex == 4 ) {
|
|
36
|
-
return size_4;
|
|
37
|
-
} else if ( materialIndex == 5 ) {
|
|
38
|
-
return size_5;
|
|
39
|
-
} else if ( materialIndex == 6 ) {
|
|
40
|
-
return size_6;
|
|
41
|
-
} else if ( materialIndex == 7 ) {
|
|
42
|
-
return size_7;
|
|
43
|
-
} else {
|
|
44
|
-
return size_0;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
bool getSizeAttenuation(int materialIndex) {
|
|
49
|
-
if ( materialIndex == 1 ) {
|
|
50
|
-
return sizeAttenuation_1;
|
|
51
|
-
} else if ( materialIndex == 2 ) {
|
|
52
|
-
return sizeAttenuation_2;
|
|
53
|
-
} else if ( materialIndex == 3 ) {
|
|
54
|
-
return sizeAttenuation_3;
|
|
55
|
-
} else if ( materialIndex == 4 ) {
|
|
56
|
-
return sizeAttenuation_4;
|
|
57
|
-
} else if ( materialIndex == 5 ) {
|
|
58
|
-
return sizeAttenuation_5;
|
|
59
|
-
} else if ( materialIndex == 6 ) {
|
|
60
|
-
return sizeAttenuation_6;
|
|
61
|
-
} else if ( materialIndex == 7 ) {
|
|
62
|
-
return sizeAttenuation_7;
|
|
63
|
-
} else {
|
|
64
|
-
return sizeAttenuation_0;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
#include <common>
|
|
69
|
-
#include <color_pars_vertex>
|
|
70
|
-
#include <fog_pars_vertex>
|
|
71
|
-
#include <morphtarget_pars_vertex>
|
|
72
|
-
#include <logdepthbuf_pars_vertex>
|
|
73
|
-
#include <clipping_planes_pars_vertex>
|
|
74
|
-
|
|
75
|
-
#ifdef USE_POINTS_UV
|
|
76
|
-
|
|
77
|
-
varying vec2 vUv;
|
|
78
|
-
uniform mat3 uvTransform;
|
|
79
|
-
|
|
80
|
-
#endif
|
|
81
|
-
|
|
82
|
-
int retrieveMaterialIndex() {
|
|
83
|
-
vec2 uv = vec2(positionIndex/1024.0, 0.5);
|
|
84
|
-
|
|
85
|
-
// get the value of a texture at a specific index
|
|
86
|
-
return int(texture2D(materialIndexDataTexture, uv).r);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
void main() {
|
|
90
|
-
int materialIndex = retrieveMaterialIndex();
|
|
91
|
-
vMaterialIndex = materialIndex;
|
|
92
|
-
|
|
93
|
-
float size = getSize(materialIndex);
|
|
94
|
-
bool sizeAttenuation = getSizeAttenuation(materialIndex);
|
|
95
|
-
|
|
96
|
-
#ifdef USE_POINTS_UV
|
|
97
|
-
|
|
98
|
-
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
|
|
99
|
-
|
|
100
|
-
#endif
|
|
101
|
-
|
|
102
|
-
#include <color_vertex>
|
|
103
|
-
#include <morphcolor_vertex>
|
|
104
|
-
#include <begin_vertex>
|
|
105
|
-
#include <morphtarget_vertex>
|
|
106
|
-
#include <project_vertex>
|
|
107
|
-
|
|
108
|
-
gl_PointSize = size;
|
|
109
|
-
|
|
110
|
-
if(sizeAttenuation) {
|
|
111
|
-
bool isPerspective = isPerspectiveMatrix( projectionMatrix );
|
|
112
|
-
if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
#include <logdepthbuf_vertex>
|
|
117
|
-
#include <clipping_planes_vertex>
|
|
118
|
-
#include <worldpos_vertex>
|
|
119
|
-
#include <fog_vertex>
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
`;
|
|
123
|
-
|
|
124
|
-
export const frag = `
|
|
125
|
-
uniform vec3 diffuse;
|
|
126
|
-
uniform vec3 color_0;
|
|
127
|
-
uniform vec3 color_1;
|
|
128
|
-
uniform vec3 color_2;
|
|
129
|
-
uniform vec3 color_3;
|
|
130
|
-
uniform vec3 color_4;
|
|
131
|
-
uniform vec3 color_5;
|
|
132
|
-
uniform vec3 color_6;
|
|
133
|
-
uniform vec3 color_7;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
uniform float opacity;
|
|
137
|
-
flat varying int vMaterialIndex;
|
|
138
|
-
flat varying int vPositionIndex;
|
|
139
|
-
|
|
140
|
-
#include <common>
|
|
141
|
-
#include <color_pars_fragment>
|
|
142
|
-
|
|
143
|
-
#if defined( USE_POINTS_UV )
|
|
144
|
-
|
|
145
|
-
varying vec2 vUv;
|
|
146
|
-
|
|
147
|
-
#else
|
|
148
|
-
|
|
149
|
-
#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
|
|
150
|
-
|
|
151
|
-
uniform mat3 uvTransform;
|
|
152
|
-
|
|
153
|
-
#endif
|
|
154
|
-
|
|
155
|
-
#endif
|
|
156
|
-
|
|
157
|
-
#ifdef USE_MAP
|
|
158
|
-
|
|
159
|
-
uniform sampler2D map_0;
|
|
160
|
-
uniform sampler2D map_1;
|
|
161
|
-
uniform sampler2D map_2;
|
|
162
|
-
uniform sampler2D map_3;
|
|
163
|
-
uniform sampler2D map_4;
|
|
164
|
-
uniform sampler2D map_5;
|
|
165
|
-
uniform sampler2D map_6;
|
|
166
|
-
uniform sampler2D map_7;
|
|
167
|
-
|
|
168
|
-
#endif
|
|
169
|
-
|
|
170
|
-
#ifdef USE_ALPHAMAP
|
|
171
|
-
|
|
172
|
-
uniform sampler2D alphaMap_0;
|
|
173
|
-
uniform sampler2D alphaMap_1;
|
|
174
|
-
uniform sampler2D alphaMap_2;
|
|
175
|
-
uniform sampler2D alphaMap_3;
|
|
176
|
-
uniform sampler2D alphaMap_4;
|
|
177
|
-
uniform sampler2D alphaMap_5;
|
|
178
|
-
uniform sampler2D alphaMap_6;
|
|
179
|
-
uniform sampler2D alphaMap_7;
|
|
180
|
-
|
|
181
|
-
#endif
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
#include <alphatest_pars_fragment>
|
|
185
|
-
#include <fog_pars_fragment>
|
|
186
|
-
#include <logdepthbuf_pars_fragment>
|
|
187
|
-
#include <clipping_planes_pars_fragment>
|
|
188
|
-
|
|
189
|
-
void main() {
|
|
190
|
-
|
|
191
|
-
#include <clipping_planes_fragment>
|
|
192
|
-
|
|
193
|
-
vec3 outgoingLight = vec3( 0.0 );
|
|
194
|
-
|
|
195
|
-
vec3 c = vec3(1.0, 0.0, 0.0);
|
|
196
|
-
if ( vMaterialIndex == 1 ) {
|
|
197
|
-
c = color_1;
|
|
198
|
-
} else if ( vMaterialIndex == 2 ) {
|
|
199
|
-
c = color_2;
|
|
200
|
-
} else if ( vMaterialIndex == 3 ) {
|
|
201
|
-
c = color_3;
|
|
202
|
-
} else if ( vMaterialIndex == 4 ) {
|
|
203
|
-
c = color_4;
|
|
204
|
-
} else if ( vMaterialIndex == 5 ) {
|
|
205
|
-
c = color_5;
|
|
206
|
-
} else if ( vMaterialIndex == 6 ) {
|
|
207
|
-
c = color_6;
|
|
208
|
-
} else if ( vMaterialIndex == 7 ) {
|
|
209
|
-
c = color_7;
|
|
210
|
-
} else {
|
|
211
|
-
c = color_0;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
vec4 diffuseColor = vec4( c, opacity );
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
#include <logdepthbuf_fragment>
|
|
220
|
-
|
|
221
|
-
#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
|
|
222
|
-
|
|
223
|
-
#if defined( USE_POINTS_UV )
|
|
224
|
-
|
|
225
|
-
vec2 uv = vUv;
|
|
226
|
-
|
|
227
|
-
#else
|
|
228
|
-
|
|
229
|
-
vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
|
|
230
|
-
|
|
231
|
-
#endif
|
|
232
|
-
|
|
233
|
-
#endif
|
|
234
|
-
|
|
235
|
-
#ifdef USE_MAP
|
|
236
|
-
|
|
237
|
-
if ( vMaterialIndex == 1 ) {
|
|
238
|
-
diffuseColor *= texture2D( map_1, uv );
|
|
239
|
-
} else if ( vMaterialIndex == 2 ) {
|
|
240
|
-
diffuseColor *= texture2D( map_2, uv );
|
|
241
|
-
} else if ( vMaterialIndex == 3 ) {
|
|
242
|
-
diffuseColor *= texture2D( map_3, uv );
|
|
243
|
-
} else if ( vMaterialIndex == 4 ) {
|
|
244
|
-
diffuseColor *= texture2D( map_4, uv );
|
|
245
|
-
} else if ( vMaterialIndex == 5 ) {
|
|
246
|
-
diffuseColor *= texture2D( map_5, uv );
|
|
247
|
-
} else if ( vMaterialIndex == 6 ) {
|
|
248
|
-
diffuseColor *= texture2D( map_6, uv );
|
|
249
|
-
} else if ( vMaterialIndex == 7 ) {
|
|
250
|
-
diffuseColor *= texture2D( map_7, uv );
|
|
251
|
-
} else {
|
|
252
|
-
diffuseColor *= texture2D( map_0, uv );
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
#endif
|
|
256
|
-
|
|
257
|
-
#ifdef USE_ALPHAMAP
|
|
258
|
-
|
|
259
|
-
if ( vMaterialIndex == 1 ) {
|
|
260
|
-
diffuseColor *= texture2D( alphaMap_1, uv );
|
|
261
|
-
} else if ( vMaterialIndex == 2 ) {
|
|
262
|
-
diffuseColor *= texture2D( alphaMap_2, uv );
|
|
263
|
-
} else if ( vMaterialIndex == 3 ) {
|
|
264
|
-
diffuseColor *= texture2D( alphaMap_3, uv );
|
|
265
|
-
} else if ( vMaterialIndex == 4 ) {
|
|
266
|
-
diffuseColor *= texture2D( alphaMap_4, uv );
|
|
267
|
-
} else if ( vMaterialIndex == 5 ) {
|
|
268
|
-
diffuseColor *= texture2D( alphaMap_5, uv );
|
|
269
|
-
} else if ( vMaterialIndex == 6 ) {
|
|
270
|
-
diffuseColor *= texture2D( alphaMap_6, uv );
|
|
271
|
-
} else if ( vMaterialIndex == 7 ) {
|
|
272
|
-
diffuseColor *= texture2D( alphaMap_7, uv );
|
|
273
|
-
} else {
|
|
274
|
-
diffuseColor *= texture2D( alphaMap_0, uv );
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
#endif
|
|
278
|
-
|
|
279
|
-
#include <color_fragment>
|
|
280
|
-
#include <alphatest_fragment>
|
|
281
|
-
|
|
282
|
-
outgoingLight = diffuseColor.rgb;
|
|
283
|
-
|
|
284
|
-
#include <opaque_fragment>
|
|
285
|
-
#include <tonemapping_fragment>
|
|
286
|
-
#include <colorspace_fragment>
|
|
287
|
-
#include <fog_fragment>
|
|
288
|
-
#include <premultiplied_alpha_fragment>
|
|
289
|
-
|
|
290
|
-
}
|
|
291
|
-
`;
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
uniform vec3 diffuse;
|
|
2
|
-
uniform vec3 color_0;
|
|
3
|
-
uniform vec3 color_1;
|
|
4
|
-
uniform vec3 color_2;
|
|
5
|
-
uniform vec3 color_3;
|
|
6
|
-
uniform vec3 color_4;
|
|
7
|
-
uniform vec3 color_5;
|
|
8
|
-
uniform vec3 color_6;
|
|
9
|
-
uniform vec3 color_7;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
uniform float opacity;
|
|
13
|
-
flat varying int vMaterialIndex;
|
|
14
|
-
flat varying int vPositionIndex;
|
|
15
|
-
|
|
16
|
-
#include <common>
|
|
17
|
-
#include <color_pars_fragment>
|
|
18
|
-
|
|
19
|
-
#if defined( USE_POINTS_UV )
|
|
20
|
-
|
|
21
|
-
varying vec2 vUv;
|
|
22
|
-
|
|
23
|
-
#else
|
|
24
|
-
|
|
25
|
-
#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
|
|
26
|
-
|
|
27
|
-
uniform mat3 uvTransform;
|
|
28
|
-
|
|
29
|
-
#endif
|
|
30
|
-
|
|
31
|
-
#endif
|
|
32
|
-
|
|
33
|
-
#ifdef USE_MAP
|
|
34
|
-
|
|
35
|
-
uniform sampler2D map_0;
|
|
36
|
-
uniform sampler2D map_1;
|
|
37
|
-
uniform sampler2D map_2;
|
|
38
|
-
uniform sampler2D map_3;
|
|
39
|
-
uniform sampler2D map_4;
|
|
40
|
-
uniform sampler2D map_5;
|
|
41
|
-
uniform sampler2D map_6;
|
|
42
|
-
uniform sampler2D map_7;
|
|
43
|
-
|
|
44
|
-
#endif
|
|
45
|
-
|
|
46
|
-
#ifdef USE_ALPHAMAP
|
|
47
|
-
|
|
48
|
-
uniform sampler2D alphaMap_0;
|
|
49
|
-
uniform sampler2D alphaMap_1;
|
|
50
|
-
uniform sampler2D alphaMap_2;
|
|
51
|
-
uniform sampler2D alphaMap_3;
|
|
52
|
-
uniform sampler2D alphaMap_4;
|
|
53
|
-
uniform sampler2D alphaMap_5;
|
|
54
|
-
uniform sampler2D alphaMap_6;
|
|
55
|
-
uniform sampler2D alphaMap_7;
|
|
56
|
-
|
|
57
|
-
#endif
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
#include <alphatest_pars_fragment>
|
|
61
|
-
#include <fog_pars_fragment>
|
|
62
|
-
#include <logdepthbuf_pars_fragment>
|
|
63
|
-
#include <clipping_planes_pars_fragment>
|
|
64
|
-
|
|
65
|
-
void main() {
|
|
66
|
-
|
|
67
|
-
#include <clipping_planes_fragment>
|
|
68
|
-
|
|
69
|
-
vec3 outgoingLight = vec3( 0.0 );
|
|
70
|
-
|
|
71
|
-
vec3 c = vec3(1.0, 0.0, 0.0);
|
|
72
|
-
if ( vMaterialIndex == 1 ) {
|
|
73
|
-
c = color_1;
|
|
74
|
-
} else if ( vMaterialIndex == 2 ) {
|
|
75
|
-
c = color_2;
|
|
76
|
-
} else if ( vMaterialIndex == 3 ) {
|
|
77
|
-
c = color_3;
|
|
78
|
-
} else if ( vMaterialIndex == 4 ) {
|
|
79
|
-
c = color_4;
|
|
80
|
-
} else if ( vMaterialIndex == 5 ) {
|
|
81
|
-
c = color_5;
|
|
82
|
-
} else if ( vMaterialIndex == 6 ) {
|
|
83
|
-
c = color_6;
|
|
84
|
-
} else if ( vMaterialIndex == 7 ) {
|
|
85
|
-
c = color_7;
|
|
86
|
-
} else {
|
|
87
|
-
c = color_0;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
vec4 diffuseColor = vec4( c, opacity );
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
#include <logdepthbuf_fragment>
|
|
96
|
-
|
|
97
|
-
#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
|
|
98
|
-
|
|
99
|
-
#if defined( USE_POINTS_UV )
|
|
100
|
-
|
|
101
|
-
vec2 uv = vUv;
|
|
102
|
-
|
|
103
|
-
#else
|
|
104
|
-
|
|
105
|
-
vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
|
|
106
|
-
|
|
107
|
-
#endif
|
|
108
|
-
|
|
109
|
-
#endif
|
|
110
|
-
|
|
111
|
-
#ifdef USE_MAP
|
|
112
|
-
|
|
113
|
-
if ( vMaterialIndex == 1 ) {
|
|
114
|
-
diffuseColor *= texture2D( map_1, uv );
|
|
115
|
-
} else if ( vMaterialIndex == 2 ) {
|
|
116
|
-
diffuseColor *= texture2D( map_2, uv );
|
|
117
|
-
} else if ( vMaterialIndex == 3 ) {
|
|
118
|
-
diffuseColor *= texture2D( map_3, uv );
|
|
119
|
-
} else if ( vMaterialIndex == 4 ) {
|
|
120
|
-
diffuseColor *= texture2D( map_4, uv );
|
|
121
|
-
} else if ( vMaterialIndex == 5 ) {
|
|
122
|
-
diffuseColor *= texture2D( map_5, uv );
|
|
123
|
-
} else if ( vMaterialIndex == 6 ) {
|
|
124
|
-
diffuseColor *= texture2D( map_6, uv );
|
|
125
|
-
} else if ( vMaterialIndex == 7 ) {
|
|
126
|
-
diffuseColor *= texture2D( map_7, uv );
|
|
127
|
-
} else {
|
|
128
|
-
diffuseColor *= texture2D( map_0, uv );
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
#endif
|
|
132
|
-
|
|
133
|
-
#ifdef USE_ALPHAMAP
|
|
134
|
-
|
|
135
|
-
if ( vMaterialIndex == 1 ) {
|
|
136
|
-
diffuseColor *= texture2D( alphaMap_1, uv );
|
|
137
|
-
} else if ( vMaterialIndex == 2 ) {
|
|
138
|
-
diffuseColor *= texture2D( alphaMap_2, uv );
|
|
139
|
-
} else if ( vMaterialIndex == 3 ) {
|
|
140
|
-
diffuseColor *= texture2D( alphaMap_3, uv );
|
|
141
|
-
} else if ( vMaterialIndex == 4 ) {
|
|
142
|
-
diffuseColor *= texture2D( alphaMap_4, uv );
|
|
143
|
-
} else if ( vMaterialIndex == 5 ) {
|
|
144
|
-
diffuseColor *= texture2D( alphaMap_5, uv );
|
|
145
|
-
} else if ( vMaterialIndex == 6 ) {
|
|
146
|
-
diffuseColor *= texture2D( alphaMap_6, uv );
|
|
147
|
-
} else if ( vMaterialIndex == 7 ) {
|
|
148
|
-
diffuseColor *= texture2D( alphaMap_7, uv );
|
|
149
|
-
} else {
|
|
150
|
-
diffuseColor *= texture2D( alphaMap_0, uv );
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
#endif
|
|
154
|
-
|
|
155
|
-
#include <color_fragment>
|
|
156
|
-
#include <alphatest_fragment>
|
|
157
|
-
|
|
158
|
-
outgoingLight = diffuseColor.rgb;
|
|
159
|
-
|
|
160
|
-
#include <opaque_fragment>
|
|
161
|
-
#include <tonemapping_fragment>
|
|
162
|
-
#include <colorspace_fragment>
|
|
163
|
-
#include <fog_fragment>
|
|
164
|
-
#include <premultiplied_alpha_fragment>
|
|
165
|
-
|
|
166
|
-
}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
attribute float positionIndex;
|
|
2
|
-
flat varying int vMaterialIndex;
|
|
3
|
-
flat varying int vPositionIndex;
|
|
4
|
-
|
|
5
|
-
uniform float size_0;
|
|
6
|
-
uniform float size_1;
|
|
7
|
-
uniform float size_2;
|
|
8
|
-
uniform float size_3;
|
|
9
|
-
uniform float size_4;
|
|
10
|
-
uniform float size_5;
|
|
11
|
-
uniform float size_6;
|
|
12
|
-
uniform float size_7;
|
|
13
|
-
|
|
14
|
-
uniform bool sizeAttenuation_0;
|
|
15
|
-
uniform bool sizeAttenuation_1;
|
|
16
|
-
uniform bool sizeAttenuation_2;
|
|
17
|
-
uniform bool sizeAttenuation_3;
|
|
18
|
-
uniform bool sizeAttenuation_4;
|
|
19
|
-
uniform bool sizeAttenuation_5;
|
|
20
|
-
uniform bool sizeAttenuation_6;
|
|
21
|
-
uniform bool sizeAttenuation_7;
|
|
22
|
-
|
|
23
|
-
uniform highp usampler2D materialIndexDataTexture;
|
|
24
|
-
|
|
25
|
-
uniform float scale;
|
|
26
|
-
|
|
27
|
-
float getSize(int materialIndex) {
|
|
28
|
-
if ( materialIndex == 1 ) {
|
|
29
|
-
return size_1;
|
|
30
|
-
} else if ( materialIndex == 2 ) {
|
|
31
|
-
return size_2;
|
|
32
|
-
} else if ( materialIndex == 3 ) {
|
|
33
|
-
return size_3;
|
|
34
|
-
} else if ( materialIndex == 4 ) {
|
|
35
|
-
return size_4;
|
|
36
|
-
} else if ( materialIndex == 5 ) {
|
|
37
|
-
return size_5;
|
|
38
|
-
} else if ( materialIndex == 6 ) {
|
|
39
|
-
return size_6;
|
|
40
|
-
} else if ( materialIndex == 7 ) {
|
|
41
|
-
return size_7;
|
|
42
|
-
} else {
|
|
43
|
-
return size_0;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
bool getSizeAttenuation(int materialIndex) {
|
|
48
|
-
if ( materialIndex == 1 ) {
|
|
49
|
-
return sizeAttenuation_1;
|
|
50
|
-
} else if ( materialIndex == 2 ) {
|
|
51
|
-
return sizeAttenuation_2;
|
|
52
|
-
} else if ( materialIndex == 3 ) {
|
|
53
|
-
return sizeAttenuation_3;
|
|
54
|
-
} else if ( materialIndex == 4 ) {
|
|
55
|
-
return sizeAttenuation_4;
|
|
56
|
-
} else if ( materialIndex == 5 ) {
|
|
57
|
-
return sizeAttenuation_5;
|
|
58
|
-
} else if ( materialIndex == 6 ) {
|
|
59
|
-
return sizeAttenuation_6;
|
|
60
|
-
} else if ( materialIndex == 7 ) {
|
|
61
|
-
return sizeAttenuation_7;
|
|
62
|
-
} else {
|
|
63
|
-
return sizeAttenuation_0;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
#include <common>
|
|
68
|
-
#include <color_pars_vertex>
|
|
69
|
-
#include <fog_pars_vertex>
|
|
70
|
-
#include <morphtarget_pars_vertex>
|
|
71
|
-
#include <logdepthbuf_pars_vertex>
|
|
72
|
-
#include <clipping_planes_pars_vertex>
|
|
73
|
-
|
|
74
|
-
#ifdef USE_POINTS_UV
|
|
75
|
-
|
|
76
|
-
varying vec2 vUv;
|
|
77
|
-
uniform mat3 uvTransform;
|
|
78
|
-
|
|
79
|
-
#endif
|
|
80
|
-
|
|
81
|
-
int retrieveMaterialIndex() {
|
|
82
|
-
vec2 uv = vec2(positionIndex/1024.0, 0.5);
|
|
83
|
-
|
|
84
|
-
// get the value of a texture at a specific index
|
|
85
|
-
return int(texture2D(materialIndexDataTexture, uv).r);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
void main() {
|
|
89
|
-
int materialIndex = retrieveMaterialIndex();
|
|
90
|
-
vMaterialIndex = materialIndex;
|
|
91
|
-
|
|
92
|
-
float size = getSize(materialIndex);
|
|
93
|
-
bool sizeAttenuation = getSizeAttenuation(materialIndex);
|
|
94
|
-
|
|
95
|
-
#ifdef USE_POINTS_UV
|
|
96
|
-
|
|
97
|
-
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
|
|
98
|
-
|
|
99
|
-
#endif
|
|
100
|
-
|
|
101
|
-
#include <color_vertex>
|
|
102
|
-
#include <morphcolor_vertex>
|
|
103
|
-
#include <begin_vertex>
|
|
104
|
-
#include <morphtarget_vertex>
|
|
105
|
-
#include <project_vertex>
|
|
106
|
-
|
|
107
|
-
gl_PointSize = size;
|
|
108
|
-
|
|
109
|
-
if(sizeAttenuation) {
|
|
110
|
-
bool isPerspective = isPerspectiveMatrix( projectionMatrix );
|
|
111
|
-
if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
#include <logdepthbuf_vertex>
|
|
116
|
-
#include <clipping_planes_vertex>
|
|
117
|
-
#include <worldpos_vertex>
|
|
118
|
-
#include <fog_vertex>
|
|
119
|
-
|
|
120
|
-
}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
export const css = `
|
|
2
|
-
.sdv-error-message-container {
|
|
3
|
-
position: absolute;
|
|
4
|
-
top: 50%;
|
|
5
|
-
left: 50%;
|
|
6
|
-
transform: translate(-50%, -50%);
|
|
7
|
-
text-align: center;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.sdv-error-message {
|
|
11
|
-
font-family: "CircularXXWeb-Book", sans-serif;
|
|
12
|
-
font-size: x-large;
|
|
13
|
-
filter: invert(100);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.sdv-anchor-container {
|
|
17
|
-
user-select: none;
|
|
18
|
-
cursor: default;
|
|
19
|
-
pointer-events: none;
|
|
20
|
-
overflow: hidden;
|
|
21
|
-
position: absolute;
|
|
22
|
-
width: 100%;
|
|
23
|
-
height: 100%;
|
|
24
|
-
left: 0%;
|
|
25
|
-
top: 0%;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.sdv-anchor-inner-container {
|
|
29
|
-
position: absolute;
|
|
30
|
-
white-space: nowrap;
|
|
31
|
-
text-overflow: clip;
|
|
32
|
-
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.sdv-anchor-text {
|
|
36
|
-
user-select: none;
|
|
37
|
-
cursor: default;
|
|
38
|
-
pointer-events: none;
|
|
39
|
-
display: block;
|
|
40
|
-
text-overflow: clip;
|
|
41
|
-
overflow: hidden;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.sdv-anchor-image {
|
|
45
|
-
user-select: none;
|
|
46
|
-
cursor: default;
|
|
47
|
-
pointer-events: none;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.sdv-logo-container {
|
|
51
|
-
position: relative;
|
|
52
|
-
height: 100%;
|
|
53
|
-
width: 100%;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.sdv-logo {
|
|
57
|
-
position: absolute;
|
|
58
|
-
top: 50%;
|
|
59
|
-
left: 50%;
|
|
60
|
-
max-width: calc(100% - 0.5);
|
|
61
|
-
max-height: calc(100% - 0.5);
|
|
62
|
-
transform: translate(-50%, -50%);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.sdv-spinner-container {
|
|
66
|
-
position: absolute;
|
|
67
|
-
height: 100%;
|
|
68
|
-
width: 100%;
|
|
69
|
-
top: 0;
|
|
70
|
-
left: 0;
|
|
71
|
-
user-select: none;
|
|
72
|
-
cursor: default;
|
|
73
|
-
pointer-events: none;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.sdv-spinner {
|
|
77
|
-
position: absolute;
|
|
78
|
-
max-width: calc(100% * 0.15);
|
|
79
|
-
max-height: calc(100% * 0.15);
|
|
80
|
-
mix-blend-mode: difference;
|
|
81
|
-
filter: invert(1) grayscale(100%);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.sdv-spinner-top-left {
|
|
85
|
-
left: calc(100% * 0.01);
|
|
86
|
-
top: calc(100% * 0.01);
|
|
87
|
-
float: left;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.sdv-spinner-top-right {
|
|
91
|
-
right: calc(100% * 0.01);
|
|
92
|
-
top: calc(100% * 0.01);
|
|
93
|
-
float: right;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.sdv-spinner-bottom-left {
|
|
97
|
-
left: calc(100% * 0.01);
|
|
98
|
-
bottom: calc(100% * 0.01);
|
|
99
|
-
float: left;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.sdv-spinner-bottom-right {
|
|
103
|
-
right: calc(100% * 0.01);
|
|
104
|
-
bottom: calc(100% * 0.01);
|
|
105
|
-
float: right;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.sdv-spinner-center {
|
|
109
|
-
top: 50%;
|
|
110
|
-
left: 50%;
|
|
111
|
-
transform: translate(-50%, -50%);
|
|
112
|
-
}
|
|
113
|
-
`;
|