CodeBlanks Logo Icon CodeBlanks

StandardMaterial3D

Learn surface materials with StandardMaterial3D.

StandardMaterial3D and Surface Materials

In Godot 3D, the physically-based (PBR) StandardMaterial3D resource is used to define surface characteristics. This material computes how light interacts with surfaces and is applied to an object by assigning it to the MaterialOverride property of a MeshInstance3D node.

StandardMaterial3D mat = new StandardMaterial3D();
meshNode.MaterialOverride = mat;

Albedo and Metallic Properties

While AlbedoColor determines the base color, the Metallic property specifies the surface metalness between 0.0 and 1.0. A value of 0.0 represents dielectric surfaces like plastic or wood, while 1.0 represents pure metals like gold or steel. Surface roughness is managed by Roughness.

mat.Metallic = 0.8f;
mat.Roughness = 0.2f;

Practice Create Metallic Material

Set mat.Metallic to 1.0f and print it with GD.Print("Metalik: " + mat.Metallic);.

Starter code

Player.cs
using System;

public class StandardMaterial3D
{
    public float Metallic { get; set; } = 0.0f;
    public float Roughness { get; set; } = 0.5f;
}

public static class GD
{
    public static void Print(object message) => Console.WriteLine(message);
}

public class Program
{
    public static void Main()
    {
        StandardMaterial3D mat = new StandardMaterial3D();
        // Metaliklik oranini 1.0f yap ve ekrana yazdir
    }
}

Sample solution

Player.cs
using System;

public class StandardMaterial3D
{
    public float Metallic { get; set; } = 0.0f;
    public float Roughness { get; set; } = 0.5f;
}

public static class GD
{
    public static void Print(object message) => Console.WriteLine(message);
}

public class Program
{
    public static void Main()
    {
        StandardMaterial3D mat = new StandardMaterial3D();
        mat.Metallic = 1.0f;
        GD.Print("Metalik: " + mat.Metallic);
    }
}

Expected output

Metalik: 1

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 Which property determines the primary base color of a material in Godot 3D?

  • Emission
  • AlbedoColor Correct answer
  • Roughness
  • NormalMap

Explanation: AlbedoColor defines the pure base surface color of the material independent of reflections.

2 Set Metallic Ratio

Question
materyal.____ = 1.0f;
Answer
materyal.Metallic = 1.0f;

Explanation: The Metallic property is used to configure the metallic reflection ratio of the surface.

3 Material Properties Matching

Term Meaning
StandardMaterial3D Standard physical surface material
AlbedoColor Base primary color of the material
Metallic Surface metallic reflection ratio
Roughness Matte and roughness degree of surface

All lessons in Intermediate