Hi
I want to put different textures on my terrain. Like grass, sand… There are two ways of doing this I think:
-
Using TextureUnitStates and mapping (maybe also non-tileable) textures, which fade to their ends, randomly over the terrain. There, where sand is I use more the sand texture, where grass should be I use the grass texture.
This would probably give a very nice look and there can be also slow fades between grass and sand. On the performance side I’m very sceptical, because it would probably use loads of TextureUnitStates, which probably take a lot of the rendering time. + I don’t really know how to do this distributing of the textures. -
Generating the texture fades before using the textures and saving the generated textures in one big texture file. For each quad in the terrain a texture-type (grass or sand) will be applied. Depending on the surrounding texture-types the texture (fade) will be set for the quad. I tried to implement this version, but I stepped over these problems:
- the created file is (for a texture size of 256256) 2562562^9 (there are 9 surrounding texture-types, so 2^9 different textures) pixels big. If this data is saved in ints this will be 2^82^82^94 = 2^27 byte = 2^7 mb = 128 mb
- because of this I always get OutOfMemoryError when trying to load it (I tried already with -mx500m). Are maybe all tyles saved again on the terrain squads? (I got 10 000 of those [10 0002^184 = approx. 2^33 = 8 gb])
Is ther maybe a third way or someway to imorove these approaches. Or is maybe no.1 not that bad as I think?
Arne

