Skip to content

Commit 7313c4e

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 7313c4e

21 files changed

+774
-193
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: 66 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,23 @@
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.
13-
14-
In Godot 3.0+, we use a more modern approach to importing: Simply drop
9+
In Godot 3.0we use a more modern approach to importing: Simply drop
1510
your assets (image files, scenes, audio files, fonts, etc) directly in the
16-
project folder (copy them manually with your OS file explorer).
11+
project folder (copy them manually with your operating system's file manager).
1712
Godot will automatically import these files internally
1813
and keep the imported resources hidden in a ``res://.import`` folder.
1914

20-
This means that when trying to access imported assets through code you
15+
This means that when trying to access imported assets through code, you
2116
need to use the :ref:`Resource Loader<class_ResourceLoader>` as it will
2217
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.
18+
try and access an imported asset using the :ref:`FileAccess <class_FileAccess>` class,
19+
it will work in the editor, but **it will break in the exported project**.
2520

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

2924
Changing import parameters
3025
--------------------------
@@ -33,7 +28,7 @@ To change the import parameters of an asset in Godot (again, keep in mind
3328
import parameters are only present in non-native Godot resource types)
3429
select the relevant resource in the filesystem dock:
3530

36-
.. image:: img/asset_workflow1.png
31+
.. image:: img/import_process_example.webp
3732

3833
Then, after adjusting the parameters, press "Reimport". These parameters
3934
will only be used for this asset and on future reimports.
@@ -42,6 +37,11 @@ Changing the import parameters of several assets at the same time is also
4237
possible. Simply select all of them together in the resources dock and the
4338
exposed parameters will apply to all of them when reimporting.
4439

40+
Default import parameters for
41+
Custom fonts' properties are governed by their respective import options
42+
instead. You can use the **Import Defaults** section of the Project Settings
43+
dialog to override default import options for custom fonts.
44+
4545
Reimporting multiple assets
4646
---------------------------
4747

@@ -66,48 +66,77 @@ automatic reimport of it, applying the preset configured for that specific
6666
asset.
6767

6868
Files generated
69-
-----------------
69+
---------------
70+
71+
Importing will add an extra ``<asset>.import`` file next to the source file,
72+
containing the import configuration.
7073

71-
Importing will add an extra ``<asset>.import`` file, containing the import
72-
configuration. Make sure to commit these to your version control system!
74+
**Make sure to commit these files to your version control system**, as these
75+
files contain important metadata.
7376

74-
.. image:: img/asset_workflow4.png
77+
::
7578

76-
Additionally, extra assets will be preset in the hidden ``res://.import`` folder:
79+
$ ls
80+
example.png
81+
example.png.import
82+
project.godot
7783

78-
.. image:: img/asset_workflow5.png
84+
Additionally, extra assets will be preset in the hidden
85+
``res://.godot/imported/`` folder:
86+
87+
::
88+
89+
$ ls .godot/imported
90+
example.png-218a8f2b3041327d8a5756f3a245f83b.ctex
91+
example.png-218a8f2b3041327d8a5756f3a245f83b.md5
7992

8093
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!
94+
asset or assets will be reimported automatically. As such, committing the
95+
``.godot/`` folder to the version control system is not recommended. While
96+
committing this folder can shorten reimporting time when checking out on another
97+
computer, it requires considerably more space and bandwidth.
98+
99+
The default version control metadata that can be generated on project creation
100+
will automatically ignore the ``.godot/`` folder.
85101

86102
Changing import resource type
87103
-----------------------------
88104

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":
105+
Some source assets can be imported as different types of resources. For this,
106+
select the relevant type of resource desired then click **Reimport**:
92107

93-
.. image:: img/asset_workflow2.png
108+
.. image:: img/import_process_changing_import_type.webp
94109

110+
.. note::
111+
112+
For technical reasons, the editor must be restarted after changing an import
113+
type in the Import dock.
95114

96115
Changing default import parameters
97-
-----------------------------------
116+
----------------------------------
98117

99118
Different types of games might require different defaults.
100119
Changing the defaults per project can be achieved by using the
101-
"Preset.." Menu. Besides some resource types offering presets,
120+
**Preset...** Menu. Besides some resource types offering presets,
102121
the default setting can be saved and cleared too:
103122

104-
.. image:: img/asset_workflow3.png
123+
.. image:: img/import_process_change_preset.webp
105124

106-
Simplicity is key!
107-
------------------
125+
The default import parameters for a given resource type can be changed
126+
project-wide using the **Import Defaults** tab of the Project Settings dialog:
127+
128+
.. image:: img/import_process_import_defaults.webp
129+
130+
Further reading
131+
---------------
132+
133+
This workflow takes a little time to get used to, but it enforces a more correct
134+
way to deal with resources.
108135

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.
136+
There are many types of assets available for import. Continue reading to
137+
understand how to work with all of them:
111138

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

0 commit comments

Comments
 (0)