Example #1
0
    private void Dispatch()
    {
        AssignStructs.AssignTransBuffer(transform, transValues, _transBuffer);

        // Setting up hand buffers
        int index = 0;

        AssignStructs.AssignHandStruct(handValues, index, out index, hand1, trigger1);
        AssignStructs.AssignHandStruct(handValues, index, out index, hand2, trigger2);
        AssignStructs.AssignHandStruct(handValues, index, out index, hand3, trigger3);
        AssignStructs.AssignHandStruct(handValues, index, out index, hand4, trigger4);
        _handBuffer.SetData(handValues);


        computeShader.SetInt("_NumberHands", 4);

        computeShader.SetFloat("_DeltaTime", Time.deltaTime);
        computeShader.SetFloat("_Time", Time.time);

        computeShader.SetInt("_RibbonWidth", ribbonWidth);
        computeShader.SetInt("_RibbonLength", ribbonLength);


        computeShader.SetBuffer(_kernel, "transBuffer", _transBuffer);
        computeShader.SetBuffer(_kernel, "vertBuffer", _vertBuffer);
        computeShader.SetBuffer(_kernel, "ogBuffer", _ogBuffer);
        computeShader.SetBuffer(_kernel, "handBuffer", _handBuffer);

        computeShader.Dispatch(_kernel, strideX, strideY, strideZ);
    }
Example #2
0
    private void Dispatch()
    {
        AssignStructs.AssignTransBuffer(transform, transValues, _transBuffer);
        AssignStructs.AssignDisformerBuffer(Disformers, disformValues, _disformBuffer);
        AssignStructs.AssignHandBuffer(Hands, handValues, _handBuffer);

        computeShader.SetInt("_NumDisformers", numDisformers);
        computeShader.SetInt("_NumberHands", Hands.Length);

        computeShader.SetFloat("_DeltaTime", Time.deltaTime);
        computeShader.SetFloat("_Time", Time.time);
        computeShader.SetInt("_RibbonWidth", ribbonWidth);
        computeShader.SetInt("_RibbonLength", ribbonLength);

        audioTexture = audioObj.GetComponent <audioSourceTexture>().AudioTexture;

        computeShader.SetTexture(_kernel, "_Audio", audioTexture);

        computeShader.SetBuffer(_kernel, "transBuffer", _transBuffer);
        computeShader.SetBuffer(_kernel, "vertBuffer", _vertBuffer);
        computeShader.SetBuffer(_kernel, "ogBuffer", _ogBuffer);
        computeShader.SetBuffer(_kernel, "disformBuffer", _disformBuffer);
        computeShader.SetBuffer(_kernel, "handBuffer", _handBuffer);

        computeShader.Dispatch(_kernel, strideX, strideY, strideZ);
    }
Example #3
0
    private void Dispatch()
    {
        //audioTexture = pedestal.GetComponent<audioSourceTexture>().AudioTexture;

        AssignStructs.AssignTransBuffer(transform, transValues, _transBuffer);
        //AssignStructs.AssignDisformerBuffer( Disformers , disformValues , _disformBuffer );


        physics.SetInt("_NumberHands", handBufferInfo.GetComponent <HandBuffer>().numberHands);

        physics.SetFloat("_DeltaTime", Time.deltaTime);
        physics.SetFloat("_Time", Time.time);



        //physics.SetTexture(_kernel,"_Audio", audioTexture);

        physics.SetBuffer(_kernel, "transBuffer", _transBuffer);
        physics.SetBuffer(_kernel, "vertBuffer", _vertBuffer);
        //physics.SetBuffer( _kernel , "disformBuffer", _disformBuffer  );
        physics.SetBuffer(_kernel, "handBuffer", handBufferInfo.GetComponent <HandBuffer>()._handBuffer);

        physics.Dispatch(_kernel, strideX, strideY, strideZ);
    }