godot-3d-essentials
Skill này làm gì
Skill này hướng dẫn xây dựng cảnh 3D cơ bản trong Godot, gồm camera, đèn, môi trường và vật liệu. Nó dành cho nhà phát triển Godot bắt đầu một màn chơi 3D hoặc sửa một cảnh bị đen hoặc trông phẳng.
Khi nào nên dùng
- ✓Khi bạn bắt đầu một cảnh 3D trong Godot và cần camera và đèn.
- ✓Khi một cảnh 3D trong Godot bị đen hoặc thiếu ánh sáng nền.
- ✓Khi bạn muốn xây dựng màn chơi 3D dạng ô bằng grid map.
Liên kết skill
https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/godot/godot-3d-essentials/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tôi đang bắt đầu một màn chơi 3D trong Godot 4.7. Bạn có thể thiết lập camera, một đèn mặt trời, bầu trời và một vật liệu cơ bản trên một hộp không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent đặt Camera3D và đánh dấu nó là camera hiện tại, thêm đèn định hướng, và thiết lập WorldEnvironment với bầu trời và ánh sáng nền. Sau đó nó gán vật liệu cho các mesh và xây màn chơi grid map khi thấy hữu ích.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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 aWorldEnvironment(sky, ambient, tonemap, glow/SSAO), assigning materials, or building levels withGridMap.
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
- Everything 3D is a
Node3Dwith aTransform3D(position, rotation basis, scale). Move withglobal_position, rotate withrotate_y(angle)orlook_at(target). - Add a
Camera3D. Mark itcurrent(or callmake_current()); setfov,near,far. Parent it to a rig/pivot for orbit or follow cameras. - Light the scene. A
DirectionalLight3Dis the sun;OmniLight3D/SpotLight3Dare 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. - Add a
WorldEnvironmentwith anEnvironmentresource: background (sky/color), ambient light, tonemap, and post (glow, SSAO, fog, adjustments). - Give meshes materials (
StandardMaterial3Dor aShaderMaterial) onMeshInstance3D. - Block out levels with
GridMap, which placesMeshLibraryitems 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
DirectionalLight3Dand/or aWorldEnvironmentwith ambient/sky. New scenes have neither by default. - No camera / wrong camera. If nothing shows, no
Camera3Discurrent. Setcurrent = trueormake_current(); only one camera renders per viewport. - Confusing local vs global transforms.
position/rotationare relative to the parent;global_position/global_transformare world space. Mixing them under a rotated parent gives surprising results.look_atuses global coordinates. - Scaling physics/lights. Non-uniform
scaleon aNode3Ddistorts child collisions and lights; prefer scaling the mesh asset or using uniform scale. look_atdoes nothing and prints an error → the target equals the node's position, theupvector is parallel to the look direction (e.g. looking straight down withVector3.UP), or the node is not in the tree yet. Keep an offset, pass a differentup, or uselook_at_from_position()before the nod
Câu hỏi thường gặp
Vì sao cảnh 3D của tôi bị đen?
Skill nói bề mặt cần có đèn và ánh sáng nền, nếu không sẽ hiển thị màu đen.
AreaLight3D là gì?
Skill nhắc đến nó như một đèn tấm hình chữ nhật trong Godot 4.7, và nó tốn kém hơn đèn omni hoặc spot.
Nó có bao quát vật lý 3D không?
Không. Body vật lý 3D và raycast do skill vật lý Godot bao quát.
Chi tiết
Mô tả gốc của tác giả
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.
Độ phổ biến
- Sao GitHub
- 6.6k
- Vị trí xếp hạng
- #13817
- Giấy phép
- Apache-2.0
- Cập nhật
- 28/10/2026
Bình luận
- …
Thêm skill từ kho mã này
router
6.6kGiúp agent của bạn chọn đúng skill phát triển game cho yêu cầu, dựa trên engine bạn dùng và loại công việc cần làm.
ai-behavior-trees-utility-ai
6.6kGiúp agent của bạn xây dựng behavior tree và hệ thống utility AI cho kẻ thù và nhân vật trong game, chọn hành động theo độ ưu tiên và điểm số.
audio-design
6.6kDạy agent cách trộn âm thanh game: bus, âm lượng theo decibel, hạ nhạc khi có thoại, nhạc thích ứng và biến thể hiệu ứng âm thanh.
camera-systems
6.6kGiúp agent của bạn xây dựng camera game bám theo mượt, giữ trong phạm vi màn chơi, và xoay quanh hoặc nhìn quanh trong 3D.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.