godot/doc/classes/ResourceImporterOBJ.xml
Hugo Locurcio b8ee61f45d
Add Generate LODs, Shadow Mesh and Lightmap UV2 options to OBJ mesh import
This puts OBJ mesh import on parity with 3D scene import. It's now
possible to have the same level of optimization as imported 3D scenes
while using the OBJ mesh workflow.

`optimize_indices_for_cache()` is now always called on import as well,
similar to what the 3D scene import already does.
2024-10-25 02:48:42 +02:00

42 lines
4.0 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<class name="ResourceImporterOBJ" inherits="ResourceImporter" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Imports an OBJ 3D model as an independent [Mesh] or scene.
</brief_description>
<description>
Unlike [ResourceImporterScene], [ResourceImporterOBJ] will import a single [Mesh] resource by default instead of importing a [PackedScene]. This makes it easier to use the [Mesh] resource in nodes that expect direct [Mesh] resources, such as [GridMap], [GPUParticles3D] or [CPUParticles3D]. Note that it is still possible to save mesh resources from 3D scenes using the [b]Advanced Import Settings[/b] dialog, regardless of the source format.
See also [ResourceImporterScene], which is used for more advanced 3D formats such as glTF.
</description>
<tutorials>
<link title="Importing 3D scenes">$DOCS_URL/tutorials/assets_pipeline/importing_3d_scenes/index.html</link>
</tutorials>
<members>
<member name="force_disable_mesh_compression" type="bool" setter="" getter="" default="false">
If [code]true[/code], mesh compression will not be used. Consider enabling if you notice blocky artifacts in your mesh normals or UVs, or if you have meshes that are larger than a few thousand meters in each direction.
</member>
<member name="generate_lightmap_uv2" type="bool" setter="" getter="" default="false">
If [code]true[/code], generates UV2 on import for [LightmapGI] baking.
</member>
<member name="generate_lightmap_uv2_texel_size" type="float" setter="" getter="" default="0.2">
Controls the size of each texel on the baked lightmap. A smaller value results in more precise lightmaps, at the cost of larger lightmap sizes and longer bake times.
[b]Note:[/b] Only effective if [member generate_lightmap_uv2] is [code]true[/code].
</member>
<member name="generate_lods" type="bool" setter="" getter="" default="true">
If [code]true[/code], generates lower detail variants of the mesh which will be displayed in the distance to improve rendering performance. Not all meshes benefit from LOD, especially if they are never rendered from far away. Disabling this can reduce output file size and speed up importing. See [url=$DOCS_URL/tutorials/3d/mesh_lod.html#doc-mesh-lod]Mesh level of detail (LOD)[/url] for more information.
</member>
<member name="generate_shadow_mesh" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables the generation of shadow meshes on import. This optimizes shadow rendering without reducing quality by welding vertices together when possible. This in turn reduces the memory bandwidth required to render shadows. Shadow mesh generation currently doesn't support using a lower detail level than the source mesh (but shadow rendering will make use of LODs when relevant).
</member>
<member name="generate_tangents" type="bool" setter="" getter="" default="true">
If [code]true[/code], generate vertex tangents using [url=http://www.mikktspace.com/]Mikktspace[/url] if the source mesh doesn't have tangent data. When possible, it's recommended to let the 3D modeling software generate tangents on export instead on relying on this option. Tangents are required for correct display of normal and height maps, along with any material/shader features that require tangents.
If you don't need material features that require tangents, disabling this can reduce output file size and speed up importing if the source 3D file doesn't contain tangents.
</member>
<member name="offset_mesh" type="Vector3" setter="" getter="" default="Vector3(0, 0, 0)">
Offsets the mesh's data by the specified value. This can be used to work around misaligned meshes without having to modify the source file.
</member>
<member name="scale_mesh" type="Vector3" setter="" getter="" default="Vector3(1, 1, 1)">
Scales the mesh's data by the specified value. This can be used to work around misscaled meshes without having to modify the source file.
</member>
</members>
</class>