HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RE_Light.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: RE_Light.h (C++)
7  *
8  * COMMENTS: Header file for RE_Light and RE_Lights
9  *
10  * Defines all the parameters required for rendering any Houdini light in
11  * the viewport.
12  */
13 
14 #ifndef __RE_Light_H__
15 #define __RE_Light_H__
16 
17 #include "RE_API.h"
18 #include "RE_TextureMap.h"
19 #include "RE_Types.h"
20 #include "RE_UniformBlock.h"
21 #include <UT/UT_BoundingBox.h>
22 #include <UT/UT_Matrix4.h>
23 #include <UT/UT_NonCopyable.h>
24 #include <UT/UT_String.h>
25 #include <UT/UT_Vector3.h>
26 #include <SYS/SYS_Types.h>
27 #include <string.h>
28 
29 class UT_Ramp;
30 class UT_Raster;
31 class RE_Texture2DMap;
32 class RE_TextureCubeMap;
33 class RE_Render;
34 class RE_ShadowMap;
35 class RE_Shader;
36 
37 #define RE_SHADOW_MAX_AREA_MAPS 8
38 #define RE_SHADOW_NUM_CUBE_MAPS 6
39 
40 // THIS ENUM MUST BE IN-SYNC WITH OBJ_LightAreaShape in OBJ_Light.h.
42 {
49 };
50 
52 {
53 public:
54  RE_LightData();
55  virtual ~RE_LightData();
56 
58 };
59 
61 {
62 public:
64  {
65  cone = 0;
66  infinite = 0;
67  ambient = 0;
68  mapprojector = 0;
69  clampprojectormap = 0;
70  mipmap = 0;
71  projectormapdirty = 0;
72  envlight = 0;
73  area = 0;
74  geometry = 0;
75  portal = 0;
76  globillum = 0;
77  enabled = 1;
78  headlight = 0;
79  }
80 
81  unsigned mapprojector:1,
82  cone:1,
83  infinite:1,
84  ambient:1,
85  clampprojectormap:1,
86  projectormapdirty:1,
87  mipmap:1,
88  envlight:1,
89  area:1,
90  geometry:1,
91  portal:1,
92  globillum:1,
93  enabled:1,
94  headlight:1;
95 };
96 
97 
99 {
100 public:
101  RE_Light(const char *n = nullptr);
102  virtual ~RE_Light();
103 
105 
106  const char *getName() const { return myName; }
107  void setName(const char *name) { myName = name; }
108 
109  void enable(bool e) { flag.enabled = e; }
110  bool isEnabled() const { return flag.enabled; }
111 
112  // Similar to isEnabled(), but takes into account color=(0,0,0) and other
113  // factors
114  bool isLightContributing() const;
115 
116  void setHeadlight(bool hl) { flag.headlight = hl; }
117  bool isHeadlight() const { return flag.headlight; }
118 
119  const UT_Vector3 &getPosition() const { return myPos; }
120  void setPosition(const UT_Vector3 &p)
121  { if(p != myPos) { myPos = p; invalidateShadowMap(); }}
122 
123  const UT_Vector3 &getDirection() const { return myDir; }
124  void setDirection(const UT_Vector3 &d)
125  { if(d != myDir) { myDir = d; invalidateShadowMap(); }}
127  { if(orient != myOrientation)
128  { myOrientation = orient; invalidateShadowMap(); }
129  }
130  const UT_Matrix3 &getOrientation() { return myOrientation; }
131 
132  const UT_Vector3F &getColor() const { return myColor; }
133  UT_Vector3 &getColor() { return myColor; }
134  void setColor(const UT_Vector3 &c);
135 
136  void setIntensity(float i);
137  float getIntensity() const { return myIntensity; }
138 
139  const UT_Matrix4 &getTransform() const { return myTransform; }
140  UT_Matrix4 &getTransform() { return myTransform; }
141  void setTransform(const UT_Matrix4 &m);
142 
143  // Range of illumination, in local bounds (must be transfomed by the above
144  // transform). Some lights do not have boumds, like environment, infinite
145  // and ambient lights, or lights with no distant attenuation - these will
146  // have an invalid BBox. Illumination cutoff is 1/1000th.
147  const UT_BoundingBoxF &getIlluminationBounds();
148 
149  int isCone() const { return flag.cone; }
150  int isInfinite() const { return flag.infinite; }
151  int isAmbient() const { return flag.ambient; }
152  int isMapProjector() const { return flag.mapprojector; }
153  bool isEnvironmentLight() const { return flag.envlight; }
154  bool isPortalLight() const { return flag.portal; }
155  bool isGlobalIllumination() const { return flag.globillum; }
156  bool isGeometry() const { return flag.geometry; }
157 
158  bool isAreaLight() const { return flag.area; }
159  UT_Vector3 getAreaAxes() const { return myAreaAxes; }
160  UT_Matrix4 getAreaTransform() const { return myAreaTransform; }
161  float getSurfaceArea() const { return mySurfaceArea; }
162  RE_LightAreaShape getAreaShape() const { return myAreaLightShape; }
163  bool isAreaSingleSided() const { return myAreaSingleSided; }
165  { return myAreaSingleReverse; }
166  int isDiffuse() const { return myContribDiff; }
167  int isSpecular() const { return myContribSpec; }
168 
169  bool isShadowed() const { return myUseShadows; }
170 
171  // bumped whenever light geometry is changed
172  virtual int64 getVersion() const { return 0; }
173 
174  // bumped whenever emitted light is changed
175  int64 getEmitVersion() const { return myEmitSerial; }
176 
177  /// Can be used by OP_Node::lookupNode() to return the light object
178  /// this light is attached to.
179  virtual int getUniqueId() const { return -999; }
180 
181  //
182  // Light attribute settings, infinite, point, and cone light
183  //
184  void setInfinite(int onoff);
185  void setAmbient(int onoff);
186  void setCone(int onoff);
187  void setArea(bool onoff);
188  void setGeometry(bool onoff);
189  void setEnvironment(bool onoff);
190  void setPortal(bool onoff);
191  void setGlobalIllumination(bool onoff);
192  void setAreaShape(RE_LightAreaShape shape);
193  void setAreaAxes(const UT_Vector3F &axes);
194  void setAreaTransform(UT_Matrix4 t);
195  void setAreaSide(bool single, bool reverse);
196  void setAreaSamplePoints(const UT_Vector3FArray &pos,
197  const UT_Vector3FArray &dir);
198  void buildAreaShape(int numsample);
199  void setBoundingRadius(float radius);
200  void setSurfaceArea(float area);
201  void setNormalizeArea(bool norm);
202  void setDiffuse(int onoff);
203  void setSpecular(int onoff);
204  void setConeAttrib(float a = 45, float d = 10, float r = 1)
205  {
206  if(myConeAngle != a ||
207  myConeDelta != d ||
208  myConeRoll != r)
209  {
210  myConeAngle = a;
211  myConeDelta = d;
212  myConeRoll = r;
213  setCone((a*.5 + d >= 180) ? 0 : 1);
214  invalidateShadowMap();
215  }
216  }
217  float getConeAngle() const { return myConeAngle; }
218  float getConeDelta() const { return myConeDelta; }
219  float getConeRoll() const { return myConeRoll; }
220 
221  // Attenuation
222  void setAttenuation(float constant,
223  float linear,
224  float quadratic);
225  void getAttenuation(float atten[3]) const
226  { atten[0] = myAtten[0];
227  atten[1] = myAtten[1];
228  atten[2] = myAtten[2]; }
229  void setAttenuationRange(float near_dist, float far_dist);
230  void getAttenuationRange(float range[2]) const
231  { range[0] = myAttenRange[0];
232  range[1] = myAttenRange[1]; }
233 
234  void setAttenuationRamp(const UT_Ramp *ramp,
235  float start_dist, float end_dist);
236  RE_Texture *getAttenuationRamp(RE_Render *r);
237  void getAttenuationRampRange(float range[2]) const
238  { range[0] = myAttenRampStart;
239  range[1] = myAttenRampEnd; }
240 
241 
242  // Shadows
243  void setShadowed(bool onoff);
244  void setShadowIntensity(float i) { myShadowIntensity = i; }
245  void setShadowBias(float b) { myShadowBias = b; }
246  void setShadowBlur(float b) { myShadowBlur = b; }
247  void setShadowQuality(float q) { myShadowQuality=q; }
248  void setLightShadowMapSize(int s) { myLightShadowMapSize=s;}
249  void setShadowMapSize(int s);
250  void setShadowMask(const char *m);
251  void setLinearShadowMap(bool linear);
252  void setViewFrustum(UT_Vector3FArray &pnts,UT_Vector3F &cam);
253  void setSceneBounds(const UT_BoundingBox &scene);
254 
255  float getShadowIntensity() const { return myShadowIntensity;}
256  float getShadowBias() const { return myShadowBias; }
257  float getShadowBlur() const { return myShadowBlur; }
258  float getShadowQuality() const { return myShadowQuality; }
259  int getShadowMapSize() const { return myShadowMapSize; }
261  { return myLightShadowMapSize; }
262  int getNumAreaMaps() const;
263  const UT_StringRef &getShadowMask() const { return myShadowMask; }
264  bool getLinearShadowMap() const;
265 
266  // Only valid once the shadowmap exists.
267  void getShadowZRange(fpreal &n, fpreal &f);
268 
269  // Shadow map usage
270  RE_Texture *getShadowMap(int area_index = 0);
271  void setMultiMap(bool m);
272  bool beginShadowRender(RE_Render *r,
273  RE_TextureCubeFace face
275  int area_index = 0);
276  void endShadowRender(RE_Render *r,
277  RE_TextureCubeFace face
279  int area_index = 0);
280  void setShadowMapVersion(uint64 version);
281  int64 getShadowMapVersion() const;
282  void setShadowMapTime(fpreal t);
283  fpreal getShadowMapTime() const;
284 
285  //
286  // Other attributes (like zoom)
287  void setZoom(float z);
288  void setFocalLength(float focal);
289  void setAperture(float aper);
290  void setOrthoWidth(float width);
291  void setNearDistance(float znear);
292  void setFarDistance(float zfar);
293  void setLeftBarn(float amount, float falloff);
294  void setRightBarn(float amount, float falloff);
295  void setTopBarn(float amount, float falloff);
296  void setBottomBarn(float amount, float falloff);
297 
298  void setFogScatter(float para, fpreal perp)
299  { myFogScatterPara = para;
300  myFogScatterPerp = perp; }
301  void setFogIntensity(float intensity)
302  { myFogIntensity = intensity; }
303 
304  float getZoom() const { return myZoom; }
305  float getFocalLength() const { return myFocalLength; }
306  float getAperture() const { return myAperture; }
307  float getOrthoWidth() const { return myOrthoWidth; }
308  float getNearDistance() const { return myNearDist; }
309  float getFarDistance() const { return myFarDist; }
310  float getFogIntensity() const { return myFogIntensity; }
311  float getFogScatterPara() const { return myFogScatterPara; }
312  float getFogScatterPerp() const { return myFogScatterPerp; }
313 
314  int64 getLightVersion() const { return myLightVersion; }
315  void bumpLightVersion() { myLightVersion++; }
316 
317  int getConeTextureIndex() const
318  { return myGLConeTextureIndex;}
319  void setConeTextureIndex(int idx)
320  { myGLConeTextureIndex = idx; }
321 
322  //
323  // Methods to set up different texture maps used by lights
324  void setProjectMap(const char *name,
325  const char *relativeTo);
326  void setProjectMapClamp(int onoff);
327  void setProjectMapFormat(RE_TextureCompress format);
328  void setProjectMapScale(float sc, bool limitres,
329  int maxw, int maxh);
330  void setProjectMapMipmap(bool onoff);
331  void setProjectMapAnisotropy(int samples);
332 
333  RE_Texture2DMap *getProjectMap(RE_Render *r);
334 
335  void setEnvironmentMap(const char *name,
336  const char *relativeTo);
337  void setEnvironmentFormat(RE_TextureCompress format);
338  void setEnvironmentMipmap(bool onoff);
339  void setEnvironmentCone(float angle);
340  RE_TextureHolder getEnvironmentMap(RE_Render *r, int max_width);
341  float getEnvironmentCone() const;
342 
343  //
344  // Uniform blocks for lights
345  void updateBasicLighting(RE_Render *r,
346  RE_Shader *sh,
347  int index);
348  void updateHQLighting(RE_Render *r, RE_Shader *sh);
349  void updateAreaLighting(RE_Render *r, RE_Shader *sh);
350  void updateShadow(RE_Render *r, RE_Shader *sh);
351 
352  // For SSBO light blocks. Copies this light's info into the block at index
353  // 'light_index'.
354  void updateBasicBlock(RE_UniformBlock *lighting_block,
355  int light_index,
356  const char *light_prefix);
357  void updateHQLightingBlock(RE_Render *r,
358  RE_UniformBlock *block,
359  int light_index,
360  const char *light_prefix) const;
361  void updateAreaLightingBlock(RE_Render *r,
362  RE_UniformBlock *block,
363  int light_index,
364  const char *light_pref) const;
365 
366  static void clearLight(RE_Shader *sh, int index);
367 
368  /// @brief Allows data, like shadow maps, to be stored with the light
369  /// Attaching data to the light gives it ownership, meaning that it will be
370  /// deleted when the light is deleted, or when a different data chunk is
371  /// assigned to the same index. To avoid it being deleted, detach the chunk.
372  /// @{
373  void attachUserData(RE_LightData *data, int index);
374  RE_LightData *detachUserData(int index);
375  RE_LightData *getAttachedUserData(int index) const;
376  /// @}
377 
378  /// @brief Accessor to underlaying shadow map object
379  /// Each light may have a shadow map object. Turning off shadows on the
380  /// light will delete the map, so do not cache the pointer. If a shadow map
381  /// does not exist, this will create a new one.
382  RE_ShadowMap *getShadowMap();
383 
385  {
393 
394  NUM_HQLIGHT_TYPES
395  };
396 
397  RE_HQLightType hqLightType() const;
398 
399  void setLightBatchID(int id, int index);
400  int getLightBatchID() { return myBatchID; }
401  int getLightBatchIndex() { return myBatchIndex; }
402 
403  void setLightLink(const UT_StringRef &link)
404  { myLightLink = link; }
405  const UT_StringRef & getLightLink() const { return myLightLink; }
406 protected:
407 
408  void invalidateShadowMap(bool purge_map = false);
409  void createEnvMap();
410  void getAreaLightProjection(UT_Matrix4 &mat) const;
411 
412  int myGLConeTextureIndex; // for lights that project maps
413  unsigned myContribDiff:1, // contributes to diffuse
414  myContribSpec:1, // contributes to specular
415  myUseShadows:1, // uses shadow maps
416  myAreaSingleSided:1, // single-sided area light
417  myAreaSingleReverse:1, // reverse dir for ss area light
418  myNormalizeArea:1, // Normalize brightness to area
419  myBBoxDirty : 1;
428  float myIntensity;
429  float myConeAngle, myConeDelta, myConeRoll;
430  float myAperture, myFocalLength;
432  float myNearDist;
433  float myFarDist;
434  float myZoom;
435  float myAtten[3];
436  float myAttenRange[2];
438  RE_Texture2DMap *projectMap; // Projection texture
439  RE_TextureCubeMap *myEnvMap; // Environment map
440  float myEnvCone;
442 
463 
470 
477 
479 
483 
486 
489 
492 
493  // Cached uniform blocks
498 };
499 
500 inline void
502 {
503  if(myColor != c)
504  {
506  myEmitSerial++;
507  myColor = c;
508  }
509 }
510 
511 inline void
513 {
514  if(myIntensity != i)
515  {
517  myEmitSerial++;
518  myIntensity = i;
519  }
520 }
521 
522 inline void
524 {
525  if(flag.infinite != onoff)
526  {
527  invalidateShadowMap(true);
528  flag.infinite = onoff;
529  if(onoff)
530  {
531  flag.area = false;
532  flag.cone = false;
533  flag.envlight = false;
534  flag.ambient = false;
535  flag.globillum = false;
536  }
537  }
538 }
539 
540 inline void
542 {
543  if(flag.ambient != onoff)
544  {
545  invalidateShadowMap(true);
546  flag.ambient = onoff;
547  if(onoff)
548  {
549  flag.area = false;
550  flag.infinite = false;
551  flag.cone = false;
552  flag.envlight = false;
553  flag.globillum = false;
554  }
555  }
556 }
557 
558 inline void
560 {
561  if(flag.cone != onoff)
562  {
563  invalidateShadowMap(true);
564  flag.cone = onoff;
565  if(onoff)
566  {
567  flag.infinite = false;
568  flag.ambient = false;
569  flag.envlight = false;
570  flag.globillum = false;
571  }
572  }
573 }
574 
575 inline void
576 RE_Light::setArea(bool onoff)
577 {
578  if(flag.area != onoff)
579  {
580  invalidateShadowMap(true);
581  flag.area = onoff;
582  if(onoff)
583  myAreaDirty = true;
584  if(onoff)
585  {
586  flag.envlight = false;
587  flag.infinite = false;
588  flag.ambient = false;
589  flag.globillum = false;
590  }
591  }
592 }
593 
594 inline void
596 {
597  flag.geometry = onoff;
598 }
599 
600 inline void
602 {
603  if(flag.portal != onoff)
604  {
605  invalidateShadowMap(true);
606  flag.portal = onoff;
607  }
608 }
609 
610 
611 inline void
613 {
614  if(onoff != flag.envlight)
615  {
616  flag.envlight = onoff;
617  if(onoff)
618  {
619  invalidateShadowMap(true);
620  flag.area = false;
621  flag.cone = false;
622  flag.ambient = false;
623  flag.infinite = false;
624  flag.globillum = false;
625  }
626  else
628 
629  }
630 }
631 
632 inline void
634 {
635  if(onoff != flag.globillum)
636  {
637  flag.globillum = onoff;
638  if(onoff)
639  {
640  invalidateShadowMap(true);
641  flag.area = false;
642  flag.cone = false;
643  flag.ambient = false;
644  flag.infinite = false;
645  flag.envlight = false;
646  }
648  }
649 }
650 
651 inline void
652 RE_Light::setAreaSide(bool single, bool reverse)
653 {
654  if(myAreaSingleSided != single ||
655  myAreaSingleReverse != reverse)
656  {
657  myAreaSingleSided = single;
659  myAreaDirty = true;
661  }
662 }
663 
664 inline void
666 {
667  myBoundingRadius = radius;
668 }
669 
670 inline void
672 {
673  angle = SYSmax(0.0f, angle);
674  if(angle != myEnvCone)
675  {
677  myEnvCone = angle;
678  }
679 }
680 
681 inline float
683 {
684  return myEnvCone;
685 }
686 
687 inline void
689 {
690  if(znear != myNearDist)
691  {
692  myNearDist = znear;
694  }
695 }
696 
697 inline void
699 {
700  if(myFarDist != zfar)
701  {
702  myFarDist = zfar;
704  }
705 }
706 
707 inline void
709 {
710  if(myShadowMask != m)
711  {
712  myShadowMask.harden(m);
714  }
715 }
716 
717 inline void
719  float linear,
720  float quadratic)
721 
722 {
723  if(!SYSisEqual(myAtten[0], constant) ||
724  !SYSisEqual(myAtten[1], linear) ||
725  !SYSisEqual(myAtten[2], quadratic))
726  {
727  myAtten[0] = constant;
728  myAtten[1] = linear;
729  myAtten[2] = quadratic;
731  }
732 }
733 
734 inline void
735 RE_Light::setAttenuationRange(float near_dist, float far_dist)
736 {
737  if(!SYSisEqual(myAttenRange[0], near_dist) ||
738  !SYSisEqual(myAttenRange[1], far_dist))
739  {
740  myAttenRange[0] = near_dist;
741  myAttenRange[1] = far_dist;
743  }
744 }
745 
746 inline void
748 {
749  if(myAreaAxes!= axes)
750  {
751  myAreaAxes=axes;
752  myAreaDirty = true;
754  }
755 }
756 
757 inline void
759 {
760  if(myAreaTransform!=t)
761  {
763  myAreaDirty = true;
765  }
766 }
767 
768 inline void
770 {
771  if(!SYSisEqual(mySurfaceArea, area))
772  {
774  myAreaDirty = true;
776  }
777 }
778 
779 inline void
781 {
782  if(norm != myNormalizeArea)
783  {
784  myNormalizeArea = norm;
785  myAreaDirty = true;
787  }
788 }
789 
790 inline void
792 {
793  if(myContribDiff != onoff)
794  {
795  myContribDiff = onoff;
797  }
798 }
799 
800 inline void
802 {
803  if(myContribSpec != onoff)
804  {
805  myContribSpec = onoff;
807  }
808 }
809 
810 inline void
812 {
813  if(!SYSisEqual(myZoom,z))
814  {
815  myZoom = z;
817  }
818 }
819 
820 inline void
822 {
823  if(!SYSisEqual(myFocalLength,focal))
824  {
825  myFocalLength = focal;
827  }
828 }
829 
830 inline void
832 {
833  if(!SYSisEqual(myAperture,aper))
834  {
835  myAperture = aper;
837  }
838 }
839 
840 inline void
842 {
843  if(!SYSisEqual(myOrthoWidth,width))
844  {
847  }
848 }
849 
850 inline void
852 {
853  if(myTransform != m)
854  {
855  myTransform= m;
857  }
858 }
859 
860 inline void
862 {
863  myBatchID = id;
865 }
866 
867 inline void
868 RE_Light::setLeftBarn(float amount, float falloff)
869 {
870  myLeftBarn.assign(amount, falloff);
871 }
872 
873 inline void
874 RE_Light::setRightBarn(float amount, float falloff)
875 {
876  myRightBarn.assign(amount, falloff);
877 }
878 
879 inline void
880 RE_Light::setTopBarn(float amount, float falloff)
881 {
882  myTopBarn.assign(amount, falloff);
883 }
884 
885 inline void
886 RE_Light::setBottomBarn(float amount, float falloff)
887 {
888  myBottomBarn.assign(amount, falloff);
889 }
890 
891 #endif
bool myAttenRampDirty
Definition: RE_Light.h:469
int64 getEmitVersion() const
Definition: RE_Light.h:175
#define SYSmax(a, b)
Definition: SYS_Math.h:1582
RE_UniformBlockHandle myHighQualityBlock
Definition: RE_Light.h:495
bool isEnvironmentLight() const
Definition: RE_Light.h:153
void getAttenuation(float atten[3]) const
Definition: RE_Light.h:225
bool isHeadlight() const
Definition: RE_Light.h:117
void setAperture(float aper)
Definition: RE_Light.h:831
float myEnvCone
Definition: RE_Light.h:440
RE_LightAreaShape getAreaShape() const
Definition: RE_Light.h:162
void setAreaSide(bool single, bool reverse)
Definition: RE_Light.h:652
UT_Vector2F myRightBarn
Definition: RE_Light.h:460
float getEnvironmentCone() const
Definition: RE_Light.h:682
void setAreaAxes(const UT_Vector3F &axes)
Definition: RE_Light.h:747
unsigned geometry
Definition: RE_Light.h:81
void setAttenuationRange(float near_dist, float far_dist)
Definition: RE_Light.h:735
UT_Vector3 myPos
Definition: RE_Light.h:423
GLenum GLint * range
Definition: glcorearb.h:1925
RE_HQLightType
Definition: RE_Light.h:384
float getNearDistance() const
Definition: RE_Light.h:308
UT_Array< RE_LightData * > myAttachedLightData
Definition: RE_Light.h:490
void setIntensity(float i)
Definition: RE_Light.h:512
void setName(const char *name)
Definition: RE_Light.h:107
void bumpLightVersion()
Definition: RE_Light.h:315
float getShadowBlur() const
Definition: RE_Light.h:257
int myBatchID
Definition: RE_Light.h:487
RE_TextureCubeFace
UT_StringHolder myLightLink
Definition: RE_Light.h:422
#define RE_API
Definition: RE_API.h:10
void setGeometry(bool onoff)
Definition: RE_Light.h:595
SIM_API const UT_StringHolder angle
void setEnvironmentCone(float angle)
Definition: RE_Light.h:671
void harden(const char *src)
int myGLConeTextureIndex
Definition: RE_Light.h:412
RE_TextureCompress myProjectMapFormat
Definition: RE_Light.h:449
UT_Matrix4 myTransform
Definition: RE_Light.h:427
UT_Vector3 myAreaAxes
Definition: RE_Light.h:471
const UT_Vector3F & getColor() const
Definition: RE_Light.h:132
const UT_StringRef & getShadowMask() const
Definition: RE_Light.h:263
float myMaxLightRadius
Definition: RE_Light.h:437
bool isGlobalIllumination() const
Definition: RE_Light.h:155
GLdouble GLdouble GLdouble z
Definition: glcorearb.h:848
void setFogScatter(float para, fpreal perp)
Definition: RE_Light.h:298
virtual int getUniqueId() const
Definition: RE_Light.h:179
void setColor(const UT_Vector3 &c)
Definition: RE_Light.h:501
int myProjectMapMaxW
Definition: RE_Light.h:446
void setLeftBarn(float amount, float falloff)
Definition: RE_Light.h:868
UT_Matrix4 getAreaTransform() const
Definition: RE_Light.h:160
unsigned area
Definition: RE_Light.h:81
RE_LightAreaShape myAreaLightShape
Definition: RE_Light.h:458
float myFocalLength
Definition: RE_Light.h:430
RE_Texture2DMap * projectMap
Definition: RE_Light.h:438
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1222
int isSpecular() const
Definition: RE_Light.h:167
GLdouble s
Definition: glad.h:3009
PUGI__FN void reverse(I begin, I end)
Definition: pugixml.cpp:7458
UT_StringHolder myName
Definition: RE_Light.h:421
void setDiffuse(int onoff)
Definition: RE_Light.h:791
float getZoom() const
Definition: RE_Light.h:304
RE_TextureCubeMap * myEnvMap
Definition: RE_Light.h:439
UT_Matrix4 & getTransform()
Definition: RE_Light.h:140
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glcorearb.h:2539
int myShadowMapSize
Definition: RE_Light.h:455
RE_LightFlag()
Definition: RE_Light.h:63
GLdouble GLdouble GLdouble q
Definition: glad.h:2445
unsigned long long uint64
Definition: SYS_Types.h:117
int64 getLightVersion() const
Definition: RE_Light.h:314
float mySurfaceArea
Definition: RE_Light.h:472
float getFocalLength() const
Definition: RE_Light.h:305
UT_String myProjectMapRelativeTo
Definition: RE_Light.h:444
UT_Vector3 & getColor()
Definition: RE_Light.h:133
void enable(bool e)
Definition: RE_Light.h:109
float getFogScatterPara() const
Definition: RE_Light.h:311
int isCone() const
Definition: RE_Light.h:149
void setGlobalIllumination(bool onoff)
Definition: RE_Light.h:633
float myShadowIntensity
Definition: RE_Light.h:451
int myLightShadowMapSize
Definition: RE_Light.h:457
void getAttenuationRange(float range[2]) const
Definition: RE_Light.h:230
int myAnisotropySamples
Definition: RE_Light.h:450
RE_ShadowMap * myShadowMap
Definition: RE_Light.h:464
float getFarDistance() const
Definition: RE_Light.h:309
int getLightBatchID()
Definition: RE_Light.h:400
void setAttenuation(float constant, float linear, float quadratic)
Definition: RE_Light.h:718
float getShadowIntensity() const
Definition: RE_Light.h:255
void setShadowIntensity(float i)
Definition: RE_Light.h:244
float myZoom
Definition: RE_Light.h:434
void setFocalLength(float focal)
Definition: RE_Light.h:821
int getLightBatchIndex()
Definition: RE_Light.h:401
void setCone(int onoff)
Definition: RE_Light.h:559
void setArea(bool onoff)
Definition: RE_Light.h:576
float myAttenRampEnd
Definition: RE_Light.h:468
void setZoom(float z)
Definition: RE_Light.h:811
UT_Vector3 getAreaAxes() const
Definition: RE_Light.h:159
GLdouble n
Definition: glcorearb.h:2008
float getFogScatterPerp() const
Definition: RE_Light.h:312
GLfloat f
Definition: glcorearb.h:1926
RE_Texture * myAttenMap
Definition: RE_Light.h:465
float myFarDist
Definition: RE_Light.h:433
void setConeAttrib(float a=45, float d=10, float r=1)
Definition: RE_Light.h:204
void setShadowQuality(float q)
Definition: RE_Light.h:247
void setFogIntensity(float intensity)
Definition: RE_Light.h:301
const UT_Matrix4 & getTransform() const
Definition: RE_Light.h:139
float getShadowBias() const
Definition: RE_Light.h:256
void setOrthoWidth(float width)
Definition: RE_Light.h:841
float myShadowBias
Definition: RE_Light.h:452
UT_Ramp * myAttenRamp
Definition: RE_Light.h:466
const UT_StringRef & getLightLink() const
Definition: RE_Light.h:405
int getShadowMapSize() const
Definition: RE_Light.h:259
float myProjectMapScale
Definition: RE_Light.h:448
void setNormalizeArea(bool norm)
Definition: RE_Light.h:780
float myAttenRampStart
Definition: RE_Light.h:467
bool myAreaDirty
Definition: RE_Light.h:476
void setOrientation(const UT_Matrix3 &orient)
Definition: RE_Light.h:126
void setLightShadowMapSize(int s)
Definition: RE_Light.h:248
PXL_API const char * getName(const ColorSpace *space)
Return the name of the color space.
int getLightShadowMapSize() const
Definition: RE_Light.h:260
bool isPortalLight() const
Definition: RE_Light.h:154
void setSurfaceArea(float area)
Definition: RE_Light.h:769
float getConeRoll() const
Definition: RE_Light.h:219
GLint GLint GLsizei GLint GLenum format
Definition: glcorearb.h:108
void setSpecular(int onoff)
Definition: RE_Light.h:801
void setHeadlight(bool hl)
Definition: RE_Light.h:116
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
float myShadowQuality
Definition: RE_Light.h:454
void setNearDistance(float znear)
Definition: RE_Light.h:688
long long int64
Definition: SYS_Types.h:116
unsigned cone
Definition: RE_Light.h:81
unsigned portal
Definition: RE_Light.h:81
float myOrthoWidth
Definition: RE_Light.h:431
GLuint id
Definition: glcorearb.h:655
const UT_Vector3 & getDirection() const
Definition: RE_Light.h:123
bool isAreaLight() const
Definition: RE_Light.h:158
virtual int64 getVersion() const
Definition: RE_Light.h:172
float getAperture() const
Definition: RE_Light.h:306
float myConeRoll
Definition: RE_Light.h:429
float myAperture
Definition: RE_Light.h:430
RE_UniformBlockHandle myAreaBlock
Definition: RE_Light.h:497
GLuint const GLchar * name
Definition: glcorearb.h:786
void setTransform(const UT_Matrix4 &m)
Definition: RE_Light.h:851
void getAttenuationRampRange(float range[2]) const
Definition: RE_Light.h:237
int isMapProjector() const
Definition: RE_Light.h:152
UT_Vector3FArray myAreaPos
Definition: RE_Light.h:474
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1222
int myProjectMapMaxH
Definition: RE_Light.h:447
GA_API const UT_StringHolder orient
RE_UniformBlockHandle myBasicLightingBlock
Definition: RE_Light.h:494
UT_Vector2F myBottomBarn
Definition: RE_Light.h:462
unsigned myContribDiff
Definition: RE_Light.h:413
GLdouble t
Definition: glad.h:2397
int myMaxEnvMapSize
Definition: RE_Light.h:441
GLsizei samples
Definition: glcorearb.h:1298
bool isAreaSingleSideReversed() const
Definition: RE_Light.h:164
GT_API const UT_StringHolder version
float getShadowQuality() const
Definition: RE_Light.h:258
void invalidateShadowMap(bool purge_map=false)
int myBatchIndex
Definition: RE_Light.h:488
void setAmbient(int onoff)
Definition: RE_Light.h:541
void setShadowBias(float b)
Definition: RE_Light.h:245
UT_BoundingBoxF myBBox
Definition: RE_Light.h:491
int isAmbient() const
Definition: RE_Light.h:151
UT_Vector3 myColor
Definition: RE_Light.h:425
UT_Vector2F myLeftBarn
Definition: RE_Light.h:459
int isDiffuse() const
Definition: RE_Light.h:166
unsigned envlight
Definition: RE_Light.h:81
float getFogIntensity() const
Definition: RE_Light.h:310
float getConeAngle() const
Definition: RE_Light.h:217
RE_LightAreaShape
Definition: RE_Light.h:41
void setPortal(bool onoff)
Definition: RE_Light.h:601
void setLightLink(const UT_StringRef &link)
Definition: RE_Light.h:403
float getOrthoWidth() const
Definition: RE_Light.h:307
void setShadowMask(const char *m)
Definition: RE_Light.h:708
bool isGeometry() const
Definition: RE_Light.h:156
UT_Matrix4 myAreaTransform
Definition: RE_Light.h:473
void setFarDistance(float zfar)
Definition: RE_Light.h:698
float myShadowBlur
Definition: RE_Light.h:453
unsigned myNormalizeArea
Definition: RE_Light.h:413
unsigned infinite
Definition: RE_Light.h:81
fpreal64 fpreal
Definition: SYS_Types.h:278
Utility class for containing a color ramp.
Definition: UT_Ramp.h:96
GLuint index
Definition: glcorearb.h:786
float myNearDist
Definition: RE_Light.h:432
void setRightBarn(float amount, float falloff)
Definition: RE_Light.h:874
bool isAreaSingleSided() const
Definition: RE_Light.h:163
UT_Vector3 myDir
Definition: RE_Light.h:424
bool myProjectMapLimit
Definition: RE_Light.h:445
float myFogScatterPara
Definition: RE_Light.h:481
UT_StringHolder myShadowMask
Definition: RE_Light.h:456
unsigned myAreaSingleReverse
Definition: RE_Light.h:413
const UT_Vector3 & getPosition() const
Definition: RE_Light.h:119
GLint GLsizei width
Definition: glcorearb.h:103
float getSurfaceArea() const
Definition: RE_Light.h:161
int64 myLightVersion
Definition: RE_Light.h:484
bool isShadowed() const
Definition: RE_Light.h:169
float myFogScatterPerp
Definition: RE_Light.h:482
void assign(T xx=0.0f, T yy=0.0f)
Set the values of the vector components.
Definition: UT_Vector2.h:446
const UT_Matrix3 & getOrientation()
Definition: RE_Light.h:130
void setDirection(const UT_Vector3 &d)
Definition: RE_Light.h:124
float myAtten[3]
Definition: RE_Light.h:435
void setLightBatchID(int id, int index)
Definition: RE_Light.h:861
GLboolean r
Definition: glcorearb.h:1222
unsigned ambient
Definition: RE_Light.h:81
float myIntensity
Definition: RE_Light.h:428
UT_Vector2F myTopBarn
Definition: RE_Light.h:461
UT_String myProjectMapName
Definition: RE_Light.h:443
RE_LightFlag flag
Definition: RE_Light.h:420
RE_TextureCompress
bool SYSisEqual(const UT_Vector2T< T > &a, const UT_Vector2T< T > &b, S tol=SYS_FTOLERANCE)
Componentwise equality.
Definition: UT_Vector2.h:674
UT_Vector3FArray myAreaDir
Definition: RE_Light.h:475
void setShadowBlur(float b)
Definition: RE_Light.h:246
void setBottomBarn(float amount, float falloff)
Definition: RE_Light.h:886
unsigned myAreaSingleSided
Definition: RE_Light.h:413
int isInfinite() const
Definition: RE_Light.h:150
void setTopBarn(float amount, float falloff)
Definition: RE_Light.h:880
float getConeDelta() const
Definition: RE_Light.h:218
unsigned globillum
Definition: RE_Light.h:81
void setConeTextureIndex(int idx)
Definition: RE_Light.h:319
UT_Matrix3 myOrientation
Definition: RE_Light.h:426
float myBoundingRadius
Definition: RE_Light.h:478
float myAttenRange[2]
Definition: RE_Light.h:436
Definition: format.h:1821
int64 myEmitSerial
Definition: RE_Light.h:485
GA_API const UT_StringHolder area
void setInfinite(int onoff)
Definition: RE_Light.h:523
void setAreaTransform(UT_Matrix4 t)
Definition: RE_Light.h:758
unsigned myContribSpec
Definition: RE_Light.h:413
void setPosition(const UT_Vector3 &p)
Definition: RE_Light.h:120
bool isEnabled() const
Definition: RE_Light.h:110
float getIntensity() const
Definition: RE_Light.h:137
int getConeTextureIndex() const
Definition: RE_Light.h:317
void setEnvironment(bool onoff)
Definition: RE_Light.h:612
float myFogIntensity
Definition: RE_Light.h:480
void setBoundingRadius(float radius)
Definition: RE_Light.h:665
RE_UniformBlockHandle myShadowBlock
Definition: RE_Light.h:496