⚠ Preview docs — built from the develop branch and may be unstable. Go to the stable docs.

Compute.SetTexture

bool SetTexture(string name, Tex texture)

Bind a texture to a named resource in the shader! If you’re writing to it (RWTexture2D), the texture must have TexType.Compute set, and use a format like TexFormat.Rgba128. Read-only Texture2D bindings work with any texture. Fallbacks are resolved at Dispatch time, so textures that are still loading will Just Work.

   
string name The texture name in the HLSL shader. Must match exactly!
Tex texture The texture to bind.
RETURNS: bool True if a matching resource was found in the shader, false if the name didn’t match anything.




Found an issue with these docs, or have some additional questions? Create an Issue on Github!