Simple 3D Glass

This shader gives a simple glass look to 3D meshes, just adjust the shader parameters to your liking.

Shader code
shader_type spatial;
render_mode specular_schlick_ggx, ambient_light_disabled;

uniform vec4 Color : hint_color;
uniform float Shine = 0.2;
uniform float Roughness = 0.2;



void vertex() {
// Output:0

}

void fragment() {
// ColorUniform:6
	vec3 n_out6p0 = Color.rgb;
	float n_out6p1 = Color.a;

// ScalarUniform:3
	float n_out3p0 = Shine;

// ScalarUniform:4
	float n_out4p0 = Roughness;

// Output:0
	ALBEDO = n_out6p0;
	ALPHA = n_out6p1;
	METALLIC = n_out3p0;
	ROUGHNESS = n_out4p0;

}

void light() {
// Output:0

}
Tags
3d, glass, simple, Spatial, Transparent
The shader code and all code snippets in this post are under MIT license and can be used freely. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

More from SamWise

Simple 3D Metal

2D reflective ice

Related shaders

Frosted Glass

Improved frosted glass

Colored Glass

Subscribe
Notify of
guest

2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Ewobee
Ewobee
3 years ago

ok

Richard Ellicott
Richard Ellicott
2 months ago

thanks, for godot 4:

“””
#define DEFAULT_COLOR vec4(1.0, 1.0, 1.0, 1.0)
uniform vec4 Color: source_color = DEFAULT_COLOR;
“””

it’s only required for the default color

Last edited 2 months ago by mescalin1