org.sunflow.core.photonmap
Class GridPhotonMap
java.lang.Object
org.sunflow.core.photonmap.GridPhotonMap
- GlobalPhotonMapInterface, PhotonStore
public class GridPhotonMap
extends java.lang.Object
GridPhotonMap
public GridPhotonMap(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
getRadiance
public Color getRadiance(Point3 p,
Vector3 n)
Lookup the global diffuse radiance at the specified surface point.
- getRadiance in interface GlobalPhotonMapInterface
p
- surface positionn
- surface normal
- an approximation of global diffuse radiance at this point
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(boolean includeDirect,
boolean includeCaustics)
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