Hologram Shader

Holographic Shader

The week I set out to make a shader. Before I went and did a thing like that, I did some brainstorming of what I wanna make, from there I did some research on how I'm going to complete this shader and finally, I implemented it.


I started by searching through google images and twitter for shaders. I never really come across anything that sparked inspiration to what I eventually created. Although I did come across an image from star wars of princess Leia as a hologram and I thought I would make exactly that.

A shader that I can slap onto models that makes it look like a shader with adjustable variables for ease.

Making this shader I have no immediate use for it, although I think it could be useful on my major project as an added visual effect for models. I primarily wanted to make it just cause I thought it would look cool and be a fun learning experience. And if it isn’t needed for my project, or wont suit the visual style, I can always keep ahold of it until I find a suitable use for it.

After closely inspecting the picture I knew that that style of the hologram isn't what I’m after fo my project I’m making if for, something more simplistic and stylised to suit the project theme more. So I did some more detail and descriptive searching on hologram effects (primary of hologram shader that have been done before).

After the searching, I decided on this exact effect ^ (found from google)

After the searching, I decided on this exact effect ^ (found from google)

Although I would be happy with something more like this ^ (found from google)

Although I would be happy with something more like this ^ (found from google)

And now finally, It’s time to work out how the hell I'm going to actually do this.

I know that I'm going to need to make rim lines horizontally around the 3D model (as seen in the reference pictures above). I know I needed to do this by using frac() which only uses the decimal place of number (ie, frac(232.4324) = 0.4324). So by putting in values something like the current position and the number of lines I want and also the time I was able to place the small lines across the model evenly.

Next up that I think is needed was the added effect of a more lengthy line like the rim ones I just made but wider in height line and has a gradient, these will move up over time.

After implementing it made this effect ^ (gif of what I implemented for the shader)

After implementing it made this effect ^ (gif of what I implemented for the shader)

After that, I thought to add a bit of transparency based on the small lines and the big gradient lines and make that an adjustable property for ease of changing.

// alpha based on scanlines and rim

col.a = 0.8 * (scanlines + rim + bigfracline) * _HoloTransparentcey;

When I came to implement all that, I had the base and I could have, and probably should have finished it there. Although, I wanted to liven it up and make it more interesting so I went through the pain of adding a glitch effect that applies at random time at the position on the model.

After a time has passed, I get a position to glitch and then displace the texture at that point.

This means the model needs to have a texture which isn’t ideal, It was hard to even find a free one so I could test it to see if it would work, and it did!

At this point my next step was to clean it up by not letting parts of the mesh shine through the other side of the model and be seen, which made a great improvement.

(The cut out there is the glitch effect)

(The cut out there is the glitch effect)

And from there that’s all I’m gonna do on it, I cleaned up the code, turning magic numbers into properties and made the shader more into a tool.


What I would like to do is have a faint outline around the model like some/most hologram effects have, and I tried to get that in but it was a struggle and it was breaking it. Maybe at a later date.

To conclude shaders are interesting and powerful, you can do some cool stuff. But they’re also an absolute struggle to implement. The lake of extra help you get like when programming with C# or even C++, made it very difficult. I found myself misspelling variables, built in functionality without the auto complete often. The way you declare variables to be altered was so strange to me and spent far to much time trying to get stuff working and finally compiling. Also, my god the resources (or at-least the ones I just found) were dull, uninformative and often not what I’m looking for, so I was flying mostly blind when making this.

I think this will come in handy with my project when we get down to the nitty gritty of improving the visuals as much as we can. But it is not needed presently. If in the future it doesn’t suit that game, I confidently can alter it to fit more in.