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
}
ok
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