Lights, Camera, Action!
Since the last time I made a post, I've spent a lot of time working on fine tuning some of the visuals. I know, I know. You're not 'supposed' to spend so much time early on worrying about the way the game looks. I should be spending more time focusing on how it plays and feels, right? I have three things to say to that! First off, working on the visuals for the game is fun. Second, one of the core aspects of Hazordhu will be exploring the hand-crafted game world, and in order for that to feel right when I work on it, I need the environment and characters to feel like they're all how they should be. And lastly, and most importantly, most people just don't like looking at screenshots of code.
In trying to drum up more interest in the game, its in the best interests of the project for people to know, right off the hop, how the game is going to look, and how the game is going to feel. That way, as I post updates with gameplay, it'll be showcased alongside great visuals as well! Now that my rant is over, let's see what I've been up to! In total over the last few weeks I've put in around 30 hours of development (imagine how fast it'll go once we hit that $800 milestone!). In that time I've done some more work in 3 areas: tuning the toon shader, redoing the models, and beginning work on the day/night cycle. So strap in, because we're getting in deep this week (month)! The Shader I'm not a visual effects guy. It's entirely new territory for me! Hazordhu probably won't have a whole bunch of different shaders, and the astute eye among you will notice that I haven't used a single texture (save for the terrain mapping). This is on purpose. Using textures means that I would be adding another layer to the workflow, and every layer means more time passes before the game gets into your hands. So how can you make a game look decent without texturing? Enter, Cel Shading.
I went over the general idea of cel shading in the last post, but I've learned a lot about it, so I'll go into a bit more detail. If you don't know what Cel Shading is, it's when you basically strip away all but two (sometimes 3 or 4) colours, to create a cartoony look. It's a relatively simple trick to pull off, and it can be composited with textures for added detail, but for Hazordhu's sake, we're keeping it very simple.
Unity has this slick feature called Shadergraph, which I've used to make the cel shader. It's a visual scripting tool that means I didn't have to learn to write shader code, or any code for that matter. For those of you curious, here's the graph:
Starting from the left at the big yellow guy, we calculate some values for our main light source such as the direction it's shining, its colour, how bright it is, and then we use those values to calculate 3 things. 1) Our diffuse light, or just the general lighting of the models. Think of diffuse light like the colour of a matte surface with no shine. 2) Specular Highlight, which adds a glossy highlight or sheen 3) A Directional Highlight, which is just an extra little touch of shine when the light hits an object just right. Specular and the Highlight are both optional, not all items have them. You can see the difference below looking at the helmet compared to the clothing: The helmet has both the specular and the directional highlight, which give it more shine and definition. We've kept the outlines black for now.
After we have those calculations done, we do one more thing before we add everything together: Factor in additional lights. Which is pretty straightforward, you just loop through the lights in the scene. After that, we just add a simple outline which is calculated based off the sharpest angles between the camera and the surface of the mesh. We can customize the colour of this outline in the Unity Editor, and we're good to go!
Et voila! That's what we work with to create everything from the tree trunks, to the shiny helmets! There's still a lot of work to do on it, especially where secondary lights are concerned, but it's come a long way since day 1, and it's looking pretty darn good!
Next time we'll go over the work that went in to re-modelling our base character, and the trials and tribulations it put me through, and the brain-dead mistake that led to a 14 hour detour that led nowhere!
As always, thank you so much for your continued support! I appreciate all of you, and I can't wait to not only get Hazordhu in your hands, but to play it with you as well!
If you'd like to see these posts a week early and get some exclusive early benefits, support development on our Patreon page! We're getting so close to reaching our first milestone, where we can promise development updates every 2 weeks!