VTK  9.5.20250807
vtkWebGPULight.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
11#ifndef vtkWebGPULight_h
12#define vtkWebGPULight_h
13
14#include "vtkLight.h"
15
16#include "vtkRenderingWebGPUModule.h" // For export macro
17#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
18
19VTK_ABI_NAMESPACE_BEGIN
20class vtkRenderer;
21class vtkCamera;
22
23class VTKRENDERINGWEBGPU_EXPORT VTK_MARSHALAUTO vtkWebGPULight : public vtkLight
24{
25public:
27 vtkTypeMacro(vtkWebGPULight, vtkLight);
28 void PrintSelf(ostream& os, vtkIndent indent) override;
29
31 inline const void* GetCachedLightInformation() { return &(this->CachedLightInfo); }
32 static std::size_t GetCacheSizeBytes() { return sizeof(LightInfo); }
33
34 void Render(vtkRenderer*, int) override;
35
36protected:
37 vtkWebGPULight() = default;
38 ~vtkWebGPULight() override = default;
39
40 struct LightInfo
41 {
42 vtkTypeUInt8 Pad[12] = {}; // so that Type begins at n modulo 16 byte. LightCount,
43 // a 4-byte integer is the first element in lights ssbo.
44 // 0 : deferred, 1 : headlight, 2 : lightkit, 3 : positional
45 vtkTypeUInt32 Type = 0;
46 // 0 : not positional, 1 : positional
47 vtkTypeUInt32 Positional = 0;
48 vtkTypeFloat32 ConeAngle = 0;
49 vtkTypeFloat32 Exponent = 0;
50 vtkTypeFloat32 Color[4] = {};
51 vtkTypeFloat32 DirectionVC[4] = {}; // normalized
52 vtkTypeFloat32 PositionVC[4] = {};
53 vtkTypeFloat32 Attenuation[4] = {};
54 };
56
57private:
58 vtkWebGPULight(const vtkWebGPULight&) = delete;
59 void operator=(const vtkWebGPULight&) = delete;
60};
61
62VTK_ABI_NAMESPACE_END
63#endif
a virtual camera for 3D rendering
Definition vtkCamera.h:151
a simple class to control print indentation
Definition vtkIndent.h:108
a virtual light for 3D rendering
Definition vtkLight.h:159
abstract specification for renderers
OpenGL light.
void Render(vtkRenderer *, int) override
Abstract interface to renderer.
const void * GetCachedLightInformation()
void CacheLightInformation(vtkRenderer *renderer, vtkCamera *camera)
static vtkWebGPULight * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static std::size_t GetCacheSizeBytes()
~vtkWebGPULight() override=default
vtkWebGPULight()=default
LightInfo CachedLightInfo
#define VTK_MARSHALAUTO