HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GR_Uniforms.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_Uniforms.h ( GR Library, C++)
7  *
8  * COMMENTS:
9  * Uniform parameters for rendering GR_GeoRenders
10  */
11 #ifndef GR_Uniforms_h
12 #define GR_Uniforms_h
13 
14 #include "GR_API.h"
15 
16 #include "GR_Defines.h"
17 #include "GR_DisplayOption.h"
18 #include "GR_TextureRef.h"
19 
20 #include <GU/GU_SelectType.h>
21 #include <GT/GT_RefineParms.h>
22 #include <GU/GU_DetailHandle.h>
23 
24 #include <RE/RE_Render.h>
25 #include <RE/RE_RenderContext.h>
26 #include <RE/RE_CachedObject.h>
27 #include <RE/RE_OGLFramebuffer.h>
28 #include <RV/RV_TextureRef.h>
29 
30 #include <UT/UT_Matrix4.h>
31 #include <UT/UT_StringHolder.h>
32 #include <UT/UT_Map.h>
33 
34 class GR_MaterialGroups;
35 
36 class OP_Node;
37 
38 class RE_Render;
39 
40 class RV_Instance;
41 class RV_Render;
42 class RV_ShaderBlock;
43 class RV_ShaderProgram;
46 class RV_VKBuffer;
47 class RV_VKImage;
48 
49 // helper macro: check value before setting var, which also sets dirty flag
50 #define SET_GLOBAL(name, v) \
51  if (((const GR_Uniforms*)this)->globals().name != (v)) \
52  { globals().name = (v); } \
53 // end SET_GLOBAL
54 
55 /// set of parameters sent to GR_Primitive::update()
57 {
58 public:
60  GR_Uniforms();
61  ~GR_Uniforms();
62 
63  void copyUniforms(const GR_Uniforms* other)
64  {
65  UT_ASSERT(other);
66  objects() = other->objects();
67  globals() = other->globals();
68  renderInfo() = other->renderInfo();
69  }
70  exint pushObjectUniforms();
71  void popObjectUniforms(exint l=-1);
72 
73  // ~~~~~~~~~~~~~~~~
74  // RE Helpers
75 
76  // Init by copying values from RE_
77  // TODO: assign to rational defaults, or taken from DisplaySettings
78  // like in DM_VPortAgent::setupViewUniforms
79  void init(RE_RenderContext rc);
80 
81  // copy equivalent uniform values from RE_Render
82  void copyFromRE(RE_Render* r);
83 
84  // Helpers for pushing our CPU options int RE_
85  void pushToRE(RE_Render* r);
86  void popFromRE(RE_Render* r);
87  void assignRE(RE_Render* r);
88 
89  // ~~~~~~~~~~~~~~~~~
90  // RV Helpers
91  void assignRVBlock(
92  RV_Render *r,
93  RV_ShaderBlock *block,
94  const RV_ShaderProgramBase *opt_shr) const;
95 
96  void assignRVBindings(
97  RV_Render* r,
99  const RV_ShaderProgramBase* opt_shr) const;
100 
101  void assignRVGlobalBlock(RV_Render *r, RV_ShaderBlock *block) const;
102  bool bindRVGlobalBlock(RV_Render *r, const RV_ShaderProgramBase *shader);
103 
104  // initialize the passed in Set and UBO to hold per-object uniform
105  // variables for a draw with the passed in shader, and bind the set
106  bool prepareForDraw(
107  RV_Render *r,
111 
112  // ~~~~~~~~~~~~~~~~~~~
113  // Object Vars
114 
115  // Values that are expected to change for each object rendered
116  // Can be pushed/popped
117 
118  // Object Matrix
119  void setObjModelMatrix(const UT_Matrix4D &v, const UT_Matrix4D *inv = nullptr)
120  {
121  objects().myModel = v;
122 
123  // setup dependent matrices
124  if (inv)
125  {
126  objects().myInvModel = *inv;
127  }
128  else
129  {
130  objects().myInvModel = objects().myModel;
131  objects().myInvModel.invert();
132  }
133 
134  // ensure it's const, so it doesn't trigger update
135  const GlobalUniforms& global_var = ((const GR_Uniforms*)this)->globals();
136 
137  objects().myModelView = objects().myModel * global_var.myView;
138 
139  objects().myModelF = objects().myModel;
140  objects().myInvModelF = objects().myInvModel;
141  objects().myModelViewF = objects().myModelView;
142  }
143  const UT_Matrix4D &getObjModelMatrix() const { return objects().myModel; }
144  const UT_Matrix4D &getObjInvModelMatrix() const { return objects().myModel; }
145  const UT_Matrix3D &getObjNormalMatrix() const { return globals().myNormalMat; }
146  const UT_Matrix4D &getObjModelViewMatrix() const { return objects().myModelView; }
147 
149  {
150  globals().myView = v;
151 
152  // setup dependent matrices
153  globals().myInvView = globals().myView;
154  globals().myInvView.invert();
155 
156  globals().myNormalMat = globals().myView;
157  globals().myNormalMat.invert();
158  globals().myNormalMat.transpose();
159 
160  globals().myViewF = globals().myView;
161  globals().myInvViewF = globals().myInvView;
162  globals().myNormalMatF = globals().myNormalMat;
163  globals().myNormalMatFr1 = globals().myNormalMat[0];
164  globals().myNormalMatFr2 = globals().myNormalMat[1];
165  globals().myNormalMatFr3 = globals().myNormalMat[2];
166 
167  objects().myModelView = globals().myView * objects().myModel;
168  objects().myModelViewF = objects().myModelView;
169  }
170  const UT_Matrix4D &getViewMatrix() const { return globals().myView; }
171  const UT_Matrix4F &getVKViewMatrix() const { return globals().myViewF; }
172  const UT_Matrix4D &getInvViewMatrix() const { return globals().myInvView; }
173  const UT_Matrix3D &getNormalMatrix() const { return globals().myNormalMat; }
174 
175  // correct controls whether to apply OpenGL to Vulkan correction, to
176  // account for different coordinate spaces
177  void setProjectMatrix(const UT_Matrix4D &v, bool correct = true, bool is_ortho = false)
178  {
179  globals().myProjection = v;
180 
181  // setup dependent matrices
182  globals().myInvProjection = globals().myProjection;
183  globals().myInvProjection.invert();
184 
185  // NOTE: NDC space in Vulkan has a z-range of [0, 1] instead of [-1, 1]
186  // and a downward-facing y-direction. appending transform after
187  // projection matrix to correct for these
188  if(correct)
189  {
190  UT_Matrix4F correction(1.0f, 0.0f, 0.0f, 0.0f,
191  0.0f, 1.0f, 0.0f, 0.0f,
192  0.0f, 0.0f, 0.5f, 0.0f,
193  0.0f, 0.0f, 0.5f, 1.0f);
194  globals().myProjectionF =
195  UT_Matrix4F(globals().myProjection) * correction;
196  }
197  else
198  globals().myProjectionF = UT_Matrix4F(globals().myProjection);
199  globals().myInvProjectionF = globals().myProjectionF;
200  globals().myInvProjectionF.invert();
201  globals().myIsOrtho = is_ortho;
202  }
203  void useVulkanProjection(bool use_vk) { myUseVulkanProjection=use_vk; }
204  bool getUseVulkanProjection() const { return myUseVulkanProjection; }
205  const UT_Matrix4D &getProjectionMatrix() const { return globals().myProjection; }
206  const UT_Matrix4F &getVKProjectionMatrix() const { return globals().myProjectionF; }
207  const UT_Matrix4D &getInvProjectionMatrix() const { return globals().myInvProjection; }
208  bool getIsOrtho() const { return globals().myIsOrtho; }
209 
210  void setReverseDepth(bool use_vk) { globals().myUseReverseDepth = (use_vk?1:0); }
211  bool getReverseDepth() const { return !!globals().myUseReverseDepth; }
212 
213  void setDepthRange(const UT_Vector2F &r) { SET_GLOBAL(myDepthRange, r); }
214  void setDepthProject(const UT_Vector2F &p) { SET_GLOBAL(myDepthProject, p); }
215  const UT_Vector2F &getDepthProject() const { return globals().myDepthProject; }
216 
217  void setDepthOcclusion(fpreal32 v) { SET_GLOBAL(myDecorOcclusionFade, v); }
218  fpreal32 getDepthOcclusion() const { return globals().myDecorOcclusionFade; }
219 
220  void setShadowmapIndex(const int32 index) { SET_GLOBAL(myShadowmapIndex, index); }
221  int32 getShadowmapIndex() const { return globals().myShadowmapIndex; }
222 
224  { renderInfo().myExcludeGsplatShadowCasters = v; }
226  { return renderInfo().myExcludeGsplatShadowCasters; }
227 
228  // These are technically Vector3s, but GLSL expects Vector3s to be 4-byte
229  // aligned, so we add one more float for the C++ alignment to match the
230  // GLSL alignment.
232  void setCSMRegionInvExts(const CSMRegionInvExts &e) { SET_GLOBAL(myCSMRegionInvExts, e); }
233  const CSMRegionInvExts &getCSMRegionInvExts() const { return globals().myCSMRegionInvExts; }
234 
236  void setCSMRegionOffsets(const CSMRegionInvExts &e) { SET_GLOBAL(myCSMRegionOffsets, e); }
237  const CSMRegionInvExts &getCSMRegionOffsets() const { return globals().myCSMRegionOffsets; }
238 
239  void setObjWireColor(const UT_Vector4 &v) { objects().myWireColor = v; }
240  const UT_Vector4 &getObjWireColor() const { return objects().myWireColor; }
241 
242  void setObjWireframeColor(const UT_Vector4 &v) { objects().myWireframeColor = v; }
243  const UT_Vector4 &getObjWireframeColor() const { return objects().myWireframeColor; }
244 
245  void setObjWireThickness(const float &v) { objects().myWireThickness = v; }
246  float getObjWireThickness() const { return objects().myWireThickness; }
247 
248  void setObjConstColor(const UT_Vector4 &v) { objects().myConstColor = v; }
249  const UT_Vector4 &getObjConstColor() const { return objects().myConstColor; }
250 
252  {
253  objects().myConstColorMap = v;
254  objects().myConstColorEnableVK = v.isVulkan();
255  objects().myConstColorEnableGL = v.isGL();
256  }
257 
259  {
260  objects().myEmitColor = c;
261  }
262  void setObjGhosting(const UT_Vector4 &v, float gfact=0.5)
263  {
264  objects().myGhostColor = v;
265  objects().myGhostFactor = gfact;
266  objects().myHasGhosting = true;
267  }
268  const UT_Vector4 &getObjGhostColor() const { return objects().myGhostColor; }
269  float getObjGhostFactor() const { return objects().myGhostFactor; }
270 
271  void setObjBackfaceTint(const UT_Vector3 &v, float gfact=0.5)
272  {
273  objects().myBackfaceColor = UT_Vector4(v, gfact);
274  objects().myHasBackfaceTint = true;
275  }
276  const UT_Vector4 &getObjBackfaceColor() const { return objects().myBackfaceColor; }
277  float getObjBackfaceFactor() const { return objects().myBackfaceColor[3]; }
278 
279  void setObjSelectColor(const UT_Vector4 &v) { objects().mySelectColor = v; }
280  const UT_Vector4 &getObjSelectColor() const { return objects().mySelectColor; }
281 
282  void setObjSelectSecondaryColor(const UT_Vector4 &v) { objects().mySelectSecondaryColor = v; }
283  const UT_Vector4 &getObjSelectSecondaryColor() const { return objects().mySelectSecondaryColor; }
284 
285  void setObjSelectMode(int v) { objects().mySelectMode = v; }
286  int getObjSelectMode() const { return objects().mySelectMode; }
287 
288  void setObjSelectType(int v) { objects().mySelectType = v; }
289  int getObjSelectType() const { return objects().mySelectType; }
290 
291  void setObjSelectInstance(int v) { objects().mySelectInstance = v; }
292  int getObjSelectInstance() const { return objects().mySelectInstance; }
293 
294  void setObjFillSelection(int v) { objects().myFillSelection = v; }
295  int getObjFillSelection() const { return objects().myFillSelection; }
296 
297  void setObjPrimConstandID(int v) { objects().myPrimConstantID = v; }
298  int getObjPrimConstandID() const { return objects().myPrimConstantID; }
299 
300  void setObjDecorationScale(float v) { objects().myDecorationScale = v; }
301  float getObjDecorationScale() const { return objects().myDecorationScale; }
302 
304  { objects().myPickBaseID = v; }
306  { return objects().myPickBaseID; }
307 
309  { objects().myPickComponentID = v; }
311  { return objects().myPickComponentID; }
312 
314  { objects().myPickDepthPass = v; }
316  { return objects().myPickDepthPass; }
317 
319  {
320  objects().myColorRamp = v;
321  objects().myColorRampEnableVK = v.isVulkan();
322  objects().myColorRampEnableGL = v.isGL();
323 
324  objects().myColorRange = range;
325  }
326 
327  void setObjColorIgnoreGeo(bool v)
328  {
329  objects().myColorIgnoreGeo = v;
330  }
331  bool getObjColorIgnoreGeo() const
332  {
333  return objects().myColorIgnoreGeo;
334  }
335 
336  // Use -1 flag to force use of geo color, ignoring
337  // any per-material geo color disable
339  {
340  objects().myColorIgnoreGeo = -1;
341  }
342 
344  {
345  objects().myColorTransformMode = mode;
346  objects().myColorTransformRef = ref;
347  }
348 
350  {
351  objects().myUseInstancePrimId = v;
352  }
353 
355  { objects().myMaxLocatedId = v; }
356 
358  { return objects().myMaxLocatedId; }
359 
361  { objects().myMinLocatedId = v; }
362 
364  { return objects().myMinLocatedId; }
365 
366 
368  {
369  objects().myLocatedBufVK = buf;
370  objects().myUseLocatedBufVK = buf ? 1 : 0;
371  }
372 
374  {
375  UT_ASSERT(!buf || buf->getTextureType() == RE_TEXTURE_BUFFER);
376  objects().myLocatedBufGL = buf;
377  objects().myUseLocatedBufGL = buf ? 1 : 0;
378  }
379 
381  { objects().myLightingEnabled = v; }
382 
384  { return objects().myLightingEnabled; }
385 
387  { objects().myTexturesEnabled = v; }
388 
390  { return objects().myTexturesEnabled; }
391 
393  { objects().myAlphaCutoff = cut; }
394 
396  { return objects().myAlphaCutoff; }
397 
398  // Values which may be changed per-object
400  {
401 
402  #define VK_BLOCK_START (offsetof(ObjectUniforms, myModelF))
403  // begin VK block
406 
408  UT_Vector4F myBackfaceColor = UT_Vector4F(0,0,0,0);
412  UT_Vector4F myEmitColor = UT_Vector4F(0,0,0,0);
413 
414  int mySelectMode = 0;
415  int mySelectType = 0;
416  int mySelectInstance = 0;
417  int myFillSelection = 0;
418 
419  int myPrimConstantID = 0;
420  int myPrimInstanceBase = 0;
421 
424 
426  int32 myColorRampEnableVK = 0;
427  int32 myColorIgnoreGeo = 0;
428 
430  int32 myColorTransformMode = 0;
431 
432  // NOTE: only used in locate highlight rendering
433  int32 myUseInstancePrimId = 0;
434  int32 myMaxLocatedId = 0;
435  int32 myMinLocatedId = 0;
436  int32 myUseLocatedBufVK = 0;
437 
438  // NOTE: only used in pick buffer rendering
440  int32 myPickDepthPass = 0;
442 
443  int32 myConstColorEnableVK = 0;
444  int32 myLightMask = 0xFFFFFFFF;
445  int32 myLightingEnabled = 1;
446  int32 myTexturesEnabled = 1;
447  fpreal32 myAlphaCutoff = -1.0f;
448 
449  // end VK block
450  #define VK_BLOCK_END (offsetof(ObjectUniforms, myAlphaCutoff )\
451  + sizeof(ObjectUniforms::myAlphaCutoff))
452 
453  // Ghosting
456 
457  bool myHasPrimLightMask = false;
458 
459  // Backface Tinting
460  bool myHasBackfaceTint = false;
461 
462  // Selection
464 
465  // Wire color
467 
468  // color mapping
469  int32 myConstColorEnableGL = 0;
471 
472  // Color Transform
473  int32 myColorRampEnableGL = 0;
475 
477 
481 
483 
484  RV_VKBuffer* myLocatedBufVK = nullptr;
485  RE_Texture* myLocatedBufGL = nullptr;
486  int32 myUseLocatedMap = 0; // redundant
487  int32 myUseLocatedBufGL = 0;
488  };
489  static constexpr int32 VkBlockSize = VK_BLOCK_END - VK_BLOCK_START;
490 
491  // ~~~~~~~~~~~~~
492  // Global Vars
493  //
494  // Values static across the whole render
495  // typically may be changed between passes of different types
496  // Can be set, but not push/popped
497 
498  void setEmission(float v) { SET_GLOBAL(myEmissionFactor, v); }
499  float getEmission() const { return globals().myEmissionFactor; }
500 
501  void setSpecular(float v) { SET_GLOBAL(mySpeculaFactor, v); }
502  float getSpecular() const { return globals().mySpeculaFactor; }
503 
504  void setDiffuse(float v) { SET_GLOBAL(myDiffuseFactor, v); }
505  float getDiffuse() const { return globals().myDiffuseFactor; }
506 
507  void setAmbient(float v) { SET_GLOBAL(myAmbientFactor, v); }
508  float getAmbient() const { return globals().myAmbientFactor; }
509 
510  void setAlphaPass(int v) { SET_GLOBAL(myAlphaPass, v); }
511  int getAlphaPass() const { return globals().myAlphaPass; }
512 
513  void setOnionSkinGroup(int v) { SET_GLOBAL(myOnionSkinGroup, v); }
514  int getOnionSkinGroup() const { return globals().myOnionSkinGroup; }
515 
516  void setLightMask(unsigned mask) { objects().myLightMask = mask; }
517  unsigned getLightMask() const { return objects().myLightMask; }
518 
519  void setUseHeadlight(bool use_headlight)
520  { SET_GLOBAL(myUseHeadlight, (int32)use_headlight); }
521  bool useHeadlight() const { return globals().myUseHeadlight; }
524  float ambient,
525  float soft,
526  bool use_spec,
527  bool use_world_space)
528  {
529  SET_GLOBAL(myHeadlightDir, dir);
530  SET_GLOBAL(myHeadlightColor, color);
531  SET_GLOBAL(myHeadlightSpec, (int32)(use_spec?1:0));
532  SET_GLOBAL(myHeadlightWorldSpace, (int32)use_world_space);
533  SET_GLOBAL(myHeadlightAmbient, ambient);
534  SET_GLOBAL(myHeadlightSoft, soft);
535  }
536  UT_Vector3F headlightDir() { return globals().myHeadlightDir; }
537  UT_Vector3F headlightColor() { return globals().myHeadlightColor; }
538  fpreal headlightSoftness() { return globals().myHeadlightSoft; }
539  void setUseFilllight(bool use_fill)
540  { SET_GLOBAL(myUseFilllight, (int32)use_fill); }
542  {
543  SET_GLOBAL(myFilllightDir, dir);
544  SET_GLOBAL(myFilllightColor, color);
545  SET_GLOBAL(myFilllightSoft, soft);
546  }
547  UT_Vector3F filllightDir() { return globals().myFilllightDir; }
548  UT_Vector3F filllightColor() { return globals().myFilllightColor; }
549  float filllightSoftness() { return globals().myFilllightSoft; }
550  void setUseBacklight(bool use_back)
551  { SET_GLOBAL(myUseBacklight, (int32)use_back); }
553  {
554  SET_GLOBAL(myBacklightDir, dir);
555  SET_GLOBAL(myBacklightColor, color);
556  SET_GLOBAL(myBacklightSoft, soft);
557  }
558  UT_Vector3F backlightDir() { return globals().myBacklightDir; }
559  UT_Vector3F backlightColor() { return globals().myBacklightColor; }
560  float backlightSoftness() { return globals().myBacklightSoft; }
561 
562  void setEnvlightMapRotate(const UT_Vector3F &rot);
563  void setEnvlightMapTint(const UT_Vector3F &tint)
564  { SET_GLOBAL(myEnvlightTint, UT_Vector4F(tint, 1.0)); }
565  void setUseEnvlight(bool use_env)
566  { SET_GLOBAL(myUseEnvlight, (int32)use_env); }
567  bool useEnvlight() const { return globals().myUseEnvlight; }
568  UT_Matrix4F getEnvlightRotate() const { return globals().myEnvlightRotate; }
570  { return UT_Vector3F(globals().myEnvlightTint); }
571 #ifdef USE_VULKAN
572  RV_TextureRef &envlightMap() { return globals().myEnvlightMapRef; }
573  RV_TextureRef &bgenvMap() { return globals().myBGEnvMapRef; }
574 #endif
575 
576  void setHasPrimLightMask(bool m) { objects().myHasPrimLightMask = m; }
577  bool hasPrimLightMask() const { return objects().myHasPrimLightMask; }
578 
580  {
581  RENDER_MATERIAL = 0,
582  RENDER_CONST = 1,
583  RENDER_OTHER = 2,
584  };
586  { SET_GLOBAL(myRenderPass, v); }
588  { return RenderPass(globals().myRenderPass); }
589 
590  void setAlphaCutoff(float v) { SET_GLOBAL(myAlphaCutoff, v); }
591  float getAlphaCutoff() const { return globals().myAlphaCutoff; }
592 
593  void setCamView(const UT_Matrix4D& v)
594  {
595  globals().myCamView = v;
596  globals().myCamViewF = UT_Matrix4F(v);
597  }
598  const UT_Matrix4D &getCamView() const { return globals().myCamView;}
599 
600  void setCamProject(const UT_Matrix4D& v)
601  {
602  globals().myCamProject = v;
603  globals().myCamProjectF = UT_Matrix4F(v);
604  }
605  const UT_Matrix4D &getCamProject() const { return globals().myCamProject;}
606 
607  void setScreenSize(const UT_Vector2& v) { SET_GLOBAL(myScreenSize, v); }
608  const UT_Vector2& getScreenSize() const { return globals().myScreenSize; }
609 
610  void setNumSamples(int v) { SET_GLOBAL(myNumSamples, v); }
611  int getNumSamples() const { return globals().myNumSamples; }
612 
613  void setLODParms(const UT_Vector2& v) { SET_GLOBAL(myLODParms, v); }
614  const UT_Vector2& getLODParms() const { return globals().myLODParms; }
615 
616  void setPickArea(const UT_Vector4F& v) { SET_GLOBAL(myPickArea, v); }
617  const UT_Vector4F& getPickArea() const { return globals().myPickArea; }
618 
619  void setPickMap(GR_TextureRef v, bool use = true)
620  {
621  SET_GLOBAL(myPickMap, v);
622  SET_GLOBAL(myPickHasMapVK, (use && globals().myPickMap.isVulkan()));
623  SET_GLOBAL(myPickHasMapGL, (use && globals().myPickMap.isGL()));
624  }
625 
627  {
628  SET_GLOBAL(myDepthMap, v);
629  int vk_val = 0;
630  if (use && globals().myDepthMap.isVulkan())
631  {
632  if (func == RE_ZLESS || func == RE_ZLEQUAL)
633  vk_val = -1;
634  else if (func == RE_ZGREATER || func == RE_ZGEQUAL)
635  vk_val = -2;
636  else
637  vk_val = 1;
638  }
639  SET_GLOBAL(myHasDepthMapVK, vk_val);
640  SET_GLOBAL(myHasDepthMapGL, (use && globals().myDepthMap.isGL()));
641  }
642  GR_TextureRef getDepthMap() { return globals().myDepthMap; }
643 
644  void setSnapDistances(const UT_Vector3i &v) { SET_GLOBAL(mySnapDistances, v);}
645  const UT_Vector3i &getSnapDistances() const { return globals().mySnapDistances;}
646 
647  void setSnapParms(int32 v) { SET_GLOBAL(mySnapParams, v);}
648  int32 getSnapParms() const { return globals().mySnapParams;}
649 
650  void setDecorationLocate(const UT_Vector4F& v) { SET_GLOBAL(myDecorLocate, v); }
651  const UT_Vector4F& getDecorationLocate() const { return globals().myDecorLocate; }
652 
653 
654  void print();
655 
656  // TODO: use these maybe ?
657  bool myIsGlobalUniformLocked = false;
659  {
660  myIsGlobalUniformLocked = true;
661  }
663  {
664  myIsGlobalUniformLocked = false;
665  }
666  bool myGlobalUniformDirty = true;
667 
668  #define UT_Vector2F_UBO alignas(8) UT_Vector2F
669  #define UT_Vector3F_UBO alignas(16) UT_Vector3F
670  #define UT_Vector4F_UBO alignas(16) UT_Vector4F
671  #define UT_Vector2i_UBO alignas(8) UT_Vector2i
672  #define UT_Vector3i_UBO alignas(16) UT_Vector3i
673  #define UT_Vector4i_UBO alignas(16) UT_Vector4i
674  #define UT_Matrix4F_UBO alignas(16) UT_Matrix4F
675 
677  {
678  #define VK_GLOBAL_BLOCK_START (offsetof(GlobalUniforms, myProjectionF))
679  // float versions for VK
682  UT_Vector3F_UBO myNormalMatFr1; // store `mat3` as 3 `vec3`s to match UBO spacing
689 
690  // Inverses (reciprocals) of the extents of the cascading shadowmap regions.
693 
694  // TODO: make this a push constant
696 
697  // Screen/Framebuffer info
700 
703  int32 myHasDepthMapVK = 0;
704  int32 myUseReverseDepth = 0;
705 
706  // Enum code indicating whether or not inside a
707  // transparency rendering pass, or what kind of pass
708  int32 myRenderPass = RENDER_MATERIAL;
709  int32 myAlphaPass = 0;
710 
711  int32 myMaterialLayer = 0;
712  int32 myOnionSkinGroup = 0;
713 
714  fpreal32 SceneIOR = 1.0;
715 
716  // Multipliers for different aspects of lighting,
717  // typically 0.0 or 1.0
718  fpreal32 myEmissionFactor = 1.0;
719  fpreal32 myDiffuseFactor = 1.0;
720  fpreal32 myAmbientFactor = 1.0;
721  fpreal32 mySpeculaFactor = 1.0;
722 
724 
725  fpreal32 myAlphaCutoff = 1e-3;
726 
727  int32 myNumSamples = 4;
728 
729  int32 myIsOrtho = 0;
731 
732  // NOTE: only used in pick rendering
734  int32 myPickHasMapVK = 0;
735 
736  // NOTE: only used in snap rendering
738  int32 mySnapParams = 0;
739 
740  // NOTE: only used in decoration rendering
742  float myDecorOcclusionFade = 1.0;
743 
744  int32 myHeadlightWorldSpace = 0;
745  fpreal32 myHeadlightAmbient = 0.02;
746 
748  int32 myHeadlightSpec = 1;
750  int32 myUseHeadlight = 0;
751  fpreal32 myHeadlightSoft = 0.0;
752 
754  int32 myUseFilllight = 0;
756  fpreal32 myFilllightSoft = 0.0;
757 
759  int32 myUseBacklight = 0;
761  fpreal32 myBacklightSoft = 0.0;
762 
765  int32 myUseEnvlight = 0;
766 
767  #define VK_GLOBAL_BLOCK_END (offsetof(GlobalUniforms, myUseEnvlight ) \
768  + sizeof(GlobalUniforms::myUseEnvlight))
769 
771 
779 
780  // NOTE: only used in pick rendering
782  int32 myPickHasMapGL = 0;
783 
784  // NOTE: only used in shadow map rendering
786  int32 myHasDepthMapGL = 0;
787  fpreal32 myDepthBufferFar = 1.0;
788 
789 #ifdef USE_VULKAN
790  RV_TextureRef myEnvlightMapRef;
791  RV_TextureRef myBGEnvMapRef;
792 #endif
793  };
794  static constexpr int32 VkGlobalBlockSize = VK_GLOBAL_BLOCK_END
796 
797  // CPU-only state describing how the current render pass should behave, as
798  // opposed to shader parameter values. Copied to per-thread uniforms
799  // alongside objects()/globals(), so worker-thread draws observe it in
800  // GR_Utils::renderParallelFor.
801  struct RenderInfo
802  {
803  // When set during a shadow-map render pass, gsplat primitives skip
804  // casting so the second shadow map excludes them, avoiding gsplat
805  // self-shadowing.
806  bool myExcludeGsplatShadowCasters = false;
807  };
808 
809 #ifdef USE_VULKAN
810  static void initStaticResources(RV_Instance* inst);
811  static void cleanupStaticResources();
812 
813  static void prepareThreadedUniforms(exint num_threads);
814  static void returnThreadedUniforms();
815 
816  static GR_Uniforms* getForThread(int* level, int idx);
817  static void returnForThread(int* level);
818 #endif
819 
821  {
822  return myObjectUniforms.last();
823  }
824  const ObjectUniforms& objects() const
825  {
826  return myObjectUniforms.last();
827  }
828 
830  {
831  UT_ASSERT(!myIsGlobalUniformLocked);
832  myGlobalUniformDirty = true;
833  return myGlobalUniforms;
834  }
835  const GlobalUniforms& globals() const
836  {
837  return myGlobalUniforms;
838  }
839 
841  {
842  return myRenderInfo;
843  }
844  const RenderInfo& renderInfo() const
845  {
846  return myRenderInfo;
847  }
848 
849 private:
850  UT_ValArray<ObjectUniforms> myObjectUniforms;
851  GlobalUniforms myGlobalUniforms;
852  RenderInfo myRenderInfo;
853 
854  // ~~~~~~~~~~~~~~~
855  // RE Private Helpers
856 
857  // RE_Render stack helpers
858  bool myIsREPushed = false;
859 
860  // Ghosting setup taken form GUI_GeoRender::setupGhosting
861  struct RECachedState
862  {
863  bool useSampleMask;
864  int sampleMask;
865  bool multisample;
866  } myCachedREState;
867 
868  // Special handlers for ghosting state -- changes some Render state as well
869  // as pushing uniforms
870  void pushGhosting(RE_Render* r);
871  void assignGhosting(RE_Render* r);
872  void popGhosting(RE_Render* r);
873 
874 private:
875  bool myUseVulkanProjection = false;
876 #ifdef USE_VULKAN
877  struct gr_SetCache
878  {
879  // Array doing linear lookup, fine if number of sets small
880  // TODO: could do a hashmap
882  UT_Array<bool> myDirtyFlags;
883 
885  RV_Render *r,
886  int set_num,
888  bool* out_is_new_or_dirty);
889  };
890  gr_SetCache myGlobalSet;
891  UT_UniquePtr<RV_ShaderBlock> myPassInfoBlock;
892 #endif
893 };
894 
895 
896 #endif
void setObjColorForceUseGeo()
Definition: GR_Uniforms.h:338
A collection of Vulkan UBO, SSBO, and Image shader bindings (descriptor set)
void setFilllightParms(UT_Vector3F dir, UT_Vector3F color, float soft)
Definition: GR_Uniforms.h:541
const UT_Vector4 & getObjWireframeColor() const
Definition: GR_Uniforms.h:243
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2540
void setAlphaCutoff(float v)
Definition: GR_Uniforms.h:590
void setObjLocatedBuffer(RE_Texture *buf)
Definition: GR_Uniforms.h:373
void setBacklightParms(UT_Vector3F dir, UT_Vector3F color, float soft)
Definition: GR_Uniforms.h:552
UT_Vector3F headlightDir()
Definition: GR_Uniforms.h:536
UT_Vector3F filllightColor()
Definition: GR_Uniforms.h:548
int int32
Definition: SYS_Types.h:39
GLenum GLint * range
Definition: glcorearb.h:1925
const UT_Vector4 & getObjBackfaceColor() const
Definition: GR_Uniforms.h:276
void setObjFillSelection(int v)
Definition: GR_Uniforms.h:294
const UT_Matrix4D & getViewMatrix() const
Definition: GR_Uniforms.h:170
void setObjConstColorMap(GR_TextureRef v)
Definition: GR_Uniforms.h:251
void setPickMap(GR_TextureRef v, bool use=true)
Definition: GR_Uniforms.h:619
void setObjEmission(const UT_Vector4F &c)
Definition: GR_Uniforms.h:258
UT_Vector3F getEnvlightMapTint() const
Definition: GR_Uniforms.h:569
void setObjTexturesEnabled(int v)
Definition: GR_Uniforms.h:386
void setUseHeadlight(bool use_headlight)
Definition: GR_Uniforms.h:519
void setShadowmapIndex(const int32 index)
Definition: GR_Uniforms.h:220
const GLdouble * v
Definition: glcorearb.h:837
void setObjWireThickness(const float &v)
Definition: GR_Uniforms.h:245
bool getIsOrtho() const
Definition: GR_Uniforms.h:208
void setObjSelectColor(const UT_Vector4 &v)
Definition: GR_Uniforms.h:279
void setObjAlphaCutoff(fpreal32 cut)
Definition: GR_Uniforms.h:392
exint getObjMaxLocatedID() const
Definition: GR_Uniforms.h:357
void setLightMask(unsigned mask)
Definition: GR_Uniforms.h:516
CSMRegionInvExts myCSMRegionInvExts
Definition: GR_Uniforms.h:691
int getAlphaPass() const
Definition: GR_Uniforms.h:511
int getObjPrimConstandID() const
Definition: GR_Uniforms.h:298
const UT_Matrix4F & getVKProjectionMatrix() const
Definition: GR_Uniforms.h:206
const UT_Vector4F & getPickArea() const
Definition: GR_Uniforms.h:617
exint getObjMinLocatedID() const
Definition: GR_Uniforms.h:363
GA_API const UT_StringHolder rot
void setEnvlightMapTint(const UT_Vector3F &tint)
Definition: GR_Uniforms.h:563
void setObjColorRamp(GR_TextureRef v, UT_Vector2F range=UT_Vector2F())
Definition: GR_Uniforms.h:318
void setUseEnvlight(bool use_env)
Definition: GR_Uniforms.h:565
int getObjTexturesEnabled() const
Definition: GR_Uniforms.h:389
const UT_Matrix3D & getNormalMatrix() const
Definition: GR_Uniforms.h:173
int64 exint
Definition: SYS_Types.h:125
GLint level
Definition: glcorearb.h:108
void setObjMaxLocatedID(exint v)
Definition: GR_Uniforms.h:354
UT_Vector3F filllightDir()
Definition: GR_Uniforms.h:547
RenderPass getRenderPass() const
Definition: GR_Uniforms.h:587
void setObjPickBaseID(const UT_Vector3i &v)
Definition: GR_Uniforms.h:303
float getAmbient() const
Definition: GR_Uniforms.h:508
void copyUniforms(const GR_Uniforms *other)
Definition: GR_Uniforms.h:63
UT_Vector3i_UBO myCoverageMask
Definition: GR_Uniforms.h:723
Opaque reference to a texture stored in the RV_TextureCache.
Definition: RV_TextureRef.h:21
const UT_Vector4 & getObjSelectSecondaryColor() const
Definition: GR_Uniforms.h:283
bool isGL() const
Definition: GR_TextureRef.h:38
UT_Matrix4F_UBO myCamViewF
Definition: GR_Uniforms.h:687
void setObjWireframeColor(const UT_Vector4 &v)
Definition: GR_Uniforms.h:242
void setObjGhosting(const UT_Vector4 &v, float gfact=0.5)
Definition: GR_Uniforms.h:262
void setObjColorTransform(int32 mode, UT_Vector3F ref=UT_Vector3F())
Definition: GR_Uniforms.h:343
const UT_Vector4 & getObjWireColor() const
Definition: GR_Uniforms.h:240
void useVulkanProjection(bool use_vk)
Definition: GR_Uniforms.h:203
UT_Matrix4F_UBO myCamProjectF
Definition: GR_Uniforms.h:688
void setObjSelectSecondaryColor(const UT_Vector4 &v)
Definition: GR_Uniforms.h:282
UT_Vector3F backlightDir()
Definition: GR_Uniforms.h:558
float getObjBackfaceFactor() const
Definition: GR_Uniforms.h:277
void setHasPrimLightMask(bool m)
Definition: GR_Uniforms.h:576
void setViewMatrix(const UT_Matrix4D &v)
Definition: GR_Uniforms.h:148
const UT_Matrix4D & getInvViewMatrix() const
Definition: GR_Uniforms.h:172
float fpreal32
Definition: SYS_Types.h:200
A class that manages material assignments to different groups of primitives.
void setNumSamples(int v)
Definition: GR_Uniforms.h:610
Temporary container for either a RV_Render and an RE_Render.
GR_API bool createOrReuseSet(RV_Render *r, UT_UniquePtr< RV_ShaderVariableSet > &set, int set_num, const RV_ShaderProgramBase *shader, bool *created=nullptr, const char *name=nullptr)
void setAlphaPass(int v)
Definition: GR_Uniforms.h:510
void setUseBacklight(bool use_back)
Definition: GR_Uniforms.h:550
#define VK_BLOCK_END
Definition: GR_Uniforms.h:450
UT_Vector4F_UBO myDecorLocate
Definition: GR_Uniforms.h:741
UT_Vector4F_UBO myEnvlightTint
Definition: GR_Uniforms.h:764
void setEmission(float v)
Definition: GR_Uniforms.h:498
CSMRegionOffsets myCSMRegionOffsets
Definition: GR_Uniforms.h:692
UT_Vector3F_UBO myBacklightColor
Definition: GR_Uniforms.h:760
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
bool getExcludeGsplatShadowCasters() const
Definition: GR_Uniforms.h:225
UT_Vector3F_UBO myHeadlightDir
Definition: GR_Uniforms.h:747
RE_TextureDimension getTextureType() const
#define SET_GLOBAL(name, v)
Definition: GR_Uniforms.h:50
#define UT_Vector2F_UBO
Definition: GR_Uniforms.h:668
void setPickArea(const UT_Vector4F &v)
Definition: GR_Uniforms.h:616
float getObjWireThickness() const
Definition: GR_Uniforms.h:246
UT_Vector3F backlightColor()
Definition: GR_Uniforms.h:559
void setUseFilllight(bool use_fill)
Definition: GR_Uniforms.h:539
void setSpecular(float v)
Definition: GR_Uniforms.h:501
#define VK_GLOBAL_BLOCK_START
Definition: GR_Uniforms.h:678
UT_Matrix4F_UBO myInvViewF
Definition: GR_Uniforms.h:686
GLfloat f
Definition: glcorearb.h:1926
UT_Vector4T< float > UT_Vector4
UT_Vector2F_UBO myLODParms
Definition: GR_Uniforms.h:699
GR_TextureRef getDepthMap()
Definition: GR_Uniforms.h:642
const UT_Matrix4D & getObjModelMatrix() const
Definition: GR_Uniforms.h:143
std::array< T, N > UT_FixedArray
Definition: UT_FixedArray.h:19
float getEmission() const
Definition: GR_Uniforms.h:499
UT_Vector4F_UBO myPickArea
Definition: GR_Uniforms.h:733
void setExcludeGsplatShadowCasters(bool v)
Definition: GR_Uniforms.h:223
bool getObjColorIgnoreGeo() const
Definition: GR_Uniforms.h:331
UT_Vector3F_UBO myBacklightDir
Definition: GR_Uniforms.h:758
void unlockGlobalUniforms()
Definition: GR_Uniforms.h:662
const UT_Vector3i & getSnapDistances() const
Definition: GR_Uniforms.h:645
GlobalUniforms & globals()
Definition: GR_Uniforms.h:829
const UT_Matrix4F & getVKViewMatrix() const
Definition: GR_Uniforms.h:171
GR_TextureRef myConstColorMap
Definition: GR_Uniforms.h:470
UT_Vector2F_UBO myScreenSize
Definition: GR_Uniforms.h:698
GLint ref
Definition: glcorearb.h:124
const RenderInfo & renderInfo() const
Definition: GR_Uniforms.h:844
void setCSMRegionOffsets(const CSMRegionInvExts &e)
Definition: GR_Uniforms.h:236
UT_Vector3i getObjPickBaseID() const
Definition: GR_Uniforms.h:305
void lockGlobalUniforms()
Definition: GR_Uniforms.h:658
UT_Vector2F_UBO myDepthRange
Definition: GR_Uniforms.h:701
void setObjPickComponentID(const UT_Vector3i &v)
Definition: GR_Uniforms.h:308
void setDepthOcclusion(fpreal32 v)
Definition: GR_Uniforms.h:217
constexpr auto set(type rhs) -> int
Definition: core.h:610
float backlightSoftness()
Definition: GR_Uniforms.h:560
int getObjSelectInstance() const
Definition: GR_Uniforms.h:292
int32 getSnapParms() const
Definition: GR_Uniforms.h:648
const UT_Vector4 & getObjSelectColor() const
Definition: GR_Uniforms.h:280
int getNumSamples() const
Definition: GR_Uniforms.h:611
UT_Vector3F headlightColor()
Definition: GR_Uniforms.h:537
void setCamView(const UT_Matrix4D &v)
Definition: GR_Uniforms.h:593
bool useEnvlight() const
Definition: GR_Uniforms.h:567
const UT_Matrix4D & getInvProjectionMatrix() const
Definition: GR_Uniforms.h:207
GLint GLuint mask
Definition: glcorearb.h:124
ObjectUniforms & objects()
Definition: GR_Uniforms.h:820
const UT_Vector2F & getDepthProject() const
Definition: GR_Uniforms.h:215
void setCSMRegionInvExts(const CSMRegionInvExts &e)
Definition: GR_Uniforms.h:232
UT_Matrix4T< fpreal32 > UT_Matrix4F
void setRenderPass(RenderPass v)
Definition: GR_Uniforms.h:585
#define GR_API
Definition: GR_API.h:10
fpreal32 getObjAlphaCutoff() const
Definition: GR_Uniforms.h:395
UT_Matrix4F_UBO myInvProjectionF
Definition: GR_Uniforms.h:685
UT_Vector2F_UBO myDepthOffset
Definition: GR_Uniforms.h:730
const UT_Vector4 & getObjConstColor() const
Definition: GR_Uniforms.h:249
const GlobalUniforms & globals() const
Definition: GR_Uniforms.h:835
#define UT_Vector4F_UBO
Definition: GR_Uniforms.h:670
float getObjDecorationScale() const
Definition: GR_Uniforms.h:301
void setObjSelectMode(int v)
Definition: GR_Uniforms.h:285
bool getUseVulkanProjection() const
Definition: GR_Uniforms.h:204
void setProjectMatrix(const UT_Matrix4D &v, bool correct=true, bool is_ortho=false)
Definition: GR_Uniforms.h:177
float getSpecular() const
Definition: GR_Uniforms.h:502
RE_ZFunction
Definition: RE_Types.h:478
void setAmbient(float v)
Definition: GR_Uniforms.h:507
void setObjUseInstancePrimId(int32 v)
Definition: GR_Uniforms.h:349
Handle to the main interface of Vulkan.
Definition: RV_Instance.h:50
void setCamProject(const UT_Matrix4D &v)
Definition: GR_Uniforms.h:600
void setReverseDepth(bool use_vk)
Definition: GR_Uniforms.h:210
int getObjSelectMode() const
Definition: GR_Uniforms.h:286
void setObjSelectType(int v)
Definition: GR_Uniforms.h:288
float getObjGhostFactor() const
Definition: GR_Uniforms.h:269
int32 getShadowmapIndex() const
Definition: GR_Uniforms.h:221
GLenum mode
Definition: glcorearb.h:99
void setObjWireColor(const UT_Vector4 &v)
Definition: GR_Uniforms.h:239
const UT_Vector2 & getLODParms() const
Definition: GR_Uniforms.h:614
bool isVulkan() const
Definition: GR_TextureRef.h:39
UT_Vector3T< fpreal32 > UT_Vector3F
#define UT_Vector3F_UBO
Definition: GR_Uniforms.h:669
const CSMRegionInvExts & getCSMRegionOffsets() const
Definition: GR_Uniforms.h:237
int32 getObjPickDepthPass() const
Definition: GR_Uniforms.h:315
const UT_Vector4F & getDecorationLocate() const
Definition: GR_Uniforms.h:651
UT_FixedArray< UT_Vector4, 4 > CSMRegionInvExts
Definition: GR_Uniforms.h:231
float getAlphaCutoff() const
Definition: GR_Uniforms.h:591
GLuint shader
Definition: glcorearb.h:785
ImageBuf OIIO_API cut(const ImageBuf &src, ROI roi={}, int nthreads=0)
const UT_Matrix4D & getObjModelViewMatrix() const
Definition: GR_Uniforms.h:146
UT_Vector3F_UBO myHeadlightColor
Definition: GR_Uniforms.h:749
UT_Vector3F_UBO myNormalMatFr1
Definition: GR_Uniforms.h:682
GLenum func
Definition: glcorearb.h:783
#define VK_BLOCK_START
Definition: GR_Uniforms.h:402
UT_Vector2T< fpreal32 > UT_Vector2F
float filllightSoftness()
Definition: GR_Uniforms.h:549
void setObjModelMatrix(const UT_Matrix4D &v, const UT_Matrix4D *inv=nullptr)
Definition: GR_Uniforms.h:119
const UT_Vector2 & getScreenSize() const
Definition: GR_Uniforms.h:608
void setObjColorIgnoreGeo(bool v)
Definition: GR_Uniforms.h:327
UT_Vector4T< fpreal32 > UT_Vector4F
GLuint color
Definition: glcorearb.h:1261
UT_Vector3F_UBO myFilllightDir
Definition: GR_Uniforms.h:753
#define UT_Vector3i_UBO
Definition: GR_Uniforms.h:672
const CSMRegionInvExts & getCSMRegionInvExts() const
Definition: GR_Uniforms.h:233
fpreal32 getDepthOcclusion() const
Definition: GR_Uniforms.h:218
UT_Vector2F_UBO myDepthProject
Definition: GR_Uniforms.h:702
void setSnapDistances(const UT_Vector3i &v)
Definition: GR_Uniforms.h:644
#define VK_GLOBAL_BLOCK_END
Definition: GR_Uniforms.h:767
fpreal64 fpreal
Definition: SYS_Types.h:283
void setScreenSize(const UT_Vector2 &v)
Definition: GR_Uniforms.h:607
UT_Matrix4F_UBO myProjectionF
Definition: GR_Uniforms.h:680
const UT_Matrix4D & getProjectionMatrix() const
Definition: GR_Uniforms.h:205
GLuint index
Definition: glcorearb.h:786
UT_Vector3i getObjPickComponentID() const
Definition: GR_Uniforms.h:310
bool hasPrimLightMask() const
Definition: GR_Uniforms.h:577
void setDiffuse(float v)
Definition: GR_Uniforms.h:504
void setDepthProject(const UT_Vector2F &p)
Definition: GR_Uniforms.h:214
void setObjMinLocatedID(exint v)
Definition: GR_Uniforms.h:360
void setObjDecorationScale(float v)
Definition: GR_Uniforms.h:300
const UT_Matrix4D & getObjInvModelMatrix() const
Definition: GR_Uniforms.h:144
UT_Vector3F_UBO myFilllightColor
Definition: GR_Uniforms.h:755
void setDepthMap(GR_TextureRef v, bool use=true, RE_ZFunction func=RE_ZALWAYS)
Definition: GR_Uniforms.h:626
const UT_Matrix4D & getCamProject() const
Definition: GR_Uniforms.h:605
fpreal headlightSoftness()
Definition: GR_Uniforms.h:538
const UT_Vector4 & getObjGhostColor() const
Definition: GR_Uniforms.h:268
unsigned getLightMask() const
Definition: GR_Uniforms.h:517
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:165
bool getReverseDepth() const
Definition: GR_Uniforms.h:211
UT_Matrix4F getEnvlightRotate() const
Definition: GR_Uniforms.h:568
UT_Vector3i_UBO mySnapDistances
Definition: GR_Uniforms.h:737
GLboolean r
Definition: glcorearb.h:1222
set of parameters sent to GR_Primitive::update()
Definition: GR_Uniforms.h:56
void setObjSelectInstance(int v)
Definition: GR_Uniforms.h:291
A vulkan buffer object.
Definition: RV_VKBuffer.h:75
int getObjFillSelection() const
Definition: GR_Uniforms.h:295
UT_FixedArray< UT_Vector4, 4 > CSMRegionOffsets
Definition: GR_Uniforms.h:235
void setObjPrimConstandID(int v)
Definition: GR_Uniforms.h:297
void setObjPickDepthPass(int32 v)
Definition: GR_Uniforms.h:313
UT_Vector3F_UBO myNormalMatFr3
Definition: GR_Uniforms.h:684
void setObjLocatedBuffer(RV_VKBuffer *buf)
Definition: GR_Uniforms.h:367
UT_Matrix4F_UBO myEnvlightRotate
Definition: GR_Uniforms.h:763
#define UT_Matrix4F_UBO
Definition: GR_Uniforms.h:674
FMT_INLINE void print(format_string< T...> fmt, T &&...args)
Definition: core.h:2903
int getObjSelectType() const
Definition: GR_Uniforms.h:289
void setSnapParms(int32 v)
Definition: GR_Uniforms.h:647
const UT_Matrix4D & getCamView() const
Definition: GR_Uniforms.h:598
int getOnionSkinGroup() const
Definition: GR_Uniforms.h:514
const UT_Matrix3D & getObjNormalMatrix() const
Definition: GR_Uniforms.h:145
void setObjConstColor(const UT_Vector4 &v)
Definition: GR_Uniforms.h:248
float getDiffuse() const
Definition: GR_Uniforms.h:505
RenderInfo & renderInfo()
Definition: GR_Uniforms.h:840
void setDecorationLocate(const UT_Vector4F &v)
Definition: GR_Uniforms.h:650
void setObjBackfaceTint(const UT_Vector3 &v, float gfact=0.5)
Definition: GR_Uniforms.h:271
void setLODParms(const UT_Vector2 &v)
Definition: GR_Uniforms.h:613
void setObjLightingEnabled(int v)
Definition: GR_Uniforms.h:380
void setDepthRange(const UT_Vector2F &r)
Definition: GR_Uniforms.h:213
const ObjectUniforms & objects() const
Definition: GR_Uniforms.h:824
void setOnionSkinGroup(int v)
Definition: GR_Uniforms.h:513
bool useHeadlight() const
Definition: GR_Uniforms.h:521
void setHeadlightParms(UT_Vector3F dir, UT_Vector3F color, float ambient, float soft, bool use_spec, bool use_world_space)
Definition: GR_Uniforms.h:522
UT_Vector3F_UBO myNormalMatFr2
Definition: GR_Uniforms.h:683
int getObjLightingEnabled() const
Definition: GR_Uniforms.h:383