Lightmap Questions

Information about the engine technology is revealed and discussed here
Post Reply
chacham15
Private
Posts: 7
Joined: Sun Apr 20, 2008 8:00 pm

Lightmap Questions

Post by chacham15 »

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
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Yes, MoHAA's lightmaps are exactly the same as Quake's.

Why don't you take a look at Q3's or OMoHAA's source code?
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
m0d hippY
Warrant Officer
Posts: 132
Joined: Tue Apr 27, 2004 3:58 am

Post by m0d hippY »

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:

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); 
} 
Then all you would do is call in the ogl wrapper the function:

Code: Select all

RGBMAKER(red, green, blue, alpha); 
Image
Image
Post Reply