Hi, thanks in advance for helping me with this. I am writing my own Mohaa map renderer. All the polygons/patches load fine and I can see them in wireframe mode. The problem is that when I turn off wireframe everything turns grey. This, I've discovered, is because the lightmaps arent giving any real light to any of the structures, so they all look the same (for now, I have texture mapping off). So, I assume that the Mohaa lightmap is the same as the Quake 3 lightmap stuff (i.e. an array of unsigned char[128][128][3]). For now, I am just trying to get polygons to render (there are very few patches in the map and ill worry about them when i get there). I just use the dsurface_t 's lightmapNum to index into the array and then use the drawVert_t 's lightmap coordinates as they are. Is that right? Do I need to do some processing on that data? Also, Im aware that people here prob. dont know much about OpenGL, but maybe by some chance does anyone know how to multitexture using GLUT?
Thanks so much for reading this and any help you can provide!
chacham15
Lightmap Questions
-
Rookie One.pl
- Site Admin
- Posts: 2752
- Joined: Fri Jan 31, 2003 7:49 pm
- Location: Nowa Wies Tworoska, Poland
- Contact:
ahh I've done some things in OpenGL in the past.
I'll see if I can help you out. If I remember correctly MOHAA has an odd way of coloring things in the game through OGL, so what you would need to do is create a custom coloring function.
Something similar to this:
Then all you would do is call in the ogl wrapper the function:
I'll see if I can help you out. If I remember correctly MOHAA has an odd way of coloring things in the game through OGL, so what you would need to do is create a custom coloring function.
Something similar to this:
Code: Select all
void RGBMAKER(float red, float green, float blue, float alpha)
{
float r_color = red/255;
float g_color = green/255;
float b_color = blue/255;
float a_color = alpha/255;
glDisableClientState(GL_COLOR_ARRAY);
glEnable(GL_COLOR_MATERIAL);
glColor4ub(r_color, g_color, b_color, a_color);
}
Code: Select all
RGBMAKER(red, green, blue, alpha);



