- All Implemented Interfaces:
Raytraceable,Light,Scattering,Manageable,Shareable,Emitter,Light,Scattering
innerAngle have a maximal intensity, the intensity falls
off to zero when the angle reaches outerAngle. The fall-off
is governed by a cubic spline: Let
outerAngle)
/ (cos innerAngle - cos outerAngle)
- Author:
- Ole Kniemeyer
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SpotLight.Typestatic final SCOType.Fieldstatic final SCOType.FieldFields inherited from class de.grogra.imp3d.objects.PointLight
attenuationDistance$FIELD, attenuationExponent$FIELD, power$FIELDFields inherited from class de.grogra.imp3d.objects.LightBase
color, color$FIELD, numberofrays, numberofrays$FIELD, raylength, raylength$FIELD, shadowless$FIELD, visualize, visualize$FIELDFields inherited from interface de.grogra.ray.physics.Light
AMBIENT, AREA, DIRECTIONAL, NO_LIGHT, POINT, SKYFields inherited from interface de.grogra.ray.physics.Scattering
DELTA_FACTOR, IS_NON_OPAQUE, MIN_UNUSED_FLAG, NEEDS_NORMAL, NEEDS_POINT, NEEDS_TANGENTS, NEEDS_TRANSFORMATION, NEEDS_UV, RANDOM_RAYS_GENERATE_ORIGINS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(LightVisitor visitor) createRaytracerLeaf(Object object, boolean asNode, long pathId, GraphState gs) protected voiddraw(Tuple3f color, RenderState rs) voidgenerateRandomRays(Environment env, Vector3f out, Spectrum specOut, RayList rays, boolean photon, Random rnd) Pseudorandomly generates, for the given input, a set of scattered rays.protected floatgetDensityAt(Vector3f direction) floatfloatvoidsetInnerAngle(float value) voidsetOuterAngle(float value) Methods inherited from class de.grogra.imp3d.objects.PointLight
computeBSDF, computeExitance, generateRandomOrigins, getAttenuationDistance, getAttenuationExponent, getLightType, getPower, getTotalPower, setAttenuationDistance, setAttenuationExponent, setPowerMethods inherited from class de.grogra.imp3d.objects.LightBase
completeRay, getAverageColor, getColor, getFlags, getNumberofrays, getRaylength, isIgnoredWhenHit, isShadowless, isVisualize, resolveLight, setColor, setNumberofrays, setRaylength, setShadowless, setVisualizeMethods inherited from class de.grogra.persistence.ShareableBase
addReference, appendReferencesTo, fieldModified, getProvider, getStamp, initProvider, manageableReadResolve, manageableWriteReplace, removeReference
-
Field Details
-
$TYPE
-
innerAngle$FIELD
-
outerAngle$FIELD
-
-
Constructor Details
-
SpotLight
public SpotLight()
-
-
Method Details
-
getManageableType
- Specified by:
getManageableTypein interfaceManageable- Overrides:
getManageableTypein classPointLight
-
getInnerAngle
public float getInnerAngle() -
setInnerAngle
public void setInnerAngle(float value) -
getOuterAngle
public float getOuterAngle() -
setOuterAngle
public void setOuterAngle(float value) -
draw
- Overrides:
drawin classPointLight
-
generateRandomRays
public void generateRandomRays(Environment env, Vector3f out, Spectrum specOut, RayList rays, boolean photon, Random rnd) Description copied from interface:ScatteringPseudorandomly generates, for the given input, a set of scattered rays. The scattered rays are generated such that they can be used for a Monte Carlo integration of a function f(ω;ν) over cos θ BSDF(ωi, νi; ωo, νo) in the following way:-
If
adjointisfalse,out= ωo describes the direction of an outgoing light ray. In this case, the integration is with respect to ωi. Let g(ω, ν;out, μ) = BSDF(ω, ν;out, μ) -
Otherwise,
adjointistrue. In this case,out= ωi describes the direction of an outgoing importance ray (an inverse light ray). Now the integration is with respect to ωo. Let g(ω, ν;out, μ) = BSDF(out, μ; ω, ν)
rays.size). Then, for every frequency ν the sum1 / N ∑i si(ν) f(di; ν) is an unbiased estimate for the integral∫ cos θ f(ω; ν) g(ω, ν; θ is the angle between the surface normal and ω. The domain of integration is the whole sphere, since the bidirectional scattering distribution includes both reflection and transmission (BSDF = BRDF + BTDF).out, μ)specOut(μ) dμ dωIf this
Scatteringinstance is in fact aLightsource,adjointistrue, and the BSDF is defined as BSDF(out, μ; ω, ν) = L1(ω, ν) δ(μ - ν), i.e., the directional distribution of the emitted radiance atenv.point, seeEmitter. In this case,outis not used.If this
Scatteringinstance is in fact aSensor,adjointisfalse, and the BSDF is defined as BSDF(ω, ν;out, μ) = W1(ω, ν) δ(μ - ν), i.e., the directional distribution of the emitted importance atenv.point, seeEmitter. In this case,outis not used.Let pω be the probability density used for the ray direction (measured with respect to solid angle ω), then the field
directionDensityof the ray i is set to pω(di). For ideal specular reflection or transmission, or for directional lights or sensors, pω is not a regular function, the valuedirectionDensitywill be set to a multiple ofScattering.DELTA_FACTOR.The ray properties which are not mentioned in the given formulas are neither used nor modified. These are the origin and its density.
- Specified by:
generateRandomRaysin interfaceScattering- Overrides:
generateRandomRaysin classPointLight- Parameters:
env- the environment for scatteringout- the direction unit vector of the outgoing ray (i.e., pointing away from the surface)specOut- the spectrum of the outgoing rayrays- the rays to be generatedphoton- representsouta light ray or an importance ray?rnd- pseudorandom generator- See Also:
-
If
-
getDensityAt
- Overrides:
getDensityAtin classPointLight
-
createRaytracerLeaf
- Specified by:
createRaytracerLeafin interfaceRaytraceable- Overrides:
createRaytracerLeafin classPointLight
-
accept
- Specified by:
acceptin interfaceLight- Overrides:
acceptin classPointLight
-