HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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_String.h>
22 #include <UT/UT_Vector3.h>
23 #include <UT/UT_Matrix4.h>
24 #include "RE_TextureMap.h"
25 #include "RE_UniformBlock.h"
26 
27 class UT_Ramp;
28 class UT_Raster;
29 class RE_Texture2DMap;
30 class RE_TextureCubeMap;
31 class RE_Render;
32 class RE_ShadowMap;
33 class RE_Shader;
34 
35 #define RE_SHADOW_MAX_AREA_MAPS 8
36 #define RE_SHADOW_NUM_CUBE_MAPS 6
37 
38 // THIS ENUM MUST BE IN-SYNC WITH OBJ_LightAreaShape in RE_Light.h.
40 {
46 };
47 
49 {
50 public:
51  RE_LightData();
52  virtual ~RE_LightData();
53 };
54 
56 {
57 public:
59  {
60  cone = 0;
61  infinite = 0;
62  ambient = 0;
63  mapprojector = 0;
64  clampprojectormap = 0;
65  mipmap = 0;
66  projectormapdirty = 0;
67  envlight = 0;
68  area = 0;
69  portal = 0;
70  globillum = 0;
71  enabled = 1;
72  headlight = 0;
73  }
74 
75  unsigned mapprojector:1,
76  cone:1,
77  infinite:1,
78  ambient:1,
79  clampprojectormap:1,
80  projectormapdirty:1,
81  mipmap:1,
82  envlight:1,
83  area:1,
84  portal:1,
85  globillum:1,
86  enabled:1,
87  headlight:1;
88 };
89 
90 
92 public:
93  RE_Light(const char *n = 0);
94  virtual ~RE_Light();
95 
96  const char *getName() const { return myName; }
97  void setName(const char *name) { myName.harden(name); }
98 
99  void enable(bool e) { flag.enabled = e; }
100  bool isEnabled() const { return flag.enabled; }
101 
102  // Similar to isEnabled(), but takes into account color=(0,0,0) and other
103  // factors
104  bool isLightContributing() const;
105 
106  void setHeadlight(bool hl) { flag.headlight = hl; }
107  bool isHeadlight() const { return flag.headlight; }
108 
109  const UT_Vector3 &getPosition() const { return myPos; }
110  void setPosition(const UT_Vector3 &p)
111  { if(p != myPos) { myPos = p; invalidateShadowMap(); }}
112 
113  const UT_Vector3 &getDirection() const { return myDir; }
114  void setDirection(const UT_Vector3 &d)
115  { if(d != myDir) { myDir = d; invalidateShadowMap(); }}
117  { if(orient != myOrientation)
118  { myOrientation = orient; invalidateShadowMap(); }
119  }
120  const UT_Matrix3 &getOrientation() { return myOrientation; }
121 
122  const UT_Vector3F &getColor() const { return myColor; }
123  UT_Vector3 &getColor() { return myColor; }
124  void setColor(const UT_Vector3 &c);
125 
126  const UT_Matrix4 &getTransform() const { return xform; }
127  UT_Matrix4 &getTransform() { return xform; }
128  void setTransform(const UT_Matrix4 &m)
129  { if(xform != m) { xform = m; invalidateShadowMap(); } }
130 
131  int isCone() const { return flag.cone; }
132  int isInfinite() const { return flag.infinite; }
133  int isAmbient() const { return flag.ambient; }
134  int isMapProjector() const { return flag.mapprojector; }
135  bool isEnvironmentLight() const { return flag.envlight; }
136  bool isPortalLight() const { return flag.portal; }
137  bool isGlobalIllumination() const { return flag.globillum; }
138 
139 
140  bool isAreaLight() const { return flag.area; }
141  UT_Vector3 getAreaAxes() const { return myAreaAxes; }
142  UT_Matrix4 getAreaTransform() const { return myAreaTransform; }
143  float getSurfaceArea() const { return mySurfaceArea; }
144  bool isAreaSingleSided() const { return myAreaSingleSided; }
146  { return myAreaSingleReverse; }
147  int isDiffuse() const { return myContribDiff; }
148  int isSpecular() const { return myContribSpec; }
149 
150  bool isShadowed() const { return myUseShadows; }
151 
152  // bumped whenever light geometry is changed
153  virtual int64 getVersion() const { return 0; }
154 
155  // bumped whenever emitted light is changed
156  int64 getEmitVersion() const { return myEmitSerial; }
157 
158  /// Can be used by OP_Node::lookupNode() to return the light object
159  /// this light is attached to.
160  virtual int getUniqueId() const { return -999; }
161 
162  //
163  // Light attribute settings, infinite, point, and cone light
164  //
165  void setInfinite(int onoff);
166  void setAmbient(int onoff);
167  void setCone(int onoff);
168  void setArea(bool onoff);
169  void setEnvironment(bool onoff);
170  void setPortal(bool onoff);
171  void setGlobalIllumination(bool onoff);
172  void setAreaAxes(const UT_Vector3F &axes);
173  void setAreaTransform(UT_Matrix4 t);
174  void setAreaSide(bool single, bool reverse);
175  void setAreaSamplePoints(const UT_Vector3FArray &pos,
176  const UT_Vector3FArray &dir);
177  void buildAreaShape(int numsample);
178  void setSurfaceArea(float area);
179  void setDiffuse(int onoff);
180  void setSpecular(int onoff);
181  void setConeAttrib(float a = 45, float d = 10, float r = 1)
182  {
183  if(coneAngle != a ||
184  coneDelta != d ||
185  coneRoll != r)
186  {
187  coneAngle = a;
188  coneDelta = d;
189  coneRoll = r;
190  setCone((a*.5 + d >= 180) ? 0 : 1);
191  invalidateShadowMap();
192  recomputeFalloffRamp();
193  }
194  }
195  float getConeAngle() const { return coneAngle; }
196  float getConeDelta() const { return coneDelta; }
197  float getConeRoll() const { return coneRoll; }
198  float getConeAngleRadius() const;
199  float getDeltaAngleFactor() const;
200 
201  RE_Texture *getFalloffRamp(RE_Render *r);
202 
203  // Attenuation
204  void setAttenuation(float constant,
205  float linear,
206  float quadratic);
207  void getAttenuation(float atten[3]) const
208  { atten[0] = myAtten[0];
209  atten[1] = myAtten[1];
210  atten[2] = myAtten[2]; }
211  void setAttenuationRange(float near_dist, float far_dist);
212  void getAttenuationRange(float range[2]) const
213  { range[0] = myAttenRange[0];
214  range[1] = myAttenRange[1]; }
215 
216  void setAttenuationRamp(const UT_Ramp *ramp,
217  float start_dist, float end_dist);
218  RE_Texture *getAttenuationRamp(RE_Render *r);
219  void getAttenuationRampRange(float range[2]) const
220  { range[0] = myAttenRampStart;
221  range[1] = myAttenRampEnd; }
222 
223 
224  // Shadows
225  void setShadowed(bool onoff);
226  void setShadowIntensity(float i) { myShadowIntensity = i; }
227  void setShadowBias(float b) { myShadowBias = b; }
228  void setShadowBlur(float b) { myShadowBlur = b; }
229  void setShadowQuality(float q) { myShadowQuality=q; }
230  void setLightShadowMapSize(int s) { myLightShadowMapSize=s;}
231  void setShadowMapSize(int s);
232  void setAreaShadowShape(RE_LightAreaShape shape);
233  void setShadowMask(const char *m);
234  void setLinearShadowMap(bool linear);
235 
236  float getShadowIntensity() const { return myShadowIntensity;}
237  float getShadowBias() const { return myShadowBias; }
238  float getShadowBlur() const { return myShadowBlur; }
239  float getShadowQuality() const { return myShadowQuality; }
240  int getShadowMapSize() const { return myShadowMapSize; }
242  { return myLightShadowMapSize; }
243  int getNumAreaMaps() const;
244  const char *getShadowMask() const { return myShadowMask; }
245  bool getLinearShadowMap() const;
246 
247  // Only valid once the shadowmap exists.
248  void getShadowZRange(fpreal &n, fpreal &f);
249 
250  // Shadow map usage
251  RE_Texture *getShadowMap(int area_index = 0);
252  void setMultiMap(bool m);
253  void useShadowMap(RE_Render *r, RE_Shader *shadow_shader,
254  bool onoff);
255  bool beginShadowRender(RE_Render *r,
256  RE_TextureCubeFace face
258  int area_index = 0);
259  void endShadowRender(RE_Render *r,
260  RE_TextureCubeFace face
262  int area_index = 0);
263  void setShadowMapVersion(uint64 version);
264  int64 getShadowMapVersion() const;
265  void setShadowMapTime(fpreal t);
266  fpreal getShadowMapTime() const;
267 
268  // Returns true if 6 separate shadow maps are used instead of a cube map,
269  // for hardware that does not support cube shadow maps.
270  bool useSeparatePointShadowMaps(RE_Render *r) const;
271 
272  //
273  // Other attributes (like zoom)
274  void setZoom(float z);
275  void setFocalLength(float focal);
276  void setAperture(float aper);
277  void setOrthoWidth(float width);
278  void setNearDistance(float znear);
279  void setFarDistance(float zfar);
280 
281  float getZoom() const { return zoom; }
282  float getFocalLength() const { return myFocalLength; }
283  float getAperture() const { return myAperture; }
284  float getOrthoWidth() const { return myOrthoWidth; }
285  float getNearDistance() const { return myNearDist; }
286  float getFarDistance() const { return myFarDist; }
287 
288  int64 getLightVersion() const { return myLightVersion; }
289  void bumpLightVersion() { myLightVersion++; }
290 
291  int getConeTextureIndex() const
292  { return myGLConeTextureIndex;}
293  void setConeTextureIndex(int idx)
294  { myGLConeTextureIndex = idx; }
295 
296  int needConeGLReset() const { return myGLConeNeedReset; }
297  void needConeGLReset(int f) { myGLConeNeedReset = f; }
298 
299  //
300  // Methods to set up different texture maps used by lights
301  void setProjectMap(const char *name,
302  const char *relativeTo);
303  void setProjectMapClamp(int onoff);
304  void setProjectMapFormat(RE_TextureCompress format);
305  void setProjectMapScale(float sc, bool limitres,
306  int maxw, int maxh);
307  void setProjectMapMipmap(bool onoff);
308  void setProjectMapAnisotropy(int samples);
309 
310  RE_Texture2DMap *getProjectMap(RE_Render *r);
311 
312  void setEnvironmentMap(const char *name,
313  const char *relativeTo);
314  void setEnvironmentFormat(RE_TextureCompress format);
315  void setEnvironmentMipmap(bool onoff);
316  void setEnvironmentCone(float angle);
317  RE_TextureHolder getEnvironmentMap(RE_Render *r, int max_width);
318  float getEnvironmentCone() const;
319 
320  //
321  // Uniform blocks for lights
322  void updateBasicLighting(RE_Render *r,
323  RE_Shader *sh,
324  int index);
325  void updateBasicBlock(RE_UniformBlock *lighting_block,
326  int light_index,
327  const char *light_prefix);
328  void updateHQLighting(RE_Render *r, RE_Shader *sh);
329  void updateAreaLighting(RE_Render *r, RE_Shader *sh);
330  void updateShadow(RE_Render *r, RE_Shader *sh);
331 
332  static void clearLight(RE_Shader *sh, int index);
333 
334  /// @brief Allows data, like shadow maps, to be stored with the light
335  /// Attaching data to the light gives it ownership, meaning that it will be
336  /// deleted when the light is deleted, or when a different data chunk is
337  /// assigned to the same index. To avoid it being deleted, detach the chunk.
338  /// @{
339  void attachUserData(RE_LightData *data, int index);
340  RE_LightData *detachUserData(int index);
341  RE_LightData *getAttachedUserData(int index) const;
342  /// @}
343 
344  /// @brief Accessor to underlaying shadow map object
345  /// Each light may have a shadow map object. Turning off shadows on the
346  /// light will delete the map, so do not cache the pointer. If a shadow map
347  /// does not exist, this will create a new one.
348  RE_ShadowMap *getShadowMap();
349 
350 protected:
351 
352  void invalidateShadowMap(bool purge_map = false);
353  void invalidateFalloffRamp();
354  void recomputeFalloffRamp();
355  void createEnvMap();
356 
357  int myGLConeTextureIndex; // for lights that project maps
358  unsigned myGLConeNeedReset:1, // reset the cone texture
359  myContribDiff:1, // contributes to diffuse
360  myContribSpec:1, // contributes to specular
361  myUseShadows:1, // uses shadow maps
362  myAreaSingleSided:1, // single-sided area light
363  myAreaSingleReverse:1; // reverse dir for ss area light
371  float coneAngle, coneDelta, coneRoll;
372  float myAperture, myFocalLength;
374  float myNearDist;
375  float myFarDist;
376  float zoom;
377  float myAtten[3];
378  float myAttenRange[2];
380  RE_Texture2DMap *projectMap; // Projection texture
381  RE_TextureCubeMap *myEnvMap; // Environment map
382  float myEnvCone;
384 
401 
410 
416 
419 
421 
422  // Cached uniform blocks
427 };
428 
429 inline void
431 {
432  if(myColor != c)
433  {
435  myEmitSerial++;
436  myColor = c;
437  }
438 }
439 
440 inline void
442 {
443  if(flag.infinite != onoff)
444  {
445  invalidateShadowMap(true);
446  flag.infinite = onoff;
447  if(onoff)
448  {
449  flag.area = false;
450  flag.cone = false;
451  flag.envlight = false;
452  flag.ambient = false;
453  flag.globillum = false;
454  }
455  }
456 }
457 
458 inline void
460 {
461  if(flag.ambient != onoff)
462  {
463  invalidateShadowMap(true);
464  flag.ambient = onoff;
465  if(onoff)
466  {
467  flag.area = false;
468  flag.infinite = false;
469  flag.cone = false;
470  flag.envlight = false;
471  flag.globillum = false;
472  }
473  }
474 }
475 
476 inline void
478 {
479  if(flag.cone != onoff)
480  {
481  invalidateShadowMap(true);
482  flag.cone = onoff;
483  if(onoff)
484  {
486  flag.infinite = false;
487  flag.ambient = false;
488  flag.envlight = false;
489  flag.globillum = false;
490  }
491  else
493  }
494 }
495 
496 inline void
497 RE_Light::setArea(bool onoff)
498 {
499  if(flag.area != onoff)
500  {
501  invalidateShadowMap(true);
502  flag.area = onoff;
503  if(onoff)
504  {
505  flag.envlight = false;
506  flag.infinite = false;
507  flag.ambient = false;
508  flag.globillum = false;
509  }
510  }
511 }
512 
513 inline void
515 {
516  if(flag.portal != onoff)
517  {
518  invalidateShadowMap(true);
519  flag.portal = onoff;
520  }
521 }
522 
523 
524 inline void
526 {
527  if(onoff != flag.envlight)
528  {
529  flag.envlight = onoff;
530  if(onoff)
531  {
532  invalidateShadowMap(true);
533  flag.area = false;
534  flag.cone = false;
535  flag.ambient = false;
536  flag.infinite = false;
537  flag.globillum = false;
538  }
539  else
541 
542  }
543 }
544 
545 inline void
547 {
548  if(onoff != flag.globillum)
549  {
550  flag.globillum = onoff;
551  if(onoff)
552  {
553  invalidateShadowMap(true);
554  flag.area = false;
555  flag.cone = false;
556  flag.ambient = false;
557  flag.infinite = false;
558  flag.envlight = false;
559  }
561  }
562 }
563 
564 inline float
566 {
567  if(coneAngle + coneDelta > 0.0)
568  return coneAngle / (coneAngle + coneDelta);
569  return 0.0f;
570 }
571 
572 inline float
574 {
575  return 1.0f/(1.0f - getConeAngleRadius());
576 }
577 
578 inline void
579 RE_Light::setAreaSide(bool single, bool reverse)
580 {
581  if(myAreaSingleSided != single ||
582  myAreaSingleReverse != reverse)
583  {
584  myAreaSingleSided = single;
585  myAreaSingleReverse = reverse;
587  }
588 }
589 
590 inline void
592 {
593  angle = SYSmax(0.0f, angle);
594  if(angle != myEnvCone)
595  {
597  myEnvCone = angle;
598  }
599 }
600 
601 inline float
603 {
604  return myEnvCone;
605 }
606 
607 inline void
609 {
610  if(znear != myNearDist)
611  {
612  myNearDist = znear;
614  }
615 }
616 
617 inline void
619 {
620  if(myFarDist != zfar)
621  {
622  myFarDist = zfar;
624  }
625 }
626 
627 inline void
629 {
630  if(myShadowMask != m)
631  {
632  myShadowMask.harden(m);
634  }
635 }
636 
637 inline void
639  float linear,
640  float quadratic)
641 
642 {
643  if(!SYSisEqual(myAtten[0], constant) ||
644  !SYSisEqual(myAtten[1], linear) ||
645  !SYSisEqual(myAtten[2], quadratic))
646  {
647  myAtten[0] = constant;
648  myAtten[1] = linear;
649  myAtten[2] = quadratic;
651  }
652 }
653 
654 inline void
655 RE_Light::setAttenuationRange(float near_dist, float far_dist)
656 {
657  if(!SYSisEqual(myAttenRange[0], near_dist) ||
658  !SYSisEqual(myAttenRange[1], far_dist))
659  {
660  myAttenRange[0] = near_dist;
661  myAttenRange[1] = far_dist;
663  }
664 }
665 
666 inline void
668 {
669  if(myAreaAxes!= axes)
670  {
671  myAreaAxes=axes;
673  }
674 }
675 
676 inline void
678 {
679  if(myAreaTransform!=t)
680  {
681  myAreaTransform=t;
683  }
684 }
685 
686 inline void
688 {
689  if(!SYSisEqual(mySurfaceArea, area))
690  {
693  }
694 }
695 
696 inline void
698 {
699  if(myContribDiff != onoff)
700  {
701  myContribDiff = onoff;
703  }
704 }
705 
706 inline void
708 {
709  if(myContribSpec != onoff)
710  {
711  myContribSpec = onoff;
713  }
714 }
715 
716 inline void
718 {
719  if(!SYSisEqual(zoom,z))
720  {
721  zoom = z;
723  }
724 }
725 
726 inline void
728 {
729  if(!SYSisEqual(myFocalLength,focal))
730  {
731  myFocalLength = focal;
733  }
734 }
735 
736 inline void
738 {
739  if(!SYSisEqual(myAperture,aper))
740  {
741  myAperture = aper;
743  }
744 }
745 
746 inline void
748 {
749  if(!SYSisEqual(myOrthoWidth,width))
750  {
753  }
754 }
755 
756 #endif
bool myAttenRampDirty
Definition: RE_Light.h:409
int64 getEmitVersion() const
Definition: RE_Light.h:156
#define SYSmax(a, b)
Definition: SYS_Math.h:1365
RE_UniformBlockHandle myHighQualityBlock
Definition: RE_Light.h:424
bool isEnvironmentLight() const
Definition: RE_Light.h:135
void invalidateFalloffRamp()
void getAttenuation(float atten[3]) const
Definition: RE_Light.h:207
bool isHeadlight() const
Definition: RE_Light.h:107
void setAperture(float aper)
Definition: RE_Light.h:737
float myEnvCone
Definition: RE_Light.h:382
void setAreaSide(bool single, bool reverse)
Definition: RE_Light.h:579
bool myFalloffRampDirty
Definition: RE_Light.h:404
float coneDelta
Definition: RE_Light.h:371
float getEnvironmentCone() const
Definition: RE_Light.h:602
void setAreaAxes(const UT_Vector3F &axes)
Definition: RE_Light.h:667
float coneAngle
Definition: RE_Light.h:371
void setAttenuationRange(float near_dist, float far_dist)
Definition: RE_Light.h:655
GLenum GLint * range
Definition: glcorearb.h:1924
UT_Vector3 myPos
Definition: RE_Light.h:366
float getNearDistance() const
Definition: RE_Light.h:285
UT_Array< RE_LightData * > myAttachedLightData
Definition: RE_Light.h:420
void setName(const char *name)
Definition: RE_Light.h:97
void bumpLightVersion()
Definition: RE_Light.h:289
float getShadowBlur() const
Definition: RE_Light.h:238
RE_TextureCubeFace
#define RE_API
Definition: RE_API.h:10
UT_Matrix4 xform
Definition: RE_Light.h:370
void setEnvironmentCone(float angle)
Definition: RE_Light.h:591
int myGLConeTextureIndex
Definition: RE_Light.h:357
RE_TextureCompress myProjectMapFormat
Definition: RE_Light.h:391
UT_Vector3 myAreaAxes
Definition: RE_Light.h:411
const UT_Vector3F & getColor() const
Definition: RE_Light.h:122
float myMaxLightRadius
Definition: RE_Light.h:379
bool isGlobalIllumination() const
Definition: RE_Light.h:137
GLdouble GLdouble GLdouble z
Definition: glcorearb.h:847
virtual int getUniqueId() const
Definition: RE_Light.h:160
void setColor(const UT_Vector3 &c)
Definition: RE_Light.h:430
int myProjectMapMaxW
Definition: RE_Light.h:388
UT_Matrix4 getAreaTransform() const
Definition: RE_Light.h:142
unsigned area
Definition: RE_Light.h:75
RE_LightAreaShape myAreaLightShape
Definition: RE_Light.h:400
float myFocalLength
Definition: RE_Light.h:372
RE_Texture2DMap * projectMap
Definition: RE_Light.h:380
float getDeltaAngleFactor() const
Definition: RE_Light.h:573
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1221
int isSpecular() const
Definition: RE_Light.h:148
void setDiffuse(int onoff)
Definition: RE_Light.h:697
int needConeGLReset() const
Definition: RE_Light.h:296
float getZoom() const
Definition: RE_Light.h:281
RE_TextureCubeMap * myEnvMap
Definition: RE_Light.h:381
UT_Matrix4 & getTransform()
Definition: RE_Light.h:127
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glcorearb.h:2538
int myShadowMapSize
Definition: RE_Light.h:397
RE_LightFlag()
Definition: RE_Light.h:58
int64 getLightVersion() const
Definition: RE_Light.h:288
float mySurfaceArea
Definition: RE_Light.h:412
float getFocalLength() const
Definition: RE_Light.h:282
UT_String myProjectMapRelativeTo
Definition: RE_Light.h:386
UT_Vector3 & getColor()
Definition: RE_Light.h:123
png_uint_32 i
Definition: png.h:2877
void enable(bool e)
Definition: RE_Light.h:99
int isCone() const
Definition: RE_Light.h:131
void setGlobalIllumination(bool onoff)
Definition: RE_Light.h:546
float myShadowIntensity
Definition: RE_Light.h:393
int myLightShadowMapSize
Definition: RE_Light.h:399
void getAttenuationRange(float range[2]) const
Definition: RE_Light.h:212
int myAnisotropySamples
Definition: RE_Light.h:392
RE_ShadowMap * myShadowMap
Definition: RE_Light.h:402
float getFarDistance() const
Definition: RE_Light.h:286
UT_String myName
Definition: RE_Light.h:365
GLint GLsizei width
Definition: glcorearb.h:102
void setAttenuation(float constant, float linear, float quadratic)
Definition: RE_Light.h:638
float getShadowIntensity() const
Definition: RE_Light.h:236
void setShadowIntensity(float i)
Definition: RE_Light.h:226
void setFocalLength(float focal)
Definition: RE_Light.h:727
void setCone(int onoff)
Definition: RE_Light.h:477
void setArea(bool onoff)
Definition: RE_Light.h:497
float myAttenRampEnd
Definition: RE_Light.h:408
long long int64
Definition: SYS_Types.h:100
float getConeAngleRadius() const
Definition: RE_Light.h:565
void setZoom(float z)
Definition: RE_Light.h:717
UT_Vector3 getAreaAxes() const
Definition: RE_Light.h:141
GLdouble n
Definition: glcorearb.h:2007
const char * getShadowMask() const
Definition: RE_Light.h:244
GLfloat f
Definition: glcorearb.h:1925
RE_Texture * myAttenMap
Definition: RE_Light.h:405
float myFarDist
Definition: RE_Light.h:375
void setConeAttrib(float a=45, float d=10, float r=1)
Definition: RE_Light.h:181
unsigned long long uint64
Definition: SYS_Types.h:101
void setShadowQuality(float q)
Definition: RE_Light.h:229
const UT_Matrix4 & getTransform() const
Definition: RE_Light.h:126
float getShadowBias() const
Definition: RE_Light.h:237
void setOrthoWidth(float width)
Definition: RE_Light.h:747
float myShadowBias
Definition: RE_Light.h:394
UT_Ramp * myAttenRamp
Definition: RE_Light.h:406
int getShadowMapSize() const
Definition: RE_Light.h:240
float myProjectMapScale
Definition: RE_Light.h:390
float myAttenRampStart
Definition: RE_Light.h:407
void setLightShadowMapSize(int s)
Definition: RE_Light.h:230
int getLightShadowMapSize() const
Definition: RE_Light.h:241
bool isPortalLight() const
Definition: RE_Light.h:136
void setSurfaceArea(float area)
Definition: RE_Light.h:687
float getConeRoll() const
Definition: RE_Light.h:197
void setSpecular(int onoff)
Definition: RE_Light.h:707
void setHeadlight(bool hl)
Definition: RE_Light.h:106
void harden()
Take shallow copy and make it deep.
Definition: UT_String.h:213
float myShadowQuality
Definition: RE_Light.h:396
void setNearDistance(float znear)
Definition: RE_Light.h:608
unsigned cone
Definition: RE_Light.h:75
T angle(const Vec2< T > &v1, const Vec2< T > &v2)
Definition: Vec2.h:480
unsigned portal
Definition: RE_Light.h:75
float myOrthoWidth
Definition: RE_Light.h:373
const UT_Vector3 & getDirection() const
Definition: RE_Light.h:113
bool isAreaLight() const
Definition: RE_Light.h:140
virtual int64 getVersion() const
Definition: RE_Light.h:153
float getAperture() const
Definition: RE_Light.h:283
float myAperture
Definition: RE_Light.h:372
RE_UniformBlockHandle myAreaBlock
Definition: RE_Light.h:426
GLboolean * data
Definition: glcorearb.h:130
void setTransform(const UT_Matrix4 &m)
Definition: RE_Light.h:128
GLuint const GLchar * name
Definition: glcorearb.h:785
void setOrientation(UT_Matrix3 &orient)
Definition: RE_Light.h:116
void getAttenuationRampRange(float range[2]) const
Definition: RE_Light.h:219
int isMapProjector() const
Definition: RE_Light.h:134
UT_Vector3FArray myAreaPos
Definition: RE_Light.h:414
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1221
int myProjectMapMaxH
Definition: RE_Light.h:389
GA_API const UT_StringHolder orient
RE_UniformBlockHandle myBasicLightingBlock
Definition: RE_Light.h:423
unsigned myContribDiff
Definition: RE_Light.h:358
int myMaxEnvMapSize
Definition: RE_Light.h:383
GLsizei samples
Definition: glcorearb.h:1297
bool isAreaSingleSideReversed() const
Definition: RE_Light.h:145
float getShadowQuality() const
Definition: RE_Light.h:239
void invalidateShadowMap(bool purge_map=false)
void setAmbient(int onoff)
Definition: RE_Light.h:459
void setShadowBias(float b)
Definition: RE_Light.h:227
GLint GLint GLsizei GLint GLenum format
Definition: glcorearb.h:107
int isAmbient() const
Definition: RE_Light.h:133
UT_Vector3 myColor
Definition: RE_Light.h:368
int isDiffuse() const
Definition: RE_Light.h:147
unsigned envlight
Definition: RE_Light.h:75
double fpreal
Definition: SYS_Types.h:263
float getConeAngle() const
Definition: RE_Light.h:195
RE_LightAreaShape
Definition: RE_Light.h:39
void setPortal(bool onoff)
Definition: RE_Light.h:514
float getOrthoWidth() const
Definition: RE_Light.h:284
void setShadowMask(const char *m)
Definition: RE_Light.h:628
UT_Matrix4 myAreaTransform
Definition: RE_Light.h:413
void setFarDistance(float zfar)
Definition: RE_Light.h:618
float myShadowBlur
Definition: RE_Light.h:395
unsigned infinite
Definition: RE_Light.h:75
Utility class for containing a color ramp.
Definition: UT_Ramp.h:84
GLuint index
Definition: glcorearb.h:785
float myNearDist
Definition: RE_Light.h:374
bool isAreaSingleSided() const
Definition: RE_Light.h:144
UT_Vector3 myDir
Definition: RE_Light.h:367
bool myProjectMapLimit
Definition: RE_Light.h:387
unsigned myAreaSingleReverse
Definition: RE_Light.h:358
const UT_Vector3 & getPosition() const
Definition: RE_Light.h:109
float getSurfaceArea() const
Definition: RE_Light.h:143
int64 myLightVersion
Definition: RE_Light.h:417
bool isShadowed() const
Definition: RE_Light.h:150
const UT_Matrix3 & getOrientation()
Definition: RE_Light.h:120
const char * getName() const
Definition: RE_Light.h:96
RE_Texture * myFalloffRamp
Definition: RE_Light.h:403
void setDirection(const UT_Vector3 &d)
Definition: RE_Light.h:114
float myAtten[3]
Definition: RE_Light.h:377
GLboolean r
Definition: glcorearb.h:1221
unsigned ambient
Definition: RE_Light.h:75
UT_String myProjectMapName
Definition: RE_Light.h:385
RE_LightFlag flag
Definition: RE_Light.h:364
RE_TextureCompress
png_infop png_uint_32 flag
Definition: png.h:2242
UT_Vector3FArray myAreaDir
Definition: RE_Light.h:415
void setShadowBlur(float b)
Definition: RE_Light.h:228
unsigned myAreaSingleSided
Definition: RE_Light.h:358
int isInfinite() const
Definition: RE_Light.h:132
float getConeDelta() const
Definition: RE_Light.h:196
unsigned globillum
Definition: RE_Light.h:75
void setConeTextureIndex(int idx)
Definition: RE_Light.h:293
float coneRoll
Definition: RE_Light.h:371
void recomputeFalloffRamp()
float zoom
Definition: RE_Light.h:376
UT_Matrix3 myOrientation
Definition: RE_Light.h:369
void needConeGLReset(int f)
Definition: RE_Light.h:297
float myAttenRange[2]
Definition: RE_Light.h:378
int64 myEmitSerial
Definition: RE_Light.h:418
UT_String myShadowMask
Definition: RE_Light.h:398
GA_API const UT_StringHolder area
void setInfinite(int onoff)
Definition: RE_Light.h:441
void setAreaTransform(UT_Matrix4 t)
Definition: RE_Light.h:677
unsigned myContribSpec
Definition: RE_Light.h:358
void setPosition(const UT_Vector3 &p)
Definition: RE_Light.h:110
bool isEnabled() const
Definition: RE_Light.h:100
int getConeTextureIndex() const
Definition: RE_Light.h:291
void setEnvironment(bool onoff)
Definition: RE_Light.h:525
RE_UniformBlockHandle myShadowBlock
Definition: RE_Light.h:425