Module gpuFlux

Class FluxLightModelTracer

java.lang.Object
de.grogra.persistence.ShareableBase
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.
Version:
1.5
Author:
Dietger van Antwerpen <dietger@xs4all.nl>
  • Field Details

    • $TYPE

      public static final FluxLightModelTracer.Type $TYPE
    • measureObjectFilter$FIELD

      public static final SCOType.Field measureObjectFilter$FIELD
    • visibleLayers$FIELD

      public static final SCOType.Field visibleLayers$FIELD
    • flatness$FIELD

      public static final SCOType.Field flatness$FIELD
    • minPower$FIELD

      public static final SCOType.Field minPower$FIELD
    • targetVariance$FIELD

      public static final SCOType.Field targetVariance$FIELD
    • cutoffPower$FIELD

      public static final SCOType.Field cutoffPower$FIELD
    • depth$FIELD

      public static final SCOType.Field depth$FIELD
    • randomseed$FIELD

      public static final SCOType.Field randomseed$FIELD
    • rayCount$FIELD

      public static final SCOType.Field rayCount$FIELD
    • enableSensors$FIELD

      public static final SCOType.Field enableSensors$FIELD
    • measureMode$FIELD

      public static final SCOType.Field measureMode$FIELD
    • minLambda$FIELD

      public static final SCOType.Field minLambda$FIELD
    • spectralBuckets$FIELD

      public static final SCOType.Field spectralBuckets$FIELD
    • importanceCurve$FIELD

      public static final SCOType.Field importanceCurve$FIELD
    • sensitivityCurves$FIELD

      public static final SCOType.Field sensitivityCurves$FIELD
    • dispersion$FIELD

      public static final SCOType.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 computation
      depth - the maximum ray depth
      cutoffPower - the maximum neglectable power quantum
      enableSensors - sensors are simulated if true
  • Method Details

    • getManageableType

      public ManageableType getManageableType()
      Specified by:
      getManageableType in interface Manageable
    • 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

      public ObjectFilter getMeasureObjectFilter()
    • getVisibleLayers

      public boolean[] getVisibleLayers()
    • getMeasureMode

      public FluxLightModelTracer.MeasureMode getMeasureMode()
    • getImportanceCurve

      public SpectralCurve getImportanceCurve()
    • getSensitivityCurves

      public SpectralCurve[] 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

      public void setSensitivityCurves(SpectralCurve[] sensitivityCurves)
    • setImportanceCurve

      public void setImportanceCurve(SpectralCurve importanceCurve)
    • setSpectralBuckets

      public void setSpectralBuckets(int spectralBuckets)
    • setMeasureMode

      public void setMeasureMode(FluxLightModelTracer.MeasureMode measureMode)
    • 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 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.
    • getSensedIrradiance

      @Deprecated public Spectrum3d getSensedIrradiance(Node node)
      Deprecated.
    • getAbsorbedPower

      @Deprecated public Spectrum3d getAbsorbedPower(Node node)
      Deprecated.
    • getSensedIrradiance

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

      public Experiment getAbsorbedPower()
      Returns the experiment data on absorbed power, computed during the last call to compute()
      Returns:
      absorbed power data
    • 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
    • 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
    • setProgress

      public void setProgress(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
    • showMessage

      public void showMessage(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
    • setMeasureObjectFilter

      public void setMeasureObjectFilter(ObjectFilter measureObjectFilter)
    • 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 sources
      minPower - the smallest measurable power quantum
      targetVariance - the target variance on the smallest measurable power quantum
      Returns:
      the estimated number of required samples
    • sampleCountToVariance

      public double sampleCountToVariance(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
    • 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)