Frutiger Aero

Frutiger aero style shader with Fresnel effect + gradient and top highlight.

Shader code
shader_type spatial;
render_mode unshaded,fog_disabled;

uniform float mesh_height = 1.0;
uniform float fresnel_power = 0.7;
uniform vec3 primary_color : source_color = vec3(1.0,0.0,1.0);
uniform vec3 secondary_color : source_color = vec3(0.0,0.0,0.5);
uniform vec3 highlight_color : source_color = vec3(1.0);
uniform float highlight_power = 1.5;

varying float height;
varying vec3 norm;

void vertex() {
	height = clamp((-VERTEX.y/mesh_height)+0.5,0.0,1.0);
	norm = NORMAL;
}

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

void fragment()
{
	float fres = fresnel(fresnel_power, NORMAL, VIEW);
	vec3 basic_fresnel = mix(primary_color,secondary_color,fres);
	vec3 gradient = mix(primary_color,secondary_color,height);
	float top_dot = clamp(dot(norm,vec3(0.0,1.0,0.0)),0.0,1.0);
	float top_light = smoothstep(0.0, 1.0, (top_dot * 0.5) / 0.05-1.0);
	vec3 mix1 = mix(gradient,basic_fresnel,fres);
	ALBEDO = mix(mix1,highlight_color,highlight_power*pow(fres,2.0)*top_light/2.0);
}
Live Preview
Tags
stylized, toon
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.
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments