I want to render a scene in OpenGL ES, but I have a problem.
Because there is no immediate mode in ES, and simulating immediate mode with single-polygon buffers is slow, I can’t just switch textures and skip invisible polygons, so I have to group my polygons.
Here are characteristics of different polygons:
- Diffuse texture (mipmapped, lots of them).
- Lightmap texture (packed, up to 64 textures).
- Visibility.
At first I thought to group the polygons only by visibility area, but I couldn’t find a way to use texture index arrays.
So, how do I properly make buffers of polygons to render?
I will make visibility groups with texture subgroups. Quake uses 64 128×128 lightmaps, I’m going to replace them with a single 1024×1024 lightmap, since modern hardware supports textures of such size.