• Advertisement

Archived

This topic is now archived and is closed to further replies.

Lightmaps from Half-Life BSP's

This topic is 6456 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey all, Im writing a 3D engine, based around the BSP format used in half life. Everything works great, all the geometry works, all textures imported and aligned, all mip levels working, and im running around all the half-life levels no problem =). Now i''ve come to a COMPLETE halt when attempting to create lightmaps using the information stored in the BSP file itself. According to the DOCS, the lightmap data is stored in a 24bit RGB format. This is fine, i can read it all, however i cannot work out the width and height of each lightmap from the data which is provided. I read over the Quake 2 BSP file tutorial on flipcode where it says lightmap_width = ceil(max_u / 16) - floor(min_u / 16) + 1 lightmap_height = ceil(max_v / 16) - floor(min_v / 16) + 1 I''ve implemented this, in the exact way outlined in that document, but all the lightmaps just come out completely screwed. As the amount of data which is read from the lightmap lump for each face is DIRECTLY lined to the width and height returned, all the problems stem from calculation of the width and height. I can tell somethings wrong when some of my Width and heights are in the 100''s =) wheras it should be a max of 16x16 (after QBSP2 creates the level) Can anyone help me out here ?? Has anyone played with the lightmap data from BSP files before ?? I really want to use the Lightmap data which is provided, rather than recalculate it all myself. I''ve looked over the source for TWISTER (Quake II Clone) but it isn''t any use in this case. Im using DX7 btw. Thanks in advance for ANY help anyone can give. Adam

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement