openrndr / org.openrndr.draw / ComputeShader

ComputeShader

interface ComputeShader (source)

Functions

buffer

abstract fun buffer(name: String, vertexBuffer: VertexBuffer): Unit

counters

abstract fun counters(bindingIndex: Int, counterBuffer: AtomicCounterBuffer): Unit

destroy

Destroy the compute shader

abstract fun destroy(): Unit

execute

Execute the compute shader

abstract fun execute(width: Int = 1, height: Int = 1, depth: Int = 1): Unit

image

Bind a colorbuffer as to image

abstract fun image(name: String, image: Int, colorBuffer: ColorBuffer, access: ImageAccess = ImageAccess.READ): Unit

Bind an array texture to image

abstract fun image(name: String, image: Int, arrayTexture: ArrayTexture, layer: Int, access: ImageAccess = ImageAccess.READ): Unit

Bind an array texture layer to image

abstract fun image(name: String, image: Int, arrayTexture: ArrayTexture, access: ImageAccess = ImageAccess.READ): Unit

Bind a cubemap texture side to image

abstract fun image(name: String, image: Int, cubemap: Cubemap, access: ImageAccess = ImageAccess.READ): Unit

uniform

abstract fun uniform(name: String, value: Matrix33): Unit
abstract fun uniform(name: String, value: Matrix44): Unit
abstract fun uniform(name: String, value: ColorRGBa): Unit
abstract fun uniform(name: String, value: Vector4): Unit
abstract fun uniform(name: String, value: Vector3): Unit
abstract fun uniform(name: String, value: Vector2): Unit
abstract fun uniform(name: String, x: Float, y: Float, z: Float, w: Float): Unit
abstract fun uniform(name: String, x: Float, y: Float, z: Float): Unit
abstract fun uniform(name: String, x: Float, y: Float): Unit
abstract fun uniform(name: String, value: Double): Unit
abstract fun uniform(name: String, value: Float): Unit
abstract fun uniform(name: String, value: Int): Unit
abstract fun uniform(name: String, value: Boolean): Unit
abstract fun uniform(name: String, value: Array<Vector4>): Unit
abstract fun uniform(name: String, value: Array<Vector3>): Unit
abstract fun uniform(name: String, value: Array<Vector2>): Unit
abstract fun uniform(name: String, value: FloatArray): Unit

Companion Object Functions

fromCode

Create a compute shader from (GLSL) code as a String

fun fromCode(code: String): ComputeShader

fromFile

Create a compute shader from file

fun fromFile(file: File): ComputeShader