C# Класс UnityEngine.ComputeShader

Наследование: UnityEngine.Object
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
DispatchIndirect ( int kernelIndex, ComputeBuffer argsBuffer, [ argsOffset ) : void

Execute a compute shader.

SetBool ( int nameID, bool val ) : void

Set a bool parameter.

SetBool ( string name, bool val ) : void

Set a bool parameter.

SetBuffer ( int kernelIndex, string name, ComputeBuffer buffer ) : void

Sets an input or output compute buffer.

SetFloat ( string name, float val ) : void

Set a float parameter.

SetFloats ( int nameID ) : void

Set multiple consecutive float parameters at once.

SetFloats ( string name ) : void

Set multiple consecutive float parameters at once.

SetInt ( string name, int val ) : void

Set an integer parameter.

SetInts ( int nameID ) : void

Set multiple consecutive integer parameters at once.

SetInts ( string name ) : void

Set multiple consecutive integer parameters at once.

SetTexture ( int kernelIndex, string name, Texture texture ) : void

Set a texture parameter.

SetTextureFromGlobal ( int kernelIndex, string name, string globalTextureName ) : void

Set a texture parameter from a global texture property.

SetVector ( int nameID, Vector4 val ) : void

Set a vector parameter.

SetVector ( string name, Vector4 val ) : void

Set a vector parameter.

Приватные методы

Метод Описание
Dispatch ( int kernelIndex, int threadGroupsX, int threadGroupsY, int threadGroupsZ ) : void
DispatchIndirect ( int kernelIndex, ComputeBuffer argsBuffer ) : void
FindKernel ( string name ) : int
GetKernelThreadGroupSizes ( int kernelIndex, uint &x, uint &y, uint &z ) : void
HasKernel ( string name ) : bool
INTERNAL_CALL_SetVector ( ComputeShader self, int nameID, Vector4 &val ) : void
Internal_DispatchIndirect ( int kernelIndex, ComputeBuffer argsBuffer, uint argsOffset ) : void
Internal_SetFloats ( int nameID, float values ) : void
Internal_SetInts ( int nameID, int values ) : void
SetBuffer ( int kernelIndex, int nameID, ComputeBuffer buffer ) : void
SetFloat ( int nameID, float val ) : void
SetInt ( int nameID, int val ) : void
SetTexture ( int kernelIndex, int nameID, Texture texture ) : void
SetTextureFromGlobal ( int kernelIndex, int nameID, int globalTextureNameID ) : void

Описание методов

DispatchIndirect() публичный Метод

Execute a compute shader.

public DispatchIndirect ( int kernelIndex, ComputeBuffer argsBuffer, [ argsOffset ) : void
kernelIndex int Which kernel to execute. A single compute shader asset can have multiple kernel entry points.
argsBuffer ComputeBuffer Buffer with dispatch arguments.
argsOffset [ Byte offset where in the buffer the dispatch arguments are.
Результат void

SetBool() публичный Метод

Set a bool parameter.

public SetBool ( int nameID, bool val ) : void
nameID int Property name ID, use Shader.PropertyToID to get it.
val bool Value to set.
Результат void

SetBool() публичный Метод

Set a bool parameter.

public SetBool ( string name, bool val ) : void
name string Variable name in shader code.
val bool Value to set.
Результат void

SetBuffer() публичный Метод

Sets an input or output compute buffer.

public SetBuffer ( int kernelIndex, string name, ComputeBuffer buffer ) : void
kernelIndex int For which kernel the buffer is being set. See FindKernel.
name string Name of the buffer variable in shader code.
buffer ComputeBuffer Buffer to set.
Результат void

SetFloat() публичный Метод

Set a float parameter.

public SetFloat ( string name, float val ) : void
name string Variable name in shader code.
val float Value to set.
Результат void

SetFloats() публичный Метод

Set multiple consecutive float parameters at once.

public SetFloats ( int nameID ) : void
nameID int Property name ID, use Shader.PropertyToID to get it.
Результат void

SetFloats() публичный Метод

Set multiple consecutive float parameters at once.

public SetFloats ( string name ) : void
name string Array variable name in the shader code.
Результат void

SetInt() публичный Метод

Set an integer parameter.

public SetInt ( string name, int val ) : void
name string Variable name in shader code.
val int Value to set.
Результат void

SetInts() публичный Метод

Set multiple consecutive integer parameters at once.

public SetInts ( int nameID ) : void
nameID int Property name ID, use Shader.PropertyToID to get it.
Результат void

SetInts() публичный Метод

Set multiple consecutive integer parameters at once.

public SetInts ( string name ) : void
name string Array variable name in the shader code.
Результат void

SetTexture() публичный Метод

Set a texture parameter.

public SetTexture ( int kernelIndex, string name, Texture texture ) : void
kernelIndex int For which kernel the texture is being set. See FindKernel.
name string Name of the buffer variable in shader code.
texture Texture Texture to set.
Результат void

SetTextureFromGlobal() публичный Метод

Set a texture parameter from a global texture property.

public SetTextureFromGlobal ( int kernelIndex, string name, string globalTextureName ) : void
kernelIndex int For which kernel the texture is being set. See FindKernel.
name string Name of the buffer variable in shader code.
globalTextureName string Global texture property to assign to shader.
Результат void

SetVector() публичный Метод

Set a vector parameter.

public SetVector ( int nameID, Vector4 val ) : void
nameID int Property name ID, use Shader.PropertyToID to get it.
val Vector4 Value to set.
Результат void

SetVector() публичный Метод

Set a vector parameter.

public SetVector ( string name, Vector4 val ) : void
name string Variable name in shader code.
val Vector4 Value to set.
Результат void