PL Tool lighting masks

You can download additional level masks for use with PL Tool's lighting preview feature.

For the preview to work, a set of two images is required: a fullbright image and a mask image that will be used for palette/color selection. This page has some pre-made masks (taken from Dreamcast levels on PC) that you can use in PL Tool.

Download level masks (open folder)

Making your own masks

If you are working on a custom level, you need to create your own lighting mask. Creating masks is a pretty tedious process, although not very involved technically. You need to produce two ingame screenshots using two sets of test palettes: fullbright and color coded. To do that, you need to use the following PL files with your mod:

Fullbright palettes

Color-coded palettes

The easiest way to load modified palettes is to replace the PL files in the Lantern Engine mod's system folder.

Creating lighting masks for PL Tool has a few nuances, which makes it pretty annoying, but you have to take them into account if you want to get a good-looking mask:

1. Both screenshots can be taken at any resolution, but the aspect ratio has to be 4:3. Any 4:3 resolution will work, but the palettizer resizes the screenshots to 512x384 on import. If you have 16:9 screenshots, you need to either crop both of them or add black borders to make the resolution match the 4:3 aspect ratio. 512x384, 640x480, 800x600, 1024x768 and 1280x960 are good for 4:3 images. If you don't adjust the aspect ratio to 4:3, the palettizer will squish them into 512x384, which will still work but the image will be stretched.

2. Certain things may interfere with the mask's accuracy. To take good mask screenshots you should disable the HUD and remove things like particle effects. You can do that by making their textures completely transparent or disabling them in code. Try the WIP mod below, which may help you.

3. Things that ignore lighting should be white in the mask image. If you have scenery that ignores lighting, you will have to edit the mask image to remove pixels that are the same as in the fullbright image - those pixels need to be replaced with white. Another way to achieve the same result is to replace all textures (except those mentioned in the previous point) with a solid white color - this is the preferred method as it will help if you have transparency in your screenshots. Again, the WIP mod should take care of that.

4. The fullbright and the mask image should be completely synchronized, which means any moving objects (characters, enemies, animated scenery etc.) should have the exact same position, rotation and animation frame in both screenshots. The camera should also be exactly the same. This is the most difficult part about creating accurate masks. If the images are not exactly the same, animated objects will have visible borders/outlines, and the scenery may be palettized wrongly if the camera is very different. For a basic level lighting preview, just making the camera the same should be enough. Loading a level without pressing anything will let you get the same camera for the level start point easily.

Here are some mods that can help you with mask creation:

TestSpawn by x-hax (my edit with rotation) - this mod can bypass all menus and load any level from command line. Usage:

sonic.exe -l LevelID -a ActNumber -c CharacterID -p X Y Z YRotation

Level IDs are the same as the internal level list, same for character IDs (e.g. Sonic is 0, Tails is 2).

WIP masks mod with blank textures to facilitate mask creation, Lantern Engine included.