コード例 #1
0
    void OnRenderObject()
    {
        if (UseComputeData)
        {
            cso = GetComponent<ComputeShaderOutput>();
            wso = GetComponent<WeatherShaderOutput>();

            if (outputBuffer == null && cso != null)
                outputBuffer = cso.outputBuffer;

            if (outputBuffer == null && wso != null)
                outputBuffer = wso.outputBuffer;

            if (cso != null)
                cso.Dispatch();
            else
            {
                wso.Dispatch();
                Wind = wso.wind;
            }
        }

        material.SetPass(0);
        material.SetColor("_Color", color);
        material.SetBuffer("buf_Points", outputBuffer);
        material.SetTexture("_Sprite", sprite);
        material.SetVector("_Size", size);
        material.SetInt("_StaticCylinderSpherical", billboardType);
        material.SetVector("_worldPos", transform.position);
        material.SetVector("_Wind", Wind);

        Graphics.DrawProcedural(MeshTopology.Points, outputBuffer.count);
    }
コード例 #2
0
    void OnRenderObject()
    {
        cso.Dispatch();
        verticesBuffer = cso.flakesBuffer;
        wind           = cso.wind;

        material.SetPass(0);
        material.SetColor("_Color", color);
        material.SetBuffer("buf_Points", verticesBuffer);
        material.SetTexture("_Sprite", sprite);
        material.SetVector("_Size", size);
        material.SetInt("_StaticCylinderSpherical", billboardType);
        material.SetVector("_worldPos", transform.position);
        material.SetVector("_Wind", wind);

        Graphics.DrawProcedural(MeshTopology.Points, verticesBuffer.count);
    }
コード例 #3
0
    void OnRenderObject()
    {
        if (UseComputeData)
        {
            cso = GetComponent <ComputeShaderOutput> ();
            wso = GetComponent <WeatherShaderOutput> ();

            if (outputBuffer == null && cso != null)
            {
                outputBuffer = cso.outputBuffer;
            }

            if (outputBuffer == null && wso != null)
            {
                outputBuffer = wso.outputBuffer;
            }

            if (cso != null)
            {
                cso.Dispatch();
            }
            else
            {
                wso.Dispatch();
                Wind = wso.wind;
            }
            if (outputBuffer == null && cso != null)
            {
                outputBuffer = cso.outputBuffer;
            }
        }

        material.SetPass(0);
        material.SetColor("_Color", color);
        material.SetBuffer("buf_Points", outputBuffer);
        material.SetTexture("_Sprite", sprite);
        material.SetVector("_Size", size);
        material.SetInt("_StaticCylinderSpherical", billboardType);
        material.SetVector("_worldPos", transform.position);
        material.SetVector("_Wind", Wind);

        Graphics.DrawProcedural(MeshTopology.Points, outputBuffer.count);
    }