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