~3 min read

Rendering and Materials

Forward+/Mobile/Compatibility, BaseMaterial3D, gdshader — how Godot draws a frame.

Three renderers

Godot picks a renderer when you create a project (you can change it later, but materials may need adapting):

RendererAPIPurpose
Forward+Vulkan / Metal / D3D12High-end. Clustered Forward+, SDFGI, volumetric fog, SSR, SSAO/SSIL.
MobileVulkan / Metal / D3D12Mobile, VR. Single-pass forward, a per-mesh light limit.
CompatibilityOpenGL ES 3 / WebGL 2Low-end hardware, the only full-featured path for the web.

Project → Project Settings → Rendering → Renderer → Rendering Method.

When to use which

  • Forward+ + Vulkan — desktop, serious 3D projects, high-end visuals.
  • Mobile + Vulkan/Metal — phones.
  • Compatibility + WebGL 2 — the browser (this is the only path for the web target that works everywhere without COOP/COEP headers).

Compatibility was declared feature-complete in 4.3: lights, shadows, GI (lightmaps), GPU particles — all available, with some limitations.

Mesh, Material, Shader

The same triad as in Unity:

  • Mesh — geometry (vertices, normals, UVs). Imported from glTF/FBX/.obj/.dae.
  • Shader — a GPU program (.gdshader or a built-in engine shader).
  • Material — an instance of a shader with parameters.

Godot has no “Material” files like Unity — a material can be embedded in a Mesh resource (override material) or saved separately as .tres.

BaseMaterial3D — the standard PBR

The equivalent of Unity Standard / URP Lit. A ready-made PBR material that covers 90% of tasks without writing a shader. Key properties:

  • Albedoalbedo_color + albedo_texture.
  • Metallic + Roughness — the diffuse/metallic workflow.
  • Normal — a normal map.
  • Emission — a self-illuminating color/texture.
  • Ambient Occlusion — an AO map.
  • TransparencyOPAQUE / ALPHA / ALPHA_SCISSOR / ALPHA_DEPTH_PRE_PASS.
  • Cull ModeBACK / FRONT / DISABLED.
  • Texture filteringLINEAR / NEAREST.
var mat = StandardMaterial3D.new()  # StandardMaterial3D inherits from BaseMaterial3D
mat.albedo_color = Color.RED
mat.metallic = 0.5
mat.roughness = 0.3
$Mesh.material_override = mat
StandardMaterial3D, ORMMaterial3D

In the Inspector you’ll see StandardMaterial3D (uses separate maps for AO/Roughness/Metallic) and ORMMaterial3D (a single map with three channels for AO/Roughness/Metallic — ORM). Both inherit from the abstract BaseMaterial3D. For compatibility with the glTF standard, use ORM.

ShaderMaterial — a custom shader

When BaseMaterial3D isn’t enough, you create a ShaderMaterial with your own .gdshader resource:

// dissolve.gdshader
shader_type spatial;

uniform sampler2D albedo : source_color, filter_linear_mipmap;
uniform sampler2D noise;
uniform float threshold : hint_range(0.0, 1.0) = 0.5;
uniform vec3 edge_color : source_color = vec3(1.0, 0.5, 0.0);

void fragment() {
    vec4 base = texture(albedo, UV);
    float n = texture(noise, UV).r;

    if (n < threshold) {
        discard; // don't draw this pixel
    }
    if (n < threshold + 0.05) {
        ALBEDO = edge_color; // glowing edge
        EMISSION = edge_color * 2.0;
    } else {
        ALBEDO = base.rgb;
    }
}

Usage:

var shader = preload("res://shaders/dissolve.gdshader")
var mat = ShaderMaterial.new()
mat.shader = shader
mat.set_shader_parameter("threshold", 0.7)
mat.set_shader_parameter("albedo", preload("res://textures/wall.png"))
$Mesh.material_override = mat
Web

GLSL ES 3.0 / WebGL — the same thing, except in Godot the shader is wrapped with shader_type and built-in variables (UV, NORMAL, ALBEDO, ALPHA, EMISSION, ROUGHNESS, NORMAL_MAP, …).

Unity

HLSL + ShaderLab in Unity ↔ .gdshader (a GLSL ES 3.0 dialect) in Godot. Different syntax, same idea. The Godot Shader Language is easier for a beginner to read: less boilerplate than a Unity URP Lit shader.

shader_type — categories

In Godot, shaders are explicitly categorized by type via a directive:

  • shader_type spatial; — for 3D meshes.
  • shader_type canvas_item; — for 2D and Control.
  • shader_type particles; — for particles (process material).
  • shader_type sky; — for the skybox.
  • shader_type fog; — for volumetric fog (Forward+).

Each type has its own inputs/outputs and built-in variables.

Visual Shader

Godot has a built-in visual shader editor — Visual Shader, substantially reworked in 4.x (with successive UX and node-catalog improvements). Created via FileSystem → New Resource → VisualShader. The equivalent of Unity Shader Graph.

Handy for those who don’t write shader code; you assemble a graph of nodes (Texture, Multiply, Mix, …). Under the hood it generates the same .gdshader.

Draw calls and batching

Unlike Unity, Godot has no explicit “Static Batching” / “GPU Instancing” settings on materials. But:

  • MultiMeshInstance3D — a node that draws N instances of a single mesh in one draw call (via a MultiMesh resource). The equivalent of GPU Instancing. Use cases: grass, decoration assets, crowds.
  • RenderingServer automatically batches draw calls where it can.
var mm = MultiMesh.new()
mm.transform_format = MultiMesh.TRANSFORM_3D
mm.instance_count = 1000
mm.mesh = preload("res://grass.obj")

for i in 1000:
    var transform = Transform3D()
    transform.origin = Vector3(randf_range(-50, 50), 0, randf_range(-50, 50))
    mm.set_instance_transform(i, transform)

$MultiMeshInstance3D.multimesh = mm

Post-processing

Godot has no Unity-style Volume Framework. Post-processing is configured via the WorldEnvironment node and its Environment resource:

  • Background — skybox / colored / camera_feed.
  • Ambient Light.
  • Glow (bloom).
  • Tonemap — Linear / Reinhard / Filmic / ACES / AgX.
  • SSR (Forward+).
  • SSAO / SSIL (Forward+).
  • SDFGI (Forward+) — dynamic GI.
  • DOF (depth of field).
  • Adjustments — Brightness/Contrast/Saturation/Color Correction LUT.
  • Glow, Volumetric Fog.

One WorldEnvironment per scene. To switch (for example, when entering a cave), there’s Camera3D → Environment Override, or change it via script.

var env = $WorldEnvironment.environment
env.tonemap_mode = Environment.TONE_MAPPER_ACES
env.glow_enabled = true
env.glow_intensity = 0.6
These effects are Forward+ only

SSR, SSAO, SDFGI, and volumetric fog are features of the Forward+ renderer. On Mobile/Compatibility they’re absent or run in a stripped-down form. If your project targets the web, plan around the Compatibility feature set.

In the next chapter — lighting in more detail.