PreprocessedSky class Lighting and environment

A sky driven by a .fmat sky shader (sky { vec3 Sky(vec3 direction) }) and its sidecar metadata (produced at build time by buildMaterials).

Wraps the compiled sky fragment as a ShaderSkySource and exposes typed, name-addressed parameters from the sidecar, set the same way as a PreprocessedMaterial's:

final sky = await loadFmatSky('assets/gradient_sky.fmat');
sky.parameters.setColor('zenith_color', const Color(0xff2255cc));
scene.skybox = Skybox(sky);

Loaded via loadFmatSky, which registers it for in-place hot reload so a .fmat edit shows up without a restart.

Inheritance

Constructors

PreprocessedSky({required Shader fragmentShader, required Map<String, Object?> metadata})

Properties

fragmentShader Shader
The full-screen sky fragment shader, typically loaded from a .shaderbundle.
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
parameters MaterialParameters
The sky's parameters, set by name. See MaterialParameters.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
textureNames Iterable<String>
All currently-bound sampler names, in insertion order.
no setterinherited
uniformBlockNames Iterable<String>
All currently-bound uniform block names, in insertion order.
no setterinherited
useEnvironment bool
Whether the engine binds the active environment's IBL textures (prefiltered_radiance, brdf_lut) when the shader declares them.
getter/setter pairinherited

Methods

bind(RenderPass pass, HostBuffer transientsBuffer, EnvironmentMap environment) → void
Binds the fragment's uniform blocks, textures, and (when useEnvironment) the environment IBL samplers. Called by the engine during the background draw; not part of the app-facing API.
override
getTexture(String name) Texture?
Reads back a previously-set texture binding, or null when none is set.
inherited
getUniformBlock(String name) ByteData?
Reads back a previously-set uniform block, or null when none is set.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setTexture(String name, Texture? texture, {SamplerOptions? sampler}) → void
Assigns a texture to a sampler uniform by name. Pass null to clear it.
inherited
setUniformBlock(String name, ByteData? bytes) → void
Assigns the byte contents of a uniform block by name. bytes must match the block's std140 layout; pass null to clear the binding.
inherited
setUniformBlockFromFloats(String name, List<double> floats) → void
Convenience wrapper around setUniformBlock that packs a list of floats. The caller is still responsible for std140 padding.
inherited
toString() String
A string representation of this object.
inherited
updateFromMetadata(Shader fragmentShader, Map<String, Object?> metadata) → void
Re-reads render state and parameters from a regenerated fragmentShader and sidecar metadata in place, preserving explicitly-set parameter values.

Operators

operator ==(Object other) bool
The equality operator.
inherited