Package org.sunflow.core.gi
Class IrradianceCacheGIEngine
- java.lang.Object
-
- org.sunflow.core.gi.IrradianceCacheGIEngine
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classIrradianceCacheGIEngine.Nodeprivate static classIrradianceCacheGIEngine.Sample
-
Field Summary
Fields Modifier and Type Field Description private GlobalPhotonMapInterfaceglobalPhotonMapprivate floatinvToleranceprivate floatmaxSpacingprivate floatminSpacingprivate IrradianceCacheGIEngine.Noderootprivate java.util.concurrent.locks.ReentrantReadWriteLockrwlprivate intsamplesprivate floattolerance
-
Constructor Summary
Constructors Constructor Description IrradianceCacheGIEngine()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ColorgetGlobalRadiance(ShadingState state)This is an optional method for engines that contain a secondary illumination engine which can return an approximation of the global radiance in the scene (like a photon map).ColorgetIrradiance(ShadingState state, Color diffuseReflectance)Return the incomming irradiance due to indirect diffuse illumination at the specified surface point.private ColorgetIrradiance(Point3 p, Vector3 n)booleaninit(Options options, Scene scene)Initialize the engine.private voidinsert(Point3 p, Vector3 n, float r0, Color irr)
-
-
-
Field Detail
-
samples
private int samples
-
tolerance
private float tolerance
-
invTolerance
private float invTolerance
-
minSpacing
private float minSpacing
-
maxSpacing
private float maxSpacing
-
root
private IrradianceCacheGIEngine.Node root
-
rwl
private java.util.concurrent.locks.ReentrantReadWriteLock rwl
-
globalPhotonMap
private GlobalPhotonMapInterface globalPhotonMap
-
-
Method Detail
-
init
public boolean init(Options options, Scene scene)
Description copied from interface:GIEngineInitialize the engine. This is called before rendering begins.
-
getGlobalRadiance
public Color getGlobalRadiance(ShadingState state)
Description copied from interface:GIEngineThis is an optional method for engines that contain a secondary illumination engine which can return an approximation of the global radiance in the scene (like a photon map). Engines can safely returnColor.BLACKif they can't or don't wish to support this.- Specified by:
getGlobalRadiancein interfaceGIEngine- Parameters:
state- shading state- Returns:
- color approximating global radiance
-
getIrradiance
public Color getIrradiance(ShadingState state, Color diffuseReflectance)
Description copied from interface:GIEngineReturn the incomming irradiance due to indirect diffuse illumination at the specified surface point.- Specified by:
getIrradiancein interfaceGIEngine- Parameters:
state- current render state describing the point to be computeddiffuseReflectance- diffuse albedo of the point being shaded, this can be used for importance tracking- Returns:
- irradiance from indirect diffuse illumination at the specified point
-
-