Not clear whether I am CPU or GPU bound but need a ‘low cost’ dissolve effect for a very high (+1 million!) poly mesh.
What would be the best approach?
Is there some type of simple dissolve effect that has little or no CPU or GPU overhead?
Not clear whether I am CPU or GPU bound but need a ‘low cost’ dissolve effect for a very high (+1 million!) poly mesh.
What would be the best approach?
Is there some type of simple dissolve effect that has little or no CPU or GPU overhead?
A simple dissolve is to use a noise texture. In most cases you can use your regular uv coords to look up the greyscale value in the noise texture. something like
float4 color = tex2D(_MainTex, frag.uv); // or whatever you do to get your main color, shading, etc...
color.a = tex2D(noiseTex, frag.uv).x < dissolveThreshold;
dissolveThreshold is the parameter that you set from your c# code and that you can nicely animate over time.
Performance wise, this is only one more texture fetch, and your noise texture does not even have to be very large for good effects. The performance is also independent of the vertex detail. It will not make rendering any faster, so if performance is already an issue, try reducing the mesh complexity.