openrndr / org.openrndr.draw / ComputeShader

ComputeShader

interface ComputeShader : ShaderImageBindings (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

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