Sign in to follow this  
wojjy

quake 3 lightmap

Recommended Posts

anybody know how to use lightmaps from quake 3 bsp file? Im using this: http://graphics.stanford.edu/~kekoa/q3/ as a reference and there are some strange lightmap data that are confusing me. Namely: 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. ) are these the values used to reference into the lightmap texture? but if so how am I supposed to do that? I am creating texture with a given size and while setting it i cant refer to only part of it (these are not uv values ?) whatsmore these valuse give very small rectangles. surelly not power of two texture. also : float[3] lm_origin World space origin of lightmap. float[2][3] lm_vecs World space lightmap s and t unit vectors. how do I use that?

Share this post


Link to post
Share on other sites
Lightmaps in Quake 3 are 128x128 textures.

The lightmap coords are in the vertex array. It is the second set of texture coordinates.
The lightmap index can be found in the face structure.

I never use the lmindex and lmstart values in my engine.
These values are there to allow dynamic lightmaps to be applied to the faces for things like rocket fire, etc.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this