org.sunflow.core.photonmap
Class GlobalPhotonMap
java.lang.Object
org.sunflow.core.photonmap.GlobalPhotonMap
- GlobalPhotonMapInterface, PhotonStore
public final class GlobalPhotonMap
extends java.lang.Object
GlobalPhotonMap
public GlobalPhotonMap(int numEmit,
int numGather,
float gatherRadius)
allowDiffuseBounced
public boolean allowDiffuseBounced()
Allow photons reflected diffusely?
- allowDiffuseBounced in interface PhotonStore
true
if diffuse bounces should be traced
allowReflectionBounced
public boolean allowReflectionBounced()
Allow specularly reflected photons?
- allowReflectionBounced in interface PhotonStore
true
if specular reflection bounces should be
traced
allowRefractionBounced
public boolean allowRefractionBounced()
Allow refracted photons?
- allowRefractionBounced in interface PhotonStore
true
if refracted bounces should be traced
init
public void init()
Initialize the map after all photons have been stored. This can be used
to balance a kd-tree based photon map for example.
- init in interface PhotonStore
numEmit
public int numEmit()
Number of photons to emit from this surface.
- numEmit in interface PhotonStore
precomputeRadiance
public void precomputeRadiance()
prepare
public void prepare(BoundingBox sceneBounds)
Initialize this object for the specified scene size.
- prepare in interface PhotonStore
sceneBounds
- scene bounding box
store
public void store(ShadingState state,
Vector3 dir,
Color power,
Color diffuse)
Store the specified photon.
- store in interface PhotonStore
state
- shading statedir
- photon directionpower
- photon powerdiffuse
- diffuse color at the hit point