Metal Mario Shader (Gold/Silver with Custom Reflection)

 

This spatial shader creates a stylized metallic effect inspired by “Metal Mario”, allowing you to switch between gold and silver materials dynamically. It includes parameters for controlling the base metal color, roughness, and metallic intensity. A custom env_texture can be assigned to simulate a fake environment reflection based on the surface normal, which is blended into the final look using emission. The result is a cartoonish, shiny material ideal for collectible items, characters, or stylized props in 3D scenes.

Shader code
shader_type spatial;
render_mode specular_schlick_ggx;

uniform sampler2D env_texture;
uniform vec3 metal_color_gold = vec3(1.0, 0.843, 0.0);
uniform vec3 metal_color_silver = vec3(0.75, 0.75, 0.75);
uniform bool use_gold = true;
uniform float roughness : hint_range(0.0, 1.0) = 0.1;
uniform float metallic : hint_range(0.0, 1.0) = 1.0;

void fragment() {
    vec3 metal_color = use_gold ? metal_color_gold : metal_color_silver;
    ALBEDO = metal_color;
    METALLIC = metallic;
    ROUGHNESS = roughness;

    vec3 view_dir = normalize(-NORMAL);
    vec2 env_uv = vec2(0.5 + 0.5 * view_dir.x, 0.5 - 0.5 * view_dir.y);
    vec3 env_reflection = texture(env_texture, env_uv).rgb;

    EMISSION = env_reflection * 0.5;
}
Live Preview
Tags
3d, Emission, godot4, Gold, mario, Metal, reflection, silver, stylized
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 Gerardo LCDF

Related shaders

guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments