Daily news, dev blogs, and stories from Game Developer straight to your inbox
Featured Blog | This community-written post highlights the best of what the game industry has to offer. Read more like it on the Game Developer Blogs.
How one game artist learned a bit of shader coding with the Unity community and created a custom solution for an invisible character. Shader code included!
December 14, 2015
2 Min Read
When we fisrt started working on Tsar Project, the game that would eventually evolve into Qasri al-Wasat, one of the few things the team knew for certain was that our protagonist, called Subtle, would be invisible. And for that we needed a visual way to convey this to players, but without compromising playabily and navigation with well, a fully invisible character in the middle of the screen. It was then that I learned about shaders.
A newbie approach to shading
First things first: working with Unity is super great because of the community. When we began working on Qasir I had absolutely know clue about shader coding. No clue about programming whatsoever to be honest. So it all started with Unity’s shader documentation and lurking on the Unity Answers database. I still very much recommend those as good starting points — even though I wouldn't be any surprised if somebody with more programming experience (not to say ANY) would recommend something else.
When it started to get shady
After deciding the kind of effect we needed to achieve (I had something between Ghost in the Shell’s cloaking and that Mortal Kombat Movie's Reptile in mind) the best shader to start from seemed to be the Stained Glass/Heat Wave available in many variations throughout Unity’s forums. The fine tuning consisted of adding highlights and shadow to the bump map based distortion.
Three shades of invisible
The final result consists of a greyscale bump map, a slider to fine tune the amount of distortion, a black texture with highlights and a white texture with shadings. Here are the three components, rendered as separated unlit materials, side by side with the combined result:
I’ve made all the textures with alpha here, just so they’d work properly as standalones, but the first one is grey around the character, the second black and the third white. In the case of Qasir, with the use of sprite based animation, every individual texture is actually a 2048px sprite map, but the shader sould also work for other kinds of 2D and 3D techniques.
You can get the .shader file here:
And if you have any questions please come say hello on twitter!
PS: By the way, the individual textures used in the game are named Liquid, Venom and Solidus. And in case you’re wondering, the texture used when Subtle is visible is named Solid.
Read more about:Featured Blogs
You May Also Like
Exploring the 2024 State of the Game Industry report - Game Developer Podcast ep. 39Feb 2, 2024
Phantom inspiration and the ethical auteur with Xalavier Nelson Jr.Dec 8, 2023
Designing Killer Queen: from playground experiment to modern arcade sensationOct 18, 2023
Rod Humble and King Choi illustrate the ambition of Life By YouSep 22, 2023
Get daily news, dev blogs, and stories from Game Developer straight to your inbox
Subscribe to Game Developer Newsletters to stay caught up with the latest news, design insights, marketing tips, and more