HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GR_HeightFieldVK.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GR_HeightFieldVK ( GR Library, C++)
7  *
8  * COMMENTS:
9  * Line and ribbon primitive.
10  */
11 #ifndef GR_HeightFieldVK_h
12 #define GR_HeightFieldVK_h
13 
14 #include "GR_API.h"
15 #include "GR_GeoRenderVK.h"
16 #include <GT/GT_PrimVolume.h>
17 #include <UT/UT_VectorTypes.h>
18 
19 class RV_Geometry;
20 class RV_Render;
22 class RV_ShaderBlock;
23 class RV_ShaderProgram;
24 class GT_PrimCurveMesh;
25 class GR_Material;
27 
29 {
30 public:
32  ~GR_HeightFieldVK() override;
33 
34  const char *className() const override { return "GR_HeightFieldVK"; }
35 
36 
37  RV_Geometry *getVkPickGeometry(unsigned int pick_mode) override;
38 
39  void update(RE_RenderContext rc,
40  const GT_PrimitiveHandle &primh,
41  const GR_UpdateParms &parms,
42  const char *cache_name) override;
43 
44  void draw(RE_RenderContext rc,
47  GR_DrawParms dp) override;
48 
49  exint getNumGLPrimitives() const override { return 1; }
50  bool hasTransparency() const override { return false; }
51 
52  static bool initShaders(RV_Instance* inst);
53  static void cleanupShaders();
54 private:
55  void updateMaterial(RV_Render *r,
56  const GR_UpdateParms *p,
57  GR_Material *material,
58  GT_Primitive *prim,
59  UT_Vector2i mapres);
60  GR_MaterialPtr defaultMaterial(RV_Render *r);
61  void updateMaterial(RV_Render *r,
63  const GR_UpdateParms *p,
64  GR_Material *material,
65  GT_Primitive *field,
66  UT_Vector2i mapres);
67 
68  GT_PrimitiveHandle mySurface;
69  int myMaterialID = -1;
70  GR_MaterialPtr myHFMat;
71  GR_MaterialPtr myHFDefaultMat;
72  UT_Vector2i myImageRes = {1,1};
73  int64 myMeshTopID = -1;
74  GT_PrimVolume::CacheMeshData mySurfaceData;
75 
76  static UT_Map<exint, RV_ShaderProgram *> theProgramMap;
77 };
78 
79 #endif
A collection of Vulkan UBO, SSBO, and Image shader bindings (descriptor set)
GLbitfield flags
Definition: glcorearb.h:1596
virtual void draw(RE_RenderContext r, GR_RenderMode mode, GR_RenderFlags flags, GR_DrawParms draw_parms)=0
Normal drawing method. Only issue rendering commands.
int64 exint
Definition: SYS_Types.h:125
GT_API const UT_StringHolder cache_name
Object that represents drawable geometry. This object holds vertex, instancing and index buffers for ...
Definition: RV_Geometry.h:165
Temporary container for either a RV_Render and an RE_Render.
A mesh of curves.
virtual RV_Geometry * getVkPickGeometry(unsigned int pick_mode)
Definition: GR_GeoRender.h:128
set of parameters sent to GR_Primitive::update()
GR_RenderMode
Definition: GR_Defines.h:48
const char * className() const override
RV_API void cleanupShaders()
#define GR_API
Definition: GR_API.h:10
long long int64
Definition: SYS_Types.h:116
GR_RenderFlags
Definition: GR_Defines.h:88
The base class for all GT primitive types.
Definition: GT_Primitive.h:43
Handle to the main interface of Vulkan.
Definition: RV_Instance.h:44
GLenum mode
Definition: glcorearb.h:99
RV_API bool initShaders(RV_Instance *inst)
GA_API const UT_StringHolder parms
bool hasTransparency() const override
returns true if this drawable renders some transparent elements
virtual void update(RE_RenderContext r, const GT_PrimitiveHandle &primh, const GR_UpdateParms &p, const char *cache_name)=0
GLboolean r
Definition: glcorearb.h:1222
exint getNumGLPrimitives() const override