de.grogra.gpuflux.tracer
Class FluxLightModelTracer

java.lang.Object
  extended by de.grogra.persistence.ShareableBase
      extended by de.grogra.gpuflux.tracer.FluxLightModelTracer
All Implemented Interfaces:
Manageable, Shareable, ProgressMonitor

public class FluxLightModelTracer
extends ShareableBase
implements 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.
Author:
Dietger van Antwerpen

Nested Class Summary
static class FluxLightModelTracer.MeasureMode
           
static class FluxLightModelTracer.Type
           
 
Field Summary
static FluxLightModelTracer.Type $TYPE
           
static SCOType.Field cutoffPower$FIELD
           
static SCOType.Field depth$FIELD
           
static SCOType.Field dispersion$FIELD
           
static SCOType.Field enableSensors$FIELD
           
static SCOType.Field flatness$FIELD
           
static SCOType.Field importanceCurve$FIELD
           
static SCOType.Field measureMode$FIELD
           
static SCOType.Field measureObjectFilter$FIELD
           
static SCOType.Field minLambda$FIELD
           
static SCOType.Field minPower$FIELD
           
static SCOType.Field rayCount$FIELD
           
static SCOType.Field sensitivityCurves$FIELD
           
static SCOType.Field spectralBuckets$FIELD
           
static SCOType.Field targetVariance$FIELD
           
static SCOType.Field visibleLayers$FIELD
           
 
Fields inherited from interface de.grogra.ray2.ProgressMonitor
DONE_PROGRESS, INDETERMINATE_PROGRESS
 
Constructor Summary
FluxLightModelTracer()
          Creates 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
 void 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.
 Experiment getAbsorbedPower()
          Returns the experiment data on absorbed power, computed during the last call to compute()
 Spectrum3d getAbsorbedPower(Node node)
          Deprecated. 
 Measurement getAbsorbedPowerMeasurement(Node node)
          Returns the power absorbed by a node during the last call to compute()
 double getCutoffPower()
           
 int getDepth()
           
 float getFlatness()
           
 SpectralCurve getImportanceCurve()
           
 ManageableType getManageableType()
           
 int getMaxLambda()
           
 FluxLightModelTracer.MeasureMode getMeasureMode()
           
 ObjectFilter getMeasureObjectFilter()
           
 int getMinLambda()
           
 double getMinPower()
           
 int getRayCount()
           
 Experiment getSensedIrradiance()
          Returns the experiment data on sensed irradiance, computed during the last call to compute()
 Spectrum3d getSensedIrradiance(Node node)
          Deprecated. 
 Measurement getSensedIrradianceMeasurement(Node node)
          Returns the irradiance sensed by a node during the last call to compute()
 SpectralCurve[] getSensitivityCurves()
           
 int getSpectralBuckets()
           
 double getTargetVariance()
           
 boolean[] getVisibleLayers()
           
 boolean isDispersion()
           
 boolean isEnableSensors()
           
 double sampleCountToVariance(java.util.AbstractList<Light> lights, double minPower, int sampleCount)
          Returns the variance for a given sample count for one computation
 void 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(java.lang.String text, float progress)
          This method is invoked by the renderer to monitor its progress.
 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(java.lang.String message)
          This method is invoked by the renderer to show a message, e.g., the statistics after rendering has completed.
 int varianceToSampleCount(java.util.AbstractList<Light> lights, double minPower, double targetVariance)
          Returns the estimated sample count, required to achieve a given target variance for one computation
 
Methods inherited from class de.grogra.persistence.ShareableBase
addReference, appendReferencesTo, fieldModified, getProvider, getStamp, initProvider, manageableReadResolve, manageableWriteReplace, removeReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

$TYPE

public static final FluxLightModelTracer.Type $TYPE

cutoffPower$FIELD

public static final SCOType.Field cutoffPower$FIELD

depth$FIELD

public static final SCOType.Field depth$FIELD

dispersion$FIELD

public static final SCOType.Field dispersion$FIELD

enableSensors$FIELD

public static final SCOType.Field enableSensors$FIELD

flatness$FIELD

public static final SCOType.Field flatness$FIELD

importanceCurve$FIELD

public static final SCOType.Field importanceCurve$FIELD

measureMode$FIELD

public static final SCOType.Field measureMode$FIELD

measureObjectFilter$FIELD

public static final SCOType.Field measureObjectFilter$FIELD

minLambda$FIELD

public static final SCOType.Field minLambda$FIELD

minPower$FIELD

public static final SCOType.Field minPower$FIELD

rayCount$FIELD

public static final SCOType.Field rayCount$FIELD

sensitivityCurves$FIELD

public static final SCOType.Field sensitivityCurves$FIELD

spectralBuckets$FIELD

public static final SCOType.Field spectralBuckets$FIELD

targetVariance$FIELD

public static final SCOType.Field targetVariance$FIELD

visibleLayers$FIELD

public static final SCOType.Field visibleLayers$FIELD
Constructor Detail

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 computation
depth - the maximum ray depth
cutoffPower - the maximum neglectable power quantum
enableSensors - sensors are simulated if true
Method Detail

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 for getSensedIrradiance(de.grogra.graph.impl.Node) and getAbsorbedPower(de.grogra.graph.impl.Node) to return correct values.

Parameters:
forceRebuild - true forces rebuilding of the scene, otherwise the last build is reused
forceRebuild2 -
lights - list of lights for which the light distribution is computed. If null, the light distribution is computed for all lights in the scene.

getAbsorbedPower

public Experiment getAbsorbedPower()
Returns the experiment data on absorbed power, computed during the last call to compute()

Returns:
absorbed power data

getAbsorbedPower

@Deprecated
public Spectrum3d getAbsorbedPower(Node node)
Deprecated. 


getAbsorbedPowerMeasurement

public Measurement getAbsorbedPowerMeasurement(Node node)
Returns the power absorbed by a node during the last call to compute()

Parameters:
node - node for which the absorbed power is returned
Returns:
absorbed power

getCutoffPower

public double getCutoffPower()

getDepth

public int getDepth()

getFlatness

public float getFlatness()

getImportanceCurve

public SpectralCurve getImportanceCurve()

getManageableType

public ManageableType getManageableType()
Specified by:
getManageableType in interface Manageable

getMaxLambda

public int getMaxLambda()

getMeasureMode

public FluxLightModelTracer.MeasureMode getMeasureMode()

getMeasureObjectFilter

public ObjectFilter getMeasureObjectFilter()

getMinLambda

public int getMinLambda()

getMinPower

public double getMinPower()

getRayCount

public int getRayCount()

getSensedIrradiance

public Experiment getSensedIrradiance()
Returns the experiment data on sensed irradiance, computed during the last call to compute()

Returns:
sensed irradiance data

getSensedIrradiance

@Deprecated
public Spectrum3d getSensedIrradiance(Node node)
Deprecated. 


getSensedIrradianceMeasurement

public Measurement getSensedIrradianceMeasurement(Node node)
Returns the irradiance sensed by a node during the last call to compute()

Parameters:
node - node for which the absorbed power is returned
Returns:
sensed irradiance

getSensitivityCurves

public SpectralCurve[] getSensitivityCurves()

getSpectralBuckets

public int getSpectralBuckets()

getTargetVariance

public double getTargetVariance()

getVisibleLayers

public boolean[] getVisibleLayers()

isDispersion

public boolean isDispersion()

isEnableSensors

public boolean isEnableSensors()

sampleCountToVariance

public double sampleCountToVariance(java.util.AbstractList<Light> lights,
                                    double minPower,
                                    int sampleCount)
Returns the variance for a given sample count for one computation

Parameters:
lights - the list of light sources
minPower - the smallest measurable power quantum
sampleCount - the number of samples
Returns:
the variance on the smallest measurable power quantum

setCutoffPower

public void setCutoffPower(double minPower)

setDepth

public void setDepth(int depth)

setDispersion

public void setDispersion(boolean dispersion)

setEnableSensors

public void setEnableSensors(boolean enableSensors)

setFlatness

public void setFlatness(float flatness)

setImportanceCurve

public void setImportanceCurve(SpectralCurve importanceCurve)

setLayerVisible

public void setLayerVisible(int layer,
                            boolean visible)

setMeasureMode

public void setMeasureMode(FluxLightModelTracer.MeasureMode measureMode)

setMeasureObjectFilter

public void setMeasureObjectFilter(ObjectFilter measureObjectFilter)

setProgress

public void setProgress(java.lang.String text,
                        float progress)
Description copied from interface: ProgressMonitor
This method is invoked by the renderer to monitor its progress.

Specified by:
setProgress in interface ProgressMonitor
Parameters:
text - short text to display
progress - state of progress from 0 to 1, or one of the constants ProgressMonitor.INDETERMINATE_PROGRESS, ProgressMonitor.DONE_PROGRESS

setRayCount

public void setRayCount(int rayCount)

setSensitivityCurves

public void setSensitivityCurves(SpectralCurve[] sensitivityCurves)

setSpectralBuckets

public void setSpectralBuckets(int spectralBuckets)

setSpectralRange

public void setSpectralRange(int minLambda,
                             int maxLambda)

setTargetVariance

public void setTargetVariance(double minPower,
                              double targetVariance)

showMessage

public void showMessage(java.lang.String message)
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 interface ProgressMonitor
Parameters:
message - message to display

varianceToSampleCount

public int varianceToSampleCount(java.util.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 sources
minPower - the smallest measurable power quantum
targetVariance - the target variance on the smallest measurable power quantum
Returns:
the estimated number of required samples