Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

特性列表

This page aims to list all features currently supported by Godot.

备注

This page lists features supported by the current stable version of Godot (4.0). Some of these features may not be available in the LTS release series (3.x).

平台

可以运行编辑器以及导出项目的:

  • Windows 7 以及更新的系统版本(64 位和 32 位)。

  • macOS 10.12 以及更新的系统版本(64 位,x86 和 ARM)。

  • Linux (64-bit, x86 and ARM).

    • 二进制文件是静态链接的,并且如果在足够旧的基本发行版上进行编译,则可以在任何发行版上运行。

    • 官方二进制文件是在 Ubuntu 14.04 上编译的。

    • 32-bit binaries can be compiled from source.

  • Android 6.0 and later (editor support is experimental).

  • Web browsers. Experimental in 4.0, using Godot 3.x is recommended instead when targeting HTML5.

运行导出的项目:

  • iOS 11.0 and later.

  • 主机

Godot aims to be as platform-independent as possible and can be ported to new platforms with relative ease.

编辑器

特性:

  • 场景树编辑器。

  • 内置脚本编辑器。

  • 支持 Visual Studio Code、VIM 等外部文本编辑器

  • GDScript 调试器

    • 尚不支持在线程中调试。

  • Visual profiler with CPU and GPU time indications for each step of the rendering pipeline.

  • Performance monitoring tools, including custom performance monitors.

  • 脚本热重载。

  • 场景热编辑。

    • 更改会在编辑器中生效并且会在关闭当前项目后保留。

  • 远程检查器。

    • 在关闭正在运行的项目后,更改不会被反映在编辑器中,也不会被保留。

  • 实时摄像机复制。

    • 移动编辑器中的摄像头,并在正在运行的项目中查看结果。

  • 内置离线类参考文档。

  • 使用由社区贡献的支持数十种语言的编辑器。

插件:

渲染

3 rendering methods (running over 2 rendering drivers) are available:

  • Forward+, running over Vulkan 1.0 (with optional Vulkan 1.1 and 1.2 features). The most advanced graphics backend, suited for desktop platforms only. Used by default on desktop platforms.

  • Forward Mobile, running over Vulkan 1.0 (with optional Vulkan 1.1 and 1.2 features). Less features, but renders simple scenes faster. Suited for mobile and desktop platforms. Used by default on mobile platforms.

  • Compatibility, running over OpenGL 3.3 / OpenGL ES 3.0 / WebGL 2.0. The least advanced graphics backend, suited for low-end desktop and mobile platforms. Used by default on the web platform.

2D 图形

  • 精灵、多边形和线条渲染。

    • High-level tools to draw lines and polygons such as Polygon2D and Line2D, with support for texturing.

  • AnimatedSprite2D as a helper for creating animated sprites.

  • 视差层。

    • 伪 3D 支持,可在编辑器中进行预览。

  • 2D lighting with normal maps and specular maps.

    • Point (omni/spot) and directional 2D lights.

    • Hard or soft shadows (adjustable on a per-light basis).

    • Custom shaders can access a real-time SDF representation of the 2D scene based on LightOccluder2D nodes, which can be used for improved 2D lighting effects including 2D global illumination.

  • Font rendering using bitmaps, rasterization using FreeType or multi-channel signed distance fields (MSDF).

    • Bitmap fonts can be exported using tools like BMFont, or imported from images (for fixed-width fonts only).

    • Dynamic fonts support monochrome fonts as well as colored fonts (e.g. for emoji). Supported formats are TTF, OTF, WOFF1 and WOFF2.

    • Dynamic fonts support optional font outlines with adjustable width and color.

    • Dynamic fonts support variable fonts and OpenType features including ligatures.

    • Dynamic fonts support simulated bold and italic when the font file lacks those styles.

    • Dynamic fonts support oversampling to keep fonts sharp at higher resolutions.

    • Dynamic fonts support subpixel positioning to make fonts crisper at low sizes.

    • Dynamic fonts support LCD subpixel optimizations to make fonts even crisper at low sizes.

    • Signed distance field fonts can be scaled at any resolution without requiring re-rasterization. Multi-channel usage makes SDF fonts scale down to lower sizes better compared to monochrome SDF fonts.

  • GPU-based particles with support for custom particle shaders.

  • 基于 CPU 的粒子。

2D 工具

  • TileMaps for 2D tile-based level design.

  • 内置平滑和拖动边距的2D相机.

  • 用于代表 2D 空间中的一条路径的 Path2D 节点。

    • 可以在编辑器中绘制或者通过程序生成。

    • 用于使节点跟随一条Path2D的PathFollow2D 节点.

  • 2D geometry helper class.

2D物理

物理实体:

  • 静态实体.

  • Animatable bodies (for objects moving only by script or animation, such as doors and platforms).

  • 刚体.

  • Character bodies.

  • 关节(Joints).

  • 用以检测实体进入或离开的区域.

碰撞检测:

  • Built-in shapes: line, box, circle, capsule, world boundary (infinite plane).

  • 碰撞多边形(可以人工绘制,或者在编辑器中根据精灵生成)。

3D 图形

  • HDR rendering with sRGB.

  • 透视、正交以及视锥偏移摄像机。

  • When using the Forward+ backend, a depth prepass is used to improve performance in complex scenes by reducing the cost of overdraw.

  • Variable rate shading on supported GPUs in Forward+ and Forward Mobile.

基于物理的渲染(内置材质特性):

  • 遵循迪士尼 PBR 模型。

  • Supports Burley, Lambert, Lambert Wrap (half-Lambert) and Toon diffuse shading modes.

  • Supports Schlick-GGX, Toon and Disabled specular shading modes.

  • 使用粗糙度金属度工作流,支持 ORM 纹理。

  • Uses horizon specular occlusion (Filament model) to improve material appearance.

  • 法线贴图。

  • Parallax/relief mapping with automatic level of detail based on distance.

  • 反照率及法线贴图的细节贴图。

  • Sub-surface scattering and transmittance.

  • Screen-space refraction with support for material roughness (resulting in blurry refraction).

  • Proximity fade (soft particles) and distance fade.

  • Distance fade can use alpha blending or dithering to avoid going through the transparent pipeline.

  • 抖动可以根据每个像素或每个对象来确定。

实时光照:

  • 全向光(日光/月光)。每个场景最多 4 个。

  • 全向光。

  • 可调整锥角和衰减的聚光。

  • 可以单独调整各个光源的镜面反射能量。

  • Adjustable light "size" for fake area lights (will also make shadows blurrier).

  • Optional distance fade system to fade distant lights and their shadows, improving performance.

  • When using the Forward+ backend (default on desktop), lights are rendered with clustered forward optimizations to decrease their individual cost. Clustered rendering also lifts any limits on the number of lights that can be used on a mesh.

  • When using the Forward Mobile backend, up to 8 omni lights and 8 spot lights can be displayed per mesh resource. Baked lighting can be used to overcome this limit if needed.

阴影贴图:

  • DirectionLight:正交(最快)、二分和四分 PSSM。支持在分割之间做混合。

  • OmniLight:双抛物面(快速)或立方映射(较慢但更精确)。支持全景形式的彩色投影纹理。

  • SpotLight: Single texture. Supports colored projector textures.

  • Shadow normal offset bias and shadow pancaking to decrease the amount of visible shadow acne and peter-panning.

  • PCSS-like shadow blur based on the light size and distance from the surface the shadow is cast on.

  • Adjustable shadow blur on a per-light basis.

具有间接照明的全局照明:

  • 烘焙光照贴图(快速,但无法在运行时更新)。

    • 支持仅烘焙间接光照,或者同时烘焙直接和间接光照。可以给各个光源单独设置烘焙模式,从而实现混合光照烘焙。

    • Supports lighting dynamic objects using automatic and manually placed probes.

    • Optionally supports directional lighting and rough reflections based on spherical harmonics.

    • Lightmaps are baked on the GPU using compute shaders (much faster compared to CPU lightmapping). Baking can only be performed from the editor, not in exported projects.

  • Voxel-based GI probes. Supports dynamic lights and dynamic occluders, while also supporting reflections. Requires a fast baking step which can be performed in the editor or at run-time (including from an exported project).

  • Signed-distance field GI designed for large open worlds. Supports dynamic lights, but not dynamic occluders. Supports reflections. No baking required.

  • Screen-space indirect lighting (SSIL) at half or full resolution. Fully real-time and supports any kind of emissive light source (including decals).

  • VoxelGI and SDFGI use a deferred pass to allow for rendering GI at half resolution to improve performance (while still having functional MSAA support).

反射:

  • Voxel-based reflections (when using GI probes) and SDF-based reflections (when using signed distance field GI).

  • 使用 ReflectionProbe 实现较快的烘焙反射或较慢的实时反射。可以选择启用视差盒校正。

  • Screen-space reflections with support for material roughness.

  • 反射技术可以混合在一起,以获得更高的准确性或可扩展性。

  • When using the Forward+ backend (default on desktop), reflection probes are rendered with clustered forward optimizations to decrease their individual cost. Clustered rendering also lifts any limits on the number of reflection probes that can be used on a mesh.

  • When using the Forward Mobile backend, up to 8 reflection probes can be displayed per mesh resource.

Decals:

  • Supports albedo, emissive, ORM and normal mapping.

  • Texture channels are smoothly overlaid on top of the underlying material, with support for normal/ORM-only decals.

  • Support for normal fade to fade the decal depending on its incidence angle.

  • Does not rely on run-time mesh generation. This means decals can be used on complex skinned meshes with no performance penalty, even if the decal moves every frame.

  • Support for nearest, bilinear, trilinear or anisotropic texture filtering (configured globally).

  • Optional distance fade system to fade distant lights and their shadows, improving performance.

  • When using the Forward+ backend (default on desktop), decals are rendered with clustered forward optimizations to decrease their individual cost. Clustered rendering also lifts any limits on the number of decals that can be used on a mesh.

  • When using the Forward Mobile backend, up to 8 decals can be displayed per mesh resource.

天空:

  • 全景天空(使用HDRI).

  • Procedural sky and Physically-based sky that respond to the DirectionalLights in the scene.

  • Support for custom sky shaders, which can be animated.

  • The radiance map used for ambient and specular light can be updated in real-time depending on the quality settings chosen.

雾:

  • Exponential depth fog.

  • Exponential height fog.

  • Support for automatic fog color depending on the sky color (aerial perspective).

  • Support for sun scattering in the fog.

Volumetric fog:

  • Global volumetric fog that reacts to lights and shadows.

  • Volumetric fog can take indirect light into account when using VoxelGI or SDFGI.

  • Fog volume nodes that can be placed to add fog to specific areas (or remove fog from specific areas).

  • Each fog volume can have its own custom shader.

  • Can be used together with traditional fog.

粒子:

  • GPU-based particles with support for subemitters (2D + 3D), trails (2D + 3D), attractors (3D only) and collision (2D + 3D).

    • 3D particle attractor shapes supported: box, sphere and 3D vector fields.

    • 3D particle collision shapes supported: box, sphere, baked signed distance field and real-time heightmap (suited for open world weather effects).

    • 2D particle collision is handled using a signed distance field generated in real-time based on LightOccluder2D nodes in the scene.

    • Trails can use the built-in ribbon trail and tube trail meshes, or custom meshes with skeletons.

    • Support for custom particle shaders with manual emission.

  • 基于 CPU 的粒子。

后期处理:

  • 色调映射(线性, Reinhard, Filmic, ACES).

  • Automatic exposure adjustments based on viewport brightness (and manual exposure override).

  • Near and far depth of field with adjustable bokeh simulation (box, hexagon, circle).

  • Screen-space ambient occlusion (SSAO) at half or full resolution.

  • Glow/bloom with optional bicubic upscaling and several blend modes available: Screen, Soft Light, Add, Replace, Mix.

  • Glow can have a colored dirt map texture, acting as a lens dirt effect.

  • Color correction using a one-dimensional ramp or a 3D LUT texture.

  • Roughness limiter to reduce the impact of specular aliasing.

  • 亮度, 对比度和饱和度调整.

纹理过滤:

  • 最近邻、双线性、三线性、各向异性过滤。

  • Filtering options are defined on a per-use basis, not a per-texture basis.

纹理压缩:

  • Basis Universal (slow, but results in smaller files).

  • BPTC for high-quality compression (not supported on macOS).

  • ETC2 (not supported on macOS).

  • S3TC (not supported on mobile/Web platforms).

抗锯齿:

  • Temporal antialiasing (TAA).

  • Multi-sample antialiasing (MSAA), for both 2D antialiasing and 3D antialiasing.

  • 快速近似抗锯齿(FXAA)。

  • Super-sample antialiasing (SSAA) using bilinear 3D scaling and a 3D resolution scale above 1.0.

  • Alpha antialiasing, MSAA alpha to coverage and alpha hashing on a per-material basis.

Resolution scaling:

  • Support for rendering 3D at a lower resolution while keeping 2D rendering at the original scale. This can be used to improve performance on low-end systems or improve visuals on high-end systems.

  • Resolution scaling uses bilinear filtering or AMD FidelityFX Super Resolution 1.0 (FSR).

  • Texture mipmap LOD bias is adjusted automatically to improve quality at lower resolution scales. It can also be modified with a manual offset.

Most effects listed above can be adjusted for better performance or to further improve quality. This can be helpful when using Godot for offline rendering.

3D 工具

  • Built-in meshes: cube, cylinder/cone, (hemi)sphere, prism, plane, quad, torus, ribbon, tube.

  • GridMaps for 3D tile-based level design.

  • 构造实体几何(用于原型制作)。

  • 程序式几何体生成工具。

  • Path3D 节点表示 3D 空间中的路径。

    • 可以在编辑器中绘制或者通过程序生成。

    • PathFollow3D 节点使节点沿 Path3D 运动。

  • 3D geometry helper class.

  • Support for exporting the current scene as a glTF 2.0 file, both from the editor and at run-time from an exported project.

3D 物理学

物理实体:

  • 静态实体.

  • Animatable bodies (for objects moving only by script or animation, such as doors and platforms).

  • 刚体.

  • Character bodies.

  • 车身(用于街机物理,而非模拟)。

  • 关节(Joints).

  • 柔体。

  • 布娃娃。

  • 用以检测实体进入或离开的区域.

碰撞检测:

  • Built-in shapes: cuboid, sphere, capsule, cylinder, world boundary (infinite plane).

  • 从编辑器中为任何网格生成三角形碰撞形状。

  • 从编辑器中为任何网格生成一个或多个凸碰撞形状。

着色器

  • 2D:自定义顶点、片段和灯光着色器。

  • 3D:自定义顶点、片段、灯光和天空着色器。

  • 基于文本的着色器,使用由 GLSL 启发的着色器语言

  • 可视化着色器编辑器。

    • 支持可视化着色器插件。

编写脚本

常规:

  • 具有脚本扩展节点的面向对象设计模式.

  • 用于脚本之间通信的信号和组.

  • 支持跨语言脚本编程

  • Many 2D, 3D and 4D linear algebra data types such as vectors and transforms.

GDScript:

C#:

  • 打包成一个单独的二进制文件,以保持文件大小和依赖关系。

  • Uses .NET 6.

    • Full support for the C# 10.0 syntax and features.

  • Supports Windows, Linux and macOS. Mobile/web platforms are currently unsupported. To use C# on mobile/web platforms, use Godot 3 instead.

  • 建议使用外部编辑器以从IDE功能中获益.

GDExtension (C, C++, Rust, D, ...):

  • 在需要时, 可以链接到本机库以获得更高的性能和第三方集成.

    • 对于脚本游戏逻辑, 如果性能足够, 建议使用 GDScript 或 C#.

  • Official GDExtension bindings for C and C++.

    • 使用任何你想要的构建系统和语言功能.

  • Actively developed GDExtension bindings for D, Haxe, Python, and Rust bindings provided by the community. (Some of these bindings may be experimental and not production-ready).

音频

特性:

  • 单声道、立体声、5.1 和 7.1 输出。

  • 2D 和 3D 的非定位和定位播放。

    • 选择 2D 或 3D 的多普勒效应。

  • 支持重路由 音频总线 以及大量其它效果.

  • Support for polyphony (playing several sounds from a single AudioStreamPlayer node).

  • Support for random volume and pitch.

  • Support for real-time pitch scaling.

  • Support for sequential/random sample selection, including repetition prevention when using random sample selection.

  • Listener2D 和 Listener3D 节点从不同于摄像机的位置进行侦听。

  • Support for procedural audio generation.

  • Audio input to record microphones.

  • MIDI 输入.

    • 尚不支持MIDI输出.

使用的 API:

  • Windows: WASAPI。

  • macOS: CoreAudio。

  • Linux: PulseAudio 或 ALSA。

导入

格式:

  • Images: See 导入图像.

  • 音频:

    • WAV,可选 IMA-ADPCM 压缩。

    • Ogg Vorbis。

    • MP3。

  • 3D scenes: See 导入 3D 场景.

    • glTF 2.0 (推荐)

    • .blend (by calling Blender's glTF export functionality transparently).

    • FBX (by calling FBX2glTF transparently).

    • Collada(.dae)。

    • Wavefront OBJ (static scenes only, can be loaded directly as a mesh or imported as a 3D scene).

  • Support for loading glTF 2.0 scenes at run-time, including from an exported project.

  • 在导入时使用 Mikktspace 为 3D 网格生成切线,保证与 Blender 等其他 3D 应用的一致性。

输入

  • Input mapping system using hardcoded input events or remappable input actions.

    • 坐标轴参数可以映射到两个不同的操作上, 这些操作可以配置死区.

    • 使用相同的代码支持键盘和手柄操作.

  • 键盘输入.

    • 按键可以被映射到“物理”模式,该模式下按键行为和键盘布局无关。

  • 鼠标输入.

    • 鼠标箭头可以配置为可见, 隐藏, 捕获, 或者限制在窗口范围内.

    • 当捕获了鼠标的原始输入时, 将会绕过windows或者linux操作系统的鼠标加速设置.

  • 手柄输入(最多同时支持 8 个控制器)。

  • 支持带压感的绘图笔和平板输入.

网络

  • Low-level TCP networking using StreamPeer and TCPServer.

  • Low-level UDP networking using PacketPeer and UDPServer.

  • Low-level HTTP requests using HTTPClient.

  • High-level HTTP requests using HTTPRequest.

    • 使用打包的证书相关工具, 支持开箱即用的HTTPS功能.

  • High-level multiplayer API using UDP and ENet.

    • 使用远程过程调用(RPCS)实现的自动同步复制功能.

    • 支持不可靠, 可靠和有序传输模型.

  • WebSocket client and server, available on all platforms.

  • WebRTC client and server, available on all platforms.

  • Support for UPnP to sidestep the requirement to forward ports when hosting a server behind a NAT.

国际化

  • 对包含emoji的Unicode完整支持.

  • 使用 CSVgettext 存储本地化字符串.

    • Support for generating gettext POT and PO files from the editor.

  • 在你的项目中自动在GUI元素中或通过使用 tr() 函数使用本地化的字符串.

  • Support for pluralization and translation contexts when using gettext translations.

  • Support for bidirectional typesetting, text shaping and OpenType localized forms.

  • Automatic UI mirroring for right-to-left locales.

  • Support for pseudolocalization to test your project for i18n-friendliness.

窗口功能与操作系统整合

  • Spawn multiple independent windows within a single process.

  • Move, resize, minimize, and maximize windows spawned by the project.

  • 更改窗口标题和图标.

  • 吸引注意(在大多数平台上表现为标题栏闪烁)。

  • 全屏模式。

    • Uses borderless fullscreen by default on Windows for fast alt-tabbing, but can optionally use exclusive fullscreen to reduce input lag.

  • Borderless windows (fullscreen or non-fullscreen).

  • Ability to keep a window always on top.

  • macOS上的全局菜单整合.

  • Execute commands in a blocking or non-blocking manner (including running multiple instances of the same project).

  • 使用默认或自定义(已注册在系统中的)协议处理器打开文件路径或URL.

  • 解析自定义命令行参数.

  • Any Godot binary (editor or exported project) can be used as a headless server by starting it with the --headless command line argument. This allows running the engine without a GPU or display server.

移动端

  • In-app purchases on Android and iOS.

  • 支持第三方广告组件.

XR 支持(AR 和 VR)

  • Out of the box support for OpenXR.

    • Including support for popular headsets like the Meta Quest and the Valve Index.

  • 开箱即用的iOS ARKit支持.

  • 支持 OpenVR API。

GUI 系统

Godot 的 GUI 也是使用 Control 节点搭建的,和制作游戏时所使用的节点一致。编辑器 UI 可以通过插件轻松地进行各种扩展。

节点:

  • 按钮。

  • 复选框、复选按钮、单选按钮。

  • Text entry using LineEdit (single line) and TextEdit (multiple lines). TextEdit also supports code editing features such as displaying line numbers and syntax highlighting.

  • Dropdown menus using PopupMenu and OptionButton.

  • 滚动条。

  • 标签。

  • RichTextLabel for text formatted using BBCode, with support for animated custom effects.

  • 树状图(也可用于显示表格)。

  • 支持 RGB 及 HSV 模式的取色器。

  • 控件可以旋转和缩放。

调整大小:

  • 锚点可将固定GUI元素在特定的角落, 边缘, 或者居中.

  • 容器可根据特定规则自动放置UI元素.

  • Scale to multiple resolutions using the canvas_items or viewport stretch modes.

  • 使用锚点和 expand 等比例缩放,支持任意纵横比。

主题:

  • 内置主题编辑器。

    • 根据当前的编辑器主题设置生成主题。

  • 使用 StyleBoxFlat 进行基于向量的程序式主题设计。

    • 支持圆角/斜角、阴影、每边框宽度、抗锯齿。

  • 使用 StyleBoxTexture 进行基于纹理的主题设计。

Godot的发行软件包较小, 使其适合替代Electron或Qt之类的框架.

动画

  • 正向运动学与反向运动学.

  • 支持为任何属性制作动画, 可自定义插值.

  • 支持在动画轨道中调用方法.

  • 支持在动画轨道中播放声音.

  • 支持在动画中使用贝塞尔曲线.

文件格式

  • 场景和资源可保存为 文本 或二进制格式.

    • 基于文本的格式易于阅读, 并且对版本控制更友好.

    • 二进制格式保存/加载大型场景/资源的速度更快.

  • Read and write text or binary files using FileAccess.

    • 可选择使用压缩或加密.

  • 读写 JSON 文件.

  • 使用 ConfigFile 读写 INI 样式的配置文件.

    • 可以(反)序列化任何 Godot 数据类型,包括 Vector2/3、Color 等。

  • 使用 XMLParser 读取 XML 文件。

  • Read and write ZIP files using ZIPReader and ZIPPacker.

  • 将游戏数据打包到 PCK 文件(针对快速搜索优化的自定义格式),ZIP 存档或直接打包到可执行文件中以进行单文件分发。

  • 导出额外的 PCK 文件,引擎可以读取这些文件以支持 mod 和 DLC。

杂项

  • Video playback with built-in support for Ogg Theora.

  • Movie Maker mode to record videos from a running project with synchronized audio and perfect frame pacing.

  • 对服务器的低级别访问,能够在必要时绕过场景树的开销。

  • 使用命令行接口进行自动化。

    • 使用持续集成平台导出和部署项目.

    • 适用于 Bash、zsh 和 fish 的 Shell 补全脚本

    • Print colored text to standard output on all platforms using print_rich.

  • Support for C++ modules statically linked into the engine binary.

  • Engine and editor written in C++17.

    • 可使用 GCC、Clang、MSVC 进行编译。同时支持 MinGW。

    • 对打包者友好。通常情况下,可以使用系统库代替 Godot 提供的库。构建系统不会下载任何东西。构建完全可重现。

  • 使用宽松的 MIT 许可。

参见

Godot 建议库 列出了社区要求的、可能在未来 Godot 版本中实现的功能。