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_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 
199  RE_Texture *getFalloffRamp(RE_Render *r);
200 
201  // Attenuation
202  void setAttenuation(float constant,
203  float linear,
204  float quadratic);
205  void getAttenuation(float atten[3]) const
206  { atten[0] = myAtten[0];
207  atten[1] = myAtten[1];
208  atten[2] = myAtten[2]; }
209  void setAttenuationRange(float near_dist, float far_dist);
210  void getAttenuationRange(float range[2]) const
211  { range[0] = myAttenRange[0];
212  range[1] = myAttenRange[1]; }
213 
214  void setAttenuationRamp(const UT_Ramp *ramp,
215  float start_dist, float end_dist);
216  RE_Texture *getAttenuationRamp(RE_Render *r);
217  void getAttenuationRampRange(float range[2]) const
218  { range[0] = myAttenRampStart;
219  range[1] = myAttenRampEnd; }
220 
221 
222  // Shadows
223  void setShadowed(bool onoff);
224  void setShadowIntensity(float i) { myShadowIntensity = i; }
225  void setShadowBias(float b) { myShadowBias = b; }
226  void setShadowBlur(float b) { myShadowBlur = b; }
227  void setShadowQuality(float q) { myShadowQuality=q; }
228  void setLightShadowMapSize(int s) { myLightShadowMapSize=s;}
229  void setShadowMapSize(int s);
230  void setAreaShadowShape(RE_LightAreaShape shape);
231  void setShadowMask(const char *m);
232  void setLinearShadowMap(bool linear);
233 
234  float getShadowIntensity() const { return myShadowIntensity;}
235  float getShadowBias() const { return myShadowBias; }
236  float getShadowBlur() const { return myShadowBlur; }
237  float getShadowQuality() const { return myShadowQuality; }
238  int getShadowMapSize() const { return myShadowMapSize; }
240  { return myLightShadowMapSize; }
241  int getNumAreaMaps() const;
242  const char *getShadowMask() const { return myShadowMask; }
243  bool getLinearShadowMap() const;
244 
245  // Only valid once the shadowmap exists.
246  void getShadowZRange(fpreal &n, fpreal &f);
247 
248  // Shadow map usage
249  RE_Texture *getShadowMap(int area_index = 0);
250  void setMultiMap(bool m);
251  void useShadowMap(RE_Render *r, RE_Shader *shadow_shader,
252  bool onoff);
253  bool beginShadowRender(RE_Render *r,
254  RE_TextureCubeFace face
256  int area_index = 0);
257  void endShadowRender(RE_Render *r,
258  RE_TextureCubeFace face
260  int area_index = 0);
261  void setShadowMapVersion(uint64 version);
262  int64 getShadowMapVersion() const;
263  void setShadowMapTime(fpreal t);
264  fpreal getShadowMapTime() const;
265 
266  // Returns true if 6 separate shadow maps are used instead of a cube map,
267  // for hardware that does not support cube shadow maps.
268  bool useSeparatePointShadowMaps(RE_Render *r) const;
269 
270  //
271  // Other attributes (like zoom)
272  void setZoom(float z);
273  void setFocalLength(float focal);
274  void setAperture(float aper);
275  void setOrthoWidth(float width);
276  void setNearDistance(float znear);
277  void setFarDistance(float zfar);
278 
279  float getZoom() const { return zoom; }
280  float getFocalLength() const { return myFocalLength; }
281  float getAperture() const { return myAperture; }
282  float getOrthoWidth() const { return myOrthoWidth; }
283  float getNearDistance() const { return myNearDist; }
284  float getFarDistance() const { return myFarDist; }
285 
286  int64 getLightVersion() const { return myLightVersion; }
287  void bumpLightVersion() { myLightVersion++; }
288 
289  int getConeTextureIndex() const
290  { return myGLConeTextureIndex;}
291  void setConeTextureIndex(int idx)
292  { myGLConeTextureIndex = idx; }
293 
294  //
295  // Methods to set up different texture maps used by lights
296  void setProjectMap(const char *name,
297  const char *relativeTo);
298  void setProjectMapClamp(int onoff);
299  void setProjectMapFormat(RE_TextureCompress format);
300  void setProjectMapScale(float sc, bool limitres,
301  int maxw, int maxh);
302  void setProjectMapMipmap(bool onoff);
303  void setProjectMapAnisotropy(int samples);
304 
305  RE_Texture2DMap *getProjectMap(RE_Render *r);
306 
307  void setEnvironmentMap(const char *name,
308  const char *relativeTo);
309  void setEnvironmentFormat(RE_TextureCompress format);
310  void setEnvironmentMipmap(bool onoff);
311  void setEnvironmentCone(float angle);
312  RE_TextureHolder getEnvironmentMap(RE_Render *r, int max_width);
313  float getEnvironmentCone() const;
314 
315  //
316  // Uniform blocks for lights
317  void updateBasicLighting(RE_Render *r,
318  RE_Shader *sh,
319  int index);
320  void updateBasicBlock(RE_UniformBlock *lighting_block,
321  int light_index,
322  const char *light_prefix);
323  void updateHQLighting(RE_Render *r, RE_Shader *sh);
324  void updateAreaLighting(RE_Render *r, RE_Shader *sh);
325  void updateShadow(RE_Render *r, RE_Shader *sh);
326 
327  static void clearLight(RE_Shader *sh, int index);
328 
329  /// @brief Allows data, like shadow maps, to be stored with the light
330  /// Attaching data to the light gives it ownership, meaning that it will be
331  /// deleted when the light is deleted, or when a different data chunk is
332  /// assigned to the same index. To avoid it being deleted, detach the chunk.
333  /// @{
334  void attachUserData(RE_LightData *data, int index);
335  RE_LightData *detachUserData(int index);
336  RE_LightData *getAttachedUserData(int index) const;
337  /// @}
338 
339  /// @brief Accessor to underlaying shadow map object
340  /// Each light may have a shadow map object. Turning off shadows on the
341  /// light will delete the map, so do not cache the pointer. If a shadow map
342  /// does not exist, this will create a new one.
343  RE_ShadowMap *getShadowMap();
344 
345 protected:
346 
347  void invalidateShadowMap(bool purge_map = false);
348  void invalidateFalloffRamp();
349  void recomputeFalloffRamp();
350  void createEnvMap();
351 
352  int myGLConeTextureIndex; // for lights that project maps
353  unsigned myContribDiff:1, // contributes to diffuse
354  myContribSpec:1, // contributes to specular
355  myUseShadows:1, // uses shadow maps
356  myAreaSingleSided:1, // single-sided area light
357  myAreaSingleReverse:1; // reverse dir for ss area light
365  float coneAngle, coneDelta, coneRoll;
366  float myAperture, myFocalLength;
368  float myNearDist;
369  float myFarDist;
370  float zoom;
371  float myAtten[3];
372  float myAttenRange[2];
374  RE_Texture2DMap *projectMap; // Projection texture
375  RE_TextureCubeMap *myEnvMap; // Environment map
376  float myEnvCone;
378 
395 
404 
410 
413 
415 
416  // Cached uniform blocks
421 };
422 
423 inline void
425 {
426  if(myColor != c)
427  {
429  myEmitSerial++;
430  myColor = c;
431  }
432 }
433 
434 inline void
436 {
437  if(flag.infinite != onoff)
438  {
439  invalidateShadowMap(true);
440  flag.infinite = onoff;
441  if(onoff)
442  {
443  flag.area = false;
444  flag.cone = false;
445  flag.envlight = false;
446  flag.ambient = false;
447  flag.globillum = false;
448  }
449  }
450 }
451 
452 inline void
454 {
455  if(flag.ambient != onoff)
456  {
457  invalidateShadowMap(true);
458  flag.ambient = onoff;
459  if(onoff)
460  {
461  flag.area = false;
462  flag.infinite = false;
463  flag.cone = false;
464  flag.envlight = false;
465  flag.globillum = false;
466  }
467  }
468 }
469 
470 inline void
472 {
473  if(flag.cone != onoff)
474  {
475  invalidateShadowMap(true);
476  flag.cone = onoff;
477  if(onoff)
478  {
480  flag.infinite = false;
481  flag.ambient = false;
482  flag.envlight = false;
483  flag.globillum = false;
484  }
485  else
487  }
488 }
489 
490 inline void
491 RE_Light::setArea(bool onoff)
492 {
493  if(flag.area != onoff)
494  {
495  invalidateShadowMap(true);
496  flag.area = onoff;
497  if(onoff)
498  {
499  flag.envlight = false;
500  flag.infinite = false;
501  flag.ambient = false;
502  flag.globillum = false;
503  }
504  }
505 }
506 
507 inline void
509 {
510  if(flag.portal != onoff)
511  {
512  invalidateShadowMap(true);
513  flag.portal = onoff;
514  }
515 }
516 
517 
518 inline void
520 {
521  if(onoff != flag.envlight)
522  {
523  flag.envlight = onoff;
524  if(onoff)
525  {
526  invalidateShadowMap(true);
527  flag.area = false;
528  flag.cone = false;
529  flag.ambient = false;
530  flag.infinite = false;
531  flag.globillum = false;
532  }
533  else
535 
536  }
537 }
538 
539 inline void
541 {
542  if(onoff != flag.globillum)
543  {
544  flag.globillum = onoff;
545  if(onoff)
546  {
547  invalidateShadowMap(true);
548  flag.area = false;
549  flag.cone = false;
550  flag.ambient = false;
551  flag.infinite = false;
552  flag.envlight = false;
553  }
555  }
556 }
557 
558 inline void
559 RE_Light::setAreaSide(bool single, bool reverse)
560 {
561  if(myAreaSingleSided != single ||
562  myAreaSingleReverse != reverse)
563  {
564  myAreaSingleSided = single;
565  myAreaSingleReverse = reverse;
567  }
568 }
569 
570 inline void
572 {
573  angle = SYSmax(0.0f, angle);
574  if(angle != myEnvCone)
575  {
577  myEnvCone = angle;
578  }
579 }
580 
581 inline float
583 {
584  return myEnvCone;
585 }
586 
587 inline void
589 {
590  if(znear != myNearDist)
591  {
592  myNearDist = znear;
594  }
595 }
596 
597 inline void
599 {
600  if(myFarDist != zfar)
601  {
602  myFarDist = zfar;
604  }
605 }
606 
607 inline void
609 {
610  if(myShadowMask != m)
611  {
612  myShadowMask.harden(m);
614  }
615 }
616 
617 inline void
619  float linear,
620  float quadratic)
621 
622 {
623  if(!SYSisEqual(myAtten[0], constant) ||
624  !SYSisEqual(myAtten[1], linear) ||
625  !SYSisEqual(myAtten[2], quadratic))
626  {
627  myAtten[0] = constant;
628  myAtten[1] = linear;
629  myAtten[2] = quadratic;
631  }
632 }
633 
634 inline void
635 RE_Light::setAttenuationRange(float near_dist, float far_dist)
636 {
637  if(!SYSisEqual(myAttenRange[0], near_dist) ||
638  !SYSisEqual(myAttenRange[1], far_dist))
639  {
640  myAttenRange[0] = near_dist;
641  myAttenRange[1] = far_dist;
643  }
644 }
645 
646 inline void
648 {
649  if(myAreaAxes!= axes)
650  {
651  myAreaAxes=axes;
653  }
654 }
655 
656 inline void
658 {
659  if(myAreaTransform!=t)
660  {
661  myAreaTransform=t;
663  }
664 }
665 
666 inline void
668 {
669  if(!SYSisEqual(mySurfaceArea, area))
670  {
673  }
674 }
675 
676 inline void
678 {
679  if(myContribDiff != onoff)
680  {
681  myContribDiff = onoff;
683  }
684 }
685 
686 inline void
688 {
689  if(myContribSpec != onoff)
690  {
691  myContribSpec = onoff;
693  }
694 }
695 
696 inline void
698 {
699  if(!SYSisEqual(zoom,z))
700  {
701  zoom = z;
703  }
704 }
705 
706 inline void
708 {
709  if(!SYSisEqual(myFocalLength,focal))
710  {
711  myFocalLength = focal;
713  }
714 }
715 
716 inline void
718 {
719  if(!SYSisEqual(myAperture,aper))
720  {
721  myAperture = aper;
723  }
724 }
725 
726 inline void
728 {
729  if(!SYSisEqual(myOrthoWidth,width))
730  {
733  }
734 }
735 
736 #endif
bool myAttenRampDirty
Definition: RE_Light.h:403
int64 getEmitVersion() const
Definition: RE_Light.h:156
#define SYSmax(a, b)
Definition: SYS_Math.h:1367
RE_UniformBlockHandle myHighQualityBlock
Definition: RE_Light.h:418
bool isEnvironmentLight() const
Definition: RE_Light.h:135
void invalidateFalloffRamp()
void getAttenuation(float atten[3]) const
Definition: RE_Light.h:205
bool isHeadlight() const
Definition: RE_Light.h:107
void setAperture(float aper)
Definition: RE_Light.h:717
float myEnvCone
Definition: RE_Light.h:376
void setAreaSide(bool single, bool reverse)
Definition: RE_Light.h:559
bool myFalloffRampDirty
Definition: RE_Light.h:398
float getEnvironmentCone() const
Definition: RE_Light.h:582
void setAreaAxes(const UT_Vector3F &axes)
Definition: RE_Light.h:647
void setAttenuationRange(float near_dist, float far_dist)
Definition: RE_Light.h:635
GLenum GLint * range
Definition: glcorearb.h:1924
UT_Vector3 myPos
Definition: RE_Light.h:360
float getNearDistance() const
Definition: RE_Light.h:283
UT_Array< RE_LightData * > myAttachedLightData
Definition: RE_Light.h:414
void setName(const char *name)
Definition: RE_Light.h:97
void bumpLightVersion()
Definition: RE_Light.h:287
float getShadowBlur() const
Definition: RE_Light.h:236
RE_TextureCubeFace
#define RE_API
Definition: RE_API.h:10
UT_Matrix4 xform
Definition: RE_Light.h:364
void setEnvironmentCone(float angle)
Definition: RE_Light.h:571
int myGLConeTextureIndex
Definition: RE_Light.h:352
RE_TextureCompress myProjectMapFormat
Definition: RE_Light.h:385
UT_Vector3 myAreaAxes
Definition: RE_Light.h:405
const UT_Vector3F & getColor() const
Definition: RE_Light.h:122
float myMaxLightRadius
Definition: RE_Light.h:373
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:424
int myProjectMapMaxW
Definition: RE_Light.h:382
UT_Matrix4 getAreaTransform() const
Definition: RE_Light.h:142
unsigned area
Definition: RE_Light.h:75
RE_LightAreaShape myAreaLightShape
Definition: RE_Light.h:394
float myFocalLength
Definition: RE_Light.h:366
RE_Texture2DMap * projectMap
Definition: RE_Light.h:374
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:677
float getZoom() const
Definition: RE_Light.h:279
RE_TextureCubeMap * myEnvMap
Definition: RE_Light.h:375
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:391
RE_LightFlag()
Definition: RE_Light.h:58
int64 getLightVersion() const
Definition: RE_Light.h:286
float mySurfaceArea
Definition: RE_Light.h:406
float getFocalLength() const
Definition: RE_Light.h:280
UT_String myProjectMapRelativeTo
Definition: RE_Light.h:380
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:540
float myShadowIntensity
Definition: RE_Light.h:387
int myLightShadowMapSize
Definition: RE_Light.h:393
void getAttenuationRange(float range[2]) const
Definition: RE_Light.h:210
int myAnisotropySamples
Definition: RE_Light.h:386
RE_ShadowMap * myShadowMap
Definition: RE_Light.h:396
float getFarDistance() const
Definition: RE_Light.h:284
UT_String myName
Definition: RE_Light.h:359
GLint GLsizei width
Definition: glcorearb.h:102
void setAttenuation(float constant, float linear, float quadratic)
Definition: RE_Light.h:618
float getShadowIntensity() const
Definition: RE_Light.h:234
void setShadowIntensity(float i)
Definition: RE_Light.h:224
void setFocalLength(float focal)
Definition: RE_Light.h:707
void setCone(int onoff)
Definition: RE_Light.h:471
void setArea(bool onoff)
Definition: RE_Light.h:491
float myAttenRampEnd
Definition: RE_Light.h:402
long long int64
Definition: SYS_Types.h:107
void setZoom(float z)
Definition: RE_Light.h:697
UT_Vector3 getAreaAxes() const
Definition: RE_Light.h:141
GLdouble n
Definition: glcorearb.h:2007
const char * getShadowMask() const
Definition: RE_Light.h:242
GLfloat f
Definition: glcorearb.h:1925
RE_Texture * myAttenMap
Definition: RE_Light.h:399
float myFarDist
Definition: RE_Light.h:369
void setConeAttrib(float a=45, float d=10, float r=1)
Definition: RE_Light.h:181
unsigned long long uint64
Definition: SYS_Types.h:108
void setShadowQuality(float q)
Definition: RE_Light.h:227
const UT_Matrix4 & getTransform() const
Definition: RE_Light.h:126
float getShadowBias() const
Definition: RE_Light.h:235
void setOrthoWidth(float width)
Definition: RE_Light.h:727
float myShadowBias
Definition: RE_Light.h:388
UT_Ramp * myAttenRamp
Definition: RE_Light.h:400
int getShadowMapSize() const
Definition: RE_Light.h:238
float myProjectMapScale
Definition: RE_Light.h:384
float myAttenRampStart
Definition: RE_Light.h:401
void setLightShadowMapSize(int s)
Definition: RE_Light.h:228
int getLightShadowMapSize() const
Definition: RE_Light.h:239
bool isPortalLight() const
Definition: RE_Light.h:136
void setSurfaceArea(float area)
Definition: RE_Light.h:667
float getConeRoll() const
Definition: RE_Light.h:197
void setSpecular(int onoff)
Definition: RE_Light.h:687
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:390
void setNearDistance(float znear)
Definition: RE_Light.h:588
unsigned cone
Definition: RE_Light.h:75
T angle(const Vec2< T > &v1, const Vec2< T > &v2)
Definition: Vec2.h:472
unsigned portal
Definition: RE_Light.h:75
float myOrthoWidth
Definition: RE_Light.h:367
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:281
float myAperture
Definition: RE_Light.h:366
RE_UniformBlockHandle myAreaBlock
Definition: RE_Light.h:420
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:217
int isMapProjector() const
Definition: RE_Light.h:134
UT_Vector3FArray myAreaPos
Definition: RE_Light.h:408
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1221
int myProjectMapMaxH
Definition: RE_Light.h:383
GA_API const UT_StringHolder orient
RE_UniformBlockHandle myBasicLightingBlock
Definition: RE_Light.h:417
unsigned myContribDiff
Definition: RE_Light.h:353
int myMaxEnvMapSize
Definition: RE_Light.h:377
GLsizei samples
Definition: glcorearb.h:1297
bool isAreaSingleSideReversed() const
Definition: RE_Light.h:145
GT_API const UT_StringHolder version
float getShadowQuality() const
Definition: RE_Light.h:237
void invalidateShadowMap(bool purge_map=false)
void setAmbient(int onoff)
Definition: RE_Light.h:453
void setShadowBias(float b)
Definition: RE_Light.h:225
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:362
int isDiffuse() const
Definition: RE_Light.h:147
unsigned envlight
Definition: RE_Light.h:75
double fpreal
Definition: SYS_Types.h:270
float getConeAngle() const
Definition: RE_Light.h:195
RE_LightAreaShape
Definition: RE_Light.h:39
void setPortal(bool onoff)
Definition: RE_Light.h:508
float getOrthoWidth() const
Definition: RE_Light.h:282
void setShadowMask(const char *m)
Definition: RE_Light.h:608
UT_Matrix4 myAreaTransform
Definition: RE_Light.h:407
void setFarDistance(float zfar)
Definition: RE_Light.h:598
float myShadowBlur
Definition: RE_Light.h:389
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:368
bool isAreaSingleSided() const
Definition: RE_Light.h:144
UT_Vector3 myDir
Definition: RE_Light.h:361
bool myProjectMapLimit
Definition: RE_Light.h:381
unsigned myAreaSingleReverse
Definition: RE_Light.h:353
const UT_Vector3 & getPosition() const
Definition: RE_Light.h:109
float getSurfaceArea() const
Definition: RE_Light.h:143
int64 myLightVersion
Definition: RE_Light.h:411
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:397
void setDirection(const UT_Vector3 &d)
Definition: RE_Light.h:114
float myAtten[3]
Definition: RE_Light.h:371
GLboolean r
Definition: glcorearb.h:1221
unsigned ambient
Definition: RE_Light.h:75
UT_String myProjectMapName
Definition: RE_Light.h:379
RE_LightFlag flag
Definition: RE_Light.h:358
RE_TextureCompress
png_infop png_uint_32 flag
Definition: png.h:2242
UT_Vector3FArray myAreaDir
Definition: RE_Light.h:409
void setShadowBlur(float b)
Definition: RE_Light.h:226
unsigned myAreaSingleSided
Definition: RE_Light.h:353
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:291
float coneRoll
Definition: RE_Light.h:365
void recomputeFalloffRamp()
float zoom
Definition: RE_Light.h:370
UT_Matrix3 myOrientation
Definition: RE_Light.h:363
float myAttenRange[2]
Definition: RE_Light.h:372
int64 myEmitSerial
Definition: RE_Light.h:412
UT_String myShadowMask
Definition: RE_Light.h:392
GA_API const UT_StringHolder area
void setInfinite(int onoff)
Definition: RE_Light.h:435
void setAreaTransform(UT_Matrix4 t)
Definition: RE_Light.h:657
unsigned myContribSpec
Definition: RE_Light.h:353
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:289
void setEnvironment(bool onoff)
Definition: RE_Light.h:519
RE_UniformBlockHandle myShadowBlock
Definition: RE_Light.h:419