Blueprint / Hologram

This is a shader that you can overlay onto any object to add that common placing effect you see in factory or town-building games.

You can also use it as a hologram by setting it as the main material instead of the overlay.

Shader code
shader_type spatial;
render_mode unshaded;

uniform int number_of_bands = 200;
uniform float alpha_fall_off = 1.0;
uniform float alpha_offset = 0.4;
uniform float alpha_contrast = 0.1;
uniform float fresnel_intensty = 1.0;
uniform float noise_intensty = 0.2;
uniform vec3 color : source_color = vec3(0.12, 0.33, 0.47);
uniform vec3 fresnel_color : source_color = vec3(0.36, 0.53, 0.63);

float fresnel(vec3 normal, vec3 view)
{
	return (1.0 - clamp(dot(normalize(normal), normalize(view)), 0.0, 2.0 ));
}

void fragment() {
	float noise = (fract(sin(dot(SCREEN_UV, vec2(12.9898, 78.233))) * 43758.5453) - 0.5) * 2.0 ;
	vec2 uv = vec2(SCREEN_UV.x, mix(SCREEN_UV.y, noise + TIME * 20.0, 0.001 * noise_intensty));
	float fresnel = fresnel(NORMAL, VIEW);
	ALBEDO = mix(color, fresnel_color, pow(fresnel, fresnel_intensty));
	
	float alpha_fresnel = mix(0.0, 0.6 - alpha_offset,pow(fresnel, alpha_fall_off)) + alpha_offset;
	ALPHA = alpha_fresnel;
	if (mod(uv.y * float(number_of_bands), 2.0) < 1.0) { 
		ALPHA = alpha_fresnel + alpha_contrast;
	}
}
Live Preview
The shader code and all code snippets in this post are under CC0 license and can be used freely without the author's permission. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

Related shaders

guest

0 Comments
Oldest
Newest Most Voted