java.lang.Object
de.grogra.persistence.ShareableBase
de.grogra.gpuflux.tracer.FluxLightModelTracer
- All Implemented Interfaces:
Manageable
,Shareable
,ProgressMonitor
- Since:
- 2011.0722 FluxLightModel is a light transport model. For a given list of light sources, it performs experiments on a scene in order to compute the total absorbed power and sensed irradiance by objects and sensors in a scene.
- Version:
- 1.5
- Author:
- Dietger van Antwerpen <dietger@xs4all.nl>
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final FluxLightModelTracer.Type
static final SCOType.Field
static final SCOType.Field
static final SCOType.Field
static final SCOType.Field
static final SCOType.Field
static final SCOType.Field
static final SCOType.Field
static final SCOType.Field
static final SCOType.Field
static final SCOType.Field
static final SCOType.Field
static final SCOType.Field
static final SCOType.Field
static final SCOType.Field
static final SCOType.Field
static final SCOType.Field
Fields inherited from interface de.grogra.util.ProgressMonitor
ALL, DONE_PROGRESS, I18N, INDETERMINATE_PROGRESS, INTERMEDIATE, LEVEL, NONE
-
Constructor Summary
ConstructorDescriptionCreates a default light model with 30.000 rays per computation and a ray depth of 10.FluxLightModelTracer
(int rayCount, int depth, double cutoffPower, boolean enableSensors) Creates a light model -
Method Summary
Modifier and TypeMethodDescriptionvoid
build()
(Re-)builds a scene from the current graph.void
compute()
void
compute
(boolean forceCompute, boolean forceRebuild) (Re-)computes the light distribution in the current graph.Returns the experiment data on absorbed power, computed during the last call tocompute()
getAbsorbedPower
(Node node) Deprecated.Returns the power absorbed by a node during the last call tocompute()
double
int
getDepth()
float
int
int
double
int
int
Returns the experiment data on sensed irradiance, computed during the last call tocompute()
getSensedIrradiance
(Node node) Deprecated.Returns the irradiance sensed by a node during the last call tocompute()
int
double
boolean[]
boolean
boolean
double
sampleCountToVariance
(AbstractList<Light> lights, double minPower, int sampleCount) Returns the variance for a given sample count for one computationvoid
setCutoffPower
(double minPower) void
setDepth
(int depth) void
setDispersion
(boolean dispersion) void
setEnableSensors
(boolean enableSensors) void
setFlatness
(float flatness) void
setImportanceCurve
(SpectralCurve importanceCurve) void
setLayerVisible
(int layer, boolean visible) void
setMeasureMode
(FluxLightModelTracer.MeasureMode measureMode) void
setMeasureObjectFilter
(ObjectFilter measureObjectFilter) void
setProgress
(String text, float progress) This method is invoked by the renderer to monitor its progress.void
setRandomseed
(int seed) void
setRayCount
(int rayCount) void
setSensitivityCurves
(SpectralCurve[] sensitivityCurves) void
setSpectralBuckets
(int spectralBuckets) void
setSpectralRange
(int minLambda, int maxLambda) void
setTargetVariance
(double minPower, double targetVariance) void
showMessage
(String message) This method is invoked by the renderer to show a message, e.g., the statistics after rendering has completed.int
varianceToSampleCount
(AbstractList<Light> lights, double minPower, double targetVariance) Returns the estimated sample count, required to achieve a given target variance for one computationMethods inherited from class de.grogra.persistence.ShareableBase
addReference, appendReferencesTo, fieldModified, getProvider, getStamp, initProvider, manageableReadResolve, manageableWriteReplace, removeReference
-
Field Details
-
$TYPE
-
measureObjectFilter$FIELD
-
visibleLayers$FIELD
-
flatness$FIELD
-
minPower$FIELD
-
targetVariance$FIELD
-
cutoffPower$FIELD
-
depth$FIELD
-
randomseed$FIELD
-
rayCount$FIELD
-
enableSensors$FIELD
-
measureMode$FIELD
-
minLambda$FIELD
-
spectralBuckets$FIELD
-
importanceCurve$FIELD
-
sensitivityCurves$FIELD
-
dispersion$FIELD
-
-
Constructor Details
-
FluxLightModelTracer
public FluxLightModelTracer()Creates a default light model with 30.000 rays per computation and a ray depth of 10. -
FluxLightModelTracer
public FluxLightModelTracer(int rayCount, int depth, double cutoffPower, boolean enableSensors) Creates a light model- Parameters:
rayCount
- the number of samples per computationdepth
- the maximum ray depthcutoffPower
- the maximum neglectable power quantumenableSensors
- sensors are simulated if true
-
-
Method Details
-
getManageableType
- Specified by:
getManageableType
in interfaceManageable
-
isEnableSensors
public boolean isEnableSensors() -
isDispersion
public boolean isDispersion() -
getDepth
public int getDepth() -
getRandomseed
public int getRandomseed() -
getRayCount
public int getRayCount() -
getMinLambda
public int getMinLambda() -
getSpectralBuckets
public int getSpectralBuckets() -
getFlatness
public float getFlatness() -
getMinPower
public double getMinPower() -
getTargetVariance
public double getTargetVariance() -
getCutoffPower
public double getCutoffPower() -
getMeasureObjectFilter
-
getVisibleLayers
public boolean[] getVisibleLayers() -
getMeasureMode
-
getImportanceCurve
-
getSensitivityCurves
-
setEnableSensors
public void setEnableSensors(boolean enableSensors) -
setCutoffPower
public void setCutoffPower(double minPower) -
setDepth
public void setDepth(int depth) -
setRandomseed
public void setRandomseed(int seed) -
setRayCount
public void setRayCount(int rayCount) -
setSensitivityCurves
-
setImportanceCurve
-
setSpectralBuckets
public void setSpectralBuckets(int spectralBuckets) -
setMeasureMode
-
setSpectralRange
public void setSpectralRange(int minLambda, int maxLambda) -
build
public void build()(Re-)builds a scene from the current graph. This scene is than used in#conpute
-
compute
public void compute() -
compute
public void compute(boolean forceCompute, boolean forceRebuild) (Re-)computes the light distribution in the current graph. This method has to be invoked at first in order forgetSensedIrradiance(de.grogra.graph.impl.Node)
andgetAbsorbedPower(de.grogra.graph.impl.Node)
to return correct values.- Parameters:
forceRebuild
- true forces rebuilding of the scene, otherwise the last build is reusedforceRebuild2
-lights
- list of lights for which the light distribution is computed. If null, the light distribution is computed for all lights in the scene.
-
getSensedIrradiance
Deprecated. -
getAbsorbedPower
Deprecated. -
getSensedIrradiance
Returns the experiment data on sensed irradiance, computed during the last call tocompute()
- Returns:
- sensed irradiance data
-
getAbsorbedPower
Returns the experiment data on absorbed power, computed during the last call tocompute()
- Returns:
- absorbed power data
-
getSensedIrradianceMeasurement
Returns the irradiance sensed by a node during the last call tocompute()
- Parameters:
node
- node for which the absorbed power is returned- Returns:
- sensed irradiance
-
getAbsorbedPowerMeasurement
Returns the power absorbed by a node during the last call tocompute()
- Parameters:
node
- node for which the absorbed power is returned- Returns:
- absorbed power
-
setProgress
Description copied from interface:ProgressMonitor
This method is invoked by the renderer to monitor its progress.- Specified by:
setProgress
in interfaceProgressMonitor
- Parameters:
text
- short text to displayprogress
- state of progress from 0 to 1, or one of the constantsProgressMonitor.INDETERMINATE_PROGRESS
,ProgressMonitor.DONE_PROGRESS
-
showMessage
Description copied from interface:ProgressMonitor
This method is invoked by the renderer to show a message, e.g., the statistics after rendering has completed.- Specified by:
showMessage
in interfaceProgressMonitor
- Parameters:
message
- message to display
-
setMeasureObjectFilter
-
varianceToSampleCount
public int varianceToSampleCount(AbstractList<Light> lights, double minPower, double targetVariance) Returns the estimated sample count, required to achieve a given target variance for one computation- Parameters:
lights
- the list of light sourcesminPower
- the smallest measurable power quantumtargetVariance
- the target variance on the smallest measurable power quantum- Returns:
- the estimated number of required samples
-
sampleCountToVariance
Returns the variance for a given sample count for one computation- Parameters:
lights
- the list of light sourcesminPower
- the smallest measurable power quantumsampleCount
- the number of samples- Returns:
- the variance on the smallest measurable power quantum
-
setTargetVariance
public void setTargetVariance(double minPower, double targetVariance) -
setDispersion
public void setDispersion(boolean dispersion) -
setFlatness
public void setFlatness(float flatness) -
getMaxLambda
public int getMaxLambda() -
setLayerVisible
public void setLayerVisible(int layer, boolean visible)
-