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 setNormalizeArea(
bool norm);
192 void setDiffuse(
int onoff);
193 void setSpecular(
int onoff);
196 if(myConeAngle !=
a ||
203 setCone((
a*.5 + d >= 180) ? 0 : 1);
204 invalidateShadowMap();
212 void setAttenuation(
float constant,
216 { atten[0] = myAtten[0];
217 atten[1] = myAtten[1];
218 atten[2] = myAtten[2]; }
219 void setAttenuationRange(
float near_dist,
float far_dist);
221 { range[0] = myAttenRange[0];
222 range[1] = myAttenRange[1]; }
224 void setAttenuationRamp(
const UT_Ramp *ramp,
225 float start_dist,
float end_dist);
228 { range[0] = myAttenRampStart;
229 range[1] = myAttenRampEnd; }
233 void setShadowed(
bool onoff);
239 void setShadowMapSize(
int s);
240 void setShadowMask(
const char *m);
241 void setLinearShadowMap(
bool linear);
251 {
return myLightShadowMapSize; }
252 int getNumAreaMaps()
const;
254 bool getLinearShadowMap()
const;
261 void setMultiMap(
bool m);
271 int64 getShadowMapVersion()
const;
272 void setShadowMapTime(
fpreal t);
273 fpreal getShadowMapTime()
const;
277 void setZoom(
float z);
278 void setFocalLength(
float focal);
279 void setAperture(
float aper);
280 void setOrthoWidth(
float width);
281 void setNearDistance(
float znear);
282 void setFarDistance(
float zfar);
283 void setLeftBarn(
float amount,
float falloff);
284 void setRightBarn(
float amount,
float falloff);
285 void setTopBarn(
float amount,
float falloff);
286 void setBottomBarn(
float amount,
float falloff);
289 { myFogScatterPara = para;
290 myFogScatterPerp = perp; }
292 { myFogIntensity = intensity; }
308 {
return myGLConeTextureIndex;}
310 { myGLConeTextureIndex = idx; }
314 void setProjectMap(
const char *
name,
315 const char *relativeTo);
316 void setProjectMapClamp(
int onoff);
318 void setProjectMapScale(
float sc,
bool limitres,
320 void setProjectMapMipmap(
bool onoff);
321 void setProjectMapAnisotropy(
int samples);
325 void setEnvironmentMap(
const char *
name,
326 const char *relativeTo);
328 void setEnvironmentMipmap(
bool onoff);
329 void setEnvironmentCone(
float angle);
331 float getEnvironmentCone()
const;
346 const char *light_prefix);
350 const char *light_prefix)
const;
354 const char *light_pref)
const;
387 RE_HQLightType hqLightType()
const;
389 void setLightBatchID(
int id,
int index);
394 { myLightLink = link; }
398 void invalidateShadowMap(
bool purge_map =
false);
400 void getAreaLightProjection(
UT_Matrix4 &mat)
const;
403 unsigned myContribDiff:1,
407 myAreaSingleReverse:1,
426 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 setNormalizeArea(bool norm)
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