Package org.sunflow.core.photonmap
Class GlobalPhotonMap
java.lang.Object
org.sunflow.core.photonmap.GlobalPhotonMap
- All Implemented Interfaces:
GlobalPhotonMapInterface,PhotonStore
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAllow photons reflected diffusely?booleanAllow specularly reflected photons?booleanAllow refracted photons?getRadiance(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.voidvoidprepare(Options options, BoundingBox sceneBounds) Initialize this object for the specified scene size.voidstore(ShadingState state, Vector3 dir, Color power, Color diffuse) Store the specified photon.
-
Constructor Details
-
GlobalPhotonMap
public GlobalPhotonMap()
-
-
Method Details
-
prepare
Description copied from interface:PhotonStoreInitialize this object for the specified scene size.- Specified by:
preparein interfacePhotonStore- Parameters:
sceneBounds- scene bounding box
-
store
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() -
getRadiance
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
-