Editor and Ambient Lighting


Level Editing

Just a brief update on my Isometric Rendering engine. I’ve been working on the basic editor for the engine, and have made a ton of progress!

The first big change was restructuring tile data as a resource, similar to a sprite, bundling the various textures together. Thus, the IsoObject node that I use to render a 32x32 object just needs a tile and a position. This also allowed me to create a simple category resource to represent tabs of tiles in the editor. Finally, it gave me immediate access to textures to use as icons in the selection window, which was very useful. As it stands, there’s a lot to do, but the trickiest parts of the system are done. Most of what’s left is simply setting up the UI, whether to switch z-levels, pan the view, or delete placed tiles.

The only editor issue that I don’t have a good solution for is grid snapping. The current snapping is based off of a horizontal and vertical grid, which can result in overlap at the corners of tiles. Essentially, I need to find a calculation that snaps a position onto a tilted isometric grid. I might just leave it as-is though; it doesn’t make too much of a difference.

Ambient Lighting

Now for the big update! While putting together the editor, I found that I desperately needed a better lighting solution. Previously, I used a few point lights, but that leaves a lot of any scene in complete darkness. I knew I wanted ambient lighting, so this seemed like the perfect time to add it in. The input is simply a color, which is multiplied by the tile’s diffuse value at a pixel. Then, the rest of the light calculations are done, adding on to that base color for each light, depending on distance and normal angle.

In the editor setup itself, I’ve been using grey ambient lighting at exactly half intensity. This adds on to a sun-like light I’ve added by setting the falloff values to 0 and placing it far off from the editor’s center. The sun is set at exactly half intensity as well, so lit pixels end up at full color.

The editor UI options are the next big thing to do, especially an option to delete tiles. Still, it’s already in pretty usable condition!