ComposedShadeStyle

A shade style made of members that are applied in order, made with a + b or composeShadeStyles. Every member keeps its own namespace: its parameters, buffers and images, and the functions, variables, structs and macros declared in its preambles are prefixed with s<index>_, so members can use the same names, and the same shade style can be a member more than once. The transforms of the members are applied in order, each in its own scope, x_fill and the other x_ values flow from one member to the next.

Changes to the members are used by the composition: values of parameters directly, changes of structure when the composition is drawn next.

Parameters set on the composition itself are not namespaced, members read them under their own names when they do not have a parameter with that name. Shade style filters set their fill and inputs this way.

Constructors

Link copied to clipboard
constructor(members: List<ShadeStyle>)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val buffers: MutableMap<String, String>
Link copied to clipboard
open override val bufferTypes: MutableMap<String, String>
Link copied to clipboard
open override var bufferValues: MutableMap<String, Any>
Link copied to clipboard
open override var dirty: Boolean

Is the structure of this shade style changed since its shaders were generated?

Link copied to clipboard

Represents an optional preamble string for a shader's fragment stage. This property allows customization of the initial setup or definitions that precede main shader code for the fragment stage.

Link copied to clipboard

Specifies the transformation applied to the fragment shader stage. This property holds an optional string value which represents the GLSL code or expressions defining the transformation logic. When the value of this property is changed, the dirty flag is set to true, indicating that the shader needs to be recompiled or updated.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val imageArrayLength: MutableMap<String, Int>
Link copied to clipboard
open override val imageBindings: MutableMap<String, Int>
Link copied to clipboard
open override val imageFlags: MutableMap<String, Set<ImageFlag>>
Link copied to clipboard
open override val imageTypes: MutableMap<String, String>
Link copied to clipboard
open override val imageValues: MutableMap<String, Array<out ImageBinding>>
Link copied to clipboard

The GLSL libraries the code of this shade style uses, their code is emitted before the preambles of the stages that read their names

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override var parameterValues: MutableMap<String, Any>
Link copied to clipboard

Counts the changes of the structure of this shade style: its code, parameter types and outputs

Link copied to clipboard
Link copied to clipboard
open override var textureBaseIndex: Int
Link copied to clipboard

Represents the preamble for vertex shading code in the shade style. This property is used to define custom vertex processing logic and, when modified, marks the state as dirty to trigger a necessary update.

Link copied to clipboard

Specifies a transformation applied to the vertex shader in the form of a string.

Functions

Link copied to clipboard
fun attributes(attributesBuffer: VertexBuffer)
Link copied to clipboard
open fun buffer(name: String, buffer: AtomicCounterBuffer)
@JvmName(name = "bufferCommand")
open fun buffer(name: String, buffer: CommandBuffer<Command>)
@JvmName(name = "bufferIndexedCommand")
open fun buffer(name: String, buffer: CommandBuffer<IndexedCommand>)
open fun buffer(name: String, buffer: IndexBuffer)
open fun buffer(name: String, buffer: ShaderStorageBuffer)
Link copied to clipboard
open fun image(name: String, values: Array<out ImageBinding>)
open fun image(name: String, value: ImageBinding)
open fun image(name: String, arrayTextures: Array<ArrayTexture>, levels: Array<Int> = Array(arrayTextures.size) { 0 })
open fun image(name: String, colorBuffers: Array<ColorBuffer>, levels: Array<Int> = Array(colorBuffers.size) { 0 })
open fun image(name: String, cubemaps: Array<Cubemap>, levels: Array<Int> = Array(cubemaps.size) { 0 })
open fun image(name: String, volumeTextures: Array<VolumeTexture>, levels: Array<Int> = Array(volumeTextures.size) { 0 })
open fun image(name: String, arrayTexture: ArrayTexture, level: Int = 0)
open fun image(name: String, colorBuffer: ColorBuffer, level: Int = 0)
open fun image(name: String, cubemap: Cubemap, level: Int = 0)
open fun image(name: String, volumeTexture: VolumeTexture, level: Int = 0)

open fun image(name: String, arrayCubemap: ArrayCubemap, level: Int = 0)

Binds an ArrayCubemap as an image to be used in computations such as shaders. Validates the presence of an existing image binding with the specified name and configures the binding using the given ArrayCubemap and mipmap level.

Link copied to clipboard
Link copied to clipboard
fun output(name: String, output: ShadeStyleOutput)
Link copied to clipboard
open fun <R : Any> Parameter(customName: String? = null, initialValue: R? = null): Parameter<R>

Creates a Parameter property with the specified constraints and associates it with a custom name or the property name.

Link copied to clipboard
open fun parameter(name: String, value: Array<ColorRGBa>)
open fun parameter(name: String, value: Array<Matrix33>)
open fun parameter(name: String, value: Array<Matrix44>)
open fun parameter(name: String, value: Array<Vector2>)
open fun parameter(name: String, value: Array<Vector3>)
open fun parameter(name: String, value: Array<Vector4>)
open fun parameter(name: String, value: Boolean)
open fun parameter(name: String, value: Double)
open fun parameter(name: String, value: DoubleArray)
open fun parameter(name: String, value: Float)
open fun parameter(name: String, value: Int)
open fun parameter(name: String, value: IntArray)
open fun parameter(name: String, value: ColorRGBa)
open fun parameter(name: String, value: ArrayCubemap)
open fun parameter(name: String, value: ArrayTexture)
open fun parameter(name: String, value: BufferTexture)
open fun parameter(name: String, value: ColorBuffer)
open fun parameter(name: String, value: Cubemap)
open fun parameter(name: String, value: DepthBuffer)
open fun parameter(name: String, value: VolumeTexture)
open fun parameter(name: String, value: BooleanVector2)
open fun parameter(name: String, value: BooleanVector3)
open fun parameter(name: String, value: BooleanVector4)
open fun parameter(name: String, value: IntVector2)
open fun parameter(name: String, value: IntVector3)
open fun parameter(name: String, value: IntVector4)
open fun parameter(name: String, value: Matrix33)
open fun parameter(name: String, value: Matrix44)
open fun parameter(name: String, value: Vector2)
open fun parameter(name: String, value: Vector3)
open fun parameter(name: String, value: Vector4)

open fun parameter(name: String, value: DynamicParameter)

Sets name to a parameter that is resolved in the shader, read from a texture or computed by GLSL code

open fun parameter(name: String, value: DynamicParameterSource)

Sets name to the dynamic parameter that value provides, it is read from value when the style is used

Link copied to clipboard
inline fun <T : Struct<T>> StyleParameters.parameter(name: String, value: T)
inline fun <T : Struct<T>> StyleParameters.parameter(name: String, value: Array<T>)
Link copied to clipboard
Link copied to clipboard
operator fun plus(other: ShadeStyle): ShadeStyle

Composes this shade style with other: this shade style is applied first, then other, each in its own namespace, so they can use the same names for parameters, functions and varyings

Link copied to clipboard
open fun StyleImageBindings.registerImageBinding(name: String, access: ImageAccess = ImageAccess.READ_WRITE, flags: Set<ImageFlag>, arrayLength: Int = -1)
Link copied to clipboard
inline fun <T : Struct<T>> StyleBufferBindings.registerStructuredBuffer(name: String, access: BufferAccess = BufferAccess.READ_WRITE, flags: Set<BufferFlag> = emptySet())
Link copied to clipboard

This shade style with its dynamic parameters and libraries resolved: the shade style itself when it has none, otherwise a shade style that reads them through resolver functions and has the code of the libraries it uses in its preambles. Shade style managers use it to make shaders.

Link copied to clipboard