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 = nullptr);
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 setNormalizeArea(bool norm);
192  void setDiffuse(int onoff);
193  void setSpecular(int onoff);
194  void setConeAttrib(float a = 45, float d = 10, float r = 1)
195  {
196  if(myConeAngle != a ||
197  myConeDelta != d ||
198  myConeRoll != r)
199  {
200  myConeAngle = a;
201  myConeDelta = d;
202  myConeRoll = r;
203  setCone((a*.5 + d >= 180) ? 0 : 1);
204  invalidateShadowMap();
205  }
206  }
207  float getConeAngle() const { return myConeAngle; }
208  float getConeDelta() const { return myConeDelta; }
209  float getConeRoll() const { return myConeRoll; }
210 
211  // Attenuation
212  void setAttenuation(float constant,
213  float linear,
214  float quadratic);
215  void getAttenuation(float atten[3]) const
216  { atten[0] = myAtten[0];
217  atten[1] = myAtten[1];
218  atten[2] = myAtten[2]; }
219  void setAttenuationRange(float near_dist, float far_dist);
220  void getAttenuationRange(float range[2]) const
221  { range[0] = myAttenRange[0];
222  range[1] = myAttenRange[1]; }
223 
224  void setAttenuationRamp(const UT_Ramp *ramp,
225  float start_dist, float end_dist);
226  RE_Texture *getAttenuationRamp(RE_Render *r);
227  void getAttenuationRampRange(float range[2]) const
228  { range[0] = myAttenRampStart;
229  range[1] = myAttenRampEnd; }
230 
231 
232  // Shadows
233  void setShadowed(bool onoff);
234  void setShadowIntensity(float i) { myShadowIntensity = i; }
235  void setShadowBias(float b) { myShadowBias = b; }
236  void setShadowBlur(float b) { myShadowBlur = b; }
237  void setShadowQuality(float q) { myShadowQuality=q; }
238  void setLightShadowMapSize(int s) { myLightShadowMapSize=s;}
239  void setShadowMapSize(int s);
240  void setShadowMask(const char *m);
241  void setLinearShadowMap(bool linear);
242  void setViewFrustum(UT_Vector3FArray &pnts,UT_Vector3F &cam);
243  void setSceneBounds(const UT_BoundingBox &scene);
244 
245  float getShadowIntensity() const { return myShadowIntensity;}
246  float getShadowBias() const { return myShadowBias; }
247  float getShadowBlur() const { return myShadowBlur; }
248  float getShadowQuality() const { return myShadowQuality; }
249  int getShadowMapSize() const { return myShadowMapSize; }
251  { return myLightShadowMapSize; }
252  int getNumAreaMaps() const;
253  const UT_StringRef &getShadowMask() const { return myShadowMask; }
254  bool getLinearShadowMap() const;
255 
256  // Only valid once the shadowmap exists.
257  void getShadowZRange(fpreal &n, fpreal &f);
258 
259  // Shadow map usage
260  RE_Texture *getShadowMap(int area_index = 0);
261  void setMultiMap(bool m);
262  bool beginShadowRender(RE_Render *r,
263  RE_TextureCubeFace face
265  int area_index = 0);
266  void endShadowRender(RE_Render *r,
267  RE_TextureCubeFace face
269  int area_index = 0);
270  void setShadowMapVersion(uint64 version);
271  int64 getShadowMapVersion() const;
272  void setShadowMapTime(fpreal t);
273  fpreal getShadowMapTime() const;
274 
275  //
276  // Other attributes (like zoom)
277  void setZoom(float z);
278  void setFocalLength(float focal);
279  void setAperture(float aper);
280  void setOrthoWidth(float width);
281  void setNearDistance(float znear);
282  void setFarDistance(float zfar);
283  void setLeftBarn(float amount, float falloff);
284  void setRightBarn(float amount, float falloff);
285  void setTopBarn(float amount, float falloff);
286  void setBottomBarn(float amount, float falloff);
287 
288  void setFogScatter(float para, fpreal perp)
289  { myFogScatterPara = para;
290  myFogScatterPerp = perp; }
291  void setFogIntensity(float intensity)
292  { myFogIntensity = intensity; }
293 
294  float getZoom() const { return myZoom; }
295  float getFocalLength() const { return myFocalLength; }
296  float getAperture() const { return myAperture; }
297  float getOrthoWidth() const { return myOrthoWidth; }
298  float getNearDistance() const { return myNearDist; }
299  float getFarDistance() const { return myFarDist; }
300  float getFogIntensity() const { return myFogIntensity; }
301  float getFogScatterPara() const { return myFogScatterPara; }
302  float getFogScatterPerp() const { return myFogScatterPerp; }
303 
304  int64 getLightVersion() const { return myLightVersion; }
305  void bumpLightVersion() { myLightVersion++; }
306 
307  int getConeTextureIndex() const
308  { return myGLConeTextureIndex;}
309  void setConeTextureIndex(int idx)
310  { myGLConeTextureIndex = idx; }
311 
312  //
313  // Methods to set up different texture maps used by lights
314  void setProjectMap(const char *name,
315  const char *relativeTo);
316  void setProjectMapClamp(int onoff);
317  void setProjectMapFormat(RE_TextureCompress format);
318  void setProjectMapScale(float sc, bool limitres,
319  int maxw, int maxh);
320  void setProjectMapMipmap(bool onoff);
321  void setProjectMapAnisotropy(int samples);
322 
323  RE_Texture2DMap *getProjectMap(RE_Render *r);
324 
325  void setEnvironmentMap(const char *name,
326  const char *relativeTo);
327  void setEnvironmentFormat(RE_TextureCompress format);
328  void setEnvironmentMipmap(bool onoff);
329  void setEnvironmentCone(float angle);
330  RE_TextureHolder getEnvironmentMap(RE_Render *r, int max_width);
331  float getEnvironmentCone() const;
332 
333  //
334  // Uniform blocks for lights
335  void updateBasicLighting(RE_Render *r,
336  RE_Shader *sh,
337  int index);
338  void updateHQLighting(RE_Render *r, RE_Shader *sh);
339  void updateAreaLighting(RE_Render *r, RE_Shader *sh);
340  void updateShadow(RE_Render *r, RE_Shader *sh);
341 
342  // For SSBO light blocks. Copies this light's info into the block at index
343  // 'light_index'.
344  void updateBasicBlock(RE_UniformBlock *lighting_block,
345  int light_index,
346  const char *light_prefix);
347  void updateHQLightingBlock(RE_Render *r,
348  RE_UniformBlock *block,
349  int light_index,
350  const char *light_prefix) const;
351  void updateAreaLightingBlock(RE_Render *r,
352  RE_UniformBlock *block,
353  int light_index,
354  const char *light_pref) const;
355 
356  static void clearLight(RE_Shader *sh, int index);
357 
358  /// @brief Allows data, like shadow maps, to be stored with the light
359  /// Attaching data to the light gives it ownership, meaning that it will be
360  /// deleted when the light is deleted, or when a different data chunk is
361  /// assigned to the same index. To avoid it being deleted, detach the chunk.
362  /// @{
363  void attachUserData(RE_LightData *data, int index);
364  RE_LightData *detachUserData(int index);
365  RE_LightData *getAttachedUserData(int index) const;
366  /// @}
367 
368  /// @brief Accessor to underlaying shadow map object
369  /// Each light may have a shadow map object. Turning off shadows on the
370  /// light will delete the map, so do not cache the pointer. If a shadow map
371  /// does not exist, this will create a new one.
372  RE_ShadowMap *getShadowMap();
373 
375  {
383 
384  NUM_HQLIGHT_TYPES
385  };
386 
387  RE_HQLightType hqLightType() const;
388 
389  void setLightBatchID(int id, int index);
390  int getLightBatchID() { return myBatchID; }
391  int getLightBatchIndex() { return myBatchIndex; }
392 
393  void setLightLink(const UT_StringRef &link)
394  { myLightLink = link; }
395  const UT_StringRef & getLightLink() const { return myLightLink; }
396 protected:
397 
398  void invalidateShadowMap(bool purge_map = false);
399  void createEnvMap();
400  void getAreaLightProjection(UT_Matrix4 &mat) const;
401 
402  int myGLConeTextureIndex; // for lights that project maps
403  unsigned myContribDiff:1, // contributes to diffuse
404  myContribSpec:1, // contributes to specular
405  myUseShadows:1, // uses shadow maps
406  myAreaSingleSided:1, // single-sided area light
407  myAreaSingleReverse:1, // reverse dir for ss area light
408  myNormalizeArea:1, // Normalize brightness to area
409  myBBoxDirty : 1;
418  float myIntensity;
419  float myConeAngle, myConeDelta, myConeRoll;
420  float myAperture, myFocalLength;
422  float myNearDist;
423  float myFarDist;
424  float myZoom;
425  float myAtten[3];
426  float myAttenRange[2];
428  RE_Texture2DMap *projectMap; // Projection texture
429  RE_TextureCubeMap *myEnvMap; // Environment map
430  float myEnvCone;
432 
453 
460 
467 
471 
474 
477 
480 
481  // Cached uniform blocks
486 };
487 
488 inline void
490 {
491  if(myColor != c)
492  {
494  myEmitSerial++;
495  myColor = c;
496  }
497 }
498 
499 inline void
501 {
502  if(myIntensity != i)
503  {
505  myEmitSerial++;
506  myIntensity = i;
507  }
508 }
509 
510 inline void
512 {
513  if(flag.infinite != onoff)
514  {
515  invalidateShadowMap(true);
516  flag.infinite = onoff;
517  if(onoff)
518  {
519  flag.area = false;
520  flag.cone = false;
521  flag.envlight = false;
522  flag.ambient = false;
523  flag.globillum = false;
524  }
525  }
526 }
527 
528 inline void
530 {
531  if(flag.ambient != onoff)
532  {
533  invalidateShadowMap(true);
534  flag.ambient = onoff;
535  if(onoff)
536  {
537  flag.area = false;
538  flag.infinite = false;
539  flag.cone = false;
540  flag.envlight = false;
541  flag.globillum = false;
542  }
543  }
544 }
545 
546 inline void
548 {
549  if(flag.cone != onoff)
550  {
551  invalidateShadowMap(true);
552  flag.cone = onoff;
553  if(onoff)
554  {
555  flag.infinite = false;
556  flag.ambient = false;
557  flag.envlight = false;
558  flag.globillum = false;
559  }
560  }
561 }
562 
563 inline void
564 RE_Light::setArea(bool onoff)
565 {
566  if(flag.area != onoff)
567  {
568  invalidateShadowMap(true);
569  flag.area = onoff;
570  if(onoff)
571  myAreaDirty = true;
572  if(onoff)
573  {
574  flag.envlight = false;
575  flag.infinite = false;
576  flag.ambient = false;
577  flag.globillum = false;
578  }
579  }
580 }
581 
582 inline void
584 {
585  if(flag.portal != onoff)
586  {
587  invalidateShadowMap(true);
588  flag.portal = onoff;
589  }
590 }
591 
592 
593 inline void
595 {
596  if(onoff != flag.envlight)
597  {
598  flag.envlight = onoff;
599  if(onoff)
600  {
601  invalidateShadowMap(true);
602  flag.area = false;
603  flag.cone = false;
604  flag.ambient = false;
605  flag.infinite = false;
606  flag.globillum = false;
607  }
608  else
610 
611  }
612 }
613 
614 inline void
616 {
617  if(onoff != flag.globillum)
618  {
619  flag.globillum = onoff;
620  if(onoff)
621  {
622  invalidateShadowMap(true);
623  flag.area = false;
624  flag.cone = false;
625  flag.ambient = false;
626  flag.infinite = false;
627  flag.envlight = false;
628  }
630  }
631 }
632 
633 inline void
634 RE_Light::setAreaSide(bool single, bool reverse)
635 {
636  if(myAreaSingleSided != single ||
637  myAreaSingleReverse != reverse)
638  {
639  myAreaSingleSided = single;
641  myAreaDirty = true;
643  }
644 }
645 
646 inline void
648 {
649  angle = SYSmax(0.0f, angle);
650  if(angle != myEnvCone)
651  {
653  myEnvCone = angle;
654  }
655 }
656 
657 inline float
659 {
660  return myEnvCone;
661 }
662 
663 inline void
665 {
666  if(znear != myNearDist)
667  {
668  myNearDist = znear;
670  }
671 }
672 
673 inline void
675 {
676  if(myFarDist != zfar)
677  {
678  myFarDist = zfar;
680  }
681 }
682 
683 inline void
685 {
686  if(myShadowMask != m)
687  {
688  myShadowMask.harden(m);
690  }
691 }
692 
693 inline void
695  float linear,
696  float quadratic)
697 
698 {
699  if(!SYSisEqual(myAtten[0], constant) ||
700  !SYSisEqual(myAtten[1], linear) ||
701  !SYSisEqual(myAtten[2], quadratic))
702  {
703  myAtten[0] = constant;
704  myAtten[1] = linear;
705  myAtten[2] = quadratic;
707  }
708 }
709 
710 inline void
711 RE_Light::setAttenuationRange(float near_dist, float far_dist)
712 {
713  if(!SYSisEqual(myAttenRange[0], near_dist) ||
714  !SYSisEqual(myAttenRange[1], far_dist))
715  {
716  myAttenRange[0] = near_dist;
717  myAttenRange[1] = far_dist;
719  }
720 }
721 
722 inline void
724 {
725  if(myAreaAxes!= axes)
726  {
727  myAreaAxes=axes;
728  myAreaDirty = true;
730  }
731 }
732 
733 inline void
735 {
736  if(myAreaTransform!=t)
737  {
739  myAreaDirty = true;
741  }
742 }
743 
744 inline void
746 {
747  if(!SYSisEqual(mySurfaceArea, area))
748  {
750  myAreaDirty = true;
752  }
753 }
754 
755 inline void
757 {
758  if(norm != myNormalizeArea)
759  {
760  myNormalizeArea = norm;
761  myAreaDirty = true;
763  }
764 }
765 
766 inline void
768 {
769  if(myContribDiff != onoff)
770  {
771  myContribDiff = onoff;
773  }
774 }
775 
776 inline void
778 {
779  if(myContribSpec != onoff)
780  {
781  myContribSpec = onoff;
783  }
784 }
785 
786 inline void
788 {
789  if(!SYSisEqual(myZoom,z))
790  {
791  myZoom = z;
793  }
794 }
795 
796 inline void
798 {
799  if(!SYSisEqual(myFocalLength,focal))
800  {
801  myFocalLength = focal;
803  }
804 }
805 
806 inline void
808 {
809  if(!SYSisEqual(myAperture,aper))
810  {
811  myAperture = aper;
813  }
814 }
815 
816 inline void
818 {
819  if(!SYSisEqual(myOrthoWidth,width))
820  {
823  }
824 }
825 
826 inline void
828 {
829  if(myTransform != m)
830  {
831  myTransform= m;
833  }
834 }
835 
836 inline void
838 {
839  myBatchID = id;
841 }
842 
843 inline void
844 RE_Light::setLeftBarn(float amount, float falloff)
845 {
846  myLeftBarn.assign(amount, falloff);
847 }
848 
849 inline void
850 RE_Light::setRightBarn(float amount, float falloff)
851 {
852  myRightBarn.assign(amount, falloff);
853 }
854 
855 inline void
856 RE_Light::setTopBarn(float amount, float falloff)
857 {
858  myTopBarn.assign(amount, falloff);
859 }
860 
861 inline void
862 RE_Light::setBottomBarn(float amount, float falloff)
863 {
864  myBottomBarn.assign(amount, falloff);
865 }
866 
867 #endif
bool myAttenRampDirty
Definition: RE_Light.h:459
int64 getEmitVersion() const
Definition: RE_Light.h:167
#define SYSmax(a, b)
Definition: SYS_Math.h:1570
RE_UniformBlockHandle myHighQualityBlock
Definition: RE_Light.h:483
bool isEnvironmentLight() const
Definition: RE_Light.h:146
void getAttenuation(float atten[3]) const
Definition: RE_Light.h:215
bool isHeadlight() const
Definition: RE_Light.h:110
void setAperture(float aper)
Definition: RE_Light.h:807
float myEnvCone
Definition: RE_Light.h:430
RE_LightAreaShape getAreaShape() const
Definition: RE_Light.h:154
void setAreaSide(bool single, bool reverse)
Definition: RE_Light.h:634
UT_Vector2F myRightBarn
Definition: RE_Light.h:450
float getEnvironmentCone() const
Definition: RE_Light.h:658
void setAreaAxes(const UT_Vector3F &axes)
Definition: RE_Light.h:723
void setAttenuationRange(float near_dist, float far_dist)
Definition: RE_Light.h:711
UT_Vector3 myPos
Definition: RE_Light.h:413
GLenum GLint * range
Definition: glcorearb.h:1925
RE_HQLightType
Definition: RE_Light.h:374
float getNearDistance() const
Definition: RE_Light.h:298
UT_Array< RE_LightData * > myAttachedLightData
Definition: RE_Light.h:478
void setIntensity(float i)
Definition: RE_Light.h:500
void setName(const char *name)
Definition: RE_Light.h:100
void bumpLightVersion()
Definition: RE_Light.h:305
float getShadowBlur() const
Definition: RE_Light.h:247
int myBatchID
Definition: RE_Light.h:475
RE_TextureCubeFace
UT_StringHolder myLightLink
Definition: RE_Light.h:412
#define RE_API
Definition: RE_API.h:10
SIM_API const UT_StringHolder angle
void setEnvironmentCone(float angle)
Definition: RE_Light.h:647
void harden(const char *src)
int myGLConeTextureIndex
Definition: RE_Light.h:402
RE_TextureCompress myProjectMapFormat
Definition: RE_Light.h:439
UT_Matrix4 myTransform
Definition: RE_Light.h:417
UT_Vector3 myAreaAxes
Definition: RE_Light.h:461
const UT_Vector3F & getColor() const
Definition: RE_Light.h:125
const UT_StringRef & getShadowMask() const
Definition: RE_Light.h:253
float myMaxLightRadius
Definition: RE_Light.h:427
bool isGlobalIllumination() const
Definition: RE_Light.h:148
GLdouble GLdouble GLdouble z
Definition: glcorearb.h:848
void setFogScatter(float para, fpreal perp)
Definition: RE_Light.h:288
virtual int getUniqueId() const
Definition: RE_Light.h:171
void setColor(const UT_Vector3 &c)
Definition: RE_Light.h:489
int myProjectMapMaxW
Definition: RE_Light.h:436
void setLeftBarn(float amount, float falloff)
Definition: RE_Light.h:844
UT_Matrix4 getAreaTransform() const
Definition: RE_Light.h:152
unsigned area
Definition: RE_Light.h:77
RE_LightAreaShape myAreaLightShape
Definition: RE_Light.h:448
float myFocalLength
Definition: RE_Light.h:420
RE_Texture2DMap * projectMap
Definition: RE_Light.h:428
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1222
int isSpecular() const
Definition: RE_Light.h:159
void reverse(I begin, I end)
Definition: pugixml.cpp:7190
GLdouble s
Definition: glad.h:3009
UT_StringHolder myName
Definition: RE_Light.h:411
void setDiffuse(int onoff)
Definition: RE_Light.h:767
float getZoom() const
Definition: RE_Light.h:294
RE_TextureCubeMap * myEnvMap
Definition: RE_Light.h:429
UT_Matrix4 & getTransform()
Definition: RE_Light.h:133
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glcorearb.h:2539
int myShadowMapSize
Definition: RE_Light.h:445
RE_LightFlag()
Definition: RE_Light.h:60
GLdouble GLdouble GLdouble q
Definition: glad.h:2445
unsigned long long uint64
Definition: SYS_Types.h:117
int64 getLightVersion() const
Definition: RE_Light.h:304
float mySurfaceArea
Definition: RE_Light.h:462
float getFocalLength() const
Definition: RE_Light.h:295
UT_String myProjectMapRelativeTo
Definition: RE_Light.h:434
UT_Vector3 & getColor()
Definition: RE_Light.h:126
void enable(bool e)
Definition: RE_Light.h:102
float getFogScatterPara() const
Definition: RE_Light.h:301
int isCone() const
Definition: RE_Light.h:142
void setGlobalIllumination(bool onoff)
Definition: RE_Light.h:615
float myShadowIntensity
Definition: RE_Light.h:441
int myLightShadowMapSize
Definition: RE_Light.h:447
void getAttenuationRange(float range[2]) const
Definition: RE_Light.h:220
int myAnisotropySamples
Definition: RE_Light.h:440
RE_ShadowMap * myShadowMap
Definition: RE_Light.h:454
float getFarDistance() const
Definition: RE_Light.h:299
int getLightBatchID()
Definition: RE_Light.h:390
void setAttenuation(float constant, float linear, float quadratic)
Definition: RE_Light.h:694
float getShadowIntensity() const
Definition: RE_Light.h:245
void setShadowIntensity(float i)
Definition: RE_Light.h:234
float myZoom
Definition: RE_Light.h:424
void setFocalLength(float focal)
Definition: RE_Light.h:797
int getLightBatchIndex()
Definition: RE_Light.h:391
void setCone(int onoff)
Definition: RE_Light.h:547
void setArea(bool onoff)
Definition: RE_Light.h:564
float myAttenRampEnd
Definition: RE_Light.h:458
void setZoom(float z)
Definition: RE_Light.h:787
UT_Vector3 getAreaAxes() const
Definition: RE_Light.h:151
GLdouble n
Definition: glcorearb.h:2008
float getFogScatterPerp() const
Definition: RE_Light.h:302
GLfloat f
Definition: glcorearb.h:1926
RE_Texture * myAttenMap
Definition: RE_Light.h:455
float myFarDist
Definition: RE_Light.h:423
void setConeAttrib(float a=45, float d=10, float r=1)
Definition: RE_Light.h:194
void setShadowQuality(float q)
Definition: RE_Light.h:237
void setFogIntensity(float intensity)
Definition: RE_Light.h:291
const UT_Matrix4 & getTransform() const
Definition: RE_Light.h:132
float getShadowBias() const
Definition: RE_Light.h:246
void setOrthoWidth(float width)
Definition: RE_Light.h:817
float myShadowBias
Definition: RE_Light.h:442
UT_Ramp * myAttenRamp
Definition: RE_Light.h:456
const UT_StringRef & getLightLink() const
Definition: RE_Light.h:395
int getShadowMapSize() const
Definition: RE_Light.h:249
float myProjectMapScale
Definition: RE_Light.h:438
void setNormalizeArea(bool norm)
Definition: RE_Light.h:756
float myAttenRampStart
Definition: RE_Light.h:457
bool myAreaDirty
Definition: RE_Light.h:466
void setOrientation(const UT_Matrix3 &orient)
Definition: RE_Light.h:119
void setLightShadowMapSize(int s)
Definition: RE_Light.h:238
int getLightShadowMapSize() const
Definition: RE_Light.h:250
bool isPortalLight() const
Definition: RE_Light.h:147
void setSurfaceArea(float area)
Definition: RE_Light.h:745
float getConeRoll() const
Definition: RE_Light.h:209
GLint GLint GLsizei GLint GLenum format
Definition: glcorearb.h:108
void setSpecular(int onoff)
Definition: RE_Light.h:777
void setHeadlight(bool hl)
Definition: RE_Light.h:109
float myShadowQuality
Definition: RE_Light.h:444
void setNearDistance(float znear)
Definition: RE_Light.h:664
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:421
GLuint id
Definition: glcorearb.h:655
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:296
float myConeRoll
Definition: RE_Light.h:419
float myAperture
Definition: RE_Light.h:420
RE_UniformBlockHandle myAreaBlock
Definition: RE_Light.h:485
GLuint const GLchar * name
Definition: glcorearb.h:786
void setTransform(const UT_Matrix4 &m)
Definition: RE_Light.h:827
void getAttenuationRampRange(float range[2]) const
Definition: RE_Light.h:227
int isMapProjector() const
Definition: RE_Light.h:145
UT_Vector3FArray myAreaPos
Definition: RE_Light.h:464
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1222
int myProjectMapMaxH
Definition: RE_Light.h:437
GA_API const UT_StringHolder orient
RE_UniformBlockHandle myBasicLightingBlock
Definition: RE_Light.h:482
UT_Vector2F myBottomBarn
Definition: RE_Light.h:452
unsigned myContribDiff
Definition: RE_Light.h:403
GLdouble t
Definition: glad.h:2397
int myMaxEnvMapSize
Definition: RE_Light.h:431
GLsizei samples
Definition: glcorearb.h:1298
bool isAreaSingleSideReversed() const
Definition: RE_Light.h:156
GT_API const UT_StringHolder version
float getShadowQuality() const
Definition: RE_Light.h:248
void invalidateShadowMap(bool purge_map=false)
int myBatchIndex
Definition: RE_Light.h:476
void setAmbient(int onoff)
Definition: RE_Light.h:529
void setShadowBias(float b)
Definition: RE_Light.h:235
UT_BoundingBoxF myBBox
Definition: RE_Light.h:479
int isAmbient() const
Definition: RE_Light.h:144
UT_Vector3 myColor
Definition: RE_Light.h:415
UT_Vector2F myLeftBarn
Definition: RE_Light.h:449
int isDiffuse() const
Definition: RE_Light.h:158
unsigned envlight
Definition: RE_Light.h:77
float getFogIntensity() const
Definition: RE_Light.h:300
float getConeAngle() const
Definition: RE_Light.h:207
RE_LightAreaShape
Definition: RE_Light.h:40
void setPortal(bool onoff)
Definition: RE_Light.h:583
void setLightLink(const UT_StringRef &link)
Definition: RE_Light.h:393
float getOrthoWidth() const
Definition: RE_Light.h:297
void setShadowMask(const char *m)
Definition: RE_Light.h:684
UT_Matrix4 myAreaTransform
Definition: RE_Light.h:463
void setFarDistance(float zfar)
Definition: RE_Light.h:674
float myShadowBlur
Definition: RE_Light.h:443
unsigned myNormalizeArea
Definition: RE_Light.h:403
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:92
GLuint index
Definition: glcorearb.h:786
float myNearDist
Definition: RE_Light.h:422
void setRightBarn(float amount, float falloff)
Definition: RE_Light.h:850
bool isAreaSingleSided() const
Definition: RE_Light.h:155
UT_Vector3 myDir
Definition: RE_Light.h:414
bool myProjectMapLimit
Definition: RE_Light.h:435
float myFogScatterPara
Definition: RE_Light.h:469
UT_StringHolder myShadowMask
Definition: RE_Light.h:446
unsigned myAreaSingleReverse
Definition: RE_Light.h:403
const UT_Vector3 & getPosition() const
Definition: RE_Light.h:112
GLint GLsizei width
Definition: glcorearb.h:103
float getSurfaceArea() const
Definition: RE_Light.h:153
int64 myLightVersion
Definition: RE_Light.h:472
bool isShadowed() const
Definition: RE_Light.h:161
float myFogScatterPerp
Definition: RE_Light.h:470
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:123
const char * getName() const
Definition: RE_Light.h:99
void setDirection(const UT_Vector3 &d)
Definition: RE_Light.h:117
float myAtten[3]
Definition: RE_Light.h:425
void setLightBatchID(int id, int index)
Definition: RE_Light.h:837
GLboolean r
Definition: glcorearb.h:1222
unsigned ambient
Definition: RE_Light.h:77
float myIntensity
Definition: RE_Light.h:418
UT_Vector2F myTopBarn
Definition: RE_Light.h:451
UT_String myProjectMapName
Definition: RE_Light.h:433
RE_LightFlag flag
Definition: RE_Light.h:410
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:465
void setShadowBlur(float b)
Definition: RE_Light.h:236
void setBottomBarn(float amount, float falloff)
Definition: RE_Light.h:862
unsigned myAreaSingleSided
Definition: RE_Light.h:403
int isInfinite() const
Definition: RE_Light.h:143
void setTopBarn(float amount, float falloff)
Definition: RE_Light.h:856
float getConeDelta() const
Definition: RE_Light.h:208
unsigned globillum
Definition: RE_Light.h:77
void setConeTextureIndex(int idx)
Definition: RE_Light.h:309
UT_Matrix3 myOrientation
Definition: RE_Light.h:416
float myAttenRange[2]
Definition: RE_Light.h:426
Definition: format.h:895
int64 myEmitSerial
Definition: RE_Light.h:473
GA_API const UT_StringHolder area
void setInfinite(int onoff)
Definition: RE_Light.h:511
void setAreaTransform(UT_Matrix4 t)
Definition: RE_Light.h:734
unsigned myContribSpec
Definition: RE_Light.h:403
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:307
void setEnvironment(bool onoff)
Definition: RE_Light.h:594
float myFogIntensity
Definition: RE_Light.h:468
RE_UniformBlockHandle myShadowBlock
Definition: RE_Light.h:484