Texture Mask Shader in Unity Tutorial

Hey y’all! I was incredibly inspired by this piece of art that Caludia Rinofer created, and I wanted to try and make it as a shader.

The result was the bird you see from the header image! And, of course, I just had to make a tutorial out of it too, to show y’all how I used texture masks and other fun shader tricks to create the effect.

If you enjoy this post, please consider following and supporting Claudia, who inspired it, and checking out the free Unity assets I used for the bird and background:

Living Birds (raven 3D model)

Farland Skies (skybox)

You can find the final code for this tutorial here.

Now, on with the tutorial!

Continue reading Texture Mask Shader in Unity Tutorial

Intro to Procedural Geometry, Part 3

This is an immediate follow-up to Intro to Procedural Geometry, Part 2. If you don’t yet know how to generate a cube, make sure to read Part 1 and 2!

This tutorial assumes you know:

  • Basics of using Unity (creating objects, attaching scripts, using the inspector)
  • How to code in C# (or at least a similar language)
  • The high-level of how 3D geometry is represented in code (vertices and triangles)
  • How to use Unity’s Mesh API to create geometry
  • How to create a plane mesh in code
  • How to create a cube’s vertices and triangles

This tutorial will teach you:

  • How normals & UVs work
  • How to texture procedural meshes (part 4)

For your reference, here’s the final code for a procedural cube. Make sure to read the linked file and the file titled Shape in the same repository folder!

Let’s get to it!

Continue reading Intro to Procedural Geometry, Part 3

Intro to Procedural Geometry, Part 2

If you follow me on Twitter, you’ll know that I post polls to determine the content of these tutorials! Y’all are keeping up the trend of voting for this procedural geometry series, so as requested, here’s part 2 😀

If you missed Intro to Procedural Geometry, Part 1, and you’re unfamiliar with how vertices and triangles work, I highly recommend checking out that tutorial first.

This tutorial assumes you know:

  • Basics of using Unity (creating objects, attaching scripts, using the inspector)
  • How to code in C# (or at least a similar language)
  • The high-level of how 3D geometry is represented in code (vertices and triangles)
  • How to use Unity’s Mesh API to create geometry
  • How to create a plane mesh in code

This tutorial will teach you:

  • How to create a cube’s vertices and triangles
  • How normals & UVs work (part 3)
  • How to texture procedural meshes (part 4)

Let’s get started!

Continue reading Intro to Procedural Geometry, Part 2

How to Start a Career in Games

Most articles about how to get a job making video games are misleading. They spend too much time over-emphasizing, and sometimes exaggerating, how competitive the game industry is, and yet simultaneously propose a perfect formula for “breaking in”.

Even the phrase “breaking in” is a misnomer- although it can be difficult to get a paid job making games, if you’re making games at all, then you’re contributing to the game industry, and you are a game developer already.

Boom! You’ve started your career. Seriously. You’ve already taken the most important step to making games as a career: making a game.

So, I can’t tell you exactly how to run your game development journey. Maybe you want to find a paid job making games, maybe you want to do your own indie thing, or maybe you need help taking the first step to make a game. This article will hopefully be adaptable to any of those situations. I’m not going to be condescending and tell you what you want out of your game journey or career, or try to look cool by exaggerating how competitive this field is.

Instead, I’m going to list a bunch of practical, honest, adaptable ideas for getting paid for your art and improving as a game developer. Because hey- once you’ve made your first game, you already are one. ❤️

Continue reading How to Start a Career in Games

Custom Diffuse Shader in Unity

If you want your game to have a unique aesthetic, a great way to accomplish that is to have all of your objects using a shader that you personally wrote for the game. The only lighting scheme I’ve written about so far is cel shading, but that’s not the only way to go about stylized looks!

So, I decided this tutorial series needed a post on diffuse shading. Lots of tutorials have already covered diffuse shading in lots of languages, so this post also has a few ideas for ways to improve and expand upon a basic diffuse shader.

In the header image, the watermelon slice is using Unity’s default diffuse shader; on the right, it’s using the shader we write during this tutorial!

We’re going after a stylized look, so the ideas presented here introduce some basic ideas and skip over others. This is certainly not the ‘best’ way to write a diffuse shader, and there arguably isn’t one single ‘best’ way- there’s just what’s best for your game!

For your reference, here’s the final code for the simple diffuse shader in Unity.

Now, on with the tutorial!

Continue reading Custom Diffuse Shader in Unity

Full Game Aesthetic Walk-Through

Hey, y’all! My friends Kytana LeLucien Ye, and I created a chill, atmospheric, color-based puzzle game called The Endless River during the 2018 Global Game Jam. In the spirit of the Global Game Jam’s encouragement of knowledge-sharing, here’s a tutorial on how we made all of the visual effects in the game!

Firstly, here’s the entire Github repository for the whole Unity project. Feel free to download it and use the resources, as long as you include the same open-source license with your project.

I’m going to talk about how we chose the effects that we used and give a short overview of how to implement every effect. One of these effects uses a shader that’s controlled by gameplay code, so this tutorial should be a great example of how to integrate shaders into the overall aesthetic and the game mechanics for your games.

In addition, there are a couple of tutorials that cover the details how the shaders were written for some of the effects, as there’s more material than would fit in this tutorial:

Now, on with the tutorial!

Continue reading Full Game Aesthetic Walk-Through

Camera Effect Shaders in Unity

Hey, y’all! My friends Kytana LeLucien Ye, and I created a chill, atmospheric, color-based puzzle game called The Endless River during the 2018 Global Game Jam. In the spirit of the GGJ, I want to share with you how we created the post-processing effect for the game that create the vignette.

We’re going to walk through:

  1. How to add post-processing effects to a camera in Unity, and
  2. How to write a shader with a vignette and color effect

Here’s the final code for the post-processing shader used in this tutorial, for your reference. It’s under an open-source license 🙂

Good luck!

Continue reading Camera Effect Shaders in Unity

Colored Outline Shader in Unity

It seems like I’m on a roll with outline shaders! I’ve already written a basic cel shader with outline tutorial and an animated dotted outline shader, and now I’m doing this colored outline.

The special thing about the color of this outline is that it’s using the color of the texture, so that the outline color always matches the pixel it’s closest to. I find it’s a common tool used by 2D artists to make outlines feel more natural, as opposed to using a solid color like black for the whole outline.

Here’s an example of the difference it makes with an example from 2D pixel art from u/croakiee on Reddit:

outlineEx

This tutorial teaches you how to do this effect in 3D.

IMPORTANT: Since I already went over the basics of how to do the outline here, I’m not going to repeat that explanation in this tutorial. Do the basic tutorial first if you’re not sure how to create an outline at all.

Here’s the full code for the shader for reference, under a non-commercial open-source license:

->> Link to full code for Unity Colored Outline Shader

Also, The 3D model is from this free asset pack.

Now, on with the tutorial!

Continue reading Colored Outline Shader in Unity

2D Reflective Water Shader in Unity

Hey, y’all! My friends Kytana Le, Lucien Ye, and I created a chill, atmospheric, color-based puzzle game called The Endless River during the 2018 Global Game Jam. I wrote all of the shaders used for this game (except for the bloom), and my favorite one is definitely the reflective water shader.

So, while it’s still fresh in my mind, I figured I’d write a tutorial about it! The waving effect is quite similar to the 3D water shader tutorial, but the reflectivity is a special Unity trick that I felt made it worth writing a whole tutorial about.

If y’all want to see another tutorial covering how I made the entire aesthetic for the game, including bloom, other post-processing effects (like the vignette), fog, animations, and other effects, please let me know!

If you have any other feedback or questions about these tutorials, don’t be afraid to PM me on Redditcontact me on Twitter, or comment on this post ❤

For your reference during the tutorial, here’s the final code for this shader, under an open-source licence. The code isn’t my usual shader tutorial repository, but instead the repository for the whole game. 😉

-> Link to final code for Unity 2D Reflective Water Shader

On with the tutorial!

Continue reading 2D Reflective Water Shader in Unity

Intro to Procedural Geometry, Part 1

If you follow me on Twitter, you’ll know that I posted a poll to determine the content of this tutorial! With almost half the votes, an introduction to procedural geometry was the winner.

So, this tutorial will teach you the bare basics of creating procedural geometry in Unity!

Unity has a tutorial on creating a plane in code, but it’s lacking in pictures and assumes that you already know what “vertices” and “triangles” mean. A few other people have written good tutorials on procedural geometry, but I wanted to write one that easily flows into the other procedural geometry tutorials that I write.

Although this tutorial uses Unity, all of the concepts (other than the specific calls to Unity’s API) are applicable to most other engines.

This tutorial assumes you know:

  • Basics of using Unity (creating objects, attaching scripts, using the inspector)
  • How to code in C# (or at least a similar language)

This tutorial will teach you:

  • The high-level of how 3D geometry is represented in code (vertices and triangles)
  • How to use these concepts to create geometry with code
  • How to use Unity’s Mesh API to create geometry
  • How to create a plane mesh in code
  • How to create a 3D cube (part 2)
  • How normals & UVs work (part 3)
  • How to texture procedural meshes (part 4)

Here’s what we’re going to learn to create today! It’s not fancy, but it’s important to understand all of the basics before moving on.

planeScreenshot

Continue reading Intro to Procedural Geometry, Part 1