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