14 #ifndef __RE_Light_H__
15 #define __RE_Light_H__
37 #define RE_SHADOW_MAX_AREA_MAPS 8
38 #define RE_SHADOW_NUM_CUBE_MAPS 6
69 clampprojectormap = 0;
71 projectormapdirty = 0;
81 unsigned mapprojector:1,
106 const
char *
getName()
const {
return myName; }
109 void enable(
bool e) { flag.enabled = e; }
114 bool isLightContributing()
const;
121 {
if(p != myPos) { myPos = p; invalidateShadowMap(); }}
125 {
if(d != myDir) { myDir = d; invalidateShadowMap(); }}
127 {
if(orient != myOrientation)
128 { myOrientation =
orient; invalidateShadowMap(); }
136 void setIntensity(
float i);
165 {
return myAreaSingleReverse; }
184 void setInfinite(
int onoff);
185 void setAmbient(
int onoff);
186 void setCone(
int onoff);
187 void setArea(
bool onoff);
188 void setGeometry(
bool onoff);
189 void setEnvironment(
bool onoff);
190 void setPortal(
bool onoff);
191 void setGlobalIllumination(
bool onoff);
195 void setAreaSide(
bool single,
bool reverse);
198 void buildAreaShape(
int numsample);
199 void setBoundingRadius(
float radius);
200 void setSurfaceArea(
float area);
201 void setNormalizeArea(
bool norm);
202 void setDiffuse(
int onoff);
203 void setSpecular(
int onoff);
206 if(myConeAngle !=
a ||
213 setCone((
a*.5 + d >= 180) ? 0 : 1);
214 invalidateShadowMap();
222 void setAttenuation(
float constant,
226 { atten[0] = myAtten[0];
227 atten[1] = myAtten[1];
228 atten[2] = myAtten[2]; }
229 void setAttenuationRange(
float near_dist,
float far_dist);
231 { range[0] = myAttenRange[0];
232 range[1] = myAttenRange[1]; }
234 void setAttenuationRamp(
const UT_Ramp *ramp,
235 float start_dist,
float end_dist);
238 { range[0] = myAttenRampStart;
239 range[1] = myAttenRampEnd; }
243 void setShadowed(
bool onoff);
249 void setShadowMapSize(
int s);
250 void setShadowMask(
const char *m);
251 void setLinearShadowMap(
bool linear);
261 {
return myLightShadowMapSize; }
262 int getNumAreaMaps()
const;
264 bool getLinearShadowMap()
const;
271 void setMultiMap(
bool m);
281 int64 getShadowMapVersion()
const;
282 void setShadowMapTime(
fpreal t);
283 fpreal getShadowMapTime()
const;
287 void setZoom(
float z);
288 void setFocalLength(
float focal);
289 void setAperture(
float aper);
290 void setOrthoWidth(
float width);
291 void setNearDistance(
float znear);
292 void setFarDistance(
float zfar);
293 void setLeftBarn(
float amount,
float falloff);
294 void setRightBarn(
float amount,
float falloff);
295 void setTopBarn(
float amount,
float falloff);
296 void setBottomBarn(
float amount,
float falloff);
299 { myFogScatterPara = para;
300 myFogScatterPerp = perp; }
302 { myFogIntensity = intensity; }
318 {
return myGLConeTextureIndex;}
320 { myGLConeTextureIndex = idx; }
324 void setProjectMap(
const char *
name,
325 const char *relativeTo);
326 void setProjectMapClamp(
int onoff);
328 void setProjectMapScale(
float sc,
bool limitres,
330 void setProjectMapMipmap(
bool onoff);
331 void setProjectMapAnisotropy(
int samples);
335 void setEnvironmentMap(
const char *
name,
336 const char *relativeTo);
338 void setEnvironmentMipmap(
bool onoff);
339 void setEnvironmentCone(
float angle);
341 float getEnvironmentCone()
const;
356 const char *light_prefix);
360 const char *light_prefix)
const;
364 const char *light_pref)
const;
397 RE_HQLightType hqLightType()
const;
399 void setLightBatchID(
int id,
int index);
404 { myLightLink = link; }
408 void invalidateShadowMap(
bool purge_map =
false);
410 void getAreaLightProjection(
UT_Matrix4 &mat)
const;
413 unsigned myContribDiff:1,
417 myAreaSingleReverse:1,
436 float myAttenRange[2];
int64 getEmitVersion() const
RE_UniformBlockHandle myHighQualityBlock
bool isEnvironmentLight() const
void getAttenuation(float atten[3]) const
void setAperture(float aper)
RE_LightAreaShape getAreaShape() const
void setAreaSide(bool single, bool reverse)
float getEnvironmentCone() const
void setAreaAxes(const UT_Vector3F &axes)
void setAttenuationRange(float near_dist, float far_dist)
float getNearDistance() const
UT_Array< RE_LightData * > myAttachedLightData
void setIntensity(float i)
void setName(const char *name)
float getShadowBlur() const
UT_StringHolder myLightLink
void setGeometry(bool onoff)
SIM_API const UT_StringHolder angle
void setEnvironmentCone(float angle)
void harden(const char *src)
RE_TextureCompress myProjectMapFormat
const UT_Vector3F & getColor() const
const UT_StringRef & getShadowMask() const
bool isGlobalIllumination() const
GLdouble GLdouble GLdouble z
void setFogScatter(float para, fpreal perp)
virtual int getUniqueId() const
void setColor(const UT_Vector3 &c)
void setLeftBarn(float amount, float falloff)
UT_Matrix4 getAreaTransform() const
RE_LightAreaShape myAreaLightShape
RE_Texture2DMap * projectMap
GLboolean GLboolean GLboolean GLboolean a
PUGI__FN void reverse(I begin, I end)
void setDiffuse(int onoff)
RE_TextureCubeMap * myEnvMap
UT_Matrix4 & getTransform()
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLdouble GLdouble GLdouble q
unsigned long long uint64
int64 getLightVersion() const
float getFocalLength() const
UT_String myProjectMapRelativeTo
float getFogScatterPara() const
void setGlobalIllumination(bool onoff)
void getAttenuationRange(float range[2]) const
RE_ShadowMap * myShadowMap
float getFarDistance() const
void setAttenuation(float constant, float linear, float quadratic)
float getShadowIntensity() const
void setShadowIntensity(float i)
void setFocalLength(float focal)
UT_Vector3 getAreaAxes() const
float getFogScatterPerp() const
void setConeAttrib(float a=45, float d=10, float r=1)
void setShadowQuality(float q)
void setFogIntensity(float intensity)
const UT_Matrix4 & getTransform() const
float getShadowBias() const
void setOrthoWidth(float width)
const UT_StringRef & getLightLink() const
int getShadowMapSize() const
void setNormalizeArea(bool norm)
void setOrientation(const UT_Matrix3 &orient)
void setLightShadowMapSize(int s)
PXL_API const char * getName(const ColorSpace *space)
Return the name of the color space.
int getLightShadowMapSize() const
bool isPortalLight() const
void setSurfaceArea(float area)
float getConeRoll() const
GLint GLint GLsizei GLint GLenum format
void setSpecular(int onoff)
void setHeadlight(bool hl)
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
void setNearDistance(float znear)
const UT_Vector3 & getDirection() const
virtual int64 getVersion() const
float getAperture() const
RE_UniformBlockHandle myAreaBlock
GLuint const GLchar * name
void setTransform(const UT_Matrix4 &m)
void getAttenuationRampRange(float range[2]) const
int isMapProjector() const
UT_Vector3FArray myAreaPos
GLboolean GLboolean GLboolean b
GA_API const UT_StringHolder orient
RE_UniformBlockHandle myBasicLightingBlock
bool isAreaSingleSideReversed() const
GT_API const UT_StringHolder version
float getShadowQuality() const
void invalidateShadowMap(bool purge_map=false)
void setAmbient(int onoff)
void setShadowBias(float b)
float getFogIntensity() const
float getConeAngle() const
void setPortal(bool onoff)
void setLightLink(const UT_StringRef &link)
float getOrthoWidth() const
void setShadowMask(const char *m)
UT_Matrix4 myAreaTransform
void setFarDistance(float zfar)
Utility class for containing a color ramp.
void setRightBarn(float amount, float falloff)
bool isAreaSingleSided() const
UT_StringHolder myShadowMask
unsigned myAreaSingleReverse
const UT_Vector3 & getPosition() const
float getSurfaceArea() const
void assign(T xx=0.0f, T yy=0.0f)
Set the values of the vector components.
const UT_Matrix3 & getOrientation()
void setDirection(const UT_Vector3 &d)
void setLightBatchID(int id, int index)
UT_String myProjectMapName
bool SYSisEqual(const UT_Vector2T< T > &a, const UT_Vector2T< T > &b, S tol=SYS_FTOLERANCE)
Componentwise equality.
UT_Vector3FArray myAreaDir
void setShadowBlur(float b)
void setBottomBarn(float amount, float falloff)
unsigned myAreaSingleSided
void setTopBarn(float amount, float falloff)
float getConeDelta() const
void setConeTextureIndex(int idx)
GA_API const UT_StringHolder area
void setInfinite(int onoff)
void setAreaTransform(UT_Matrix4 t)
void setPosition(const UT_Vector3 &p)
float getIntensity() const
int getConeTextureIndex() const
void setEnvironment(bool onoff)
void setBoundingRadius(float radius)
RE_UniformBlockHandle myShadowBlock