3#ifndef vtkWebGPURenderer_h
4#define vtkWebGPURenderer_h
8#include "vtkRenderingWebGPUModule.h"
10#include "vtkTypeUInt32Array.h"
14#include <unordered_map>
20VTK_ABI_NAMESPACE_BEGIN
46 vtkGetMacro(LightingComplexity,
int);
77 layouts.emplace_back(this->SceneBindGroupLayout);
78 layouts.emplace_back(this->ActorBindGroupLayout);
98 vtkSetMacro(UseRenderBundles,
bool);
99 vtkBooleanMacro(UseRenderBundles,
bool);
100 vtkGetMacro(UseRenderBundles,
bool);
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;
abstract class specifies interface to map data
abstract interface to OpenGL FBOs
a simple class to control print indentation
Context in which a vtkRenderPass will render.
abstract specification for renderers
Hold a reference to a vtkObjectBase instance.
handles properties associated with a texture map
record modification and/or execution time
void SetupSceneBindGroup()
void ReleaseGraphicsResources(vtkWindow *w) override
static vtkWebGPURenderer * New()
wgpu::Buffer SceneTransformBuffer
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTimeStamp LightingUploadTimestamp
wgpu::BindGroup GetSceneBindGroup()
std::size_t WriteSceneTransformsBuffer(std::size_t offset=0)
int UpdateOpaquePolygonalGeometry() override
Request mappers to run the vtkAlgorithm pipeline (if needed) and consequently update device buffers c...
std::size_t WriteLightsBuffer(std::size_t offset=0)
std::size_t WriteActorBlocksBuffer(std::size_t offset=0)
std::unordered_map< vtkProp *, vtkWGPUPropItem > PropWGPUItems
int UpdateTranslucentPolygonalGeometry() override
Ask all props to update and draw any translucent polygonal geometry.
int UpdateGeometry(vtkFrameBufferObjectBase *fbo=nullptr) override
Ask all props to update themselves.
wgpu::ShaderModule HasShaderCache(const std::string &source)
int UpdateLights() override
Ask all lights to load themselves into rendering pipeline.
void SetUserLightTransform(vtkTransform *transform)
Set the user light transform applied after the camera transform.
wgpu::RenderPassEncoder WGPURenderEncoder
void DeviceRenderOpaqueGeometry(vtkFrameBufferObjectBase *fbo) override
Request mappers to bind descriptor sets (bind groups) and encode draw commands.
wgpu::BindGroup GetActorBindGroup()
void PopulateBindgroupLayouts(std::vector< wgpu::BindGroupLayout > &layouts)
wgpu::Buffer SceneLightsBuffer
std::size_t UpdateBufferData()
void Clear() override
Clear the image to the background color.
void DeviceRenderTranslucentPolygonalGeometry(vtkFrameBufferObjectBase *fbo) override
Render translucent polygonal geometry.
vtkTransform * GetUserLightTransform()
Set the user light transform applied after the camera transform.
int RenderGeometry()
Request props to encode render commands.
void DeviceRender() override
Create an image.
wgpu::Buffer ActorBlocksBuffer
wgpu::BindGroup SceneBindGroup
vtkSmartPointer< vtkTransform > UserLightTransform
Optional user transform for lights.
~vtkWebGPURenderer() override
std::vector< std::size_t > LightIDs
wgpu::RenderPassEncoder GetRenderPassEncoder()
wgpu::BindGroup ActorBindGroup
std::vector< wgpu::RenderBundle > Bundles
wgpu::BindGroupLayout SceneBindGroupLayout
void SetEnvironmentTexture(vtkTexture *texture, bool isSRGB=false) override
Set/Get the environment texture used for image based lighting.
std::unordered_map< std::string, wgpu::ShaderModule > ShaderCache
void InsertShader(const std::string &source, wgpu::ShaderModule shader)
wgpu::BindGroupLayout ActorBindGroupLayout
vtkMTimeType LightingUpdateTime
void SetupBindGroupLayouts()
void SetupActorBindGroup()
window superclass for vtkRenderWindow
vtkSmartPointer< vtkPropCollection > Props
wgpu::RenderPipeline Pipeline
vtkSmartPointer< vtkTypeUInt32Array > DynamicOffsets
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
vtkTypeUInt32 vtkMTimeType