3 #ifndef vtkWebGPURenderer_h
4 #define vtkWebGPURenderer_h
8 #include "vtkRenderingWebGPUModule.h"
10 #include "vtkTypeUInt32Array.h"
14 #include <unordered_map>
20 VTK_ABI_NAMESPACE_BEGIN
46 vtkGetMacro(LightingComplexity,
int);
50 void Clear()
override;
77 layouts.emplace_back(this->SceneBindGroupLayout);
78 layouts.emplace_back(this->ActorBindGroupLayout);
98 vtkSetMacro(UseRenderBundles,
bool);
99 vtkBooleanMacro(UseRenderBundles,
bool);
100 vtkGetMacro(UseRenderBundles,
bool);
122 void SetupBindGroupLayouts();
124 void CreateBuffers();
126 std::size_t UpdateBufferData();
128 void SetupSceneBindGroup();
130 void SetupActorBindGroup();
133 void BeginEncoding();
136 std::size_t WriteLightsBuffer(std::size_t
offset = 0);
137 std::size_t WriteSceneTransformsBuffer(std::size_t
offset = 0);
138 std::size_t WriteActorBlocksBuffer(std::size_t
offset = 0);
150 #ifdef __EMSCRIPTEN__
151 bool UseRenderBundles =
true;
153 bool UseRenderBundles =
false;
161 wgpu::RenderBundle Bundle =
nullptr;
167 std::size_t NumberOfPropsUpdated = 0;
168 int LightingComplexity = 0;
169 std::size_t NumberOfLightsUsed = 0;
179 uint32_t TotalRequests = 0;
192 VTK_ABI_NAMESPACE_END
wgpu::BindGroup ActorBindGroup
wgpu::Buffer SceneTransformBuffer
void PopulateBindgroupLayouts(std::vector< wgpu::BindGroupLayout > &layouts)
virtual void ReleaseGraphicsResources(vtkWindow *)
vtkTypeUInt32 vtkMTimeType
std::unordered_map< vtkProp *, vtkWGPUPropItem > PropWGPUItems
vtkSmartPointer< vtkTypeUInt32Array > DynamicOffsets
record modification and/or execution time
vtkMTimeType LightingUpdateTime
wgpu::Buffer SceneLightsBuffer
abstract specification for renderers
virtual void SetEnvironmentTexture(vtkTexture *texture, bool isSRGB=false)
Set/Get the environment texture used for image based lighting.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
window superclass for vtkRenderWindow
vtkTimeStamp LightingUploadTimestamp
vtkSmartPointer< vtkPropCollection > Props
Context in which a vtkRenderPass will render.
abstract interface to OpenGL FBOs
a simple class to control print indentation
wgpu::BindGroup GetSceneBindGroup()
virtual int UpdateLights()
Ask all lights to load themselves into rendering pipeline.
handles properties associated with a texture map
wgpu::RenderPassEncoder GetRenderPassEncoder()
wgpu::BindGroup SceneBindGroup
wgpu::RenderPipeline Pipeline
virtual int UpdateGeometry(vtkFrameBufferObjectBase *fbo=nullptr)
Ask all props to update and draw any opaque and translucent geometry.
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
wgpu::Buffer ActorBlocksBuffer
abstract class specifies interface to map data
std::vector< wgpu::RenderBundle > Bundles
wgpu::BindGroupLayout ActorBindGroupLayout
wgpu::BindGroupLayout SceneBindGroupLayout
virtual void DeviceRender()
Create an image.
virtual int UpdateTranslucentPolygonalGeometry()
Ask all props to update and draw any translucent polygonal geometry.
wgpu::RenderPassEncoder WGPURenderEncoder
virtual void DeviceRenderTranslucentPolygonalGeometry(vtkFrameBufferObjectBase *fbo=nullptr)
Render translucent polygonal geometry.
static vtkRenderer * New()
Create a vtkRenderer with a black background, a white ambient light, two-sided lighting turned on...
vtkSmartPointer< vtkTransform > UserLightTransform
Optional user transform for lights.
virtual int UpdateOpaquePolygonalGeometry()
Ask all props to update and draw any opaque polygonal geometry.
std::unordered_map< std::string, wgpu::ShaderModule > ShaderCache
wgpu::BindGroup GetActorBindGroup()
virtual void DeviceRenderOpaqueGeometry(vtkFrameBufferObjectBase *fbo=nullptr)
Render opaque polygonal geometry.
std::vector< std::size_t > LightIDs
virtual void Clear()
Clear the image to the background color.