I would have liked to have made a program that generates all the components required to make a material from an albedo texture, but that proved to be too difficult for the time I had. Instead, I have made a program that programatically generates normal maps from albedo textures.
NB: It works best if you level your textures first in photoshop before putting them in the program.
I have attached 2 files to this post, one containing the exe for windows (64 bit only) and one containing the source code if you would like to modify the program to run on a different OS.
It uses OpenGL (C++, OpenGL, GLSL) to render a real-time preview of what the normal map will look like when you save it.
It was developed from an existing algorithm that was used to turn height-maps into normal maps.
The reason I wanted to make this was because I wanted a simple alternative to the other normal map generators out there - Bitmap2Material was too complex, various others required multiple images or height maps, some were plug-ins to existing software.
I originally wanted to make this program portable to run on Linux and MacOS as well as Windows, unfortunately however, it does use Windows-specific code for the information window.
Features:
- You can save the normal maps
- You can edit the shader that changes the normal maps and see the results in real time
- It is well optimised (not too many GPU calls, no leaks)
- It is responsive
- It is free
- It has simple controls
- Handy log file in case something goes wrong compiling the shader
Bugs:
- Does not support all file types
- Can only save as bmp
- U.I. is reportedly difficult to use
- Does not close properly if you close the windows in the wrong order (can be fixed using task manager)
- No CMake, sorry
You can:
- Import files
- Change the intensity of the normal map
- Change the scale of the texture (as long as it's square)
- Change the sampling radius (affects smoothness)
- See the value of the most common colour in the image you imported (approximately)
- Invert the normal map (treats high as low and vice versa)
It uses a bunch of libraries:
- GLEW
- GLFW
- SOIL
Things you need to know:
- It relies on a configuration file called "Config.cfg"
- It relies on a folder called "images" containing "brick.jpg" - this is the default image but it can be changed in the config file
- It relies on a folder called "shaders" containing "AlgorithmB.frag" - this is the default shader but it can be changed in the config file
- If you try to resize the info window the help text will disappear and you will have to restart the program
- You will need to have a GPU or onboard graphics that supports OpenGL version 4.1 (probably)
- It relies on "glfw3.dll"
- Where I've said "it relies on..." do not move these files / folders in relation to the executable
- When downloading the "source" you are downloading the entire Visual Studio solution. You may or may not need to change some environment variables to get it to run. It uses VS2017, although it can use 15 judging by the icon. As long as you have Platform Toolset v141 you should be fine.
- Check the project properties, I think I hard-coded the directories
Any issues, you can add a comment or email me at: [email protected]
Link to download source: drive.google.com/open?id=1-OS8OjP4tqdj24hqjMKZN1fHV09yViZW
materialgeneratorstandalone.rar |