@kitware/vtk.js 24.5.1 → 24.5.4
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/Common/Core/Base64.d.ts +4 -2
- package/Common/Core/CellArray.d.ts +2 -2
- package/Common/Core/DataArray.d.ts +2 -2
- package/Common/Core/Endian.d.ts +1 -1
- package/Common/Core/ImageHelper.d.ts +1 -1
- package/Common/Core/LookupTable.d.ts +1 -1
- package/Common/Core/Math/index.js +1 -1
- package/Common/Core/Math.d.ts +1 -1
- package/Common/Core/Math.js +1 -1
- package/Common/Core/MatrixBuilder.d.ts +1 -1
- package/Common/Core/Points.d.ts +2 -2
- package/Common/Core/PriorityQueue.d.ts +1 -1
- package/Common/Core/ProgressHandler.d.ts +1 -1
- package/Common/Core/ScalarsToColors.d.ts +3 -3
- package/Common/Core/StringArray.d.ts +1 -1
- package/Common/Core/VariantArray.d.ts +1 -1
- package/Common/DataModel/Box.d.ts +2 -2
- package/Common/DataModel/CardinalSpline1D.d.ts +1 -1
- package/Common/DataModel/Cell.d.ts +3 -3
- package/Common/DataModel/Cone.d.ts +2 -2
- package/Common/DataModel/Cylinder.d.ts +2 -2
- package/Common/DataModel/DataSet.d.ts +1 -1
- package/Common/DataModel/DataSetAttributes/FieldData.d.ts +4 -2
- package/Common/DataModel/DataSetAttributes.d.ts +3 -3
- package/Common/DataModel/ImageData.d.ts +1 -1
- package/Common/DataModel/Line.d.ts +1 -1
- package/Common/DataModel/PiecewiseFunction.d.ts +2 -2
- package/Common/DataModel/Plane.d.ts +2 -2
- package/Common/DataModel/PointSet.d.ts +2 -2
- package/Common/DataModel/PolyData.d.ts +2 -2
- package/Common/DataModel/Polygon.d.ts +2 -2
- package/Common/DataModel/SelectionNode.d.ts +2 -2
- package/Common/DataModel/Sphere.d.ts +2 -2
- package/Common/DataModel/Spline1D.d.ts +1 -1
- package/Common/DataModel/Spline3D.d.ts +1 -1
- package/Common/DataModel/Triangle.d.ts +1 -1
- package/Common/DataModel/Triangle.js +1 -1
- package/Common/Transform/LandmarkTransform.d.ts +2 -2
- package/Common/Transform/LandmarkTransform.js +1 -1
- package/Filters/Core/PolyDataNormals.js +1 -1
- package/Filters/General/AppendPolyData.d.ts +1 -1
- package/Filters/General/ImageCropFilter.d.ts +1 -1
- package/Filters/General/ImageOutlineFilter.d.ts +1 -1
- package/Filters/General/ImageSliceFilter.d.ts +1 -1
- package/Filters/General/ImageStreamline.d.ts +3 -3
- package/Filters/General/LineFilter.d.ts +1 -1
- package/Filters/General/OBBTree.js +1 -1
- package/Filters/General/OutlineFilter.d.ts +1 -1
- package/Filters/General/TriangleFilter.d.ts +1 -1
- package/Filters/General/TubeFilter.d.ts +2 -2
- package/Filters/General/WindowedSincPolyDataFilter.js +1 -1
- package/Filters/Sources/Arrow2DSource.d.ts +2 -2
- package/Filters/Sources/ArrowSource.d.ts +2 -2
- package/Filters/Sources/CircleSource.d.ts +2 -2
- package/Filters/Sources/CircleSource.js +1 -1
- package/Filters/Sources/ConeSource.d.ts +2 -2
- package/Filters/Sources/CubeSource.d.ts +2 -2
- package/Filters/Sources/Cursor3D.d.ts +3 -3
- package/Filters/Sources/CylinderSource.d.ts +2 -2
- package/Filters/Sources/LineSource.d.ts +2 -2
- package/Filters/Sources/PlaneSource.d.ts +2 -2
- package/Filters/Sources/PointSource.d.ts +2 -2
- package/Filters/Sources/PointSource.js +1 -1
- package/Filters/Sources/SphereSource.d.ts +2 -2
- package/Filters/Texture/TextureMapToPlane.d.ts +1 -1
- package/Filters/Texture/TextureMapToPlane.js +1 -1
- package/Filters/Texture/TextureMapToSphere.d.ts +1 -1
- package/IO/Core/DataAccessHelper.d.ts +4 -4
- package/IO/Core/HttpDataSetReader.d.ts +1 -1
- package/IO/Core/HttpSceneLoader.d.ts +5 -5
- package/IO/Core/ImageStream/DefaultProtocol.d.ts +1 -1
- package/IO/Core/ImageStream/ViewStream.d.ts +4 -4
- package/IO/Core/ImageStream.d.ts +3 -3
- package/IO/Core/WSLinkClient.d.ts +1 -1
- package/IO/Geometry/DracoReader.d.ts +5 -5
- package/IO/Geometry/PLYReader.d.ts +5 -5
- package/IO/Geometry/PLYWriter.d.ts +2 -2
- package/IO/Geometry/STLReader.d.ts +5 -5
- package/IO/Geometry/STLWriter.d.ts +2 -2
- package/IO/Misc/ElevationReader.d.ts +5 -5
- package/IO/Misc/ITKImageReader.d.ts +1 -1
- package/IO/Misc/ITKPolyDataReader.d.ts +1 -1
- package/IO/Misc/JSONNucleoReader.d.ts +5 -5
- package/IO/Misc/JSONReader.d.ts +1 -1
- package/IO/Misc/MTLReader.d.ts +6 -6
- package/IO/Misc/OBJReader.d.ts +5 -5
- package/IO/Misc/PDBReader.d.ts +5 -5
- package/IO/XML/XMLReader.d.ts +5 -5
- package/Interaction/Manipulators/MouseCameraTrackballRollManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraTrackballRotateManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraUnicamManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraUnicamRotateManipulator.js +1 -1
- package/Interaction/Style/InteractorStyleTrackballCamera.js +1 -1
- package/Interaction/Widgets/OrientationMarkerWidget.d.ts +6 -6
- package/Interaction/Widgets/PiecewiseGaussianWidget.js +1 -1
- package/Proxy/Core/View2DProxy.js +1 -1
- package/Rendering/Core/AbstractMapper.d.ts +2 -2
- package/Rendering/Core/AbstractMapper3D.d.ts +1 -1
- package/Rendering/Core/AbstractPicker.d.ts +2 -2
- package/Rendering/Core/Actor.d.ts +1 -1
- package/Rendering/Core/Actor2D.d.ts +1 -1
- package/Rendering/Core/Camera.d.ts +2 -2
- package/Rendering/Core/CellPicker.d.ts +2 -2
- package/Rendering/Core/ColorTransferFunction.d.ts +1 -1
- package/Rendering/Core/ColorTransferFunction.js +1 -1
- package/Rendering/Core/Coordinate.d.ts +1 -1
- package/Rendering/Core/Coordinate.js +1 -1
- package/Rendering/Core/CubeAxesActor.js +1 -1
- package/Rendering/Core/Glyph3DMapper.d.ts +1 -1
- package/Rendering/Core/Glyph3DMapper.js +1 -1
- package/Rendering/Core/ImageMapper.d.ts +1 -1
- package/Rendering/Core/ImageMapper.js +1 -1
- package/Rendering/Core/ImageProperty.d.ts +1 -1
- package/Rendering/Core/ImageSlice.d.ts +1 -1
- package/Rendering/Core/Light.d.ts +2 -2
- package/Rendering/Core/Mapper.d.ts +1 -1
- package/Rendering/Core/Mapper.js +1 -1
- package/Rendering/Core/Mapper2D.d.ts +1 -1
- package/Rendering/Core/Picker.d.ts +1 -1
- package/Rendering/Core/PointPicker.d.ts +1 -1
- package/Rendering/Core/Prop.d.ts +1 -1
- package/Rendering/Core/Prop3D.d.ts +1 -1
- package/Rendering/Core/Prop3D.js +1 -1
- package/Rendering/Core/Property.d.ts +2 -2
- package/Rendering/Core/Property2D.d.ts +2 -2
- package/Rendering/Core/RenderWindow.d.ts +2 -2
- package/Rendering/Core/RenderWindowInteractor.d.ts +123 -109
- package/Rendering/Core/RenderWindowInteractor.js +1 -1
- package/Rendering/Core/Renderer.d.ts +1 -1
- package/Rendering/Core/Renderer.js +1 -1
- package/Rendering/Core/ScalarBarActor.d.ts +2 -2
- package/Rendering/Core/ScalarBarActor.js +3 -3
- package/Rendering/Core/Texture.d.ts +1 -1
- package/Rendering/Core/Viewport.d.ts +2 -2
- package/Rendering/Core/Volume.d.ts +1 -1
- package/Rendering/Core/VolumeMapper.d.ts +1 -1
- package/Rendering/Core/VolumeMapper.js +1 -1
- package/Rendering/Core/VolumeProperty.d.ts +1 -1
- package/Rendering/Misc/CanvasView.d.ts +2 -2
- package/Rendering/Misc/FullScreenRenderWindow.d.ts +8 -8
- package/Rendering/Misc/GenericRenderWindow.d.ts +6 -6
- package/Rendering/Misc/RemoteView.d.ts +2 -2
- package/Rendering/Misc/RenderWindowWithControlBar.d.ts +1 -1
- package/Rendering/Misc/SynchronizableRenderWindow.d.ts +2 -2
- package/Rendering/Misc/TextureLODsDownloader.d.ts +3 -3
- package/Rendering/OpenGL/OrderIndependentTranslucentPass.js +5 -1
- package/Rendering/OpenGL/PolyDataMapper2D.js +1 -1
- package/Rendering/OpenGL/RenderWindow.d.ts +7 -7
- package/Rendering/OpenGL/Texture.js +1 -1
- package/Rendering/OpenGL/VolumeMapper.js +1 -1
- package/Rendering/SceneGraph/RenderPass.d.ts +1 -1
- package/Rendering/SceneGraph/ViewNode.d.ts +1 -1
- package/Rendering/SceneGraph/ViewNode.js +28 -2
- package/Rendering/SceneGraph/ViewNodeFactory.d.ts +1 -1
- package/Rendering/WebGPU/CellArrayMapper.js +629 -0
- package/Rendering/WebGPU/FullScreenQuad.js +4 -6
- package/Rendering/WebGPU/Glyph3DMapper.js +60 -27
- package/Rendering/WebGPU/ImageMapper.js +23 -60
- package/Rendering/WebGPU/OrderIndependentTranslucentPass.js +4 -6
- package/Rendering/WebGPU/Pipeline.js +12 -0
- package/Rendering/WebGPU/PolyDataMapper.js +49 -623
- package/Rendering/WebGPU/RenderEncoder.js +34 -0
- package/Rendering/WebGPU/Renderer.js +4 -62
- package/Rendering/WebGPU/ShaderDescription.js +6 -6
- package/Rendering/WebGPU/{MapperHelper.js → SimpleMapper.js} +64 -38
- package/Rendering/WebGPU/SphereMapper.js +41 -37
- package/Rendering/WebGPU/StickMapper.js +35 -30
- package/Rendering/WebGPU/StorageBuffer.js +2 -2
- package/Rendering/WebGPU/UniformBuffer.js +1 -1
- package/Rendering/WebGPU/Volume.js +1 -14
- package/Rendering/WebGPU/VolumePass.js +15 -19
- package/Rendering/WebGPU/VolumePassFSQ.js +19 -25
- package/Widgets/Manipulators/LineManipulator.d.ts +1 -1
- package/Widgets/Manipulators/LineManipulator.js +1 -1
- package/Widgets/Manipulators/PlaneManipulator.d.ts +1 -1
- package/Widgets/Manipulators/TrackballManipulator.d.ts +1 -1
- package/Widgets/Representations/PolyLineRepresentation.js +1 -1
- package/Widgets/Representations/ResliceCursorContextRepresentation.js +1 -1
- package/Widgets/Representations/WidgetRepresentation.d.ts +1 -1
- package/Widgets/Widgets3D/AngleWidget.js +1 -1
- package/Widgets/Widgets3D/LineWidget/helpers.js +1 -1
- package/Widgets/Widgets3D/ResliceCursorWidget/behavior.js +1 -1
- package/Widgets/Widgets3D/ResliceCursorWidget/helpers.js +1 -1
- package/Widgets/Widgets3D/ResliceCursorWidget.js +1 -1
- package/Widgets/Widgets3D/ShapeWidget/behavior.js +1 -1
- package/Widgets/Widgets3D/SphereWidget.d.ts +2 -2
- package/index.d.ts +2 -2
- package/interfaces.d.ts +2 -2
- package/macros.d.ts +1 -1
- package/package.json +1 -1
- package/types.d.ts +1 -1
- package/tsconfig.json +0 -8
|
@@ -10,6 +10,7 @@ function vtkWebGPURenderEncoder(publicAPI, model) {
|
|
|
10
10
|
model.classHierarchy.push('vtkWebGPURenderEncoder');
|
|
11
11
|
|
|
12
12
|
publicAPI.begin = function (encoder) {
|
|
13
|
+
model.drawCallbacks = [];
|
|
13
14
|
model.handle = encoder.beginRenderPass(model.description);
|
|
14
15
|
|
|
15
16
|
if (model.label) {
|
|
@@ -18,14 +19,30 @@ function vtkWebGPURenderEncoder(publicAPI, model) {
|
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
publicAPI.end = function () {
|
|
22
|
+
// loop over registered pipelines and their callbacks
|
|
23
|
+
for (var i = 0; i < model.drawCallbacks.length; i++) {
|
|
24
|
+
var pStruct = model.drawCallbacks[i];
|
|
25
|
+
var pl = pStruct.pipeline;
|
|
26
|
+
publicAPI.setPipeline(pl);
|
|
27
|
+
|
|
28
|
+
for (var cb = 0; cb < pStruct.callbacks.length; cb++) {
|
|
29
|
+
pStruct.callbacks[cb](publicAPI);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
21
33
|
if (model.label) {
|
|
22
34
|
model.handle.popDebugGroup();
|
|
23
35
|
}
|
|
24
36
|
|
|
25
37
|
model.handle.end();
|
|
38
|
+
model.boundPipeline = null;
|
|
26
39
|
};
|
|
27
40
|
|
|
28
41
|
publicAPI.setPipeline = function (pl) {
|
|
42
|
+
if (model.boundPipeline === pl) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
29
46
|
model.handle.setPipeline(pl.getHandle());
|
|
30
47
|
var pd = pl.getPipelineDescription(); // check attachment state
|
|
31
48
|
|
|
@@ -57,6 +74,7 @@ function vtkWebGPURenderEncoder(publicAPI, model) {
|
|
|
57
74
|
}
|
|
58
75
|
|
|
59
76
|
model.boundPipeline = pl;
|
|
77
|
+
pl.draw(publicAPI);
|
|
60
78
|
};
|
|
61
79
|
|
|
62
80
|
publicAPI.replaceShaderCode = function (pipeline) {
|
|
@@ -100,6 +118,22 @@ function vtkWebGPURenderEncoder(publicAPI, model) {
|
|
|
100
118
|
if (model.depthTextureView) {
|
|
101
119
|
model.description.depthStencilAttachment.view = model.depthTextureView.getHandle();
|
|
102
120
|
}
|
|
121
|
+
}; // register pipeline callbacks from a mapper
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
publicAPI.registerDrawCallback = function (pipeline, cb) {
|
|
125
|
+
// if there is a matching pipeline just add the cb
|
|
126
|
+
for (var i = 0; i < model.drawCallbacks.length; i++) {
|
|
127
|
+
if (model.drawCallbacks[i].pipeline === pipeline) {
|
|
128
|
+
model.drawCallbacks[i].callbacks.push(cb);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
model.drawCallbacks.push({
|
|
134
|
+
pipeline: pipeline,
|
|
135
|
+
callbacks: [cb]
|
|
136
|
+
});
|
|
103
137
|
}; // simple forwarders
|
|
104
138
|
|
|
105
139
|
|
|
@@ -93,22 +93,6 @@ function vtkWebGPURenderer(publicAPI, model) {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
return count;
|
|
96
|
-
}; // register pipeline callbacks from a mapper
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
publicAPI.registerPipelineCallback = function (pipeline, cb) {
|
|
100
|
-
// if there is a matching pipeline just add the cb
|
|
101
|
-
for (var i = 0; i < model.pipelineCallbacks.length; i++) {
|
|
102
|
-
if (model.pipelineCallbacks[i].pipeline === pipeline) {
|
|
103
|
-
model.pipelineCallbacks[i].callbacks.push(cb);
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
model.pipelineCallbacks.push({
|
|
109
|
-
pipeline: pipeline,
|
|
110
|
-
callbacks: [cb]
|
|
111
|
-
});
|
|
112
96
|
};
|
|
113
97
|
|
|
114
98
|
publicAPI.updateUBO = function () {
|
|
@@ -148,25 +132,11 @@ function vtkWebGPURenderer(publicAPI, model) {
|
|
|
148
132
|
|
|
149
133
|
publicAPI.opaquePass = function (prepass) {
|
|
150
134
|
if (prepass) {
|
|
151
|
-
// clear last pipelines
|
|
152
|
-
model.pipelineCallbacks = [];
|
|
153
135
|
model.renderEncoder.begin(model._parent.getCommandEncoder());
|
|
154
136
|
publicAPI.updateUBO();
|
|
155
137
|
} else {
|
|
156
138
|
publicAPI.scissorAndViewport(model.renderEncoder);
|
|
157
|
-
publicAPI.clear();
|
|
158
|
-
|
|
159
|
-
for (var i = 0; i < model.pipelineCallbacks.length; i++) {
|
|
160
|
-
var pStruct = model.pipelineCallbacks[i];
|
|
161
|
-
var pl = pStruct.pipeline;
|
|
162
|
-
model.renderEncoder.setPipeline(pl);
|
|
163
|
-
publicAPI.bindUBO(model.renderEncoder);
|
|
164
|
-
|
|
165
|
-
for (var cb = 0; cb < pStruct.callbacks.length; cb++) {
|
|
166
|
-
pStruct.callbacks[cb](model.renderEncoder);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
139
|
+
publicAPI.clear();
|
|
170
140
|
model.renderEncoder.end();
|
|
171
141
|
}
|
|
172
142
|
};
|
|
@@ -193,51 +163,23 @@ function vtkWebGPURenderer(publicAPI, model) {
|
|
|
193
163
|
var background = model.renderable.getBackgroundByReference();
|
|
194
164
|
model.clearFSQ.getUBO().setArray('BackgroundColor', background);
|
|
195
165
|
model.clearFSQ.getUBO().sendIfNeeded(device);
|
|
196
|
-
model.clearFSQ.
|
|
166
|
+
model.clearFSQ.prepareAndDraw(model.renderEncoder);
|
|
197
167
|
};
|
|
198
168
|
|
|
199
169
|
publicAPI.translucentPass = function (prepass) {
|
|
200
170
|
if (prepass) {
|
|
201
|
-
// clear last pipelines
|
|
202
|
-
model.pipelineCallbacks = [];
|
|
203
171
|
model.renderEncoder.begin(model._parent.getCommandEncoder());
|
|
204
172
|
} else {
|
|
205
|
-
publicAPI.scissorAndViewport(model.renderEncoder);
|
|
206
|
-
|
|
207
|
-
for (var i = 0; i < model.pipelineCallbacks.length; i++) {
|
|
208
|
-
var pStruct = model.pipelineCallbacks[i];
|
|
209
|
-
var pl = pStruct.pipeline;
|
|
210
|
-
model.renderEncoder.setPipeline(pl);
|
|
211
|
-
publicAPI.bindUBO(model.renderEncoder);
|
|
212
|
-
|
|
213
|
-
for (var cb = 0; cb < pStruct.callbacks.length; cb++) {
|
|
214
|
-
pStruct.callbacks[cb](model.renderEncoder);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
173
|
+
publicAPI.scissorAndViewport(model.renderEncoder);
|
|
218
174
|
model.renderEncoder.end();
|
|
219
175
|
}
|
|
220
176
|
};
|
|
221
177
|
|
|
222
178
|
publicAPI.volumeDepthRangePass = function (prepass) {
|
|
223
179
|
if (prepass) {
|
|
224
|
-
// clear last pipelines
|
|
225
|
-
model.pipelineCallbacks = [];
|
|
226
180
|
model.renderEncoder.begin(model._parent.getCommandEncoder());
|
|
227
181
|
} else {
|
|
228
|
-
publicAPI.scissorAndViewport(model.renderEncoder);
|
|
229
|
-
|
|
230
|
-
for (var i = 0; i < model.pipelineCallbacks.length; i++) {
|
|
231
|
-
var pStruct = model.pipelineCallbacks[i];
|
|
232
|
-
var pl = pStruct.pipeline;
|
|
233
|
-
model.renderEncoder.setPipeline(pl);
|
|
234
|
-
publicAPI.bindUBO(model.renderEncoder);
|
|
235
|
-
|
|
236
|
-
for (var cb = 0; cb < pStruct.callbacks.length; cb++) {
|
|
237
|
-
pStruct.callbacks[cb](model.renderEncoder);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
182
|
+
publicAPI.scissorAndViewport(model.renderEncoder);
|
|
241
183
|
model.renderEncoder.end();
|
|
242
184
|
}
|
|
243
185
|
};
|
|
@@ -51,15 +51,15 @@ function vtkWebGPUShaderDescription(publicAPI, model) {
|
|
|
51
51
|
|
|
52
52
|
for (var i = 0; i < inputNames.length; i++) {
|
|
53
53
|
if (inputInterpolations[i] !== undefined) {
|
|
54
|
-
inputStruct.push(" @location(".concat(i, ") @interpolate(").concat(inputInterpolations[i], ") ").concat(inputNames[i], " : ").concat(inputTypes[i], "
|
|
54
|
+
inputStruct.push(" @location(".concat(i, ") @interpolate(").concat(inputInterpolations[i], ") ").concat(inputNames[i], " : ").concat(inputTypes[i], ","));
|
|
55
55
|
} else {
|
|
56
|
-
inputStruct.push(" @location(".concat(i, ") ").concat(inputNames[i], " : ").concat(inputTypes[i], "
|
|
56
|
+
inputStruct.push(" @location(".concat(i, ") ").concat(inputNames[i], " : ").concat(inputTypes[i], ","));
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
for (var _i = 0; _i < model.builtinInputNames.length; _i++) {
|
|
62
|
-
inputStruct.push(" ".concat(model.builtinInputNames[_i], " : ").concat(model.builtinInputTypes[_i], "
|
|
62
|
+
inputStruct.push(" ".concat(model.builtinInputNames[_i], " : ").concat(model.builtinInputTypes[_i], ","));
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
if (inputStruct.length > 1) {
|
|
@@ -79,14 +79,14 @@ function vtkWebGPUShaderDescription(publicAPI, model) {
|
|
|
79
79
|
|
|
80
80
|
for (var _i2 = 0; _i2 < model.outputNames.length; _i2++) {
|
|
81
81
|
if (model.outputInterpolations[_i2] !== undefined) {
|
|
82
|
-
outputStruct.push(" @location(".concat(_i2, ") @interpolate(").concat(model.outputInterpolations[_i2], ") ").concat(model.outputNames[_i2], " : ").concat(model.outputTypes[_i2], "
|
|
82
|
+
outputStruct.push(" @location(".concat(_i2, ") @interpolate(").concat(model.outputInterpolations[_i2], ") ").concat(model.outputNames[_i2], " : ").concat(model.outputTypes[_i2], ","));
|
|
83
83
|
} else {
|
|
84
|
-
outputStruct.push(" @location(".concat(_i2, ") ").concat(model.outputNames[_i2], " : ").concat(model.outputTypes[_i2], "
|
|
84
|
+
outputStruct.push(" @location(".concat(_i2, ") ").concat(model.outputNames[_i2], " : ").concat(model.outputTypes[_i2], ","));
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
for (var _i3 = 0; _i3 < model.builtinOutputNames.length; _i3++) {
|
|
89
|
-
outputStruct.push(" ".concat(model.builtinOutputNames[_i3], " : ").concat(model.builtinOutputTypes[_i3], "
|
|
89
|
+
outputStruct.push(" ".concat(model.builtinOutputNames[_i3], " : ").concat(model.builtinOutputTypes[_i3], ","));
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
outputStruct.push('};');
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
2
2
|
import macro from '../../macros.js';
|
|
3
|
+
import vtkViewNode from '../SceneGraph/ViewNode.js';
|
|
3
4
|
import vtkWebGPUBindGroup from './BindGroup.js';
|
|
4
5
|
import vtkWebGPUPipeline from './Pipeline.js';
|
|
5
6
|
import vtkWebGPUShaderCache from './ShaderCache.js';
|
|
6
7
|
import vtkWebGPUShaderDescription from './ShaderDescription.js';
|
|
7
8
|
import vtkWebGPUVertexInput from './VertexInput.js';
|
|
8
9
|
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
//
|
|
10
|
+
var vtkWebGPUSimpleMapperVS = "\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n//VTK::Normal::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Select::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n@stage(vertex)\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : vertexOutput;\n\n // var vertex: vec4<f32> = vertexBC;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n //VTK::Position::Impl\n\n return output;\n}\n";
|
|
11
|
+
var vtkWebGPUSimpleMapperFS = "\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n//VTK::Normal::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Select::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n@stage(fragment)\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : fragmentOutput;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::Light::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n // var computedColor:vec4<f32> = vec4<f32>(1.0,0.5,0.5,1.0);\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n"; // ----------------------------------------------------------------------------
|
|
12
|
+
// vtkWebGPUSimpleMapper methods
|
|
12
13
|
// ----------------------------------------------------------------------------
|
|
13
14
|
|
|
14
|
-
function
|
|
15
|
+
function vtkWebGPUSimpleMapper(publicAPI, model) {
|
|
15
16
|
// Set our className
|
|
16
|
-
model.classHierarchy.push('
|
|
17
|
+
model.classHierarchy.push('vtkWebGPUSimpleMapper');
|
|
17
18
|
|
|
18
19
|
publicAPI.generateShaderDescriptions = function (hash, pipeline, vertexInput) {
|
|
19
20
|
// create the shader descriptions
|
|
@@ -126,32 +127,59 @@ function vtkWebGPUMapperHelper(publicAPI, model) {
|
|
|
126
127
|
}
|
|
127
128
|
|
|
128
129
|
model.textureViews.push(view);
|
|
130
|
+
}; // do everything required for this mapper to be rerady to draw
|
|
131
|
+
// but do not bind or do the actual draw commands as the pipeline
|
|
132
|
+
// is not neccessarily bound yet
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
publicAPI.prepareToDraw = function (renderEncoder) {
|
|
136
|
+
model.renderEncoder = renderEncoder; // do anything needed to get our input data up to date
|
|
137
|
+
|
|
138
|
+
publicAPI.updateInput(); // make sure buffers are created and up to date
|
|
139
|
+
|
|
140
|
+
publicAPI.updateBuffers(); // update bindings and bind groups/layouts
|
|
141
|
+
// does not acutally bind them, that is done in draw(...)
|
|
142
|
+
|
|
143
|
+
publicAPI.updateBindings(); // update the pipeline, includes computing the hash, and if needed
|
|
144
|
+
// creating the pipeline, shader code etc
|
|
145
|
+
|
|
146
|
+
publicAPI.updatePipeline();
|
|
129
147
|
};
|
|
130
148
|
|
|
131
|
-
publicAPI.
|
|
132
|
-
var pipeline = renderEncoder.getBoundPipeline(); // bind the mapper bind group
|
|
149
|
+
publicAPI.updateInput = function () {};
|
|
133
150
|
|
|
134
|
-
|
|
151
|
+
publicAPI.updateBuffers = function () {};
|
|
135
152
|
|
|
136
|
-
|
|
137
|
-
|
|
153
|
+
publicAPI.updateBindings = function () {
|
|
154
|
+
// bindings can change without a pipeline change
|
|
155
|
+
// as long as their layout remains the same.
|
|
156
|
+
// That is why this is done even when the pipeline
|
|
157
|
+
// hash doesn't change.
|
|
158
|
+
model.bindGroup.setBindables(publicAPI.getBindables());
|
|
138
159
|
};
|
|
139
160
|
|
|
140
|
-
publicAPI.
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
161
|
+
publicAPI.computePipelineHash = function () {};
|
|
162
|
+
|
|
163
|
+
publicAPI.registerDrawCallback = function (encoder) {
|
|
164
|
+
encoder.registerDrawCallback(model.pipeline, publicAPI.draw);
|
|
144
165
|
};
|
|
145
166
|
|
|
146
|
-
publicAPI.
|
|
147
|
-
publicAPI.
|
|
148
|
-
|
|
167
|
+
publicAPI.prepareAndDraw = function (encoder) {
|
|
168
|
+
publicAPI.prepareToDraw(encoder);
|
|
169
|
+
encoder.setPipeline(model.pipeline);
|
|
170
|
+
publicAPI.draw(encoder);
|
|
171
|
+
}; // do the rest of the calls required to draw this mapper
|
|
172
|
+
// at this point the command encouder and pipeline are
|
|
173
|
+
// created and bound
|
|
149
174
|
|
|
150
|
-
if (model.WebGPURenderer) {
|
|
151
|
-
model.WebGPURenderer.bindUBO(renderEncoder);
|
|
152
|
-
}
|
|
153
175
|
|
|
154
|
-
|
|
176
|
+
publicAPI.draw = function (renderEncoder) {
|
|
177
|
+
var pipeline = renderEncoder.getBoundPipeline(); // bind the mapper bind group
|
|
178
|
+
|
|
179
|
+
renderEncoder.activateBindGroup(model.bindGroup); // bind the vertex input
|
|
180
|
+
|
|
181
|
+
pipeline.bindVertexInput(renderEncoder, model.vertexInput);
|
|
182
|
+
renderEncoder.draw(model.numberOfVertices, model.numberOfInstances, 0, 0);
|
|
155
183
|
};
|
|
156
184
|
|
|
157
185
|
publicAPI.getBindables = function () {
|
|
@@ -178,27 +206,25 @@ function vtkWebGPUMapperHelper(publicAPI, model) {
|
|
|
178
206
|
return bindables;
|
|
179
207
|
};
|
|
180
208
|
|
|
181
|
-
publicAPI.
|
|
182
|
-
|
|
183
|
-
model.
|
|
184
|
-
model.pipeline = device.getPipeline(model.pipelineHash);
|
|
185
|
-
model.bindGroup.setBindables(publicAPI.getBindables()); // build VBO for this primitive
|
|
186
|
-
// build the pipeline if needed
|
|
209
|
+
publicAPI.updatePipeline = function () {
|
|
210
|
+
publicAPI.computePipelineHash();
|
|
211
|
+
model.pipeline = model.device.getPipeline(model.pipelineHash); // build the pipeline if needed
|
|
187
212
|
|
|
188
213
|
if (!model.pipeline) {
|
|
189
214
|
model.pipeline = vtkWebGPUPipeline.newInstance();
|
|
190
|
-
model.pipeline.setDevice(device);
|
|
215
|
+
model.pipeline.setDevice(model.device);
|
|
191
216
|
|
|
192
217
|
if (model.WebGPURenderer) {
|
|
193
218
|
model.pipeline.addBindGroupLayout(model.WebGPURenderer.getBindGroup());
|
|
219
|
+
model.pipeline.addDrawCallback(model.WebGPURenderer.bindUBO);
|
|
194
220
|
}
|
|
195
221
|
|
|
196
222
|
model.pipeline.addBindGroupLayout(model.bindGroup);
|
|
197
223
|
publicAPI.generateShaderDescriptions(model.pipelineHash, model.pipeline, model.vertexInput);
|
|
198
224
|
model.pipeline.setTopology(model.topology);
|
|
199
|
-
model.pipeline.setRenderEncoder(renderEncoder);
|
|
225
|
+
model.pipeline.setRenderEncoder(model.renderEncoder);
|
|
200
226
|
model.pipeline.setVertexState(model.vertexInput.getVertexInputInformation());
|
|
201
|
-
device.createPipeline(model.pipelineHash, model.pipeline);
|
|
227
|
+
model.device.createPipeline(model.pipelineHash, model.pipeline);
|
|
202
228
|
}
|
|
203
229
|
};
|
|
204
230
|
} // ----------------------------------------------------------------------------
|
|
@@ -227,28 +253,28 @@ function extend(publicAPI, model) {
|
|
|
227
253
|
var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
228
254
|
Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance
|
|
229
255
|
|
|
230
|
-
|
|
256
|
+
vtkViewNode.extend(publicAPI, model, initialValues);
|
|
231
257
|
model.textureViews = [];
|
|
232
258
|
model.vertexInput = vtkWebGPUVertexInput.newInstance();
|
|
233
259
|
model.bindGroup = vtkWebGPUBindGroup.newInstance({
|
|
234
260
|
label: 'mapperBG'
|
|
235
261
|
});
|
|
236
262
|
model.additionalBindables = [];
|
|
237
|
-
model.fragmentShaderTemplate = model.fragmentShaderTemplate ||
|
|
238
|
-
model.vertexShaderTemplate = model.vertexShaderTemplate ||
|
|
263
|
+
model.fragmentShaderTemplate = model.fragmentShaderTemplate || vtkWebGPUSimpleMapperFS;
|
|
264
|
+
model.vertexShaderTemplate = model.vertexShaderTemplate || vtkWebGPUSimpleMapperVS;
|
|
239
265
|
model.shaderReplacements = new Map(); // Build VTK API
|
|
240
266
|
|
|
241
|
-
macro.get(publicAPI, model, ['vertexInput']);
|
|
267
|
+
macro.get(publicAPI, model, ['pipeline', 'vertexInput']);
|
|
242
268
|
macro.setGet(publicAPI, model, ['additionalBindables', 'device', 'fragmentShaderTemplate', 'interpolate', 'numberOfInstances', 'numberOfVertices', 'pipelineHash', 'shaderReplacements', 'SSBO', 'textureViews', 'topology', 'UBO', 'vertexShaderTemplate', 'WebGPURenderer']); // Object methods
|
|
243
269
|
|
|
244
|
-
|
|
270
|
+
vtkWebGPUSimpleMapper(publicAPI, model);
|
|
245
271
|
} // ----------------------------------------------------------------------------
|
|
246
272
|
|
|
247
|
-
var newInstance = macro.newInstance(extend, '
|
|
273
|
+
var newInstance = macro.newInstance(extend, 'vtkWebGPUSimpleMapper'); // ----------------------------------------------------------------------------
|
|
248
274
|
|
|
249
|
-
var
|
|
275
|
+
var vtkWebGPUSimpleMapper$1 = {
|
|
250
276
|
newInstance: newInstance,
|
|
251
277
|
extend: extend
|
|
252
278
|
};
|
|
253
279
|
|
|
254
|
-
export {
|
|
280
|
+
export { vtkWebGPUSimpleMapper$1 as default, extend, newInstance };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { newInstance as newInstance$1, vtkErrorMacro as vtkErrorMacro$1 } from '../../macros.js';
|
|
2
2
|
import { r as radiansFromDegrees } from '../../Common/Core/Math/index.js';
|
|
3
|
-
import
|
|
3
|
+
import vtkWebGPUCellArrayMapper from './CellArrayMapper.js';
|
|
4
4
|
import vtkWebGPUBufferManager from './BufferManager.js';
|
|
5
5
|
import vtkWebGPUShaderCache from './ShaderCache.js';
|
|
6
6
|
import { registerOverride } from './ViewNodeFactory.js';
|
|
7
7
|
|
|
8
|
-
var BufferUsage = vtkWebGPUBufferManager.BufferUsage
|
|
9
|
-
PrimitiveTypes = vtkWebGPUBufferManager.PrimitiveTypes;
|
|
8
|
+
var BufferUsage = vtkWebGPUBufferManager.BufferUsage;
|
|
10
9
|
var vtkErrorMacro = vtkErrorMacro$1;
|
|
11
10
|
var vtkWebGPUSphereMapperVS = "\n//VTK::Renderer::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::Color::Dec\n\n//VTK::IOStructs::Dec\n\n@stage(vertex)\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : vertexOutput;\n\n var vertexVC: vec4<f32> = rendererUBO.SCVCMatrix * mapperUBO.BCSCMatrix * vec4<f32>(vertexBC.x, vertexBC.y, vertexBC.z, 1.0);\n\n //VTK::Color::Impl\n\n // compute the projected vertex position\n output.centerVC = vertexVC.xyz;\n output.radiusVC = length(offsetMC)*0.5;\n\n // make the triangle face the camera\n if (rendererUBO.cameraParallel == 0u)\n {\n var dir: vec3<f32> = normalize(-vertexVC.xyz);\n var base2: vec3<f32> = normalize(cross(dir,vec3<f32>(1.0,0.0,0.0)));\n var base1: vec3<f32> = cross(base2,dir);\n dir = vertexVC.xyz + offsetMC.x*base1 + offsetMC.y*base2;\n vertexVC = vec4<f32>(dir, 1.0);\n }\n else\n {\n // add in the offset\n var tmp2: vec2<f32> = vertexVC.xy + offsetMC;\n vertexVC = vec4<f32>(tmp2, vertexVC.zw);\n }\n\n output.vertexVC = vertexVC.xyz;\n\n //VTK::Position::Impl\n\n return output;\n}\n"; // ----------------------------------------------------------------------------
|
|
12
11
|
// vtkWebGPUSphereMapper methods
|
|
@@ -15,6 +14,21 @@ var vtkWebGPUSphereMapperVS = "\n//VTK::Renderer::Dec\n\n//VTK::Mapper::Dec\n\n/
|
|
|
15
14
|
function vtkWebGPUSphereMapper(publicAPI, model) {
|
|
16
15
|
// Set our className
|
|
17
16
|
model.classHierarchy.push('vtkWebGPUSphereMapper');
|
|
17
|
+
var cellMapperBuildPass = publicAPI.buildPass;
|
|
18
|
+
|
|
19
|
+
publicAPI.buildPass = function (prepass) {
|
|
20
|
+
if (prepass) {
|
|
21
|
+
if (!model.renderable.getStatic()) {
|
|
22
|
+
model.renderable.update();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var poly = model.renderable.getInputData();
|
|
26
|
+
publicAPI.setCellArray(poly.getVerts());
|
|
27
|
+
publicAPI.setCurrentInput(poly);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
cellMapperBuildPass(prepass);
|
|
31
|
+
};
|
|
18
32
|
|
|
19
33
|
publicAPI.replaceShaderNormal = function (hash, pipeline, vertexInput) {
|
|
20
34
|
var vDesc = pipeline.getShaderDescription('vertex');
|
|
@@ -40,32 +54,26 @@ function vtkWebGPUSphereMapper(publicAPI, model) {
|
|
|
40
54
|
// or vertex input changes/ bind groups/ etc
|
|
41
55
|
|
|
42
56
|
|
|
43
|
-
publicAPI.computePipelineHash = function (
|
|
44
|
-
|
|
57
|
+
publicAPI.computePipelineHash = function () {
|
|
58
|
+
model.pipelineHash = 'spm';
|
|
45
59
|
|
|
46
|
-
if (vertexInput.hasAttribute("colorVI")) {
|
|
47
|
-
pipelineHash += "c";
|
|
60
|
+
if (model.vertexInput.hasAttribute("colorVI")) {
|
|
61
|
+
model.pipelineHash += "c";
|
|
48
62
|
}
|
|
49
63
|
|
|
50
|
-
pipelineHash += model.renderEncoder.getPipelineHash();
|
|
51
|
-
|
|
52
|
-
}; // was originally buildIBOs() but not using IBOs right now
|
|
53
|
-
|
|
64
|
+
model.pipelineHash += model.renderEncoder.getPipelineHash();
|
|
65
|
+
};
|
|
54
66
|
|
|
55
|
-
publicAPI.
|
|
67
|
+
publicAPI.updateBuffers = function () {
|
|
56
68
|
var poly = model.currentInput;
|
|
57
|
-
|
|
58
|
-
model.renderable.mapScalars(poly, 1.0); // handle triangles
|
|
59
|
-
|
|
60
|
-
var i = PrimitiveTypes.Triangles;
|
|
69
|
+
model.renderable.mapScalars(poly, 1.0);
|
|
61
70
|
var points = poly.getPoints();
|
|
62
71
|
var numPoints = points.getNumberOfPoints();
|
|
63
|
-
var pointArray = points.getData();
|
|
64
|
-
var primHelper = model.primitives[i]; // default to one instance and computed number of verts
|
|
72
|
+
var pointArray = points.getData(); // default to one instance and computed number of verts
|
|
65
73
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
var vertexInput = model.
|
|
74
|
+
publicAPI.setNumberOfInstances(1);
|
|
75
|
+
publicAPI.setNumberOfVertices(3 * numPoints);
|
|
76
|
+
var vertexInput = model.vertexInput;
|
|
69
77
|
var buffRequest = {
|
|
70
78
|
owner: points,
|
|
71
79
|
hash: 'spm',
|
|
@@ -74,7 +82,7 @@ function vtkWebGPUSphereMapper(publicAPI, model) {
|
|
|
74
82
|
format: 'float32x3'
|
|
75
83
|
};
|
|
76
84
|
|
|
77
|
-
if (!device.getBufferManager().hasBuffer(buffRequest)) {
|
|
85
|
+
if (!model.device.getBufferManager().hasBuffer(buffRequest)) {
|
|
78
86
|
// xyz v1 v2 v3
|
|
79
87
|
var tmpVBO = new Float32Array(3 * numPoints * 3);
|
|
80
88
|
var pointIdx = 0;
|
|
@@ -94,7 +102,7 @@ function vtkWebGPUSphereMapper(publicAPI, model) {
|
|
|
94
102
|
}
|
|
95
103
|
|
|
96
104
|
buffRequest.nativeArray = tmpVBO;
|
|
97
|
-
var buff = device.getBufferManager().getBuffer(buffRequest);
|
|
105
|
+
var buff = model.device.getBufferManager().getBuffer(buffRequest);
|
|
98
106
|
vertexInput.addBuffer(buff, ['vertexBC']);
|
|
99
107
|
} // compute offset VBO
|
|
100
108
|
|
|
@@ -117,7 +125,7 @@ function vtkWebGPUSphereMapper(publicAPI, model) {
|
|
|
117
125
|
format: 'float32x2'
|
|
118
126
|
};
|
|
119
127
|
|
|
120
|
-
if (!device.getBufferManager().hasBuffer(buffRequest)) {
|
|
128
|
+
if (!model.device.getBufferManager().hasBuffer(buffRequest)) {
|
|
121
129
|
var _tmpVBO = new Float32Array(3 * numPoints * 2);
|
|
122
130
|
|
|
123
131
|
var cos30 = Math.cos(radiansFromDegrees(30.0));
|
|
@@ -140,15 +148,14 @@ function vtkWebGPUSphereMapper(publicAPI, model) {
|
|
|
140
148
|
|
|
141
149
|
buffRequest.nativeArray = _tmpVBO;
|
|
142
150
|
|
|
143
|
-
var _buff = device.getBufferManager().getBuffer(buffRequest);
|
|
151
|
+
var _buff = model.device.getBufferManager().getBuffer(buffRequest);
|
|
144
152
|
|
|
145
153
|
vertexInput.addBuffer(_buff, ['offsetMC']);
|
|
146
154
|
}
|
|
147
155
|
|
|
148
156
|
model._lastRadius = defaultRadius;
|
|
149
|
-
}
|
|
157
|
+
} // deal with colors but only if modified
|
|
150
158
|
|
|
151
|
-
model.renderable.mapScalars(poly, 1.0); // deal with colors but only if modified
|
|
152
159
|
|
|
153
160
|
var haveColors = false;
|
|
154
161
|
|
|
@@ -164,7 +171,7 @@ function vtkWebGPUSphereMapper(publicAPI, model) {
|
|
|
164
171
|
format: 'unorm8x4'
|
|
165
172
|
};
|
|
166
173
|
|
|
167
|
-
if (!device.getBufferManager().hasBuffer(buffRequest)) {
|
|
174
|
+
if (!model.device.getBufferManager().hasBuffer(buffRequest)) {
|
|
168
175
|
var colorComponents = c.getNumberOfComponents();
|
|
169
176
|
|
|
170
177
|
if (colorComponents !== 4) {
|
|
@@ -189,7 +196,7 @@ function vtkWebGPUSphereMapper(publicAPI, model) {
|
|
|
189
196
|
|
|
190
197
|
buffRequest.nativeArray = _tmpVBO2;
|
|
191
198
|
|
|
192
|
-
var _buff2 = device.getBufferManager().getBuffer(buffRequest);
|
|
199
|
+
var _buff2 = model.device.getBufferManager().getBuffer(buffRequest);
|
|
193
200
|
|
|
194
201
|
vertexInput.addBuffer(_buff2, ['colorVI']);
|
|
195
202
|
}
|
|
@@ -202,11 +209,8 @@ function vtkWebGPUSphereMapper(publicAPI, model) {
|
|
|
202
209
|
vertexInput.removeBufferIfPresent('colorVI');
|
|
203
210
|
}
|
|
204
211
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
primHelper.setTopology('triangle-list');
|
|
208
|
-
primHelper.build(model.renderEncoder, device);
|
|
209
|
-
primHelper.registerToDraw();
|
|
212
|
+
publicAPI.setTopology('triangle-list');
|
|
213
|
+
publicAPI.updateUBO();
|
|
210
214
|
};
|
|
211
215
|
} // ----------------------------------------------------------------------------
|
|
212
216
|
// Object factory
|
|
@@ -219,11 +223,11 @@ function extend(publicAPI, model) {
|
|
|
219
223
|
var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
220
224
|
Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance
|
|
221
225
|
|
|
222
|
-
|
|
223
|
-
|
|
226
|
+
vtkWebGPUCellArrayMapper.extend(publicAPI, model, initialValues);
|
|
227
|
+
publicAPI.setVertexShaderTemplate(vtkWebGPUSphereMapperVS); // Object methods
|
|
224
228
|
|
|
225
229
|
vtkWebGPUSphereMapper(publicAPI, model);
|
|
226
|
-
var sr = model.
|
|
230
|
+
var sr = model.shaderReplacements;
|
|
227
231
|
sr.set('replaceShaderPosition', publicAPI.replaceShaderPosition);
|
|
228
232
|
sr.set('replaceShaderNormal', publicAPI.replaceShaderNormal);
|
|
229
233
|
} // ----------------------------------------------------------------------------
|