ShadeStyle

Represents a customizable and composable style for shaders and rendering pipelines. This class allows defining transformations, preambles, and shader outputs as well as binding buffers and images for use in rendering.

ShadeStyle provides mechanisms for combining different styles and managing parameters for complex rendering effects.

Primary Features:

  • Shader Transformations: Define custom vertex, geometry, and fragment transformations.

  • Shader Preambles: Specify custom preamble code blocks for vertex, geometry, and fragment shaders.

  • Parameter Management: Facilitate management of shader parameters and types.

  • Outputs: Manage shader outputs such as fragment colors.

  • Buffer and Image Bindings: Enable configuration and binding of buffers and images.

ShadeStyle is designed for flexibility and modularity in shader-based rendering pipelines, enabling advanced rendering techniques and reusable styles.

Constructors

Link copied to clipboard
constructor()
constructor(other: ShadeStyle)

Types

Link copied to clipboard

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
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
Link copied to clipboard
Link copied to clipboard
open override var parameterValues: MutableMap<String, Any>
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)
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 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)
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
operator fun plus(other: ShadeStyle): ShadeStyle
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