From a865a960f7474c7bb8f053be677c2667b4319314 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sun, 19 Apr 2020 17:13:04 +0100 Subject: [PATCH] Convert SpatialMaterial references to StandardMaterial3D. --- .../workflow/assets/escn_exporter/material.rst | 2 +- .../workflow/assets/importing_images.rst | 2 +- tutorials/3d/gi_probes.rst | 2 +- tutorials/3d/index.rst | 2 +- tutorials/3d/lights_and_shadows.rst | 2 +- tutorials/3d/optimizing_3d_performance.rst | 4 ++-- tutorials/3d/reflection_probes.rst | 2 +- ...atial_material.rst => standard_material_3d.rst} | 14 +++++++------- tutorials/misc/gles2_gles3_differences.rst | 8 ++++---- tutorials/plugins/editor/import_plugins.rst | 10 +++++----- tutorials/shading/shader_materials.rst | 6 +++--- .../shading/shading_reference/particle_shader.rst | 2 +- .../your_second_spatial_shader.rst | 2 +- 13 files changed, 29 insertions(+), 29 deletions(-) rename tutorials/3d/{spatial_material.rst => standard_material_3d.rst} (97%) diff --git a/getting_started/workflow/assets/escn_exporter/material.rst b/getting_started/workflow/assets/escn_exporter/material.rst index d8d017554..fa6a5e85a 100644 --- a/getting_started/workflow/assets/escn_exporter/material.rst +++ b/getting_started/workflow/assets/escn_exporter/material.rst @@ -13,7 +13,7 @@ To do this, the exporter attempts to find Godot materials with names that match those of the material name in Blender. So if you export an object in Blender with the material name ``PurpleDots`` then the exporter will search for the file ``PurpleDots.tres`` and assign it to the object. If this file is not a -``SpatialMaterial`` or ``ShaderMaterial`` or if it cannot be found, then the +``StandardMaterial3D`` or ``ShaderMaterial`` or if it cannot be found, then the exporter will fall back to exporting the material from Blender. diff --git a/getting_started/workflow/assets/importing_images.rst b/getting_started/workflow/assets/importing_images.rst index 7823dbb36..78160c0a3 100644 --- a/getting_started/workflow/assets/importing_images.rst +++ b/getting_started/workflow/assets/importing_images.rst @@ -209,4 +209,4 @@ A few HDR files are broken and contain sRGB color data. It is advised not to use Invert Color ~~~~~~~~~~~~ -Reverses the image's color. This is useful, for example, to convert a height map generated by external programs to depth map to use with :ref:`doc_spatial_material`. +Reverses the image's color. This is useful, for example, to convert a height map generated by external programs to depth map to use with :ref:`doc_standard_material_3d`. diff --git a/tutorials/3d/gi_probes.rst b/tutorials/3d/gi_probes.rst index ac479f356..03a89a8ab 100644 --- a/tutorials/3d/gi_probes.rst +++ b/tutorials/3d/gi_probes.rst @@ -11,7 +11,7 @@ Introduction when using the GLES2 renderer. Just like with :ref:`doc_reflection_probes`, and as stated in -the :ref:`doc_spatial_material`, objects can show reflected or diffuse light. +the :ref:`doc_standard_material_3d`, objects can show reflected or diffuse light. GI Probes are similar to Reflection Probes, but they use a different and more complex technique to produce indirect light and reflections. diff --git a/tutorials/3d/index.rst b/tutorials/3d/index.rst index fe738a835..e3e57b276 100644 --- a/tutorials/3d/index.rst +++ b/tutorials/3d/index.rst @@ -9,7 +9,7 @@ using_transforms optimizing_3d_performance 3d_rendering_limitations - spatial_material + standard_material_3d lights_and_shadows reflection_probes gi_probes diff --git a/tutorials/3d/lights_and_shadows.rst b/tutorials/3d/lights_and_shadows.rst index 28b639216..f3f94c958 100644 --- a/tutorials/3d/lights_and_shadows.rst +++ b/tutorials/3d/lights_and_shadows.rst @@ -17,7 +17,7 @@ result. Light can come from several types of sources in a scene: - Baked Light (read :ref:`doc_baked_lightmaps`). The emission color is a material property. You can read more about it -in the :ref:`doc_spatial_material` tutorial. +in the :ref:`doc_standard_material_3d` tutorial. Light nodes ----------- diff --git a/tutorials/3d/optimizing_3d_performance.rst b/tutorials/3d/optimizing_3d_performance.rst index 6b3ac661f..61adb600b 100644 --- a/tutorials/3d/optimizing_3d_performance.rst +++ b/tutorials/3d/optimizing_3d_performance.rst @@ -52,7 +52,7 @@ Reuse shaders and materials The Godot renderer is a little different to what is out there. It's designed to minimize GPU state changes as much as possible. -:ref:`class_SpatialMaterial` +:ref:`class_StandardMaterial3D` does a good job at reusing materials that need similar shaders but, if custom shaders are used, make sure to reuse them as much as possible. Godot's priorities will be like this: @@ -62,7 +62,7 @@ Godot's priorities will be like this: of objects (in the hundreds or thousands) try reusing the materials or in the worst case use atlases. - **Reusing Shaders**: If materials can't be reused, at least try to - re-use shaders (or SpatialMaterials with different parameters but the same + re-use shaders (or StandardMaterial3Ds with different parameters but the same configuration). If a scene has, for example, 20.000 objects with 20.000 different diff --git a/tutorials/3d/reflection_probes.rst b/tutorials/3d/reflection_probes.rst index 76ff3ac9c..f5509a4d4 100644 --- a/tutorials/3d/reflection_probes.rst +++ b/tutorials/3d/reflection_probes.rst @@ -6,7 +6,7 @@ Reflection probes Introduction ------------ -As stated in the :ref:`doc_spatial_material`, objects can show reflected or diffuse light. +As stated in the :ref:`doc_standard_material_3d`, objects can show reflected or diffuse light. Reflection probes are used as a source of reflected and ambient light for objects inside their area of influence. A probe of this type captures the surroundings (as a sort of 360 degrees image), and stores versions diff --git a/tutorials/3d/spatial_material.rst b/tutorials/3d/standard_material_3d.rst similarity index 97% rename from tutorials/3d/spatial_material.rst rename to tutorials/3d/standard_material_3d.rst index 3ea07e135..438d20104 100644 --- a/tutorials/3d/spatial_material.rst +++ b/tutorials/3d/standard_material_3d.rst @@ -1,18 +1,18 @@ -.. _doc_spatial_material: +.. _doc_standard_material_3d: -Spatial Material -================ +Standard Material 3D +==================== Introduction ------------ -``SpatialMaterial`` is a default 3D material that aims to provide most of the features +``StandardMaterial3D`` is a default 3D material that aims to provide most of the features artists look for in a material, without the need for writing shader code. However, it can be converted to shader code if additional functionality is needed. -This tutorial explains most parameters present in ``SpatialMaterial``. +This tutorial explains most parameters present in ``StandardMaterial3D``. -There are three ways to add a ``SpatialMaterial`` to an object. It can be added in +There are three ways to add a ``StandardMaterial3D`` to an object. It can be added in the *Material* property of the mesh. It can be added in the *Material* property of the node using the mesh (such as a MeshInstance node), or in the *Material Override* property of the node using the mesh. @@ -160,7 +160,7 @@ option on will help them look correct. Parameters ----------- -``SpatialMaterial`` also has several configurable parameters to tweak +``StandardMaterial3D`` also has several configurable parameters to tweak many aspects of the rendering: .. image:: img/spatial_material5.png diff --git a/tutorials/misc/gles2_gles3_differences.rst b/tutorials/misc/gles2_gles3_differences.rst index 905f711ff..e94966241 100644 --- a/tutorials/misc/gles2_gles3_differences.rst +++ b/tutorials/misc/gles2_gles3_differences.rst @@ -50,10 +50,10 @@ GLES2 is not capable of using High Dynamic Range (HDR) rendering features. If HD project, or for a given viewport, Godot will still user Low Dynamic Range (LDR) which limits viewport values to the ``0-1`` range. -SpatialMaterial features ------------------------- +StandardMaterial3D features +--------------------------- -In GLES2, the following advanced rendering features in the :ref:`SpatialMaterial ` are missing: +In GLES2, the following advanced rendering features in the :ref:`StandardMaterial3D ` are missing: - Refraction - Subsurface scattering @@ -61,7 +61,7 @@ In GLES2, the following advanced rendering features in the :ref:`SpatialMaterial - Clearcoat - Depth mapping -When using SpatialMaterials they will not even appear in the editor. +When using StandardMaterial3Ds they will not even appear in the editor. In custom :ref:`ShaderMaterials `, you can set values for these features but they will be non-functional. For example, you will still be able to set the ``SSS`` built-in (which normally adds diff --git a/tutorials/plugins/editor/import_plugins.rst b/tutorials/plugins/editor/import_plugins.rst index 675b83d3d..fffc4b543 100644 --- a/tutorials/plugins/editor/import_plugins.rst +++ b/tutorials/plugins/editor/import_plugins.rst @@ -147,13 +147,13 @@ way by the engine. :: func get_resource_type(): - return "SpatialMaterial" + return "StandardMaterial3D" The imported resource has a specific type, so the editor can know which property slot it belongs to. This allows drag and drop from the FileSystem dock to a property in the Inspector. -In our case it's a :ref:`class_SpatialMaterial`, which can be applied to 3D +In our case it's a :ref:`class_StandardMaterial3D`, which can be applied to 3D objects. .. note:: If you need to import different types from the same extension, you @@ -324,10 +324,10 @@ it sets the color as a pure red instead. :: - var material = SpatialMaterial.new() + var material = StandardMaterial3D.new() material.albedo_color = color -This part makes a new :ref:`SpatialMaterial ` that is the +This part makes a new :ref:`StandardMaterial3D ` that is the imported resource. We create a new instance of it and then set its albedo color as the value we got before. @@ -382,7 +382,7 @@ in a different file: :: - var next_pass = SpatialMaterial.new() + var next_pass = StandardMaterial3D.new() next_pass.albedo_color = color.inverted() var next_pass_path = "%s.next_pass.%s" % [save_path, get_save_extension()] diff --git a/tutorials/shading/shader_materials.rst b/tutorials/shading/shader_materials.rst index 46a1e1060..49fda70a0 100644 --- a/tutorials/shading/shader_materials.rst +++ b/tutorials/shading/shader_materials.rst @@ -7,7 +7,7 @@ Introduction ------------ For the most common cases, Godot provides ready to use materials for -most types of shaders, such as :ref:`SpatialMaterial `, +most types of shaders, such as :ref:`StandardMaterial3D `, :ref:`CanvasItemMaterial ` and :ref:`ParticlesMaterial `. They are flexible implementations that cover most use cases. @@ -69,7 +69,7 @@ your visual shader to a text shader. Converting to ShaderMaterial ---------------------------- -It is possible to convert from SpatialMaterial, CanvasItemMaterial and +It is possible to convert from StandardMaterial3D, CanvasItemMaterial and ParticlesMaterial to ShaderMaterial. To do so, go to the material properties and select the convert option. @@ -77,5 +77,5 @@ and select the convert option. .. note:: - Using the convert option will turn the SpatialMaterial into a ShaderMaterial + Using the convert option will turn the StandardMaterial3D into a ShaderMaterial with a text shader, not a visual shader. diff --git a/tutorials/shading/shading_reference/particle_shader.rst b/tutorials/shading/shading_reference/particle_shader.rst index d9d0a8f9f..2fb5f1868 100644 --- a/tutorials/shading/shading_reference/particle_shader.rst +++ b/tutorials/shading/shading_reference/particle_shader.rst @@ -58,7 +58,7 @@ Global built-ins are available everywhere, including custom functions. Vertex built-ins ^^^^^^^^^^^^^^^^ -In order to use the ``COLOR`` variable in a SpatialMaterial, set ``use_vertex_as_albedo`` +In order to use the ``COLOR`` variable in a StandardMaterial3D, set ``use_vertex_as_albedo`` to ``true``. In a ShaderMaterial, access it with the ``COLOR`` variable. +---------------------------------+-------------------------------------------------------------------------------------+ diff --git a/tutorials/shading/your_first_shader/your_second_spatial_shader.rst b/tutorials/shading/your_first_shader/your_second_spatial_shader.rst index 2a22a0124..5db088573 100644 --- a/tutorials/shading/your_first_shader/your_second_spatial_shader.rst +++ b/tutorials/shading/your_first_shader/your_second_spatial_shader.rst @@ -141,7 +141,7 @@ when you are looking at the surface head-on or at a glancing angle. float fresnel = sqrt(1.0 - dot(NORMAL, VIEW)); And mix it into both ``ROUGHNESS`` and ``ALBEDO``. This is the benefit of ShaderMaterials over -SpatialMaterials. With SpatialMaterials, we could set these properties with a texture, or to a flat +StandardMaterial3Ds. With StandardMaterial3D, we could set these properties with a texture, or to a flat number. But with shaders we can set them based on any mathematical function that we can dream up.