Shader Showcase Saturday #8: Subsurface Scattering

If you ever placed a strong light source behind your hand, you might have noticed how light is able to filter through the skin. Even more interesting is the fact that light “travels” inside the skin, and can sometimes make the entire hand glow. This optical phenomenon is called subsurface scattering (or SSS) and is caused by individual photons penetrating the skin, bouncing (scattering) inside it, and finally exiting from a different point. For this reason, subsurface scattering is also called subsurface light transport.

Most semi-transparent materials exhibit a certain degree of SSS, which gives them a “smoother” look. Milk, for instance, owe its uniform colouration to the presence of fat molecules which diffuse and scatter visible light very well. Even solid materials can be subjected to SSS. Marble is a typical example, and this is the reason why most subsurface scattering demos feature marble statues. Skin, milk, marble and wax are the materials which most commonly owe their look to SSS, although this is an optical phenomenon that is present in virtually all non-metallic materials.

Continue reading

Shader Showcase Saturday #7: Billboard Impostors

Some of the readers might have heard of a game called Duke Nukem 3D. Released in 1996, it was one of the first 3D games I had the chance to play. An interesting feature of that game is that most of the interactive elements (including the enemies) were not actually 3D. They were 2D sprites rendered on quads which are always facing the camera (below).

This technique is called billboarding, and early 3D games were using it extensively. Even today it is still used for some background details, such as trees in a forest far away. For instance, one of them is Massive Vegetation, which uses billboarding to render grass blades in a very realistic way.

Continue reading

Shader Showcase Saturday #6: Dynamic Snow

After two previous instalments of Shader Showcase Saturday focused on wind and rain, talking about snow was simply unavoidable.

Creating realistic snow is a serious challenge, which will be further explored in the following months. This week, we focus on how shaders can be used to add snow to an existing scene. Most of the references shown in this post will not be photorealistic. We will show on how to simulate photorealistic snow and frost in a few weeks. If you cannot wait, I would strongly advise having a look at Winter Suite. It contains some of the most realistic shaders for snowy and frosty surfaces.

As you can see from the image above, it supports translucency, subsurface scattering and the shimmering effect that is typically seen in snow.

I have also dedicated a proper tutorial on snow shading, which you can find in the article titled Surface Shading in Unity. Continue reading

Shader Showcase Saturday #5: Dripping Rain

The first time I played Diablo 2 I remember how impressed I was to see rain causing ripples on the river just behind the Rogue Encampment. But only when I looked closer I realised that those ripples were not actually caused by any raindrop. Both ripples and raindrops were simply unrelated. As it often happens, improving graphics in modern computer games is not a quest for realism: it’s all about believability.

When it comes to 2D games, creating ripples in water is relatively easy, as that is often done with particles. But for 3D objects, things are a little bit more complicated. Since meshes can be curved, is hard to have particles following those shapes correctly. Technically speaking, such an effect could be perfectly simulated with physics, but as we have seen already, fluid simulations are expensive and hard to control.

This is why most games in which you see water slowly dripping on a 3D surface often rely on shaders.

If this is your first time approaching shaders, I highly encourage you to read A Gentle Introduction to Shaders, which will get you started.

Continue reading

Shader Showcase Saturday #4: How To Start A Fire With Shaders

In the two previous instalments of Shader Showcase Saturday, we have talked about waterfalls and interactive grass. Those two subjects sound very different from each other, yet they share something in common: the original phenomenon can be modelled as a fluid simulation. This week’s Shader Showcase Saturday will continue this trend, talking about another effect that involves fluids: fire.

Continue reading

Shader Showcase Saturday #2: Waterfalls

Historically speaking, waterfalls have always had a special place in games. From Super Mario to Tomb Raider, their role has been more than just aesthetic. Often hiding secret caves, waterfalls are now iconic. This is why I believe is important to celebrate some of the most well-crafted waterfalls that have been posted online in the past few months.

I hope this will encourage more readers to try out what shaders can really do, especially when it comes to rivers, lakes and oceans.

Continue reading

Shader Showcase Saturday #1: Volumetric Crystals

When a 3D object is drawn on the screen, only its outer shell is actually rendered. This works for most solid and opaque materials, but is not powerful enough to bring life to transparent and translucent materials. Currently, this is one of the biggest limitations of most modern game engines. Volumetric rendering is a technique that allows rendering materials with a complex internal structure. The topic has been covered extensively on a tutorial tilted Volumetric Rendering, specifically designed for Unity.

In this post, however, I want to highlight some of the best volumetric effects that I have recently seen on the Internet. Not all the effects shown here might be actually using volumetric rendering, but they all give the illusion of being more than just empty shells.

Continue reading

Learning Shaders

Making games is hard. Engines like Unity and Unreal have massively lowered the barrier to entry into this industry. And now that making games is easier than it has ever been before, developers are facing a new crisis. More and more people are joining this industry every day, making it harder to succeed in such an overcrowded market.

Many games that were popular and successful five years ago, would go mostly unnoticed today. More skills are needed to make a game stand out from its competitors, and this is why I believe that learning shaders is so important.

Shaders are the paintbrushes developers use to render graphics. The look and aesthetic of many iconic games, such as Journey, Antichamber and No Man’s Sky, was made possible only by the clever use of shaders.

Whether you are a new developer wanting to make games, or a veteran of the industry, learning how to write shaders can make the difference. This unusual tutorial pays homage to some of the best online content creators that you should know if you want to start your journey into shader coding. Continue reading