“Dodge obstacles and collect riches as you journey down the river Styx, delivering a soul to the afterlife.”
About Styx
STYX was the first game project at TGA. Which meant a lot of new things to learn. Getting to know the programs TGA expected us to use like Perforce and YouTrack. For a some it was their first time working in Unity or even on a game. We chose Race the Sun as our reference game.
A large part of the programmers had never worked in Unity before and wanted to learn how to work in Unity. I had already worked in Unity for a few years thanks to my time at LBS. But I also wanted to do something new so I left the gameplay and other systems to the others and decided that I wanted to try working with shaders and because our game play out on the river Styx it only felt natural to make a water shader. I am lucky and have a good friend Allen, who is also a student at TGA (Link to his portfolio here). He taught me the basics of Unitys Shader Graph system and gave me some tips and resources for actually making water shaders.
Vertex Displacement I started by making the vertex displacement using two noise textures and scroll both over the plane and using the values to modify the vertex positions. A classic approach and most of the difficulty came from my inexperience with Shader Graph.
Color The shader blends between a few different colors, A deep color, shallow color, horizon color. I lerp between the shallow and deep color to get a gradient between the parts closer to the walls/shore. The horizon color is used to give water that is far away a different color to give a better sense of distance. I also use a similar calculation to create foam where objects intersect the water.
Making this water shader is what got me more interested in graphics programming and it made me more exited to do more of it.
And this is the full shader graph, excluding a few subgraphs that handle a few calculations.
Styx
“Dodge obstacles and collect riches as you journey down the river Styx, delivering a soul to the afterlife.”
About Styx
STYX was the first game project at TGA. Which meant a lot of new things to learn. Getting to know the programs TGA expected us to use like Perforce and YouTrack. For a some it was their first time working in Unity or even on a game. We chose Race the Sun as our reference game.
A large part of the programmers had never worked in Unity before and wanted to learn how to work in Unity. I had already worked in Unity for a few years thanks to my time at LBS. But I also wanted to do something new so I left the gameplay and other systems to the others and decided that I wanted to try working with shaders and because our game play out on the river Styx it only felt natural to make a water shader. I am lucky and have a good friend Allen, who is also a student at TGA (Link to his portfolio here). He taught me the basics of Unitys Shader Graph system and gave me some tips and resources for actually making water shaders.
Vertex Displacement I started by making the vertex displacement using two noise textures and scroll both over the plane and using the values to modify the vertex positions. A classic approach and most of the difficulty came from my inexperience with Shader Graph.
Color The shader blends between a few different colors, A deep color, shallow color, horizon color. I lerp between the shallow and deep color to get a gradient between the parts closer to the walls/shore. The horizon color is used to give water that is far away a different color to give a better sense of distance. I also use a similar calculation to create foam where objects intersect the water.
Making this water shader is what got me more interested in graphics programming and it made me more exited to do more of it.
And this is the full shader graph, excluding a few subgraphs that handle a few calculations.