This weekend I explored the viability of adding shaders in 2D game art to achieve a more dynamic look when lighting. I focused mostly on the normal map because it seems to have the biggest impact, but also interested in applying specular, opacity, and emission maps as they might be useful as well. The inspiration came from this article. Grégoire's forum post is very informative, and shows the wide range of possibilities by spitting/deferring shading. This post is my not-so-subtle "emulation" of his testing grounds. Albedo, Normal, Specular Maps + Light = Pretty Neat. Separating graphics into a few shader maps yields a drastically different look, and adds a wide range of variable lighting. It even makes basic 2D pixel art look pretty neat. I'm still working on establishing my Blender workflow for creating 3D assets, and the 2D graphics rendered. Similar to keeping sizing and mesh quality consistent, I want to be thoughtful of renders that might be needed later on. So, whether or not I end up using them, it won't hurt to have higher resolution versions, albedo, normal, and other maps in addition to the final image. Step one of this test was to create a scene, then render a baseline sample. Next, I figured out how to render a proper albedo & normal map. I'd like to eventually have a Blender scene or script setup to output all these maps at once. Rendering a specular map eluded me unfortunately. It might be easier than I think, I just seem to get bombarded with texture baking tutorials geared toward 3D artists. The Baseline - This is a typical image that I'd render for use in a 2D isometric game. It's textured & shaded. When combined in game, the lighting always has this top down 3:00PM appearance, and reflective surfaces are frozen in place despite what the lighting or surrounding conditions are. If I combine the two images below correctly, I should end up with something similar to this. Step two is to combine the albedo & normal maps. I didn't want to invest too much time installing and then learning a game engine like Unity or Godot just to test this one image out. So after searching high and low for a lightweight program that would combine these with some simple lighting tools I realized... I could just fake a 2D game engine's lighting right in Blender: Not too shabby for two flat images. Though, the metal doughnut looks like a concrete doughnut. This highlights the importance of a specular map image in this shader combination. Adding these maps makes a world of difference in a 2D game. With the addition of projected shadows, dark scenes take on a whole new life. I imagine wearing shiny plate armor could look drastically different, or areas lit by flickering torch light But, the problem with implementing this in Faldon is that we don't have normal maps. We need them for most everything in game for it to look consistent. There are thousands of frames of art when including all the props, animations, characters, and creatures. I remember we had this problem when we added the alpha channel to the newest game version. Luckily we handled this with a combination of clipping black edges, re-rendering new versions, and adding an alpha by channel in an image editor. Obstacle: No Normal Maps... A possible solution is to generate the normal from the already existing 2D graphics. But, it wont' look nearly as good as those rendered from a 3D engine. And it would require some fine tuning. I found a free tool called Laigter, and tried out some sample Faldon art: This might work. The specular map generation shown at the middle of the video with the wall weapons & shield is a nice touch. This is an example of what the metal doughnut was missing, and how metal reflective surfaces can respond to the environment. These generated normals have limitations and should probably be used to provide the texture, and not the overall geometric shape. The second video below shows why. It tests two separate normals for the same wall piece, the highly geometrical one to the right doesn't generate the correct top, left & right distinction like it should. There might be a workaround, and other tools and software to address this but definitely shows the snags that might occur in a mass normal map generation for an entire game.
0 Comments
Leave a Reply. |
Wu
Archives
October 2020
Categories
|