Hi! This is my first post in this community, and I want to present you my free and open source tool for normal map (and others) generator, called Laigter. In this post I will show just the basic of Laigter, and the basic usage on Godot and Unity. We will only focus in normal maps for now. If you want more info, don't hesitate to ask me!
Laigter is a tool with a simple interface, that allows the user to generate a normal map for sprites (mainly 2d) easily. Or that's the intention at least. The first thing you see when opening Laigter is the main window with the sample texture:
At the top right of the window, for the default configuration, you can see a dropbox which contains view modes. There we can change to, for example, normal and preview modes:
In the normal view, you just preview the generated normal maps. Remember that RGB in this maps refers to the components x,y,z of a normal vector to the sprite surface. This way we can emulate more realistic lighting effects.
In the preview mode, you can watch the lighting effect in real time, as it will look in your game! You can move arround the light, and play with the controls to configure it.
For loading your own sprites, just drag and drop an image file to Laigter window, or use the "Import" toolbar button. Laigter will open the image, and generate the maps with the current settings. So how do you tweak the normal map? Easy, just move the sliders!
As shown in the above image, the sliders in the "Enhance" group will affect normals for the "details" of the sprite. Height slider would affect how abrupt is the normal change on each pixel, and Soft just applies a blur to the normal map. Then we have the Bump controls:
This controls affect the normals from the edge of the sprite, to simulate it has volume. The height and soft controls have the same purpose in "Enhance" controls, and the "Distance" slider is to set how much inside the sprite you want the normals to reach.
You can preview the result changing view mode to Preview in the combobox at the top right of the window:
The easiest way to export the maps, is clicking on the "Export" button in the export Dock at bottom right. You can first select which maps to export. In this case, we will just choose Normals:
The normal map will be exported in the same directory where you have the original file. This is intentional, so you can import the files directly from your game's project directory, and the maps will be generated right there. Now you just need to import them on your engine.
Note: for using with godot, check the "Invert Y" checkbox in the axis group of the Normal dock BEFORE export. This is because godot uses negative y as up direction
So, now lets create a godot project, called whatever you want, and import both textures (sprite and normal map) into it. Also add some texture for the light (a white circle should be enough for this example). Generate a simple Node2D scene with a Sprite and a Light node as children. Asign the light Texture to the "Texture" property of the "Light2D" node in the editor. Then assign your sprite to the "Texture" property of the "Sprite" node, and the generated normal map to its "Normal Map" property. Aslo, play a bit with the light settings (specially the height) to be able to notice the effect.
And that's it! the most basic usage of Laigter + Godot.
Create a project, and import to it the normal map and the sprite. Then create a Material. Change the mode to "cutout" or "fade" and assign the normal map to the "Normal" attribute of the material. Then drag and drop the sprite to the scene. Assign the recently created material to it. Add a point light and test the result! Thats all!
Obviously, there are much more complex use cases. This is just the basic usage to get started. If there is enough interest, i can make more specific use case tutorials. If you have any further questions, you can join me at discord.
Also, making and maintaining a free and open source tool involves a lot of effort. I making this to help indie dev to make their games with minimal cost! But if you like what I'm doing, consider supporting me!
Last, i want to show you Laigter being used in my personal projects: