Gras Performance Question (masked Materials)

Hi,

i made two diffrent gras types, one is a a basic plane with a material
one cluster has about 100 polys

the second one is hair gras, so every gras blade is a singel polygone modell (one cluster about 600 polys)

how ever i have more Fps if i use the gras with mutch more polys then the one with planes.

My question is: Is a masked texture heavyer to compute compaired to a normal Material?

Is a masked texture heavyer to compute compaired to a normal Material?

Yes. How much of an FPS difference is there between the two, btw?

the diffrens is normaly 5-10 fps, the nice thing about the hairgras is that the fps dont go down if you place very much of it with the foliagetool^^

The tradeoff here could very based on your hardware. generally though, masked materials are only expensive when they ‘overdraw’. If you go into shader complexity viewmode, you should see this. If you have a masked material that has a 100% white solid mask, the performance will be fairly close to opaque although there is still some overhead.

But if you made your mask black, now the entire surface would be rendered but “invisible”. However making the pixel “invisible” in this case didn’t make it any cheaper to render. So if you stack 10 of these invisible planes one behind another, the total cost will be 10x as expensive, since for each pixel it will have to see that it was invisible 10 times. However if any one of those pixels is “opaque” inside the material, it can reject and stop checking the other masked shaders behind it (for that pixel only that frame).

So the performance cost of masked is directly proportional to the ratio of “masked” area in the alpha mask compared to the unmasked area.

Personally I would suggest the individual hair method for up close with an LOD that uses the cluster method. Best of both worlds since as something gets further away, the pixel/vertex tradeoff switches (ie, there isn’t as many pixels on a faraway mesh of the same scale, but there are the same amount of verts!)