PeriDyno 1.0.0
Loading...
Searching...
No Matches
GLSurfaceVisualModule.h
Go to the documentation of this file.
1
16
17#pragma once
18
19#include <DeclarePort.h>
20#include <Topology/TriangleSet.h>
21
22#include "GLVisualModule.h"
27
28namespace dyno
29{
31 {
33 public:
35 ~GLSurfaceVisualModule() override;
36
37 public:
38 virtual std::string caption() override;
39
40 DECLARE_ENUM(EColorMode,
41 CM_Object = 0,
42 CM_Vertex = 1,
43 CM_Texture = 2);
44
45 DEF_ENUM(EColorMode, ColorMode, EColorMode::CM_Object, "Color Mode");
46 DEF_VAR(bool, UseVertexNormal, false, "");
47
48#ifdef CUDA_BACKEND
50#endif
51
52#ifdef VK_BACKEND
54#endif
55
56 DEF_ARRAY_IN(Vec3f, Color, DeviceType::GPU, "");
57 DEF_ARRAY_IN(Vec3f, Normal, DeviceType::GPU, "");
58 DEF_ARRAY_IN(Vec2f, TexCoord, DeviceType::GPU, "");
59
60 DEF_ARRAY_IN(TopologyModule::Triangle, NormalIndex, DeviceType::GPU, "");
61 DEF_ARRAY_IN(TopologyModule::Triangle, TexCoordIndex, DeviceType::GPU, "");
62
63#ifdef CUDA_BACKEND
64 DEF_ARRAY2D_IN(Vec4f, ColorTexture, DeviceType::GPU, "");
65 DEF_ARRAY2D_IN(Vec4f, BumpMap, DeviceType::GPU, "");
66#endif
67
68 protected:
69 virtual void updateImpl() override;
70
71 virtual void paintGL(const RenderParams& rparams) override;
72 virtual void updateGL() override;
73 virtual bool initializeGL() override;
74 virtual void releaseGL() override;
75
76 protected:
77
79
80 // uniform blocks
83
85 unsigned int mNumTriangles = 0;
86
88 XBuffer<Vec3f> mVertexColor; // per-vertex color
90
93
96
97#ifdef CUDA_BACKEND
98 // color texture
99 XTexture2D<Vec4f> mColorTexture;
100 XTexture2D<Vec4f> mBumpMap;
101#endif
102
103 // for instanced rendering
104 unsigned int mInstanceCount = 0;
105
106 };
107};
#define DEF_ARRAY2D_IN(T, name, device, desc)
#define DEF_INSTANCE_IN(T, name, desc)
#define DECLARE_CLASS(name)
Definition Object.h:65
virtual void releaseGL() override
DEF_ARRAY_IN(TopologyModule::Triangle, TexCoordIndex, DeviceType::GPU, "")
virtual void paintGL(const RenderParams &rparams) override
DEF_VAR(bool, UseVertexNormal, false, "")
DEF_ARRAY_IN(TopologyModule::Triangle, NormalIndex, DeviceType::GPU, "")
virtual std::string caption() override
Return the caption.
DEF_ARRAY_IN(Vec3f, Normal, DeviceType::GPU, "")
DECLARE_ENUM(EColorMode, CM_Object=0, CM_Vertex=1, CM_Texture=2)
DEF_ARRAY_IN(Vec2f, TexCoord, DeviceType::GPU, "")
XBuffer< TopologyModule::Triangle > mNormalIndex
virtual bool initializeGL() override
DEF_ARRAY_IN(Vec3f, Color, DeviceType::GPU, "")
XBuffer< TopologyModule::Triangle > mVertexIndex
DEF_ENUM(EColorMode, ColorMode, EColorMode::CM_Object, "Color Mode")
XBuffer< TopologyModule::Triangle > mTexCoordIndex
Vector< PointType, 3 > Triangle
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
Vector< float, 2 > Vec2f
Definition Vector2D.h:81
Vector< float, 4 > Vec4f
Definition Vector4D.h:86
Vector< float, 3 > Vec3f
Definition Vector3D.h:93