-
public class IndirectLight.BuilderUse
Builderto construct anIndirectLightobject instance.
-
-
Constructor Summary
Constructors Constructor Description IndirectLight.Builder()Use Builderto construct anIndirectLightobject instance.
-
Method Summary
Modifier and Type Method Description IndirectLight.Builderreflections(@NonNull() Texture cubemap)Set the reflections cubemap mipmap chain. IndirectLight.Builderirradiance(@IntRange(from = 1, to = 3) int bands, @NonNull() Array<float> sh)Sets the irradiance as Spherical Harmonics. IndirectLight.Builderradiance(@IntRange(from = 1, to = 3) int bands, @NonNull() Array<float> sh)Sets the irradiance from the radiance expressed as Spherical Harmonics. IndirectLight.Builderirradiance(@NonNull() Texture cubemap)Sets the irradiance as a cubemap. IndirectLight.Builderintensity(float envIntensity)Environment intensity (optional). IndirectLight.Builderrotation(@NonNull() @Size(min = 9) Array<float> rotation)Specifies the rigid-body transformation to apply to the IBL. IndirectLightbuild(@NonNull() Engine engine)Creates the IndirectLight object and returns a pointer to it. -
-
Method Detail
-
reflections
@NonNull() IndirectLight.Builder reflections(@NonNull() Texture cubemap)
Set the reflections cubemap mipmap chain.
- Parameters:
cubemap- A mip-mapped cubemap generated by cmgen.
-
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 BRDF1/&piandspecified 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
cmgentool.The index in the
sharray 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× ClOnly 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
sharray 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 thecmgentool.- 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)
-
rotation
@NonNull() IndirectLight.Builder rotation(@NonNull() @Size(min = 9) Array<float> rotation)
Specifies the rigid-body transformation to apply to the IBL.
- Parameters:
rotation- 3x3 rotation matrix.
-
-
-
-