Tex.GenCubemapReflection
static Tex GenCubemapReflection(Tex sourceCubemap, Tex into, int maxResolution)
Generates a specular reflection cubemap from an
environment cubemap: a GGX convolved mip chain suitable for
Lighting.Reflection. Skybox cubemaps carry only raw radiance at
mip 0, so reflections must be generated from them here. The
result also carries the environment’s lighting data, ready in
CubemapLighting as soon as the reflection finishes loading.
This is asynchronous: a still-loading source returns a pending
texture right away, and generates when the load finishes. If the
source fails to load, a new result switches to the error
fallback, while a reused into keeps its previous
content.
| Tex sourceCubemap | The environment cubemap to convolve. It does not need to be loaded yet, generation chains off the load. |
| Tex into | When null, a new reflection texture is created. Otherwise this should be a reflection cubemap from an earlier call, whose contents are regenerated from the source, the fast path for frequently updated environments. The source itself is not a valid destination. |
| int maxResolution | Cap for the reflection texture’s face resolution when a new texture is created. Reflection data is low frequency, so this can stay small. |
| RETURNS: Tex | The reflection cubemap, or null on failure. |
Found an issue with these docs, or have some additional questions? Create an Issue on Github!