Welcome to my lightmap tutorial. Lightmaps are one of the more difficult parts of MCPatcher to understand. Unlike other aspects such as CTM or CIT, lightmaps don't have expansive config files. Understanding them isn't a matter of mastering what all the options do, but just figuring out how each pixel in the lightmap translates to the lighting you see in the world. In this respect, they're a bit of an oddity within MCPatcher's vast array of mods, and one that requires some explaining to understand.
In this tutorial you'll learn how each section of the lightmap works, what it all means, how the sections fit together, and most importantly how to make aesthetically pleasing lightmaps for your Resource Pack.
Tip: Watch for Green Text: When I write tutorials, I add little tidbits in green text lines. These are often helpful hints or little extras. Keep an eye out for them, as they may prove helpful.
IMPORTANT: YOU NEED MCPATCHER FOR THIS: To (hopefully) head off this question, yes, this feature requires MCPatcher. It will NOT work in vanilla Minecraft. I will be ignoring anyone who asks about this.
1. Templates and File Placement: To begin with, it helps to have a basic template of how the lightmaps work. Without a basic understanding of the placement of your colors, the rest of this tutorial is entirely pointless.
Lightmaps must always be either 32 or 64 pixels in height, depending on whether you want to include the nightvision section or not, but can be any width. For ease of understanding, I've created three templates for the three most common widths of lightmap: 16 wide, 32 wide, and 64 wide. You can save them from the images in the spoiler below. Note that none of these include the nightvision section, which will be discussed later in the tutorial.
Tip: Why Different Widths?: The only difference in the widths of lightmaps is how much control you have over the color change during sunrise and sunset. If you don't care about having fine color control, go with the 16 wide one since it will give you the least amount of trouble.
16 Wide:
32 Wide:
64 Wide:
IMPORTANT: DO NOT RESIZE THE LIGHTMAP: Lightmaps are one of the rare things in Resource Pack creation that should never be resized, even if you're making a higher resolution pack. Because each and every pixel is important to a lightmap, resizing one will throw MCPatcher off entirely. For that reason, leave the sizes alone even if you're making a high-resolution pack.
File Names and Placement:
All of your lightmaps are placed in "\assets\minecraft\mcpatcher\lightmap\", which should all be within your resource pack's folder or .zip file. The file "world0.png" is for the overworld. "world-1.png" and "world1.png" are for the Nether and End dimensions respectively.
2. Sky Light Map: Lightmaps come in distinct sections. The top 16 rows of pixels are always the map that deals with lighting from the sky.
Tip: Overworld Only: While the information in this section technically apply to all three dimensions in Minecraft, they're really only useful for the overworld. This is explained in more detail in the section on the End and Nether lightmaps. If you're not making a map for the overworld, skip ahead to the section on the Light Source Map half of the color map.
Layout: The top part of the lightmap that deals with the light from the sky is by far the most difficult section to deal with, mainly because there aren't many good explanations of how it functions available.
Using the templates above, here's a basic rundown of how this image works:
You may notice the two arrows in the above image that say "Sky Exposure" and "Time of Day". These are where things get complicated. If you've taken any reasonably advanced math course, seeing lines like this probably makes you think of graphic points on a grid. In essence, that's exactly what you're doing. The exact pixel that dictates the brightness and color of a block is based on that block's exposure to the sky (not necessarily the sun) and the time of day.
Understanding how each of these axises operates, and how they interact, is key to understanding the top section of the lightmap.
Sky Exposure: The vertical axis of the upper portion of the lightmap is for sky exposure. The bottom row represents full sky exposure. That is, when you're standing directly under the open sky with no light-blocking blocks overhead. The top row represents no sky exposure. This is the row that's used when you're more than fifteen blocks away from a block that's exposed to the open sky.
Note that's I'm specifically referring to this as "sky exposure" not sunlight as you may have read in other guides or tutorials. The reason for this is simple: the vertical axis isn't based at all on whether or not the sun is out. The bottom row represents both direct sunlight, and direct moonlight depending on the time of day (the horizontal axis), which will be covered in the next section.
Here's an illustration to help you visualize which row is used based on the exposure to the open sky:
Tip: Deep in a Cave: Pay attention to the fact that the top row means no influence from the sky. A common mistake that I see a lot of texture artists make is to have that top row vary in intensity or color based on the time of day, even though the sky should have no influence on it at all. If you're going for realism, try to have the top row be a single color value all the way across. On the other hand, if you want to be able to know what time of day it is even when you're deep underground, it's possible to have the light change by giving variance to this row.
Tip: What's my (Sun) Light Level: Need an easy way to find how much sky exposure you have? Open your debug menu in-game (F3) and look for "sl:" in the second-to-bottom row. This is how much exposure you have to the sun. Fifteen is bottom row of the light map while zero is the top row.
Time of Day: The horizontal axis primarily represents the time of day, but also has a section on the far right side exclusively for lightning. The far left of the image is night time. On the far right is lightning. Just to the left of the lightning is the daylight. The wide area in between night and day is the sunrise and sunset transition.
The transition for sunrise and sunset is the reason for the variable width of the lightmap. Having a wider map gives you finer control over the changes in color as the sun rises or sets, but offers no other benefit. There is no way to give sunrise and sunset different colors or light levels; both transitions use the same one, but move in different directions along the horizontal axis.
Here's a demonstration showing the changes in the horizontal axis as time passes:
Lightning, Thunderstorms, and Rain To the right of the column used for daytime, there's one or more column used for Lightning. For the most part, only the far right column is used for a lightning strike. On wider maps, there may be multiple columns between the daylight column and the lignting column. These columns are apparently unused, most likely as a result of how MCPatcher calculates the positions for various times along with width of the axis with daylight being at 15/16 of the width rather than just in the second-to-right column as an absolute position.
On the templates, there are two columns specifically highlighted: one for rain and one for thunderstorms. These columns are used when the associated weather phenomenon happens during normal daylight hours. Unlike the columns reserved for lightning, they're also part of the normal sunrise/sunset fade, though, so you can't color them individually to be used only during weather. They're marked on my templates primarily so that you don't wonder why your world turns an odd color when it rains.
It's important to note that the only column that's always exact is the lightning strike column. The columns for rain and storms are not precise, and will pick up some of the color from the columns next to them due to the way Minecraft attempts to blend colors during the sunrise and sunset transitions. If you're not getting exactly the color you want for these, try spreading that color slightly into the columns to the left and right of the primary columns to boost the effect.
Putting It All Together: Now that you have an understanding of what each axis of a lightmap does, it's time to put the two together. Your darkest colors are going to be at the top and the left side of your color map. The top because it is the farthest removed from the sky, and thus sunlight, and the left because it represents night time and thus will have minimal lighting. The brightest spot should be at the bottom-right of the color map as it represents full sky exposure during the daytime.
Keep in mind the area on the right that's reserved for lightning. An easy way to fill in these areas is simply to borrow the column you've used for daylight. This works, and will go largely unnoticed, because Minecraft will change the lighting from a much darker column to the lightning column in only a few frames. The lightning itself also doesn't last very long, so most people won't notice that it's the same brightness as lightning. If you'd like to be a little sneakier about hiding this duplicity, consider giving your lightning a different hue than your normal daylight.
Here's an example of a working colormap that takes into account both the time of day, and exposure to the sky:
If you load this example pack (see the downloads section), you'll notice how at sunset the color map cycles from yellow (daylight) through orange, red, and purple to a deep bluish hue at night. You can easily see where these changes occur on the color map. Likewise, if you set your game weather to lightning ("/weather thunder" in the chat line with cheats enabled), you'll see that during lightning strikes the world briefly goes a bright cyan color. Again, it's easy to see where this occurs on the example colormap.
Tip: One Column at a Time: If you're having trouble making things look right, do one column at a time. Start with the daylight column. Get it the way you want to with your full sunlight at the bottom, and your deep cave lighting at the top. When you've gotten that the way you want it, do your night time column. Then the lightning columns. Finally, do the in-between columns that constitute your sunrise and sunset transition. Don't be afraid to stop time in Minecraft ("/gamerule doDaylightCycle false") and advance a few ticks at a time to get a feeling for each and every moment of your sunrises and sunsets if that's what you need to do.
3. Light Source Map: The second set of sixteen rows on your lightmap deals with the light emanated by light sources such as torches, glowstone, redstone lamps, jack-o-lanterns, and so forth.
Tip: Leave it Black for Testing: When you're testing the previous section, color the sixteen rows that you use for your light sources black. By doing this, you won't get any influence from light sources and will easily be able to see how pure sky lighting affects your world. Likewise, when testing this half it's a good idea to blot out your sky lighting with solid black. That way you can be sure about the colors and intensities you're seeing coming from your light sources. Don't forget to make backups so you don't lose anything by accident!
Light Levels: This half of the lightmap is much easier to understand as it works with a real, tangible value for how it calculates which row it draws any given face's lighting value from. In particular, it uses that block's light level.
Tip: What's my (Torch) Light Level?: Just as you can use the debug menu to find how much sky light you're getting, you can also use it to find how much light you're getting from a lightsource. With your debug menu open (F3) look for "bl:" in the second-to-bottom row. Fifteen represents the bottom row, and zero represents the top row of this section. Keep in mind that this is the lighting at the level of your head. The best way to see this effect in-game is the embed a piece of glowstone in a flat wall, deep in a cave, at eye level, with no other light sources around. Look at the blocks on that same wall at eye level and either look at your debug menu, or count the number of block spaces away from the glowstone you are and compare that number to the rows on your lightmap.
Just as the top half of the lightmap had the top hidden far away from the light, the top row of this half likewise represents a block with absolutely no light coming from any light source. Similarly, the bottom row represents the strongest light possible. This bottom row is rarely seen in-game since that light level is usually within any block bright enough to give that level. The only place to view it currently is in flowing lava. Any time a lava flow does not fill the entire block, the highest light level can be seen on the slanted surface on top of the lava.
Here's a colorful map to show this concept in action:
Light Flicker IMPORTANT: SKIP THIS SECTION: Light flicker is seldom used because it is VERY annoying and can potentially cause illness in those who are sensitive to rapid changes in color or intensity of light. For this reason, the entire section is in a spoiler. If you do not wish to use light flicker (and you shouldn't) just make each row a single color all the way across the width of the lightmap as shown in the previous example.
Varying the intensity or color of columns in the light source map will cause the light to "flicker" constantly. This is based on a random value, so there's no way to control which column Minecraft will choose its color from in any given frame. Likewise, there's no way to change the frequency of this change meaning that the flashing will always be fast and unpredictable.
For this reason, it is STRONGLY suggested that any variation you make be very subtle. Rapid, pronounced changes to the lighting can be very annoying. Extreme changes can be even worse, hence the repeated warnings pervasive in this section and the need to keep this entire section in a spoiler.
Here's an example of a lightmap that has just a little bit of flicker to it:
Note how the colors aren't being used in any particular order, or even a distinct pattern (beyond the repeat of the animated .png). Remember that you're dealing with a completely random selection, and that there's no way to slow it down or make it more linear.
Even though this example is very subtle, it's easy to see how it could grow tiresome to look at this flickering for a lengthy amount of time.
EPILEPSY WARNING!
Please should be aware that variation along the horizontal axis of the Block Light Map can be used to create rapid, random shifts in the color and intensity of on-screen graphics. Discretion is STRONGLY advised due to the possibility of accidentally triggering epileptic seizures. If you are unsure if you have any conditions triggered by rapid color or light changes, please do not attempt any of the techniques discussed in this section. Even if you're sure be very VERY careful; particularly if you plan to publish your pack. Remember: Your the only person responsible for any harm your pack causes.
IMPORTANT: SUBTLETY!: It cannot be stressed enough how important subtlety is when adding flicker. Too much variation can cause very annoying flickering. This can be very hard on the eye. After seeing it in-game, assume that it's going to be worse for someone else than it is for you and reduce the variation by half.
Tip: Testing Makes Perfect: While it's always advisable to test your work in-game, for light map flicker it's necessary to actually play with your light map to see how it affects your gameplay. If you find your eyes are getting sore when you're in a cave or indoors due to the flickering light, you'll want to reduce it. On the other hand, if you don't notice it at all you may need a bit more variation. Play the game with your lightmap rather than just looking at it and making a judgement like you would an ordinary block texture.
How Lighting is Calculated: Now that you've created both light maps, you've put them together in a single image stacking the sky light section on top of the torch light section. You may have even tested it out in-game, and the results may not have been what you expected them to be.
The way Minecraft calculates the lighting of any particular block face is to first calculate which pixel on each of the two maps that have already been discussed is used.
For the first map, it chooses the one pixel that's at the intersection of the row that corresponds to the amount of sky exposure, and the column that corresponds to the time of day (or lightning flash). For the second map, chooses a random pixel along the row that corresponds to that block's light level from non-sky light sources.
Once Minecraft has chosen these two values, it compares them and chooses the brighter of the two to represent the lighting in that block. It doesn't blend the colors between the two, it simply chooses the brighter one and goes with it.
This is why, for example, if you're using drastically different color schemes for your sun light and block-emanated light that it will sometimes be very obvious which blocks are being lit by the sky and which are not just because of the color variation. If the block light is brighter than your sun light it will win out. If you don't understand this and just assigned your values based on what looked good, you may end up wondering why the lighting always seems to draw from one map or the other, even when that's not what you want to happen.
4. Night Vision: After you've gotten your lighting just the way you want it, you may decide that you want to change how it looks while you have the Night Vision effect active. This step is entirely optional, so if the normal Night Vision lighting looks fine to you, then there's no reason to bother with this.
The way to do this is create a second set of maps below the first in the same image. These maps are, believe it or not, made exactly the same way the top two sets maps. Everything is exactly the same in how they work. The difference is that you have the opportunity to choose different, and usually brighter, values with the night vision set. For example, you may want your shadows to trail off into a medium cyan rather than a very dark blue while under the effect of night vision. You're free to choose your colors and values with these maps, exactly the same way you chose them when not under night vision in the two primary maps.
Here's an example map, and how it displays the environment:
Because the normal and nigh tvision maps work exactly the same way, if you were to swap the top and bottom halves of this map you'd have night vision normally, and normal vision when under the effect of a nigh tvision potion. By that same token, just having a night vision section in your lightmap doesn't guarantee better vision while under the effect of a night vision potion. If you use a strait copy of your normal lightmap without brightening it, players will have normal vision even when under the effect of a night vision potion. You could also be a total troll and make the night vision half darker, thus making it harder for players to navigate in the dark.
5. Nether and End Light Maps: Color maps for the Nether and End are done exactly the same way that color maps for the overworld are. There's one very important difference though: There's no day or night and no degrees of sky exposure.
What does that mean exactly? Well, it means that the entire Sky Light half of the color map can just be bucket-filled with a single color! The most complicated and time-consuming aspect of lightmap creation can be circumvented with a single tap of your stylus!
It's important to know, particularly in the case of the Nether, that even if there is sky exposure (such as if you use Dark Oak trees or creative mode to break through bedrock), Minecraft still won't register it as sky exposure since that dimension was not designed with the idea that there would ever be sky exposure in mind. The End is designed with the idea that the sky has no sun or moon, and thus doesn't emit light so sky exposure is meaningless.
Naturally you'll still have to decide what color you want to be pervasive in absence of torches, but that should be relatively simple and require little trial and error.
Tip: Go for 16 wide!: The only reason to make a lightmap wider than sixteen pixels is to have more control during the sunrise and sunset transitions. The End and nether don't have these, so there's no reason to have the larger file size unless you require more flicker variation for your block lighting. Sixteen-pixels wide is the minimum MCPatcher will accept, so you'll still need to make it that wide even if you don't need the extra space.
6. Download Some Examples:
Still a little confused? Want more practical examples? How about something pre-made that you can experiment on without worrying about wrecking your own stuff? Well, here you go!
Note that by default only the final examples are loaded. You can go into the lightmap folder and switch around the examples by renaming them. This is a little bit of work, but there's no way to have a pack where EVERY example in this thread is loaded by default.
7. Troubleshooting: Coming soon. Post any problems you're having in this thread. If you have a good problem, the answer might make it into this section!
8. Frequently Asked Questions: Q: Do I need MCPatcher to use lightmaps? A: The need for MCPatcher is mentioned no less than three times on this page. So... yes. You do.
Q: Will this work with Optifine? A: Maybe. According to Optifine's thread it will, but I've also heard of Optifine crashing when exposed to lightmaps. Try it and post what your result is in this thread.
Q: Do light maps affect mob spawning? A: No. Mobs will spawn at the light levels the game calculates, which have nothing to do with the light that it displays in-game. Lightmaps are purely aesthetic.
Q: Do lightmaps change when going into a Nether or End biome in the overworld? A: No. Lightmaps are dimension-specific, not biome-specific. If you want to see the lightmaps made for the Nether or End, you actually have to visit those dimensions.
9. Any Questions?
If there's anything that you don't understand, want clarified, or just can't figure out feel free to post in this thread and someone (maybe even me) will try to help you out.
Please be clear about what you're having problems with. Saying "it's not working" doesn't help anyone to help you. Provide screenshots if possible. Also, be prepared to offer a download of the lightmap files that aren't working. Sometimes we just have to see what you've done in order to tell you what you did wrong.
Hopefully this thread helps some of you who are having problems with this relatively unknown area of MCPatcher functionality.
This is immensely helpful, The explanations and the download of templates and examples are great. (:
Thank you!
Thank you. I've always found that that it's good to offer a variety of learning aids ranging from text, to images, to practical examples when making a tutorial. Not everyone learns the same way, so it's good to have a variety of approaches.
Oddly enough I also had nearly completed my light map when I saw this.
This sentance made the whole read worthwhile:
"Once Minecraft has chosen these two values, it compares them and chooses the brighter of the two to represent the lighting in that block. It doesn't blend the colors between the two, it simply chooses the brighter one and goes with it."
An easy way to fix weird lightmap color choosing is to make the torch light darker than the sky light (which can be done by making the 0 and 1 levels the same or shifting the torch light 1 down). I would also suggest that the hue and darkness values for the final color be chosen separately. Otherwise you will get "halos" of light around your torches. (hence why I cannot make my lightmap any darker -- remember, play on moody!)
I just tried light maps in the nether and end. It totally changed the fog to bright red and white respectively, I haven't done anything else to adjust fog/hardcoded colors. Is this normal, or am i confused?
Wait, wait, wait. Is the top section of the colourmap combined with the sky colour and lowere block-section of the lightmap?
They're on the same image, if that's what you mean. The top 16 pixels is the sky lighting (for both time of day and directness of sky light), and the bottom 16 are for block lighting. These two section are in the same image, but their colors aren't combined; just compared.
Oddly enough I also had nearly completed my light map when I saw this.
This sentance made the whole read worthwhile:
"Once Minecraft has chosen these two values, it compares them and chooses the brighter of the two to represent the lighting in that block. It doesn't blend the colors between the two, it simply chooses the brighter one and goes with it."
An easy way to fix weird lightmap color choosing is to make the torch light darker than the sky light (which can be done by making the 0 and 1 levels the same or shifting the torch light 1 down). I would also suggest that the hue and darkness values for the final color be chosen separately. Otherwise you will get "halos" of light around your torches. (hence why I cannot make my lightmap any darker -- remember, play on moody!)
Not really sure what you mean by "halos" of light. It's up to the lightmap creator how strong he or she wants the falloff of the torch lighting to be. But yes, if you're going for having the sky lighting always overpower the torch at any given light level, that is indeed a good way to do it.
I just tried light maps in the nether and end. It totally changed the fog to bright red and white respectively, I haven't done anything else to adjust fog/hardcoded colors. Is this normal, or am i confused?
It's normal.
Believe it or not, the lightmaps do have some effect on the fog color. Why? Because it's taken from the sky color, which lightmaps influence. Look at the Nightvision example. Notice how the sky gets brighter with a brighter map? The fog color does too because it's coded to try to match the sky, except for when you're close to bedrock, which is influenced by the lightmap as a way of reducing the contrast while night vision is in effect.
If you want to see this same effect in vanilla, just take a potion of Night Vision while in the Nether.
I honestly had little-to-no intention of customizing lightmaps for my packs, however with this, it may be the next thing I do! You covered every aspect in detail, and explained to me why Summerfields has a realistic flickering so I can replicate it.
I can think of a lot I can do with this information in a modern pack...
Two questions:
1. In the practical example under sky exposure, what is the slightly lighter column on the right side of the lightmap?
2. The width of the lightmap spans across any source of lighting? So the wider it is, the smoother the transition would be? Or if you had a thin one and put several hues on would the game automatically smooth them?
I honestly had little-to-no intention of customizing lightmaps for my packs, however with this, it may be the next thing I do! You covered every aspect in detail, and explained to me why Summerfields has a realistic flickering so I can replicate it.
I can think of a lot I can do with this information in a modern pack...
Excellent! I wrote this tutorial to help people understand this little bit of obscure MCPatcher functionality, and to get them excited about trying it for themselves.
Two questions:
1. In the practical example under sky exposure, what is the slightly lighter column on the right side of the lightmap?
The far-fight column in the sky map is always the light during a lightning flash. I made it slightly lighter in that example to make it easier to point to the pixel just to the left of it with my lines. I didn't do this on the colorful example because it's on the opposite side. Also, I forgot.
2. The width of the lightmap spans across any source of lighting? So the wider it is, the smoother the transition would be? Or if you had a thin one and put several hues on would the game automatically smooth them?
The game blends smoothly between them. Having a wider lightmap gives you more control during the sunrise/sunset transition, it doesn't guarantee that transition will be any smoother. With more control in your hands, you can more precisely affect the smoothness of the transition either negatively or positively.
I'd already had a pretty accurate lightmap complete when I read this, but knew nothing about the rain and thunderstorm values until now. Maybe full-saturation yellows, reds and purples weren't the best idea...
I might just go redo my lightmap. Be back in never.
I'd already had a pretty accurate lightmap complete when I read this, but knew nothing about the rain and thunderstorm values until now. Maybe full-saturation yellows, reds and purples weren't the best idea...
I might just go redo my lightmap. Be back in never.
I suppose that depends on what color you want the world to be when you go out for a walk in the rain.
And this is why I always tell people to actually play the game with their packs active.
Hey, I'm trying to use the old lightmaps from before beta 1.8, but when I put the lightmaps in the area of the resourcepack like you said, the lighting is still orange and not white. I'm using mcpatcher too.
Hey, I'm trying to use the old lightmaps from before beta 1.8, but when I put the lightmaps in the area of the resourcepack like you said, the lighting is still orange and not white. I'm using mcpatcher too.
Would you mind posting it here. I can't seem to find the lightmap in the beta Minecraft files I have.
They should work. Are you sure you're putting them in the proper folder?
Yes, followed every step correctly and thoroughly. EDIT: I figured out the issue, the png files needed to be renamed to "world" not "lightmap". Didn't know mojang changed the name of the lightmaps. =D
Welcome to my lightmap tutorial. Lightmaps are one of the more difficult parts of MCPatcher to understand. Unlike other aspects such as CTM or CIT, lightmaps don't have expansive config files. Understanding them isn't a matter of mastering what all the options do, but just figuring out how each pixel in the lightmap translates to the lighting you see in the world. In this respect, they're a bit of an oddity within MCPatcher's vast array of mods, and one that requires some explaining to understand.
In this tutorial you'll learn how each section of the lightmap works, what it all means, how the sections fit together, and most importantly how to make aesthetically pleasing lightmaps for your Resource Pack.
Tip: Watch for Green Text: When I write tutorials, I add little tidbits in green text lines. These are often helpful hints or little extras. Keep an eye out for them, as they may prove helpful.
IMPORTANT: YOU NEED MCPATCHER FOR THIS: To (hopefully) head off this question, yes, this feature requires MCPatcher. It will NOT work in vanilla Minecraft. I will be ignoring anyone who asks about this.
1. Templates and File Placement:
To begin with, it helps to have a basic template of how the lightmaps work. Without a basic understanding of the placement of your colors, the rest of this tutorial is entirely pointless.
Lightmaps must always be either 32 or 64 pixels in height, depending on whether you want to include the nightvision section or not, but can be any width. For ease of understanding, I've created three templates for the three most common widths of lightmap: 16 wide, 32 wide, and 64 wide. You can save them from the images in the spoiler below. Note that none of these include the nightvision section, which will be discussed later in the tutorial.
Tip: Why Different Widths?: The only difference in the widths of lightmaps is how much control you have over the color change during sunrise and sunset. If you don't care about having fine color control, go with the 16 wide one since it will give you the least amount of trouble.
16 Wide:
32 Wide:
64 Wide:
File Names and Placement:
All of your lightmaps are placed in "\assets\minecraft\mcpatcher\lightmap\", which should all be within your resource pack's folder or .zip file. The file "world0.png" is for the overworld. "world-1.png" and "world1.png" are for the Nether and End dimensions respectively.
2. Sky Light Map:
Lightmaps come in distinct sections. The top 16 rows of pixels are always the map that deals with lighting from the sky.
Tip: Overworld Only: While the information in this section technically apply to all three dimensions in Minecraft, they're really only useful for the overworld. This is explained in more detail in the section on the End and Nether lightmaps. If you're not making a map for the overworld, skip ahead to the section on the Light Source Map half of the color map.
Layout:
The top part of the lightmap that deals with the light from the sky is by far the most difficult section to deal with, mainly because there aren't many good explanations of how it functions available.
Using the templates above, here's a basic rundown of how this image works:
You may notice the two arrows in the above image that say "Sky Exposure" and "Time of Day". These are where things get complicated. If you've taken any reasonably advanced math course, seeing lines like this probably makes you think of graphic points on a grid. In essence, that's exactly what you're doing. The exact pixel that dictates the brightness and color of a block is based on that block's exposure to the sky (not necessarily the sun) and the time of day.
Understanding how each of these axises operates, and how they interact, is key to understanding the top section of the lightmap.
Sky Exposure:
The vertical axis of the upper portion of the lightmap is for sky exposure. The bottom row represents full sky exposure. That is, when you're standing directly under the open sky with no light-blocking blocks overhead. The top row represents no sky exposure. This is the row that's used when you're more than fifteen blocks away from a block that's exposed to the open sky.
Note that's I'm specifically referring to this as "sky exposure" not sunlight as you may have read in other guides or tutorials. The reason for this is simple: the vertical axis isn't based at all on whether or not the sun is out. The bottom row represents both direct sunlight, and direct moonlight depending on the time of day (the horizontal axis), which will be covered in the next section.
Here's an illustration to help you visualize which row is used based on the exposure to the open sky:
Tip: Deep in a Cave: Pay attention to the fact that the top row means no influence from the sky. A common mistake that I see a lot of texture artists make is to have that top row vary in intensity or color based on the time of day, even though the sky should have no influence on it at all. If you're going for realism, try to have the top row be a single color value all the way across. On the other hand, if you want to be able to know what time of day it is even when you're deep underground, it's possible to have the light change by giving variance to this row.
Tip: What's my (Sun) Light Level: Need an easy way to find how much sky exposure you have? Open your debug menu in-game (F3) and look for "sl:" in the second-to-bottom row. This is how much exposure you have to the sun. Fifteen is bottom row of the light map while zero is the top row.
Time of Day:
The horizontal axis primarily represents the time of day, but also has a section on the far right side exclusively for lightning. The far left of the image is night time. On the far right is lightning. Just to the left of the lightning is the daylight. The wide area in between night and day is the sunrise and sunset transition.
The transition for sunrise and sunset is the reason for the variable width of the lightmap. Having a wider map gives you finer control over the changes in color as the sun rises or sets, but offers no other benefit. There is no way to give sunrise and sunset different colors or light levels; both transitions use the same one, but move in different directions along the horizontal axis.
Here's a demonstration showing the changes in the horizontal axis as time passes:
Lightning, Thunderstorms, and Rain
To the right of the column used for daytime, there's one or more column used for Lightning. For the most part, only the far right column is used for a lightning strike. On wider maps, there may be multiple columns between the daylight column and the lignting column. These columns are apparently unused, most likely as a result of how MCPatcher calculates the positions for various times along with width of the axis with daylight being at 15/16 of the width rather than just in the second-to-right column as an absolute position.
On the templates, there are two columns specifically highlighted: one for rain and one for thunderstorms. These columns are used when the associated weather phenomenon happens during normal daylight hours. Unlike the columns reserved for lightning, they're also part of the normal sunrise/sunset fade, though, so you can't color them individually to be used only during weather. They're marked on my templates primarily so that you don't wonder why your world turns an odd color when it rains.
It's important to note that the only column that's always exact is the lightning strike column. The columns for rain and storms are not precise, and will pick up some of the color from the columns next to them due to the way Minecraft attempts to blend colors during the sunrise and sunset transitions. If you're not getting exactly the color you want for these, try spreading that color slightly into the columns to the left and right of the primary columns to boost the effect.
Putting It All Together:
Now that you have an understanding of what each axis of a lightmap does, it's time to put the two together. Your darkest colors are going to be at the top and the left side of your color map. The top because it is the farthest removed from the sky, and thus sunlight, and the left because it represents night time and thus will have minimal lighting. The brightest spot should be at the bottom-right of the color map as it represents full sky exposure during the daytime.
Keep in mind the area on the right that's reserved for lightning. An easy way to fill in these areas is simply to borrow the column you've used for daylight. This works, and will go largely unnoticed, because Minecraft will change the lighting from a much darker column to the lightning column in only a few frames. The lightning itself also doesn't last very long, so most people won't notice that it's the same brightness as lightning. If you'd like to be a little sneakier about hiding this duplicity, consider giving your lightning a different hue than your normal daylight.
Here's an example of a working colormap that takes into account both the time of day, and exposure to the sky:
If you load this example pack (see the downloads section), you'll notice how at sunset the color map cycles from yellow (daylight) through orange, red, and purple to a deep bluish hue at night. You can easily see where these changes occur on the color map. Likewise, if you set your game weather to lightning ("/weather thunder" in the chat line with cheats enabled), you'll see that during lightning strikes the world briefly goes a bright cyan color. Again, it's easy to see where this occurs on the example colormap.
Tip: One Column at a Time: If you're having trouble making things look right, do one column at a time. Start with the daylight column. Get it the way you want to with your full sunlight at the bottom, and your deep cave lighting at the top. When you've gotten that the way you want it, do your night time column. Then the lightning columns. Finally, do the in-between columns that constitute your sunrise and sunset transition. Don't be afraid to stop time in Minecraft ("/gamerule doDaylightCycle false") and advance a few ticks at a time to get a feeling for each and every moment of your sunrises and sunsets if that's what you need to do.
3. Light Source Map:
The second set of sixteen rows on your lightmap deals with the light emanated by light sources such as torches, glowstone, redstone lamps, jack-o-lanterns, and so forth.
Tip: Leave it Black for Testing: When you're testing the previous section, color the sixteen rows that you use for your light sources black. By doing this, you won't get any influence from light sources and will easily be able to see how pure sky lighting affects your world. Likewise, when testing this half it's a good idea to blot out your sky lighting with solid black. That way you can be sure about the colors and intensities you're seeing coming from your light sources. Don't forget to make backups so you don't lose anything by accident!
Light Levels:
This half of the lightmap is much easier to understand as it works with a real, tangible value for how it calculates which row it draws any given face's lighting value from. In particular, it uses that block's light level.
Tip: What's my (Torch) Light Level?: Just as you can use the debug menu to find how much sky light you're getting, you can also use it to find how much light you're getting from a lightsource. With your debug menu open (F3) look for "bl:" in the second-to-bottom row. Fifteen represents the bottom row, and zero represents the top row of this section. Keep in mind that this is the lighting at the level of your head. The best way to see this effect in-game is the embed a piece of glowstone in a flat wall, deep in a cave, at eye level, with no other light sources around. Look at the blocks on that same wall at eye level and either look at your debug menu, or count the number of block spaces away from the glowstone you are and compare that number to the rows on your lightmap.
Just as the top half of the lightmap had the top hidden far away from the light, the top row of this half likewise represents a block with absolutely no light coming from any light source. Similarly, the bottom row represents the strongest light possible. This bottom row is rarely seen in-game since that light level is usually within any block bright enough to give that level. The only place to view it currently is in flowing lava. Any time a lava flow does not fill the entire block, the highest light level can be seen on the slanted surface on top of the lava.
Here's a colorful map to show this concept in action:
Light Flicker
IMPORTANT: SKIP THIS SECTION: Light flicker is seldom used because it is VERY annoying and can potentially cause illness in those who are sensitive to rapid changes in color or intensity of light. For this reason, the entire section is in a spoiler. If you do not wish to use light flicker (and you shouldn't) just make each row a single color all the way across the width of the lightmap as shown in the previous example.
Varying the intensity or color of columns in the light source map will cause the light to "flicker" constantly. This is based on a random value, so there's no way to control which column Minecraft will choose its color from in any given frame. Likewise, there's no way to change the frequency of this change meaning that the flashing will always be fast and unpredictable.
For this reason, it is STRONGLY suggested that any variation you make be very subtle. Rapid, pronounced changes to the lighting can be very annoying. Extreme changes can be even worse, hence the repeated warnings pervasive in this section and the need to keep this entire section in a spoiler.
Here's an example of a lightmap that has just a little bit of flicker to it:
Note how the colors aren't being used in any particular order, or even a distinct pattern (beyond the repeat of the animated .png). Remember that you're dealing with a completely random selection, and that there's no way to slow it down or make it more linear.
Even though this example is very subtle, it's easy to see how it could grow tiresome to look at this flickering for a lengthy amount of time.
EPILEPSY WARNING!
Please should be aware that variation along the horizontal axis of the Block Light Map can be used to create rapid, random shifts in the color and intensity of on-screen graphics. Discretion is STRONGLY advised due to the possibility of accidentally triggering epileptic seizures. If you are unsure if you have any conditions triggered by rapid color or light changes, please do not attempt any of the techniques discussed in this section. Even if you're sure be very VERY careful; particularly if you plan to publish your pack. Remember: Your the only person responsible for any harm your pack causes.
IMPORTANT: SUBTLETY!: It cannot be stressed enough how important subtlety is when adding flicker. Too much variation can cause very annoying flickering. This can be very hard on the eye. After seeing it in-game, assume that it's going to be worse for someone else than it is for you and reduce the variation by half.
Tip: Testing Makes Perfect: While it's always advisable to test your work in-game, for light map flicker it's necessary to actually play with your light map to see how it affects your gameplay. If you find your eyes are getting sore when you're in a cave or indoors due to the flickering light, you'll want to reduce it. On the other hand, if you don't notice it at all you may need a bit more variation. Play the game with your lightmap rather than just looking at it and making a judgement like you would an ordinary block texture.
How Lighting is Calculated:
Now that you've created both light maps, you've put them together in a single image stacking the sky light section on top of the torch light section. You may have even tested it out in-game, and the results may not have been what you expected them to be.
The way Minecraft calculates the lighting of any particular block face is to first calculate which pixel on each of the two maps that have already been discussed is used.
For the first map, it chooses the one pixel that's at the intersection of the row that corresponds to the amount of sky exposure, and the column that corresponds to the time of day (or lightning flash). For the second map, chooses a random pixel along the row that corresponds to that block's light level from non-sky light sources.
Once Minecraft has chosen these two values, it compares them and chooses the brighter of the two to represent the lighting in that block. It doesn't blend the colors between the two, it simply chooses the brighter one and goes with it.
This is why, for example, if you're using drastically different color schemes for your sun light and block-emanated light that it will sometimes be very obvious which blocks are being lit by the sky and which are not just because of the color variation. If the block light is brighter than your sun light it will win out. If you don't understand this and just assigned your values based on what looked good, you may end up wondering why the lighting always seems to draw from one map or the other, even when that's not what you want to happen.
4. Night Vision:
After you've gotten your lighting just the way you want it, you may decide that you want to change how it looks while you have the Night Vision effect active. This step is entirely optional, so if the normal Night Vision lighting looks fine to you, then there's no reason to bother with this.
The way to do this is create a second set of maps below the first in the same image. These maps are, believe it or not, made exactly the same way the top two sets maps. Everything is exactly the same in how they work. The difference is that you have the opportunity to choose different, and usually brighter, values with the night vision set. For example, you may want your shadows to trail off into a medium cyan rather than a very dark blue while under the effect of night vision. You're free to choose your colors and values with these maps, exactly the same way you chose them when not under night vision in the two primary maps.
Here's an example map, and how it displays the environment:
Because the normal and nigh tvision maps work exactly the same way, if you were to swap the top and bottom halves of this map you'd have night vision normally, and normal vision when under the effect of a nigh tvision potion. By that same token, just having a night vision section in your lightmap doesn't guarantee better vision while under the effect of a night vision potion. If you use a strait copy of your normal lightmap without brightening it, players will have normal vision even when under the effect of a night vision potion. You could also be a total troll and make the night vision half darker, thus making it harder for players to navigate in the dark.
5. Nether and End Light Maps:
Color maps for the Nether and End are done exactly the same way that color maps for the overworld are. There's one very important difference though: There's no day or night and no degrees of sky exposure.
What does that mean exactly? Well, it means that the entire Sky Light half of the color map can just be bucket-filled with a single color! The most complicated and time-consuming aspect of lightmap creation can be circumvented with a single tap of your stylus!
It's important to know, particularly in the case of the Nether, that even if there is sky exposure (such as if you use Dark Oak trees or creative mode to break through bedrock), Minecraft still won't register it as sky exposure since that dimension was not designed with the idea that there would ever be sky exposure in mind. The End is designed with the idea that the sky has no sun or moon, and thus doesn't emit light so sky exposure is meaningless.
Naturally you'll still have to decide what color you want to be pervasive in absence of torches, but that should be relatively simple and require little trial and error.
Tip: Go for 16 wide!: The only reason to make a lightmap wider than sixteen pixels is to have more control during the sunrise and sunset transitions. The End and nether don't have these, so there's no reason to have the larger file size unless you require more flicker variation for your block lighting. Sixteen-pixels wide is the minimum MCPatcher will accept, so you'll still need to make it that wide even if you don't need the extra space.
6. Download Some Examples:
Still a little confused? Want more practical examples? How about something pre-made that you can experiment on without worrying about wrecking your own stuff? Well, here you go!
>> DOWNLOAD <<
This pack, and all of the lightmaps contained therein, are released under the Creative Commons Attribution 4.0 International license.
Note that by default only the final examples are loaded. You can go into the lightmap folder and switch around the examples by renaming them. This is a little bit of work, but there's no way to have a pack where EVERY example in this thread is loaded by default.
7. Troubleshooting:
Coming soon. Post any problems you're having in this thread. If you have a good problem, the answer might make it into this section!
8. Frequently Asked Questions:
Q: Do I need MCPatcher to use lightmaps?
A: The need for MCPatcher is mentioned no less than three times on this page. So... yes. You do.
Q: Will this work with Optifine?
A: Maybe. According to Optifine's thread it will, but I've also heard of Optifine crashing when exposed to lightmaps. Try it and post what your result is in this thread.
Q: Do light maps affect mob spawning?
A: No. Mobs will spawn at the light levels the game calculates, which have nothing to do with the light that it displays in-game. Lightmaps are purely aesthetic.
Q: Do lightmaps change when going into a Nether or End biome in the overworld?
A: No. Lightmaps are dimension-specific, not biome-specific. If you want to see the lightmaps made for the Nether or End, you actually have to visit those dimensions.
9. Any Questions?
If there's anything that you don't understand, want clarified, or just can't figure out feel free to post in this thread and someone (maybe even me) will try to help you out.
Please be clear about what you're having problems with. Saying "it's not working" doesn't help anyone to help you. Provide screenshots if possible. Also, be prepared to offer a download of the lightmap files that aren't working. Sometimes we just have to see what you've done in order to tell you what you did wrong.
Hopefully this thread helps some of you who are having problems with this relatively unknown area of MCPatcher functionality.
Very good tutorial
Thank you. I've always found that that it's good to offer a variety of learning aids ranging from text, to images, to practical examples when making a tutorial. Not everyone learns the same way, so it's good to have a variety of approaches.
I'm glad you like what I've done.
Thank you! I'm happy to be of service to one of the texturing greats.
Sorry. I've been busy with other things. I would have liked to have had it up a week ago but, you know, life happens.
Thank you!
This sentance made the whole read worthwhile:
"Once Minecraft has chosen these two values, it compares them and chooses the brighter of the two to represent the lighting in that block. It doesn't blend the colors between the two, it simply chooses the brighter one and goes with it."
• Follow Lithos on Twitter for release announcments
* Join the Lithos Discord for previews and to help
Putting the CENDENT back in transcendent!
• Follow Lithos on Twitter for release announcments
* Join the Lithos Discord for previews and to help
They're on the same image, if that's what you mean. The top 16 pixels is the sky lighting (for both time of day and directness of sky light), and the bottom 16 are for block lighting. These two section are in the same image, but their colors aren't combined; just compared.
Does that answer your question?
I hope you mean that in an "it was useful" way.
Not really sure what you mean by "halos" of light. It's up to the lightmap creator how strong he or she wants the falloff of the torch lighting to be. But yes, if you're going for having the sky lighting always overpower the torch at any given light level, that is indeed a good way to do it.
It's normal.
Believe it or not, the lightmaps do have some effect on the fog color. Why? Because it's taken from the sky color, which lightmaps influence. Look at the Nightvision example. Notice how the sky gets brighter with a brighter map? The fog color does too because it's coded to try to match the sky, except for when you're close to bedrock, which is influenced by the lightmap as a way of reducing the contrast while night vision is in effect.
If you want to see this same effect in vanilla, just take a potion of Night Vision while in the Nether.
I can think of a lot I can do with this information in a modern pack...
Two questions:
1. In the practical example under sky exposure, what is the slightly lighter column on the right side of the lightmap?
2. The width of the lightmap spans across any source of lighting? So the wider it is, the smoother the transition would be? Or if you had a thin one and put several hues on would the game automatically smooth them?
"And with that, POW! I'm gone." ---Lord Crump
The far-fight column in the sky map is always the light during a lightning flash. I made it slightly lighter in that example to make it easier to point to the pixel just to the left of it with my lines. I didn't do this on the colorful example because it's on the opposite side. Also, I forgot.
The game blends smoothly between them. Having a wider lightmap gives you more control during the sunrise/sunset transition, it doesn't guarantee that transition will be any smoother. With more control in your hands, you can more precisely affect the smoothness of the transition either negatively or positively.
I hope that helped!
I might just go redo my lightmap. Be back in never.
And this is why I always tell people to actually play the game with their packs active.