Zum Inhalt springen
Skillpedia
Allgemeines Programmieren6.6k · #13817

godot-3d-essentials

Was er macht

Dieser Skill führt durch den Bau einer einfachen 3D-Szene in Godot, mit Kameras, Licht, Umgebung und Materialien. Er ist für Godot-Entwickler gedacht, die ein 3D-Level beginnen oder eine Szene reparieren, die schwarz gerendert wird oder flach aussieht.

Wann du ihn nutzt

  • ✓Wenn du eine 3D-Szene in Godot beginnst und eine Kamera und Lichter brauchst.
  • ✓Wenn eine 3D-Szene in Godot schwarz gerendert wird oder kein Umgebungslicht hat.
  • ✓Wenn du ein kachelbasiertes 3D-Level mit Rasterkarten bauen willst.

Link zum Skill

https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/godot/godot-3d-essentials/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/godot/godot-3d-essentials/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Ich beginne ein 3D-Level in Godot 4.7. Kannst du eine Kamera, ein Sonnenlicht, einen Himmel und ein einfaches Material auf einer Box einrichten?”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Dein Agent positioniert eine Camera3D und setzt sie als aktuelle Kamera, fügt ein gerichtetes Licht hinzu und richtet eine WorldEnvironment mit Himmel und Umgebungslicht ein. Danach weist er Meshes Materialien zu und baut, wo sinnvoll, Rasterkarten-Level.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von GitHub.

Godot 3D Essentials (4.x)

Assemble a working 3D scene: transforms, camera, lights, environment/post, materials, and GridMap blockouts. Targets Godot 4.7.

When to use

  • Use when starting or fixing a 3D scene: positioning a Camera3D, adding lights, setting up a WorldEnvironment (sky, ambient, tonemap, glow/SSAO), assigning materials, or building levels with GridMap.

When not to use: writing spatial shaders → godot-shaders; 3D physics bodies and raycasts → godot-physics; character animation blending → godot-animation; full FPS template → the fps-shooter genre skill.

Core workflow

  1. Everything 3D is a Node3D with a Transform3D (position, rotation basis, scale). Move with global_position, rotate with rotate_y(angle) or look_at(target).
  2. Add a Camera3D. Mark it current (or call make_current()); set fov, near, far. Parent it to a rig/pivot for orbit or follow cameras.
  3. Light the scene. A DirectionalLight3D is the sun; OmniLight3D/SpotLight3D are local; AreaLight3D (4.7+) is a rectangular panel light that costs more than omni/spot. Enable shadows per light. Without lights and ambient, surfaces render black.
  4. Add a WorldEnvironment with an Environment resource: background (sky/color), ambient light, tonemap, and post (glow, SSAO, fog, adjustments).
  5. Give meshes materials (StandardMaterial3D or a ShaderMaterial) on MeshInstance3D.
  6. Block out levels with GridMap, which places MeshLibrary items on a 3D grid (the 3D analog of a tilemap).

Patterns

1. A follow camera (third-person, smoothed)

extends Camera3D

@export var target: Node3D
@export var offset := Vector3(0, 4, 8)
@export var smooth := 6.0

func _physics_process(delta: float) -> void:
    if target == null:
        return
    var desired := target.global_position + offset
    global_position = global_position.lerp(desired, smooth * delta)  # smooth follow
    look_at(target.global_position, Vector3.UP)                      # face the target

2. Sun + environment in code

func _ready() -> void:
    var sun := DirectionalLight3D.new()
    sun.rotation_degrees = Vector3(-45, -30, 0)
    sun.shadow_enabled = true
    add_child(sun)

    var we := WorldEnvironment.new()
    var env := Environment.new()
    env.background_mode = Environment.BG_SKY
    env.sky = Sky.new()
    env.sky.sky_material = ProceduralSkyMaterial.new()
    env.ambient_light_source = Environment.AMBIENT_SOURCE_SKY
    env.tonemap_mode = Environment.TONE_MAPPER_FILMIC
    env.glow_enabled = true
    we.environment = env
    add_child(we)

3. Assign a StandardMaterial3D from code

func tint_mesh(mesh: MeshInstance3D, color: Color) -> void:
    var mat := StandardMaterial3D.new()
    mat.albedo_color = color
    mat.metallic = 0.0
    mat.roughness = 0.6
    mat.emission_enabled = true
    mat.emission = color * 0.3
    mesh.material_override = mat       # overrides the mesh's surface materials

4. Place tiles into a GridMap

@onready var grid: GridMap = $GridMap   # cell_size + mesh_library set in the editor

func build_floor(width: int, depth: int, item_id: int) -> void:
    for x in width:
        for z in depth:
            # set_cell_item(Vector3i cell, int item, orientation = 0)
            grid.set_cell_item(Vector3i(x, 0, z), item_id)

Pitfalls

  • Scene renders black → no lights and no ambient. Add a DirectionalLight3D and/or a WorldEnvironment with ambient/sky. New scenes have neither by default.
  • No camera / wrong camera. If nothing shows, no Camera3D is current. Set current = true or make_current(); only one camera renders per viewport.
  • Confusing local vs global transforms. position/rotation are relative to the parent; global_position/global_transform are world space. Mixing them under a rotated parent gives surprising results. look_at uses global coordinates.
  • Scaling physics/lights. Non-uniform scale on a Node3D distorts child collisions and lights; prefer scaling the mesh asset or using uniform scale.
  • look_at does nothing and prints an error → the target equals the node's position, the up vector is parallel to the look direction (e.g. looking straight down with Vector3.UP), or the node is not in the tree yet. Keep an offset, pass a different up, or use look_at_from_position() before the nod
Häufige Fragen

Warum sieht meine 3D-Szene schwarz aus?

Der Skill sagt, Flächen brauchen Licht und Umgebungslicht, sonst werden sie schwarz gerendert.

Was ist AreaLight3D?

Der Skill erwähnt es als rechteckiges Flächenlicht in Godot 4.7, das mehr kostet als Omni- oder Spotlichter.

Deckt er 3D-Physik ab?

Nein. 3D-Physikkörper und Raycasts deckt der Godot-Physik-Skill ab.

Details

Originalbeschreibung des Autors

Set up a Godot 4.7 3D scene: Node3D transforms, Camera3D, lighting (DirectionalLight3D/OmniLight3D), WorldEnvironment for sky/ambient/tonemap/post, MeshInstance3D materials, and GridMap for tile-based 3D levels. Use when building a 3D scene in a Godot project, placing cameras/lights, configuring environment and post-processing, or working with Node3D/.tscn 3D content and GridMap.

repo: gamedev-skills/awesome-gamedev-agent-skills

Beliebtheit

GitHub-Sterne
6.6k
Platz im Ranking
#13817
Lizenz
Apache-2.0
Aktualisiert
28.10.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills