What is a bicubic lightmap?
Gaming
The Lemmy.zip Gaming Community
For news, discussions and memes!
Community Rules
This community follows the Lemmy.zip Instance rules, with the inclusion of the following rule:
- No NSFW content
You can see Lemmy.zip's rules by going to our Code of Conduct.
What to Expect in Our Code of Conduct:
- Respectful Communication: We strive for positive, constructive dialogue and encourage all members to engage with one another in a courteous and understanding manner.
- Inclusivity: Embracing diversity is at the core of our community. We welcome members from all walks of life and expect interactions to be conducted without discrimination.
- Privacy: Your privacy is paramount. Please respect the privacy of others just as you expect yours to be treated. Personal information should never be shared without consent.
- Integrity: We believe in the integrity of speech and action. As such, honesty is expected, and deceptive practices are strictly prohibited.
- Collaboration: Whether you're here to learn, teach, or simply engage in discussion, collaboration is key. Support your fellow members and contribute positively to shared learning and growth.
If you enjoy reading legal stuff, you can check it all out at legal.lemmy.zip.
Reference: https://developer.valvesoftware.com/wiki/Lightmap
Skipping over some details and simplifying this to (hopefully) make it something anyone can reasonably understand: For Source in particular (as other engines may do things differently), maps start out as being fully bright without shadows. Here is an image I stole off a google search showing what that looks like:
When the map is being compiled (or exported or whatever term resonates with you the best), the lights placed within the map (and probably sky information too) are used to determine what parts should be covered in shadow and what should be brightly lit. The result is called the lightmap. (The lightmap itself doesn't have any texture of, say concrete. It only stores data along the lines of "this light brightness here is 50%"). By taking the texture of the surface (concrete, asphalt, stucco) and darkening / lightening it according to the lightmap, you then end up with a lit version of the map which does have shadows.
Now on to the bicubic part: To keep the size of map files down, and reduce the resources required to load it, lightmaps by default render at a resolution of one pixel per (approximately) 40 cm or roughly one pixel per 1.5 ft. This low resolution is perfectly fine since the shadow of a building or highway overpass doesn't need to be especially detailed beyond just "it's dark over there". Where required, the map author can increase the resolution in the spots that require additional detail. However, there is still one problem: When rendering a frame for you to view, the low resolution lightmap is "scaled up" to cover the entire surface, and you don't want pixelated shadows. The fast way of handling this is linear scaling, where to find the value of a "scaled up" pixel, you just take the values of the nearest "original pixels" and simply average them (with more weight given toward nearer "original pixels" than farther). While extremely fast, this leads to stair-stepping as shown in the top-left panel:
Bicubic is just a fancier method of finding the value of that "scaled up" pixel. It's a slower method than linear, but it resolves the stair-stepping problem.