[solved] [The size matters c==8] GrassLayer

nargil

06-03-2009 07:55:11

So when i create the scene with the following world file:


<PgGrassLayers>
<Layer name="Warstwa " material="grass" animation="1" fadeTechnique="2" grassTechnique="1" density="20.000000" maxWidth="1.500000" maxHeight="0.400000" minWidth="1.000000" minHeight="0.200000" swayDistribution="7.000000" swayLenght="0.100000" swaySpeed="0.400000" />
</PgGrassLayers>

[CUT]

<TerrainManager tileSize="1000.000000">
<terrain name="Teren01.mesh 1" coordX="0" coordY="0" coordZ="0" rotation="0" mesh="Teren01.mesh">
<grassLayer name="Warstwa " file="Teren01.mesh 1 Warstwa .png" />

[CUT]

I get ~80 FPS

but if I change it (double the min/max W/H) to:
[code]
<PgGrassLayers>
<Layer name="Warstwa " material="grass" animation="1" fadeTechnique="2" grassTechnique="1" density="20.000000" maxWidth="3.00000" maxHeight="0.800000" minWidth="2.000000" minHeight="0.400000" swayDistribution="7.000000" swayLenght="0.100000" swaySpeed="0.400000" />
</PgGrassLayers>

Then there are only ~40 fps.

I'd like to know why. I mean the grass material is the same, and has the same texture resolution, the triangle/batch count remains the same (279315 / 13). Without Aniso Filtering in the gpu driver there is still a 87 to 48 fps drop only due to enlargin the grass quads (actually x-cross quads)
Even doubling the texture size doesn't have such an impact on the performance.

Edit: just turned transparency off. Expected no frame drop, but there still is, a 170 to 150 drop. How to explain that ?

JohnJ

17-05-2009 13:25:38

This is a problem inherent to grass rendering for the most part. Large grass quads can result in a huge amount of "overdraw" (pixels being rendered over and over) and results in a pixel filling bottleneck on the video card. There's not much you can do to fix this other than try enabling alpha rejection maybe, or try other sizes (vertical height is the worst).