UnityEngine.ComputeShader.SetInt C# (CSharp) Method

SetInt() public method

Set an integer parameter.

public SetInt ( string name, int val ) : void
name string Variable name in shader code.
val int Value to set.
return void
        public void SetInt(string name, int val)
        {
            this.SetInt(Shader.PropertyToID(name), val);
        }

Same methods

ComputeShader::SetInt ( int nameID, int val ) : void

Usage Example

コード例 #1
0
    //
    // GPU STUFF
    //

    private static void SetShaderVars(UnityEngine.ComputeShader shader, UnityEngine.Vector2 noiseOffset, bool normalize, float noiseScale)
    {
        shader.SetInt("octaves", octaves);
        shader.SetFloat("falloff", falloff);

        shader.SetInt("normalize", System.Convert.ToInt32(normalize));
        shader.SetFloat("noiseScale", noiseScale);
        shader.SetVector("offset", noiseOffset);
    }
All Usage Examples Of UnityEngine.ComputeShader::SetInt