java.lang.Object
de.grogra.persistence.ShareableBase
de.grogra.gpuflux.imp3d.objects.LightDistribution
- All Implemented Interfaces:
LightDistributionIF,LightDistributionIF,Manageable,Shareable
- Direct Known Subclasses:
LightDistributionResource
- Author:
- Dietger van Antwerpen This object holds a discretized 2D light distribution over unit hemisphere It is used for computing the cumulative probability distribution for importance sampling The object uses the following mapping from 2D (u,v) coordinates in the discetized unit square [0,1]^2 to spherical coordinates (theta,phi) theta = u * PI phi = v * 2 * PI - PI
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LightDistribution.Typestatic final SCOType.Fieldstatic final SCOType.Fieldstatic final SCOType.Fieldstatic final SCOType.Field -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Vector2fcartesian2map(Vector3f direction) doublegetDensityAt(Vector3f direction) Returns the probability density for emitting light in the given direction (in local coordinates).double[][]intdouble[]doublegetPower()intgetWidth()static Vector3fmap2cartesian(float r1, float r2) static voidmap2cartesian(Tuple3f out, float r1, float r2) doublemap2direction(Vector3f outDirection, Tuple2d inPoint) Importance-samples an emission direction from this distribution.voidsetDistribution(double[][] lipdf) voidsetDistributionEx(double[][] lipdf) voidsetPower(double power) Methods inherited from class de.grogra.persistence.ShareableBase
addReference, appendReferencesTo, fieldModified, getProvider, getStamp, initProvider, manageableReadResolve, manageableWriteReplace, removeReference
-
Field Details
-
$TYPE
-
width$FIELD
-
height$FIELD
-
lipdf$FIELD
-
licdf$FIELD
-
-
Constructor Details
-
LightDistribution
public LightDistribution() -
LightDistribution
public LightDistribution(double[][] lipdf)
-
-
Method Details
-
getManageableType
- Specified by:
getManageableTypein interfaceManageable
-
getWidth
public int getWidth()- Specified by:
getWidthin interfaceLightDistributionIF
-
getHeight
public int getHeight()- Specified by:
getHeightin interfaceLightDistributionIF
-
getDistribution
public double[][] getDistribution()- Specified by:
getDistributionin interfaceLightDistributionIF
-
getLinearCDF
public double[] getLinearCDF()- Specified by:
getLinearCDFin interfaceLightDistributionIF
-
setDistribution
public void setDistribution(double[][] lipdf) - Specified by:
setDistributionin interfaceLightDistributionIF
-
setDistributionEx
public void setDistributionEx(double[][] lipdf) - Specified by:
setDistributionExin interfaceLightDistributionIF
-
getPower
public double getPower()- Specified by:
getPowerin interfaceLightDistributionIF
-
setPower
public void setPower(double power) - Specified by:
setPowerin interfaceLightDistributionIF
-
getDensityAt
Description copied from interface:LightDistributionIFReturns the probability density for emitting light in the given direction (in local coordinates).- Specified by:
getDensityAtin interfaceLightDistributionIF- Parameters:
direction- normalised emission direction in local space- Returns:
- density value ≥ 0
-
map2direction
Description copied from interface:LightDistributionIFImportance-samples an emission direction from this distribution.- Specified by:
map2directionin interfaceLightDistributionIF- Parameters:
outDirection- receives the sampled direction in local spaceinPoint- two uniform random numbers in [0,1)²- Returns:
- the PDF of the sampled direction
-
map2cartesian
-
map2cartesian
-
cartesian2map
-