Class CausticPhotonMap

    • Field Detail

      • storedPhotons

        private int storedPhotons
      • halfStoredPhotons

        private int halfStoredPhotons
      • log2n

        private int log2n
      • gatherNum

        private int gatherNum
      • gatherRadius

        private float gatherRadius
      • filterValue

        private float filterValue
      • maxPower

        private float maxPower
      • maxRadius

        private float maxRadius
      • numEmit

        private int numEmit
    • Constructor Detail

      • CausticPhotonMap

        public CausticPhotonMap()
    • Method Detail

      • prepare

        public void prepare​(Options options,
                            BoundingBox sceneBounds)
        Description copied from interface: PhotonStore
        Initialize this object for the specified scene size.
        Specified by:
        prepare in interface PhotonStore
        sceneBounds - scene bounding box
      • balance

        private void balance()
      • balanceSegment

        private void balanceSegment​(CausticPhotonMap.Photon[] temp,
                                    int index,
                                    int start,
                                    int end)
      • swap

        private void swap​(int i,
                          int j)
      • store

        public void store​(ShadingState state,
                          Vector3 dir,
                          Color power,
                          Color diffuse)
        Description copied from interface: PhotonStore
        Store the specified photon.
        Specified by:
        store in interface PhotonStore
        Parameters:
        state - shading state
        dir - photon direction
        power - photon power
        diffuse - diffuse color at the hit point
      • init

        public void init()
        Description copied from interface: PhotonStore
        Initialize the map after all photons have been stored. This can be used to balance a kd-tree based photon map for example.
        Specified by:
        init in interface PhotonStore
      • allowDiffuseBounced

        public boolean allowDiffuseBounced()
        Description copied from interface: PhotonStore
        Allow photons reflected diffusely?
        Specified by:
        allowDiffuseBounced in interface PhotonStore
        Returns:
        true if diffuse bounces should be traced
      • allowReflectionBounced

        public boolean allowReflectionBounced()
        Description copied from interface: PhotonStore
        Allow specularly reflected photons?
        Specified by:
        allowReflectionBounced in interface PhotonStore
        Returns:
        true if specular reflection bounces should be traced
      • allowRefractionBounced

        public boolean allowRefractionBounced()
        Description copied from interface: PhotonStore
        Allow refracted photons?
        Specified by:
        allowRefractionBounced in interface PhotonStore
        Returns:
        true if refracted bounces should be traced
      • numEmit

        public int numEmit()
        Description copied from interface: PhotonStore
        Number of photons to emit from this surface.
        Specified by:
        numEmit in interface PhotonStore
        Returns:
        number of photons