14 #ifndef __RE_Light_H__
15 #define __RE_Light_H__
36 #define RE_SHADOW_MAX_AREA_MAPS 8
37 #define RE_SHADOW_NUM_CUBE_MAPS 6
66 clampprojectormap = 0;
68 projectormapdirty = 0;
77 unsigned mapprojector:1,
99 const char *
getName()
const {
return myName; }
102 void enable(
bool e) { flag.enabled = e; }
107 bool isLightContributing()
const;
114 {
if(p != myPos) { myPos = p; invalidateShadowMap(); }}
118 {
if(d != myDir) { myDir = d; invalidateShadowMap(); }}
120 {
if(orient != myOrientation)
121 { myOrientation =
orient; invalidateShadowMap(); }
129 void setIntensity(
float i);
157 {
return myAreaSingleReverse; }
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);
186 void setAreaSide(
bool single,
bool reverse);
189 void buildAreaShape(
int numsample);
190 void setSurfaceArea(
float area);
191 void setDiffuse(
int onoff);
192 void setSpecular(
int onoff);
195 if(myConeAngle !=
a ||
202 setCone((
a*.5 + d >= 180) ? 0 : 1);
203 invalidateShadowMap();
211 void setAttenuation(
float constant,
215 { atten[0] = myAtten[0];
216 atten[1] = myAtten[1];
217 atten[2] = myAtten[2]; }
218 void setAttenuationRange(
float near_dist,
float far_dist);
220 { range[0] = myAttenRange[0];
221 range[1] = myAttenRange[1]; }
223 void setAttenuationRamp(
const UT_Ramp *ramp,
224 float start_dist,
float end_dist);
227 { range[0] = myAttenRampStart;
228 range[1] = myAttenRampEnd; }
232 void setShadowed(
bool onoff);
238 void setShadowMapSize(
int s);
239 void setShadowMask(
const char *m);
240 void setLinearShadowMap(
bool linear);
250 {
return myLightShadowMapSize; }
251 int getNumAreaMaps()
const;
253 bool getLinearShadowMap()
const;
260 void setMultiMap(
bool m);
270 int64 getShadowMapVersion()
const;
271 void setShadowMapTime(
fpreal t);
272 fpreal getShadowMapTime()
const;
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);
288 { myFogScatterPara = para;
289 myFogScatterPerp = perp; }
291 { myFogIntensity = intensity; }
307 {
return myGLConeTextureIndex;}
309 { myGLConeTextureIndex = idx; }
313 void setProjectMap(
const char *
name,
314 const char *relativeTo);
315 void setProjectMapClamp(
int onoff);
317 void setProjectMapScale(
float sc,
bool limitres,
319 void setProjectMapMipmap(
bool onoff);
320 void setProjectMapAnisotropy(
int samples);
324 void setEnvironmentMap(
const char *
name,
325 const char *relativeTo);
327 void setEnvironmentMipmap(
bool onoff);
328 void setEnvironmentCone(
float angle);
330 float getEnvironmentCone()
const;
345 const char *light_prefix);
349 const char *light_prefix)
const;
353 const char *light_pref)
const;
386 RE_HQLightType hqLightType()
const;
388 void setLightBatchID(
int id,
int index);
393 { myLightLink = link; }
397 void invalidateShadowMap(
bool purge_map =
false);
399 void getAreaLightProjection(
UT_Matrix4 &mat)
const;
402 unsigned myContribDiff:1,
406 myAreaSingleReverse:1,
424 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
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
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 setOrientation(const UT_Matrix3 &orient)
void setLightShadowMapSize(int s)
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)
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()
const char * getName() const
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)
RE_UniformBlockHandle myShadowBlock