Class SkyboxGenerator
- Namespace
- Stride.CommunityToolkit.Skyboxes
- Assembly
- Stride.CommunityToolkit.Skyboxes.dll
Provides functionality to generate a skybox with diffuse and specular lighting parameters from a given texture.
public static class SkyboxGenerator
- Inheritance
-
SkyboxGenerator
Remarks
This class handles the conversion of a texture to a cubemap, performs spherical harmonics filtering for diffuse lighting, and prefilters the texture for specular lighting using GGX reflection. The original logic is from Stride.Assets.Skyboxes
Methods
Generate(Skybox, SkyboxGeneratorContext, Texture)
Generates a skybox using the provided texture and context, applying both diffuse and specular lighting.
public static Skybox Generate(Skybox skybox, SkyboxGeneratorContext context, Texture skyboxTexture)
Parameters
skybox
SkyboxThe skybox instance to apply the generated parameters to.
context
SkyboxGeneratorContextThe context required for rendering, which includes services and draw context.
skyboxTexture
TextureThe texture used to generate the skybox cubemap.
Returns
Remarks
The method performs the following:
- Converts the provided texture into a cubemap with a computed resolution based on the texture width.
- Applies Lambertian spherical harmonics filtering for diffuse lighting.
- Performs GGX prefiltering for specular lighting and generates a cubemap for reflection purposes.