In our sixth game project I worked closely with our technical artists to create a pipeline that would let them create and put visual effects into the game without relying as much on us programmers to implement them.
I made a material editor that would let users create material-files that were readable by our game engine, containing the textures and shaders that would be used. This was built as an add-on to our already existing modelviewer which was created by my colleague Tobias Garpenhall.
With this tool I wanted to give our artists something that would be easy to use, while simultaneously letting our technical artists control the more advanced parts like shaders and pipeline states.
The tool can handle dragging and dropping of textures, meshes, shaders, and materials, as well as letting the user adjust properties like transparency, back face culling, and color tinting.
Shaders in the videos are created by Malte Ekvall & Alexander Thambert!
A vital feature of this tool was the ability to export and import materials. For this we used our own material filetype which is a json-file containing information such as textures that the material uses and what texture slots they’re tied to, what Pipeline State Object it uses during rendering, and a handful of custom variables that artists can use when making datadriven shaders.
A material that uses a custom written shader requires a new Pipeline State Object (PSO) that is comprised of a vertex shader, pixel shader, an optional geometry shader, and settings for things like transparency and backface culling. The editor also has functionality for creating and exporting these PSOs to allow our artists to create unique visual effects.
Implementing the ability to drag and drop texture files into specific texture slots meant that our artists could define their own texture slots in their shaders, since there were many situations where using the PBR standard wasn’t appropriate.