⚠ Preview docs — built from the develop branch and may be unstable. Go to the stable docs.

Tex.CubemapLighting

SphericalHarmonics CubemapLighting{ get set }

Description

ONLY valid for cubemap textures! This is a spherical harmonics representation of the cubemap for use with StereoKit’s lighting. The first read calculates it, blocking for the result, and caches it. After new pixel content is uploaded, reads keep answering with the previous lighting while a fresh calculation runs in the background, swapping in once it’s ready. Cubemaps over 32px per face need a mip chain to answer accurately, so a raw mip-less skybox will warn and return zeroes. Generate a reflection from it with GenCubemapReflection and query that instead, since it already carries the environment’s lighting.

If you already know the lighting, from generating the cubemap yourself for example, assigning it here skips the calculation entirely. Assigning waits on a still-loading cubemap first, so the value sticks to its final content. Uploading new pixels afterwards replaces it with a calculated one, so assign after the content, not before.




Found an issue with these docs, or have some additional questions? Create an Issue on Github!