Sign in to follow this  
TiDa

Half-life BSP lightmap

Recommended Posts

hi! i am doing a Half-life map viewer. i want to know whether there is a total lightmap in a BSP map. i only can get several small lightmap from reading every Face from BSP map. if Bsp map really has a total lightmap how i can get a total lightmap by piecint up these small lightmaps.

Share this post


Link to post
Share on other sites
What do you mean by "total lightmap"?
Do you mean a single really big texture that you could use on every face? If so, then no, it's a bad idea because the resulting lightmap would be really big.

Perhaps HLLib could be useful to you, as it already includes source code to get the lightmaps...

Share this post


Link to post
Share on other sites
Yes .My "total lightmap" is a single really big texture that can be used on every face.
Because render scene by every face becoming slower.And i use a texture as a SUBMESH . One texture with several faces. I want A SUBMESH ues a texture and a lightmap.So i wish to get a total Lightmap or several Big Lightmap.But if i combine these faces' lightmap which containing in a same texture by myself. These small lightmaps in the resulting big map are indiscriminate. when i render scene by these big map.Although i set u,v correctly but it maybe use the surrounding small lightmaps' pixel. So i want to conbine several related lightmaps.

Share this post


Link to post
Share on other sites
Just use a bin-packing algorithm to combine all the smaller textures into larger textures, also know as atlases (IIRC jyk posted one many moons ago, you can probably search for it). Then let the faces know the UV coordinates of their lightmaps in the large texture, and batch appropriately. One problem you might run into is texture bleeding due to texture filtering, which is a common problem with atlas textures. Unfortunately, a BSP file only stores light samples at a 16x16 resolution by default, so you need to rely on linear filtering to get the proper light across the face. One solution is to expand the lightmaps in software to their full size and use point filtering, but then you'd need a lot more atlases.

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