Detoeni, thank you for your response however it still doesnt exactly tell me if what I would like to do is possible. Its quite possible that there may be an alternative solution but I’d really like to know if its actually even possible to put the hi-resolution lightmaps into the BSP file.
Maybe a little more background might help to clarify my question;
Since I am loading the BSPs with my custom engine I have a load routine which handles moving through the various ‘lumps’ of data in the BSP. The faces that are drawn are defined with a structure that is pretty close to this:
int texture Texture index.
int effect Index into lump 12 (Effects), or -1.
int type Face type. 1=polygon, 2=patch, 3=mesh, 4=billboard
int vertex Index of first vertex.
int n_vertexes Number of vertices.
int meshvert Index of first meshvert.
int n_meshverts Number of meshverts.
int lm_index Lightmap index.
int[2] lm_start Corner of this face's lightmap image in lightmap.
int[2] lm_size Size of this face's lightmap image in lightmap.
float[3] lm_origin World space origin of lightmap.
float[2][3] lm_vecs World space lightmap s and t unit vectors.
float[3] normal Surface normal.
int[2] size Patch dimensions.
As you can see there is a texture index and a lightmap index. All the textures are loaded from a list so the index tells me which one needs to be used for a face. Similarly, the lm_index (lightmap index) says which lightmaps (from a list loaded from inside the BSP) I should be rendering with.
In order to use both the lightmap and diffuse texture at the same time I have written a GLSL shader. The GLSL shader is what OpenGL actually uses on the video card to shade the surface.
This GLSL shader is different than the “shaders” which q3map2 uses to understand the surfaces it is pre-processing (generating data prior to when the engine runs)
Whats happening right now is that the lightmap index in the BSP is ending up a negative value indicating that it has not been set. What this means is that I dont have a nice way to know which external lightmap I would need to load.
If I can get q3map2 to just write the larger lightmaps into the BSP then my whole system would start working again.
One other note - a lot of people keep telling me that it is possible to increase the visual quality of a lightmap without needing to increase its size by using various filtering, etc options.
I realize that this is possible. However, in my specific case I am also trying to use the normalImage parameter in order to make q3map2 take my normal maps into account when generating lightmaps.
One of the issues with this is that my normal maps have fairly high frequency data - that is the resulting light value from texel to texel can be quite dramatic. In order to preserve this information I need higher resolution lightmaps.
Perhaps someone can clarify if I have totally missed the point here?
Is it possible to get higher resolution lightmaps compiled into a BSP?