You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -66,7 +67,7 @@ Here are some quick notes on the WebGPU classes and how they work together. Clas
66
67
67
68
- Device - one instance, represents a GPU, holds objects that can be shared including the buffer manager, texture manager, shader cache, and pipelines
68
69
69
-
- BufferManager - one instance, manages and caches buffers (chunks of memeory), owned by the Device
70
+
- BufferManager - one instance, manages and caches buffers (chunks of memory), owned by the Device
70
71
71
72
- Buffer - many instances, represents a chunk of memory, often a vtkDataArray, managed by the buffer manager so that multiple mappers can share a common buffer. Textures can also be buffer backed. Owned by the buffermanager.
72
73
@@ -115,6 +116,7 @@ encoders in the WebGPU spec.
115
116
116
117
There is a notion of bindable things in this implementation. BingGroups keep an array of
117
118
bindable things that it uses/manages. Right now these unclude UBOs, SSBOs, and TextureViews and Smaplers. A bindable thing must answer to the following interface
119
+
118
120
```
119
121
set/getName
120
122
getBindGroupLayoutEntry()
@@ -170,6 +172,12 @@ The simple mapper is a viewnode subclass so it can handle render passes. The Ful
170
172
## IndexBuffers
171
173
172
174
The WebGPU backend supports the standard IndexBuffer and VertexBuffer combination to render primatives. Due to vtk's use of celldata which doesn;t always map well to graphics primitives, the IndexBuffer class has methods to create a index buffer where each primitive has a unique provoking point. That way cell data can be rendered as point data using a flat interpolation. The IndexBuffer class holds array to map between the flat indexbuffer and original vtk data.
175
+
176
+
> :warning: WebGPU spec requires buffer sizes to be aligned to 4 bytes. If your
177
+
data size is not a multiple of 4, you need to pad the buffer size to the next
178
+
multiple of 4. For Float32Array data, this is automatically satisfied since each
179
+
float is 4 bytes.
180
+
173
181
## Private API
174
182
175
183
Note that none of the classes in the WebGPU directory are meant to be accessed directly by application code. These classes implement one view of the data (WebGPU as opposed to WebGL). Typical applicaiton code will interface with the RenderWindowViewNode superclass (in the SceneGraph) directory as the main entry point for a view such as WebGL or WebGPU. As such, changes to the API of the WebGPU classes are considered private changes, internal to the implementation of this view.
@@ -225,7 +233,7 @@ You can offset geometry by a factor cF ranging from 0.0 to 1.0 using the followi
225
233
226
234
The physically based rendering implementation is relatively basic in its current state. It uses a metallic roughness workflow,
227
235
supporting diffuse, roughness, metallic, normal, emission (ambient occlusion is yet to be supported since there is no ambient
228
-
lighting). The specular component is computed with the Cook-Torrance BRDF which utilizes the Trowbridge-Reitz GGX normal distribution,
236
+
lighting). The specular component is computed with the Cook-Torrance BRDF which utilizes the Trowbridge-Reitz GGX normal distribution,
229
237
Shlick fresnel approximation, and Smith's method with Schlick GGX. The diffuse is computed using Yasuhiro Fujii's improvement on the
230
238
Oren–Nayar reflectance model. As of right now, there are a few limitations to take note of:
231
239
@@ -235,4 +243,4 @@ Oren–Nayar reflectance model. As of right now, there are a few limitations to
235
243
236
244
- Normal maps are applied with an approximation of tangent values, causing them to be off at high strengths
237
245
238
-
- For certain meshes (depending on the normals and topology), dark zones can appear around the edges
246
+
- For certain meshes (depending on the normals and topology), dark zones can appear around the edges
0 commit comments