Terrain static lighting
Hello, I would like an opinion about 2 methods of (static) lighting a mesh of a terrain ( 513 x 513) , in terms of OpenGL texture usage & efficiency.
One would be using a 256x256 lightmap, and 4 textures for layers which would repeat over the terrain, and an RGBA texture with the contributions of each layer.
After that, the calculation could easily be done using these 6 (!) texture units.
The other would be to create just a big (e.g. 4K x 4K) RGB map, with the textures & lightmap baked on it, so I would need only one texture unit & it would be the simplest shader possible. Since the terrain will be viewed from above, I have no need for zooming in/out much, I will only see it from a fixed perspective. So the questions :
1. Which is better, using the huge texture or 6 small ones? ( 1 fetch from a BIG tex vs 6 fetches from smaller ones and a few ops)
2. In case I use the huge one, will it help to have it bound always to a specific texture unit which will only be used for the terrain, in order to avoid successive binds to it?
3. Would it be better to NOT generate mipmaps for the huge one, since the perspective is fixed? or how could I compute the best mipmap level?
Thanks in advance,
Babis
What Gfx are you going to be targeting? 4096x4096 textures aren't supported on older ATI cards IIRC.
I can't say if it would take longer to move one larger texture that was baked with the lighting, or many glBindTexture calls.
If you want to roll with KISS than use the one larger texture and only bind it once. I would still generate mipmaps for the larger texture and use compression.
I can't say if it would take longer to move one larger texture that was baked with the lighting, or many glBindTexture calls.
If you want to roll with KISS than use the one larger texture and only bind it once. I would still generate mipmaps for the larger texture and use compression.
Thanks for your answer,
Compression is a must I know, I would use it for all the textures (except the lightmap perhaps). I'm targetting relatively newer hardware, although if needed I could just reduce it to 2K by 2K,that's not a problem. The other method isn't a problem for KISS, I've tried it already in an older app and works fine.
So you suggest I suppose the large texture bound in a unique tex unit, used only for terrain rendering.
Compression is a must I know, I would use it for all the textures (except the lightmap perhaps). I'm targetting relatively newer hardware, although if needed I could just reduce it to 2K by 2K,that's not a problem. The other method isn't a problem for KISS, I've tried it already in an older app and works fine.
So you suggest I suppose the large texture bound in a unique tex unit, used only for terrain rendering.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement