Package org.sunflow.core.photonmap
Class GridPhotonMap
- java.lang.Object
-
- org.sunflow.core.photonmap.GridPhotonMap
-
- All Implemented Interfaces:
GlobalPhotonMapInterface,PhotonStore
public class GridPhotonMap extends java.lang.Object implements GlobalPhotonMapInterface
-
-
Constructor Summary
Constructors Constructor Description GridPhotonMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowDiffuseBounced()Allow photons reflected diffusely?booleanallowReflectionBounced()Allow specularly reflected photons?booleanallowRefractionBounced()Allow refracted photons?ColorgetRadiance(Point3 p, Vector3 n)Lookup the global diffuse radiance at the specified surface point.voidinit()Initialize the map after all photons have been stored.intnumEmit()Number of photons to emit from this surface.voidprecomputeRadiance(boolean includeDirect, boolean includeCaustics)voidprepare(Options options, BoundingBox sceneBounds)Initialize this object for the specified scene size.intsize()voidstore(ShadingState state, Vector3 dir, Color power, Color diffuse)Store the specified photon.
-
-
-
Method Detail
-
prepare
public void prepare(Options options, BoundingBox sceneBounds)
Description copied from interface:PhotonStoreInitialize this object for the specified scene size.- Specified by:
preparein interfacePhotonStoresceneBounds- scene bounding box
-
size
public int size()
-
store
public void store(ShadingState state, Vector3 dir, Color power, Color diffuse)
Description copied from interface:PhotonStoreStore the specified photon.- Specified by:
storein interfacePhotonStore- Parameters:
state- shading statedir- photon directionpower- photon powerdiffuse- diffuse color at the hit point
-
init
public void init()
Description copied from interface:PhotonStoreInitialize the map after all photons have been stored. This can be used to balance a kd-tree based photon map for example.- Specified by:
initin interfacePhotonStore
-
precomputeRadiance
public void precomputeRadiance(boolean includeDirect, boolean includeCaustics)
-
getRadiance
public Color getRadiance(Point3 p, Vector3 n)
Description copied from interface:GlobalPhotonMapInterfaceLookup the global diffuse radiance at the specified surface point.- Specified by:
getRadiancein interfaceGlobalPhotonMapInterface- Parameters:
p- surface positionn- surface normal- Returns:
- an approximation of global diffuse radiance at this point
-
allowDiffuseBounced
public boolean allowDiffuseBounced()
Description copied from interface:PhotonStoreAllow photons reflected diffusely?- Specified by:
allowDiffuseBouncedin interfacePhotonStore- Returns:
trueif diffuse bounces should be traced
-
allowReflectionBounced
public boolean allowReflectionBounced()
Description copied from interface:PhotonStoreAllow specularly reflected photons?- Specified by:
allowReflectionBouncedin interfacePhotonStore- Returns:
trueif specular reflection bounces should be traced
-
allowRefractionBounced
public boolean allowRefractionBounced()
Description copied from interface:PhotonStoreAllow refracted photons?- Specified by:
allowRefractionBouncedin interfacePhotonStore- Returns:
trueif refracted bounces should be traced
-
numEmit
public int numEmit()
Description copied from interface:PhotonStoreNumber of photons to emit from this surface.- Specified by:
numEmitin interfacePhotonStore- Returns:
- number of photons
-
-