Devlog 5: Let There Be Light (And Shaders)!


In this week's self-study, we began to explore the intricacies of lighting! There are two primary approaches: realtime and baked lighting. By default, Unity scenes are lit using realtime lighting, which calculates lighting on the fly for all objects. However, many scenes contain 'static' objects (e.g., ground or buildings) that don’t move. For these objects, lighting and shadows can be pre-calculated during the build time, and baked into the game. Baked lighting allows for complex techniques like raycasting and ambient occlusion, resulting in high-quality visuals, even on less powerful machines. Typically, we would employ a mixture of both approaches to achieve a cohesive visual experience.

To begin learning about applying lighting, we were instructed to follow another of Brackeys' tutorials. In this tutorial, we would apply materials to game objects in the scene to act as lighting. Today we mainly dealt with 'baked' lighting (or 'lightmapping'), which is calculated during the development stage. It was fun playing around with the different lighting settings, many of which could simply be switched on or off.


The basic Brackeys tutorial product. My laptop did NOT appreciate all of this processing (70° temperature...)!!

After achieving the basic product, it was time to play around with some more effects. This would include installing the post-processing suite to Unity, and adding these functions to the camera. Part of the suite includes a 'bloom' effect, which gives the camera view a vivid glow. Additionally, we would enable 'ambient occlusion', which would further add to the softness of the lighting. As seen below, the shadows are a lot less harsh, but also remain defined. The lightmap resolution and padding were also heightened to make the monkey more smooth.

The Brackeys monkey, with added smoothness and bloom.

Next, we moved on to the basics of shaders, utilising Shader Graph, which is a tool that uses nodes in a network to build visuals - no code required! Following Brackeys yet again, we created a network of nodes, all of which corresponded with a certain effect or colour on a material. This could then be easily applied to a game object.

My basic shader, created using Shader Graph, applied to the funny Blender monki.


Adding my shader to my poly barrel - it looks tainted and evil!

The next task would be in a similar vein: this time, we'd create an animated shader! Woo! I chose to follow along with Brackeys' simple water tutorial, and add the water effect to my funny little portfolio world.

The beginning of the tutorial.

To animate the water, we would employ an effect called 'Voronoi', which randomly generates "distributing points, called seeds, that are extended outward into regions, called cells, with bounds determined by distances to other points" (Blender, n.d.). Coupled with blue shades and effects such as Multiply and Add, this would create a ripple-like shader, which we could then apply to the plain plane. :)


The water shader, created in the editor; in actuality, it's much smoother than this!


The shader applied to the plane, slowly animating away. My laptop HATES it!

Thank you :)

Blender. (n.d.). Voronoi Texture Node - Blender Manual. docs.blender.org/manual/en/2.80/render/shader_nodes/textures/voronoi.html

Brackeys. (2018, January 25). LIGHTING in Unity [Video]. Youtube. youtube.com/watch?v=VnG2gOKV9dw

Brackeys. (2019, May 20). SIMPLE CARTOON WATER in Unity [Video]. Youtube. youtube.com/watch?v=Vg0L9aCRWPE

Leave a comment

Log in with itch.io to leave a comment.