Skip to content

Commit a776f0d

Browse files
committed
Update resource importing documentation for Godot 4.0
- Add best practices for importing images and audio, such as texture size recommendations.
1 parent 80f5259 commit a776f0d

21 files changed

+792
-203
lines changed

tutorials/3d/3d_rendering_limitations.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ your texture to display correctly on all platforms, you should avoid using
2323
textures larger than 4096×4096 and use a power of two size if the texture needs
2424
to repeat.
2525

26+
To limit the size of a specific texture that may be too large to render, you can
27+
set the **Process > Size Limit** import option to a value greater than ``0``.
28+
This will reduce the texture's dimensions on import (preserving aspect ratio)
29+
without affecting the source file.
30+
2631
.. _doc_3d_rendering_limitations_color_banding:
2732

2833
Color banding

tutorials/3d/standard_material_3d.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,8 @@ World Triplanar
448448
When using triplanar mapping, it is computed in object local space. This
449449
option makes it use world space instead.
450450

451+
.. _doc_standard_material_3d_sampling:
452+
451453
Sampling
452454
--------
453455

tutorials/3d/volumetric_fog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ the following properties in FogMaterial:
204204
of the FogVolume. This can be used to vary fog density within the FogVolume
205205
with any kind of static pattern. For animated effects, consider using a custom
206206
:ref:`fog shader <doc_fog_shader>`.
207+
You can import any image as a 3D texture by
208+
:ref:`changing its import type in the Import dock <doc_importing_images_changing_import_type>`.
207209

208210
Custom FogVolume shaders
209211
------------------------
-10.5 KB
Binary file not shown.
-7.32 KB
Binary file not shown.
-12.5 KB
Binary file not shown.
-2.61 KB
Binary file not shown.
-3.05 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

tutorials/assets_pipeline/import_process.rst

Lines changed: 84 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,48 @@
33
Import process
44
==============
55

6-
Importing assets in Godot 3.0+
7-
------------------------------
6+
Importing assets in Godot
7+
-------------------------
88

9-
Previously, importing assets in Godot 2.x required manual maintenance
10-
of a separate directory with source assets. Without doing this, it was
11-
impossible to specify how to convert and change import flags for
12-
textures, audio files, scenes, etc.
9+
To import assets in Godot, place your assets (image files, scenes, audio
10+
files, fonts, etc) directly in the project folder. There are 2 ways to achieve this:
1311

14-
In Godot 3.0+, we use a more modern approach to importing: Simply drop
15-
your assets (image files, scenes, audio files, fonts, etc) directly in the
16-
project folder (copy them manually with your OS file explorer).
17-
Godot will automatically import these files internally
18-
and keep the imported resources hidden in a ``res://.import`` folder.
12+
- **For any file type:** Copy files manually with your operating system's file manager.
13+
- **For file types that can be imported by Godot:**
14+
Drag-and-drop files from the operating system's file manager to the editor's FileSystem dock.
15+
This only works with *resource* file types (i.e. file types that Godot can import).
1916

20-
This means that when trying to access imported assets through code you
17+
Godot will automatically import these files internally and keep the imported
18+
resources hidden in a ``res://.godot/imported/`` folder.
19+
20+
This means that when trying to access imported assets through code, you
2121
need to use the :ref:`Resource Loader<class_ResourceLoader>` as it will
2222
automatically take into account where the internal files are saved. If you
23-
try and access an imported asset using the :ref:`FileAccess <class_FileAccess>` class
24-
it will work in the editor, but break in the exported project.
23+
try and access an imported asset using the :ref:`FileAccess <class_FileAccess>` class,
24+
it will work in the editor, but **it will break in the exported project**.
2525

2626
However, the :ref:`Resource Loader<class_ResourceLoader>` cannot access
27-
non imported files, only the :ref:`FileAccess <class_FileAccess>` class can.
27+
non-imported files. Only the :ref:`FileAccess <class_FileAccess>` class can.
2828

2929
Changing import parameters
3030
--------------------------
3131

32-
To change the import parameters of an asset in Godot (again, keep in mind
33-
import parameters are only present in non-native Godot resource types)
34-
select the relevant resource in the filesystem dock:
32+
.. note::
33+
34+
Import parameters are only present in *non-native* Godot resource types.
35+
This means Godot's own scene and resource file formats (``.tscn``, ``.scn``,
36+
``.tres``, ``.res``) don't have import options you can select in the Import
37+
dock.
38+
39+
To change the import parameters of an asset in Godot, select the relevant
40+
resource in the FileSystem dock:
3541

36-
.. image:: img/asset_workflow1.png
42+
.. image:: img/import_process_example.webp
3743

38-
Then, after adjusting the parameters, press "Reimport". These parameters
39-
will only be used for this asset and on future reimports.
44+
After adjusting the parameters, click **Reimport**. Be careful: if you select
45+
another file in the FileSystem dock before clicking **Reimport**, changes will
46+
be discarded. After clicking **Reimport**, the chosen parameters will only be
47+
used for this asset and on future reimports.
4048

4149
Changing the import parameters of several assets at the same time is also
4250
possible. Simply select all of them together in the resources dock and the
@@ -66,48 +74,77 @@ automatic reimport of it, applying the preset configured for that specific
6674
asset.
6775

6876
Files generated
69-
-----------------
77+
---------------
78+
79+
Importing will add an extra ``<asset>.import`` file next to the source file,
80+
containing the import configuration.
81+
82+
**Make sure to commit these files to your version control system**, as these
83+
files contain important metadata.
84+
85+
::
7086

71-
Importing will add an extra ``<asset>.import`` file, containing the import
72-
configuration. Make sure to commit these to your version control system!
87+
$ ls
88+
example.png
89+
example.png.import
90+
project.godot
7391

74-
.. image:: img/asset_workflow4.png
92+
Additionally, extra assets will be preset in the hidden
93+
``res://.godot/imported/`` folder:
7594

76-
Additionally, extra assets will be preset in the hidden ``res://.import`` folder:
95+
::
7796

78-
.. image:: img/asset_workflow5.png
97+
$ ls .godot/imported
98+
example.png-218a8f2b3041327d8a5756f3a245f83b.ctex
99+
example.png-218a8f2b3041327d8a5756f3a245f83b.md5
79100

80101
If any of the files present in this folder is erased (or the whole folder), the
81-
asset or assets will be reimported automatically. As such, committing this folder
82-
to the version control system is optional. It can shorten
83-
reimporting time when checking out on another computer, but it takes considerably
84-
more space and transfer time. Pick your poison!
102+
asset or assets will be reimported automatically. As such, committing the
103+
``.godot/`` folder to the version control system is not recommended. While
104+
committing this folder can shorten reimporting time when checking out on another
105+
computer, it requires considerably more space and bandwidth.
106+
107+
The default version control metadata that can be generated on project creation
108+
will automatically ignore the ``.godot/`` folder.
85109

86110
Changing import resource type
87111
-----------------------------
88112

89-
Some source assets can be imported as different types of resources.
90-
For this, select the relevant type of resource desired and
91-
press "Reimport":
113+
Some source assets can be imported as different types of resources. For this,
114+
select the relevant type of resource desired then click **Reimport**:
115+
116+
.. image:: img/import_process_changing_import_type.webp
92117

93-
.. image:: img/asset_workflow2.png
118+
.. note::
94119

120+
For technical reasons, the editor must be restarted after changing an import
121+
type in the Import dock.
95122

96123
Changing default import parameters
97-
-----------------------------------
124+
----------------------------------
98125

99-
Different types of games might require different defaults.
100-
Changing the defaults per project can be achieved by using the
101-
"Preset.." Menu. Besides some resource types offering presets,
102-
the default setting can be saved and cleared too:
126+
Different types of projects might require different defaults. Changing the import
127+
options to a predefined set of options can be achieved by using the
128+
**Preset...** Menu. Besides some resource types offering presets, the default
129+
settings can be saved and cleared too:
103130

104-
.. image:: img/asset_workflow3.png
131+
.. image:: img/import_process_change_preset.webp
105132

106-
Simplicity is key!
107-
------------------
133+
The default import parameters for a given resource type can be changed
134+
project-wide using the **Import Defaults** tab of the Project Settings dialog:
135+
136+
.. image:: img/import_process_import_defaults.webp
137+
138+
Further reading
139+
---------------
140+
141+
This workflow takes a little time to get used to, but it enforces a more correct
142+
way to deal with resources.
108143

109-
This workflow is aimed to be simple and take very little time to get used to. It also enforces a more
110-
correct way to deal with resources.
144+
There are many types of assets available for import. Continue reading to
145+
understand how to work with all of them:
111146

112-
There are many types of assets available for import, so please continue reading to understand how to work
113-
with all of them!
147+
- :ref:`doc_importing_images`
148+
- :ref:`doc_importing_audio_samples`
149+
- :ref:`doc_importing_3d_scenes`
150+
- :ref:`doc_importing_translations`

0 commit comments

Comments
 (0)