summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/io/multiplayer_api.cpp1
-rw-r--r--core/io/zip_io.cpp1
-rw-r--r--doc/classes/Material.xml4
-rw-r--r--doc/classes/Shader.xml13
-rw-r--r--doc/classes/ShaderMaterial.xml2
-rw-r--r--doc/classes/SpatialMaterial.xml140
-rw-r--r--drivers/gles2/rasterizer_scene_gles2.cpp35
-rw-r--r--drivers/gles2/rasterizer_storage_gles2.cpp21
-rw-r--r--drivers/gles3/rasterizer_gles3.cpp17
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp51
-rw-r--r--drivers/gles3/shader_compiler_gles3.cpp41
-rw-r--r--drivers/gles3/shaders/scene.glsl29
-rw-r--r--editor/animation_bezier_editor.cpp20
-rw-r--r--editor/animation_track_editor.cpp20
-rw-r--r--editor/import/resource_importer_scene.cpp5
-rw-r--r--editor/plugins/sprite_editor_plugin.cpp63
-rw-r--r--editor/project_manager.cpp4
-rw-r--r--editor/spatial_editor_gizmos.cpp108
-rw-r--r--editor/spatial_editor_gizmos.h13
-rw-r--r--modules/gdnative/pluginscript/pluginscript_instance.cpp49
-rw-r--r--modules/gdnative/pluginscript/pluginscript_instance.h14
-rw-r--r--modules/gdscript/gdscript_function.cpp4
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/CsProjOperations.cs7
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Internals/ScriptClassParser.cs11
-rw-r--r--modules/mono/editor/script_class_parser.cpp81
-rw-r--r--modules/websocket/websocket_multiplayer_peer.cpp2
-rw-r--r--scene/2d/polygon_2d.cpp189
-rw-r--r--scene/3d/portal.cpp232
-rw-r--r--scene/3d/portal.h88
-rw-r--r--scene/3d/room_instance.cpp164
-rw-r--r--scene/3d/room_instance.h81
-rw-r--r--scene/3d/voxel_light_baker.cpp4
-rw-r--r--scene/animation/animation_blend_tree.cpp16
-rw-r--r--scene/register_scene_types.cpp2
-rw-r--r--scene/resources/dynamic_font.cpp4
-rw-r--r--scene/resources/font.cpp4
-rw-r--r--scene/resources/room.cpp70
-rw-r--r--scene/resources/room.h62
-rw-r--r--servers/audio_server.h12
-rw-r--r--servers/visual/visual_server_raster.h5
-rw-r--r--servers/visual/visual_server_scene.cpp4
-rw-r--r--servers/visual/visual_server_scene.h23
-rw-r--r--servers/visual/visual_server_wrap_mt.h5
-rw-r--r--servers/visual_server.h7
44 files changed, 292 insertions, 1436 deletions
diff --git a/core/io/multiplayer_api.cpp b/core/io/multiplayer_api.cpp
index 2708cb8c01..381ac4c0bb 100644
--- a/core/io/multiplayer_api.cpp
+++ b/core/io/multiplayer_api.cpp
@@ -111,6 +111,7 @@ void MultiplayerAPI::poll() {
Error err = network_peer->get_packet(&packet, len);
if (err != OK) {
ERR_PRINT("Error getting packet!");
+ break; // Something is wrong!
}
rpc_sender_id = sender;
diff --git a/core/io/zip_io.cpp b/core/io/zip_io.cpp
index 582b7c906b..40e902d874 100644
--- a/core/io/zip_io.cpp
+++ b/core/io/zip_io.cpp
@@ -97,6 +97,7 @@ int zipio_close(voidpf opaque, voidpf stream) {
FileAccess *&f = *(FileAccess **)opaque;
if (f) {
f->close();
+ memdelete(f);
f = NULL;
}
return 0;
diff --git a/doc/classes/Material.xml b/doc/classes/Material.xml
index f584c5207a..7a620ead3b 100644
--- a/doc/classes/Material.xml
+++ b/doc/classes/Material.xml
@@ -12,8 +12,12 @@
</methods>
<members>
<member name="next_pass" type="Material" setter="set_next_pass" getter="get_next_pass">
+ Sets the [Material] to be used for the next pass. This renders the object again using a different material.
+ [b]Note:[/b] only applies to [SpatialMaterial]s and [ShaderMaterial]s with type "Spatial".
</member>
<member name="render_priority" type="int" setter="set_render_priority" getter="get_render_priority" default="0">
+ Sets the render priority for transparent objects in 3D scenes. Higher priority objects will be sorted in front of lower priority objects.
+ [b]Note:[/b] this only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are sorted based on depth, while transparent objects are sorted from back to front (subject to priority).
</member>
</members>
<constants>
diff --git a/doc/classes/Shader.xml b/doc/classes/Shader.xml
index be9509fda5..673248a3b1 100644
--- a/doc/classes/Shader.xml
+++ b/doc/classes/Shader.xml
@@ -4,10 +4,11 @@
A custom shader program.
</brief_description>
<description>
- This class allows you to define a custom shader program that can be used for various materials to render objects.
+ This class allows you to define a custom shader program that can be used by a [ShaderMaterial]. Shaders allow you to write your own custom behavior for rendering objects or updating particle information. For a detailed explanation and usage, please see the tutorials linked below.
</description>
<tutorials>
<link>https://docs.godotengine.org/en/latest/tutorials/shading/index.html</link>
+ <link>https://docs.godotengine.org/en/latest/tutorials/shading/your_first_shader/what_are_shaders.html</link>
</tutorials>
<methods>
<method name="get_default_texture_param" qualifiers="const">
@@ -16,6 +17,8 @@
<argument index="0" name="param" type="String">
</argument>
<description>
+ Returns the texture that is set as default for the specified parameter.
+ [b]Note:[/b] [code]param[/code] must match the name of the uniform in the code exactly.
</description>
</method>
<method name="get_mode" qualifiers="const">
@@ -31,6 +34,8 @@
<argument index="0" name="name" type="String">
</argument>
<description>
+ Returns [code]true[/code] if the shader has this param defined as a uniform in its code.
+ [b]Note:[/b] [code]param[/code] must match the name of the uniform in the code exactly.
</description>
</method>
<method name="set_default_texture_param">
@@ -41,19 +46,25 @@
<argument index="1" name="texture" type="Texture">
</argument>
<description>
+ Sets the default texture to be used with a texture uniform. The default is used if a texture is not set in the [ShaderMaterial].
+ [b]Note:[/b] [code]param[/code] must match the name of the uniform in the code exactly.
</description>
</method>
</methods>
<members>
<member name="code" type="String" setter="set_code" getter="get_code" default="&quot;&quot;">
+ Returns the shader's code as the user has written it, not the full generated code used internally.
</member>
</members>
<constants>
<constant name="MODE_SPATIAL" value="0" enum="Mode">
+ Mode used to draw all 3D objects.
</constant>
<constant name="MODE_CANVAS_ITEM" value="1" enum="Mode">
+ Mode used to draw all 2D objects.
</constant>
<constant name="MODE_PARTICLES" value="2" enum="Mode">
+ Mode used to calculate particle information on a per-particle basis. Not used for drawing.
</constant>
</constants>
</class>
diff --git a/doc/classes/ShaderMaterial.xml b/doc/classes/ShaderMaterial.xml
index 0f39b703ca..f2742a5453 100644
--- a/doc/classes/ShaderMaterial.xml
+++ b/doc/classes/ShaderMaterial.xml
@@ -45,7 +45,7 @@
<argument index="1" name="value" type="Variant">
</argument>
<description>
- Changes the value set for this material of a uniform in the shader.
+ Changes the value set for this material of a uniform in the shader. [b]Note:[/b] [code]param[/code] must match the name of the uniform in the code exactly.
</description>
</method>
</methods>
diff --git a/doc/classes/SpatialMaterial.xml b/doc/classes/SpatialMaterial.xml
index df315d7430..912161a5ae 100644
--- a/doc/classes/SpatialMaterial.xml
+++ b/doc/classes/SpatialMaterial.xml
@@ -16,6 +16,7 @@
<argument index="0" name="feature" type="int" enum="SpatialMaterial.Feature">
</argument>
<description>
+ Returns [code]true[/code], if the specifed [enum Feature] is enabled.
</description>
</method>
<method name="get_flag" qualifiers="const">
@@ -24,6 +25,7 @@
<argument index="0" name="flag" type="int" enum="SpatialMaterial.Flags">
</argument>
<description>
+ Returns [code]true[/code], if the specified flag is enabled. See [enum Flags] enumerator for options.
</description>
</method>
<method name="get_texture" qualifiers="const">
@@ -32,6 +34,7 @@
<argument index="0" name="param" type="int" enum="SpatialMaterial.TextureParam">
</argument>
<description>
+ Returns the [Texture] associated with the specified [enum TextureParam].
</description>
</method>
<method name="set_feature">
@@ -42,6 +45,7 @@
<argument index="1" name="enable" type="bool">
</argument>
<description>
+ If [code]true[/code], enables the specified [enum Feature]. Many features that are available in [SpatialMaterial]s need to be enabled before use. This way the cost for using the feature is only incurred when specified. Features can also be enabled by setting the corresponding member to [code]true[/code].
</description>
</method>
<method name="set_flag">
@@ -52,6 +56,7 @@
<argument index="1" name="enable" type="bool">
</argument>
<description>
+ If [code]true[/code], enables the specified flag. Flags are optional behaviour that can be turned on and off. Only one flag can be enabled at a time with this function, the flag enumerators cannot be bit-masked together to enable or disable multiple flags at once. Flags can also be enabled by setting the corresponding member to [code]true[/code]. See [enum Flags] enumerator for options.
</description>
</method>
<method name="set_texture">
@@ -62,6 +67,7 @@
<argument index="1" name="texture" type="Texture">
</argument>
<description>
+ Sets the [Texture] to be used by the specified [enum TextureParam]. This function is called when setting members ending in [code]*_texture[/code].
</description>
</method>
</methods>
@@ -70,86 +76,115 @@
The material's base color.
</member>
<member name="albedo_texture" type="Texture" setter="set_texture" getter="get_texture">
+ Texture to multiply by [member albedo_color]. Used for basic texturing of objects.
</member>
<member name="anisotropy" type="float" setter="set_anisotropy" getter="get_anisotropy">
The strength of the anisotropy effect.
</member>
<member name="anisotropy_enabled" type="bool" setter="set_feature" getter="get_feature" default="false">
- If [code]true[/code], anisotropy is enabled. Changes the shape of the specular blob and aligns it to tangent space.
+ If [code]true[/code], anisotropy is enabled. Changes the shape of the specular blob and aligns it to tangent space. Mesh tangents are needed for this to work. If the mesh does not contain tangents the anisotropy effect will appear broken.
</member>
<member name="anisotropy_flowmap" type="Texture" setter="set_texture" getter="get_texture">
+ Texture that offsets the tangent map for anisotropy calculations.
</member>
<member name="ao_enabled" type="bool" setter="set_feature" getter="get_feature" default="false">
- If [code]true[/code], ambient occlusion is enabled.
+ If [code]true[/code], ambient occlusion is enabled. Ambient occlusion darkens areas based on the [member ao_texture].
</member>
<member name="ao_light_affect" type="float" setter="set_ao_light_affect" getter="get_ao_light_affect">
+ Amount that ambient occlusion affects lighting from lights. If [code]0[/code], ambient occlusion only affects ambient light. If [code]1[/code], ambient occlusion affects lights just as much as it affects ambient light. This can be used to impact the strength of the ambient occlusion effect, but typically looks unrealistic.
</member>
<member name="ao_on_uv2" type="bool" setter="set_flag" getter="get_flag">
+ If [code]true[/code], use [code]UV2[/code] coordinates to look up from the [member ao_texture].
</member>
<member name="ao_texture" type="Texture" setter="set_texture" getter="get_texture">
+ Texture that defines the amount of ambient occlusion for a given point on the object.
</member>
<member name="ao_texture_channel" type="int" setter="set_ao_texture_channel" getter="get_ao_texture_channel" enum="SpatialMaterial.TextureChannel">
+ Specifies the channel of the [member ao_texture] in which the ambient occlusion information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use.
</member>
<member name="clearcoat" type="float" setter="set_clearcoat" getter="get_clearcoat">
+ Sets the strength of the clearcoat effect. Setting to [code]0[/code] looks the same as disabling the clearcoat effect.
</member>
<member name="clearcoat_enabled" type="bool" setter="set_feature" getter="get_feature" default="false">
- If [code]true[/code], clearcoat rendering is enabled. Adds a secondary transparent pass to the material.
+ If [code]true[/code], clearcoat rendering is enabled. Adds a secondary transparent pass to the lighting calculation resulting in an added specular blob. This makes materials appear as if they have a clear layer on them that can either by glossy or rough.
</member>
<member name="clearcoat_gloss" type="float" setter="set_clearcoat_gloss" getter="get_clearcoat_gloss">
+ Sets the roughness of the clearcoat pass. A higher value results in a smoother clearcoat while a lower value results in a rougher clearcoat.
</member>
<member name="clearcoat_texture" type="Texture" setter="set_texture" getter="get_texture">
+ Texture that defines the strength of the clearcoat effect and the glossiness of the clearcoat. Strength is specified in the red channel while glossiness is specified in the green channel.
</member>
<member name="depth_deep_parallax" type="bool" setter="set_depth_deep_parallax" getter="is_depth_deep_parallax_enabled">
+ If [code]true[/code], the shader will read depth texture at multiple points along the view ray to determine occlusion and parrallax. This can be very performance demanding, but results in more realistic looking depth mapping.
</member>
<member name="depth_enabled" type="bool" setter="set_feature" getter="get_feature" default="false">
If [code]true[/code], depth mapping is enabled (also called "parallax mapping" or "height mapping"). See also [member normal_enabled].
</member>
<member name="depth_flip_binormal" type="bool" setter="set_depth_deep_parallax_flip_binormal" getter="get_depth_deep_parallax_flip_binormal">
+ If [code]true[/code], direction of the binormal is flipped before using in the depth effect. This may be necessary if you have encoded your binormals in a way that is conflicting with the depth effect.
</member>
<member name="depth_flip_tangent" type="bool" setter="set_depth_deep_parallax_flip_tangent" getter="get_depth_deep_parallax_flip_tangent">
+ If [code]true[/code], direction of the tangent is flipped before using in the depth effect. This may be necessary if you have encoded your tangents in a way that is conflicting with the depth effect.
</member>
<member name="depth_max_layers" type="int" setter="set_depth_deep_parallax_max_layers" getter="get_depth_deep_parallax_max_layers">
+ Number of layers to use when using [member depth_deep_parallax] and the view direction is perpendicular to the surface of the object. A higher number will be more performance demanding while a lower number may not look as crisp.
</member>
<member name="depth_min_layers" type="int" setter="set_depth_deep_parallax_min_layers" getter="get_depth_deep_parallax_min_layers">
+ Number of layers to use when using [member depth_deep_parallax] and the view direction is parallel to the surface of the object. A higher number will be more performance demanding while a lower number may not look as crisp.
</member>
<member name="depth_scale" type="float" setter="set_depth_scale" getter="get_depth_scale">
+ Scales the depth offset effect. A higher number will create a larger depth.
</member>
<member name="depth_texture" type="Texture" setter="set_texture" getter="get_texture">
+ Texture used to determine depth at a given pixel. Depth is always stored in the red channel.
</member>
<member name="detail_albedo" type="Texture" setter="set_texture" getter="get_texture">
+ Texture that specifies the color of the detail overlay.
</member>
<member name="detail_blend_mode" type="int" setter="set_detail_blend_mode" getter="get_detail_blend_mode" enum="SpatialMaterial.BlendMode">
+ Specifies how the [member detail_albedo] should blend with the current [code]ALBEDO[/code]. See [enum BlendMode] for options.
</member>
<member name="detail_enabled" type="bool" setter="set_feature" getter="get_feature" default="false">
+ If [code]true[/code], enables the detail overlay. Detail is a second texture that gets mixed over the surface of the object based on [member detail_mask]. This can be used to add variation to objects, or to blend between two different albedo/normal textures.
</member>
<member name="detail_mask" type="Texture" setter="set_texture" getter="get_texture">
+ Texture used to specify how the detail textures get blended with the base textures.
</member>
<member name="detail_normal" type="Texture" setter="set_texture" getter="get_texture">
+ Texture that specifies the per-pixel normal of the detail overlay.
</member>
<member name="detail_uv_layer" type="int" setter="set_detail_uv" getter="get_detail_uv" enum="SpatialMaterial.DetailUV">
+ Specifies whether to use [code]UV[/code] or [code]UV2[/code] for the detail layer. See [enum DetailUV] for options.
</member>
<member name="distance_fade_max_distance" type="float" setter="set_distance_fade_max_distance" getter="get_distance_fade_max_distance">
+ Distance at which the object fades fully and is no longer visible.
</member>
<member name="distance_fade_min_distance" type="float" setter="set_distance_fade_min_distance" getter="get_distance_fade_min_distance">
+ Distance at which the object starts to fade. If the object is less than this distance away it will appear normal.
</member>
<member name="distance_fade_mode" type="int" setter="set_distance_fade" getter="get_distance_fade" enum="SpatialMaterial.DistanceFadeMode" default="0">
+ Specifies which type of fade to use. Can be any of the [enum DistanceFadeMode]s.
</member>
<member name="emission" type="Color" setter="set_emission" getter="get_emission">
The emitted light's color. See [member emission_enabled].
</member>
<member name="emission_enabled" type="bool" setter="set_feature" getter="get_feature" default="false">
- If [code]true[/code], the body emits light.
+ If [code]true[/code], the body emits light. Emitting light makes the object appear brighter. The object can also cast light on other objects if a [GIProbe] or [BakedLightmap] is used and this object is used in baked lighting.
</member>
<member name="emission_energy" type="float" setter="set_emission_energy" getter="get_emission_energy">
The emitted light's strength. See [member emission_enabled].
</member>
<member name="emission_on_uv2" type="bool" setter="set_flag" getter="get_flag">
+ Use [code]UV2[/code] to read from the [member emission_texture].
</member>
<member name="emission_operator" type="int" setter="set_emission_operator" getter="get_emission_operator" enum="SpatialMaterial.EmissionOperator">
+ Sets how [member emission] interacts with [member emission_texture]. Can either add or multiply. See [enum EmissionOperator] for options.
</member>
<member name="emission_texture" type="Texture" setter="set_texture" getter="get_texture">
+ Texture that specifies how much surface emits light at a given point.
</member>
<member name="flags_albedo_tex_force_srgb" type="bool" setter="set_flag" getter="get_flag" default="false">
+ Forces a conversion of the [member albedo_texture] from sRGB space to linear space.
</member>
<member name="flags_disable_ambient_light" type="bool" setter="set_flag" getter="get_flag" default="false">
If [code]true[/code], the object receives no ambient light.
@@ -158,6 +193,7 @@
If [code]true[/code], the object receives no shadow that would otherwise be cast onto it.
</member>
<member name="flags_ensure_correct_normals" type="bool" setter="set_flag" getter="get_flag" default="false">
+ If [code]true[/code], the shader will compute extra operations to make sure the normal stays correct when using a non-uniform scale. Only enable if using non-uniform scaling.
</member>
<member name="flags_fixed_size" type="bool" setter="set_flag" getter="get_flag" default="false">
If [code]true[/code], the object is rendered at the same size regardless of distance.
@@ -176,6 +212,7 @@
[b]Note:[/b] this is only effective for objects whose geometry is point-based rather than triangle-based. See also [member params_point_size].
</member>
<member name="flags_use_shadow_to_opacity" type="bool" setter="set_flag" getter="get_flag" default="false">
+ If [code]true[/code], enables the "shadow to opacity" render mode where lighting modifies the alpha so shadowed areas are opaque and non-shadowed areas are transparent. Useful for overlaying shadows onto a camera feed in AR.
</member>
<member name="flags_vertex_lighting" type="bool" setter="set_flag" getter="get_flag" default="false">
If [code]true[/code], lighting is calculated per vertex rather than per pixel. This may increase performance on low-end devices.
@@ -187,12 +224,14 @@
The reflectivity of the object's surface. The higher the value, the more light is reflected.
</member>
<member name="metallic_specular" type="float" setter="set_specular" getter="get_specular" default="0.5">
- General reflectivity amount.
+ Sets the size of the specular lobe. The specular lobe is the bright spot that is reflected from light sources.
[b]Note:[/b] unlike [member metallic], this is not energy-conserving, so it should be left at [code]0.5[/code] in most cases. See also [member roughness].
</member>
<member name="metallic_texture" type="Texture" setter="set_texture" getter="get_texture">
+ Texture used to specify metallic for an object. This is multiplied by [member metallic].
</member>
<member name="metallic_texture_channel" type="int" setter="set_metallic_texture_channel" getter="get_metallic_texture_channel" enum="SpatialMaterial.TextureChannel" default="0">
+ Specifies the channel of the [member metallic_texture] in which the metallic information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use.
</member>
<member name="normal_enabled" type="bool" setter="set_feature" getter="get_feature" default="false">
If [code]true[/code], normal mapping is enabled.
@@ -201,10 +240,13 @@
The strength of the normal map's effect.
</member>
<member name="normal_texture" type="Texture" setter="set_texture" getter="get_texture">
+ Texture used to specify the normal at a given pixel. The [code]normal_texture[/code] only uses the red and green channels. The normal read from [code]normal_texture[/code] is oriented around the surface normal provided by the [Mesh].
</member>
<member name="params_alpha_scissor_threshold" type="float" setter="set_alpha_scissor_threshold" getter="get_alpha_scissor_threshold">
+ Threshold at which the alpha scissor will discard values.
</member>
<member name="params_billboard_keep_scale" type="bool" setter="set_flag" getter="get_flag" default="false">
+ If [code]true[/code], the shader will keep the scale set for the mesh. Otherwise the scale is lost when billboarding. Only applies when [member params_billboard_mode] is [constant BILLBOARD_ENABLED].
</member>
<member name="params_billboard_mode" type="int" setter="set_billboard_mode" getter="get_billboard_mode" enum="SpatialMaterial.BillboardMode" default="0">
Controls how the object faces the camera. See [enum BillboardMode].
@@ -229,6 +271,7 @@
Grows object vertices in the direction of their normals.
</member>
<member name="params_line_width" type="float" setter="set_line_width" getter="get_line_width" default="1.0">
+ Currently unimplemented in Godot.
</member>
<member name="params_point_size" type="float" setter="set_point_size" getter="get_point_size" default="1.0">
The point size in pixels. See [member flags_use_point_size].
@@ -237,6 +280,7 @@
The method for rendering the specular blob. See [enum SpecularMode].
</member>
<member name="params_use_alpha_scissor" type="bool" setter="set_flag" getter="get_flag" default="false">
+ If [code]true[/code], the shader will discard all pixels that have an alpha value less than [member params_alpha_scissor_threshold].
</member>
<member name="particles_anim_h_frames" type="int" setter="set_particles_anim_h_frames" getter="get_particles_anim_h_frames">
The number of horizontal frames in the particle sprite sheet. Only enabled when using [constant BILLBOARD_PARTICLES]. See [member params_billboard_mode].
@@ -248,9 +292,10 @@
The number of vertical frames in the particle sprite sheet. Only enabled when using [constant BILLBOARD_PARTICLES]. See [member params_billboard_mode].
</member>
<member name="proximity_fade_distance" type="float" setter="set_proximity_fade_distance" getter="get_proximity_fade_distance">
+ Distance over which the fade effect takes place. The larger the distance the longer it takes for an object to fade.
</member>
<member name="proximity_fade_enable" type="bool" setter="set_proximity_fade" getter="is_proximity_fade_enabled" default="false">
- If [code]true[/code], the proximity and distance fade effect is enabled.
+ If [code]true[/code], the proximity fade effect is enabled. The proximity fade effect fades out each pixel based on its distance to another object.
</member>
<member name="refraction_enabled" type="bool" setter="set_feature" getter="get_feature" default="false">
If [code]true[/code], the refraction effect is enabled. Distorts transparency based on light from behind the object.
@@ -259,15 +304,19 @@
The strength of the refraction effect.
</member>
<member name="refraction_texture" type="Texture" setter="set_texture" getter="get_texture">
+ Texture that controls the strength of the refraction per-pixel. Multiplied by [member refraction_scale].
</member>
<member name="refraction_texture_channel" type="int" setter="set_refraction_texture_channel" getter="get_refraction_texture_channel" enum="SpatialMaterial.TextureChannel">
+ Specifies the channel of the [member ao_texture] in which the ambient occlusion information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use.
</member>
<member name="rim" type="float" setter="set_rim" getter="get_rim">
+ Sets the strength of the rim lighting effect.
</member>
<member name="rim_enabled" type="bool" setter="set_feature" getter="get_feature" default="false">
- If [code]true[/code], rim effect is enabled.
+ If [code]true[/code], rim effect is enabled. Rim lighting increases the brightness at glancing angles on an object.
</member>
<member name="rim_texture" type="Texture" setter="set_texture" getter="get_texture">
+ Texture used to set the strength of the rim lighting effect per-pixel. Multiplied by [member rim].
</member>
<member name="rim_tint" type="float" setter="set_rim_tint" getter="get_rim_tint">
The amount of to blend light and albedo color when rendering rim effect. If [code]0[/code] the light color is used, while [code]1[/code] means albedo color is used. An intermediate value generally works best.
@@ -276,8 +325,10 @@
Surface reflection. A value of [code]0[/code] represents a perfect mirror while a value of [code]1[/code] completely blurs the reflection. See also [member metallic].
</member>
<member name="roughness_texture" type="Texture" setter="set_texture" getter="get_texture">
+ Texture used to control the roughness per-pixel. Multiplied by [member roughness].
</member>
<member name="roughness_texture_channel" type="int" setter="set_roughness_texture_channel" getter="get_roughness_texture_channel" enum="SpatialMaterial.TextureChannel" default="0">
+ Specifies the channel of the [member ao_texture] in which the ambient occlusion information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use.
</member>
<member name="subsurf_scatter_enabled" type="bool" setter="set_feature" getter="get_feature" default="false">
If [code]true[/code], subsurface scattering is enabled. Emulates light that penetrates an object's surface, is scattered, and then emerges.
@@ -286,6 +337,7 @@
The strength of the subsurface scattering effect.
</member>
<member name="subsurf_scatter_texture" type="Texture" setter="set_texture" getter="get_texture">
+ Texture used to control the subsurface scattering strength. Stored in the red texture channel. Multiplied by [member subsurf_scatter_strength].
</member>
<member name="transmission" type="Color" setter="set_transmission" getter="get_transmission">
The color used by the transmission effect. Represents the light passing through an object.
@@ -294,22 +346,31 @@
If [code]true[/code], the transmission effect is enabled.
</member>
<member name="transmission_texture" type="Texture" setter="set_texture" getter="get_texture">
+ Texture used to control the transmission effect per-pixel. Added to [member transmission].
</member>
<member name="uv1_offset" type="Vector3" setter="set_uv1_offset" getter="get_uv1_offset" default="Vector3( 0, 0, 0 )">
+ How much to offset the [code]UV[/code] coordinates. This amount will be added to [code]UV[/code] in the vertex function. This can be used to offset a texture.
</member>
<member name="uv1_scale" type="Vector3" setter="set_uv1_scale" getter="get_uv1_scale" default="Vector3( 1, 1, 1 )">
+ How much to scale the [code]UV[/code] coordinates. This is multiplied by [code]UV[/code] in the vertex function.
</member>
<member name="uv1_triplanar" type="bool" setter="set_flag" getter="get_flag" default="false">
+ If [code]true[/code], instead of using [code]UV[/code] textures will use a triplanar texture lookup to determine how to apply textures. Triplanar uses the orientation of the object's surface to blend between texture coordinates. It reads from the source texture 3 times, once for each axis and then blends between the results based on how closely the pixel aligns with each axis. This is often used for natural features to get a realistic blend of materials. Because triplanar texturing requires many more texture reads per-pixel it is much slower than normal UV texturing. Additionally, because it is blending the texture between the three axes, it is unsuitable when you are trying to achieve crisp texturing.
</member>
<member name="uv1_triplanar_sharpness" type="float" setter="set_uv1_triplanar_blend_sharpness" getter="get_uv1_triplanar_blend_sharpness" default="1.0">
+ A lower number blends the texture more softly while a higher number blends the texture more sharply.
</member>
<member name="uv2_offset" type="Vector3" setter="set_uv2_offset" getter="get_uv2_offset" default="Vector3( 0, 0, 0 )">
+ How much to offset the [code]UV2[/code] coordinates. This amount will be added to [code]UV2[/code] in the vertex function. This can be used to offset a texture.
</member>
<member name="uv2_scale" type="Vector3" setter="set_uv2_scale" getter="get_uv2_scale" default="Vector3( 1, 1, 1 )">
+ How much to scale the [code]UV2[/code] coordinates. This is multiplied by [code]UV2[/code] in the vertex function.
</member>
<member name="uv2_triplanar" type="bool" setter="set_flag" getter="get_flag" default="false">
+ If [code]true[/code], instead of using [code]UV2[/code] textures will use a triplanar texture lookup to determine how to apply textures. Triplanar uses the orientation of the object's surface to blend between texture coordinates. It reads from the source texture 3 times, once for each axis and then blends between the results based on how closely the pixel aligns with each axis. This is often used for natural features to get a realistic blend of materials. Because triplanar texturing requires many more texture reads per-pixel it is much slower than normal UV texturing. Additionally, because it is blending the texture between the three axes, it is unsuitable when you are trying to achieve crisp texturing.
</member>
<member name="uv2_triplanar_sharpness" type="float" setter="set_uv2_triplanar_blend_sharpness" getter="get_uv2_triplanar_blend_sharpness" default="1.0">
+ A lower number blends the texture more softly while a higher number blends the texture more sharply.
</member>
<member name="vertex_color_is_srgb" type="bool" setter="set_flag" getter="get_flag" default="false">
If [code]true[/code], the model's vertex colors are processed as sRGB mode.
@@ -320,79 +381,112 @@
</members>
<constants>
<constant name="TEXTURE_ALBEDO" value="0" enum="TextureParam">
+ Texture specifying per-pixel color.
</constant>
<constant name="TEXTURE_METALLIC" value="1" enum="TextureParam">
+ Texture specifying per-pixel metallic value.
</constant>
<constant name="TEXTURE_ROUGHNESS" value="2" enum="TextureParam">
+ Texture specifying per-pixel roughness value.
</constant>
<constant name="TEXTURE_EMISSION" value="3" enum="TextureParam">
+ Texture specifying per-pixel emission color.
</constant>
<constant name="TEXTURE_NORMAL" value="4" enum="TextureParam">
+ Texture specifying per-pixel normal vector.
</constant>
<constant name="TEXTURE_RIM" value="5" enum="TextureParam">
+ Texture specifying per-pixel rim value.
</constant>
<constant name="TEXTURE_CLEARCOAT" value="6" enum="TextureParam">
+ Texture specifying per-pixel clearcoat value.
</constant>
<constant name="TEXTURE_FLOWMAP" value="7" enum="TextureParam">
+ Texture specifying per-pixel flowmap direction for use with [member anisotropy].
</constant>
<constant name="TEXTURE_AMBIENT_OCCLUSION" value="8" enum="TextureParam">
+ Texture specifying per-pixel ambient occlusion value.
</constant>
<constant name="TEXTURE_DEPTH" value="9" enum="TextureParam">
+ Texture specifying per-pixel depth.
</constant>
<constant name="TEXTURE_SUBSURFACE_SCATTERING" value="10" enum="TextureParam">
+ Texture specifying per-pixel subsurface scattering.
</constant>
<constant name="TEXTURE_TRANSMISSION" value="11" enum="TextureParam">
+ Texture specifying per-pixel transmission color.
</constant>
<constant name="TEXTURE_REFRACTION" value="12" enum="TextureParam">
+ Texture specifying per-pixel refraction strength.
</constant>
<constant name="TEXTURE_DETAIL_MASK" value="13" enum="TextureParam">
+ Texture specifying per-pixel detail mask blending value.
</constant>
<constant name="TEXTURE_DETAIL_ALBEDO" value="14" enum="TextureParam">
+ Texture specifying per-pixel detail color.
</constant>
<constant name="TEXTURE_DETAIL_NORMAL" value="15" enum="TextureParam">
+ Texture specifying per-pixel detail normal.
</constant>
<constant name="TEXTURE_MAX" value="16" enum="TextureParam">
Represents the size of the [enum TextureParam] enum.
</constant>
<constant name="DETAIL_UV_1" value="0" enum="DetailUV">
+ Use [code]UV[/code] with the detail texture.
</constant>
<constant name="DETAIL_UV_2" value="1" enum="DetailUV">
+ Use [code]UV2[/code] with the detail texture.
</constant>
<constant name="FEATURE_TRANSPARENT" value="0" enum="Feature">
+ Constant for setting [member flags_transparent].
</constant>
<constant name="FEATURE_EMISSION" value="1" enum="Feature">
+ Constant for setting [member emission_enabled].
</constant>
<constant name="FEATURE_NORMAL_MAPPING" value="2" enum="Feature">
+ Constant for setting [member normal_enabled].
</constant>
<constant name="FEATURE_RIM" value="3" enum="Feature">
+ Constant for setting [member rim_enabled].
</constant>
<constant name="FEATURE_CLEARCOAT" value="4" enum="Feature">
+ Constant for setting [member clearcoat_enabled].
</constant>
<constant name="FEATURE_ANISOTROPY" value="5" enum="Feature">
+ Constant for setting [member anisotropy_enabled].
</constant>
<constant name="FEATURE_AMBIENT_OCCLUSION" value="6" enum="Feature">
+ Constant for setting [member ao_enabled].
</constant>
<constant name="FEATURE_DEPTH_MAPPING" value="7" enum="Feature">
+ Constant for setting [member depth_enabled].
</constant>
<constant name="FEATURE_SUBSURACE_SCATTERING" value="8" enum="Feature">
+ Constant for setting [member subsurf_scatter_enabled].
</constant>
<constant name="FEATURE_TRANSMISSION" value="9" enum="Feature">
+ Constant for setting [member transmission_enabled].
</constant>
<constant name="FEATURE_REFRACTION" value="10" enum="Feature">
+ Constant for setting [member refraction_enabled].
</constant>
<constant name="FEATURE_DETAIL" value="11" enum="Feature">
+ Constant for setting [member detail_enabled].
</constant>
<constant name="FEATURE_MAX" value="12" enum="Feature">
Represents the size of the [enum Feature] enum.
</constant>
<constant name="BLEND_MODE_MIX" value="0" enum="BlendMode">
- Default blend mode.
+ Default blend mode. The color of the object is blended over the background based on the object's alpha value.
</constant>
<constant name="BLEND_MODE_ADD" value="1" enum="BlendMode">
+ The color of the object is added to the background.
</constant>
<constant name="BLEND_MODE_SUB" value="2" enum="BlendMode">
+ The color of the object is subtracted from the background.
</constant>
<constant name="BLEND_MODE_MUL" value="3" enum="BlendMode">
+ The color of the object is multiplied by the background.
</constant>
<constant name="DEPTH_DRAW_OPAQUE_ONLY" value="0" enum="DepthDrawMode">
Default depth draw mode. Depth is drawn only for opaque objects.
@@ -416,42 +510,61 @@
No culling is performed.
</constant>
<constant name="FLAG_UNSHADED" value="0" enum="Flags">
+ No lighting is used on the object. Color comes directly from [code]ALBEDO[/code].
</constant>
<constant name="FLAG_USE_VERTEX_LIGHTING" value="1" enum="Flags">
+ Lighting is calculated per-vertex rather than per-pixel. This can be used to increase the speed of the shader at the cost of quality.
</constant>
<constant name="FLAG_DISABLE_DEPTH_TEST" value="2" enum="Flags">
+ Disables the depth test, so this object is drawn on top of all others. However, objects drawn after it in the draw order may cover it.
</constant>
<constant name="FLAG_ALBEDO_FROM_VERTEX_COLOR" value="3" enum="Flags">
+ Set [code]ALBEDO[/code] to the per-vertex color specified in the mesh.
</constant>
<constant name="FLAG_SRGB_VERTEX_COLOR" value="4" enum="Flags">
+ Vertex color is in sRGB space and needs to be converted to linear. Only applies in the GLES3 renderer.
</constant>
<constant name="FLAG_USE_POINT_SIZE" value="5" enum="Flags">
+ Uses point size to alter the size of primitive points. Also changes the albedo texture lookup to use [code]POINT_COORD[/code] instead of [code]UV[/code].
</constant>
<constant name="FLAG_FIXED_SIZE" value="6" enum="Flags">
+ Object is scaled by depth so that it always appears the same size on screen.
</constant>
<constant name="FLAG_BILLBOARD_KEEP_SCALE" value="7" enum="Flags">
+ Shader will keep the scale set for the mesh. Otherwise the scale is lost when billboarding. Only applies when [member params_billboard_mode] is [constant BILLBOARD_ENABLED].
</constant>
<constant name="FLAG_UV1_USE_TRIPLANAR" value="8" enum="Flags">
+ Use triplanar texture lookup for all texture lookups that would normally use [code]UV[/code].
</constant>
<constant name="FLAG_UV2_USE_TRIPLANAR" value="9" enum="Flags">
+ Use triplanar texture lookup for all texture lookups that would normally use [code]UV2[/code].
</constant>
<constant name="FLAG_AO_ON_UV2" value="11" enum="Flags">
+ Use [code]UV2[/code] coordinates to look up from the [member ao_texture].
</constant>
<constant name="FLAG_EMISSION_ON_UV2" value="12" enum="Flags">
+ Use [code]UV2[/code] coordinates to look up from the [member emission_texture].
</constant>
<constant name="FLAG_USE_ALPHA_SCISSOR" value="13" enum="Flags">
+ Use alpha scissor. Set by [member params_use_alpha_scissor].
</constant>
<constant name="FLAG_TRIPLANAR_USE_WORLD" value="10" enum="Flags">
+ Use world coordinates in the triplanar texture lookup instead of local coordinates.
</constant>
<constant name="FLAG_ALBEDO_TEXTURE_FORCE_SRGB" value="14" enum="Flags">
+ Forces the shader to convert albedo from sRGB space to linear space.
</constant>
<constant name="FLAG_DONT_RECEIVE_SHADOWS" value="15" enum="Flags">
+ Disables receiving shadows from other objects.
</constant>
<constant name="FLAG_DISABLE_AMBIENT_LIGHT" value="17" enum="Flags">
+ Disables receiving ambient light.
</constant>
<constant name="FLAG_ENSURE_CORRECT_NORMALS" value="16" enum="Flags">
+ Ensures that normals appear correct, even with non-uniform scaling.
</constant>
<constant name="FLAG_USE_SHADOW_TO_OPACITY" value="18" enum="Flags">
+ Enables the shadow to opacity feature.
</constant>
<constant name="FLAG_MAX" value="19" enum="Flags">
Represents the size of the [enum Flags] enum.
@@ -499,26 +612,37 @@
Used for particle systems. Enables particle animation options.
</constant>
<constant name="TEXTURE_CHANNEL_RED" value="0" enum="TextureChannel">
+ Used to read from the red channel of a texture.
</constant>
<constant name="TEXTURE_CHANNEL_GREEN" value="1" enum="TextureChannel">
+ Used to read from the green channel of a texture.
</constant>
<constant name="TEXTURE_CHANNEL_BLUE" value="2" enum="TextureChannel">
+ Used to read from the blue channel of a texture.
</constant>
<constant name="TEXTURE_CHANNEL_ALPHA" value="3" enum="TextureChannel">
+ Used to read from the alpha channel of a texture.
</constant>
<constant name="TEXTURE_CHANNEL_GRAYSCALE" value="4" enum="TextureChannel">
+ Currently unused.
</constant>
<constant name="EMISSION_OP_ADD" value="0" enum="EmissionOperator">
+ Adds the emission color to the color from the emission texture.
</constant>
<constant name="EMISSION_OP_MULTIPLY" value="1" enum="EmissionOperator">
+ Multiplies the emission color by the color from the emission texture.
</constant>
<constant name="DISTANCE_FADE_DISABLED" value="0" enum="DistanceFadeMode">
+ Do not use distance fade.
</constant>
<constant name="DISTANCE_FADE_PIXEL_ALPHA" value="1" enum="DistanceFadeMode">
+ Smoothly fades the object out based on each pixel's distance from the camera using the alpha channel.
</constant>
<constant name="DISTANCE_FADE_PIXEL_DITHER" value="2" enum="DistanceFadeMode">
+ Smoothly fades the object out based on each pixel's distance from the camera using a dither approach. Dithering discards pixels based on a set pattern to smoothly fade without enabling transparency. On certain hardware this can be faster than [constant DISTANCE_FADE_PIXEL_ALPHA].
</constant>
<constant name="DISTANCE_FADE_OBJECT_DITHER" value="3" enum="DistanceFadeMode">
+ Smoothly fades the object out based on the object's distance from the camera using a dither approach. Dithering discards pixels based on a set pattern to smoothly fade without enabling transparency. On certain hardware this can be faster than [constant DISTANCE_FADE_PIXEL_ALPHA].
</constant>
</constants>
</class>
diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp
index 6b1574bbbd..a315684ce9 100644
--- a/drivers/gles2/rasterizer_scene_gles2.cpp
+++ b/drivers/gles2/rasterizer_scene_gles2.cpp
@@ -557,15 +557,16 @@ bool RasterizerSceneGLES2::reflection_probe_instance_begin_render(RID p_instance
glGenTextures(1, &rpi->cubemap);
glBindTexture(GL_TEXTURE_CUBE_MAP, rpi->cubemap);
-#if 1
- //Mobile hardware (PowerVR specially) prefers this approach, the other one kills the game
+
+ // Mobile hardware (PowerVR specially) prefers this approach,
+ // the previous approach with manual lod levels kills the game.
for (int i = 0; i < 6; i++) {
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, internal_format, size, size, 0, format, type, NULL);
}
glGenerateMipmap(GL_TEXTURE_CUBE_MAP);
- //Generate framebuffers for rendering
+ // Generate framebuffers for rendering
for (int i = 0; i < 6; i++) {
glBindFramebuffer(GL_FRAMEBUFFER, rpi->fbo[i]);
glBindTexture(GL_TEXTURE_2D, rpi->color[i]);
@@ -576,34 +577,6 @@ bool RasterizerSceneGLES2::reflection_probe_instance_begin_render(RID p_instance
ERR_CONTINUE(status != GL_FRAMEBUFFER_COMPLETE);
}
-#else
- int lod = 0;
-
- //the approach below is fatal for powervr
-
- // Set the initial (empty) mipmaps, all need to be set for this to work in GLES2, even if they won't be used later.
- while (size >= 1) {
-
- for (int i = 0; i < 6; i++) {
- glTexImage2D(_cube_side_enum[i], lod, internal_format, size, size, 0, format, type, NULL);
- if (size == rpi->current_resolution) {
- //adjust framebuffer
- glBindFramebuffer(GL_FRAMEBUFFER, rpi->fbo[i]);
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, _cube_side_enum[i], rpi->cubemap, 0);
- glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rpi->depth);
-
-#ifdef DEBUG_ENABLED
- GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
- ERR_CONTINUE(status != GL_FRAMEBUFFER_COMPLETE);
-#endif
- }
- }
-
- lod++;
-
- size >>= 1;
- }
-#endif
glTexParameterf(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameterf(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp
index 7980c43517..c633d17cca 100644
--- a/drivers/gles2/rasterizer_storage_gles2.cpp
+++ b/drivers/gles2/rasterizer_storage_gles2.cpp
@@ -1206,32 +1206,21 @@ void RasterizerStorageGLES2::sky_set_texture(RID p_sky, RID p_panorama, int p_ra
GLenum type = GL_UNSIGNED_BYTE;
// Set the initial (empty) mipmaps
-#if 1
- //Mobile hardware (PowerVR specially) prefers this approach, the other one kills the game
+ // Mobile hardware (PowerVR specially) prefers this approach,
+ // the previous approach with manual lod levels kills the game.
for (int i = 0; i < 6; i++) {
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, internal_format, size, size, 0, format, type, NULL);
}
glGenerateMipmap(GL_TEXTURE_CUBE_MAP);
- //no filters for now
+
+ // No filters for now
glTexParameterf(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-#else
- while (size >= 1) {
-
- for (int i = 0; i < 6; i++) {
- glTexImage2D(_cube_side_enum[i], lod, internal_format, size, size, 0, format, type, NULL);
- }
-
- lod++;
-
- size >>= 1;
- }
-#endif
- //framebuffer
+ // Framebuffer
glBindFramebuffer(GL_FRAMEBUFFER, resources.mipmap_blur_fbo);
diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp
index ef2c318807..a24147146f 100644
--- a/drivers/gles3/rasterizer_gles3.cpp
+++ b/drivers/gles3/rasterizer_gles3.cpp
@@ -339,8 +339,6 @@ void RasterizerGLES3::blit_render_target_to_screen(RID p_render_target, const Re
RasterizerStorageGLES3::RenderTarget *rt = storage->render_target_owner.getornull(p_render_target);
ERR_FAIL_COND(!rt);
-#if 1
-
Size2 win_size = OS::get_singleton()->get_window_size();
if (rt->external.fbo != 0) {
glBindFramebuffer(GL_READ_FRAMEBUFFER, rt->external.fbo);
@@ -350,21 +348,6 @@ void RasterizerGLES3::blit_render_target_to_screen(RID p_render_target, const Re
glReadBuffer(GL_COLOR_ATTACHMENT0);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
glBlitFramebuffer(0, 0, rt->width, rt->height, p_screen_rect.position.x, win_size.height - p_screen_rect.position.y - p_screen_rect.size.height, p_screen_rect.position.x + p_screen_rect.size.width, win_size.height - p_screen_rect.position.y, GL_COLOR_BUFFER_BIT, GL_NEAREST);
-
-#else
- canvas->canvas_begin();
- glDisable(GL_BLEND);
- glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, rt->color);
- //glBindTexture(GL_TEXTURE_2D, rt->effects.mip_maps[0].color);
- glActiveTexture(GL_TEXTURE1);
- glBindTexture(GL_TEXTURE_2D, storage->resources.normal_tex);
-
- canvas->draw_generic_textured_rect(p_screen_rect, Rect2(0, 0, 1, -1));
- glBindTexture(GL_TEXTURE_2D, 0);
- canvas->canvas_end();
-#endif
}
void RasterizerGLES3::output_lens_distorted_to_screen(RID p_render_target, const Rect2 &p_screen_rect, float p_k1, float p_k2, const Vector2 &p_eye_center, float p_oversample) {
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index 0ed2637a11..c9ee2a18ef 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -1146,47 +1146,6 @@ bool RasterizerSceneGLES3::_setup_material(RasterizerStorageGLES3::Material *p_m
state.current_depth_draw = p_material->shader->spatial.depth_draw_mode;
}
-#if 0
- //blend mode
- if (state.current_blend_mode!=p_material->shader->spatial.blend_mode) {
-
- switch(p_material->shader->spatial.blend_mode) {
-
- case RasterizerStorageGLES3::Shader::Spatial::BLEND_MODE_MIX: {
- glBlendEquation(GL_FUNC_ADD);
- if (storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT]) {
- glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
- } else {
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- }
-
- } break;
- case RasterizerStorageGLES3::Shader::Spatial::BLEND_MODE_ADD: {
-
- glBlendEquation(GL_FUNC_ADD);
- glBlendFunc(p_alpha_pass?GL_SRC_ALPHA:GL_ONE,GL_ONE);
-
- } break;
- case RasterizerStorageGLES3::Shader::Spatial::BLEND_MODE_SUB: {
-
- glBlendEquation(GL_FUNC_REVERSE_SUBTRACT);
- glBlendFunc(GL_SRC_ALPHA,GL_ONE);
- } break;
- case RasterizerStorageGLES3::Shader::Spatial::BLEND_MODE_MUL: {
- glBlendEquation(GL_FUNC_ADD);
- if (storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT]) {
- glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
- } else {
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- }
-
- } break;
- }
-
- state.current_blend_mode=p_material->shader->spatial.blend_mode;
-
- }
-#endif
//material parameters
state.scene_shader.set_custom_shader(p_material->shader->custom_code_id);
@@ -3007,16 +2966,6 @@ void RasterizerSceneGLES3::_setup_lights(RID *p_light_cull_result, int p_light_c
li->light_index = state.spot_light_count;
copymem(&state.spot_array_tmp[li->light_index * state.ubo_light_size], &ubo_data, state.ubo_light_size);
state.spot_light_count++;
-
-#if 0
- if (li->light_ptr->shadow_enabled) {
- CameraMatrix bias;
- bias.set_light_bias();
- Transform modelview=Transform(camera_transform_inverse * li->transform).inverse();
- li->shadow_projection[0] = bias * li->projection * modelview;
- lights_use_shadow=true;
- }
-#endif
} break;
}
diff --git a/drivers/gles3/shader_compiler_gles3.cpp b/drivers/gles3/shader_compiler_gles3.cpp
index 121a7f60f4..f43943bdff 100644
--- a/drivers/gles3/shader_compiler_gles3.cpp
+++ b/drivers/gles3/shader_compiler_gles3.cpp
@@ -400,7 +400,7 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener
for (int i = 0; i < max_uniforms; i++) {
r_gen_code.uniforms += uniform_defines[i];
}
-#if 1
+
// add up
int offset = 0;
for (int i = 0; i < uniform_sizes.size(); i++) {
@@ -420,45 +420,6 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener
if (r_gen_code.uniform_total_size % 16 != 0) { //UBO sizes must be multiples of 16
r_gen_code.uniform_total_size += r_gen_code.uniform_total_size % 16;
}
-#else
- // add up
- for (int i = 0; i < uniform_sizes.size(); i++) {
-
- if (i > 0) {
-
- int align = uniform_sizes[i - 1] % uniform_alignments[i];
- if (align != 0) {
- uniform_sizes[i - 1] += uniform_alignments[i] - align;
- }
-
- uniform_sizes[i] = uniform_sizes[i] + uniform_sizes[i - 1];
- }
- }
- //offset
- r_gen_code.uniform_offsets.resize(uniform_sizes.size());
- for (int i = 0; i < uniform_sizes.size(); i++) {
-
- if (i > 0)
- r_gen_code.uniform_offsets[i] = uniform_sizes[i - 1];
- else
- r_gen_code.uniform_offsets[i] = 0;
- }
- /*
- for(Map<StringName,SL::ShaderNode::Uniform>::Element *E=pnode->uniforms.front();E;E=E->next()) {
-
- if (SL::is_sampler_type(E->get().type)) {
- continue;
- }
-
- }
-
-*/
- if (uniform_sizes.size()) {
- r_gen_code.uniform_total_size = uniform_sizes[uniform_sizes.size() - 1];
- } else {
- r_gen_code.uniform_total_size = 0;
- }
-#endif
for (Map<StringName, SL::ShaderNode::Varying>::Element *E = pnode->varyings.front(); E; E = E->next()) {
diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl
index a330dbef77..a45ac2eb8a 100644
--- a/drivers/gles3/shaders/scene.glsl
+++ b/drivers/gles3/shaders/scene.glsl
@@ -1224,35 +1224,6 @@ in highp float dp_clip;
#endif
-#if 0
-// need to save texture depth for this
-vec3 light_transmittance(float translucency,vec3 light_vec, vec3 normal, vec3 pos, float distance) {
-
- float scale = 8.25 * (1.0 - translucency) / subsurface_scatter_width;
- float d = scale * distance;
-
- /**
- * Armed with the thickness, we can now calculate the color by means of the
- * precalculated transmittance profile.
- * (It can be precomputed into a texture, for maximum performance):
- */
- float dd = -d * d;
- vec3 profile =
- vec3(0.233, 0.455, 0.649) * exp(dd / 0.0064) +
- vec3(0.1, 0.336, 0.344) * exp(dd / 0.0484) +
- vec3(0.118, 0.198, 0.0) * exp(dd / 0.187) +
- vec3(0.113, 0.007, 0.007) * exp(dd / 0.567) +
- vec3(0.358, 0.004, 0.0) * exp(dd / 1.99) +
- vec3(0.078, 0.0, 0.0) * exp(dd / 7.41);
-
- /**
- * Using the profile, we finally approximate the transmitted lighting from
- * the back of the object:
- */
- return profile * clamp(0.3 + dot(light_vec, normal),0.0,1.0);
-}
-#endif
-
void light_process_omni(int idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 binormal, vec3 tangent, vec3 albedo, vec3 transmission, float roughness, float metallic, float specular, float rim, float rim_tint, float clearcoat, float clearcoat_gloss, float anisotropy, float p_blob_intensity, inout vec3 diffuse_light, inout vec3 specular_light, inout float alpha) {
vec3 light_rel_vec = omni_lights[idx].light_pos_inv_radius.xyz - vertex;
diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp
index 2514663b4c..af2760e82b 100644
--- a/editor/animation_bezier_editor.cpp
+++ b/editor/animation_bezier_editor.cpp
@@ -491,26 +491,6 @@ void AnimationBezierTrackEdit::_notification(int p_what) {
}
draw_rect(Rect2(bs_from, bs_to - bs_from), bs);
}
-
-#if 0
- // KEYFAMES //
-
- {
-
- float scale = timeline->get_zoom_scale();
- int limit_end = get_size().width - timeline->get_buttons_width();
-
- for (int i = 0; i < animation->track_get_key_count(track); i++) {
-
- float offset = animation->track_get_key_time(track, i) - timeline->get_value();
- if (editor->is_key_selected(track, i) && editor->is_moving_selection()) {
- offset += editor->get_moving_selection_offset();
- }
- offset = offset * scale + limit;
- draw_key(i, scale, int(offset), editor->is_key_selected(track, i), limit, limit_end);
- }
- }
-#endif
}
}
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index f6d5312fc7..22a5298d5c 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -4838,25 +4838,6 @@ struct _AnimMoveRestore {
void AnimationTrackEditor::_clear_key_edit() {
if (key_edit) {
-
-#if 0
- // going back seems like the most comfortable thing to do, but it results
- // in weird behaviors and crashes, because going back to animation editor
- // triggers the editor setting up again itself
-
- bool go_back = false;
- if (EditorNode::get_singleton()->get_inspector()->get_edited_object() == key_edit) {
- EditorNode::get_singleton()->push_item(NULL);
- go_back = true;
- }
-
- memdelete(key_edit);
- key_edit = NULL;
-
- if (go_back) {
- EditorNode::get_singleton()->get_inspector_dock()->go_back();
- }
-#else
//if key edit is the object being inspected, remove it first
if (EditorNode::get_singleton()->get_inspector()->get_edited_object() == key_edit ||
EditorNode::get_singleton()->get_inspector()->get_edited_object() == multi_key_edit) {
@@ -4871,7 +4852,6 @@ void AnimationTrackEditor::_clear_key_edit() {
memdelete(multi_key_edit);
multi_key_edit = NULL;
}
-#endif
}
}
diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp
index cab317990e..0774d0b5dc 100644
--- a/editor/import/resource_importer_scene.cpp
+++ b/editor/import/resource_importer_scene.cpp
@@ -32,18 +32,15 @@
#include "core/io/resource_saver.h"
#include "editor/editor_node.h"
-#include "scene/resources/packed_scene.h"
-
#include "scene/3d/collision_shape.h"
#include "scene/3d/mesh_instance.h"
#include "scene/3d/navigation.h"
#include "scene/3d/physics_body.h"
-#include "scene/3d/portal.h"
-#include "scene/3d/room_instance.h"
#include "scene/3d/vehicle_body.h"
#include "scene/animation/animation_player.h"
#include "scene/resources/animation.h"
#include "scene/resources/box_shape.h"
+#include "scene/resources/packed_scene.h"
#include "scene/resources/plane_shape.h"
#include "scene/resources/ray_shape.h"
#include "scene/resources/resource_format_text.h"
diff --git a/editor/plugins/sprite_editor_plugin.cpp b/editor/plugins/sprite_editor_plugin.cpp
index f5ea88eeae..6757b180a3 100644
--- a/editor/plugins/sprite_editor_plugin.cpp
+++ b/editor/plugins/sprite_editor_plugin.cpp
@@ -474,69 +474,6 @@ void SpriteEditor::_add_as_sibling_or_child(Node *p_own_node, Node *p_new_node)
p_new_node->set_owner(this->get_tree()->get_edited_scene_root());
}
-#if 0
-void SpriteEditor::_create_uv_lines() {
-
- Ref<Mesh> sprite = node->get_sprite();
- ERR_FAIL_COND(!sprite.is_valid());
-
- Set<SpriteEditorEdgeSort> edges;
- uv_lines.clear();
- for (int i = 0; i < sprite->get_surface_count(); i++) {
- if (sprite->surface_get_primitive_type(i) != Mesh::PRIMITIVE_TRIANGLES)
- continue;
- Array a = sprite->surface_get_arrays(i);
-
- PoolVector<Vector2> uv = a[p_layer == 0 ? Mesh::ARRAY_TEX_UV : Mesh::ARRAY_TEX_UV2];
- if (uv.size() == 0) {
- err_dialog->set_text(TTR("Model has no UV in this layer"));
- err_dialog->popup_centered_minsize();
- return;
- }
-
- PoolVector<Vector2>::Read r = uv.read();
-
- PoolVector<int> indices = a[Mesh::ARRAY_INDEX];
- PoolVector<int>::Read ri;
-
- int ic;
- bool use_indices;
-
- if (indices.size()) {
- ic = indices.size();
- ri = indices.read();
- use_indices = true;
- } else {
- ic = uv.size();
- use_indices = false;
- }
-
- for (int j = 0; j < ic; j += 3) {
-
- for (int k = 0; k < 3; k++) {
-
- SpriteEditorEdgeSort edge;
- if (use_indices) {
- edge.a = r[ri[j + k]];
- edge.b = r[ri[j + ((k + 1) % 3)]];
- } else {
- edge.a = r[j + k];
- edge.b = r[j + ((k + 1) % 3)];
- }
-
- if (edges.has(edge))
- continue;
-
- uv_lines.push_back(edge.a);
- uv_lines.push_back(edge.b);
- edges.insert(edge);
- }
- }
- }
-
- debug_uv_dialog->popup_centered_minsize();
-}
-#endif
void SpriteEditor::_debug_uv_draw() {
Ref<Texture> tex = node->get_texture();
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index 9bbb9bd38c..30e31cb530 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -1313,7 +1313,9 @@ void ProjectList::create_project_item_control(int p_index) {
hb->set_is_favorite(item.favorite);
TextureRect *tf = memnew(TextureRect);
- tf->set_texture(get_icon("DefaultProjectIcon", "EditorIcons"));
+ // The project icon may not be loaded by the time the control is displayed,
+ // so use a loading placeholder.
+ tf->set_texture(get_icon("ProjectIconLoading", "EditorIcons"));
if (item.missing) {
tf->set_modulate(Color(1, 1, 1, 0.5));
}
diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp
index 418ff1d2a3..c94b0eeab0 100644
--- a/editor/spatial_editor_gizmos.cpp
+++ b/editor/spatial_editor_gizmos.cpp
@@ -44,11 +44,9 @@
#include "scene/3d/navigation_mesh.h"
#include "scene/3d/particles.h"
#include "scene/3d/physics_joint.h"
-#include "scene/3d/portal.h"
#include "scene/3d/position_3d.h"
#include "scene/3d/ray_cast.h"
#include "scene/3d/reflection_probe.h"
-#include "scene/3d/room_instance.h"
#include "scene/3d/soft_body.h"
#include "scene/3d/spring_arm.h"
#include "scene/3d/sprite_3d.h"
@@ -1951,112 +1949,6 @@ void PhysicalBoneSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
p_gizmo->add_lines(points, material);
}
-// FIXME: Kept as reference for reimplementation in 3.1+
-#if 0
-
-void RoomSpatialGizmo::redraw() {
-
- clear();
- Ref<RoomBounds> roomie = room->get_room();
- if (roomie.is_null())
- return;
- PoolVector<Face3> faces = roomie->get_geometry_hint();
-
- Vector<Vector3> lines;
- int fc = faces.size();
- PoolVector<Face3>::Read r = faces.read();
-
- Map<_EdgeKey, Vector3> edge_map;
-
- for (int i = 0; i < fc; i++) {
-
- Vector3 fn = r[i].get_plane().normal;
-
- for (int j = 0; j < 3; j++) {
-
- _EdgeKey ek;
- ek.from = r[i].vertex[j].snapped(Vector3(CMP_EPSILON, CMP_EPSILON, CMP_EPSILON));
- ek.to = r[i].vertex[(j + 1) % 3].snapped(Vector3(CMP_EPSILON, CMP_EPSILON, CMP_EPSILON));
- if (ek.from < ek.to)
- SWAP(ek.from, ek.to);
-
- Map<_EdgeKey, Vector3>::Element *E = edge_map.find(ek);
-
- if (E) {
-
- if (E->get().dot(fn) > 0.9) {
-
- E->get() = Vector3();
- }
-
- } else {
-
- edge_map[ek] = fn;
- }
- }
- }
-
- for (Map<_EdgeKey, Vector3>::Element *E = edge_map.front(); E; E = E->next()) {
-
- if (E->get() != Vector3()) {
- lines.push_back(E->key().from);
- lines.push_back(E->key().to);
- }
- }
-
- add_lines(lines, EditorSpatialGizmos::singleton->room_material);
- add_collision_segments(lines);
-}
-
-RoomSpatialGizmo::RoomSpatialGizmo(Room *p_room) {
-
- set_spatial_node(p_room);
- room = p_room;
-}
-
-/////
-
-void PortalSpatialGizmo::redraw() {
-
- clear();
-
- Vector<Point2> points = portal->get_shape();
- if (points.size() == 0) {
- return;
- }
-
- Vector<Vector3> lines;
-
- Vector3 center;
- for (int i = 0; i < points.size(); i++) {
-
- Vector3 f;
- f.x = points[i].x;
- f.y = points[i].y;
- Vector3 fn;
- fn.x = points[(i + 1) % points.size()].x;
- fn.y = points[(i + 1) % points.size()].y;
- center += f;
-
- lines.push_back(f);
- lines.push_back(fn);
- }
-
- center /= points.size();
- lines.push_back(center);
- lines.push_back(center + Vector3(0, 0, 1));
-
- add_lines(lines, EditorSpatialGizmos::singleton->portal_material);
- add_collision_segments(lines);
-}
-
-PortalSpatialGizmo::PortalSpatialGizmo(Portal *p_portal) {
-
- set_spatial_node(p_portal);
- portal = p_portal;
-}
-
-#endif
/////
RayCastSpatialGizmoPlugin::RayCastSpatialGizmoPlugin() {
diff --git a/editor/spatial_editor_gizmos.h b/editor/spatial_editor_gizmos.h
index 1d6801a136..81b62981ac 100644
--- a/editor/spatial_editor_gizmos.h
+++ b/editor/spatial_editor_gizmos.h
@@ -160,19 +160,6 @@ public:
PhysicalBoneSpatialGizmoPlugin();
};
-#if 0
-class PortalSpatialGizmo : public EditorSpatialGizmo {
-
- GDCLASS(PortalSpatialGizmo, EditorSpatialGizmo);
-
- Portal *portal;
-
-public:
- void redraw();
- PortalSpatialGizmo(Portal *p_portal = NULL);
-};
-#endif
-
class RayCastSpatialGizmoPlugin : public EditorSpatialGizmoPlugin {
GDCLASS(RayCastSpatialGizmoPlugin, EditorSpatialGizmoPlugin);
diff --git a/modules/gdnative/pluginscript/pluginscript_instance.cpp b/modules/gdnative/pluginscript/pluginscript_instance.cpp
index 97897870ba..c64a00a4d9 100644
--- a/modules/gdnative/pluginscript/pluginscript_instance.cpp
+++ b/modules/gdnative/pluginscript/pluginscript_instance.cpp
@@ -28,11 +28,13 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+#include "pluginscript_instance.h"
+
// Godot imports
#include "core/os/os.h"
#include "core/variant.h"
+
// PluginScript imports
-#include "pluginscript_instance.h"
#include "pluginscript_language.h"
#include "pluginscript_script.h"
@@ -89,51 +91,6 @@ Variant PluginScriptInstance::call(const StringName &p_method, const Variant **p
return var_ret;
}
-#if 0 // TODO: Don't rely on default implementations provided by ScriptInstance ?
-void PluginScriptInstance::call_multilevel(const StringName& p_method,const Variant** p_args,int p_argcount) {
-
-#if 0
- PluginScript *sptr=script.ptr();
- Variant::CallError ce;
-
- while(sptr) {
- Map<StringName,GDFunction*>::Element *E = sptr->member_functions.find(p_method);
- if (E) {
- E->get()->call(this,p_args,p_argcount,ce);
- }
- sptr = sptr->_base;
- }
-#endif
-
-}
-
-#if 0
-void PluginScriptInstance::_ml_call_reversed(PluginScript *sptr,const StringName& p_method,const Variant** p_args,int p_argcount) {
-
- if (sptr->_base)
- _ml_call_reversed(sptr->_base,p_method,p_args,p_argcount);
-
- Variant::CallError ce;
-
- Map<StringName,GDFunction*>::Element *E = sptr->member_functions.find(p_method);
- if (E) {
- E->get()->call(this,p_args,p_argcount,ce);
- }
-
-}
-#endif
-
-
-void PluginScriptInstance::call_multilevel_reversed(const StringName& p_method,const Variant** p_args,int p_argcount) {
-
-#if 0
- if (script.ptr()) {
- _ml_call_reversed(script.ptr(),p_method,p_args,p_argcount);
- }
-#endif
-}
-#endif // Multilevel stuff
-
void PluginScriptInstance::notification(int p_notification) {
_desc->notification(_data, p_notification);
}
diff --git a/modules/gdnative/pluginscript/pluginscript_instance.h b/modules/gdnative/pluginscript/pluginscript_instance.h
index d92d3ace77..dc1229a44d 100644
--- a/modules/gdnative/pluginscript/pluginscript_instance.h
+++ b/modules/gdnative/pluginscript/pluginscript_instance.h
@@ -33,6 +33,7 @@
// Godot imports
#include "core/script_language.h"
+
// PluginScript imports
#include <pluginscript/godot_pluginscript.h>
@@ -60,13 +61,12 @@ public:
virtual bool has_method(const StringName &p_method) const;
virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error);
-#if 0
- // Rely on default implementations provided by ScriptInstance for the moment.
- // Note that multilevel call could be removed in 3.0 release, so stay tuned
- // (see https://godotengine.org/qa/9244/can-override-the-_ready-and-_process-functions-child-classes)
- virtual void call_multilevel(const StringName& p_method,const Variant** p_args,int p_argcount);
- virtual void call_multilevel_reversed(const StringName& p_method,const Variant** p_args,int p_argcount);
-#endif
+
+ // Rely on default implementations provided by ScriptInstance for the moment.
+ // Note that multilevel call could be removed in 3.0 release, so stay tuned
+ // (see https://godotengine.org/qa/9244/can-override-the-_ready-and-_process-functions-child-classes)
+ //virtual void call_multilevel(const StringName& p_method,const Variant** p_args,int p_argcount);
+ //virtual void call_multilevel_reversed(const StringName& p_method,const Variant** p_args,int p_argcount);
virtual void notification(int p_notification);
diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp
index 524be480d7..452b1933eb 100644
--- a/modules/gdscript/gdscript_function.cpp
+++ b/modules/gdscript/gdscript_function.cpp
@@ -1550,10 +1550,8 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
OPCODE_BREAK;
}
-// Enable for debugging
-#if 0
+#if 0 // Enable for debugging.
default: {
-
err_text = "Illegal opcode " + itos(_code_ptr[ip]) + " at address " + itos(ip);
OPCODE_BREAK;
}
diff --git a/modules/mono/editor/GodotTools/GodotTools/CsProjOperations.cs b/modules/mono/editor/GodotTools/GodotTools/CsProjOperations.cs
index 174509dc5b..9abfda4538 100644
--- a/modules/mono/editor/GodotTools/GodotTools/CsProjOperations.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/CsProjOperations.cs
@@ -81,7 +81,12 @@ namespace GodotTools
}
}
- ScriptClassParser.ParseFileOrThrow(projectIncludeFile, out var classes);
+ Error parseError = ScriptClassParser.ParseFile(projectIncludeFile, out var classes, out string errorStr);
+ if (parseError != Error.Ok)
+ {
+ GD.PushError($"Failed to determine namespace and class for script: {projectIncludeFile}. Parse error: {errorStr ?? parseError.ToString()}");
+ continue;
+ }
string searchName = System.IO.Path.GetFileNameWithoutExtension(projectIncludeFile);
diff --git a/modules/mono/editor/GodotTools/GodotTools/Internals/ScriptClassParser.cs b/modules/mono/editor/GodotTools/GodotTools/Internals/ScriptClassParser.cs
index 11afa8773e..7fb087467f 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Internals/ScriptClassParser.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Internals/ScriptClassParser.cs
@@ -27,12 +27,15 @@ namespace GodotTools.Internals
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern Error internal_ParseFile(string filePath, Array<Dictionary> classes, out string errorStr);
- public static void ParseFileOrThrow(string filePath, out IEnumerable<ClassDecl> classes)
+ public static Error ParseFile(string filePath, out IEnumerable<ClassDecl> classes, out string errorStr)
{
var classesArray = new Array<Dictionary>();
- var error = internal_ParseFile(filePath, classesArray, out string errorStr);
+ var error = internal_ParseFile(filePath, classesArray, out errorStr);
if (error != Error.Ok)
- throw new Exception($"Failed to determine namespace and class for script: {filePath}. Parse error: {errorStr ?? error.ToString()}");
+ {
+ classes = null;
+ return error;
+ }
var classesList = new List<ClassDecl>();
@@ -47,6 +50,8 @@ namespace GodotTools.Internals
}
classes = classesList;
+
+ return Error.Ok;
}
}
}
diff --git a/modules/mono/editor/script_class_parser.cpp b/modules/mono/editor/script_class_parser.cpp
index 84163dd952..8ac4df9952 100644
--- a/modules/mono/editor/script_class_parser.cpp
+++ b/modules/mono/editor/script_class_parser.cpp
@@ -631,6 +631,85 @@ Error ScriptClassParser::parse(const String &p_code) {
return OK;
}
+static String get_preprocessor_directive(const String &p_line, int p_from) {
+ CRASH_COND(p_line[p_from] != '#');
+ p_from++;
+ int i = p_from;
+ while (i < p_line.length() && p_line[i] != ' ' && p_line[i] != '\t') {
+ i++;
+ }
+ return p_line.substr(p_from, i - p_from);
+}
+
+static void run_dummy_preprocessor(String &r_source) {
+
+ Vector<String> lines = r_source.split("\n", /* p_allow_empty: */ true);
+
+ bool *include_lines = memnew_arr(bool, lines.size());
+
+ int if_level = -1;
+ Vector<bool> is_branch_being_compiled;
+
+ for (int i = 0; i < lines.size(); i++) {
+ const String &line = lines[i];
+
+ const int line_len = line.length();
+
+ int j = 0;
+ while (j < line_len) {
+ if (line[j] != ' ' && line[j] != '\t') {
+ if (line[j] == '#') {
+ // First non-whitespace char of the line is '#'
+ include_lines[i] = false;
+
+ String directive = get_preprocessor_directive(line, j);
+
+ if (directive == "if") {
+ if_level++;
+ is_branch_being_compiled.push_back(if_level == 0 || is_branch_being_compiled[if_level - 1]);
+ } else if (directive == "elif") {
+ ERR_CONTINUE_MSG(if_level == -1, "Found unexpected '#elif' directive.");
+ is_branch_being_compiled.write[if_level] = false;
+ } else if (directive == "else") {
+ ERR_CONTINUE_MSG(if_level == -1, "Found unexpected '#else' directive.");
+ is_branch_being_compiled.write[if_level] = false;
+ } else if (directive == "endif") {
+ ERR_CONTINUE_MSG(if_level == -1, "Found unexpected '#endif' directive.");
+ is_branch_being_compiled.remove(if_level);
+ if_level--;
+ }
+
+ break;
+ } else {
+ // First non-whitespace char of the line is not '#'
+ include_lines[i] = if_level == -1 || is_branch_being_compiled[if_level];
+ break;
+ }
+ }
+
+ j++;
+ }
+
+ if (j == line_len) {
+ // Loop ended without finding a non-whitespace character.
+ // Either the line was empty or it only contained whitespaces.
+ include_lines[i] = if_level == -1 || is_branch_being_compiled[if_level];
+ }
+ }
+
+ r_source.clear();
+
+ // Custom join ignoring lines removed by the preprocessor
+ for (int i = 0; i < lines.size(); i++) {
+ if (i > 0 && include_lines[i - 1])
+ r_source += '\n';
+
+ if (include_lines[i]) {
+ r_source += lines[i];
+ }
+ }
+}
+
Error ScriptClassParser::parse_file(const String &p_filepath) {
String source;
@@ -643,6 +722,8 @@ Error ScriptClassParser::parse_file(const String &p_filepath) {
" Please ensure that scripts are saved in valid UTF-8 unicode." :
"Failed to read file: '" + p_filepath + "'.");
+ run_dummy_preprocessor(source);
+
return parse(source);
}
diff --git a/modules/websocket/websocket_multiplayer_peer.cpp b/modules/websocket/websocket_multiplayer_peer.cpp
index b639c635fd..27ea50b524 100644
--- a/modules/websocket/websocket_multiplayer_peer.cpp
+++ b/modules/websocket/websocket_multiplayer_peer.cpp
@@ -98,7 +98,7 @@ void WebSocketMultiplayerPeer::_bind_methods() {
//
int WebSocketMultiplayerPeer::get_available_packet_count() const {
- ERR_FAIL_COND_V_MSG(!_is_multiplayer, ERR_UNCONFIGURED, "Please use get_peer(ID).get_available_packet_count to get available packet count from peers when not using the MultiplayerAPI.");
+ ERR_FAIL_COND_V_MSG(!_is_multiplayer, 0, "Please use get_peer(ID).get_available_packet_count to get available packet count from peers when not using the MultiplayerAPI.");
return _incoming_packets.size();
}
diff --git a/scene/2d/polygon_2d.cpp b/scene/2d/polygon_2d.cpp
index c480423eca..a6da027e0a 100644
--- a/scene/2d/polygon_2d.cpp
+++ b/scene/2d/polygon_2d.cpp
@@ -346,195 +346,6 @@ void Polygon2D::_notification(int p_what) {
if (total_indices.size()) {
VS::get_singleton()->canvas_item_add_triangle_array(get_canvas_item(), total_indices, points, colors, uvs, bones, weights, texture.is_valid() ? texture->get_rid() : RID(), -1, RID(), antialiased);
}
-
-#if 0
- //use splits
- Vector<int> loop;
- int sc = splits.size();
- PoolVector<int>::Read r = splits.read();
-
-
- print_line("has splits, amount " + itos(splits.size()));
- Vector<Vector<int> > loops;
-
- // find a point that can be used to begin, must not be in a split, and have to the left and right the same one
- // like this one -> x---o
- // \ / \ .
- // o---o
- int base_point = -1;
- {
- int current_point = -1;
- int base_point_prev_split = -1;
-
-
- for (int i = 0; i < points.size(); i++) {
-
- //find if this point is in a split
- int split_index = -1;
- bool has_prev_split = false;
- int min_dist_to_end = 0x7FFFFFFF;
-
- for (int j = 0; j < sc; j += 2) {
-
- int split_pos = -1;
- int split_end = -1;
-
- if (r[j + 0] == i) { //found split in first point
- split_pos = r[j + 0];
- split_end = r[j + 1];
- } else if (r[j + 1] == i) { //found split in second point
- split_pos = r[j + 1];
- split_end = r[j + 0];
- }
-
- if (split_pos == split_end) {
- continue; //either nothing found or begin == end, this not a split in either case
- }
-
- if (j == base_point_prev_split) {
- has_prev_split = true;
- }
-
- //compute distance from split pos to split end in current traversal direction
- int dist_to_end = split_end > split_pos ? split_end - split_pos : (last - split_pos + split_end);
-
- if (dist_to_end < min_dist_to_end) {
- //always keep the valid split with the least distance to the loop
- min_dist_to_end = dist_to_end;
- split_index = j;
- }
- }
-
- if (split_index == -1) {
- current_point = i; //no split here, we are testing this point
- } else if (has_prev_split) {
- base_point = current_point; // there is a split and it contains the previous visited split, success
- break;
- } else {
- //invalidate current point and keep split
- current_point = -1;
- base_point_prev_split = split_index;
- }
- }
- }
-
- print_line("found base point: " + itos(base_point));
-
- if (base_point != -1) {
-
- int point = base_point;
- int last = base_point;
- //go through all the points, find splits
- do {
-
- int split;
- int last_dist_to_end = -1; //maximum valid distance to end
-
- do {
-
- loop.push_back(point); //push current point
-
- split = -1;
- int end = -1;
-
- int max_dist_to_end = 0;
-
- //find if this point is in a split
- for (int j = 0; j < sc; j += 2) {
-
- int split_pos = -1;
- int split_end = -1;
-
- if (r[j + 0] == point) { //match first split index
- split_pos = r[j + 0];
- split_end = r[j + 1];
- } else if (r[j + 1] == point) { //match second split index
- split_pos = r[j + 1];
- split_end = r[j + 0];
- }
-
- if (split_pos == split_end) {
- continue; //either nothing found or begin == end, this not a split in either case
- }
-
- //compute distance from split pos to split end
- int dist_to_end = split_end > split_pos ? split_end - split_pos : (points.size() - split_pos + split_end);
-
- if (last_dist_to_end != -1 && dist_to_end >= last_dist_to_end) {
- //distance must be shorter than in last iteration, means we've tested this before so ignore
- continue;
- } else if (dist_to_end > max_dist_to_end) {
- //always keep the valid point with the most distance (as long as it's valid)
- max_dist_to_end = dist_to_end;
- split = split_pos;
- end = split_end;
- }
- }
-
- if (split != -1) {
- //found a split!
- int from = end;
-
- //add points until last is reached
- while (true) {
- //find if point is in a split
- loop.push_back(from);
-
- if (from == last) {
- break;
- }
-
- from++;
- if (from >= points.size()) { //wrap if reached end
- from = 0;
- }
-
- if (from == loop[0]) {
- break; //end because we reached split source
- }
- }
-
- loops.push_back(loop); //done with this loop
- loop.clear();
-
- last_dist_to_end = max_dist_to_end;
- last = end; //algorithm can safely finish in this split point
- }
-
- } while (split != -1);
-
- } while (point != last);
- }
-
- if (loop.size() >=2 ) { //points remained
- //points remain
- loop.push_back(last); //no splits found, use last
- loops.push_back(loop);
- }
-
- print_line("total loops: " + itos(loops.size()));
-
- if (loops.size()) { //loops found
- Vector<int> indices;
-
- for (int i = 0; i < loops.size(); i++) {
- Vector<int> loop = loops[i];
- Vector<Vector2> vertices;
- vertices.resize(loop.size());
- for (int j = 0; j < vertices.size(); j++) {
- vertices.write[j] = points[loop[j]];
- }
- Vector<int> sub_indices = Geometry::triangulate_polygon(vertices);
- int from = indices.size();
- indices.resize(from + sub_indices.size());
- for (int j = 0; j < sub_indices.size(); j++) {
- indices.write[from + j] = loop[sub_indices[j]];
- }
- }
-
- VS::get_singleton()->canvas_item_add_triangle_array(get_canvas_item(), indices, points, colors, uvs, bones, weights, texture.is_valid() ? texture->get_rid() : RID());
- }
-#endif
}
} break;
diff --git a/scene/3d/portal.cpp b/scene/3d/portal.cpp
deleted file mode 100644
index e60ca619dd..0000000000
--- a/scene/3d/portal.cpp
+++ /dev/null
@@ -1,232 +0,0 @@
-/*************************************************************************/
-/* portal.cpp */
-/*************************************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/* https://godotengine.org */
-/*************************************************************************/
-/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
-/* */
-/* Permission is hereby granted, free of charge, to any person obtaining */
-/* a copy of this software and associated documentation files (the */
-/* "Software"), to deal in the Software without restriction, including */
-/* without limitation the rights to use, copy, modify, merge, publish, */
-/* distribute, sublicense, and/or sell copies of the Software, and to */
-/* permit persons to whom the Software is furnished to do so, subject to */
-/* the following conditions: */
-/* */
-/* The above copyright notice and this permission notice shall be */
-/* included in all copies or substantial portions of the Software. */
-/* */
-/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
-/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
-/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
-/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
-/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
-/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
-/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-/*************************************************************************/
-
-#include "portal.h"
-#include "core/project_settings.h"
-#include "scene/resources/surface_tool.h"
-#include "servers/visual_server.h"
-
-// FIXME: This will be removed, kept as reference for new implementation
-#if 0
-bool Portal::_set(const StringName &p_name, const Variant &p_value) {
-
- if (p_name == "shape") {
- PoolVector<float> src_coords = p_value;
- Vector<Point2> points;
- int src_coords_size = src_coords.size();
- ERR_FAIL_COND_V(src_coords_size % 2, false);
- points.resize(src_coords_size / 2);
- for (int i = 0; i < points.size(); i++) {
-
- points[i].x = src_coords[i * 2 + 0];
- points[i].y = src_coords[i * 2 + 1];
- set_shape(points);
- }
- } else if (p_name == "enabled") {
- set_enabled(p_value);
- } else if (p_name == "disable_distance") {
- set_disable_distance(p_value);
- } else if (p_name == "disabled_color") {
- set_disabled_color(p_value);
- } else if (p_name == "connect_range") {
- set_connect_range(p_value);
- } else
- return false;
-
- return true;
-}
-
-bool Portal::_get(const StringName &p_name, Variant &r_ret) const {
-
- if (p_name == "shape") {
- Vector<Point2> points = get_shape();
- PoolVector<float> dst_coords;
- dst_coords.resize(points.size() * 2);
-
- for (int i = 0; i < points.size(); i++) {
-
- dst_coords.set(i * 2 + 0, points[i].x);
- dst_coords.set(i * 2 + 1, points[i].y);
- }
-
- r_ret = dst_coords;
- } else if (p_name == "enabled") {
- r_ret = is_enabled();
- } else if (p_name == "disable_distance") {
- r_ret = get_disable_distance();
- } else if (p_name == "disabled_color") {
- r_ret = get_disabled_color();
- } else if (p_name == "connect_range") {
- r_ret = get_connect_range();
- } else
- return false;
- return true;
-}
-
-void Portal::_get_property_list(List<PropertyInfo> *p_list) const {
-
- p_list->push_back(PropertyInfo(Variant::POOL_REAL_ARRAY, "shape"));
- p_list->push_back(PropertyInfo(Variant::BOOL, "enabled"));
- p_list->push_back(PropertyInfo(Variant::REAL, "disable_distance", PROPERTY_HINT_RANGE, "0,4096,0.01"));
- p_list->push_back(PropertyInfo(Variant::COLOR, "disabled_color"));
- p_list->push_back(PropertyInfo(Variant::REAL, "connect_range", PROPERTY_HINT_RANGE, "0.1,4096,0.01"));
-}
-
-AABB Portal::get_aabb() const {
-
- return aabb;
-}
-PoolVector<Face3> Portal::get_faces(uint32_t p_usage_flags) const {
-
- if (!(p_usage_flags & FACES_ENCLOSING))
- return PoolVector<Face3>();
-
- Vector<Point2> shape = get_shape();
- if (shape.size() == 0)
- return PoolVector<Face3>();
-
- Vector2 center;
- for (int i = 0; i < shape.size(); i++) {
-
- center += shape[i];
- }
-
- PoolVector<Face3> ret;
- center /= shape.size();
-
- for (int i = 0; i < shape.size(); i++) {
-
- int n = (i + 1) % shape.size();
-
- Face3 f;
- f.vertex[0] = Vector3(center.x, center.y, 0);
- f.vertex[1] = Vector3(shape[i].x, shape[i].y, 0);
- f.vertex[2] = Vector3(shape[n].x, shape[n].y, 0);
- ret.push_back(f);
- }
-
- return ret;
-}
-
-void Portal::set_shape(const Vector<Point2> &p_shape) {
-
- VisualServer::get_singleton()->portal_set_shape(portal, p_shape);
- shape = p_shape;
- update_gizmo();
-}
-
-Vector<Point2> Portal::get_shape() const {
-
- return shape;
-}
-
-void Portal::set_connect_range(float p_range) {
-
- connect_range = p_range;
- //VisualServer::get_singleton()->portal_set_connect_range(portal,p_range);
-}
-
-float Portal::get_connect_range() const {
-
- return connect_range;
-}
-
-void Portal::set_enabled(bool p_enabled) {
-
- enabled = p_enabled;
- VisualServer::get_singleton()->portal_set_enabled(portal, enabled);
-}
-
-bool Portal::is_enabled() const {
-
- return enabled;
-}
-
-void Portal::set_disable_distance(float p_distance) {
-
- disable_distance = p_distance;
- VisualServer::get_singleton()->portal_set_disable_distance(portal, disable_distance);
-}
-float Portal::get_disable_distance() const {
-
- return disable_distance;
-}
-
-void Portal::set_disabled_color(const Color &p_disabled_color) {
-
- disabled_color = p_disabled_color;
- VisualServer::get_singleton()->portal_set_disabled_color(portal, disabled_color);
-}
-
-Color Portal::get_disabled_color() const {
-
- return disabled_color;
-}
-
-void Portal::_bind_methods() {
-
- ClassDB::bind_method(D_METHOD("set_shape", "points"), &Portal::set_shape);
- ClassDB::bind_method(D_METHOD("get_shape"), &Portal::get_shape);
-
- ClassDB::bind_method(D_METHOD("set_enabled", "enable"), &Portal::set_enabled);
- ClassDB::bind_method(D_METHOD("is_enabled"), &Portal::is_enabled);
-
- ClassDB::bind_method(D_METHOD("set_disable_distance", "distance"), &Portal::set_disable_distance);
- ClassDB::bind_method(D_METHOD("get_disable_distance"), &Portal::get_disable_distance);
-
- ClassDB::bind_method(D_METHOD("set_disabled_color", "color"), &Portal::set_disabled_color);
- ClassDB::bind_method(D_METHOD("get_disabled_color"), &Portal::get_disabled_color);
-
- ClassDB::bind_method(D_METHOD("set_connect_range", "range"), &Portal::set_connect_range);
- ClassDB::bind_method(D_METHOD("get_connect_range"), &Portal::get_connect_range);
-}
-
-Portal::Portal() {
-
- portal = VisualServer::get_singleton()->portal_create();
- Vector<Point2> points;
- points.push_back(Point2(-1, 1));
- points.push_back(Point2(1, 1));
- points.push_back(Point2(1, -1));
- points.push_back(Point2(-1, -1));
- set_shape(points); // default shape
-
- set_connect_range(0.8);
- set_disable_distance(50);
- set_enabled(true);
-
- set_base(portal);
-}
-
-Portal::~Portal() {
-
- VisualServer::get_singleton()->free(portal);
-}
-#endif
diff --git a/scene/3d/portal.h b/scene/3d/portal.h
deleted file mode 100644
index 7e8b016e79..0000000000
--- a/scene/3d/portal.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*************************************************************************/
-/* portal.h */
-/*************************************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/* https://godotengine.org */
-/*************************************************************************/
-/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
-/* */
-/* Permission is hereby granted, free of charge, to any person obtaining */
-/* a copy of this software and associated documentation files (the */
-/* "Software"), to deal in the Software without restriction, including */
-/* without limitation the rights to use, copy, modify, merge, publish, */
-/* distribute, sublicense, and/or sell copies of the Software, and to */
-/* permit persons to whom the Software is furnished to do so, subject to */
-/* the following conditions: */
-/* */
-/* The above copyright notice and this permission notice shall be */
-/* included in all copies or substantial portions of the Software. */
-/* */
-/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
-/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
-/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
-/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
-/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
-/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
-/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-/*************************************************************************/
-
-#ifndef PORTAL_H
-#define PORTAL_H
-
-#include "scene/3d/visual_instance.h"
-
-/* Portal Logic:
- If a portal is placed next (very close to) a similar, opposing portal, they automatically connect,
- otherwise, a portal connects to the parent room
-*/
-// FIXME: This will be redone and replaced by area portals, left for reference
-// since a new class with this name will have to exist and want to reuse the gizmos
-#if 0
-class Portal : public VisualInstance {
-
- GDCLASS(Portal, VisualInstance);
-
- RID portal;
- Vector<Point2> shape;
-
- bool enabled;
- float disable_distance;
- Color disabled_color;
- float connect_range;
-
- AABB aabb;
-
-protected:
- bool _set(const StringName &p_name, const Variant &p_value);
- bool _get(const StringName &p_name, Variant &r_ret) const;
- void _get_property_list(List<PropertyInfo> *p_list) const;
-
- static void _bind_methods();
-
-public:
- virtual AABB get_aabb() const;
- virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
-
- void set_enabled(bool p_enabled);
- bool is_enabled() const;
-
- void set_disable_distance(float p_distance);
- float get_disable_distance() const;
-
- void set_disabled_color(const Color &p_disabled_color);
- Color get_disabled_color() const;
-
- void set_shape(const Vector<Point2> &p_shape);
- Vector<Point2> get_shape() const;
-
- void set_connect_range(float p_range);
- float get_connect_range() const;
-
- Portal();
- ~Portal();
-};
-
-#endif
-#endif
diff --git a/scene/3d/room_instance.cpp b/scene/3d/room_instance.cpp
deleted file mode 100644
index 61687360a6..0000000000
--- a/scene/3d/room_instance.cpp
+++ /dev/null
@@ -1,164 +0,0 @@
-/*************************************************************************/
-/* room_instance.cpp */
-/*************************************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/* https://godotengine.org */
-/*************************************************************************/
-/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
-/* */
-/* Permission is hereby granted, free of charge, to any person obtaining */
-/* a copy of this software and associated documentation files (the */
-/* "Software"), to deal in the Software without restriction, including */
-/* without limitation the rights to use, copy, modify, merge, publish, */
-/* distribute, sublicense, and/or sell copies of the Software, and to */
-/* permit persons to whom the Software is furnished to do so, subject to */
-/* the following conditions: */
-/* */
-/* The above copyright notice and this permission notice shall be */
-/* included in all copies or substantial portions of the Software. */
-/* */
-/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
-/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
-/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
-/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
-/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
-/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
-/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-/*************************************************************************/
-
-#include "room_instance.h"
-
-#include "servers/visual_server.h"
-
-// FIXME: Will be removed, kept as reference for new implementation
-#if 0
-#include "core/math/geometry.h"
-#include "core/project_settings.h"
-#include "scene/resources/surface_tool.h"
-
-void Room::_notification(int p_what) {
-
- switch (p_what) {
- case NOTIFICATION_ENTER_WORLD: {
- // go find parent level
- Node *parent_room = get_parent();
- level = 0;
-
- while (parent_room) {
-
- Room *r = Object::cast_to<Room>(parent_room);
- if (r) {
-
- level = r->level + 1;
- break;
- }
-
- parent_room = parent_room->get_parent();
- }
-
- } break;
- case NOTIFICATION_TRANSFORM_CHANGED: {
- } break;
- case NOTIFICATION_EXIT_WORLD: {
-
- } break;
- }
-}
-
-AABB Room::get_aabb() const {
-
- if (room.is_null())
- return AABB();
-
- return AABB();
-}
-
-PoolVector<Face3> Room::get_faces(uint32_t p_usage_flags) const {
-
- return PoolVector<Face3>();
-}
-
-void Room::set_room(const Ref<RoomBounds> &p_room) {
-
- room = p_room;
- update_gizmo();
-
- if (room.is_valid()) {
-
- set_base(room->get_rid());
- } else {
- set_base(RID());
- }
-
- if (!is_inside_tree())
- return;
-
- propagate_notification(NOTIFICATION_AREA_CHANGED);
- update_gizmo();
-}
-
-Ref<RoomBounds> Room::get_room() const {
-
- return room;
-}
-
-void Room::_parse_node_faces(PoolVector<Face3> &all_faces, const Node *p_node) const {
-
- const VisualInstance *vi = Object::cast_to<VisualInstance>(p_node);
-
- if (vi) {
- PoolVector<Face3> faces = vi->get_faces(FACES_ENCLOSING);
-
- if (faces.size()) {
- int old_len = all_faces.size();
- all_faces.resize(all_faces.size() + faces.size());
- int new_len = all_faces.size();
- PoolVector<Face3>::Write all_facesw = all_faces.write();
- Face3 *all_facesptr = all_facesw.ptr();
-
- PoolVector<Face3>::Read facesr = faces.read();
- const Face3 *facesptr = facesr.ptr();
-
- Transform tr = vi->get_relative_transform(this);
-
- for (int i = old_len; i < new_len; i++) {
-
- Face3 f = facesptr[i - old_len];
- for (int j = 0; j < 3; j++)
- f.vertex[j] = tr.xform(f.vertex[j]);
- all_facesptr[i] = f;
- }
- }
- }
-
- for (int i = 0; i < p_node->get_child_count(); i++) {
-
- _parse_node_faces(all_faces, p_node->get_child(i));
- }
-}
-
-void Room::_bounds_changed() {
-
- update_gizmo();
-}
-
-void Room::_bind_methods() {
-
- ClassDB::bind_method(D_METHOD("set_room", "room"), &Room::set_room);
- ClassDB::bind_method(D_METHOD("get_room"), &Room::get_room);
-
- ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "room/room", PROPERTY_HINT_RESOURCE_TYPE, "Area"), "set_room", "get_room");
-}
-
-Room::Room() {
-
- // sound_enabled=false;
-
- level = 0;
-}
-
-Room::~Room() {
-}
-#endif
diff --git a/scene/3d/room_instance.h b/scene/3d/room_instance.h
deleted file mode 100644
index 071d42cff2..0000000000
--- a/scene/3d/room_instance.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*************************************************************************/
-/* room_instance.h */
-/*************************************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/* https://godotengine.org */
-/*************************************************************************/
-/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
-/* */
-/* Permission is hereby granted, free of charge, to any person obtaining */
-/* a copy of this software and associated documentation files (the */
-/* "Software"), to deal in the Software without restriction, including */
-/* without limitation the rights to use, copy, modify, merge, publish, */
-/* distribute, sublicense, and/or sell copies of the Software, and to */
-/* permit persons to whom the Software is furnished to do so, subject to */
-/* the following conditions: */
-/* */
-/* The above copyright notice and this permission notice shall be */
-/* included in all copies or substantial portions of the Software. */
-/* */
-/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
-/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
-/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
-/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
-/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
-/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
-/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-/*************************************************************************/
-
-#ifndef ROOM_INSTANCE_H
-#define ROOM_INSTANCE_H
-
-#include "scene/3d/visual_instance.h"
-#include "scene/resources/room.h"
-
-/* RoomInstance Logic:
- a) Instances that belong to the room are drawn only if the room is visible (seen through portal, or player inside)
- b) Instances that don't belong to any room are considered to belong to the root room (RID empty)
- c) "dynamic" Instances are assigned to the rooms their AABB touch
-
-*/
-
-// FIXME: this will be removed, left for reference
-#if 0
-
-class Room : public VisualInstance {
-
- GDCLASS(Room, VisualInstance);
-
-public:
-private:
- Ref<RoomBounds> room;
-
- int level;
- void _parse_node_faces(PoolVector<Face3> &all_faces, const Node *p_node) const;
-
- void _bounds_changed();
-
-protected:
- void _notification(int p_what);
-
- static void _bind_methods();
-
-public:
- enum {
- // used to notify portals that the room in which they are has changed.
- NOTIFICATION_AREA_CHANGED = 60
- };
-
- virtual AABB get_aabb() const;
- virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
-
- void set_room(const Ref<RoomBounds> &p_room);
- Ref<RoomBounds> get_room() const;
-
- Room();
- ~Room();
-};
-#endif
-#endif // ROOM_INSTANCE_H
diff --git a/scene/3d/voxel_light_baker.cpp b/scene/3d/voxel_light_baker.cpp
index 9970b9350f..c1ec59d49f 100644
--- a/scene/3d/voxel_light_baker.cpp
+++ b/scene/3d/voxel_light_baker.cpp
@@ -29,6 +29,7 @@
/*************************************************************************/
#include "voxel_light_baker.h"
+
#include "core/os/os.h"
#include "core/os/threaded_array_processor.h"
@@ -2118,8 +2119,7 @@ Error VoxelLightBaker::make_lightmap(const Transform &p_xform, Ref<Mesh> &p_mesh
}
}
-// Enable for debugging
-#if 0
+#if 0 // Enable for debugging.
{
PoolVector<uint8_t> img;
int ls = lightmap.size();
diff --git a/scene/animation/animation_blend_tree.cpp b/scene/animation/animation_blend_tree.cpp
index a604fb9604..5f606ff4c5 100644
--- a/scene/animation/animation_blend_tree.cpp
+++ b/scene/animation/animation_blend_tree.cpp
@@ -29,6 +29,7 @@
/*************************************************************************/
#include "animation_blend_tree.h"
+
#include "scene/scene_string_names.h"
void AnimationNodeAnimation::set_animation(const StringName &p_name) {
@@ -718,21 +719,6 @@ String AnimationNodeTransition::get_input_caption(int p_input) const {
return inputs[p_input].name;
}
-#if 0
- Ref<AnimationNodeBlendTree> tree = get_parent();
-
- if (tree.is_valid() && current >= 0) {
- prev = current;
- prev_xfading = xfade;
- time = 0;
- current = p_current;
- switched = true;
- _change_notify("current");
- } else {
- current = p_current;
- }
-#endif
-
void AnimationNodeTransition::set_cross_fade_time(float p_fade) {
xfade = p_fade;
}
diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp
index 09d4505458..c0c6b864a5 100644
--- a/scene/register_scene_types.cpp
+++ b/scene/register_scene_types.cpp
@@ -194,13 +194,11 @@
#include "scene/3d/path.h"
#include "scene/3d/physics_body.h"
#include "scene/3d/physics_joint.h"
-#include "scene/3d/portal.h"
#include "scene/3d/position_3d.h"
#include "scene/3d/proximity_group.h"
#include "scene/3d/ray_cast.h"
#include "scene/3d/reflection_probe.h"
#include "scene/3d/remote_transform.h"
-#include "scene/3d/room_instance.h"
#include "scene/3d/skeleton.h"
#include "scene/3d/soft_body.h"
#include "scene/3d/spring_arm.h"
diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp
index a21015f872..d19d82d252 100644
--- a/scene/resources/dynamic_font.cpp
+++ b/scene/resources/dynamic_font.cpp
@@ -1018,8 +1018,8 @@ void DynamicFont::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_fallback_count"), &DynamicFont::get_fallback_count);
ADD_GROUP("Settings", "");
- ADD_PROPERTY(PropertyInfo(Variant::INT, "size", PROPERTY_HINT_RANGE, "1,255,1"), "set_size", "get_size");
- ADD_PROPERTY(PropertyInfo(Variant::INT, "outline_size", PROPERTY_HINT_RANGE, "0,255,1"), "set_outline_size", "get_outline_size");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "size", PROPERTY_HINT_RANGE, "1,1024,1"), "set_size", "get_size");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "outline_size", PROPERTY_HINT_RANGE, "0,1024,1"), "set_outline_size", "get_outline_size");
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "outline_color"), "set_outline_color", "get_outline_color");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_mipmaps"), "set_use_mipmaps", "get_use_mipmaps");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_filter"), "set_use_filter", "get_use_filter");
diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp
index 960919df47..19c59b3817 100644
--- a/scene/resources/font.cpp
+++ b/scene/resources/font.cpp
@@ -628,8 +628,8 @@ void BitmapFont::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::POOL_INT_ARRAY, "chars", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_set_chars", "_get_chars");
ADD_PROPERTY(PropertyInfo(Variant::POOL_INT_ARRAY, "kernings", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_set_kernings", "_get_kernings");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "height", PROPERTY_HINT_RANGE, "-1024,1024,1"), "set_height", "get_height");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "ascent", PROPERTY_HINT_RANGE, "-1024,1024,1"), "set_ascent", "get_ascent");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "height", PROPERTY_HINT_RANGE, "1,1024,1"), "set_height", "get_height");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "ascent", PROPERTY_HINT_RANGE, "0,1024,1"), "set_ascent", "get_ascent");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "distance_field"), "set_distance_field_hint", "is_distance_field_hint");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "fallback", PROPERTY_HINT_RESOURCE_TYPE, "BitmapFont"), "set_fallback", "get_fallback");
}
diff --git a/scene/resources/room.cpp b/scene/resources/room.cpp
deleted file mode 100644
index 51c4489ec3..0000000000
--- a/scene/resources/room.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/*************************************************************************/
-/* room.cpp */
-/*************************************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/* https://godotengine.org */
-/*************************************************************************/
-/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
-/* */
-/* Permission is hereby granted, free of charge, to any person obtaining */
-/* a copy of this software and associated documentation files (the */
-/* "Software"), to deal in the Software without restriction, including */
-/* without limitation the rights to use, copy, modify, merge, publish, */
-/* distribute, sublicense, and/or sell copies of the Software, and to */
-/* permit persons to whom the Software is furnished to do so, subject to */
-/* the following conditions: */
-/* */
-/* The above copyright notice and this permission notice shall be */
-/* included in all copies or substantial portions of the Software. */
-/* */
-/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
-/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
-/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
-/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
-/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
-/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
-/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-/*************************************************************************/
-
-#include "room.h"
-
-#include "servers/visual_server.h"
-
-// FIXME: Left for reference for reimplementation using Area
-#if 0
-RID RoomBounds::get_rid() const {
-
- return area;
-}
-
-void RoomBounds::set_geometry_hint(const PoolVector<Face3> &p_geometry_hint) {
-
- geometry_hint = p_geometry_hint;
-}
-
-PoolVector<Face3> RoomBounds::get_geometry_hint() const {
-
- return geometry_hint;
-}
-
-void RoomBounds::_bind_methods() {
-
- ClassDB::bind_method(D_METHOD("set_geometry_hint", "triangles"), &RoomBounds::set_geometry_hint);
- ClassDB::bind_method(D_METHOD("get_geometry_hint"), &RoomBounds::get_geometry_hint);
-
- //ADD_PROPERTY( PropertyInfo( Variant::DICTIONARY, "bounds"), "set_bounds","get_bounds") ;
- ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR3_ARRAY, "geometry_hint"), "set_geometry_hint", "get_geometry_hint");
-}
-
-RoomBounds::RoomBounds() {
-
- area = VisualServer::get_singleton()->room_create();
-}
-
-RoomBounds::~RoomBounds() {
-
- VisualServer::get_singleton()->free(area);
-}
-#endif
diff --git a/scene/resources/room.h b/scene/resources/room.h
deleted file mode 100644
index 809a9c1de8..0000000000
--- a/scene/resources/room.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*************************************************************************/
-/* room.h */
-/*************************************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/* https://godotengine.org */
-/*************************************************************************/
-/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
-/* */
-/* Permission is hereby granted, free of charge, to any person obtaining */
-/* a copy of this software and associated documentation files (the */
-/* "Software"), to deal in the Software without restriction, including */
-/* without limitation the rights to use, copy, modify, merge, publish, */
-/* distribute, sublicense, and/or sell copies of the Software, and to */
-/* permit persons to whom the Software is furnished to do so, subject to */
-/* the following conditions: */
-/* */
-/* The above copyright notice and this permission notice shall be */
-/* included in all copies or substantial portions of the Software. */
-/* */
-/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
-/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
-/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
-/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
-/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
-/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
-/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-/*************************************************************************/
-
-#ifndef ROOM_BOUNDS_H
-#define ROOM_BOUNDS_H
-
-#include "core/math/bsp_tree.h"
-#include "core/resource.h"
-
-// FIXME: left for reference but will be removed when portals are reimplemented using Area
-#if 0
-
-class RoomBounds : public Resource {
-
- GDCLASS(RoomBounds, Resource);
- RES_BASE_EXTENSION("room");
-
- RID area;
- PoolVector<Face3> geometry_hint;
-
-protected:
- static void _bind_methods();
-
-public:
- virtual RID get_rid() const;
-
- void set_geometry_hint(const PoolVector<Face3> &p_geometry_hint);
- PoolVector<Face3> get_geometry_hint() const;
-
- RoomBounds();
- ~RoomBounds();
-};
-
-#endif
-#endif // ROOM_H
diff --git a/servers/audio_server.h b/servers/audio_server.h
index 13d6abbc8d..815200c811 100644
--- a/servers/audio_server.h
+++ b/servers/audio_server.h
@@ -247,18 +247,6 @@ private:
void _mix_step();
-#if 0
- struct AudioInBlock {
-
- Ref<AudioStreamSample> audio_stream;
- int current_position;
- bool loops;
- };
-
- Map<StringName, AudioInBlock *> audio_in_block_map;
- Vector<AudioInBlock *> audio_in_blocks;
-#endif
-
struct CallbackItem {
AudioCallback callback;
diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h
index 1a1e86833e..9afcfc4648 100644
--- a/servers/visual/visual_server_raster.h
+++ b/servers/visual/visual_server_raster.h
@@ -531,11 +531,10 @@ public:
BIND2(scenario_set_fallback_environment, RID, RID)
/* INSTANCING API */
- // from can be mesh, light, area and portal so far.
BIND0R(RID, instance_create)
- BIND2(instance_set_base, RID, RID) // from can be mesh, light, poly, area and portal so far.
- BIND2(instance_set_scenario, RID, RID) // from can be mesh, light, poly, area and portal so far.
+ BIND2(instance_set_base, RID, RID)
+ BIND2(instance_set_scenario, RID, RID)
BIND2(instance_set_layer_mask, RID, uint32_t)
BIND2(instance_set_transform, RID, const Transform &)
BIND2(instance_attach_object_instance_id, RID, ObjectID)
diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp
index bf9db616e4..409a814b3b 100644
--- a/servers/visual/visual_server_scene.cpp
+++ b/servers/visual/visual_server_scene.cpp
@@ -29,10 +29,13 @@
/*************************************************************************/
#include "visual_server_scene.h"
+
#include "core/os/os.h"
#include "visual_server_globals.h"
#include "visual_server_raster.h"
+
#include <new>
+
/* CAMERA API */
RID VisualServerScene::camera_create() {
@@ -314,7 +317,6 @@ void VisualServerScene::_instance_queue_update(Instance *p_instance, bool p_upda
_instance_update_list.add(&p_instance->update_item);
}
-// from can be mesh, light, area and portal so far.
RID VisualServerScene::instance_create() {
Instance *instance = memnew(Instance);
diff --git a/servers/visual/visual_server_scene.h b/servers/visual/visual_server_scene.h
index ad74250fe4..a174d9e616 100644
--- a/servers/visual/visual_server_scene.h
+++ b/servers/visual/visual_server_scene.h
@@ -55,22 +55,6 @@ public:
static VisualServerScene *singleton;
-// FIXME: Kept as reference for future implementation
-#if 0
- struct Portal {
-
- bool enabled;
- float disable_distance;
- Color disable_color;
- float connect_range;
- Vector<Point2> shape;
- Rect2 bounds;
-
-
- Portal() { enabled=true; disable_distance=50; disable_color=Color(); connect_range=0.8; }
- };
-#endif
-
/* CAMERA API */
struct Camera : public RID_Data {
@@ -450,11 +434,10 @@ public:
RID_Owner<Instance> instance_owner;
- // from can be mesh, light, area and portal so far.
- virtual RID instance_create(); // from can be mesh, light, poly, area and portal so far.
+ virtual RID instance_create();
- virtual void instance_set_base(RID p_instance, RID p_base); // from can be mesh, light, poly, area and portal so far.
- virtual void instance_set_scenario(RID p_instance, RID p_scenario); // from can be mesh, light, poly, area and portal so far.
+ virtual void instance_set_base(RID p_instance, RID p_base);
+ virtual void instance_set_scenario(RID p_instance, RID p_scenario);
virtual void instance_set_layer_mask(RID p_instance, uint32_t p_mask);
virtual void instance_set_transform(RID p_instance, const Transform &p_transform);
virtual void instance_attach_object_instance_id(RID p_instance, ObjectID p_id);
diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h
index b8f433d006..b1bbed24fd 100644
--- a/servers/visual/visual_server_wrap_mt.h
+++ b/servers/visual/visual_server_wrap_mt.h
@@ -453,11 +453,10 @@ public:
FUNC2(scenario_set_fallback_environment, RID, RID)
/* INSTANCING API */
- // from can be mesh, light, area and portal so far.
FUNCRID(instance)
- FUNC2(instance_set_base, RID, RID) // from can be mesh, light, poly, area and portal so far.
- FUNC2(instance_set_scenario, RID, RID) // from can be mesh, light, poly, area and portal so far.
+ FUNC2(instance_set_base, RID, RID)
+ FUNC2(instance_set_scenario, RID, RID)
FUNC2(instance_set_layer_mask, RID, uint32_t)
FUNC2(instance_set_transform, RID, const Transform &)
FUNC2(instance_attach_object_instance_id, RID, ObjectID)
diff --git a/servers/visual_server.h b/servers/visual_server.h
index 6f0659357c..e7662695a6 100644
--- a/servers/visual_server.h
+++ b/servers/visual_server.h
@@ -813,11 +813,10 @@ public:
virtual RID instance_create2(RID p_base, RID p_scenario);
- //virtual RID instance_create(RID p_base,RID p_scenario)=0; // from can be mesh, light, area and portal so far.
- virtual RID instance_create() = 0; // from can be mesh, light, poly, area and portal so far.
+ virtual RID instance_create() = 0;
- virtual void instance_set_base(RID p_instance, RID p_base) = 0; // from can be mesh, light, poly, area and portal so far.
- virtual void instance_set_scenario(RID p_instance, RID p_scenario) = 0; // from can be mesh, light, poly, area and portal so far.
+ virtual void instance_set_base(RID p_instance, RID p_base) = 0;
+ virtual void instance_set_scenario(RID p_instance, RID p_scenario) = 0;
virtual void instance_set_layer_mask(RID p_instance, uint32_t p_mask) = 0;
virtual void instance_set_transform(RID p_instance, const Transform &p_transform) = 0;
virtual void instance_attach_object_instance_id(RID p_instance, ObjectID p_id) = 0;