Package 

Class IndirectLight.Builder

    • Constructor Detail

      • IndirectLight.Builder

        IndirectLight.Builder()
        Use Builder to construct an IndirectLight object instance.
    • Method Detail

      • irradiance

        @NonNull() IndirectLight.Builder irradiance(@IntRange(from = 1, to = 3) int bands, @NonNull() Array<float> sh)

        Sets the irradiance as Spherical Harmonics.

        The irradiance coefficients must be pre-convolved by < n &sdot l > andpre-multiplied by the Lambertian diffuse BRDF 1/&pi andspecified as Spherical Harmonics coefficients.

        Additionally, these Spherical Harmonics coefficients must be pre-scaled by thereconstruction factors Al,m.

        The final coefficients can be generated using the cmgen tool.

        The index in the sh array is given by:index(l, m) = 3 × (l * (l + 1) + m)sh[index(l,m) + 0] = LRl,m× 1/&pi× Al,m× Clsh[index(l,m) + 1] = LGl,m× 1/&pi× Al,m× Clsh[index(l,m) + 2] = LBl,m× 1/&pi× Al,m× Cl

        Only 1, 2 or 3 bands are allowed.

        Because the coefficients are pre-scaled, sh[0] is the environment'saverage irradiance.

        Parameters:
        bands - Number of spherical harmonics bands.
        sh - Array containing the spherical harmonics coefficients.
      • radiance

        @NonNull() IndirectLight.Builder radiance(@IntRange(from = 1, to = 3) int bands, @NonNull() Array<float> sh)

        Sets the irradiance from the radiance expressed as Spherical Harmonics.

        The radiance must be specified as Spherical Harmonics coefficients Ll,m, whereeach coefficient is comprised of three floats for red, green and blue components, respectively

        The index in the sh array is given by:index(l, m) = 3 × (l * (l + 1) + m)sh[index(l,m) + 0] = LRl,msh[index(l,m) + 1] = LGl,msh[index(l,m) + 2] = LBl,m

        Parameters:
        bands - Number of spherical harmonics bands.
        sh - Array containing the spherical harmonics coefficients.
      • irradiance

        @NonNull() IndirectLight.Builder irradiance(@NonNull() Texture cubemap)

        Sets the irradiance as a cubemap.

        The irradiance can alternatively be specified as a cubemap instead of SphericalHarmonics coefficients. It may or may not be more efficient, depending on yourhardware (essentially, it's trading ALU for bandwidth).This irradiance cubemap can be generated with the cmgen tool.
        Parameters:
        cubemap - Cubemap representing the Irradiance pre-convolved by< n &sdot l >.
      • intensity

        @NonNull() IndirectLight.Builder intensity(float envIntensity)

        Environment intensity (optional).

        Because the environment is encoded usually relative to some reference, therange can be adjusted with this method.

        Parameters:
        envIntensity - Scale factor applied to the environment and irradiance such thatthe result is in lux, or lumen/m^2 (default = 30000)