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); }
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); }
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); }