ShaderSkySource class Lighting and environment
Draws a custom sky from a fragment shader.
The fragmentShader runs full-screen behind the scene. The engine supplies
the world-space view direction as the v_ray vertex input and owns the
full-screen draw, depth, and draw order, so you place no geometry; the
shader writes linear HDR radiance with premultiplied alpha (exposure and
tone mapping are applied later). Bind custom uniform blocks and textures by
name with setUniformBlock / setTexture; set useEnvironment to have
the engine bind the scene environment's IBL textures (prefiltered_radiance
and brdf_lut) when the shader declares them.
Unlike EnvironmentSkySource, Skybox.intensity is not applied for you;
the shader controls its own output brightness.
- Inheritance
- Implementers
Constructors
- ShaderSkySource({required Shader fragmentShader, bool useEnvironment = false})
Properties
- fragmentShader ↔ Shader
-
The full-screen sky fragment shader, typically loaded from a
.shaderbundle.getter/setter pair - hashCode → int
-
The hash code for this object.
no setterinherited
- 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 setter
-
uniformBlockNames
→ Iterable<
String> -
All currently-bound uniform block names, in insertion order.
no setter
- useEnvironment ↔ bool
-
Whether the engine binds the active environment's IBL textures
(
prefiltered_radiance,brdf_lut) when the shader declares them.getter/setter pair
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.
-
getTexture(
String name) → Texture? -
Reads back a previously-set texture binding, or
nullwhen none is set. -
getUniformBlock(
String name) → ByteData? -
Reads back a previously-set uniform block, or
nullwhen none is set. -
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
nullto clear it. -
setUniformBlock(
String name, ByteData? bytes) → void -
Assigns the byte contents of a uniform block by name.
bytesmust match the block's std140 layout; passnullto clear the binding. -
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.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited