diff options
165 files changed, 2806 insertions, 1825 deletions
diff --git a/SConstruct b/SConstruct index 7b0c644aea..92dc4d9da2 100644 --- a/SConstruct +++ b/SConstruct @@ -422,7 +422,7 @@ if selected_platform in platform_list: if (can_build): config.configure(env) env.module_list.append(x) - + # Get doc classes paths (if present) try: doc_classes = config.get_doc_classes() @@ -522,13 +522,23 @@ if selected_platform in platform_list: env.AppendUnique(CPPDEFINES=[header[1]]) elif selected_platform != "": + if selected_platform == "list": + print("The following platforms are available:\n") + else: + print('Invalid target platform "' + selected_platform + '".') + print("The following platforms were detected:\n") - print("Invalid target platform: " + selected_platform) - print("The following platforms were detected:") for x in platform_list: print("\t" + x) + print("\nPlease run SCons again and select a valid platform: platform=<string>") + if selected_platform == "list": + # Exit early to suppress the rest of the built-in SCons messages + sys.exit(0) + else: + sys.exit(255) + # The following only makes sense when the env is defined, and assumes it is if 'env' in locals(): screen = sys.stdout diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 34bbdb2c75..b41b84ab1e 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -2941,6 +2941,10 @@ float _Engine::get_physics_jitter_fix() const { return Engine::get_singleton()->get_physics_jitter_fix(); } +float _Engine::get_physics_interpolation_fraction() const { + return Engine::get_singleton()->get_physics_interpolation_fraction(); +} + void _Engine::set_target_fps(int p_fps) { Engine::get_singleton()->set_target_fps(p_fps); } @@ -3029,6 +3033,7 @@ void _Engine::_bind_methods() { ClassDB::bind_method(D_METHOD("get_iterations_per_second"), &_Engine::get_iterations_per_second); ClassDB::bind_method(D_METHOD("set_physics_jitter_fix", "physics_jitter_fix"), &_Engine::set_physics_jitter_fix); ClassDB::bind_method(D_METHOD("get_physics_jitter_fix"), &_Engine::get_physics_jitter_fix); + ClassDB::bind_method(D_METHOD("get_physics_interpolation_fraction"), &_Engine::get_physics_interpolation_fraction); ClassDB::bind_method(D_METHOD("set_target_fps", "target_fps"), &_Engine::set_target_fps); ClassDB::bind_method(D_METHOD("get_target_fps"), &_Engine::get_target_fps); diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 3be5a08752..f0f86e003f 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -746,6 +746,7 @@ public: void set_physics_jitter_fix(float p_threshold); float get_physics_jitter_fix() const; + float get_physics_interpolation_fraction() const; void set_target_fps(int p_fps); int get_target_fps() const; diff --git a/core/engine.cpp b/core/engine.cpp index 2d8473fbd9..0dd0459403 100644 --- a/core/engine.cpp +++ b/core/engine.cpp @@ -227,6 +227,7 @@ Engine::Engine() { frames_drawn = 0; ips = 60; physics_jitter_fix = 0.5; + _physics_interpolation_fraction = 0.0f; _frame_delay = 0; _fps = 1; _target_fps = 0; diff --git a/core/engine.h b/core/engine.h index 15665fee29..192e8e67a0 100644 --- a/core/engine.h +++ b/core/engine.h @@ -63,6 +63,7 @@ private: float _time_scale; bool _pixel_snap; uint64_t _physics_frames; + float _physics_interpolation_fraction; uint64_t _idle_frames; bool _in_physics; @@ -95,6 +96,7 @@ public: bool is_in_physics_frame() const { return _in_physics; } uint64_t get_idle_frame_ticks() const { return _frame_ticks; } float get_idle_frame_step() const { return _frame_step; } + float get_physics_interpolation_fraction() const { return _physics_interpolation_fraction; } void set_time_scale(float p_scale); float get_time_scale() const; diff --git a/doc/classes/ARVRServer.xml b/doc/classes/ARVRServer.xml index af1a1b0fff..b71a18858f 100644 --- a/doc/classes/ARVRServer.xml +++ b/doc/classes/ARVRServer.xml @@ -107,7 +107,7 @@ </method> </methods> <members> - <member name="primary_interface" type="ARVRInterface" setter="set_primary_interface" getter="get_primary_interface" default="null"> + <member name="primary_interface" type="ARVRInterface" setter="set_primary_interface" getter="get_primary_interface"> </member> <member name="world_scale" type="float" setter="set_world_scale" getter="get_world_scale" default="1.0"> Allows you to adjust the scale to your game's units. Most AR/VR platforms assume a scale of 1 game world unit = 1 real world meter. diff --git a/doc/classes/AnimatedSprite.xml b/doc/classes/AnimatedSprite.xml index 72d1fa4881..10ee4222c8 100644 --- a/doc/classes/AnimatedSprite.xml +++ b/doc/classes/AnimatedSprite.xml @@ -51,7 +51,7 @@ <member name="frame" type="int" setter="set_frame" getter="get_frame" default="0"> The displayed animation frame's index. </member> - <member name="frames" type="SpriteFrames" setter="set_sprite_frames" getter="get_sprite_frames" default="null"> + <member name="frames" type="SpriteFrames" setter="set_sprite_frames" getter="get_sprite_frames"> The [SpriteFrames] resource containing the animation(s). </member> <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2( 0, 0 )"> diff --git a/doc/classes/AnimatedSprite3D.xml b/doc/classes/AnimatedSprite3D.xml index ff7d2fb9eb..eac5822d53 100644 --- a/doc/classes/AnimatedSprite3D.xml +++ b/doc/classes/AnimatedSprite3D.xml @@ -40,7 +40,7 @@ <member name="frame" type="int" setter="set_frame" getter="get_frame" default="0"> The displayed animation frame's index. </member> - <member name="frames" type="SpriteFrames" setter="set_sprite_frames" getter="get_sprite_frames" default="null"> + <member name="frames" type="SpriteFrames" setter="set_sprite_frames" getter="get_sprite_frames"> The [SpriteFrames] resource containing the animation(s). </member> <member name="playing" type="bool" setter="_set_playing" getter="_is_playing" default="false"> diff --git a/doc/classes/AnimationTree.xml b/doc/classes/AnimationTree.xml index 70c1b783df..d1c24e466d 100644 --- a/doc/classes/AnimationTree.xml +++ b/doc/classes/AnimationTree.xml @@ -43,7 +43,7 @@ </member> <member name="root_motion_track" type="NodePath" setter="set_root_motion_track" getter="get_root_motion_track" default="NodePath("")"> </member> - <member name="tree_root" type="AnimationNode" setter="set_tree_root" getter="get_tree_root" default="null"> + <member name="tree_root" type="AnimationNode" setter="set_tree_root" getter="get_tree_root"> </member> </members> <constants> diff --git a/doc/classes/AtlasTexture.xml b/doc/classes/AtlasTexture.xml index 1363287dc1..5b0a06a7fb 100644 --- a/doc/classes/AtlasTexture.xml +++ b/doc/classes/AtlasTexture.xml @@ -12,7 +12,7 @@ <methods> </methods> <members> - <member name="atlas" type="Texture" setter="set_atlas" getter="get_atlas" default="null"> + <member name="atlas" type="Texture" setter="set_atlas" getter="get_atlas"> The texture that contains the atlas. Can be any [Texture] subtype. </member> <member name="filter_clip" type="bool" setter="set_filter_clip" getter="has_filter_clip" default="false"> diff --git a/doc/classes/AudioStreamPlayer.xml b/doc/classes/AudioStreamPlayer.xml index 92f3a9bd73..4bc29335ff 100644 --- a/doc/classes/AudioStreamPlayer.xml +++ b/doc/classes/AudioStreamPlayer.xml @@ -65,7 +65,7 @@ <member name="playing" type="bool" setter="_set_playing" getter="is_playing" default="false"> If [code]true[/code], audio is playing. </member> - <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream" default="null"> + <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream"> The [AudioStream] object to be played. </member> <member name="stream_paused" type="bool" setter="set_stream_paused" getter="get_stream_paused" default="false"> diff --git a/doc/classes/AudioStreamPlayer2D.xml b/doc/classes/AudioStreamPlayer2D.xml index 362a096810..4734aff770 100644 --- a/doc/classes/AudioStreamPlayer2D.xml +++ b/doc/classes/AudioStreamPlayer2D.xml @@ -71,7 +71,7 @@ <member name="playing" type="bool" setter="_set_playing" getter="is_playing" default="false"> If [code]true[/code], audio is playing. </member> - <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream" default="null"> + <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream"> The [AudioStream] object to be played. </member> <member name="stream_paused" type="bool" setter="set_stream_paused" getter="get_stream_paused" default="false"> diff --git a/doc/classes/AudioStreamPlayer3D.xml b/doc/classes/AudioStreamPlayer3D.xml index d722f2164d..a73f96d082 100644 --- a/doc/classes/AudioStreamPlayer3D.xml +++ b/doc/classes/AudioStreamPlayer3D.xml @@ -95,7 +95,7 @@ <member name="playing" type="bool" setter="_set_playing" getter="is_playing" default="false"> If [code]true[/code], audio is playing. </member> - <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream" default="null"> + <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream"> The [AudioStream] object to be played. </member> <member name="stream_paused" type="bool" setter="set_stream_paused" getter="get_stream_paused" default="false"> diff --git a/doc/classes/AudioStreamRandomPitch.xml b/doc/classes/AudioStreamRandomPitch.xml index 9c73a64537..a2ee314d92 100644 --- a/doc/classes/AudioStreamRandomPitch.xml +++ b/doc/classes/AudioStreamRandomPitch.xml @@ -11,7 +11,7 @@ <methods> </methods> <members> - <member name="audio_stream" type="AudioStream" setter="set_audio_stream" getter="get_audio_stream" default="null"> + <member name="audio_stream" type="AudioStream" setter="set_audio_stream" getter="get_audio_stream"> The current [AudioStream]. </member> <member name="random_pitch" type="float" setter="set_random_pitch" getter="get_random_pitch" default="1.1"> diff --git a/doc/classes/BakedLightmap.xml b/doc/classes/BakedLightmap.xml index 4baf3a6bb2..4a1381295f 100644 --- a/doc/classes/BakedLightmap.xml +++ b/doc/classes/BakedLightmap.xml @@ -18,12 +18,14 @@ <argument index="1" name="create_visual_debug" type="bool" default="false"> </argument> <description> + Bakes the lightmaps within the currently edited scene. </description> </method> <method name="debug_bake"> <return type="void"> </return> <description> + Executes a dry run bake of lightmaps within the currently edited scene. </description> </method> </methods> @@ -32,8 +34,10 @@ Grid subdivision size for lightmapper calculation. The default value will work for most cases. Increase for better lighting on small details or if your scene is very large. </member> <member name="bake_default_texels_per_unit" type="float" setter="set_bake_default_texels_per_unit" getter="get_bake_default_texels_per_unit" default="20.0"> + If a [member Mesh.lightmap_size_hint] isn't specified, the lightmap baker will dynamically set the lightmap size using this value. This value is measured in texels per world unit. The maximum lightmap texture size is 4096x4096. </member> <member name="bake_energy" type="float" setter="set_energy" getter="get_energy" default="1.0"> + Multiplies the light sources' intensity by this value. For instance, if the value is set to 2, lights will be twice as bright. If the value is set to 0.5, lights will be half as bright. </member> <member name="bake_extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3( 10, 10, 10 )"> The size of the affected area. @@ -45,6 +49,7 @@ Lightmapping mode. See [enum BakeMode]. </member> <member name="bake_propagation" type="float" setter="set_propagation" getter="get_propagation" default="1.0"> + Defines how far the light will travel before it is no longer effective. The higher the number, the farther the light will travel. For instance, if the value is set to 2, the light will go twice as far. If the value is set to 0.5, the light will only go half as far. </member> <member name="bake_quality" type="int" setter="set_bake_quality" getter="get_bake_quality" enum="BakedLightmap.BakeQuality" default="1"> Three quality modes are available. Higher quality requires more rendering time. See [enum BakeQuality]. @@ -55,7 +60,7 @@ <member name="image_path" type="String" setter="set_image_path" getter="get_image_path" default="".""> The location where lightmaps will be saved. </member> - <member name="light_data" type="BakedLightmapData" setter="set_light_data" getter="get_light_data" default="null"> + <member name="light_data" type="BakedLightmapData" setter="set_light_data" getter="get_light_data"> The calculated light data. </member> </members> diff --git a/doc/classes/BaseButton.xml b/doc/classes/BaseButton.xml index f306adced2..9d1c80d3be 100644 --- a/doc/classes/BaseButton.xml +++ b/doc/classes/BaseButton.xml @@ -54,7 +54,7 @@ <member name="enabled_focus_mode" type="int" setter="set_enabled_focus_mode" getter="get_enabled_focus_mode" enum="Control.FocusMode" default="2"> Focus access mode to use when switching between enabled/disabled (see [member Control.focus_mode] and [member disabled]). </member> - <member name="group" type="ButtonGroup" setter="set_button_group" getter="get_button_group" default="null"> + <member name="group" type="ButtonGroup" setter="set_button_group" getter="get_button_group"> [ButtonGroup] associated to the button. </member> <member name="keep_pressed_outside" type="bool" setter="set_keep_pressed_outside" getter="is_keep_pressed_outside" default="false"> @@ -63,7 +63,7 @@ <member name="pressed" type="bool" setter="set_pressed" getter="is_pressed" default="false"> If [code]true[/code], the button's state is pressed. Means the button is pressed down or toggled (if toggle_mode is active). </member> - <member name="shortcut" type="ShortCut" setter="set_shortcut" getter="get_shortcut" default="null"> + <member name="shortcut" type="ShortCut" setter="set_shortcut" getter="get_shortcut"> [ShortCut] associated to the button. </member> <member name="shortcut_in_tooltip" type="bool" setter="set_shortcut_in_tooltip" getter="is_shortcut_in_tooltip_enabled" default="true"> diff --git a/doc/classes/BitmapFont.xml b/doc/classes/BitmapFont.xml index 5ec4947f46..16a28978d5 100644 --- a/doc/classes/BitmapFont.xml +++ b/doc/classes/BitmapFont.xml @@ -110,7 +110,7 @@ <member name="distance_field" type="bool" setter="set_distance_field_hint" getter="is_distance_field_hint" default="false"> If [code]true[/code], distance field hint is enabled. </member> - <member name="fallback" type="BitmapFont" setter="set_fallback" getter="get_fallback" default="null"> + <member name="fallback" type="BitmapFont" setter="set_fallback" getter="get_fallback"> The fallback font. </member> <member name="height" type="float" setter="set_height" getter="get_height" default="1.0"> diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml index f92cf8fabc..adf826c26b 100644 --- a/doc/classes/Button.xml +++ b/doc/classes/Button.xml @@ -20,7 +20,7 @@ <member name="flat" type="bool" setter="set_flat" getter="is_flat" default="false"> Flat buttons don't display decoration. </member> - <member name="icon" type="Texture" setter="set_button_icon" getter="get_button_icon" default="null"> + <member name="icon" type="Texture" setter="set_button_icon" getter="get_button_icon"> Button's icon, if text is present the icon will be placed before the text. </member> <member name="text" type="String" setter="set_text" getter="get_text" default=""""> diff --git a/doc/classes/CPUParticles.xml b/doc/classes/CPUParticles.xml index 12e00be04a..e68b0feb2d 100644 --- a/doc/classes/CPUParticles.xml +++ b/doc/classes/CPUParticles.xml @@ -106,7 +106,7 @@ <member name="angle" type="float" setter="set_param" getter="get_param" default="0.0"> Initial rotation applied to each particle, in degrees. </member> - <member name="angle_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="angle_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's rotation will be animated along this [Curve]. </member> <member name="angle_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -115,7 +115,7 @@ <member name="angular_velocity" type="float" setter="set_param" getter="get_param" default="0.0"> Initial angular velocity applied to each particle. Sets the speed of rotation of the particle. </member> - <member name="angular_velocity_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="angular_velocity_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's angular velocity will vary along this [Curve]. </member> <member name="angular_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -124,7 +124,7 @@ <member name="anim_offset" type="float" setter="set_param" getter="get_param" default="0.0"> Particle animation offset. </member> - <member name="anim_offset_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="anim_offset_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's animation offset will vary along this [Curve]. </member> <member name="anim_offset_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -133,7 +133,7 @@ <member name="anim_speed" type="float" setter="set_param" getter="get_param" default="0.0"> Particle animation speed. </member> - <member name="anim_speed_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="anim_speed_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's animation speed will vary along this [Curve]. </member> <member name="anim_speed_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -142,13 +142,13 @@ <member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )"> Unused for 3D particles. </member> - <member name="color_ramp" type="Gradient" setter="set_color_ramp" getter="get_color_ramp" default="null"> + <member name="color_ramp" type="Gradient" setter="set_color_ramp" getter="get_color_ramp"> Unused for 3D particles. </member> <member name="damping" type="float" setter="set_param" getter="get_param" default="0.0"> The rate at which particles lose velocity. </member> - <member name="damping_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="damping_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Damping will vary along this [Curve]. </member> <member name="damping_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -205,7 +205,7 @@ <member name="hue_variation" type="float" setter="set_param" getter="get_param" default="0.0"> Initial hue variation applied to each particle. </member> - <member name="hue_variation_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="hue_variation_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's hue will vary along this [Curve]. </member> <member name="hue_variation_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -220,10 +220,13 @@ <member name="lifetime" type="float" setter="set_lifetime" getter="get_lifetime" default="1.0"> Amount of time each particle will exist. </member> + <member name="lifetime_randomness" type="float" setter="set_lifetime_randomness" getter="get_lifetime_randomness" default="0.0"> + Particle lifetime randomness ratio. + </member> <member name="linear_accel" type="float" setter="set_param" getter="get_param" default="0.0"> Linear acceleration applied to each particle in the direction of motion. </member> - <member name="linear_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="linear_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's linear acceleration will vary along this [Curve]. </member> <member name="linear_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -232,7 +235,7 @@ <member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates" default="true"> If [code]true[/code], particles use the parent node's coordinate space. If [code]false[/code], they use global coordinates. </member> - <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh" default="null"> + <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh"> The [Mesh] used for each particle. If [code]null[/code], particles will be spheres. </member> <member name="one_shot" type="bool" setter="set_one_shot" getter="get_one_shot" default="false"> @@ -254,7 +257,7 @@ <member name="radial_accel" type="float" setter="set_param" getter="get_param" default="0.0"> Radial acceleration applied to each particle. Makes particle accelerate away from origin. </member> - <member name="radial_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="radial_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's radial acceleration will vary along this [Curve]. </member> <member name="radial_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -266,7 +269,7 @@ <member name="scale_amount" type="float" setter="set_param" getter="get_param" default="1.0"> Initial scale applied to each particle. </member> - <member name="scale_amount_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="scale_amount_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's scale will vary along this [Curve]. </member> <member name="scale_amount_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -281,7 +284,7 @@ <member name="tangential_accel" type="float" setter="set_param" getter="get_param" default="0.0"> Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. </member> - <member name="tangential_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="tangential_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's tangential acceleration will vary along this [Curve]. </member> <member name="tangential_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -299,52 +302,52 @@ Particles are drawn in order of depth. </constant> <constant name="PARAM_INITIAL_LINEAR_VELOCITY" value="0" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set initial velocity properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set initial velocity properties. </constant> <constant name="PARAM_ANGULAR_VELOCITY" value="1" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set angular velocity properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set angular velocity properties. </constant> <constant name="PARAM_ORBIT_VELOCITY" value="2" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set orbital velocity properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set orbital velocity properties. </constant> <constant name="PARAM_LINEAR_ACCEL" value="3" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set linear acceleration properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set linear acceleration properties. </constant> <constant name="PARAM_RADIAL_ACCEL" value="4" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set radial acceleration properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set radial acceleration properties. </constant> <constant name="PARAM_TANGENTIAL_ACCEL" value="5" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set tangential acceleration properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set tangential acceleration properties. </constant> <constant name="PARAM_DAMPING" value="6" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set damping properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set damping properties. </constant> <constant name="PARAM_ANGLE" value="7" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set angle properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set angle properties. </constant> <constant name="PARAM_SCALE" value="8" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set scale properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set scale properties. </constant> <constant name="PARAM_HUE_VARIATION" value="9" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set hue variation properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set hue variation properties. </constant> <constant name="PARAM_ANIM_SPEED" value="10" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set animation speed properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set animation speed properties. </constant> <constant name="PARAM_ANIM_OFFSET" value="11" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set animation offset properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set animation offset properties. </constant> <constant name="PARAM_MAX" value="12" enum="Parameter"> Represents the size of the [enum Parameter] enum. </constant> <constant name="FLAG_ALIGN_Y_TO_VELOCITY" value="0" enum="Flags"> - Use with [method set_flag] to set [member flag_align_y]. + Use with [method set_particle_flag] to set [member flag_align_y]. </constant> <constant name="FLAG_ROTATE_Y" value="1" enum="Flags"> - Use with [method set_flag] to set [member flag_rotate_y]. + Use with [method set_particle_flag] to set [member flag_rotate_y]. </constant> <constant name="FLAG_DISABLE_Z" value="2" enum="Flags"> - Use with [method set_flag] to set [member flag_disable_z]. + Use with [method set_particle_flag] to set [member flag_disable_z]. </constant> <constant name="FLAG_MAX" value="3" enum="Flags"> Represents the size of the [enum Flags] enum. diff --git a/doc/classes/CPUParticles2D.xml b/doc/classes/CPUParticles2D.xml index 7380014b96..c8dbffb4cb 100644 --- a/doc/classes/CPUParticles2D.xml +++ b/doc/classes/CPUParticles2D.xml @@ -107,7 +107,7 @@ <member name="angle" type="float" setter="set_param" getter="get_param" default="0.0"> Initial rotation applied to each particle, in degrees. </member> - <member name="angle_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="angle_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's rotation will be animated along this [Curve]. </member> <member name="angle_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -116,7 +116,7 @@ <member name="angular_velocity" type="float" setter="set_param" getter="get_param" default="0.0"> Initial angular velocity applied to each particle. Sets the speed of rotation of the particle. </member> - <member name="angular_velocity_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="angular_velocity_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's angular velocity will vary along this [Curve]. </member> <member name="angular_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -125,7 +125,7 @@ <member name="anim_offset" type="float" setter="set_param" getter="get_param" default="0.0"> Particle animation offset. </member> - <member name="anim_offset_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="anim_offset_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's animation offset will vary along this [Curve]. </member> <member name="anim_offset_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -134,7 +134,7 @@ <member name="anim_speed" type="float" setter="set_param" getter="get_param" default="0.0"> Particle animation speed. </member> - <member name="anim_speed_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="anim_speed_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's animation speed will vary along this [Curve]. </member> <member name="anim_speed_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -143,13 +143,13 @@ <member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )"> Each particle's initial color. If [member texture] is defined, it will be multiplied by this color. </member> - <member name="color_ramp" type="Gradient" setter="set_color_ramp" getter="get_color_ramp" default="null"> + <member name="color_ramp" type="Gradient" setter="set_color_ramp" getter="get_color_ramp"> Each particle's color will vary along this [Gradient]. </member> <member name="damping" type="float" setter="set_param" getter="get_param" default="0.0"> The rate at which particles lose velocity. </member> - <member name="damping_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="damping_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Damping will vary along this [Curve]. </member> <member name="damping_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -199,7 +199,7 @@ <member name="hue_variation" type="float" setter="set_param" getter="get_param" default="0.0"> Initial hue variation applied to each particle. </member> - <member name="hue_variation_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="hue_variation_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's hue will vary along this [Curve]. </member> <member name="hue_variation_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -214,10 +214,13 @@ <member name="lifetime" type="float" setter="set_lifetime" getter="get_lifetime" default="1.0"> Amount of time each particle will exist. </member> + <member name="lifetime_randomness" type="float" setter="set_lifetime_randomness" getter="get_lifetime_randomness" default="0.0"> + Particle lifetime randomness ratio. + </member> <member name="linear_accel" type="float" setter="set_param" getter="get_param" default="0.0"> Linear acceleration applied to each particle in the direction of motion. </member> - <member name="linear_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="linear_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's linear acceleration will vary along this [Curve]. </member> <member name="linear_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -226,7 +229,7 @@ <member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates" default="true"> If [code]true[/code], particles use the parent node's coordinate space. If [code]false[/code], they use global coordinates. </member> - <member name="normalmap" type="Texture" setter="set_normalmap" getter="get_normalmap" default="null"> + <member name="normalmap" type="Texture" setter="set_normalmap" getter="get_normalmap"> Normal map to be used for the [member texture] property. </member> <member name="one_shot" type="bool" setter="set_one_shot" getter="get_one_shot" default="false"> @@ -235,7 +238,7 @@ <member name="orbit_velocity" type="float" setter="set_param" getter="get_param" default="0.0"> Orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second. </member> - <member name="orbit_velocity_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="orbit_velocity_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's orbital velocity will vary along this [Curve]. </member> <member name="orbit_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -247,7 +250,7 @@ <member name="radial_accel" type="float" setter="set_param" getter="get_param" default="0.0"> Radial acceleration applied to each particle. Makes particle accelerate away from origin. </member> - <member name="radial_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="radial_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's radial acceleration will vary along this [Curve]. </member> <member name="radial_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -259,7 +262,7 @@ <member name="scale_amount" type="float" setter="set_param" getter="get_param" default="1.0"> Initial scale applied to each particle. </member> - <member name="scale_amount_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="scale_amount_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's scale will vary along this [Curve]. </member> <member name="scale_amount_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -274,13 +277,13 @@ <member name="tangential_accel" type="float" setter="set_param" getter="get_param" default="0.0"> Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. </member> - <member name="tangential_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve" default="null"> + <member name="tangential_accel_curve" type="Curve" setter="set_param_curve" getter="get_param_curve"> Each particle's tangential acceleration will vary along this [Curve]. </member> <member name="tangential_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> Tangential acceleration randomness ratio. </member> - <member name="texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> Particle texture. If [code]null[/code], particles will be squares. </member> </members> @@ -292,46 +295,46 @@ Particles are drawn in order of remaining lifetime. </constant> <constant name="PARAM_INITIAL_LINEAR_VELOCITY" value="0" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set initial velocity properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set initial velocity properties. </constant> <constant name="PARAM_ANGULAR_VELOCITY" value="1" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set angular velocity properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set angular velocity properties. </constant> <constant name="PARAM_ORBIT_VELOCITY" value="2" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set orbital velocity properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set orbital velocity properties. </constant> <constant name="PARAM_LINEAR_ACCEL" value="3" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set linear acceleration properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set linear acceleration properties. </constant> <constant name="PARAM_RADIAL_ACCEL" value="4" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set radial acceleration properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set radial acceleration properties. </constant> <constant name="PARAM_TANGENTIAL_ACCEL" value="5" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set tangential acceleration properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set tangential acceleration properties. </constant> <constant name="PARAM_DAMPING" value="6" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set damping properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set damping properties. </constant> <constant name="PARAM_ANGLE" value="7" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set angle properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set angle properties. </constant> <constant name="PARAM_SCALE" value="8" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set scale properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set scale properties. </constant> <constant name="PARAM_HUE_VARIATION" value="9" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set hue variation properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set hue variation properties. </constant> <constant name="PARAM_ANIM_SPEED" value="10" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set animation speed properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set animation speed properties. </constant> <constant name="PARAM_ANIM_OFFSET" value="11" enum="Parameter"> - Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set animation offset properties. + Use with [method set_param], [method set_param_randomness], and [method set_param_curve] to set animation offset properties. </constant> <constant name="PARAM_MAX" value="12" enum="Parameter"> Represents the size of the [enum Parameter] enum. </constant> <constant name="FLAG_ALIGN_Y_TO_VELOCITY" value="0" enum="Flags"> - Use with [method set_flag] to set [member flag_align_y]. + Use with [method set_particle_flag] to set [member flag_align_y]. </constant> <constant name="FLAG_ROTATE_Y" value="1" enum="Flags"> Present for consistency with 3D particle nodes, not used in 2D. diff --git a/doc/classes/Camera.xml b/doc/classes/Camera.xml index c22413ae7e..d410800141 100644 --- a/doc/classes/Camera.xml +++ b/doc/classes/Camera.xml @@ -171,7 +171,7 @@ <member name="doppler_tracking" type="int" setter="set_doppler_tracking" getter="get_doppler_tracking" enum="Camera.DopplerTracking" default="0"> If not [constant DOPPLER_TRACKING_DISABLED], this camera will simulate the Doppler effect for objects changed in particular [code]_process[/code] methods. See [enum DopplerTracking] for possible values. </member> - <member name="environment" type="Environment" setter="set_environment" getter="get_environment" default="null"> + <member name="environment" type="Environment" setter="set_environment" getter="get_environment"> The [Environment] to use for this camera. </member> <member name="far" type="float" setter="set_zfar" getter="get_zfar" default="100.0"> diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 79e3676068..87b8f5c83d 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -519,7 +519,7 @@ <member name="light_mask" type="int" setter="set_light_mask" getter="get_light_mask" default="1"> The rendering layers in which this [CanvasItem] responds to [Light2D] nodes. </member> - <member name="material" type="Material" setter="set_material" getter="get_material" default="null"> + <member name="material" type="Material" setter="set_material" getter="get_material"> The material applied to textures on this [CanvasItem]. </member> <member name="modulate" type="Color" setter="set_modulate" getter="get_modulate" default="Color( 1, 1, 1, 1 )"> diff --git a/doc/classes/CollisionShape.xml b/doc/classes/CollisionShape.xml index bbbc07e6d3..c34c0be839 100644 --- a/doc/classes/CollisionShape.xml +++ b/doc/classes/CollisionShape.xml @@ -31,7 +31,7 @@ <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" default="false"> A disabled collision shape has no effect in the world. </member> - <member name="shape" type="Shape" setter="set_shape" getter="get_shape" default="null"> + <member name="shape" type="Shape" setter="set_shape" getter="get_shape"> The actual shape owned by this collision shape. </member> </members> diff --git a/doc/classes/CollisionShape2D.xml b/doc/classes/CollisionShape2D.xml index fa002bc881..5fd8826a98 100644 --- a/doc/classes/CollisionShape2D.xml +++ b/doc/classes/CollisionShape2D.xml @@ -20,7 +20,7 @@ </member> <member name="one_way_collision_margin" type="float" setter="set_one_way_collision_margin" getter="get_one_way_collision_margin" default="1.0"> </member> - <member name="shape" type="Shape2D" setter="set_shape" getter="get_shape" default="null"> + <member name="shape" type="Shape2D" setter="set_shape" getter="get_shape"> The actual shape owned by this collision shape. </member> </members> diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index 8ca0bb0b9b..69fec750a2 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -788,7 +788,7 @@ <member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" default="1"> Tells the parent [Container] nodes how they should resize and place the node on the Y axis. Use one of the [code]SIZE_*[/code] constants to change the flags. See the constants to learn what each does. </member> - <member name="theme" type="Theme" setter="set_theme" getter="get_theme" default="null"> + <member name="theme" type="Theme" setter="set_theme" getter="get_theme"> Changing this property replaces the current [Theme] resource this node and all its [Control] children use. </member> </members> diff --git a/doc/classes/CurveTexture.xml b/doc/classes/CurveTexture.xml index 666284138b..e8df560a4c 100644 --- a/doc/classes/CurveTexture.xml +++ b/doc/classes/CurveTexture.xml @@ -11,7 +11,7 @@ <methods> </methods> <members> - <member name="curve" type="Curve" setter="set_curve" getter="get_curve" default="null"> + <member name="curve" type="Curve" setter="set_curve" getter="get_curve"> The [code]curve[/code] rendered onto the texture. </member> <member name="width" type="int" setter="set_width" getter="get_width" default="2048"> diff --git a/doc/classes/DynamicFont.xml b/doc/classes/DynamicFont.xml index ac707d09bc..0820d4e1b6 100644 --- a/doc/classes/DynamicFont.xml +++ b/doc/classes/DynamicFont.xml @@ -92,7 +92,7 @@ <member name="extra_spacing_top" type="int" setter="set_spacing" getter="get_spacing" default="0"> Extra spacing at the top in pixels. </member> - <member name="font_data" type="DynamicFontData" setter="set_font_data" getter="get_font_data" default="null"> + <member name="font_data" type="DynamicFontData" setter="set_font_data" getter="get_font_data"> The font data. </member> <member name="outline_color" type="Color" setter="set_outline_color" getter="get_outline_color" default="Color( 1, 1, 1, 1 )"> diff --git a/doc/classes/Engine.xml b/doc/classes/Engine.xml index 60a807c304..187e13d7bd 100644 --- a/doc/classes/Engine.xml +++ b/doc/classes/Engine.xml @@ -72,6 +72,13 @@ Returns the main loop object (see [MainLoop] and [SceneTree]). </description> </method> + <method name="get_physics_interpolation_fraction" qualifiers="const"> + <return type="float"> + </return> + <description> + Returns the fraction through the current physics tick we are at the time of rendering the frame. This can be used to implement fixed timestep interpolation. + </description> + </method> <method name="get_singleton" qualifiers="const"> <return type="Object"> </return> diff --git a/doc/classes/Environment.xml b/doc/classes/Environment.xml index 613c5b6563..cc3d5a1139 100644 --- a/doc/classes/Environment.xml +++ b/doc/classes/Environment.xml @@ -38,7 +38,7 @@ <member name="adjustment_brightness" type="float" setter="set_adjustment_brightness" getter="get_adjustment_brightness" default="1.0"> Global brightness value of the rendered scene (default value is 1). </member> - <member name="adjustment_color_correction" type="Texture" setter="set_adjustment_color_correction" getter="get_adjustment_color_correction" default="null"> + <member name="adjustment_color_correction" type="Texture" setter="set_adjustment_color_correction" getter="get_adjustment_color_correction"> Applies the provided [Texture] resource to affect the global color aspect of the rendered scene. </member> <member name="adjustment_contrast" type="float" setter="set_adjustment_contrast" getter="get_adjustment_contrast" default="1.0"> @@ -89,7 +89,7 @@ <member name="background_mode" type="int" setter="set_background" getter="get_background" enum="Environment.BGMode" default="0"> Defines the mode of background. </member> - <member name="background_sky" type="Sky" setter="set_sky" getter="get_sky" default="null"> + <member name="background_sky" type="Sky" setter="set_sky" getter="get_sky"> [Sky] resource defined as background. </member> <member name="background_sky_custom_fov" type="float" setter="set_sky_custom_fov" getter="get_sky_custom_fov" default="0.0"> diff --git a/doc/classes/GIProbe.xml b/doc/classes/GIProbe.xml index 6f672bd01a..a9192d1942 100644 --- a/doc/classes/GIProbe.xml +++ b/doc/classes/GIProbe.xml @@ -30,7 +30,7 @@ </member> <member name="compress" type="bool" setter="set_compress" getter="is_compressed" default="false"> </member> - <member name="data" type="GIProbeData" setter="set_probe_data" getter="get_probe_data" default="null"> + <member name="data" type="GIProbeData" setter="set_probe_data" getter="get_probe_data"> </member> <member name="dynamic_range" type="int" setter="set_dynamic_range" getter="get_dynamic_range" default="4"> </member> diff --git a/doc/classes/GeometryInstance.xml b/doc/classes/GeometryInstance.xml index 49c1ce480f..b108e1be7c 100644 --- a/doc/classes/GeometryInstance.xml +++ b/doc/classes/GeometryInstance.xml @@ -56,7 +56,7 @@ <member name="lod_min_hysteresis" type="float" setter="set_lod_min_hysteresis" getter="get_lod_min_hysteresis" default="0.0"> The GeometryInstance's min LOD margin. </member> - <member name="material_override" type="Material" setter="set_material_override" getter="get_material_override" default="null"> + <member name="material_override" type="Material" setter="set_material_override" getter="get_material_override"> The material override for the whole geometry. If there is a material in [code]material_override[/code], it will be used instead of any material set in any material slot of the mesh. </member> diff --git a/doc/classes/GradientTexture.xml b/doc/classes/GradientTexture.xml index ef46491e02..3492b2e261 100644 --- a/doc/classes/GradientTexture.xml +++ b/doc/classes/GradientTexture.xml @@ -11,7 +11,7 @@ <methods> </methods> <members> - <member name="gradient" type="Gradient" setter="set_gradient" getter="get_gradient" default="null"> + <member name="gradient" type="Gradient" setter="set_gradient" getter="get_gradient"> The [Gradient] that will be used to fill the texture. </member> <member name="width" type="int" setter="set_width" getter="get_width" default="2048"> diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml index 65d5fbedc3..8cd69ba0da 100644 --- a/doc/classes/Image.xml +++ b/doc/classes/Image.xml @@ -469,13 +469,7 @@ </method> </methods> <members> - <member name="data" type="Dictionary" setter="_set_data" getter="_get_data" default="{ -"data": PoolByteArray( ), -"format": "Lum8", -"height": 0, -"mipmaps": false, -"width": 0 -}"> + <member name="data" type="Dictionary" setter="_set_data" getter="_get_data" default="{"data": PoolByteArray( ),"format": "Lum8","height": 0,"mipmaps": false,"width": 0}"> Holds all of the image's color data in a given format. See [code]FORMAT_*[/code] constants. </member> </members> diff --git a/doc/classes/InputEvent.xml b/doc/classes/InputEvent.xml index f2c00908f6..4c8d83adba 100644 --- a/doc/classes/InputEvent.xml +++ b/doc/classes/InputEvent.xml @@ -17,6 +17,8 @@ <argument index="0" name="with_event" type="InputEvent"> </argument> <description> + Returns [code]true[/code] if the given input event and this input event can be added together (only for events of type [InputEventMouseMotion]). + The given input event's position, global position and speed will be copied. The resulting [code]relative[/code] is a sum of both events. Both events' modifiers have to be identical. </description> </method> <method name="as_text" qualifiers="const"> @@ -32,6 +34,7 @@ <argument index="0" name="action" type="String"> </argument> <description> + Returns a value between 0.0 and 1.0 depending on the given actions' state. Useful for getting the value of events of type [InputEventJoypadMotion]. </description> </method> <method name="is_action" qualifiers="const"> @@ -88,6 +91,7 @@ <argument index="0" name="event" type="InputEvent"> </argument> <description> + Returns [code]true[/code] if the given input event is checking for the same key ([InputEventKey]), button ([InputEventJoypadButton]) or action ([InputEventAction]). </description> </method> <method name="xformed_by" qualifiers="const"> @@ -98,6 +102,7 @@ <argument index="1" name="local_ofs" type="Vector2" default="Vector2( 0, 0 )"> </argument> <description> + Returns a copy of the given input event which has been offset by [code]local_ofs[/code] and transformed by [code]xform[/code]. Relevant for events of type [InputEventMouseButton], [InputEventMouseMotion], [InputEventScreenTouch], [InputEventScreenDrag], [InputEventMagnifyGesture] and [InputEventPanGesture]. </description> </method> </methods> diff --git a/doc/classes/KinematicCollision.xml b/doc/classes/KinematicCollision.xml index 4ce28b25c9..44447c8fc8 100644 --- a/doc/classes/KinematicCollision.xml +++ b/doc/classes/KinematicCollision.xml @@ -12,7 +12,7 @@ <methods> </methods> <members> - <member name="collider" type="Object" setter="" getter="get_collider" default="null"> + <member name="collider" type="Object" setter="" getter="get_collider"> The colliding body. </member> <member name="collider_id" type="int" setter="" getter="get_collider_id" default="0"> @@ -21,7 +21,7 @@ <member name="collider_metadata" type="Variant" setter="" getter="get_collider_metadata"> The colliding body's metadata. See [Object]. </member> - <member name="collider_shape" type="Object" setter="" getter="get_collider_shape" default="null"> + <member name="collider_shape" type="Object" setter="" getter="get_collider_shape"> The colliding body's shape. </member> <member name="collider_shape_index" type="int" setter="" getter="get_collider_shape_index" default="0"> @@ -30,7 +30,7 @@ <member name="collider_velocity" type="Vector3" setter="" getter="get_collider_velocity" default="Vector3( 0, 0, 0 )"> The colliding object's velocity. </member> - <member name="local_shape" type="Object" setter="" getter="get_local_shape" default="null"> + <member name="local_shape" type="Object" setter="" getter="get_local_shape"> The moving object's colliding shape. </member> <member name="normal" type="Vector3" setter="" getter="get_normal" default="Vector3( 0, 0, 0 )"> diff --git a/doc/classes/KinematicCollision2D.xml b/doc/classes/KinematicCollision2D.xml index 91cee3d05a..51c2277fb2 100644 --- a/doc/classes/KinematicCollision2D.xml +++ b/doc/classes/KinematicCollision2D.xml @@ -12,7 +12,7 @@ <methods> </methods> <members> - <member name="collider" type="Object" setter="" getter="get_collider" default="null"> + <member name="collider" type="Object" setter="" getter="get_collider"> The colliding body. </member> <member name="collider_id" type="int" setter="" getter="get_collider_id" default="0"> @@ -21,7 +21,7 @@ <member name="collider_metadata" type="Variant" setter="" getter="get_collider_metadata"> The colliding body's metadata. See [Object]. </member> - <member name="collider_shape" type="Object" setter="" getter="get_collider_shape" default="null"> + <member name="collider_shape" type="Object" setter="" getter="get_collider_shape"> The colliding body's shape. </member> <member name="collider_shape_index" type="int" setter="" getter="get_collider_shape_index" default="0"> @@ -30,7 +30,7 @@ <member name="collider_velocity" type="Vector2" setter="" getter="get_collider_velocity" default="Vector2( 0, 0 )"> The colliding object's velocity. </member> - <member name="local_shape" type="Object" setter="" getter="get_local_shape" default="null"> + <member name="local_shape" type="Object" setter="" getter="get_local_shape"> The moving object's colliding shape. </member> <member name="normal" type="Vector2" setter="" getter="get_normal" default="Vector2( 0, 0 )"> diff --git a/doc/classes/Light2D.xml b/doc/classes/Light2D.xml index 88ad371983..f61be5a5af 100644 --- a/doc/classes/Light2D.xml +++ b/doc/classes/Light2D.xml @@ -70,7 +70,7 @@ <member name="shadow_item_cull_mask" type="int" setter="set_item_shadow_cull_mask" getter="get_item_shadow_cull_mask" default="1"> The shadow mask. Used with [LightOccluder2D] to cast shadows. Only occluders with a matching shadow mask will cast shadows. </member> - <member name="texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> [Texture] used for the Light2D's appearance. </member> <member name="texture_scale" type="float" setter="set_texture_scale" getter="get_texture_scale" default="1.0"> diff --git a/doc/classes/LightOccluder2D.xml b/doc/classes/LightOccluder2D.xml index 55978aa0a1..c7d52e6ef4 100644 --- a/doc/classes/LightOccluder2D.xml +++ b/doc/classes/LightOccluder2D.xml @@ -15,7 +15,7 @@ <member name="light_mask" type="int" setter="set_occluder_light_mask" getter="get_occluder_light_mask" default="1"> The LightOccluder2D's light mask. The LightOccluder2D will cast shadows only from Light2D(s) that have the same light mask(s). </member> - <member name="occluder" type="OccluderPolygon2D" setter="set_occluder_polygon" getter="get_occluder_polygon" default="null"> + <member name="occluder" type="OccluderPolygon2D" setter="set_occluder_polygon" getter="get_occluder_polygon"> The [OccluderPolygon2D] used to compute the shadow. </member> </members> diff --git a/doc/classes/Line2D.xml b/doc/classes/Line2D.xml index 106c736147..3cb04b8b89 100644 --- a/doc/classes/Line2D.xml +++ b/doc/classes/Line2D.xml @@ -75,7 +75,7 @@ <member name="end_cap_mode" type="int" setter="set_end_cap_mode" getter="get_end_cap_mode" enum="Line2D.LineCapMode" default="0"> Controls the style of the line's last point. Use [code]LINE_CAP_*[/code] constants. </member> - <member name="gradient" type="Gradient" setter="set_gradient" getter="get_gradient" default="null"> + <member name="gradient" type="Gradient" setter="set_gradient" getter="get_gradient"> The gradient is drawn through the whole line from start to finish. The default color will not be used if a gradient is set. </member> <member name="joint_mode" type="int" setter="set_joint_mode" getter="get_joint_mode" enum="Line2D.LineJointMode" default="0"> @@ -90,7 +90,7 @@ <member name="sharp_limit" type="float" setter="set_sharp_limit" getter="get_sharp_limit" default="2.0"> The direction difference in radians between vector points. This value is only used if [code]joint mode[/code] is set to [constant LINE_JOINT_SHARP]. </member> - <member name="texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> The texture used for the line's texture. Uses [code]texture_mode[/code] for drawing style. </member> <member name="texture_mode" type="int" setter="set_texture_mode" getter="get_texture_mode" enum="Line2D.LineTextureMode" default="0"> @@ -99,7 +99,7 @@ <member name="width" type="float" setter="set_width" getter="get_width" default="10.0"> The line's width. </member> - <member name="width_curve" type="Curve" setter="set_curve" getter="get_curve" default="null"> + <member name="width_curve" type="Curve" setter="set_curve" getter="get_curve"> The line's width varies with the curve. The original width is simply multiply by the value of the Curve. </member> </members> diff --git a/doc/classes/Material.xml b/doc/classes/Material.xml index 80d8b674f3..f584c5207a 100644 --- a/doc/classes/Material.xml +++ b/doc/classes/Material.xml @@ -11,7 +11,7 @@ <methods> </methods> <members> - <member name="next_pass" type="Material" setter="set_next_pass" getter="get_next_pass" default="null"> + <member name="next_pass" type="Material" setter="set_next_pass" getter="get_next_pass"> </member> <member name="render_priority" type="int" setter="set_render_priority" getter="get_render_priority" default="0"> </member> diff --git a/doc/classes/MeshInstance.xml b/doc/classes/MeshInstance.xml index e7dbb8e017..c577635c98 100644 --- a/doc/classes/MeshInstance.xml +++ b/doc/classes/MeshInstance.xml @@ -59,7 +59,7 @@ </method> </methods> <members> - <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh" default="null"> + <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh"> The [Mesh] resource for the instance. </member> <member name="skeleton" type="NodePath" setter="set_skeleton_path" getter="get_skeleton_path" default="NodePath("..")"> diff --git a/doc/classes/MeshInstance2D.xml b/doc/classes/MeshInstance2D.xml index a44b009fb6..4b38b9aa96 100644 --- a/doc/classes/MeshInstance2D.xml +++ b/doc/classes/MeshInstance2D.xml @@ -12,13 +12,13 @@ <methods> </methods> <members> - <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh" default="null"> + <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh"> The [Mesh] that will be drawn by the [MeshInstance2D]. </member> - <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map" default="null"> + <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map"> The normal map that will be used if using the default [CanvasItemMaterial]. </member> - <member name="texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> The [Texture] that will be used if using the default [CanvasItemMaterial]. Can be accessed as [code]TEXTURE[/code] in CanvasItem shader. </member> </members> diff --git a/doc/classes/MeshTexture.xml b/doc/classes/MeshTexture.xml index 4ec8268cc5..f8e02d1851 100644 --- a/doc/classes/MeshTexture.xml +++ b/doc/classes/MeshTexture.xml @@ -11,13 +11,13 @@ <methods> </methods> <members> - <member name="base_texture" type="Texture" setter="set_base_texture" getter="get_base_texture" default="null"> + <member name="base_texture" type="Texture" setter="set_base_texture" getter="get_base_texture"> Sets the base texture that the Mesh will use to draw. </member> <member name="image_size" type="Vector2" setter="set_image_size" getter="get_image_size" default="Vector2( 0, 0 )"> Sets the size of the image, needed for reference. </member> - <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh" default="null"> + <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh"> Sets the mesh used to draw. It must be a mesh using 2D vertices. </member> </members> diff --git a/doc/classes/MultiMesh.xml b/doc/classes/MultiMesh.xml index 295f23a92c..8a72aa155b 100644 --- a/doc/classes/MultiMesh.xml +++ b/doc/classes/MultiMesh.xml @@ -123,7 +123,7 @@ <member name="instance_count" type="int" setter="set_instance_count" getter="get_instance_count" default="0"> Number of instances that will get drawn. This clears and (re)sizes the buffers. By default, all instances are drawn but you can limit this with [member visible_instance_count]. </member> - <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh" default="null"> + <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh"> Mesh to be drawn. </member> <member name="transform_format" type="int" setter="set_transform_format" getter="get_transform_format" enum="MultiMesh.TransformFormat" default="0"> diff --git a/doc/classes/MultiMeshInstance.xml b/doc/classes/MultiMeshInstance.xml index 5e8cb83a39..16f16fdc8b 100644 --- a/doc/classes/MultiMeshInstance.xml +++ b/doc/classes/MultiMeshInstance.xml @@ -14,7 +14,7 @@ <methods> </methods> <members> - <member name="multimesh" type="MultiMesh" setter="set_multimesh" getter="get_multimesh" default="null"> + <member name="multimesh" type="MultiMesh" setter="set_multimesh" getter="get_multimesh"> The [MultiMesh] resource that will be used and shared among all instances of the [MultiMeshInstance]. </member> </members> diff --git a/doc/classes/MultiMeshInstance2D.xml b/doc/classes/MultiMeshInstance2D.xml index 28cee1aeba..8509986c3c 100644 --- a/doc/classes/MultiMeshInstance2D.xml +++ b/doc/classes/MultiMeshInstance2D.xml @@ -12,13 +12,13 @@ <methods> </methods> <members> - <member name="multimesh" type="MultiMesh" setter="set_multimesh" getter="get_multimesh" default="null"> + <member name="multimesh" type="MultiMesh" setter="set_multimesh" getter="get_multimesh"> The [MultiMesh] that will be drawn by the [MultiMeshInstance2D]. </member> - <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map" default="null"> + <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map"> The normal map that will be used if using the default [CanvasItemMaterial]. </member> - <member name="texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> The [Texture] that will be used if using the default [CanvasItemMaterial]. Can be accessed as [code]TEXTURE[/code] in CanvasItem shader. </member> </members> diff --git a/doc/classes/NavigationMeshInstance.xml b/doc/classes/NavigationMeshInstance.xml index a6266aac0a..2f9cc58aea 100644 --- a/doc/classes/NavigationMeshInstance.xml +++ b/doc/classes/NavigationMeshInstance.xml @@ -11,7 +11,7 @@ <members> <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" default="true"> </member> - <member name="navmesh" type="NavigationMesh" setter="set_navigation_mesh" getter="get_navigation_mesh" default="null"> + <member name="navmesh" type="NavigationMesh" setter="set_navigation_mesh" getter="get_navigation_mesh"> </member> </members> <constants> diff --git a/doc/classes/NavigationPolygonInstance.xml b/doc/classes/NavigationPolygonInstance.xml index 26cc7fbf31..83f3386af6 100644 --- a/doc/classes/NavigationPolygonInstance.xml +++ b/doc/classes/NavigationPolygonInstance.xml @@ -11,7 +11,7 @@ <members> <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" default="true"> </member> - <member name="navpoly" type="NavigationPolygon" setter="set_navigation_polygon" getter="get_navigation_polygon" default="null"> + <member name="navpoly" type="NavigationPolygon" setter="set_navigation_polygon" getter="get_navigation_polygon"> </member> </members> <constants> diff --git a/doc/classes/NinePatchRect.xml b/doc/classes/NinePatchRect.xml index c50c1b6079..f191b08d96 100644 --- a/doc/classes/NinePatchRect.xml +++ b/doc/classes/NinePatchRect.xml @@ -53,7 +53,7 @@ <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2( 0, 0, 0, 0 )"> Rectangular region of the texture to sample from. If you're working with an atlas, use this property to define the area the 9-slice should use. All other properties are relative to this one. </member> - <member name="texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> The node's texture resource. </member> </members> diff --git a/doc/classes/PackedScene.xml b/doc/classes/PackedScene.xml index f01ef78c02..0400f2704b 100644 --- a/doc/classes/PackedScene.xml +++ b/doc/classes/PackedScene.xml @@ -65,17 +65,7 @@ </method> </methods> <members> - <member name="_bundled" type="Dictionary" setter="_set_bundled_scene" getter="_get_bundled_scene" default="{ -"conn_count": 0, -"conns": PoolIntArray( ), -"editable_instances": [ ], -"names": PoolStringArray( ), -"node_count": 0, -"node_paths": [ ], -"nodes": PoolIntArray( ), -"variants": [ ], -"version": 2 -}"> + <member name="_bundled" type="Dictionary" setter="_set_bundled_scene" getter="_get_bundled_scene" default="{"conn_count": 0,"conns": PoolIntArray( ),"editable_instances": [ ],"names": PoolStringArray( ),"node_count": 0,"node_paths": [ ],"nodes": PoolIntArray( ),"variants": [ ],"version": 2}"> A dictionary representation of the scene contents. Available keys include "rnames" and "variants" for resources, "node_count", "nodes", "node_paths" for nodes, "editable_instances" for base scene children overrides, "conn_count" and "conns" for signal connections, and "version" for the format style of the PackedScene. </member> diff --git a/doc/classes/PanoramaSky.xml b/doc/classes/PanoramaSky.xml index 93a8bc6166..96aefc0623 100644 --- a/doc/classes/PanoramaSky.xml +++ b/doc/classes/PanoramaSky.xml @@ -11,7 +11,7 @@ <methods> </methods> <members> - <member name="panorama" type="Texture" setter="set_panorama" getter="get_panorama" default="null"> + <member name="panorama" type="Texture" setter="set_panorama" getter="get_panorama"> [Texture] to be applied to the PanoramaSky. </member> </members> diff --git a/doc/classes/Particles.xml b/doc/classes/Particles.xml index 3b9a0554e8..fb74c5a3d4 100644 --- a/doc/classes/Particles.xml +++ b/doc/classes/Particles.xml @@ -51,7 +51,7 @@ <member name="draw_order" type="int" setter="set_draw_order" getter="get_draw_order" enum="Particles.DrawOrder" default="0"> Particle draw order. Uses [code]DRAW_ORDER_*[/code] values. </member> - <member name="draw_pass_1" type="Mesh" setter="set_draw_pass_mesh" getter="get_draw_pass_mesh" default="null"> + <member name="draw_pass_1" type="Mesh" setter="set_draw_pass_mesh" getter="get_draw_pass_mesh"> [Mesh] that is drawn for the first draw pass. </member> <member name="draw_pass_2" type="Mesh" setter="set_draw_pass_mesh" getter="get_draw_pass_mesh"> @@ -90,7 +90,7 @@ <member name="preprocess" type="float" setter="set_pre_process_time" getter="get_pre_process_time" default="0.0"> Amount of time to preprocess the particles before animation starts. Lets you start the animation some time after particles have started emitting. </member> - <member name="process_material" type="Material" setter="set_process_material" getter="get_process_material" default="null"> + <member name="process_material" type="Material" setter="set_process_material" getter="get_process_material"> [Material] for processing particles. Can be a [ParticlesMaterial] or a [ShaderMaterial]. </member> <member name="randomness" type="float" setter="set_randomness_ratio" getter="get_randomness_ratio" default="0.0"> diff --git a/doc/classes/Particles2D.xml b/doc/classes/Particles2D.xml index 52b0c846ca..7c7b42ce88 100644 --- a/doc/classes/Particles2D.xml +++ b/doc/classes/Particles2D.xml @@ -51,7 +51,7 @@ <member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates" default="true"> If [code]true[/code], particles use the parent node's coordinate space. If [code]false[/code], they use global coordinates. </member> - <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map" default="null"> + <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map"> Normal map to be used for the [member texture] property. </member> <member name="one_shot" type="bool" setter="set_one_shot" getter="get_one_shot" default="false"> @@ -60,7 +60,7 @@ <member name="preprocess" type="float" setter="set_pre_process_time" getter="get_pre_process_time" default="0.0"> Particle system starts as if it had already run for this many seconds. </member> - <member name="process_material" type="Material" setter="set_process_material" getter="get_process_material" default="null"> + <member name="process_material" type="Material" setter="set_process_material" getter="get_process_material"> [Material] for processing particles. Can be a [ParticlesMaterial] or a [ShaderMaterial]. </member> <member name="randomness" type="float" setter="set_randomness_ratio" getter="get_randomness_ratio" default="0.0"> @@ -69,7 +69,7 @@ <member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale" default="1.0"> Particle system's running speed scaling ratio. A value of [code]0[/code] can be used to pause the particles. </member> - <member name="texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> Particle texture. If [code]null[/code], particles will be squares. </member> <member name="visibility_rect" type="Rect2" setter="set_visibility_rect" getter="get_visibility_rect" default="Rect2( -100, -100, 200, 200 )"> diff --git a/doc/classes/ParticlesMaterial.xml b/doc/classes/ParticlesMaterial.xml index 624a8d4dc5..64751cdf76 100644 --- a/doc/classes/ParticlesMaterial.xml +++ b/doc/classes/ParticlesMaterial.xml @@ -89,7 +89,7 @@ Initial rotation applied to each particle, in degrees. Only applied when [member flag_disable_z] or [member flag_rotate_y] are [code]true[/code] or the [SpatialMaterial] being used to draw the particle is using [constant SpatialMaterial.BILLBOARD_PARTICLES]. </member> - <member name="angle_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" default="null"> + <member name="angle_curve" type="Texture" setter="set_param_texture" getter="get_param_texture"> Each particle's rotation will be animated along this [CurveTexture]. </member> <member name="angle_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -99,7 +99,7 @@ Initial angular velocity applied to each particle. Sets the speed of rotation of the particle. Only applied when [member flag_disable_z] or [member flag_rotate_y] are [code]true[/code] or the [SpatialMaterial] being used to draw the particle is using [constant SpatialMaterial.BILLBOARD_PARTICLES]. </member> - <member name="angular_velocity_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" default="null"> + <member name="angular_velocity_curve" type="Texture" setter="set_param_texture" getter="get_param_texture"> Each particle's angular velocity will vary along this [CurveTexture]. </member> <member name="angular_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -108,7 +108,7 @@ <member name="anim_offset" type="float" setter="set_param" getter="get_param" default="0.0"> Particle animation offset. </member> - <member name="anim_offset_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" default="null"> + <member name="anim_offset_curve" type="Texture" setter="set_param_texture" getter="get_param_texture"> Each particle's animation offset will vary along this [CurveTexture]. </member> <member name="anim_offset_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -117,7 +117,7 @@ <member name="anim_speed" type="float" setter="set_param" getter="get_param" default="0.0"> Particle animation speed. </member> - <member name="anim_speed_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" default="null"> + <member name="anim_speed_curve" type="Texture" setter="set_param_texture" getter="get_param_texture"> Each particle's animation speed will vary along this [CurveTexture]. </member> <member name="anim_speed_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -126,13 +126,13 @@ <member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )"> Each particle's initial color. If the [Particles2D]'s [code]texture[/code] is defined, it will be multiplied by this color. To have particle display color in a [SpatialMaterial] make sure to set [member SpatialMaterial.vertex_color_use_as_albedo] to [code]true[/code]. </member> - <member name="color_ramp" type="Texture" setter="set_color_ramp" getter="get_color_ramp" default="null"> + <member name="color_ramp" type="Texture" setter="set_color_ramp" getter="get_color_ramp"> Each particle's color will vary along this [GradientTexture]. </member> <member name="damping" type="float" setter="set_param" getter="get_param" default="0.0"> The rate at which particles lose velocity. </member> - <member name="damping_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" default="null"> + <member name="damping_curve" type="Texture" setter="set_param_texture" getter="get_param_texture"> Damping will vary along this [CurveTexture]. </member> <member name="damping_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -180,7 +180,7 @@ <member name="hue_variation" type="float" setter="set_param" getter="get_param" default="0.0"> Initial hue variation applied to each particle. </member> - <member name="hue_variation_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" default="null"> + <member name="hue_variation_curve" type="Texture" setter="set_param_texture" getter="get_param_texture"> Each particle's hue will vary along this [CurveTexture]. </member> <member name="hue_variation_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -192,10 +192,13 @@ <member name="initial_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> Initial velocity randomness ratio. </member> + <member name="lifetime_randomness" type="float" setter="set_lifetime_randomness" getter="get_lifetime_randomness" default="0.0"> + Particle lifetime randomness ratio. + </member> <member name="linear_accel" type="float" setter="set_param" getter="get_param" default="0.0"> Linear acceleration applied to each particle in the direction of motion. </member> - <member name="linear_accel_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" default="null"> + <member name="linear_accel_curve" type="Texture" setter="set_param_texture" getter="get_param_texture"> Each particle's linear acceleration will vary along this [CurveTexture]. </member> <member name="linear_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -214,7 +217,7 @@ <member name="radial_accel" type="float" setter="set_param" getter="get_param" default="0.0"> Radial acceleration applied to each particle. Makes particle accelerate away from origin. </member> - <member name="radial_accel_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" default="null"> + <member name="radial_accel_curve" type="Texture" setter="set_param_texture" getter="get_param_texture"> Each particle's radial acceleration will vary along this [CurveTexture]. </member> <member name="radial_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -223,7 +226,7 @@ <member name="scale" type="float" setter="set_param" getter="get_param" default="1.0"> Initial scale applied to each particle. </member> - <member name="scale_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" default="null"> + <member name="scale_curve" type="Texture" setter="set_param_texture" getter="get_param_texture"> Each particle's scale will vary along this [CurveTexture]. </member> <member name="scale_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> @@ -235,19 +238,19 @@ <member name="tangential_accel" type="float" setter="set_param" getter="get_param" default="0.0"> Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. </member> - <member name="tangential_accel_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" default="null"> + <member name="tangential_accel_curve" type="Texture" setter="set_param_texture" getter="get_param_texture"> Each particle's tangential acceleration will vary along this [CurveTexture]. </member> <member name="tangential_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" default="0.0"> Tangential acceleration randomness ratio. </member> - <member name="trail_color_modifier" type="GradientTexture" setter="set_trail_color_modifier" getter="get_trail_color_modifier" default="null"> + <member name="trail_color_modifier" type="GradientTexture" setter="set_trail_color_modifier" getter="get_trail_color_modifier"> Trail particles' color will vary along this [GradientTexture]. </member> <member name="trail_divisor" type="int" setter="set_trail_divisor" getter="get_trail_divisor" default="1"> Emitter will emit [code]amount[/code] divided by [code]trail_divisor[/code] particles. The remaining particles will be used as trail(s). </member> - <member name="trail_size_modifier" type="CurveTexture" setter="set_trail_size_modifier" getter="get_trail_size_modifier" default="null"> + <member name="trail_size_modifier" type="CurveTexture" setter="set_trail_size_modifier" getter="get_trail_size_modifier"> Trail particles' size will vary along this [CurveTexture]. </member> </members> diff --git a/doc/classes/Path.xml b/doc/classes/Path.xml index 5c1100e670..12ae8fd3d5 100644 --- a/doc/classes/Path.xml +++ b/doc/classes/Path.xml @@ -12,11 +12,7 @@ <methods> </methods> <members> - <member name="curve" type="Curve3D" setter="set_curve" getter="get_curve" default="Object(Curve3D,"resource_local_to_scene":false,"resource_name":"","bake_interval":0.2,"_data":{ -"points": PoolVector3Array( ), -"tilts": PoolRealArray( ) -},"up_vector_enabled":true,"script":null) -"> + <member name="curve" type="Curve3D" setter="set_curve" getter="get_curve"> A [Curve3D] describing the path. </member> </members> diff --git a/doc/classes/Path2D.xml b/doc/classes/Path2D.xml index 960cd5163d..b49a3d928d 100644 --- a/doc/classes/Path2D.xml +++ b/doc/classes/Path2D.xml @@ -12,10 +12,7 @@ <methods> </methods> <members> - <member name="curve" type="Curve2D" setter="set_curve" getter="get_curve" default="Object(Curve2D,"resource_local_to_scene":false,"resource_name":"","bake_interval":5.0,"_data":{ -"points": PoolVector2Array( ) -},"script":null) -"> + <member name="curve" type="Curve2D" setter="set_curve" getter="get_curve"> A [Curve2D] describing the path. </member> </members> diff --git a/doc/classes/Physics2DTestMotionResult.xml b/doc/classes/Physics2DTestMotionResult.xml index 410bffc0f0..752b50922d 100644 --- a/doc/classes/Physics2DTestMotionResult.xml +++ b/doc/classes/Physics2DTestMotionResult.xml @@ -9,7 +9,7 @@ <methods> </methods> <members> - <member name="collider" type="Object" setter="" getter="get_collider" default="null"> + <member name="collider" type="Object" setter="" getter="get_collider"> </member> <member name="collider_id" type="int" setter="" getter="get_collider_id" default="0"> </member> diff --git a/doc/classes/Polygon2D.xml b/doc/classes/Polygon2D.xml index 6fc0d76d02..7c2aa468ab 100644 --- a/doc/classes/Polygon2D.xml +++ b/doc/classes/Polygon2D.xml @@ -104,7 +104,7 @@ </member> <member name="skeleton" type="NodePath" setter="set_skeleton" getter="get_skeleton" default="NodePath("")"> </member> - <member name="texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> The polygon's fill texture. Use [code]uv[/code] to set texture coordinates. </member> <member name="texture_offset" type="Vector2" setter="set_texture_offset" getter="get_texture_offset" default="Vector2( 0, 0 )"> diff --git a/doc/classes/PrimitiveMesh.xml b/doc/classes/PrimitiveMesh.xml index 83d4dea5b1..b0e69bd089 100644 --- a/doc/classes/PrimitiveMesh.xml +++ b/doc/classes/PrimitiveMesh.xml @@ -24,7 +24,7 @@ <member name="flip_faces" type="bool" setter="set_flip_faces" getter="get_flip_faces" default="false"> If set, the order of the vertices in each triangle are reversed resulting in the backside of the mesh being drawn. Result is the same as using *CULL_BACK* in [SpatialMaterial]. </member> - <member name="material" type="Material" setter="set_material" getter="get_material" default="null"> + <member name="material" type="Material" setter="set_material" getter="get_material"> The current [Material] of the primitive mesh. </member> </members> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 22dae4fe71..7ab29e67ae 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -434,92 +434,31 @@ <member name="gui/timers/text_edit_idle_detect_sec" type="float" setter="" getter="" default="3"> Timer for detecting idle in the editor (in seconds). </member> - <member name="input/ui_accept" type="Dictionary" setter="" getter="" default="{ -"deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777221,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777222,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null) - ] -}"> - </member> - <member name="input/ui_cancel" type="Dictionary" setter="" getter="" default="{ -"deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"unicode":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":1,"pressure":0.0,"pressed":false,"script":null) - ] -}"> - </member> - <member name="input/ui_down" type="Dictionary" setter="" getter="" default="{ -"deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"unicode":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null) - ] -}"> - </member> - <member name="input/ui_end" type="Dictionary" setter="" getter="" default="{ -"deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777230,"unicode":0,"echo":false,"script":null) - ] -}"> - </member> - <member name="input/ui_focus_next" type="Dictionary" setter="" getter="" default="{ -"deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777218,"unicode":0,"echo":false,"script":null) - ] -}"> - </member> - <member name="input/ui_focus_prev" type="Dictionary" setter="" getter="" default="{ -"deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":true,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777218,"unicode":0,"echo":false,"script":null) - ] -}"> - </member> - <member name="input/ui_home" type="Dictionary" setter="" getter="" default="{ -"deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777229,"unicode":0,"echo":false,"script":null) - ] -}"> - </member> - <member name="input/ui_left" type="Dictionary" setter="" getter="" default="{ -"deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null) - ] -}"> - </member> - <member name="input/ui_page_down" type="Dictionary" setter="" getter="" default="{ -"deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777236,"unicode":0,"echo":false,"script":null) - ] -}"> - </member> - <member name="input/ui_page_up" type="Dictionary" setter="" getter="" default="{ -"deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777235,"unicode":0,"echo":false,"script":null) - ] -}"> - </member> - <member name="input/ui_right" type="Dictionary" setter="" getter="" default="{ -"deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null) - ] -}"> - </member> - <member name="input/ui_select" type="Dictionary" setter="" getter="" default="{ -"deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":3,"pressure":0.0,"pressed":false,"script":null) - ] -}"> - </member> - <member name="input/ui_up" type="Dictionary" setter="" getter="" default="{ -"deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null) - ] -}"> + <member name="input/ui_accept" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777221,"unicode":0,"echo":false,"script":null), Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777222,"unicode":0,"echo":false,"script":null), Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null), Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null) ]}"> + </member> + <member name="input/ui_cancel" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"unicode":0,"echo":false,"script":null), Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":1,"pressure":0.0,"pressed":false,"script":null) ]}"> + </member> + <member name="input/ui_down" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"unicode":0,"echo":false,"script":null), Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null) ]}"> + </member> + <member name="input/ui_end" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777230,"unicode":0,"echo":false,"script":null) ]}"> + </member> + <member name="input/ui_focus_next" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777218,"unicode":0,"echo":false,"script":null) ]}"> + </member> + <member name="input/ui_focus_prev" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":true,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777218,"unicode":0,"echo":false,"script":null) ]}"> + </member> + <member name="input/ui_home" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777229,"unicode":0,"echo":false,"script":null) ]}"> + </member> + <member name="input/ui_left" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null), Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null) ]}"> + </member> + <member name="input/ui_page_down" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777236,"unicode":0,"echo":false,"script":null) ]}"> + </member> + <member name="input/ui_page_up" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777235,"unicode":0,"echo":false,"script":null) ]}"> + </member> + <member name="input/ui_right" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null), Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null) ]}"> + </member> + <member name="input/ui_select" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null), Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":3,"pressure":0.0,"pressed":false,"script":null) ]}"> + </member> + <member name="input/ui_up" type="Dictionary" setter="" getter="" default="{"deadzone": 0.5,"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null), Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null) ]}"> </member> <member name="input_devices/pointing/emulate_mouse_from_touch" type="bool" setter="" getter="" default="true"> If [code]true[/code], sends mouse input events when tapping or swiping on the touchscreen. @@ -907,7 +846,7 @@ <member name="rendering/vram_compression/import_s3tc" type="bool" setter="" getter="" default="true"> If [code]true[/code], the texture importer will import VRAM-compressed textures using the S3 Texture Compression algorithm. This algorithm is only supported on desktop platforms and consoles. </member> - <member name="script" type="Script" setter="" getter="" default="null"> + <member name="script" type="Script" setter="" getter=""> </member> </members> <constants> diff --git a/doc/classes/ProxyTexture.xml b/doc/classes/ProxyTexture.xml index d403196022..a36f670c42 100644 --- a/doc/classes/ProxyTexture.xml +++ b/doc/classes/ProxyTexture.xml @@ -9,7 +9,7 @@ <methods> </methods> <members> - <member name="base" type="Texture" setter="set_base" getter="get_base" default="null"> + <member name="base" type="Texture" setter="set_base" getter="get_base"> </member> </members> <constants> diff --git a/doc/classes/RigidBody.xml b/doc/classes/RigidBody.xml index 07eed6bb34..4378fc3ffe 100644 --- a/doc/classes/RigidBody.xml +++ b/doc/classes/RigidBody.xml @@ -182,7 +182,7 @@ <member name="mode" type="int" setter="set_mode" getter="get_mode" enum="RigidBody.Mode" default="0"> The body mode. See [enum Mode] for possible values. </member> - <member name="physics_material_override" type="PhysicsMaterial" setter="set_physics_material_override" getter="get_physics_material_override" default="null"> + <member name="physics_material_override" type="PhysicsMaterial" setter="set_physics_material_override" getter="get_physics_material_override"> </member> <member name="sleeping" type="bool" setter="set_sleeping" getter="is_sleeping" default="false"> If [code]true[/code], the body is sleeping and will not calculate forces until woken up by a collision or the [code]apply_impulse[/code] method. diff --git a/doc/classes/RigidBody2D.xml b/doc/classes/RigidBody2D.xml index 907a82d51d..f280dc81c2 100644 --- a/doc/classes/RigidBody2D.xml +++ b/doc/classes/RigidBody2D.xml @@ -168,7 +168,7 @@ <member name="mode" type="int" setter="set_mode" getter="get_mode" enum="RigidBody2D.Mode" default="0"> The body's mode. See [enum Mode] for possible values. </member> - <member name="physics_material_override" type="PhysicsMaterial" setter="set_physics_material_override" getter="get_physics_material_override" default="null"> + <member name="physics_material_override" type="PhysicsMaterial" setter="set_physics_material_override" getter="get_physics_material_override"> </member> <member name="sleeping" type="bool" setter="set_sleeping" getter="is_sleeping" default="false"> If [code]true[/code], the body is sleeping and will not calculate forces until woken up by a collision or by using [method apply_impulse] or [method add_force]. diff --git a/doc/classes/ShaderMaterial.xml b/doc/classes/ShaderMaterial.xml index 01d9055569..ef355c4417 100644 --- a/doc/classes/ShaderMaterial.xml +++ b/doc/classes/ShaderMaterial.xml @@ -48,7 +48,7 @@ </method> </methods> <members> - <member name="shader" type="Shader" setter="set_shader" getter="get_shader" default="null"> + <member name="shader" type="Shader" setter="set_shader" getter="get_shader"> The [Shader] program used to render this material. </member> </members> diff --git a/doc/classes/ShortCut.xml b/doc/classes/ShortCut.xml index 44a10ba598..4c5dc0e77b 100644 --- a/doc/classes/ShortCut.xml +++ b/doc/classes/ShortCut.xml @@ -35,7 +35,7 @@ </method> </methods> <members> - <member name="shortcut" type="InputEvent" setter="set_shortcut" getter="get_shortcut" default="null"> + <member name="shortcut" type="InputEvent" setter="set_shortcut" getter="get_shortcut"> The shortcut's [InputEvent]. Generally the [InputEvent] is a keyboard key, though it can be any [InputEvent]. </member> diff --git a/doc/classes/SpatialMaterial.xml b/doc/classes/SpatialMaterial.xml index f739fed733..f684f09263 100644 --- a/doc/classes/SpatialMaterial.xml +++ b/doc/classes/SpatialMaterial.xml @@ -69,7 +69,7 @@ <member name="albedo_color" type="Color" setter="set_albedo" getter="get_albedo" default="Color( 1, 1, 1, 1 )"> The material's base color. </member> - <member name="albedo_texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="albedo_texture" type="Texture" setter="set_texture" getter="get_texture"> </member> <member name="anisotropy" type="float" setter="set_anisotropy" getter="get_anisotropy"> The strength of the anisotropy effect. @@ -190,7 +190,7 @@ General reflectivity amount. [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" default="null"> + <member name="metallic_texture" type="Texture" setter="set_texture" getter="get_texture"> </member> <member name="metallic_texture_channel" type="int" setter="set_metallic_texture_channel" getter="get_metallic_texture_channel" enum="SpatialMaterial.TextureChannel" default="2"> </member> @@ -275,7 +275,7 @@ <member name="roughness" type="float" setter="set_roughness" getter="get_roughness" default="1.0"> 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" default="null"> + <member name="roughness_texture" type="Texture" setter="set_texture" getter="get_texture"> </member> <member name="roughness_texture_channel" type="int" setter="set_roughness_texture_channel" getter="get_roughness_texture_channel" enum="SpatialMaterial.TextureChannel" default="1"> </member> diff --git a/doc/classes/SpringArm.xml b/doc/classes/SpringArm.xml index 16b4b846e4..438d96f2b3 100644 --- a/doc/classes/SpringArm.xml +++ b/doc/classes/SpringArm.xml @@ -41,7 +41,7 @@ </member> <member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.01"> </member> - <member name="shape" type="Shape" setter="set_shape" getter="get_shape" default="null"> + <member name="shape" type="Shape" setter="set_shape" getter="get_shape"> </member> <member name="spring_length" type="float" setter="set_length" getter="get_length" default="1.0"> </member> diff --git a/doc/classes/Sprite.xml b/doc/classes/Sprite.xml index c14ae43f66..e5aea961f4 100644 --- a/doc/classes/Sprite.xml +++ b/doc/classes/Sprite.xml @@ -49,7 +49,7 @@ <member name="hframes" type="int" setter="set_hframes" getter="get_hframes" default="1"> The number of columns in the sprite sheet. </member> - <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map" default="null"> + <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map"> The normal map gives depth to the Sprite. </member> <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2( 0, 0 )"> @@ -64,7 +64,7 @@ <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2( 0, 0, 0, 0 )"> The region of the atlas texture to display. [member region_enabled] must be [code]true[/code]. </member> - <member name="texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> [Texture] object to draw. </member> <member name="vframes" type="int" setter="set_vframes" getter="get_vframes" default="1"> diff --git a/doc/classes/Sprite3D.xml b/doc/classes/Sprite3D.xml index 78004c60ee..9a51302bf1 100644 --- a/doc/classes/Sprite3D.xml +++ b/doc/classes/Sprite3D.xml @@ -23,7 +23,7 @@ <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2( 0, 0, 0, 0 )"> The region of the atlas texture to display. [member region_enabled] must be [code]true[/code]. </member> - <member name="texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> [Texture] object to draw. </member> <member name="vframes" type="int" setter="set_vframes" getter="get_vframes" default="1"> diff --git a/doc/classes/StaticBody.xml b/doc/classes/StaticBody.xml index 878d76a2e3..a9709d00df 100644 --- a/doc/classes/StaticBody.xml +++ b/doc/classes/StaticBody.xml @@ -27,7 +27,7 @@ The body's friction, from 0 (frictionless) to 1 (full friction). Deprecated, use [member PhysicsMaterial.friction] instead via [member physics_material_override]. </member> - <member name="physics_material_override" type="PhysicsMaterial" setter="set_physics_material_override" getter="get_physics_material_override" default="null"> + <member name="physics_material_override" type="PhysicsMaterial" setter="set_physics_material_override" getter="get_physics_material_override"> </member> </members> <constants> diff --git a/doc/classes/StaticBody2D.xml b/doc/classes/StaticBody2D.xml index 4522a50557..4a7f71b667 100644 --- a/doc/classes/StaticBody2D.xml +++ b/doc/classes/StaticBody2D.xml @@ -26,7 +26,7 @@ The body's friction. Values range from [code]0[/code] (no friction) to [code]1[/code] (full friction). Deprecated, use [member PhysicsMaterial.friction] instead via [member physics_material_override]. </member> - <member name="physics_material_override" type="PhysicsMaterial" setter="set_physics_material_override" getter="get_physics_material_override" default="null"> + <member name="physics_material_override" type="PhysicsMaterial" setter="set_physics_material_override" getter="get_physics_material_override"> </member> </members> <constants> diff --git a/doc/classes/StyleBoxTexture.xml b/doc/classes/StyleBoxTexture.xml index f68d749d3b..d5efc80846 100644 --- a/doc/classes/StyleBoxTexture.xml +++ b/doc/classes/StyleBoxTexture.xml @@ -110,14 +110,14 @@ <member name="modulate_color" type="Color" setter="set_modulate" getter="get_modulate" default="Color( 1, 1, 1, 1 )"> Modulates the color of the texture when this style box is drawn. </member> - <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map" default="null"> + <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map"> The normal map to use when drawing this style box. </member> <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2( 0, 0, 0, 0 )"> Species a sub region of the texture to use. This is equivalent to first wrapping the texture in an [AtlasTexture] with the same region. </member> - <member name="texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> The texture to use when drawing this style box. </member> </members> diff --git a/doc/classes/TextureButton.xml b/doc/classes/TextureButton.xml index e3396a10c2..899ab8b875 100644 --- a/doc/classes/TextureButton.xml +++ b/doc/classes/TextureButton.xml @@ -18,22 +18,22 @@ <member name="stretch_mode" type="int" setter="set_stretch_mode" getter="get_stretch_mode" enum="TextureButton.StretchMode" default="0"> Controls the texture's behavior when you resize the node's bounding rectangle, [b]only if[/b] [member expand] is [code]true[/code]. Set it to one of the [code]STRETCH_*[/code] constants. See the constants to learn more. </member> - <member name="texture_click_mask" type="BitMap" setter="set_click_mask" getter="get_click_mask" default="null"> + <member name="texture_click_mask" type="BitMap" setter="set_click_mask" getter="get_click_mask"> Pure black and white [BitMap] image to use for click detection. On the mask, white pixels represent the button's clickable area. Use it to create buttons with curved shapes. </member> - <member name="texture_disabled" type="Texture" setter="set_disabled_texture" getter="get_disabled_texture" default="null"> + <member name="texture_disabled" type="Texture" setter="set_disabled_texture" getter="get_disabled_texture"> Texture to display when the node is disabled. See [member BaseButton.disabled]. </member> - <member name="texture_focused" type="Texture" setter="set_focused_texture" getter="get_focused_texture" default="null"> + <member name="texture_focused" type="Texture" setter="set_focused_texture" getter="get_focused_texture"> Texture to display when the node has mouse or keyboard focus. </member> - <member name="texture_hover" type="Texture" setter="set_hover_texture" getter="get_hover_texture" default="null"> + <member name="texture_hover" type="Texture" setter="set_hover_texture" getter="get_hover_texture"> Texture to display when the mouse hovers the node. </member> - <member name="texture_normal" type="Texture" setter="set_normal_texture" getter="get_normal_texture" default="null"> + <member name="texture_normal" type="Texture" setter="set_normal_texture" getter="get_normal_texture"> Texture to display by default, when the node is [b]not[/b] in the disabled, focused, hover or pressed state. </member> - <member name="texture_pressed" type="Texture" setter="set_pressed_texture" getter="get_pressed_texture" default="null"> + <member name="texture_pressed" type="Texture" setter="set_pressed_texture" getter="get_pressed_texture"> Texture to display on mouse down over the node, if the node has keyboard focus and the player presses the Enter key or if the player presses the [member BaseButton.shortcut] key. </member> </members> diff --git a/doc/classes/TextureLayered.xml b/doc/classes/TextureLayered.xml index a9ad5c251d..232df8f59b 100644 --- a/doc/classes/TextureLayered.xml +++ b/doc/classes/TextureLayered.xml @@ -83,14 +83,7 @@ </method> </methods> <members> - <member name="data" type="Dictionary" setter="_set_data" getter="_get_data" default="{ -"depth": 0, -"flags": 4, -"format": 37, -"height": 0, -"layers": [ ], -"width": 0 -}"> + <member name="data" type="Dictionary" setter="_set_data" getter="_get_data" default="{"depth": 0,"flags": 4,"format": 37,"height": 0,"layers": [ ],"width": 0}"> </member> <member name="flags" type="int" setter="set_flags" getter="get_flags" default="4"> </member> diff --git a/doc/classes/TextureProgress.xml b/doc/classes/TextureProgress.xml index 3900b8bf45..4f8ea6438b 100644 --- a/doc/classes/TextureProgress.xml +++ b/doc/classes/TextureProgress.xml @@ -57,14 +57,14 @@ <member name="stretch_margin_top" type="int" setter="set_stretch_margin" getter="get_stretch_margin" default="0"> The height of the 9-patch's top row. </member> - <member name="texture_over" type="Texture" setter="set_over_texture" getter="get_over_texture" default="null"> + <member name="texture_over" type="Texture" setter="set_over_texture" getter="get_over_texture"> [Texture] that draws over the progress bar. Use it to add highlights or an upper-frame that hides part of [member texture_progress]. </member> - <member name="texture_progress" type="Texture" setter="set_progress_texture" getter="get_progress_texture" default="null"> + <member name="texture_progress" type="Texture" setter="set_progress_texture" getter="get_progress_texture"> [Texture] that clips based on the node's [code]value[/code] and [member fill_mode]. As [code]value[/code] increased, the texture fills up. It shows entirely when [code]value[/code] reaches [code]max_value[/code]. It doesn't show at all if [code]value[/code] is equal to [code]min_value[/code]. The [code]value[/code] property comes from [Range]. See [member Range.value], [member Range.min_value], [member Range.max_value]. </member> - <member name="texture_under" type="Texture" setter="set_under_texture" getter="get_under_texture" default="null"> + <member name="texture_under" type="Texture" setter="set_under_texture" getter="get_under_texture"> [Texture] that draws under the progress bar. The bar's background. </member> <member name="tint_over" type="Color" setter="set_tint_over" getter="get_tint_over" default="Color( 1, 1, 1, 1 )"> diff --git a/doc/classes/TextureRect.xml b/doc/classes/TextureRect.xml index 8320d535ea..be46459b21 100644 --- a/doc/classes/TextureRect.xml +++ b/doc/classes/TextureRect.xml @@ -23,7 +23,7 @@ <member name="stretch_mode" type="int" setter="set_stretch_mode" getter="get_stretch_mode" enum="TextureRect.StretchMode" default="0"> Controls the texture's behavior when resizing the node's bounding rectangle. See [enum StretchMode]. </member> - <member name="texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> The node's [Texture] resource. </member> </members> diff --git a/doc/classes/Theme.xml b/doc/classes/Theme.xml index 9c2676a55a..e4db9243ef 100644 --- a/doc/classes/Theme.xml +++ b/doc/classes/Theme.xml @@ -335,7 +335,7 @@ </method> </methods> <members> - <member name="default_font" type="Font" setter="set_default_font" getter="get_default_font" default="null"> + <member name="default_font" type="Font" setter="set_default_font" getter="get_default_font"> The theme's default font. </member> </members> diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml index 3f9c2e8647..efb7a0d900 100644 --- a/doc/classes/TileMap.xml +++ b/doc/classes/TileMap.xml @@ -306,7 +306,7 @@ <member name="occluder_light_mask" type="int" setter="set_occluder_light_mask" getter="get_occluder_light_mask" default="1"> The light mask assigned to all light occluders in the TileMap. The TileSet's light occluders will cast shadows only from Light2D(s) that have the same light mask(s). </member> - <member name="tile_set" type="TileSet" setter="set_tileset" getter="get_tileset" default="null"> + <member name="tile_set" type="TileSet" setter="set_tileset" getter="get_tileset"> The assigned [TileSet]. </member> </members> diff --git a/doc/classes/TouchScreenButton.xml b/doc/classes/TouchScreenButton.xml index fd9f96a41e..fccfb4cd6d 100644 --- a/doc/classes/TouchScreenButton.xml +++ b/doc/classes/TouchScreenButton.xml @@ -21,19 +21,19 @@ <member name="action" type="String" setter="set_action" getter="get_action" default=""""> The button's action. Actions can be handled with [InputEventAction]. </member> - <member name="bitmask" type="BitMap" setter="set_bitmask" getter="get_bitmask" default="null"> + <member name="bitmask" type="BitMap" setter="set_bitmask" getter="get_bitmask"> The button's bitmask. </member> - <member name="normal" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="normal" type="Texture" setter="set_texture" getter="get_texture"> The button's texture for the normal state. </member> <member name="passby_press" type="bool" setter="set_passby_press" getter="is_passby_press_enabled" default="false"> If [code]true[/code], pass-by presses are enabled. </member> - <member name="pressed" type="Texture" setter="set_texture_pressed" getter="get_texture_pressed" default="null"> + <member name="pressed" type="Texture" setter="set_texture_pressed" getter="get_texture_pressed"> The button's texture for the pressed state. </member> - <member name="shape" type="Shape2D" setter="set_shape" getter="get_shape" default="null"> + <member name="shape" type="Shape2D" setter="set_shape" getter="get_shape"> The button's shape. </member> <member name="shape_centered" type="bool" setter="set_shape_centered" getter="is_shape_centered" default="true"> diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index 22c74d4ca5..c2b7901c05 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -182,7 +182,7 @@ <argument index="1" name="expand" type="bool"> </argument> <description> - If [code]true[/code], the column will have the "Expand" flag of [Control]. + If [code]true[/code], the column will have the "Expand" flag of [Control]. Columns that have the "Expand" flag will use their "min_width" in a similar fashion to [member Control.size_flags_stretch_ratio]. </description> </method> <method name="set_column_min_width"> @@ -193,7 +193,7 @@ <argument index="1" name="min_width" type="int"> </argument> <description> - Sets the minimum width of a column. + Sets the minimum width of a column. Columns that have the "Expand" flag will use their "min_width" in a similar fashion to [member Control.size_flags_stretch_ratio]. </description> </method> <method name="set_column_title"> diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml index 3a4acb351d..56b4b21525 100644 --- a/doc/classes/TreeItem.xml +++ b/doc/classes/TreeItem.xml @@ -347,6 +347,7 @@ <argument index="2" name="disabled" type="bool"> </argument> <description> + If [code]true[/code], disables the button at index [code]button_idx[/code] in column [code]column[/code]. </description> </method> <method name="set_cell_mode"> diff --git a/doc/classes/VideoPlayer.xml b/doc/classes/VideoPlayer.xml index 45341cee74..18a85d496f 100644 --- a/doc/classes/VideoPlayer.xml +++ b/doc/classes/VideoPlayer.xml @@ -64,7 +64,7 @@ <member name="paused" type="bool" setter="set_paused" getter="is_paused" default="false"> If [code]true[/code], the video is paused. </member> - <member name="stream" type="VideoStream" setter="set_stream" getter="get_stream" default="null"> + <member name="stream" type="VideoStream" setter="set_stream" getter="get_stream"> </member> <member name="stream_position" type="float" setter="set_stream_position" getter="get_stream_position"> The current position of the stream, in seconds. diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 9b24aa1a86..117c4835eb 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -295,7 +295,7 @@ <member name="usage" type="int" setter="set_usage" getter="get_usage" enum="Viewport.Usage" default="2"> The rendering mode of viewport. </member> - <member name="world" type="World" setter="set_world" getter="get_world" default="null"> + <member name="world" type="World" setter="set_world" getter="get_world"> The custom [World] which can be used as 3D environment source. </member> <member name="world_2d" type="World2D" setter="set_world_2d" getter="get_world_2d"> diff --git a/doc/classes/VisualShaderNodeCompare.xml b/doc/classes/VisualShaderNodeCompare.xml new file mode 100644 index 0000000000..7edad5294d --- /dev/null +++ b/doc/classes/VisualShaderNodeCompare.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeCompare" inherits="VisualShaderNode" category="Core" version="3.2"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <members> + <member name="condition" type="int" setter="set_condition" getter="get_condition" enum="VisualShaderNodeCompare.Condition" default="0"> + </member> + <member name="function" type="int" setter="set_function" getter="get_function" enum="VisualShaderNodeCompare.Function" default="0"> + </member> + <member name="type" type="int" setter="set_comparsion_type" getter="get_comparsion_type" enum="VisualShaderNodeCompare.ComparsionType" default="0"> + </member> + </members> + <constants> + <constant name="CTYPE_SCALAR" value="0" enum="ComparsionType"> + </constant> + <constant name="CTYPE_VECTOR" value="1" enum="ComparsionType"> + </constant> + <constant name="CTYPE_BOOLEAN" value="2" enum="ComparsionType"> + </constant> + <constant name="CTYPE_TRANSFORM" value="3" enum="ComparsionType"> + </constant> + <constant name="FUNC_EQUAL" value="0" enum="Function"> + </constant> + <constant name="FUNC_NOT_EQUAL" value="1" enum="Function"> + </constant> + <constant name="FUNC_GREATER_THAN" value="2" enum="Function"> + </constant> + <constant name="FUNC_GREATER_THAN_EQUAL" value="3" enum="Function"> + </constant> + <constant name="FUNC_LESS_THAN" value="4" enum="Function"> + </constant> + <constant name="FUNC_LESS_THAN_EQUAL" value="5" enum="Function"> + </constant> + <constant name="COND_ALL" value="0" enum="Condition"> + </constant> + <constant name="COND_ANY" value="1" enum="Condition"> + </constant> + </constants> +</class> diff --git a/doc/classes/VisualShaderNodeCubeMap.xml b/doc/classes/VisualShaderNodeCubeMap.xml index 9a4cb5b17c..b695297f07 100644 --- a/doc/classes/VisualShaderNodeCubeMap.xml +++ b/doc/classes/VisualShaderNodeCubeMap.xml @@ -9,7 +9,7 @@ <methods> </methods> <members> - <member name="cube_map" type="CubeMap" setter="set_cube_map" getter="get_cube_map" default="null"> + <member name="cube_map" type="CubeMap" setter="set_cube_map" getter="get_cube_map"> </member> <member name="texture_type" type="int" setter="set_texture_type" getter="get_texture_type" enum="VisualShaderNodeCubeMap.TextureType" default="0"> </member> diff --git a/doc/classes/VisualShaderNodeIs.xml b/doc/classes/VisualShaderNodeIs.xml new file mode 100644 index 0000000000..8db64b7cde --- /dev/null +++ b/doc/classes/VisualShaderNodeIs.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeIs" inherits="VisualShaderNode" category="Core" version="3.2"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <members> + <member name="function" type="int" setter="set_function" getter="get_function" enum="VisualShaderNodeIs.Function" default="0"> + </member> + </members> + <constants> + <constant name="FUNC_IS_INF" value="0" enum="Function"> + </constant> + <constant name="FUNC_IS_NAN" value="1" enum="Function"> + </constant> + </constants> +</class> diff --git a/doc/classes/VisualShaderNodeTexture.xml b/doc/classes/VisualShaderNodeTexture.xml index b3b89eb29b..f3bade9303 100644 --- a/doc/classes/VisualShaderNodeTexture.xml +++ b/doc/classes/VisualShaderNodeTexture.xml @@ -11,7 +11,7 @@ <members> <member name="source" type="int" setter="set_source" getter="get_source" enum="VisualShaderNodeTexture.Source" default="0"> </member> - <member name="texture" type="Texture" setter="set_texture" getter="get_texture" default="null"> + <member name="texture" type="Texture" setter="set_texture" getter="get_texture"> </member> <member name="texture_type" type="int" setter="set_texture_type" getter="get_texture_type" enum="VisualShaderNodeTexture.TextureType" default="0"> </member> diff --git a/doc/classes/VisualShaderNodeTextureUniformTriplanar.xml b/doc/classes/VisualShaderNodeTextureUniformTriplanar.xml new file mode 100644 index 0000000000..d4e142651e --- /dev/null +++ b/doc/classes/VisualShaderNodeTextureUniformTriplanar.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeTextureUniformTriplanar" inherits="VisualShaderNodeTextureUniform" category="Core" version="3.2"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/World.xml b/doc/classes/World.xml index adb3286c51..c8e6944b83 100644 --- a/doc/classes/World.xml +++ b/doc/classes/World.xml @@ -15,10 +15,10 @@ <member name="direct_space_state" type="PhysicsDirectSpaceState" setter="" getter="get_direct_space_state"> The World's physics direct space state, used for making various queries. Might be used only during [code]_physics_process[/code]. </member> - <member name="environment" type="Environment" setter="set_environment" getter="get_environment" default="null"> + <member name="environment" type="Environment" setter="set_environment" getter="get_environment"> The World's [Environment]. </member> - <member name="fallback_environment" type="Environment" setter="set_fallback_environment" getter="get_fallback_environment" default="null"> + <member name="fallback_environment" type="Environment" setter="set_fallback_environment" getter="get_fallback_environment"> The World's fallback_environment will be used if the World's [Environment] fails or is missing. </member> <member name="scenario" type="RID" setter="" getter="get_scenario"> diff --git a/doc/classes/WorldEnvironment.xml b/doc/classes/WorldEnvironment.xml index a2a454d1b3..b4524bfea0 100644 --- a/doc/classes/WorldEnvironment.xml +++ b/doc/classes/WorldEnvironment.xml @@ -14,7 +14,7 @@ <methods> </methods> <members> - <member name="environment" type="Environment" setter="set_environment" getter="get_environment" default="null"> + <member name="environment" type="Environment" setter="set_environment" getter="get_environment"> The [Environment] resource used by this [WorldEnvironment], defining the default properties. </member> </members> diff --git a/drivers/gles2/rasterizer_canvas_gles2.cpp b/drivers/gles2/rasterizer_canvas_gles2.cpp index b82186162d..8a177e32b0 100644 --- a/drivers/gles2/rasterizer_canvas_gles2.cpp +++ b/drivers/gles2/rasterizer_canvas_gles2.cpp @@ -498,7 +498,16 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur Vector2(line->to.x, line->to.y) }; +#ifdef GLES_OVER_GL + if (line->antialiased) + glEnable(GL_LINE_SMOOTH); +#endif _draw_gui_primitive(2, verts, NULL, NULL); + +#ifdef GLES_OVER_GL + if (line->antialiased) + glDisable(GL_LINE_SMOOTH); +#endif } else { Vector2 t = (line->from - line->to).normalized().tangent() * line->width * 0.5; @@ -510,6 +519,19 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur }; _draw_gui_primitive(4, verts, NULL, NULL); +#ifdef GLES_OVER_GL + if (line->antialiased) { + glEnable(GL_LINE_SMOOTH); + for (int j = 0; j < 4; j++) { + Vector2 vertsl[2] = { + verts[j], + verts[(j + 1) % 4], + }; + _draw_gui_primitive(2, vertsl, NULL, NULL); + } + glDisable(GL_LINE_SMOOTH); + } +#endif } } break; @@ -919,6 +941,13 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur } _draw_polygon(polygon->indices.ptr(), polygon->count, polygon->points.size(), polygon->points.ptr(), polygon->uvs.ptr(), polygon->colors.ptr(), polygon->colors.size() == 1, polygon->weights.ptr(), polygon->bones.ptr()); +#ifdef GLES_OVER_GL + if (polygon->antialiased) { + glEnable(GL_LINE_SMOOTH); + _draw_generic(GL_LINE_LOOP, polygon->points.size(), polygon->points.ptr(), polygon->uvs.ptr(), polygon->colors.ptr(), polygon->colors.size() == 1); + glDisable(GL_LINE_SMOOTH); + } +#endif } break; case Item::Command::TYPE_MESH: { @@ -1120,7 +1149,22 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur if (pline->triangles.size()) { _draw_generic(GL_TRIANGLE_STRIP, pline->triangles.size(), pline->triangles.ptr(), NULL, pline->triangle_colors.ptr(), pline->triangle_colors.size() == 1); +#ifdef GLES_OVER_GL + glEnable(GL_LINE_SMOOTH); + if (pline->multiline) { + //needs to be different + } else { + _draw_generic(GL_LINE_LOOP, pline->lines.size(), pline->lines.ptr(), NULL, pline->line_colors.ptr(), pline->line_colors.size() == 1); + } + glDisable(GL_LINE_SMOOTH); +#endif } else { + +#ifdef GLES_OVER_GL + if (pline->antialiased) + glEnable(GL_LINE_SMOOTH); +#endif + if (pline->multiline) { int todo = pline->lines.size() / 2; int max_per_call = data.polygon_buffer_size / (sizeof(real_t) * 4); @@ -1135,6 +1179,11 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur } else { _draw_generic(GL_LINES, pline->lines.size(), pline->lines.ptr(), NULL, pline->line_colors.ptr(), pline->line_colors.size() == 1); } + +#ifdef GLES_OVER_GL + if (pline->antialiased) + glDisable(GL_LINE_SMOOTH); +#endif } } break; diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp index ea29af7d9e..c8ceca8d97 100644 --- a/drivers/gles2/rasterizer_scene_gles2.cpp +++ b/drivers/gles2/rasterizer_scene_gles2.cpp @@ -1133,8 +1133,8 @@ void RasterizerSceneGLES2::_add_geometry_with_material(RasterizerStorageGLES2::G LightInstance *li = light_instance_owner.getornull(e->instance->light_instances[i]); - if (li->light_index >= render_light_instance_count) { - continue; // too many + if (li->light_index >= render_light_instance_count || render_light_instances[li->light_index] != li) { + continue; // too many or light_index did not correspond to the light instances to be rendered } if (copy) { diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp index ee34a478b1..df7eee2301 100644 --- a/drivers/gles2/shader_compiler_gles2.cpp +++ b/drivers/gles2/shader_compiler_gles2.cpp @@ -510,7 +510,97 @@ String ShaderCompilerGLES2::_dump_node_code(SL::Node *p_node, int p_level, Gener } } } break; + case SL::Node::TYPE_ARRAY_DECLARATION: { + SL::ArrayDeclarationNode *var_dec_node = (SL::ArrayDeclarationNode *)p_node; + + StringBuffer<> declaration; + + declaration += _prestr(var_dec_node->precision); + declaration += _typestr(var_dec_node->datatype); + + for (int i = 0; i < var_dec_node->declarations.size(); i++) { + + if (i > 0) { + declaration += ","; + } + + declaration += " "; + + declaration += _mkid(var_dec_node->declarations[i].name); + declaration += "["; + declaration += itos(var_dec_node->declarations[i].size); + declaration += "]"; + int sz = var_dec_node->declarations[i].initializer.size(); + if (sz > 0) { + declaration += "="; + declaration += _typestr(var_dec_node->datatype); + declaration += "["; + declaration += itos(sz); + declaration += "]"; + declaration += "("; + for (int j = 0; j < sz; j++) { + declaration += _dump_node_code(var_dec_node->declarations[i].initializer[j], p_level, r_gen_code, p_actions, p_default_actions, p_assigning); + if (j != sz - 1) { + declaration += ", "; + } + } + declaration += ")"; + } + } + + code += declaration.as_string(); + } break; + case SL::Node::TYPE_ARRAY: { + SL::ArrayNode *var_node = (SL::ArrayNode *)p_node; + + if (p_assigning && p_actions.write_flag_pointers.has(var_node->name)) { + *p_actions.write_flag_pointers[var_node->name] = true; + } + + if (p_default_actions.usage_defines.has(var_node->name) && !used_name_defines.has(var_node->name)) { + String define = p_default_actions.usage_defines[var_node->name]; + + if (define.begins_with("@")) { + define = p_default_actions.usage_defines[define.substr(1, define.length())]; + } + + r_gen_code.custom_defines.push_back(define.utf8()); + used_name_defines.insert(var_node->name); + } + + if (p_actions.usage_flag_pointers.has(var_node->name) && !used_flag_pointers.has(var_node->name)) { + *p_actions.usage_flag_pointers[var_node->name] = true; + used_flag_pointers.insert(var_node->name); + } + + if (p_default_actions.renames.has(var_node->name)) { + code += p_default_actions.renames[var_node->name]; + } else { + code += _mkid(var_node->name); + } + + if (var_node->call_expression != NULL) { + code += "."; + code += _dump_node_code(var_node->call_expression, p_level, r_gen_code, p_actions, p_default_actions, p_assigning); + } + + if (var_node->index_expression != NULL) { + code += "["; + code += _dump_node_code(var_node->index_expression, p_level, r_gen_code, p_actions, p_default_actions, p_assigning); + code += "]"; + } + + if (var_node->name == time_name) { + if (current_func_name == vertex_name) { + r_gen_code.uses_vertex_time = true; + } + if (current_func_name == fragment_name || current_func_name == light_name) { + r_gen_code.uses_fragment_time = true; + } + } + + } break; case SL::Node::TYPE_CONSTANT: { SL::ConstantNode *const_node = (SL::ConstantNode *)p_node; diff --git a/drivers/gles3/shader_compiler_gles3.cpp b/drivers/gles3/shader_compiler_gles3.cpp index b0f0a71d56..f826bdf5a2 100644 --- a/drivers/gles3/shader_compiler_gles3.cpp +++ b/drivers/gles3/shader_compiler_gles3.cpp @@ -607,6 +607,88 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener } } break; + case SL::Node::TYPE_ARRAY_DECLARATION: { + + SL::ArrayDeclarationNode *vdnode = (SL::ArrayDeclarationNode *)p_node; + + String declaration = _prestr(vdnode->precision) + _typestr(vdnode->datatype); + for (int i = 0; i < vdnode->declarations.size(); i++) { + if (i > 0) { + declaration += ","; + } else { + declaration += " "; + } + declaration += _mkid(vdnode->declarations[i].name); + declaration += "["; + declaration += itos(vdnode->declarations[i].size); + declaration += "]"; + int sz = vdnode->declarations[i].initializer.size(); + if (sz > 0) { + declaration += "="; + declaration += _typestr(vdnode->datatype); + declaration += "["; + declaration += itos(sz); + declaration += "]"; + declaration += "("; + for (int j = 0; j < sz; j++) { + declaration += _dump_node_code(vdnode->declarations[i].initializer[j], p_level, r_gen_code, p_actions, p_default_actions, p_assigning); + if (j != sz - 1) { + declaration += ", "; + } + } + declaration += ")"; + } + } + + code += declaration; + } break; + case SL::Node::TYPE_ARRAY: { + SL::ArrayNode *vnode = (SL::ArrayNode *)p_node; + + if (p_assigning && p_actions.write_flag_pointers.has(vnode->name)) { + *p_actions.write_flag_pointers[vnode->name] = true; + } + + if (p_default_actions.usage_defines.has(vnode->name) && !used_name_defines.has(vnode->name)) { + String define = p_default_actions.usage_defines[vnode->name]; + if (define.begins_with("@")) { + define = p_default_actions.usage_defines[define.substr(1, define.length())]; + } + r_gen_code.defines.push_back(define.utf8()); + used_name_defines.insert(vnode->name); + } + + if (p_actions.usage_flag_pointers.has(vnode->name) && !used_flag_pointers.has(vnode->name)) { + *p_actions.usage_flag_pointers[vnode->name] = true; + used_flag_pointers.insert(vnode->name); + } + + if (p_default_actions.renames.has(vnode->name)) + code = p_default_actions.renames[vnode->name]; + else + code = _mkid(vnode->name); + + if (vnode->call_expression != NULL) { + code += "."; + code += _dump_node_code(vnode->call_expression, p_level, r_gen_code, p_actions, p_default_actions, p_assigning); + } + + if (vnode->index_expression != NULL) { + code += "["; + code += _dump_node_code(vnode->index_expression, p_level, r_gen_code, p_actions, p_default_actions, p_assigning); + code += "]"; + } + + if (vnode->name == time_name) { + if (current_func_name == vertex_name) { + r_gen_code.uses_vertex_time = true; + } + if (current_func_name == fragment_name || current_func_name == light_name) { + r_gen_code.uses_fragment_time = true; + } + } + + } break; case SL::Node::TYPE_CONSTANT: { SL::ConstantNode *cnode = (SL::ConstantNode *)p_node; return get_constant_text(cnode->datatype, cnode->values); diff --git a/drivers/png/resource_saver_png.cpp b/drivers/png/resource_saver_png.cpp index 89e8ee32cc..43a30f055b 100644 --- a/drivers/png/resource_saver_png.cpp +++ b/drivers/png/resource_saver_png.cpp @@ -79,7 +79,7 @@ bool ResourceSaverPNG::recognize(const RES &p_resource) const { void ResourceSaverPNG::get_recognized_extensions(const RES &p_resource, List<String> *p_extensions) const { - if (Object::cast_to<Texture>(*p_resource)) { + if (Object::cast_to<ImageTexture>(*p_resource)) { p_extensions->push_back("png"); } } diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp index 251bab5783..d5582d00ed 100644 --- a/drivers/unix/dir_access_unix.cpp +++ b/drivers/unix/dir_access_unix.cpp @@ -136,27 +136,31 @@ String DirAccessUnix::get_next() { return ""; } - //typedef struct stat Stat; - struct stat flags; - String fname = fix_unicode_name(entry->d_name); - String f = current_dir.plus_file(fname); + if (entry->d_type == DT_UNKNOWN) { + //typedef struct stat Stat; + struct stat flags; + + String f = current_dir.plus_file(fname); + + if (stat(f.utf8().get_data(), &flags) == 0) { - if (stat(f.utf8().get_data(), &flags) == 0) { + if (S_ISDIR(flags.st_mode)) { - if (S_ISDIR(flags.st_mode)) { + _cisdir = true; - _cisdir = true; + } else { + + _cisdir = false; + } } else { _cisdir = false; } - } else { - - _cisdir = false; + _cisdir = (entry->d_type == DT_DIR); } _cishidden = (fname != "." && fname != ".." && fname.begins_with(".")); diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 4862d4bb5b..e45ff3fee2 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -1426,17 +1426,17 @@ void CodeTextEditor::_on_settings_change() { // AUTO BRACE COMPLETION text_editor->set_auto_brace_completion( - EDITOR_DEF("text_editor/completion/auto_brace_complete", true)); + EDITOR_GET("text_editor/completion/auto_brace_complete")); code_complete_timer->set_wait_time( - EDITOR_DEF("text_editor/completion/code_complete_delay", .3f)); + EDITOR_GET("text_editor/completion/code_complete_delay")); // call hint settings text_editor->set_callhint_settings( - EDITOR_DEF("text_editor/completion/put_callhint_tooltip_below_current_line", true), - EDITOR_DEF("text_editor/completion/callhint_tooltip_offset", Vector2())); + EDITOR_GET("text_editor/completion/put_callhint_tooltip_below_current_line"), + EDITOR_GET("text_editor/completion/callhint_tooltip_offset")); - idle->set_wait_time(EDITOR_DEF("text_editor/completion/idle_parse_delay", 2.0)); + idle->set_wait_time(EDITOR_GET("text_editor/completion/idle_parse_delay")); } void CodeTextEditor::_text_changed_idle_timeout() { @@ -1622,12 +1622,12 @@ CodeTextEditor::CodeTextEditor() { idle = memnew(Timer); add_child(idle); idle->set_one_shot(true); - idle->set_wait_time(EDITOR_DEF("text_editor/completion/idle_parse_delay", 2.0)); + idle->set_wait_time(EDITOR_GET("text_editor/completion/idle_parse_delay")); code_complete_timer = memnew(Timer); add_child(code_complete_timer); code_complete_timer->set_one_shot(true); - code_complete_timer->set_wait_time(EDITOR_DEF("text_editor/completion/code_complete_delay", .3f)); + code_complete_timer->set_wait_time(EDITOR_GET("text_editor/completion/code_complete_delay")); error_line = 0; error_column = 0; diff --git a/editor/doc/doc_data.cpp b/editor/doc/doc_data.cpp index a8ba54d4f8..6f09e73fab 100644 --- a/editor/doc/doc_data.cpp +++ b/editor/doc/doc_data.cpp @@ -266,8 +266,8 @@ void DocData::generate(bool p_basic_types) { } } - if (default_value_valid) { - prop.default_value = default_value.get_construct_string(); + if (default_value_valid && default_value.get_type() != Variant::OBJECT) { + prop.default_value = default_value.get_construct_string().replace("\n", ""); } bool found_type = false; diff --git a/editor/editor_asset_installer.cpp b/editor/editor_asset_installer.cpp index 12df91a501..b706f2cae6 100644 --- a/editor/editor_asset_installer.cpp +++ b/editor/editor_asset_installer.cpp @@ -111,18 +111,14 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) { Map<String, Ref<Texture> > extension_guess; { - extension_guess["png"] = get_icon("Texture", "EditorIcons"); - extension_guess["jpg"] = get_icon("Texture", "EditorIcons"); - extension_guess["tex"] = get_icon("Texture", "EditorIcons"); - extension_guess["atlastex"] = get_icon("Texture", "EditorIcons"); - extension_guess["dds"] = get_icon("Texture", "EditorIcons"); + extension_guess["png"] = get_icon("ImageTexture", "EditorIcons"); + extension_guess["jpg"] = get_icon("ImageTexture", "EditorIcons"); + extension_guess["atlastex"] = get_icon("AtlasTexture", "EditorIcons"); extension_guess["scn"] = get_icon("PackedScene", "EditorIcons"); extension_guess["tscn"] = get_icon("PackedScene", "EditorIcons"); - extension_guess["xml"] = get_icon("PackedScene", "EditorIcons"); - extension_guess["xscn"] = get_icon("PackedScene", "EditorIcons"); - extension_guess["material"] = get_icon("Material", "EditorIcons"); - extension_guess["shd"] = get_icon("Shader", "EditorIcons"); + extension_guess["shader"] = get_icon("Shader", "EditorIcons"); extension_guess["gd"] = get_icon("GDScript", "EditorIcons"); + extension_guess["vs"] = get_icon("VisualScript", "EditorIcons"); } Ref<Texture> generic_extension = get_icon("Object", "EditorIcons"); diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index cd5d26e577..d81a1dbd77 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -444,6 +444,7 @@ void EditorHelp::_update_doc() { class_desc->pop(); class_desc->add_newline(); + class_desc->push_font(doc_code_font); class_desc->push_indent(1); class_desc->push_table(2); class_desc->set_table_column_expand(1, 1); @@ -509,6 +510,7 @@ void EditorHelp::_update_doc() { class_desc->pop(); //table class_desc->pop(); + class_desc->pop(); // font class_desc->add_newline(); class_desc->add_newline(); } diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 3431930b8b..3183f1ae97 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -238,185 +238,183 @@ void EditorNode::_unhandled_input(const Ref<InputEvent> &p_event) { void EditorNode::_notification(int p_what) { - if (p_what == NOTIFICATION_EXIT_TREE) { - - editor_data.save_editor_external_data(); - FileAccess::set_file_close_fail_notify_callback(NULL); - log->deinit(); // do not get messages anymore - } - if (p_what == NOTIFICATION_PROCESS) { - - if (opening_prev && !confirmation->is_visible()) - opening_prev = false; + switch (p_what) { + case NOTIFICATION_PROCESS: { + if (opening_prev && !confirmation->is_visible()) + opening_prev = false; - if (unsaved_cache != (saved_version != editor_data.get_undo_redo().get_version())) { + if (unsaved_cache != (saved_version != editor_data.get_undo_redo().get_version())) { - unsaved_cache = (saved_version != editor_data.get_undo_redo().get_version()); - _update_title(); - } + unsaved_cache = (saved_version != editor_data.get_undo_redo().get_version()); + _update_title(); + } - if (last_checked_version != editor_data.get_undo_redo().get_version()) { - _update_scene_tabs(); - last_checked_version = editor_data.get_undo_redo().get_version(); - } + if (last_checked_version != editor_data.get_undo_redo().get_version()) { + _update_scene_tabs(); + last_checked_version = editor_data.get_undo_redo().get_version(); + } - // update the animation frame of the update spinner - uint64_t frame = Engine::get_singleton()->get_frames_drawn(); - uint32_t tick = OS::get_singleton()->get_ticks_msec(); + // update the animation frame of the update spinner + uint64_t frame = Engine::get_singleton()->get_frames_drawn(); + uint32_t tick = OS::get_singleton()->get_ticks_msec(); - if (frame != update_spinner_step_frame && (tick - update_spinner_step_msec) > (1000 / 8)) { + if (frame != update_spinner_step_frame && (tick - update_spinner_step_msec) > (1000 / 8)) { - update_spinner_step++; - if (update_spinner_step >= 8) - update_spinner_step = 0; + update_spinner_step++; + if (update_spinner_step >= 8) + update_spinner_step = 0; - update_spinner_step_msec = tick; - update_spinner_step_frame = frame + 1; + update_spinner_step_msec = tick; + update_spinner_step_frame = frame + 1; - // update the icon itself only when the spinner is visible - if (EditorSettings::get_singleton()->get("interface/editor/show_update_spinner")) { - update_spinner->set_icon(gui_base->get_icon("Progress" + itos(update_spinner_step + 1), "EditorIcons")); + // update the icon itself only when the spinner is visible + if (EditorSettings::get_singleton()->get("interface/editor/show_update_spinner")) { + update_spinner->set_icon(gui_base->get_icon("Progress" + itos(update_spinner_step + 1), "EditorIcons")); + } } - } - editor_selection->update(); + editor_selection->update(); - scene_root->set_size_override(true, Size2(ProjectSettings::get_singleton()->get("display/window/size/width"), ProjectSettings::get_singleton()->get("display/window/size/height"))); + scene_root->set_size_override(true, Size2(ProjectSettings::get_singleton()->get("display/window/size/width"), ProjectSettings::get_singleton()->get("display/window/size/height"))); - ResourceImporterTexture::get_singleton()->update_imports(); - } - if (p_what == NOTIFICATION_ENTER_TREE) { + ResourceImporterTexture::get_singleton()->update_imports(); + } break; - Engine::get_singleton()->set_editor_hint(true); + case NOTIFICATION_ENTER_TREE: { + Engine::get_singleton()->set_editor_hint(true); - OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(int(EDITOR_GET("interface/editor/low_processor_mode_sleep_usec"))); - get_tree()->get_root()->set_usage(Viewport::USAGE_2D_NO_SAMPLING); //reduce memory usage - get_tree()->get_root()->set_disable_3d(true); - get_tree()->get_root()->set_as_audio_listener(false); - get_tree()->get_root()->set_as_audio_listener_2d(false); - get_tree()->set_auto_accept_quit(false); - get_tree()->connect("files_dropped", this, "_dropped_files"); + OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(int(EDITOR_GET("interface/editor/low_processor_mode_sleep_usec"))); + get_tree()->get_root()->set_usage(Viewport::USAGE_2D_NO_SAMPLING); //reduce memory usage + get_tree()->get_root()->set_disable_3d(true); + get_tree()->get_root()->set_as_audio_listener(false); + get_tree()->get_root()->set_as_audio_listener_2d(false); + get_tree()->set_auto_accept_quit(false); + get_tree()->connect("files_dropped", this, "_dropped_files"); - /* DO NOT LOAD SCENES HERE, WAIT FOR FILE SCANNING AND REIMPORT TO COMPLETE */ - } + /* DO NOT LOAD SCENES HERE, WAIT FOR FILE SCANNING AND REIMPORT TO COMPLETE */ + } break; - if (p_what == NOTIFICATION_EXIT_TREE) { + case NOTIFICATION_EXIT_TREE: { + editor_data.save_editor_external_data(); + FileAccess::set_file_close_fail_notify_callback(NULL); + log->deinit(); // do not get messages anymore + editor_data.clear_edited_scenes(); + } break; - editor_data.clear_edited_scenes(); - } - if (p_what == NOTIFICATION_READY) { + case NOTIFICATION_READY: { - VisualServer::get_singleton()->viewport_set_hide_scenario(get_scene_root()->get_viewport_rid(), true); - VisualServer::get_singleton()->viewport_set_hide_canvas(get_scene_root()->get_viewport_rid(), true); - VisualServer::get_singleton()->viewport_set_disable_environment(get_viewport()->get_viewport_rid(), true); + VisualServer::get_singleton()->viewport_set_hide_scenario(get_scene_root()->get_viewport_rid(), true); + VisualServer::get_singleton()->viewport_set_hide_canvas(get_scene_root()->get_viewport_rid(), true); + VisualServer::get_singleton()->viewport_set_disable_environment(get_viewport()->get_viewport_rid(), true); - feature_profile_manager->notify_changed(); + feature_profile_manager->notify_changed(); - if (!main_editor_buttons[EDITOR_3D]->is_visible()) { //may be hidden due to feature profile - _editor_select(EDITOR_2D); - } else { - _editor_select(EDITOR_3D); - } + if (!main_editor_buttons[EDITOR_3D]->is_visible()) { //may be hidden due to feature profile + _editor_select(EDITOR_2D); + } else { + _editor_select(EDITOR_3D); + } - _update_debug_options(); + _update_debug_options(); - /* DO NOT LOAD SCENES HERE, WAIT FOR FILE SCANNING AND REIMPORT TO COMPLETE */ - } + /* DO NOT LOAD SCENES HERE, WAIT FOR FILE SCANNING AND REIMPORT TO COMPLETE */ + } break; - if (p_what == MainLoop::NOTIFICATION_WM_FOCUS_IN) { + case MainLoop::NOTIFICATION_WM_FOCUS_IN: { - // Restore the original FPS cap after focusing back on the editor - OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(int(EDITOR_GET("interface/editor/low_processor_mode_sleep_usec"))); + // Restore the original FPS cap after focusing back on the editor + OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(int(EDITOR_GET("interface/editor/low_processor_mode_sleep_usec"))); - EditorFileSystem::get_singleton()->scan_changes(); - } + EditorFileSystem::get_singleton()->scan_changes(); + } break; - if (p_what == MainLoop::NOTIFICATION_WM_FOCUS_OUT) { + case MainLoop::NOTIFICATION_WM_FOCUS_OUT: { - // Set a low FPS cap to decrease CPU/GPU usage while the editor is unfocused - OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(int(EDITOR_GET("interface/editor/unfocused_low_processor_mode_sleep_usec"))); - } + // Set a low FPS cap to decrease CPU/GPU usage while the editor is unfocused + OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(int(EDITOR_GET("interface/editor/unfocused_low_processor_mode_sleep_usec"))); + } break; - if (p_what == MainLoop::NOTIFICATION_WM_QUIT_REQUEST) { + case MainLoop::NOTIFICATION_WM_QUIT_REQUEST: { - _menu_option_confirm(FILE_QUIT, false); - } + _menu_option_confirm(FILE_QUIT, false); + } break; - if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { - scene_tabs->set_tab_close_display_policy((bool(EDITOR_GET("interface/scene_tabs/always_show_close_button")) ? Tabs::CLOSE_BUTTON_SHOW_ALWAYS : Tabs::CLOSE_BUTTON_SHOW_ACTIVE_ONLY)); - Ref<Theme> theme = create_editor_theme(theme_base->get_theme()); + case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { + scene_tabs->set_tab_close_display_policy((bool(EDITOR_GET("interface/scene_tabs/always_show_close_button")) ? Tabs::CLOSE_BUTTON_SHOW_ALWAYS : Tabs::CLOSE_BUTTON_SHOW_ACTIVE_ONLY)); + Ref<Theme> theme = create_editor_theme(theme_base->get_theme()); - theme_base->set_theme(theme); - gui_base->set_theme(theme); + theme_base->set_theme(theme); + gui_base->set_theme(theme); - gui_base->add_style_override("panel", gui_base->get_stylebox("Background", "EditorStyles")); - scene_root_parent->add_style_override("panel", gui_base->get_stylebox("Content", "EditorStyles")); - bottom_panel->add_style_override("panel", gui_base->get_stylebox("panel", "TabContainer")); - scene_tabs->add_style_override("tab_fg", gui_base->get_stylebox("SceneTabFG", "EditorStyles")); - scene_tabs->add_style_override("tab_bg", gui_base->get_stylebox("SceneTabBG", "EditorStyles")); + gui_base->add_style_override("panel", gui_base->get_stylebox("Background", "EditorStyles")); + scene_root_parent->add_style_override("panel", gui_base->get_stylebox("Content", "EditorStyles")); + bottom_panel->add_style_override("panel", gui_base->get_stylebox("panel", "TabContainer")); + scene_tabs->add_style_override("tab_fg", gui_base->get_stylebox("SceneTabFG", "EditorStyles")); + scene_tabs->add_style_override("tab_bg", gui_base->get_stylebox("SceneTabBG", "EditorStyles")); - file_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); - project_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); - debug_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); - settings_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); - help_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); + file_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); + project_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); + debug_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); + settings_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); + help_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); - if (EDITOR_GET("interface/scene_tabs/resize_if_many_tabs")) { - scene_tabs->set_min_width(int(EDITOR_GET("interface/scene_tabs/minimum_width")) * EDSCALE); - } else { - scene_tabs->set_min_width(0); - } - _update_scene_tabs(); + if (EDITOR_GET("interface/scene_tabs/resize_if_many_tabs")) { + scene_tabs->set_min_width(int(EDITOR_GET("interface/scene_tabs/minimum_width")) * EDSCALE); + } else { + scene_tabs->set_min_width(0); + } + _update_scene_tabs(); - recent_scenes->set_as_minsize(); + recent_scenes->set_as_minsize(); - // debugger area - if (ScriptEditor::get_singleton()->get_debugger()->is_visible()) - bottom_panel->add_style_override("panel", gui_base->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")); + // debugger area + if (ScriptEditor::get_singleton()->get_debugger()->is_visible()) + bottom_panel->add_style_override("panel", gui_base->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")); - // update_icons - for (int i = 0; i < singleton->main_editor_buttons.size(); i++) { + // update_icons + for (int i = 0; i < singleton->main_editor_buttons.size(); i++) { - ToolButton *tb = singleton->main_editor_buttons[i]; - EditorPlugin *p_editor = singleton->editor_table[i]; - Ref<Texture> icon = p_editor->get_icon(); + ToolButton *tb = singleton->main_editor_buttons[i]; + EditorPlugin *p_editor = singleton->editor_table[i]; + Ref<Texture> icon = p_editor->get_icon(); - if (icon.is_valid()) { - tb->set_icon(icon); - } else if (singleton->gui_base->has_icon(p_editor->get_name(), "EditorIcons")) { - tb->set_icon(singleton->gui_base->get_icon(p_editor->get_name(), "EditorIcons")); + if (icon.is_valid()) { + tb->set_icon(icon); + } else if (singleton->gui_base->has_icon(p_editor->get_name(), "EditorIcons")) { + tb->set_icon(singleton->gui_base->get_icon(p_editor->get_name(), "EditorIcons")); + } } - } - _build_icon_type_cache(); + _build_icon_type_cache(); - play_button->set_icon(gui_base->get_icon("MainPlay", "EditorIcons")); - play_scene_button->set_icon(gui_base->get_icon("PlayScene", "EditorIcons")); - play_custom_scene_button->set_icon(gui_base->get_icon("PlayCustom", "EditorIcons")); - pause_button->set_icon(gui_base->get_icon("Pause", "EditorIcons")); - stop_button->set_icon(gui_base->get_icon("Stop", "EditorIcons")); + play_button->set_icon(gui_base->get_icon("MainPlay", "EditorIcons")); + play_scene_button->set_icon(gui_base->get_icon("PlayScene", "EditorIcons")); + play_custom_scene_button->set_icon(gui_base->get_icon("PlayCustom", "EditorIcons")); + pause_button->set_icon(gui_base->get_icon("Pause", "EditorIcons")); + stop_button->set_icon(gui_base->get_icon("Stop", "EditorIcons")); - prev_scene->set_icon(gui_base->get_icon("PrevScene", "EditorIcons")); - distraction_free->set_icon(gui_base->get_icon("DistractionFree", "EditorIcons")); - scene_tab_add->set_icon(gui_base->get_icon("Add", "EditorIcons")); + prev_scene->set_icon(gui_base->get_icon("PrevScene", "EditorIcons")); + distraction_free->set_icon(gui_base->get_icon("DistractionFree", "EditorIcons")); + scene_tab_add->set_icon(gui_base->get_icon("Add", "EditorIcons")); - // clear_button->set_icon(gui_base->get_icon("Close", "EditorIcons")); don't have access to that node. needs to become a class property - dock_tab_move_left->set_icon(theme->get_icon("Back", "EditorIcons")); - dock_tab_move_right->set_icon(theme->get_icon("Forward", "EditorIcons")); + // clear_button->set_icon(gui_base->get_icon("Close", "EditorIcons")); don't have access to that node. needs to become a class property + dock_tab_move_left->set_icon(theme->get_icon("Back", "EditorIcons")); + dock_tab_move_right->set_icon(theme->get_icon("Forward", "EditorIcons")); - PopupMenu *p = help_menu->get_popup(); - p->set_item_icon(p->get_item_index(HELP_SEARCH), gui_base->get_icon("HelpSearch", "EditorIcons")); - p->set_item_icon(p->get_item_index(HELP_DOCS), gui_base->get_icon("Instance", "EditorIcons")); - p->set_item_icon(p->get_item_index(HELP_QA), gui_base->get_icon("Instance", "EditorIcons")); - p->set_item_icon(p->get_item_index(HELP_ISSUES), gui_base->get_icon("Instance", "EditorIcons")); - p->set_item_icon(p->get_item_index(HELP_COMMUNITY), gui_base->get_icon("Instance", "EditorIcons")); - p->set_item_icon(p->get_item_index(HELP_ABOUT), gui_base->get_icon("Godot", "EditorIcons")); + PopupMenu *p = help_menu->get_popup(); + p->set_item_icon(p->get_item_index(HELP_SEARCH), gui_base->get_icon("HelpSearch", "EditorIcons")); + p->set_item_icon(p->get_item_index(HELP_DOCS), gui_base->get_icon("Instance", "EditorIcons")); + p->set_item_icon(p->get_item_index(HELP_QA), gui_base->get_icon("Instance", "EditorIcons")); + p->set_item_icon(p->get_item_index(HELP_ISSUES), gui_base->get_icon("Instance", "EditorIcons")); + p->set_item_icon(p->get_item_index(HELP_COMMUNITY), gui_base->get_icon("Instance", "EditorIcons")); + p->set_item_icon(p->get_item_index(HELP_ABOUT), gui_base->get_icon("Godot", "EditorIcons")); - _update_update_spinner(); - } + _update_update_spinner(); + } break; - if (p_what == Control::NOTIFICATION_RESIZED) { - _update_scene_tabs(); + case Control::NOTIFICATION_RESIZED: { + _update_scene_tabs(); + } break; } } diff --git a/editor/editor_sectioned_inspector.cpp b/editor/editor_sectioned_inspector.cpp index e7019e4ef6..ad6b280b6d 100644 --- a/editor/editor_sectioned_inspector.cpp +++ b/editor/editor_sectioned_inspector.cpp @@ -144,8 +144,9 @@ void SectionedInspector::_section_selected() { if (!sections->get_selected()) return; - filter->set_section(sections->get_selected()->get_metadata(0), sections->get_selected()->get_children() == NULL); - inspector->set_property_prefix(String(sections->get_selected()->get_metadata(0)) + "/"); + selected_category = sections->get_selected()->get_metadata(0); + filter->set_section(selected_category, sections->get_selected()->get_children() == NULL); + inspector->set_property_prefix(selected_category + "/"); } void SectionedInspector::set_current_section(const String &p_section) { @@ -197,8 +198,13 @@ void SectionedInspector::edit(Object *p_object) { filter->set_edited(p_object); inspector->edit(filter); - if (sections->get_root()->get_children()) { - sections->get_root()->get_children()->select(0); + TreeItem *first_item = sections->get_root(); + if (first_item) { + while (first_item->get_children()) + first_item = first_item->get_children(); + + first_item->select(0); + selected_category = first_item->get_metadata(0); } } else { @@ -208,7 +214,6 @@ void SectionedInspector::edit(Object *p_object) { void SectionedInspector::update_category_list() { - String selected_category = get_current_section(); sections->clear(); Object *o = ObjectDB::get_instance(obj); @@ -224,6 +229,10 @@ void SectionedInspector::update_category_list() { TreeItem *root = sections->create_item(); section_map[""] = root; + String filter; + if (search_box) + filter = search_box->get_text(); + for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) { PropertyInfo pi = E->get(); @@ -236,9 +245,6 @@ void SectionedInspector::update_category_list() { if (pi.name.find(":") != -1 || pi.name == "script" || pi.name == "resource_name" || pi.name == "resource_path" || pi.name == "resource_local_to_scene" || pi.name.begins_with("_global_script")) continue; - if (search_box && search_box->get_text() != String() && pi.name.findn(search_box->get_text()) == -1) - continue; - int sp = pi.name.find("/"); if (sp == -1) pi.name = "global/" + pi.name; @@ -246,6 +252,9 @@ void SectionedInspector::update_category_list() { Vector<String> sectionarr = pi.name.split("/"); String metasection; + if (!filter.empty() && !filter.is_subsequence_ofi(sectionarr[sectionarr.size() - 1].capitalize())) + continue; + int sc = MIN(2, sectionarr.size() - 1); for (int i = 0; i < sc; i++) { diff --git a/editor/editor_sectioned_inspector.h b/editor/editor_sectioned_inspector.h index c32f23890f..4395e9bb27 100644 --- a/editor/editor_sectioned_inspector.h +++ b/editor/editor_sectioned_inspector.h @@ -50,6 +50,8 @@ class SectionedInspector : public HSplitContainer { EditorInspector *inspector; LineEdit *search_box; + String selected_category; + static void _bind_methods(); void _section_selected(); diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 2c0449398e..223ca7a108 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -483,7 +483,9 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { // Completion _initial_set("text_editor/completion/idle_parse_delay", 2.0); hints["text_editor/completion/idle_parse_delay"] = PropertyInfo(Variant::REAL, "text_editor/completion/idle_parse_delay", PROPERTY_HINT_RANGE, "0.1, 10, 0.01"); - _initial_set("text_editor/completion/auto_brace_complete", false); + _initial_set("text_editor/completion/auto_brace_complete", true); + _initial_set("text_editor/completion/code_complete_delay", 0.3); + hints["text_editor/completion/code_complete_delay"] = PropertyInfo(Variant::REAL, "text_editor/completion/code_complete_delay", PROPERTY_HINT_RANGE, "0.01, 5, 0.01"); _initial_set("text_editor/completion/put_callhint_tooltip_below_current_line", true); _initial_set("text_editor/completion/callhint_tooltip_offset", Vector2()); _initial_set("text_editor/completion/complete_file_paths", true); diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 947d96f897..8e332ad20e 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -1298,7 +1298,7 @@ void FileSystemDock::_rename_operation_confirm() { _try_move_item(to_rename, new_path, file_renames, folder_renames); int current_tab = editor->get_current_tab(); - + _save_scenes_after_move(file_renames); // save scenes before updating _update_dependencies_after_move(file_renames); _update_resource_paths_after_move(file_renames); _update_project_settings_after_move(file_renames); @@ -1407,7 +1407,7 @@ void FileSystemDock::_move_operation_confirm(const String &p_to_path, bool overw if (is_moved) { int current_tab = editor->get_current_tab(); - + _save_scenes_after_move(file_renames); //save scenes before updating _update_dependencies_after_move(file_renames); _update_resource_paths_after_move(file_renames); _update_project_settings_after_move(file_renames); diff --git a/editor/icons/icon_vulkan.svg b/editor/icons/icon_vulkan.svg deleted file mode 100644 index 1d5fed0305..0000000000 --- a/editor/icons/icon_vulkan.svg +++ /dev/null @@ -1,127 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - version="1.1" - id="svg2" - width="48" - height="16" - viewBox="0 0 47.999999 16" - sodipodi:docname="icon_vulkan.svg" - inkscape:version="0.92.3 (2405546, 2018-03-11)"> - <metadata - id="metadata8"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> - </cc:Work> - </rdf:RDF> - </metadata> - <defs - id="defs6" /> - <sodipodi:namedview - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1" - objecttolerance="10" - gridtolerance="10" - guidetolerance="10" - inkscape:pageopacity="0" - inkscape:pageshadow="2" - inkscape:window-width="1853" - inkscape:window-height="1016" - id="namedview4" - showgrid="false" - inkscape:zoom="10.24" - inkscape:cx="9.4970674" - inkscape:cy="11.192118" - inkscape:window-x="67" - inkscape:window-y="27" - inkscape:window-maximized="1" - inkscape:current-layer="g8" /> - <path - style="fill:#000000;stroke-width:1.06666672" - d="" - id="path819" - inkscape:connector-curvature="0" /> - <path - style="fill:#000000;stroke-width:1.06666672" - d="" - id="path817" - inkscape:connector-curvature="0" /> - <g - transform="matrix(0.04333868,0,0,0.04333868,-4.0493236,-3.7704963)" - id="g8"> - <path - inkscape:connector-curvature="0" - d="m 724.1,432.41989 h -40.6 c 0,0 0,-99 0,-129.7 13,7.2 30.1,20.5 40.6,33.3 z" - id="path10" - style="fill:#e6555a;fill-opacity:1" /> - <g - id="g12" - style="fill:#e6555a;fill-opacity:1" - transform="translate(0,47.319882)"> - <path - inkscape:connector-curvature="0" - d="m 381.8,385.1 h -50.6 l -66,-204 h 46 l 45.4,143.5 h 0.6 l 46,-143.5 h 46.3 z" - id="path14" - style="fill:#e6555a;fill-opacity:1" /> - <path - inkscape:connector-curvature="0" - d="M 585.5,385.1 H 546.9 V 364.5 H 546 c -5.1,8.6 -11.8,14.8 -20,18.6 -8.2,3.8 -16.6,5.7 -25.1,5.7 -10.9,0 -19.8,-1.4 -26.7,-4.3 -7,-2.9 -12.4,-6.9 -16.4,-12.1 -4,-5.2 -6.8,-11.6 -8.4,-19.1 -1.6,-7.5 -2.4,-15.9 -2.4,-25 v -90.9 h 40.6 v 83.4 c 0,12.2 1.9,21.3 5.7,27.3 3.8,6 10.6,9 20.3,9 11,0 19.1,-3.3 24,-9.9 5,-6.6 7.4,-17.4 7.4,-32.4 v -77.4 h 40.6 v 147.7 z" - id="path16" - style="fill:#e6555a;fill-opacity:1" /> - </g> - <polygon - points="730.8,296.2 730.7,290.5 781.9,237.3 829.9,237.3 774.2,291.6 836.2,385.1 787,385.1 " - id="polygon18" - style="fill:#e6555a;fill-opacity:1" - transform="translate(0,47.319882)" /> - <path - inkscape:connector-curvature="0" - d="m 843.6,330.11989 c 0.6,-9.5 3,-17.4 7.2,-23.7 4.2,-6.3 9.5,-11.3 16,-15.1 6.5,-3.8 13.8,-6.5 21.9,-8.1 8.1,-1.6 16.2,-2.4 24.4,-2.4 7.4,0 15,0.5 22.6,1.6 7.6,1.1 14.6,3.1 20.9,6.1 6.3,3.1 11.4,7.3 15.4,12.7 4,5.4 6,12.6 6,21.6 v 76.9 c 0,6.7 0.4,13.1 1.1,19.1 0.8,6.1 2.1,10.7 4,13.7 h -41.2 c -0.8,-2.3 -1.4,-4.6 -1.9,-7 -0.5,-2.4 -0.8,-4.8 -1,-7.3 -6.5,6.7 -14.1,11.3 -22.9,14 -8.8,2.7 -17.7,4 -26.9,4 -7,0 -13.6,-0.9 -19.7,-2.6 -6.1,-1.7 -11.4,-4.4 -16,-8 -4.6,-3.6 -8.2,-8.2 -10.7,-13.7 -2.6,-5.5 -3.9,-12.1 -3.9,-19.7 0,-8.4 1.5,-15.3 4.4,-20.7 3,-5.4 6.8,-9.8 11.4,-13 4.7,-3.2 10,-5.7 16,-7.3 6,-1.6 12,-2.9 18.1,-3.9 6.1,-0.9 12.1,-1.7 18,-2.3 5.9,-0.6 11.1,-1.4 15.7,-2.6 4.6,-1.1 8.2,-2.8 10.9,-5 2.7,-2.2 3.9,-5.4 3.7,-9.6 0,-4.4 -0.7,-7.9 -2.2,-10.4 -1.4,-2.6 -3.3,-4.6 -5.7,-6 -2.4,-1.4 -5.1,-2.4 -8.3,-2.9 -3.1,-0.5 -6.5,-0.7 -10.1,-0.7 -8,0 -14.3,1.7 -18.9,5.1 -4.6,3.4 -7.2,9.1 -8,17.1 h -40.3 z m 93.8,30 c -1.7,1.5 -3.9,2.7 -6.4,3.6 -2.6,0.9 -5.3,1.6 -8.3,2.2 -2.9,0.6 -6,1 -9.3,1.4 -3.2,0.4 -6.5,0.9 -9.7,1.4 -3,0.6 -6,1.3 -9,2.3 -3,1 -5.5,2.2 -7.7,3.9 -2.2,1.6 -4,3.7 -5.3,6.1 -1.3,2.5 -2,5.6 -2,9.4 0,3.6 0.7,6.7 2,9.1 1.3,2.5 3.1,4.4 5.4,5.9 2.3,1.4 5,2.4 8,3 3.1,0.6 6.2,0.9 9.4,0.9 8,0 14.2,-1.3 18.6,-4 4.4,-2.7 7.6,-5.9 9.7,-9.6 2.1,-3.7 3.4,-7.5 3.9,-11.3 0.5,-3.8 0.7,-6.9 0.7,-9.1 z" - id="path20" - style="fill:#e6555a;fill-opacity:1" /> - <path - inkscape:connector-curvature="0" - d="m 1004.2,284.61989 h 38.6 v 20.6 h 0.9 c 5.1,-8.6 11.8,-14.8 20,-18.7 8.2,-3.9 16.6,-5.9 25.1,-5.9 10.9,0 19.8,1.5 26.7,4.4 7,3 12.4,7.1 16.4,12.3 4,5.2 6.8,11.6 8.4,19.1 1.6,7.5 2.4,15.9 2.4,25 v 90.9 h -40.6 v -83.4 c 0,-12.2 -1.9,-21.3 -5.7,-27.3 -3.8,-6 -10.6,-9 -20.3,-9 -11,0 -19,3.3 -24,9.9 -5,6.6 -7.4,17.4 -7.4,32.4 v 77.4 h -40.6 v -147.7 z" - id="path22" - style="fill:#e6555a;fill-opacity:1" /> - <g - id="g24" - style="fill:#e6555a;fill-opacity:1" - transform="translate(0,47.319882)"> - <path - inkscape:connector-curvature="0" - d="M 612.4,211.8 V 385 H 653 V 234.2 c -13.1,-8 -26.6,-15.5 -40.6,-22.4 z" - id="path26" - style="fill:#e6555a;fill-opacity:1" /> - </g> - <path - inkscape:connector-curvature="0" - d="m 198.4,266.51989 c 23.5,-68.9 164.2,-94.2 314.1,-56.4 90,22.6 163.5,66.5 211.5,109.9 -21.7,-57.6 -127.3,-139.6 -272.8,-167.7 -164.5,-31.8 -326.7,-3.9 -346.8,69.1 -14.5,52.7 49.2,114.5 147.7,156.7 -44.3,-35.8 -65.8,-76 -53.7,-111.6 z" - id="path28" - style="fill:#e6555a;fill-opacity:1" /> - <g - id="g30" - style="fill:#e6555a;fill-opacity:1" - transform="translate(0,47.319882)"> - <path - inkscape:connector-curvature="0" - d="M 724.2,247.6 V 181 h -40.6 v 20.2 c 17.3,15.5 31,31.2 40.6,46.4 z" - id="path32" - style="fill:#e6555a;fill-opacity:1" /> - </g> - </g> -</svg> diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index 1503258ff5..31b11d8bea 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -177,6 +177,8 @@ void EditorAssetLibraryItemDescription::set_image(int p_type, int p_index, const tex->create_from_image(thumbnail); preview_images[i].button->set_icon(tex); + // Make it clearer that clicking it will open an external link + preview_images[i].button->set_default_cursor_shape(CURSOR_POINTING_HAND); } else { preview_images[i].button->set_icon(p_image); } @@ -403,54 +405,60 @@ void EditorAssetLibraryItemDownload::configure(const String &p_title, int p_asse void EditorAssetLibraryItemDownload::_notification(int p_what) { - if (p_what == NOTIFICATION_PROCESS) { + switch (p_what) { - // Make the progress bar visible again when retrying the download - progress->set_modulate(Color(1, 1, 1, 1)); + case NOTIFICATION_READY: { - if (download->get_downloaded_bytes() > 0) { - progress->set_max(download->get_body_size()); - progress->set_value(download->get_downloaded_bytes()); - } + add_style_override("panel", get_stylebox("panel", "TabContainer")); + } break; + case NOTIFICATION_PROCESS: { - int cstatus = download->get_http_client_status(); + // Make the progress bar visible again when retrying the download. + progress->set_modulate(Color(1, 1, 1, 1)); - if (cstatus == HTTPClient::STATUS_BODY) { - if (download->get_body_size() > 0) { - status->set_text( - vformat( - TTR("Downloading (%s / %s)..."), - String::humanize_size(download->get_downloaded_bytes()), - String::humanize_size(download->get_body_size()))); - } else { - // Total file size is unknown, so it cannot be displayed - status->set_text(TTR("Downloading...")); + if (download->get_downloaded_bytes() > 0) { + progress->set_max(download->get_body_size()); + progress->set_value(download->get_downloaded_bytes()); } - } - if (cstatus != prev_status) { - switch (cstatus) { + int cstatus = download->get_http_client_status(); + + if (cstatus == HTTPClient::STATUS_BODY) { + if (download->get_body_size() > 0) { + status->set_text(vformat( + TTR("Downloading (%s / %s)..."), + String::humanize_size(download->get_downloaded_bytes()), + String::humanize_size(download->get_body_size()))); + } else { + // Total file size is unknown, so it cannot be displayed. + status->set_text(TTR("Downloading...")); + } + } - case HTTPClient::STATUS_RESOLVING: { - status->set_text(TTR("Resolving...")); - progress->set_max(1); - progress->set_value(0); - } break; - case HTTPClient::STATUS_CONNECTING: { - status->set_text(TTR("Connecting...")); - progress->set_max(1); - progress->set_value(0); - } break; - case HTTPClient::STATUS_REQUESTING: { - status->set_text(TTR("Requesting...")); - progress->set_max(1); - progress->set_value(0); - } break; - default: { + if (cstatus != prev_status) { + switch (cstatus) { + + case HTTPClient::STATUS_RESOLVING: { + status->set_text(TTR("Resolving...")); + progress->set_max(1); + progress->set_value(0); + } break; + case HTTPClient::STATUS_CONNECTING: { + status->set_text(TTR("Connecting...")); + progress->set_max(1); + progress->set_value(0); + } break; + case HTTPClient::STATUS_REQUESTING: { + status->set_text(TTR("Requesting...")); + progress->set_max(1); + progress->set_value(0); + } break; + default: { + } } + prev_status = cstatus; } - prev_status = cstatus; - } + } break; } } void EditorAssetLibraryItemDownload::_close() { @@ -531,7 +539,7 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() { hb2->add_spacer(); install = memnew(Button); - install->set_text(TTR("Install")); + install->set_text(TTR("Install...")); install->set_disabled(true); install->connect("pressed", this, "_install"); @@ -564,6 +572,7 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() { void EditorAssetLibrary::_notification(int p_what) { switch (p_what) { + case NOTIFICATION_READY: { error_tr->set_texture(get_icon("Error", "EditorIcons")); @@ -573,14 +582,12 @@ void EditorAssetLibrary::_notification(int p_what) { error_label->raise(); } break; - case NOTIFICATION_VISIBILITY_CHANGED: { if (is_visible()) { - _repository_changed(0); // Update when shown for the first time + _repository_changed(0); // Update when shown for the first time. } } break; - case NOTIFICATION_PROCESS: { HTTPClient::Status s = request->get_http_client_status(); @@ -619,6 +626,7 @@ void EditorAssetLibrary::_notification(int p_what) { case NOTIFICATION_THEME_CHANGED: { library_scroll_bg->add_style_override("panel", get_stylebox("bg", "Tree")); + downloads_scroll->add_style_override("bg", get_stylebox("bg", "Tree")); error_tr->set_texture(get_icon("Error", "EditorIcons")); reverse->set_icon(get_icon("Sort", "EditorIcons")); filter->set_right_icon(get_icon("Search", "EditorIcons")); @@ -749,7 +757,7 @@ void EditorAssetLibrary::_image_update(bool use_cache, bool final, const PoolByt float scale_ratio = max_height / (image->get_height() * EDSCALE); if (scale_ratio < 1) { - image->resize(image->get_width() * EDSCALE * scale_ratio, image->get_height() * EDSCALE * scale_ratio, Image::INTERPOLATE_CUBIC); + image->resize(image->get_width() * EDSCALE * scale_ratio, image->get_height() * EDSCALE * scale_ratio, Image::INTERPOLATE_LANCZOS); } } break; case IMAGE_QUEUE_SCREENSHOT: { @@ -757,7 +765,7 @@ void EditorAssetLibrary::_image_update(bool use_cache, bool final, const PoolByt float scale_ratio = max_height / (image->get_height() * EDSCALE); if (scale_ratio < 1) { - image->resize(image->get_width() * EDSCALE * scale_ratio, image->get_height() * EDSCALE * scale_ratio, Image::INTERPOLATE_CUBIC); + image->resize(image->get_width() * EDSCALE * scale_ratio, image->get_height() * EDSCALE * scale_ratio, Image::INTERPOLATE_LANCZOS); } } break; } @@ -1238,9 +1246,6 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const description->connect("confirmed", this, "_install_asset"); description->configure(r["title"], r["asset_id"], category_map[r["category_id"]], r["category_id"], r["author"], r["author_id"], r["cost"], r["version"], r["version_string"], r["description"], r["download_url"], r["browse_url"], r["download_hash"]); - /*item->connect("asset_selected",this,"_select_asset"); - item->connect("author_selected",this,"_select_author"); - item->connect("category_selected",this,"_category_selected");*/ if (r.has("icon_url") && r["icon_url"] != "") { _request_image(description->get_instance_id(), r["icon_url"], IMAGE_QUEUE_ICON, 0); @@ -1267,9 +1272,8 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const if (p.has("thumbnail")) { _request_image(description->get_instance_id(), p["thumbnail"], IMAGE_QUEUE_THUMBNAIL, i); } - if (is_video) { - //_request_image(description->get_instance_id(),p["link"],IMAGE_QUEUE_SCREENSHOT,i); - } else { + + if (!is_video) { _request_image(description->get_instance_id(), p["link"], IMAGE_QUEUE_SCREENSHOT, i); } } @@ -1390,19 +1394,16 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { reverse = memnew(ToolButton); reverse->set_toggle_mode(true); reverse->connect("toggled", this, "_rerun_search"); - //reverse->set_text(TTR("Reverse")); + reverse->set_tooltip(TTR("Reverse sorting.")); search_hb2->add_child(reverse); search_hb2->add_child(memnew(VSeparator)); - //search_hb2->add_spacer(); - search_hb2->add_child(memnew(Label(TTR("Category:") + " "))); categories = memnew(OptionButton); categories->add_item(TTR("All")); search_hb2->add_child(categories); categories->set_h_size_flags(SIZE_EXPAND_FILL); - //search_hb2->add_spacer(); categories->connect("item_selected", this, "_rerun_search"); search_hb2->add_child(memnew(VSeparator)); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 1f601e64fa..d4eab888cc 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -860,20 +860,47 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve Ref<InputEventMouseButton> b = p_event; Ref<InputEventMouseMotion> m = p_event; - // Start dragging a guide if (drag_type == DRAG_NONE) { - if (b.is_valid() && b->get_button_index() == BUTTON_LEFT && b->is_pressed()) { - if (show_guides && show_rulers && EditorNode::get_singleton()->get_edited_scene()) { - Transform2D xform = viewport_scrollable->get_transform() * transform; - // Retrieve the guide lists - Array vguides; - if (EditorNode::get_singleton()->get_edited_scene()->has_meta("_edit_vertical_guides_")) { - vguides = EditorNode::get_singleton()->get_edited_scene()->get_meta("_edit_vertical_guides_"); + if (show_guides && show_rulers && EditorNode::get_singleton()->get_edited_scene()) { + Transform2D xform = viewport_scrollable->get_transform() * transform; + // Retrieve the guide lists + Array vguides; + if (EditorNode::get_singleton()->get_edited_scene()->has_meta("_edit_vertical_guides_")) { + vguides = EditorNode::get_singleton()->get_edited_scene()->get_meta("_edit_vertical_guides_"); + } + Array hguides; + if (EditorNode::get_singleton()->get_edited_scene()->has_meta("_edit_horizontal_guides_")) { + hguides = EditorNode::get_singleton()->get_edited_scene()->get_meta("_edit_horizontal_guides_"); + } + + // Hover over guides + float minimum = 1e20; + is_hovering_h_guide = false; + is_hovering_v_guide = false; + + if (m.is_valid() && m->get_position().x < RULER_WIDTH) { + // Check if we are hovering an existing horizontal guide + for (int i = 0; i < hguides.size(); i++) { + if (ABS(xform.xform(Point2(0, hguides[i])).y - m->get_position().y) < MIN(minimum, 8)) { + is_hovering_h_guide = true; + is_hovering_v_guide = false; + break; + } } - Array hguides; - if (EditorNode::get_singleton()->get_edited_scene()->has_meta("_edit_horizontal_guides_")) { - hguides = EditorNode::get_singleton()->get_edited_scene()->get_meta("_edit_horizontal_guides_"); + + } else if (m.is_valid() && m->get_position().y < RULER_WIDTH) { + // Check if we are hovering an existing vertical guide + for (int i = 0; i < vguides.size(); i++) { + if (ABS(xform.xform(Point2(vguides[i], 0)).x - m->get_position().x) < MIN(minimum, 8)) { + is_hovering_v_guide = true; + is_hovering_h_guide = false; + break; + } } + } + + // Start dragging a guide + if (b.is_valid() && b->get_button_index() == BUTTON_LEFT && b->is_pressed()) { // Press button if (b->get_position().x < RULER_WIDTH && b->get_position().y < RULER_WIDTH) { @@ -883,7 +910,6 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve return true; } else if (b->get_position().x < RULER_WIDTH) { // Check if we drag an existing horizontal guide - float minimum = 1e20; dragged_guide_index = -1; for (int i = 0; i < hguides.size(); i++) { if (ABS(xform.xform(Point2(0, hguides[i])).y - b->get_position().y) < MIN(minimum, 8)) { @@ -901,7 +927,6 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve return true; } else if (b->get_position().y < RULER_WIDTH) { // Check if we drag an existing vertical guide - float minimum = 1e20; dragged_guide_index = -1; for (int i = 0; i < vguides.size(); i++) { if (ABS(xform.xform(Point2(vguides[i], 0)).x - b->get_position().x) < MIN(minimum, 8)) { @@ -956,14 +981,14 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve // Adds a new vertical guide if (dragged_guide_index >= 0) { vguides[dragged_guide_index] = edited.x; - undo_redo->create_action(TTR("Move vertical guide")); + undo_redo->create_action(TTR("Move Vertical Guide")); undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", vguides); undo_redo->add_undo_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", prev_vguides); undo_redo->add_undo_method(viewport, "update"); undo_redo->commit_action(); } else { vguides.push_back(edited.x); - undo_redo->create_action(TTR("Create new vertical guide")); + undo_redo->create_action(TTR("Create Vertical Guide")); undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", vguides); undo_redo->add_undo_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", prev_vguides); undo_redo->add_undo_method(viewport, "update"); @@ -972,7 +997,7 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve } else { if (dragged_guide_index >= 0) { vguides.remove(dragged_guide_index); - undo_redo->create_action(TTR("Remove vertical guide")); + undo_redo->create_action(TTR("Remove Vertical Guide")); undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", vguides); undo_redo->add_undo_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", prev_vguides); undo_redo->add_undo_method(viewport, "update"); @@ -985,14 +1010,14 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve // Adds a new horizontal guide if (dragged_guide_index >= 0) { hguides[dragged_guide_index] = edited.y; - undo_redo->create_action(TTR("Move horizontal guide")); + undo_redo->create_action(TTR("Move Horizontal Guide")); undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", hguides); undo_redo->add_undo_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", prev_hguides); undo_redo->add_undo_method(viewport, "update"); undo_redo->commit_action(); } else { hguides.push_back(edited.y); - undo_redo->create_action(TTR("Create new horizontal guide")); + undo_redo->create_action(TTR("Create Horizontal Guide")); undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", hguides); undo_redo->add_undo_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", prev_hguides); undo_redo->add_undo_method(viewport, "update"); @@ -1001,7 +1026,7 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve } else { if (dragged_guide_index >= 0) { hguides.remove(dragged_guide_index); - undo_redo->create_action(TTR("Remove horizontal guide")); + undo_redo->create_action(TTR("Remove Horizontal Guide")); undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", hguides); undo_redo->add_undo_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", prev_hguides); undo_redo->add_undo_method(viewport, "update"); @@ -1015,7 +1040,7 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve // Adds a new horizontal guide a new vertical guide vguides.push_back(edited.x); hguides.push_back(edited.y); - undo_redo->create_action(TTR("Create new horizontal and vertical guides")); + undo_redo->create_action(TTR("Create Horizontal and Vertical Guides")); undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", vguides); undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_horizontal_guides_", hguides); undo_redo->add_undo_method(EditorNode::get_singleton()->get_edited_scene(), "set_meta", "_edit_vertical_guides_", prev_vguides); @@ -2221,8 +2246,6 @@ void CanvasItemEditor::_gui_input_viewport(const Ref<InputEvent> &p_event) { //printf("Plugin\n"); } else if ((accepted = _gui_input_open_scene_on_double_click(p_event))) { //printf("Open scene on double click\n"); - } else if ((accepted = _gui_input_anchors(p_event))) { - //printf("Anchors\n"); } else if ((accepted = _gui_input_scale(p_event))) { //printf("Set scale\n"); } else if ((accepted = _gui_input_pivot(p_event))) { @@ -2233,6 +2256,8 @@ void CanvasItemEditor::_gui_input_viewport(const Ref<InputEvent> &p_event) { //printf("Rotate\n"); } else if ((accepted = _gui_input_move(p_event))) { //printf("Move\n"); + } else if ((accepted = _gui_input_anchors(p_event))) { + //printf("Anchors\n"); } else if ((accepted = _gui_input_select(p_event))) { //printf("Selection\n"); } else { @@ -2268,14 +2293,17 @@ void CanvasItemEditor::_gui_input_viewport(const Ref<InputEvent> &p_event) { break; case DRAG_LEFT: case DRAG_RIGHT: + case DRAG_V_GUIDE: c = CURSOR_HSIZE; break; case DRAG_TOP: case DRAG_BOTTOM: + case DRAG_H_GUIDE: c = CURSOR_VSIZE; break; case DRAG_TOP_LEFT: case DRAG_BOTTOM_RIGHT: + case DRAG_DOUBLE_GUIDE: c = CURSOR_FDIAGSIZE; break; case DRAG_TOP_RIGHT: @@ -2288,6 +2316,12 @@ void CanvasItemEditor::_gui_input_viewport(const Ref<InputEvent> &p_event) { default: break; } + + if (is_hovering_h_guide) + c = CURSOR_VSIZE; + else if (is_hovering_v_guide) + c = CURSOR_HSIZE; + viewport->set_default_cursor_shape(c); // Grab focus diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h index a46682d494..2a85b20424 100644 --- a/editor/plugins/canvas_item_editor_plugin.h +++ b/editor/plugins/canvas_item_editor_plugin.h @@ -371,6 +371,8 @@ private: List<CanvasItem *> drag_selection; int dragged_guide_index; Point2 dragged_guide_pos; + bool is_hovering_h_guide; + bool is_hovering_v_guide; bool updating_value_dialog; diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 9fd694ee0d..a593a92b97 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -283,7 +283,8 @@ void SpatialEditorViewport::_select_clicked(bool p_append, bool p_single) { node = node->get_parent(); } - _select(selected, clicked_wants_append, true); + if (!_is_node_locked(selected)) + _select(selected, clicked_wants_append, true); } void SpatialEditorViewport::_select(Node *p_node, bool p_append, bool p_single) { @@ -513,7 +514,7 @@ void SpatialEditorViewport::_select_region() { for (int i = 0; i < instances.size(); i++) { Spatial *sp = Object::cast_to<Spatial>(ObjectDB::get_instance(instances[i])); - if (!sp) + if (!sp && _is_node_locked(sp)) continue; Node *item = Object::cast_to<Node>(sp); @@ -536,6 +537,8 @@ void SpatialEditorViewport::_select_region() { if (selected.find(item) != -1) continue; + if (_is_node_locked(Object::cast_to<Spatial>(item))) continue; + Ref<EditorSpatialGizmo> seg = sp->get_gizmo(); if (!seg.is_valid()) @@ -833,7 +836,9 @@ void SpatialEditorViewport::_surface_focus_exit() { view_menu->set_disable_shortcuts(true); } - +bool SpatialEditorViewport ::_is_node_locked(const Node *p_node) { + return p_node->has_meta("_edit_lock_") && p_node->get_meta("_edit_lock_"); +} void SpatialEditorViewport::_list_select(Ref<InputEventMouseButton> b) { _find_items_at_pos(b->get_position(), clicked_includes_current, selection_results, b->get_shift()); diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h index b4e2f028d2..1a32d6e047 100644 --- a/editor/plugins/spatial_editor_plugin.h +++ b/editor/plugins/spatial_editor_plugin.h @@ -364,7 +364,7 @@ private: Camera *preview; bool previewing_cinema; - + bool _is_node_locked(const Node *p_node); void _preview_exited_scene(); void _toggle_camera_preview(bool); void _toggle_cinema_preview(bool); diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index 8f58fbd6ab..cb48b5eaa5 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -1021,15 +1021,21 @@ bool TextureRegionEditorPlugin::handles(Object *p_object) const { return p_object->is_class("Sprite") || p_object->is_class("Sprite3D") || p_object->is_class("NinePatchRect") || p_object->is_class("StyleBoxTexture") || p_object->is_class("AtlasTexture"); } +void TextureRegionEditorPlugin::_editor_visiblity_changed() { + manually_hidden = !region_editor->is_visible_in_tree(); +} + void TextureRegionEditorPlugin::make_visible(bool p_visible) { if (p_visible) { texture_region_button->show(); - if (region_editor->is_stylebox() || region_editor->is_atlas_texture() || region_editor->is_ninepatch() || (region_editor->get_sprite() && region_editor->get_sprite()->is_region()) || (region_editor->get_sprite_3d() && region_editor->get_sprite_3d()->is_region()) || texture_region_button->is_pressed()) { + bool is_node_configured = region_editor->is_stylebox() || region_editor->is_atlas_texture() || region_editor->is_ninepatch() || (region_editor->get_sprite() && region_editor->get_sprite()->is_region()) || (region_editor->get_sprite_3d() && region_editor->get_sprite_3d()->is_region()); + if ((is_node_configured && !manually_hidden) || texture_region_button->is_pressed()) { editor->make_bottom_panel_item_visible(region_editor); } } else { if (region_editor->is_visible_in_tree()) { editor->hide_bottom_panel(); + manually_hidden = false; } texture_region_button->hide(); region_editor->edit(NULL); @@ -1076,12 +1082,18 @@ void TextureRegionEditorPlugin::set_state(const Dictionary &p_state) { } } +void TextureRegionEditorPlugin::_bind_methods() { + ClassDB::bind_method(D_METHOD("_editor_visiblity_changed"), &TextureRegionEditorPlugin::_editor_visiblity_changed); +} + TextureRegionEditorPlugin::TextureRegionEditorPlugin(EditorNode *p_node) { + manually_hidden = false; editor = p_node; - region_editor = memnew(TextureRegionEditor(p_node)); + region_editor = memnew(TextureRegionEditor(p_node)); region_editor->set_custom_minimum_size(Size2(0, 200) * EDSCALE); region_editor->hide(); + region_editor->connect("visibility_changed", this, "_editor_visiblity_changed"); texture_region_button = p_node->add_bottom_panel_item(TTR("TextureRegion"), region_editor); texture_region_button->hide(); diff --git a/editor/plugins/texture_region_editor_plugin.h b/editor/plugins/texture_region_editor_plugin.h index a49e0fb96c..4eb84ae176 100644 --- a/editor/plugins/texture_region_editor_plugin.h +++ b/editor/plugins/texture_region_editor_plugin.h @@ -145,10 +145,16 @@ public: class TextureRegionEditorPlugin : public EditorPlugin { GDCLASS(TextureRegionEditorPlugin, EditorPlugin); + bool manually_hidden; Button *texture_region_button; TextureRegionEditor *region_editor; EditorNode *editor; +protected: + static void _bind_methods(); + + void _editor_visiblity_changed(); + public: virtual String get_name() const { return "TextureRegion"; } bool has_main_screen() const { return false; } diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index 25e812e31c..766890242f 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -1467,15 +1467,28 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) { return true; } - if (ED_IS_SHORTCUT("tile_map_editor/mirror_x", p_event)) { - flip_h = !flip_h; - _update_palette(); + if (ED_IS_SHORTCUT("tile_map_editor/rotate_left", p_event)) { + _rotate(-1); CanvasItemEditor::get_singleton()->update_viewport(); return true; } - if (ED_IS_SHORTCUT("tile_map_editor/mirror_y", p_event)) { - flip_v = !flip_v; - _update_palette(); + if (ED_IS_SHORTCUT("tile_map_editor/rotate_right", p_event)) { + _rotate(1); + CanvasItemEditor::get_singleton()->update_viewport(); + return true; + } + if (ED_IS_SHORTCUT("tile_map_editor/flip_horizontal", p_event)) { + _flip_horizontal(); + CanvasItemEditor::get_singleton()->update_viewport(); + return true; + } + if (ED_IS_SHORTCUT("tile_map_editor/flip_vertical", p_event)) { + _flip_vertical(); + CanvasItemEditor::get_singleton()->update_viewport(); + return true; + } + if (ED_IS_SHORTCUT("tile_map_editor/clear_transform", p_event)) { + _clear_transform(); CanvasItemEditor::get_singleton()->update_viewport(); return true; } @@ -1917,8 +1930,6 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { ED_SHORTCUT("tile_map_editor/erase_selection", TTR("Erase Selection"), KEY_DELETE); ED_SHORTCUT("tile_map_editor/find_tile", TTR("Find Tile"), KEY_MASK_CMD + KEY_F); ED_SHORTCUT("tile_map_editor/transpose", TTR("Transpose"), KEY_T); - ED_SHORTCUT("tile_map_editor/mirror_x", TTR("Mirror X"), KEY_A); - ED_SHORTCUT("tile_map_editor/mirror_y", TTR("Mirror Y"), KEY_S); HBoxContainer *tool_hb = memnew(HBoxContainer); add_child(tool_hb); @@ -2044,30 +2055,35 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { rotate_left_button->set_tooltip(TTR("Rotate Left")); rotate_left_button->set_focus_mode(FOCUS_NONE); rotate_left_button->connect("pressed", this, "_rotate", varray(-1)); + rotate_left_button->set_shortcut(ED_SHORTCUT("tile_map_editor/rotate_left", TTR("Rotate Left"), KEY_A)); tool_hb->add_child(rotate_left_button); rotate_right_button = memnew(ToolButton); rotate_right_button->set_tooltip(TTR("Rotate Right")); rotate_right_button->set_focus_mode(FOCUS_NONE); rotate_right_button->connect("pressed", this, "_rotate", varray(1)); + rotate_right_button->set_shortcut(ED_SHORTCUT("tile_map_editor/rotate_right", TTR("Rotate Right"), KEY_S)); tool_hb->add_child(rotate_right_button); flip_horizontal_button = memnew(ToolButton); flip_horizontal_button->set_tooltip(TTR("Flip Horizontally")); flip_horizontal_button->set_focus_mode(FOCUS_NONE); flip_horizontal_button->connect("pressed", this, "_flip_horizontal"); + flip_horizontal_button->set_shortcut(ED_SHORTCUT("tile_map_editor/flip_horizontal", TTR("Flip Horizontally"), KEY_X)); tool_hb->add_child(flip_horizontal_button); flip_vertical_button = memnew(ToolButton); flip_vertical_button->set_tooltip(TTR("Flip Vertically")); flip_vertical_button->set_focus_mode(FOCUS_NONE); flip_vertical_button->connect("pressed", this, "_flip_vertical"); + flip_vertical_button->set_shortcut(ED_SHORTCUT("tile_map_editor/flip_vertical", TTR("Flip Vertically"), KEY_Z)); tool_hb->add_child(flip_vertical_button); clear_transform_button = memnew(ToolButton); clear_transform_button->set_tooltip(TTR("Clear Transform")); clear_transform_button->set_focus_mode(FOCUS_NONE); clear_transform_button->connect("pressed", this, "_clear_transform"); + clear_transform_button->set_shortcut(ED_SHORTCUT("tile_map_editor/clear_transform", TTR("Clear Transform"), KEY_W)); tool_hb->add_child(clear_transform_button); clear_transform_button->set_disabled(true); diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 5c505e0c06..cd8e36f68b 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -542,6 +542,9 @@ void VisualShaderEditor::_update_graph() { button->set_custom_minimum_size(Size2(30, 0) * EDSCALE); button->connect("draw", this, "_draw_color_over_button", varray(button, default_value)); } break; + case Variant::BOOL: { + button->set_text(((bool)default_value) ? "true" : "false"); + } break; case Variant::INT: case Variant::REAL: { button->set_text(String::num(default_value, 4)); @@ -2272,8 +2275,9 @@ VisualShaderEditor::VisualShaderEditor() { add_options.push_back(AddOption("CubeMap", "Textures", "Functions", "VisualShaderNodeCubeMap", TTR("Perform the cubic texture lookup."), -1, VisualShaderNode::PORT_TYPE_COLOR)); add_options.push_back(AddOption("Texture", "Textures", "Functions", "VisualShaderNodeTexture", TTR("Perform the texture lookup."), -1, VisualShaderNode::PORT_TYPE_COLOR)); - add_options.push_back(AddOption("CubeMapUniform", "Textures", "Variables", "VisualShaderNodeCubeMapUniform", TTR("Cubic texture uniform."), -1, VisualShaderNode::PORT_TYPE_COLOR)); - add_options.push_back(AddOption("TextureUniform", "Textures", "Variables", "VisualShaderNodeTextureUniform", TTR("2D texture uniform."), -1, VisualShaderNode::PORT_TYPE_COLOR)); + add_options.push_back(AddOption("CubeMapUniform", "Textures", "Variables", "VisualShaderNodeCubeMapUniform", TTR("Cubic texture uniform lookup."), -1, VisualShaderNode::PORT_TYPE_COLOR)); + add_options.push_back(AddOption("TextureUniform", "Textures", "Variables", "VisualShaderNodeTextureUniform", TTR("2D texture uniform lookup."), -1, VisualShaderNode::PORT_TYPE_COLOR)); + add_options.push_back(AddOption("TextureUniformTriplanar", "Textures", "Variables", "VisualShaderNodeTextureUniformTriplanar", TTR("2D texture uniform lookup with triplanar."), -1, VisualShaderNode::PORT_TYPE_COLOR, VisualShader::TYPE_FRAGMENT | VisualShader::TYPE_LIGHT, Shader::MODE_SPATIAL)); // TRANSFORM diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 935946bf24..c43d164078 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -394,7 +394,11 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { if (!profile_allow_editing) { break; } - create_dialog->popup_create(false, true, scene_tree->get_selected()->get_class()); + + Node *selected = scene_tree->get_selected(); + if (selected) + create_dialog->popup_create(false, true, selected->get_class()); + } break; case TOOL_ATTACH_SCRIPT: { diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index 445ca3a792..c1a14685b0 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -70,7 +70,8 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item, int p_column, int p_i } } else if (p_id == BUTTON_SCRIPT) { RefPtr script = n->get_script(); - if (!script.is_null()) + Ref<Script> script_typed = script; + if (!script_typed.is_null()) emit_signal("open_script", script); } else if (p_id == BUTTON_VISIBILITY) { @@ -210,7 +211,8 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { if (connect_to_script_mode) { Color accent = get_color("accent_color", "Editor"); - if (!p_node->get_script().is_null()) { + Ref<Script> script = p_node->get_script(); + if (!script.is_null()) { //has script item->add_button(0, get_icon("Script", "EditorIcons"), BUTTON_SCRIPT); } else { @@ -290,8 +292,8 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { if (!p_node->is_connected("script_changed", this, "_node_script_changed")) p_node->connect("script_changed", this, "_node_script_changed", varray(p_node)); - if (!p_node->get_script().is_null()) { - Ref<Script> script = p_node->get_script(); + Ref<Script> script = p_node->get_script(); + if (!script.is_null()) { item->add_button(0, get_icon("Script", "EditorIcons"), BUTTON_SCRIPT, false, TTR("Open Script:") + " " + script->get_path()); } diff --git a/main/main.cpp b/main/main.cpp index ef5c4109db..7e69864e1e 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1880,6 +1880,7 @@ bool Main::iteration() { double scaled_step = step * time_scale; Engine::get_singleton()->_frame_step = step; + Engine::get_singleton()->_physics_interpolation_fraction = advance.interpolation_fraction; uint64_t physics_process_ticks = 0; uint64_t idle_process_ticks = 0; diff --git a/main/main_timer_sync.cpp b/main/main_timer_sync.cpp index f7388c8517..edacb20f28 100644 --- a/main/main_timer_sync.cpp +++ b/main/main_timer_sync.cpp @@ -178,6 +178,10 @@ MainFrameTime MainTimerSync::advance_checked(float p_frame_slice, int p_iteratio // track deficit time_deficit = p_idle_step - ret.idle_step; + // p_frame_slice is 1.0 / iterations_per_sec + // i.e. the time in seconds taken by a physics tick + ret.interpolation_fraction = time_accum / p_frame_slice; + return ret; } diff --git a/main/main_timer_sync.h b/main/main_timer_sync.h index 179119edce..93d335b27f 100644 --- a/main/main_timer_sync.h +++ b/main/main_timer_sync.h @@ -36,6 +36,7 @@ struct MainFrameTime { float idle_step; // time to advance idles for (argument to process()) int physics_steps; // number of times to iterate the physics engine + float interpolation_fraction; // fraction through the current physics tick void clamp_idle(float min_idle_step, float max_idle_step); }; diff --git a/main/tests/test_shader_lang.cpp b/main/tests/test_shader_lang.cpp index dcb19b7df7..d66e706b6f 100644 --- a/main/tests/test_shader_lang.cpp +++ b/main/tests/test_shader_lang.cpp @@ -197,6 +197,13 @@ static String dump_node_code(SL::Node *p_node, int p_level) { case SL::Node::TYPE_VARIABLE_DECLARATION: { // FIXME: Implement } break; + case SL::Node::TYPE_ARRAY: { + SL::ArrayNode *vnode = (SL::ArrayNode *)p_node; + code = vnode->name; + } break; + case SL::Node::TYPE_ARRAY_DECLARATION: { + // FIXME: Implement + } break; case SL::Node::TYPE_CONSTANT: { SL::ConstantNode *cnode = (SL::ConstantNode *)p_node; return get_constant_text(cnode->datatype, cnode->values); diff --git a/modules/bmp/image_loader_bmp.cpp b/modules/bmp/image_loader_bmp.cpp index a7e8dec11e..88732dff33 100644 --- a/modules/bmp/image_loader_bmp.cpp +++ b/modules/bmp/image_loader_bmp.cpp @@ -47,9 +47,6 @@ Error ImageLoaderBMP::convert_to_image(Ref<Image> p_image, size_t height = (size_t)p_header.bmp_info_header.bmp_height; size_t bits_per_pixel = (size_t)p_header.bmp_info_header.bmp_bit_count; - if (p_header.bmp_info_header.bmp_compression != BI_RGB) { - err = FAILED; - } // Check whether we can load it if (bits_per_pixel == 1) { @@ -238,11 +235,16 @@ Error ImageLoaderBMP::load_image(Ref<Image> p_image, FileAccess *f, bmp_header.bmp_info_header.bmp_colors_used = f->get_32(); bmp_header.bmp_info_header.bmp_important_colors = f->get_32(); - // Compressed bitmaps not supported, stop parsing - if (bmp_header.bmp_info_header.bmp_compression != BI_RGB) { - ERR_EXPLAIN("Unsupported bmp file: " + f->get_path()); - f->close(); - ERR_FAIL_V(ERR_UNAVAILABLE); + switch (bmp_header.bmp_info_header.bmp_compression) { + case BI_RLE8: + case BI_RLE4: + case BI_CMYKRLE8: + case BI_CMYKRLE4: { + // Stop parsing + ERR_EXPLAIN("Compressed BMP files are not supported: " + f->get_path()); + f->close(); + ERR_FAIL_V(ERR_UNAVAILABLE); + } break; } // Don't rely on sizeof(bmp_file_header) as structure padding // adds 2 bytes offset leading to misaligned color table reading @@ -257,8 +259,8 @@ Error ImageLoaderBMP::load_image(Ref<Image> p_image, FileAccess *f, if (bmp_header.bmp_info_header.bmp_bit_count <= 8) { // Support 256 colors max color_table_size = 1 << bmp_header.bmp_info_header.bmp_bit_count; + ERR_FAIL_COND_V(color_table_size == 0, ERR_BUG); } - ERR_FAIL_COND_V(color_table_size == 0, ERR_BUG); PoolVector<uint8_t> bmp_color_table; // Color table is usually 4 bytes per color -> [B][G][R][0] diff --git a/modules/bmp/image_loader_bmp.h b/modules/bmp/image_loader_bmp.h index 0082cf778a..2debb19a1c 100644 --- a/modules/bmp/image_loader_bmp.h +++ b/modules/bmp/image_loader_bmp.h @@ -42,15 +42,15 @@ protected: enum bmp_compression_s { BI_RGB = 0x00, - BI_RLE8 = 0x01, - BI_RLE4 = 0x02, + BI_RLE8 = 0x01, // compressed + BI_RLE4 = 0x02, // compressed BI_BITFIELDS = 0x03, BI_JPEG = 0x04, BI_PNG = 0x05, BI_ALPHABITFIELDS = 0x06, BI_CMYK = 0x0b, - BI_CMYKRLE8 = 0x0c, - BI_CMYKRLE4 = 0x0d + BI_CMYKRLE8 = 0x0c, // compressed + BI_CMYKRLE4 = 0x0d // compressed }; struct bmp_header_s { diff --git a/modules/csg/doc_classes/CSGBox.xml b/modules/csg/doc_classes/CSGBox.xml index d100c01205..14f5a1952e 100644 --- a/modules/csg/doc_classes/CSGBox.xml +++ b/modules/csg/doc_classes/CSGBox.xml @@ -17,7 +17,7 @@ <member name="height" type="float" setter="set_height" getter="get_height" default="2.0"> Height of the box measured from the center of the box. </member> - <member name="material" type="Material" setter="set_material" getter="get_material" default="null"> + <member name="material" type="Material" setter="set_material" getter="get_material"> The material used to render the box. </member> <member name="width" type="float" setter="set_width" getter="get_width" default="2.0"> diff --git a/modules/csg/doc_classes/CSGCylinder.xml b/modules/csg/doc_classes/CSGCylinder.xml index 643eb7c7f4..9fc0281887 100644 --- a/modules/csg/doc_classes/CSGCylinder.xml +++ b/modules/csg/doc_classes/CSGCylinder.xml @@ -17,7 +17,7 @@ <member name="height" type="float" setter="set_height" getter="get_height" default="1.0"> The height of the cylinder. </member> - <member name="material" type="Material" setter="set_material" getter="get_material" default="null"> + <member name="material" type="Material" setter="set_material" getter="get_material"> The material used to render the cylinder. </member> <member name="radius" type="float" setter="set_radius" getter="get_radius" default="1.0"> diff --git a/modules/csg/doc_classes/CSGMesh.xml b/modules/csg/doc_classes/CSGMesh.xml index daa08decb6..afe0bc262d 100644 --- a/modules/csg/doc_classes/CSGMesh.xml +++ b/modules/csg/doc_classes/CSGMesh.xml @@ -11,9 +11,9 @@ <methods> </methods> <members> - <member name="material" type="Material" setter="set_material" getter="get_material" default="null"> + <member name="material" type="Material" setter="set_material" getter="get_material"> </member> - <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh" default="null"> + <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh"> The mesh resource to use as a CSG shape. </member> </members> diff --git a/modules/csg/doc_classes/CSGPolygon.xml b/modules/csg/doc_classes/CSGPolygon.xml index 48f5d730cc..0ecee92cd5 100644 --- a/modules/csg/doc_classes/CSGPolygon.xml +++ b/modules/csg/doc_classes/CSGPolygon.xml @@ -14,7 +14,7 @@ <member name="depth" type="float" setter="set_depth" getter="get_depth" default="1.0"> Extrusion depth when [member mode] is [constant MODE_DEPTH]. </member> - <member name="material" type="Material" setter="set_material" getter="get_material" default="null"> + <member name="material" type="Material" setter="set_material" getter="get_material"> Material to use for the resulting mesh. </member> <member name="mode" type="int" setter="set_mode" getter="get_mode" enum="CSGPolygon.Mode" default="0"> diff --git a/modules/csg/doc_classes/CSGSphere.xml b/modules/csg/doc_classes/CSGSphere.xml index 0a62644179..714e725acb 100644 --- a/modules/csg/doc_classes/CSGSphere.xml +++ b/modules/csg/doc_classes/CSGSphere.xml @@ -11,7 +11,7 @@ <methods> </methods> <members> - <member name="material" type="Material" setter="set_material" getter="get_material" default="null"> + <member name="material" type="Material" setter="set_material" getter="get_material"> The material used to render the sphere. </member> <member name="radial_segments" type="int" setter="set_radial_segments" getter="get_radial_segments" default="12"> diff --git a/modules/csg/doc_classes/CSGTorus.xml b/modules/csg/doc_classes/CSGTorus.xml index 156fb185e7..5dc6bb8380 100644 --- a/modules/csg/doc_classes/CSGTorus.xml +++ b/modules/csg/doc_classes/CSGTorus.xml @@ -14,7 +14,7 @@ <member name="inner_radius" type="float" setter="set_inner_radius" getter="get_inner_radius" default="2.0"> The inner radius of the torus. </member> - <member name="material" type="Material" setter="set_material" getter="get_material" default="null"> + <member name="material" type="Material" setter="set_material" getter="get_material"> The material used to render the torus. </member> <member name="outer_radius" type="float" setter="set_outer_radius" getter="get_outer_radius" default="3.0"> diff --git a/modules/gdnative/doc_classes/GDNative.xml b/modules/gdnative/doc_classes/GDNative.xml index 95ed1fc048..8750ddc56d 100644 --- a/modules/gdnative/doc_classes/GDNative.xml +++ b/modules/gdnative/doc_classes/GDNative.xml @@ -33,7 +33,7 @@ </method> </methods> <members> - <member name="library" type="GDNativeLibrary" setter="set_library" getter="get_library" default="null"> + <member name="library" type="GDNativeLibrary" setter="set_library" getter="get_library"> </member> </members> <constants> diff --git a/modules/gdnative/doc_classes/NativeScript.xml b/modules/gdnative/doc_classes/NativeScript.xml index 460471386d..e34e209374 100644 --- a/modules/gdnative/doc_classes/NativeScript.xml +++ b/modules/gdnative/doc_classes/NativeScript.xml @@ -53,7 +53,7 @@ <members> <member name="class_name" type="String" setter="set_class_name" getter="get_class_name" default=""""> </member> - <member name="library" type="GDNativeLibrary" setter="set_library" getter="get_library" default="null"> + <member name="library" type="GDNativeLibrary" setter="set_library" getter="get_library"> </member> <member name="script_class_icon_path" type="String" setter="set_script_class_icon_path" getter="get_script_class_icon_path" default=""""> </member> diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 78a1bfc99b..521b5ed538 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -159,7 +159,11 @@ bool GDScriptLanguage::validate(const String &p_script, int &r_line_error, int & for (int i = 0; i < cl->subclasses.size(); i++) { for (int j = 0; j < cl->subclasses[i]->functions.size(); j++) { - funcs[cl->subclasses[i]->functions[j]->line] = String(cl->subclasses[i]->name) + "." + String(cl->subclasses[i]->functions[j]->name); + funcs[cl->subclasses[i]->functions[j]->line] = String(cl->subclasses[i]->name) + "." + cl->subclasses[i]->functions[j]->name; + } + for (int j = 0; j < cl->subclasses[i]->static_functions.size(); j++) { + + funcs[cl->subclasses[i]->static_functions[j]->line] = String(cl->subclasses[i]->name) + "." + cl->subclasses[i]->static_functions[j]->name; } } diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp index d5e74c07c9..42f349ffc0 100644 --- a/modules/gdscript/gdscript_function.cpp +++ b/modules/gdscript/gdscript_function.cpp @@ -1784,20 +1784,9 @@ GDScriptFunction::~GDScriptFunction() { Variant GDScriptFunctionState::_signal_callback(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { - if (state.instance_id && !ObjectDB::get_instance(state.instance_id)) { -#ifdef DEBUG_ENABLED - ERR_EXPLAIN("Resumed function '" + String(function->get_name()) + "()' after yield, but class instance is gone. At script: " + state.script->get_path() + ":" + itos(state.line)); - ERR_FAIL_V(Variant()); -#else - return Variant(); -#endif - } - Variant arg; r_error.error = Variant::CallError::CALL_OK; - ERR_FAIL_COND_V(!function, Variant()); - if (p_argcount == 0) { r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument = 1; @@ -1823,44 +1812,7 @@ Variant GDScriptFunctionState::_signal_callback(const Variant **p_args, int p_ar return Variant(); } - state.result = arg; - Variant ret = function->call(NULL, NULL, 0, r_error, &state); - - bool completed = true; - - // If the return value is a GDScriptFunctionState reference, - // then the function did yield again after resuming. - if (ret.is_ref()) { - GDScriptFunctionState *gdfs = Object::cast_to<GDScriptFunctionState>(ret); - if (gdfs && gdfs->function == function) { - completed = false; - gdfs->first_state = first_state.is_valid() ? first_state : Ref<GDScriptFunctionState>(this); - } - } - - function = NULL; //cleaned up; - state.result = Variant(); - - if (completed) { - if (first_state.is_valid()) { - first_state->emit_signal("completed", ret); - } else { - emit_signal("completed", ret); - } - } - -#ifdef DEBUG_ENABLED - if (ScriptDebugger::get_singleton()) - GDScriptLanguage::get_singleton()->exit_function(); - if (state.stack_size) { - //free stack - Variant *stack = (Variant *)state.stack.ptr(); - for (int i = 0; i < state.stack_size; i++) - stack[i].~Variant(); - } -#endif - - return ret; + return resume(arg); } bool GDScriptFunctionState::is_valid(bool p_extended_check) const { diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 80da606967..fa430b5364 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -2211,6 +2211,8 @@ void GDScriptParser::_parse_pattern_block(BlockNode *p_block, Vector<PatternBran p_block->has_return = true; + bool catch_all_appeared = false; + while (true) { while (tokenizer->get_token() == GDScriptTokenizer::TK_NEWLINE && _parse_newline()) @@ -2221,7 +2223,7 @@ void GDScriptParser::_parse_pattern_block(BlockNode *p_block, Vector<PatternBran return; if (indent_level > tab_level.back()->get()) { - return; // go back a level + break; // go back a level } if (pending_newline != -1) { @@ -2236,12 +2238,20 @@ void GDScriptParser::_parse_pattern_block(BlockNode *p_block, Vector<PatternBran branch->patterns.push_back(_parse_pattern(p_static)); if (!branch->patterns[0]) { - return; + break; } bool has_binding = branch->patterns[0]->pt_type == PatternNode::PT_BIND; bool catch_all = has_binding || branch->patterns[0]->pt_type == PatternNode::PT_WILDCARD; +#ifdef DEBUG_ENABLED + // Branches after a wildcard or binding are unreachable + if (catch_all_appeared && !current_function->has_unreachable_code) { + _add_warning(GDScriptWarning::UNREACHABLE_CODE, -1, current_function->name.operator String()); + current_function->has_unreachable_code = true; + } +#endif + while (tokenizer->get_token() == GDScriptTokenizer::TK_COMMA) { tokenizer->advance(); branch->patterns.push_back(_parse_pattern(p_static)); @@ -2259,6 +2269,8 @@ void GDScriptParser::_parse_pattern_block(BlockNode *p_block, Vector<PatternBran catch_all = catch_all || pt == PatternNode::PT_WILDCARD; } + catch_all_appeared = catch_all_appeared || catch_all; + if (!_enter_indent_block()) { _set_error("Expected block in pattern branch"); return; @@ -2274,6 +2286,11 @@ void GDScriptParser::_parse_pattern_block(BlockNode *p_block, Vector<PatternBran p_branches.push_back(branch); } + + // Even if all branches return, there is possibility of default fallthrough + if (!catch_all_appeared) { + p_block->has_return = false; + } } void GDScriptParser::_generate_pattern(PatternNode *p_pattern, Node *p_node_to_match, Node *&p_resulting_node, Map<StringName, Node *> &p_bindings) { diff --git a/modules/gridmap/doc_classes/GridMap.xml b/modules/gridmap/doc_classes/GridMap.xml index 325432579f..1bd3d72066 100644 --- a/modules/gridmap/doc_classes/GridMap.xml +++ b/modules/gridmap/doc_classes/GridMap.xml @@ -210,7 +210,7 @@ </member> <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1"> </member> - <member name="mesh_library" type="MeshLibrary" setter="set_mesh_library" getter="get_mesh_library" default="null"> + <member name="mesh_library" type="MeshLibrary" setter="set_mesh_library" getter="get_mesh_library"> The assigned [MeshLibrary]. </member> <member name="theme" type="MeshLibrary" setter="set_theme" getter="get_theme"> diff --git a/modules/opensimplex/doc_classes/NoiseTexture.xml b/modules/opensimplex/doc_classes/NoiseTexture.xml index 4826b6cd2a..4b59a380f5 100644 --- a/modules/opensimplex/doc_classes/NoiseTexture.xml +++ b/modules/opensimplex/doc_classes/NoiseTexture.xml @@ -20,7 +20,7 @@ <member name="height" type="int" setter="set_height" getter="get_height" default="512"> Height of the generated texture. </member> - <member name="noise" type="OpenSimplexNoise" setter="set_noise" getter="get_noise" default="null"> + <member name="noise" type="OpenSimplexNoise" setter="set_noise" getter="get_noise"> The [OpenSimplexNoise] instance used to generate the noise. </member> <member name="seamless" type="bool" setter="set_seamless" getter="get_seamless" default="false"> diff --git a/modules/regex/doc_classes/RegExMatch.xml b/modules/regex/doc_classes/RegExMatch.xml index e279607d13..6dec9fc516 100644 --- a/modules/regex/doc_classes/RegExMatch.xml +++ b/modules/regex/doc_classes/RegExMatch.xml @@ -48,9 +48,7 @@ </method> </methods> <members> - <member name="names" type="Dictionary" setter="" getter="get_names" default="{ - -}"> + <member name="names" type="Dictionary" setter="" getter="get_names" default="{}"> A dictionary of named groups and its corresponding group number. Only groups with that were matched are included. If multiple groups have the same name, that name would refer to the first matching one. </member> <member name="strings" type="Array" setter="" getter="get_strings" default="[ ]"> diff --git a/modules/visual_script/doc_classes/VisualScriptPreload.xml b/modules/visual_script/doc_classes/VisualScriptPreload.xml index 05ed0ad1e5..b3b39691c9 100644 --- a/modules/visual_script/doc_classes/VisualScriptPreload.xml +++ b/modules/visual_script/doc_classes/VisualScriptPreload.xml @@ -15,7 +15,7 @@ <methods> </methods> <members> - <member name="resource" type="Resource" setter="set_preload" getter="get_preload" default="null"> + <member name="resource" type="Resource" setter="set_preload" getter="get_preload"> The [Resource] to load. </member> </members> diff --git a/platform/server/os_server.cpp b/platform/server/os_server.cpp index 12e53054bc..87dc6421ac 100644 --- a/platform/server/os_server.cpp +++ b/platform/server/os_server.cpp @@ -88,6 +88,8 @@ Error OS_Server::initialize(const VideoMode &p_desired, int p_video_driver, int visual_server = memnew(VisualServerRaster); visual_server->init(); + camera_server = memnew(CameraServer); + AudioDriverManager::initialize(p_audio_driver); input = memnew(InputDefault); @@ -117,6 +119,8 @@ void OS_Server::finalize() { memdelete(input); + memdelete(camera_server); + memdelete(power_manager); ResourceLoader::remove_resource_format_loader(resource_loader_dummy); diff --git a/platform/server/os_server.h b/platform/server/os_server.h index e3488a693d..dbdae6afb1 100644 --- a/platform/server/os_server.h +++ b/platform/server/os_server.h @@ -74,6 +74,7 @@ class OS_Server : public OS_Unix { #endif CrashHandler crash_handler; + CameraServer *camera_server; int video_driver_index; diff --git a/scene/2d/collision_shape_2d.cpp b/scene/2d/collision_shape_2d.cpp index 5440a1d8c3..f79d79d039 100644 --- a/scene/2d/collision_shape_2d.cpp +++ b/scene/2d/collision_shape_2d.cpp @@ -97,15 +97,8 @@ void CollisionShape2D::_notification(int p_what) { } owner_id = 0; parent = NULL; - } break; - /* - case NOTIFICATION_TRANSFORM_CHANGED: { - - if (!is_inside_scene()) - break; - _update_parent(); - } break;*/ + } break; case NOTIFICATION_DRAW: { if (!Engine::get_singleton()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) { @@ -131,10 +124,13 @@ void CollisionShape2D::_notification(int p_what) { rect = rect.grow(3); if (one_way_collision) { - Color dcol = get_tree()->get_debug_collisions_color(); //0.9,0.2,0.2,0.4); - dcol.a = 1.0; + // Draw an arrow indicating the one-way collision direction + draw_col = get_tree()->get_debug_collisions_color().inverted(); + if (disabled) { + draw_col = draw_col.darkened(0.25); + } Vector2 line_to(0, 20); - draw_line(Vector2(), line_to, dcol, 3); + draw_line(Vector2(), line_to, draw_col, 2, true); Vector<Vector2> pts; float tsize = 8; pts.push_back(line_to + (Vector2(0, tsize))); @@ -142,9 +138,9 @@ void CollisionShape2D::_notification(int p_what) { pts.push_back(line_to + (Vector2(-0.707 * tsize, 0))); Vector<Color> cols; for (int i = 0; i < 3; i++) - cols.push_back(dcol); + cols.push_back(draw_col); - draw_primitive(pts, cols, Vector<Vector2>()); //small arrow + draw_primitive(pts, cols, Vector<Vector2>()); } } break; } diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp index 591933d972..1bddc4d22f 100644 --- a/scene/2d/cpu_particles_2d.cpp +++ b/scene/2d/cpu_particles_2d.cpp @@ -83,6 +83,10 @@ void CPUParticles2D::set_randomness_ratio(float p_ratio) { randomness_ratio = p_ratio; } +void CPUParticles2D::set_lifetime_randomness(float p_random) { + + lifetime_randomness = p_random; +} void CPUParticles2D::set_use_local_coordinates(bool p_enable) { local_coords = p_enable; @@ -123,6 +127,10 @@ float CPUParticles2D::get_randomness_ratio() const { return randomness_ratio; } +float CPUParticles2D::get_lifetime_randomness() const { + + return lifetime_randomness; +} bool CPUParticles2D::get_use_local_coordinates() const { @@ -611,6 +619,10 @@ void CPUParticles2D::_particles_process(float p_delta) { } } + if (p.time * (1.0 - explosiveness_ratio) > p.lifetime) { + restart = true; + } + if (restart) { if (!emitting) { @@ -654,6 +666,7 @@ void CPUParticles2D::_particles_process(float p_delta) { p.custom[3] = 0.0; p.transform = Transform2D(); p.time = 0; + p.lifetime = lifetime * (1.0 - Math::randf() * lifetime_randomness); p.base_color = Color(1, 1, 1, 1); switch (emission_shape) { @@ -696,6 +709,8 @@ void CPUParticles2D::_particles_process(float p_delta) { } else if (!p.active) { continue; + } else if (p.time > p.lifetime) { + p.active = false; } else { uint32_t alt_seed = p.seed; @@ -1153,6 +1168,7 @@ void CPUParticles2D::convert_from_particles(Node *p_particles) { Vector2 gravity = Vector2(material->get_gravity().x, material->get_gravity().y); set_gravity(gravity); + set_lifetime_randomness(material->get_lifetime_randomness()); #define CONVERT_PARAM(m_param) \ set_param(m_param, material->get_param(ParticlesMaterial::m_param)); \ @@ -1187,6 +1203,7 @@ void CPUParticles2D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_pre_process_time", "secs"), &CPUParticles2D::set_pre_process_time); ClassDB::bind_method(D_METHOD("set_explosiveness_ratio", "ratio"), &CPUParticles2D::set_explosiveness_ratio); ClassDB::bind_method(D_METHOD("set_randomness_ratio", "ratio"), &CPUParticles2D::set_randomness_ratio); + ClassDB::bind_method(D_METHOD("set_lifetime_randomness", "random"), &CPUParticles2D::set_lifetime_randomness); ClassDB::bind_method(D_METHOD("set_use_local_coordinates", "enable"), &CPUParticles2D::set_use_local_coordinates); ClassDB::bind_method(D_METHOD("set_fixed_fps", "fps"), &CPUParticles2D::set_fixed_fps); ClassDB::bind_method(D_METHOD("set_fractional_delta", "enable"), &CPUParticles2D::set_fractional_delta); @@ -1199,6 +1216,7 @@ void CPUParticles2D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_pre_process_time"), &CPUParticles2D::get_pre_process_time); ClassDB::bind_method(D_METHOD("get_explosiveness_ratio"), &CPUParticles2D::get_explosiveness_ratio); ClassDB::bind_method(D_METHOD("get_randomness_ratio"), &CPUParticles2D::get_randomness_ratio); + ClassDB::bind_method(D_METHOD("get_lifetime_randomness"), &CPUParticles2D::get_lifetime_randomness); ClassDB::bind_method(D_METHOD("get_use_local_coordinates"), &CPUParticles2D::get_use_local_coordinates); ClassDB::bind_method(D_METHOD("get_fixed_fps"), &CPUParticles2D::get_fixed_fps); ClassDB::bind_method(D_METHOD("get_fractional_delta"), &CPUParticles2D::get_fractional_delta); @@ -1225,6 +1243,7 @@ void CPUParticles2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "speed_scale", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_speed_scale", "get_speed_scale"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "explosiveness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_explosiveness_ratio", "get_explosiveness_ratio"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_randomness_ratio", "get_randomness_ratio"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "lifetime_randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_lifetime_randomness", "get_lifetime_randomness"); ADD_PROPERTY(PropertyInfo(Variant::INT, "fixed_fps", PROPERTY_HINT_RANGE, "0,1000,1"), "set_fixed_fps", "get_fixed_fps"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fract_delta"), "set_fractional_delta", "get_fractional_delta"); ADD_GROUP("Drawing", ""); @@ -1404,6 +1423,7 @@ CPUParticles2D::CPUParticles2D() { set_pre_process_time(0); set_explosiveness_ratio(0); set_randomness_ratio(0); + set_lifetime_randomness(0); set_use_local_coordinates(true); set_draw_order(DRAW_ORDER_INDEX); diff --git a/scene/2d/cpu_particles_2d.h b/scene/2d/cpu_particles_2d.h index 8613a185b4..1cd22df9e7 100644 --- a/scene/2d/cpu_particles_2d.h +++ b/scene/2d/cpu_particles_2d.h @@ -96,6 +96,7 @@ private: float hue_rot_rand; float anim_offset_rand; float time; + float lifetime; Color base_color; uint32_t seed; @@ -139,6 +140,7 @@ private: float pre_process_time; float explosiveness_ratio; float randomness_ratio; + float lifetime_randomness; float speed_scale; bool local_coords; int fixed_fps; @@ -200,6 +202,7 @@ public: void set_pre_process_time(float p_time); void set_explosiveness_ratio(float p_ratio); void set_randomness_ratio(float p_ratio); + void set_lifetime_randomness(float p_random); void set_visibility_aabb(const Rect2 &p_aabb); void set_use_local_coordinates(bool p_enable); void set_speed_scale(float p_scale); @@ -211,6 +214,7 @@ public: float get_pre_process_time() const; float get_explosiveness_ratio() const; float get_randomness_ratio() const; + float get_lifetime_randomness() const; Rect2 get_visibility_aabb() const; bool get_use_local_coordinates() const; float get_speed_scale() const; diff --git a/scene/2d/ray_cast_2d.cpp b/scene/2d/ray_cast_2d.cpp index 57dfe5176d..bf8d008bb2 100644 --- a/scene/2d/ray_cast_2d.cpp +++ b/scene/2d/ray_cast_2d.cpp @@ -100,6 +100,7 @@ Vector2 RayCast2D::get_collision_normal() const { void RayCast2D::set_enabled(bool p_enabled) { enabled = p_enabled; + update(); if (is_inside_tree() && !Engine::get_singleton()->is_editor_hint()) set_physics_process_internal(p_enabled); if (!p_enabled) @@ -167,19 +168,25 @@ void RayCast2D::_notification(int p_what) { xf.rotate(cast_to.angle()); xf.translate(Vector2(cast_to.length(), 0)); - //Vector2 tip = Vector2(0,s->get_length()); - Color dcol = get_tree()->get_debug_collisions_color(); //0.9,0.2,0.2,0.4); - draw_line(Vector2(), cast_to, dcol, 3); + // Draw an arrow indicating where the RayCast is pointing to + Color draw_col = get_tree()->get_debug_collisions_color(); + if (!enabled) { + float g = draw_col.get_v(); + draw_col.r = g; + draw_col.g = g; + draw_col.b = g; + } + draw_line(Vector2(), cast_to, draw_col, 2, true); Vector<Vector2> pts; - float tsize = 4; + float tsize = 8; pts.push_back(xf.xform(Vector2(tsize, 0))); pts.push_back(xf.xform(Vector2(0, 0.707 * tsize))); pts.push_back(xf.xform(Vector2(0, -0.707 * tsize))); Vector<Color> cols; for (int i = 0; i < 3; i++) - cols.push_back(dcol); + cols.push_back(draw_col); - draw_primitive(pts, cols, Vector<Vector2>()); //small arrow + draw_primitive(pts, cols, Vector<Vector2>()); } break; diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index ff28f60d4f..054c211d23 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -974,7 +974,7 @@ void AudioStreamPlayer3D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "emission_angle_degrees", PROPERTY_HINT_RANGE, "0.1,90,0.1"), "set_emission_angle", "get_emission_angle"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "emission_angle_filter_attenuation_db", PROPERTY_HINT_RANGE, "-80,0,0.1"), "set_emission_angle_filter_attenuation_db", "get_emission_angle_filter_attenuation_db"); ADD_GROUP("Attenuation Filter", "attenuation_filter_"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "attenuation_filter_cutoff_hz", PROPERTY_HINT_RANGE, "50,50000,1"), "set_attenuation_filter_cutoff_hz", "get_attenuation_filter_cutoff_hz"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "attenuation_filter_cutoff_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_attenuation_filter_cutoff_hz", "get_attenuation_filter_cutoff_hz"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "attenuation_filter_db", PROPERTY_HINT_RANGE, "-80,0,0.1"), "set_attenuation_filter_db", "get_attenuation_filter_db"); ADD_GROUP("Doppler", "doppler_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "doppler_tracking", PROPERTY_HINT_ENUM, "Disabled,Idle,Physics"), "set_doppler_tracking", "get_doppler_tracking"); diff --git a/scene/3d/cpu_particles.cpp b/scene/3d/cpu_particles.cpp index 86b407b9e6..7ab7363c7c 100644 --- a/scene/3d/cpu_particles.cpp +++ b/scene/3d/cpu_particles.cpp @@ -92,6 +92,10 @@ void CPUParticles::set_randomness_ratio(float p_ratio) { randomness_ratio = p_ratio; } +void CPUParticles::set_lifetime_randomness(float p_random) { + + lifetime_randomness = p_random; +} void CPUParticles::set_use_local_coordinates(bool p_enable) { local_coords = p_enable; @@ -130,6 +134,10 @@ float CPUParticles::get_randomness_ratio() const { return randomness_ratio; } +float CPUParticles::get_lifetime_randomness() const { + + return lifetime_randomness; +} bool CPUParticles::get_use_local_coordinates() const { @@ -583,6 +591,10 @@ void CPUParticles::_particles_process(float p_delta) { } } + if (p.time * (1.0 - explosiveness_ratio) > p.lifetime) { + restart = true; + } + if (restart) { if (!emitting) { @@ -636,6 +648,7 @@ void CPUParticles::_particles_process(float p_delta) { p.custom[2] = (parameters[PARAM_ANIM_OFFSET] + tex_anim_offset) * Math::lerp(1.0f, p.anim_offset_rand, randomness[PARAM_ANIM_OFFSET]); //animation offset (0-1) p.transform = Transform(); p.time = 0; + p.lifetime = lifetime * (1.0 - Math::randf() * lifetime_randomness); p.base_color = Color(1, 1, 1, 1); switch (emission_shape) { @@ -701,6 +714,8 @@ void CPUParticles::_particles_process(float p_delta) { } else if (!p.active) { continue; + } else if (p.time > p.lifetime) { + p.active = false; } else { uint32_t alt_seed = p.seed; @@ -1221,6 +1236,7 @@ void CPUParticles::convert_from_particles(Node *p_particles) { set_emission_box_extents(material->get_emission_box_extents()); set_gravity(material->get_gravity()); + set_lifetime_randomness(material->get_lifetime_randomness()); #define CONVERT_PARAM(m_param) \ set_param(m_param, material->get_param(ParticlesMaterial::m_param)); \ @@ -1255,6 +1271,7 @@ void CPUParticles::_bind_methods() { ClassDB::bind_method(D_METHOD("set_pre_process_time", "secs"), &CPUParticles::set_pre_process_time); ClassDB::bind_method(D_METHOD("set_explosiveness_ratio", "ratio"), &CPUParticles::set_explosiveness_ratio); ClassDB::bind_method(D_METHOD("set_randomness_ratio", "ratio"), &CPUParticles::set_randomness_ratio); + ClassDB::bind_method(D_METHOD("set_lifetime_randomness", "random"), &CPUParticles::set_lifetime_randomness); ClassDB::bind_method(D_METHOD("set_use_local_coordinates", "enable"), &CPUParticles::set_use_local_coordinates); ClassDB::bind_method(D_METHOD("set_fixed_fps", "fps"), &CPUParticles::set_fixed_fps); ClassDB::bind_method(D_METHOD("set_fractional_delta", "enable"), &CPUParticles::set_fractional_delta); @@ -1267,6 +1284,7 @@ void CPUParticles::_bind_methods() { ClassDB::bind_method(D_METHOD("get_pre_process_time"), &CPUParticles::get_pre_process_time); ClassDB::bind_method(D_METHOD("get_explosiveness_ratio"), &CPUParticles::get_explosiveness_ratio); ClassDB::bind_method(D_METHOD("get_randomness_ratio"), &CPUParticles::get_randomness_ratio); + ClassDB::bind_method(D_METHOD("get_lifetime_randomness"), &CPUParticles::get_lifetime_randomness); ClassDB::bind_method(D_METHOD("get_use_local_coordinates"), &CPUParticles::get_use_local_coordinates); ClassDB::bind_method(D_METHOD("get_fixed_fps"), &CPUParticles::get_fixed_fps); ClassDB::bind_method(D_METHOD("get_fractional_delta"), &CPUParticles::get_fractional_delta); @@ -1290,6 +1308,7 @@ void CPUParticles::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "speed_scale", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_speed_scale", "get_speed_scale"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "explosiveness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_explosiveness_ratio", "get_explosiveness_ratio"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_randomness_ratio", "get_randomness_ratio"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "lifetime_randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_lifetime_randomness", "get_lifetime_randomness"); ADD_PROPERTY(PropertyInfo(Variant::INT, "fixed_fps", PROPERTY_HINT_RANGE, "0,1000,1"), "set_fixed_fps", "get_fixed_fps"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fract_delta"), "set_fractional_delta", "get_fractional_delta"); ADD_GROUP("Drawing", ""); @@ -1472,6 +1491,7 @@ CPUParticles::CPUParticles() { set_pre_process_time(0); set_explosiveness_ratio(0); set_randomness_ratio(0); + set_lifetime_randomness(0); set_use_local_coordinates(true); set_draw_order(DRAW_ORDER_INDEX); diff --git a/scene/3d/cpu_particles.h b/scene/3d/cpu_particles.h index 517df8490d..71de56f59e 100644 --- a/scene/3d/cpu_particles.h +++ b/scene/3d/cpu_particles.h @@ -95,6 +95,7 @@ private: float hue_rot_rand; float anim_offset_rand; float time; + float lifetime; Color base_color; uint32_t seed; @@ -137,6 +138,7 @@ private: float pre_process_time; float explosiveness_ratio; float randomness_ratio; + float lifetime_randomness; float speed_scale; bool local_coords; int fixed_fps; @@ -200,6 +202,7 @@ public: void set_pre_process_time(float p_time); void set_explosiveness_ratio(float p_ratio); void set_randomness_ratio(float p_ratio); + void set_lifetime_randomness(float p_random); void set_visibility_aabb(const AABB &p_aabb); void set_use_local_coordinates(bool p_enable); void set_speed_scale(float p_scale); @@ -211,6 +214,7 @@ public: float get_pre_process_time() const; float get_explosiveness_ratio() const; float get_randomness_ratio() const; + float get_lifetime_randomness() const; AABB get_visibility_aabb() const; bool get_use_local_coordinates() const; float get_speed_scale() const; diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp index 4ef945ab8d..91595657b1 100644 --- a/scene/3d/light.cpp +++ b/scene/3d/light.cpp @@ -413,7 +413,7 @@ DirectionalLight::DirectionalLight() : set_param(PARAM_SHADOW_NORMAL_BIAS, 0.8); set_param(PARAM_SHADOW_BIAS, 0.1); - set_param(PARAM_SHADOW_MAX_DISTANCE, 200); + set_param(PARAM_SHADOW_MAX_DISTANCE, 100); set_param(PARAM_SHADOW_BIAS_SPLIT_SCALE, 0.25); set_shadow_mode(SHADOW_PARALLEL_4_SPLITS); set_shadow_depth_range(SHADOW_DEPTH_RANGE_STABLE); diff --git a/scene/gui/graph_node.cpp b/scene/gui/graph_node.cpp index 6463ee5ad5..222c75b21d 100644 --- a/scene/gui/graph_node.cpp +++ b/scene/gui/graph_node.cpp @@ -599,6 +599,8 @@ void GraphNode::_gui_input(const Ref<InputEvent> &p_ev) { Vector2 mpos = Vector2(mb->get_position().x, mb->get_position().y); if (close_rect.size != Size2() && close_rect.has_point(mpos)) { + //send focus to parent + get_parent_control()->grab_focus(); emit_signal("close_request"); accept_event(); return; @@ -615,9 +617,7 @@ void GraphNode::_gui_input(const Ref<InputEvent> &p_ev) { return; } - //send focus to parent emit_signal("raise_request"); - get_parent_control()->grab_focus(); } if (!mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) { diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 3dcbf64e7c..d5347edb87 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -999,6 +999,8 @@ void LineEdit::set_cursor_at_pixel_pos(int p_x) { Ref<StyleBox> style = get_stylebox("normal"); int pixel_ofs = 0; Size2 size = get_size(); + bool display_clear_icon = !text.empty() && is_editable() && clear_button_enabled; + int r_icon_width = Control::get_icon("clear")->get_width(); switch (align) { @@ -1013,10 +1015,16 @@ void LineEdit::set_cursor_at_pixel_pos(int p_x) { pixel_ofs = int(style->get_offset().x); else pixel_ofs = int(size.width - (cached_width)) / 2; + + if (display_clear_icon) + pixel_ofs -= int(r_icon_width / 2 + style->get_margin(MARGIN_RIGHT)); } break; case ALIGN_RIGHT: { pixel_ofs = int(size.width - style->get_margin(MARGIN_RIGHT) - (cached_width)); + + if (display_clear_icon) + pixel_ofs -= int(r_icon_width + style->get_margin(MARGIN_RIGHT)); } break; } diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index 9a21da7479..2533d91156 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -522,6 +522,7 @@ void register_scene_types() { ClassDB::register_class<VisualShaderNodeVec3Uniform>(); ClassDB::register_class<VisualShaderNodeTransformUniform>(); ClassDB::register_class<VisualShaderNodeTextureUniform>(); + ClassDB::register_class<VisualShaderNodeTextureUniformTriplanar>(); ClassDB::register_class<VisualShaderNodeCubeMapUniform>(); ClassDB::register_class<VisualShaderNodeIf>(); ClassDB::register_class<VisualShaderNodeSwitch>(); diff --git a/scene/resources/audio_stream_sample.cpp b/scene/resources/audio_stream_sample.cpp index 4b3e392013..5b61654c5d 100644 --- a/scene/resources/audio_stream_sample.cpp +++ b/scene/resources/audio_stream_sample.cpp @@ -564,7 +564,8 @@ Error AudioStreamSample::save_to_wav(const String &p_path) { file->store_32(sub_chunk_2_size); //Subchunk2Size // Add data - PoolVector<uint8_t>::Read read_data = get_data().read(); + PoolVector<uint8_t> data = get_data(); + PoolVector<uint8_t>::Read read_data = data.read(); switch (format) { case AudioStreamSample::FORMAT_8_BITS: for (unsigned int i = 0; i < data_bytes; i++) { diff --git a/scene/resources/particles_material.cpp b/scene/resources/particles_material.cpp index b4818755b4..dc6ef2b49c 100644 --- a/scene/resources/particles_material.cpp +++ b/scene/resources/particles_material.cpp @@ -101,6 +101,8 @@ void ParticlesMaterial::init_shaders() { shader_names->trail_color_modifier = "trail_color_modifier"; shader_names->gravity = "gravity"; + + shader_names->lifetime_randomness = "lifetime_randomness"; } void ParticlesMaterial::finish_shaders() { @@ -173,6 +175,7 @@ void ParticlesMaterial::_update_shader() { code += "uniform float hue_variation_random;\n"; code += "uniform float anim_speed_random;\n"; code += "uniform float anim_offset_random;\n"; + code += "uniform float lifetime_randomness;\n"; switch (emission_shape) { case EMISSION_SHAPE_POINT: { @@ -285,7 +288,11 @@ void ParticlesMaterial::_update_shader() { code += " ivec2 emission_tex_size = textureSize(emission_texture_points, 0);\n"; code += " ivec2 emission_tex_ofs = ivec2(point % emission_tex_size.x, point / emission_tex_size.x);\n"; } - code += " if (RESTART) {\n"; + code += " bool restart = false;\n"; + code += " if (CUSTOM.y > CUSTOM.w) {\n"; + code += " restart = true;\n"; + code += " }\n\n"; + code += " if (RESTART || restart) {\n"; if (tex_parameters[PARAM_INITIAL_LINEAR_VELOCITY].is_valid()) code += " float tex_linear_velocity = textureLod(linear_velocity_texture, vec2(0.0, 0.0), 0.0).r;\n"; @@ -325,6 +332,7 @@ void ParticlesMaterial::_update_shader() { code += " float base_angle = (initial_angle + tex_angle) * mix(1.0, angle_rand, initial_angle_random);\n"; code += " CUSTOM.x = base_angle * degree_to_rad;\n"; // angle code += " CUSTOM.y = 0.0;\n"; // phase + code += " CUSTOM.w = LIFETIME * (1.0 - lifetime_randomness * rand_from_seed(alt_seed));\n"; code += " CUSTOM.z = (anim_offset + tex_anim_offset) * mix(1.0, anim_offset_rand, anim_offset_random);\n"; // animation offset (0-1) switch (emission_shape) { @@ -576,6 +584,9 @@ void ParticlesMaterial::_update_shader() { code += " VELOCITY.z = 0.0;\n"; code += " TRANSFORM[3].z = 0.0;\n"; } + code += " if (CUSTOM.y > CUSTOM.w) {"; + code += " ACTIVE = false;\n"; + code += " }\n"; code += "}\n"; code += "\n"; @@ -1014,6 +1025,17 @@ Vector3 ParticlesMaterial::get_gravity() const { return gravity; } +void ParticlesMaterial::set_lifetime_randomness(float p_lifetime) { + + lifetime_randomness = p_lifetime; + VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->lifetime_randomness, lifetime_randomness); +} + +float ParticlesMaterial::get_lifetime_randomness() const { + + return lifetime_randomness; +} + RID ParticlesMaterial::get_shader_rid() const { ERR_FAIL_COND_V(!shader_map.has(current_key), RID()); @@ -1118,6 +1140,11 @@ void ParticlesMaterial::_bind_methods() { ClassDB::bind_method(D_METHOD("get_gravity"), &ParticlesMaterial::get_gravity); ClassDB::bind_method(D_METHOD("set_gravity", "accel_vec"), &ParticlesMaterial::set_gravity); + ClassDB::bind_method(D_METHOD("set_lifetime_randomness", "randomness"), &ParticlesMaterial::set_lifetime_randomness); + ClassDB::bind_method(D_METHOD("get_lifetime_randomness"), &ParticlesMaterial::get_lifetime_randomness); + + ADD_GROUP("Time", ""); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "lifetime_randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_lifetime_randomness", "get_lifetime_randomness"); ADD_GROUP("Trail", "trail_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "trail_divisor", PROPERTY_HINT_RANGE, "1,1000000,1"), "set_trail_divisor", "get_trail_divisor"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "trail_size_modifier", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_trail_size_modifier", "get_trail_size_modifier"); @@ -1240,6 +1267,7 @@ ParticlesMaterial::ParticlesMaterial() : set_emission_box_extents(Vector3(1, 1, 1)); set_trail_divisor(1); set_gravity(Vector3(0, -9.8, 0)); + set_lifetime_randomness(0); emission_point_count = 1; for (int i = 0; i < PARAM_MAX; i++) { diff --git a/scene/resources/particles_material.h b/scene/resources/particles_material.h index 7f11bd794b..6fe381db0a 100644 --- a/scene/resources/particles_material.h +++ b/scene/resources/particles_material.h @@ -185,6 +185,8 @@ private: StringName trail_color_modifier; StringName gravity; + + StringName lifetime_randomness; }; static ShaderNames *shader_names; @@ -225,6 +227,8 @@ private: Vector3 gravity; + float lifetime_randomness; + //do not save emission points here protected: @@ -287,6 +291,9 @@ public: void set_gravity(const Vector3 &p_gravity); Vector3 get_gravity() const; + void set_lifetime_randomness(float p_lifetime); + float get_lifetime_randomness() const; + static void init_shaders(); static void finish_shaders(); static void flush_changes(); diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index 7265c9b457..8475a34818 100644 --- a/scene/resources/visual_shader.cpp +++ b/scene/resources/visual_shader.cpp @@ -67,6 +67,14 @@ String VisualShaderNode::generate_global(Shader::Mode p_mode, VisualShader::Type return String(); } +String VisualShaderNode::generate_global_per_node(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const { + return String(); +} + +String VisualShaderNode::generate_global_per_func(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const { + return String(); +} + Vector<StringName> VisualShaderNode::get_editable_properties() const { return Vector<StringName>(); } @@ -449,7 +457,10 @@ String VisualShader::generate_preview_shader(Type p_type, int p_node, int p_port ERR_FAIL_COND_V(node->get_output_port_type(p_port) == VisualShaderNode::PORT_TYPE_TRANSFORM, String()); StringBuilder global_code; + StringBuilder global_code_per_node; + Map<Type, StringBuilder> global_code_per_func; StringBuilder code; + Set<StringName> classes; global_code += String() + "shader_type canvas_item;\n"; @@ -474,7 +485,7 @@ String VisualShader::generate_preview_shader(Type p_type, int p_node, int p_port code += "\nvoid fragment() {\n"; Set<int> processed; - Error err = _write_node(p_type, global_code, code, default_tex_params, input_connections, output_connections, p_node, processed, true); + Error err = _write_node(p_type, global_code, global_code_per_node, global_code_per_func, code, default_tex_params, input_connections, output_connections, p_node, processed, true, classes); ERR_FAIL_COND_V(err != OK, String()); if (node->get_output_port_type(p_port) == VisualShaderNode::PORT_TYPE_SCALAR) { @@ -489,6 +500,7 @@ String VisualShader::generate_preview_shader(Type p_type, int p_node, int p_port //set code secretly global_code += "\n\n"; String final_code = global_code; + final_code += global_code_per_node; final_code += code; return final_code; } @@ -833,7 +845,7 @@ void VisualShader::_get_property_list(List<PropertyInfo> *p_list) const { } } -Error VisualShader::_write_node(Type type, StringBuilder &global_code, StringBuilder &code, Vector<VisualShader::DefaultTextureParam> &def_tex_params, const VMap<ConnectionKey, const List<Connection>::Element *> &input_connections, const VMap<ConnectionKey, const List<Connection>::Element *> &output_connections, int node, Set<int> &processed, bool for_preview) const { +Error VisualShader::_write_node(Type type, StringBuilder &global_code, StringBuilder &global_code_per_node, Map<Type, StringBuilder> &global_code_per_func, StringBuilder &code, Vector<VisualShader::DefaultTextureParam> &def_tex_params, const VMap<ConnectionKey, const List<Connection>::Element *> &input_connections, const VMap<ConnectionKey, const List<Connection>::Element *> &output_connections, int node, Set<int> &processed, bool for_preview, Set<StringName> &r_classes) const { const Ref<VisualShaderNode> vsnode = graph[type].nodes[node].node; @@ -850,7 +862,7 @@ Error VisualShader::_write_node(Type type, StringBuilder &global_code, StringBui continue; } - Error err = _write_node(type, global_code, code, def_tex_params, input_connections, output_connections, from_node, processed, for_preview); + Error err = _write_node(type, global_code, global_code_per_node, global_code_per_func, code, def_tex_params, input_connections, output_connections, from_node, processed, for_preview, r_classes); if (err) return err; } @@ -958,6 +970,14 @@ Error VisualShader::_write_node(Type type, StringBuilder &global_code, StringBui if (!skip_global) { global_code += vsnode->generate_global(get_mode(), type, node); + + if (!r_classes.has(vsnode->get_class_name())) { + global_code_per_node += vsnode->generate_global_per_node(get_mode(), type, node); + for (int i = 0; i < TYPE_MAX; i++) { + global_code_per_func[Type(i)] += vsnode->generate_global_per_func(get_mode(), Type(i), node); + } + r_classes.insert(vsnode->get_class_name()); + } } //handle normally @@ -976,8 +996,12 @@ void VisualShader::_update_shader() const { dirty = false; StringBuilder global_code; + StringBuilder global_code_per_node; + Map<Type, StringBuilder> global_code_per_func; StringBuilder code; Vector<VisualShader::DefaultTextureParam> default_tex_params; + Set<StringName> classes; + List<int> insertion_pos; static const char *shader_mode_str[Shader::MODE_MAX] = { "spatial", "canvas_item", "particles" }; global_code += String() + "shader_type " + shader_mode_str[shader_mode] + ";\n"; @@ -1056,8 +1080,9 @@ void VisualShader::_update_shader() const { code += "\nvoid " + String(func_name[i]) + "() {\n"; Set<int> processed; - Error err = _write_node(Type(i), global_code, code, default_tex_params, input_connections, output_connections, NODE_ID_OUTPUT, processed, false); + Error err = _write_node(Type(i), global_code, global_code_per_node, global_code_per_func, code, default_tex_params, input_connections, output_connections, NODE_ID_OUTPUT, processed, false, classes); ERR_FAIL_COND(err != OK); + insertion_pos.push_back(code.get_string_length()); code += "}\n"; } @@ -1065,7 +1090,13 @@ void VisualShader::_update_shader() const { //set code secretly global_code += "\n\n"; String final_code = global_code; - final_code += code; + final_code += global_code_per_node; + String tcode = code; + for (int i = 0; i < TYPE_MAX; i++) { + tcode = tcode.insert(insertion_pos[i], global_code_per_func[Type(i)]); + } + final_code += tcode; + const_cast<VisualShader *>(this)->set_code(final_code); for (int i = 0; i < default_tex_params.size(); i++) { const_cast<VisualShader *>(this)->set_default_texture_param(default_tex_params[i].name, default_tex_params[i].param); diff --git a/scene/resources/visual_shader.h b/scene/resources/visual_shader.h index 83db51b1b0..b3c0ab6e0b 100644 --- a/scene/resources/visual_shader.h +++ b/scene/resources/visual_shader.h @@ -103,7 +103,7 @@ private: } }; - Error _write_node(Type p_type, StringBuilder &global_code, StringBuilder &code, Vector<DefaultTextureParam> &def_tex_params, const VMap<ConnectionKey, const List<Connection>::Element *> &input_connections, const VMap<ConnectionKey, const List<Connection>::Element *> &output_connections, int node, Set<int> &processed, bool for_preview) const; + Error _write_node(Type p_type, StringBuilder &global_code, StringBuilder &global_code_per_node, Map<Type, StringBuilder> &global_code_per_func, StringBuilder &code, Vector<DefaultTextureParam> &def_tex_params, const VMap<ConnectionKey, const List<Connection>::Element *> &input_connections, const VMap<ConnectionKey, const List<Connection>::Element *> &output_connections, int node, Set<int> &processed, bool for_preview, Set<StringName> &r_classes) const; void _input_type_changed(Type p_type, int p_id); @@ -208,6 +208,8 @@ public: virtual Vector<VisualShader::DefaultTextureParam> get_default_texture_parameters(VisualShader::Type p_type, int p_id) const; virtual String generate_global(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const; + virtual String generate_global_per_node(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const; + virtual String generate_global_per_func(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const; virtual String generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview = false) const = 0; //if no output is connected, the output var passed will be empty. if no input is connected and input is NIL, the input var passed will be empty virtual String get_warning(Shader::Mode p_mode, VisualShader::Type p_type) const; diff --git a/scene/resources/visual_shader_nodes.cpp b/scene/resources/visual_shader_nodes.cpp index 235b56b0ce..06f18472ce 100644 --- a/scene/resources/visual_shader_nodes.cpp +++ b/scene/resources/visual_shader_nodes.cpp @@ -2968,6 +2968,98 @@ VisualShaderNodeTextureUniform::VisualShaderNodeTextureUniform() { color_default = COLOR_DEFAULT_WHITE; } +////////////// Texture Uniform (Triplanar) + +String VisualShaderNodeTextureUniformTriplanar::get_caption() const { + return "TextureUniformTriplanar"; +} + +int VisualShaderNodeTextureUniformTriplanar::get_input_port_count() const { + return 2; +} + +VisualShaderNodeTextureUniform::PortType VisualShaderNodeTextureUniformTriplanar::get_input_port_type(int p_port) const { + if (p_port == 0) { + return PORT_TYPE_VECTOR; + } else if (p_port == 1) { + return PORT_TYPE_VECTOR; + } + return PORT_TYPE_SCALAR; +} + +String VisualShaderNodeTextureUniformTriplanar::get_input_port_name(int p_port) const { + if (p_port == 0) { + return "weights"; + } else if (p_port == 1) { + return "pos"; + } + return ""; +} + +String VisualShaderNodeTextureUniformTriplanar::generate_global_per_node(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const { + + String code; + + code += "// TRIPLANAR FUNCTION GLOBAL CODE\n"; + code += "\tvec4 triplanar_texture(sampler2D p_sampler, vec3 p_weights, vec3 p_triplanar_pos) {\n"; + code += "\t\tvec4 samp = vec4(0.0);\n"; + code += "\t\tsamp += texture(p_sampler, p_triplanar_pos.xy) * p_weights.z;\n"; + code += "\t\tsamp += texture(p_sampler, p_triplanar_pos.xz) * p_weights.y;\n"; + code += "\t\tsamp += texture(p_sampler, p_triplanar_pos.zy * vec2(-1.0, 1.0)) * p_weights.x;\n"; + code += "\t\treturn samp;\n"; + code += "\t}\n"; + code += "\n"; + code += "\tuniform vec3 triplanar_scale = vec3(1.0, 1.0, 1.0);\n"; + code += "\tuniform vec3 triplanar_offset;\n"; + code += "\tuniform float triplanar_sharpness = 0.5;\n"; + code += "\n"; + code += "\tvarying vec3 triplanar_power_normal;\n"; + code += "\tvarying vec3 triplanar_pos;\n"; + + return code; +} + +String VisualShaderNodeTextureUniformTriplanar::generate_global_per_func(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const { + + String code; + + if (p_type == VisualShader::TYPE_VERTEX) { + + code += "\t// TRIPLANAR FUNCTION VERTEX CODE\n"; + code += "\t\ttriplanar_power_normal = pow(abs(NORMAL), vec3(triplanar_sharpness));\n"; + code += "\t\ttriplanar_power_normal /= dot(triplanar_power_normal, vec3(1.0));\n"; + code += "\t\ttriplanar_pos = VERTEX * triplanar_scale + triplanar_offset;\n"; + code += "\t\ttriplanar_pos *= vec3(1.0, -1.0, 1.0);\n"; + } + + return code; +} + +String VisualShaderNodeTextureUniformTriplanar::generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview) const { + + String id = get_uniform_name(); + String code = "\t{\n"; + + if (p_input_vars[0] == String() && p_input_vars[1] == String()) { + code += "\t\tvec4 n_tex_read = triplanar_texture( " + id + ", triplanar_power_normal, triplanar_pos );\n"; + } else if (p_input_vars[0] != String() && p_input_vars[1] == String()) { + code += "\t\tvec4 n_tex_read = triplanar_texture( " + id + ", " + p_input_vars[0] + ", triplanar_pos );\n"; + } else if (p_input_vars[0] == String() && p_input_vars[1] != String()) { + code += "\t\tvec4 n_tex_read = triplanar_texture( " + id + ", triplanar_power_normal," + p_input_vars[1] + " );\n"; + } else { + code += "\t\tvec4 n_tex_read = triplanar_texture( " + id + ", " + p_input_vars[0] + ", " + p_input_vars[1] + " );\n"; + } + + code += "\t\t" + p_output_vars[0] + " = n_tex_read.rgb;\n"; + code += "\t\t" + p_output_vars[1] + " = n_tex_read.a;\n"; + code += "\t}\n"; + + return code; +} + +VisualShaderNodeTextureUniformTriplanar::VisualShaderNodeTextureUniformTriplanar() { +} + ////////////// CubeMap Uniform String VisualShaderNodeCubeMapUniform::get_caption() const { diff --git a/scene/resources/visual_shader_nodes.h b/scene/resources/visual_shader_nodes.h index dca0ebe033..cafc7a0f00 100644 --- a/scene/resources/visual_shader_nodes.h +++ b/scene/resources/visual_shader_nodes.h @@ -1425,6 +1425,25 @@ VARIANT_ENUM_CAST(VisualShaderNodeTextureUniform::ColorDefault) /////////////////////////////////////// +class VisualShaderNodeTextureUniformTriplanar : public VisualShaderNodeTextureUniform { + GDCLASS(VisualShaderNodeTextureUniformTriplanar, VisualShaderNodeTextureUniform); + +public: + virtual String get_caption() const; + + virtual int get_input_port_count() const; + virtual PortType get_input_port_type(int p_port) const; + virtual String get_input_port_name(int p_port) const; + + virtual String generate_global_per_node(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const; + virtual String generate_global_per_func(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const; + virtual String generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview = false) const; //if no output is connected, the output var passed will be empty. if no input is connected and input is NIL, the input var passed will be empty + + VisualShaderNodeTextureUniformTriplanar(); +}; + +/////////////////////////////////////// + class VisualShaderNodeCubeMapUniform : public VisualShaderNode { GDCLASS(VisualShaderNodeCubeMapUniform, VisualShaderNode); diff --git a/servers/audio/effects/audio_effect_chorus.cpp b/servers/audio/effects/audio_effect_chorus.cpp index c2f8b97c1a..216a0a4aa6 100644 --- a/servers/audio/effects/audio_effect_chorus.cpp +++ b/servers/audio/effects/audio_effect_chorus.cpp @@ -333,28 +333,28 @@ void AudioEffectChorus::_bind_methods() { ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/1/rate_hz", PROPERTY_HINT_RANGE, "0.1,20,0.1"), "set_voice_rate_hz", "get_voice_rate_hz", 0); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/1/depth_ms", PROPERTY_HINT_RANGE, "0,20,0.01"), "set_voice_depth_ms", "get_voice_depth_ms", 0); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/1/level_db", PROPERTY_HINT_RANGE, "-60,24,0.1"), "set_voice_level_db", "get_voice_level_db", 0); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/1/cutoff_hz", PROPERTY_HINT_RANGE, "1,16000,1"), "set_voice_cutoff_hz", "get_voice_cutoff_hz", 0); + ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/1/cutoff_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_voice_cutoff_hz", "get_voice_cutoff_hz", 0); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/1/pan", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_voice_pan", "get_voice_pan", 0); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/2/delay_ms", PROPERTY_HINT_RANGE, "0,50,0.01"), "set_voice_delay_ms", "get_voice_delay_ms", 1); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/2/rate_hz", PROPERTY_HINT_RANGE, "0.1,20,0.1"), "set_voice_rate_hz", "get_voice_rate_hz", 1); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/2/depth_ms", PROPERTY_HINT_RANGE, "0,20,0.01"), "set_voice_depth_ms", "get_voice_depth_ms", 1); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/2/level_db", PROPERTY_HINT_RANGE, "-60,24,0.1"), "set_voice_level_db", "get_voice_level_db", 1); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/2/cutoff_hz", PROPERTY_HINT_RANGE, "1,16000,1"), "set_voice_cutoff_hz", "get_voice_cutoff_hz", 1); + ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/2/cutoff_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_voice_cutoff_hz", "get_voice_cutoff_hz", 1); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/2/pan", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_voice_pan", "get_voice_pan", 1); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/3/delay_ms", PROPERTY_HINT_RANGE, "0,50,0.01"), "set_voice_delay_ms", "get_voice_delay_ms", 2); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/3/rate_hz", PROPERTY_HINT_RANGE, "0.1,20,0.1"), "set_voice_rate_hz", "get_voice_rate_hz", 2); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/3/depth_ms", PROPERTY_HINT_RANGE, "0,20,0.01"), "set_voice_depth_ms", "get_voice_depth_ms", 2); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/3/level_db", PROPERTY_HINT_RANGE, "-60,24,0.1"), "set_voice_level_db", "get_voice_level_db", 2); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/3/cutoff_hz", PROPERTY_HINT_RANGE, "1,16000,1"), "set_voice_cutoff_hz", "get_voice_cutoff_hz", 2); + ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/3/cutoff_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_voice_cutoff_hz", "get_voice_cutoff_hz", 2); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/3/pan", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_voice_pan", "get_voice_pan", 2); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/4/delay_ms", PROPERTY_HINT_RANGE, "0,50,0.01"), "set_voice_delay_ms", "get_voice_delay_ms", 3); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/4/rate_hz", PROPERTY_HINT_RANGE, "0.1,20,0.1"), "set_voice_rate_hz", "get_voice_rate_hz", 3); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/4/depth_ms", PROPERTY_HINT_RANGE, "0,20,0.01"), "set_voice_depth_ms", "get_voice_depth_ms", 3); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/4/level_db", PROPERTY_HINT_RANGE, "-60,24,0.1"), "set_voice_level_db", "get_voice_level_db", 3); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/4/cutoff_hz", PROPERTY_HINT_RANGE, "1,16000,1"), "set_voice_cutoff_hz", "get_voice_cutoff_hz", 3); + ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/4/cutoff_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_voice_cutoff_hz", "get_voice_cutoff_hz", 3); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "voice/4/pan", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_voice_pan", "get_voice_pan", 3); } diff --git a/servers/audio/effects/audio_effect_distortion.cpp b/servers/audio/effects/audio_effect_distortion.cpp index 37305bd7f4..278647c304 100644 --- a/servers/audio/effects/audio_effect_distortion.cpp +++ b/servers/audio/effects/audio_effect_distortion.cpp @@ -173,7 +173,7 @@ void AudioEffectDistortion::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Clip,ATan,LoFi,Overdrive,WaveShape"), "set_mode", "get_mode"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "pre_gain", PROPERTY_HINT_RANGE, "-60,60,0.01"), "set_pre_gain", "get_pre_gain"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "keep_hf_hz", PROPERTY_HINT_RANGE, "1,20000,1"), "set_keep_hf_hz", "get_keep_hf_hz"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "keep_hf_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_keep_hf_hz", "get_keep_hf_hz"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "drive", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drive", "get_drive"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "post_gain", PROPERTY_HINT_RANGE, "-80,24,0.01"), "set_post_gain", "get_post_gain"); diff --git a/servers/audio/effects/audio_effect_filter.cpp b/servers/audio/effects/audio_effect_filter.cpp index dc86d6ffbb..3841f2b5a0 100644 --- a/servers/audio/effects/audio_effect_filter.cpp +++ b/servers/audio/effects/audio_effect_filter.cpp @@ -156,7 +156,7 @@ void AudioEffectFilter::_bind_methods() { ClassDB::bind_method(D_METHOD("set_db", "amount"), &AudioEffectFilter::set_db); ClassDB::bind_method(D_METHOD("get_db"), &AudioEffectFilter::get_db); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "cutoff_hz", PROPERTY_HINT_RANGE, "1,40000,0.1"), "set_cutoff", "get_cutoff"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "cutoff_hz", PROPERTY_HINT_RANGE, "1,20500,1"), "set_cutoff", "get_cutoff"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "resonance", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_resonance", "get_resonance"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "gain", PROPERTY_HINT_RANGE, "0,4,0.01"), "set_gain", "get_gain"); ADD_PROPERTY(PropertyInfo(Variant::INT, "db", PROPERTY_HINT_ENUM, "6 dB,12 dB,18 dB,24 dB"), "set_db", "get_db"); diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index e0be58d0c1..14fefbf195 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -785,6 +785,17 @@ ShaderLanguage::DataPrecision ShaderLanguage::get_token_precision(TokenType p_ty return PRECISION_MEDIUMP; } +String ShaderLanguage::get_precision_name(DataPrecision p_type) { + switch (p_type) { + case PRECISION_LOWP: return "lowp"; + case PRECISION_MEDIUMP: return "mediump"; + case PRECISION_HIGHP: return "highp"; + default: + break; + } + return ""; +} + String ShaderLanguage::get_datatype_name(DataType p_type) { switch (p_type) { @@ -849,7 +860,7 @@ void ShaderLanguage::clear() { } } -bool ShaderLanguage::_find_identifier(const BlockNode *p_block, const Map<StringName, BuiltInInfo> &p_builtin_types, const StringName &p_identifier, DataType *r_data_type, IdentifierType *r_type) { +bool ShaderLanguage::_find_identifier(const BlockNode *p_block, const Map<StringName, BuiltInInfo> &p_builtin_types, const StringName &p_identifier, DataType *r_data_type, IdentifierType *r_type, int *r_array_size) { if (p_builtin_types.has(p_identifier)) { @@ -871,6 +882,9 @@ bool ShaderLanguage::_find_identifier(const BlockNode *p_block, const Map<String if (r_data_type) { *r_data_type = p_block->variables[p_identifier].type; } + if (r_array_size) { + *r_array_size = p_block->variables[p_identifier].array_size; + } if (r_type) { *r_type = IDENTIFIER_LOCAL_VAR; } @@ -1328,721 +1342,730 @@ bool ShaderLanguage::_validate_operator(OperatorNode *p_op, DataType *r_ret_type const ShaderLanguage::BuiltinFuncDef ShaderLanguage::builtin_func_defs[] = { //constructors - { "bool", TYPE_BOOL, { TYPE_BOOL, TYPE_VOID } }, - { "bvec2", TYPE_BVEC2, { TYPE_BOOL, TYPE_VOID } }, - { "bvec2", TYPE_BVEC2, { TYPE_BOOL, TYPE_BOOL, TYPE_VOID } }, - { "bvec3", TYPE_BVEC3, { TYPE_BOOL, TYPE_VOID } }, - { "bvec3", TYPE_BVEC3, { TYPE_BOOL, TYPE_BOOL, TYPE_BOOL, TYPE_VOID } }, - { "bvec3", TYPE_BVEC3, { TYPE_BVEC2, TYPE_BOOL, TYPE_VOID } }, - { "bvec3", TYPE_BVEC3, { TYPE_BOOL, TYPE_BVEC2, TYPE_VOID } }, - { "bvec4", TYPE_BVEC4, { TYPE_BOOL, TYPE_VOID } }, - { "bvec4", TYPE_BVEC4, { TYPE_BOOL, TYPE_BOOL, TYPE_BOOL, TYPE_BOOL, TYPE_VOID } }, - { "bvec4", TYPE_BVEC4, { TYPE_BOOL, TYPE_BVEC2, TYPE_BOOL, TYPE_VOID } }, - { "bvec4", TYPE_BVEC4, { TYPE_BVEC2, TYPE_BOOL, TYPE_BOOL, TYPE_VOID } }, - { "bvec4", TYPE_BVEC4, { TYPE_BOOL, TYPE_BOOL, TYPE_BVEC2, TYPE_VOID } }, - { "bvec4", TYPE_BVEC4, { TYPE_BOOL, TYPE_BVEC3, TYPE_VOID } }, - { "bvec4", TYPE_BVEC4, { TYPE_BVEC3, TYPE_BOOL, TYPE_VOID } }, - { "bvec4", TYPE_BVEC4, { TYPE_BVEC2, TYPE_BVEC2, TYPE_VOID } }, - - { "float", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "vec2", TYPE_VEC2, { TYPE_FLOAT, TYPE_VOID } }, - { "vec2", TYPE_VEC2, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "vec3", TYPE_VEC3, { TYPE_FLOAT, TYPE_VOID } }, - { "vec3", TYPE_VEC3, { TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "vec3", TYPE_VEC3, { TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } }, - { "vec3", TYPE_VEC3, { TYPE_FLOAT, TYPE_VEC2, TYPE_VOID } }, - { "vec4", TYPE_VEC4, { TYPE_FLOAT, TYPE_VOID } }, - { "vec4", TYPE_VEC4, { TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "vec4", TYPE_VEC4, { TYPE_FLOAT, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } }, - { "vec4", TYPE_VEC4, { TYPE_VEC2, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "vec4", TYPE_VEC4, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VEC2, TYPE_VOID } }, - { "vec4", TYPE_VEC4, { TYPE_FLOAT, TYPE_VEC3, TYPE_VOID } }, - { "vec4", TYPE_VEC4, { TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "vec4", TYPE_VEC4, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - - { "int", TYPE_INT, { TYPE_INT, TYPE_VOID } }, - { "ivec2", TYPE_IVEC2, { TYPE_INT, TYPE_VOID } }, - { "ivec2", TYPE_IVEC2, { TYPE_INT, TYPE_INT, TYPE_VOID } }, - { "ivec3", TYPE_IVEC3, { TYPE_INT, TYPE_VOID } }, - { "ivec3", TYPE_IVEC3, { TYPE_INT, TYPE_INT, TYPE_INT, TYPE_VOID } }, - { "ivec3", TYPE_IVEC3, { TYPE_IVEC2, TYPE_INT, TYPE_VOID } }, - { "ivec3", TYPE_IVEC3, { TYPE_INT, TYPE_IVEC2, TYPE_VOID } }, - { "ivec4", TYPE_IVEC4, { TYPE_INT, TYPE_VOID } }, - { "ivec4", TYPE_IVEC4, { TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_VOID } }, - { "ivec4", TYPE_IVEC4, { TYPE_INT, TYPE_IVEC2, TYPE_INT, TYPE_VOID } }, - { "ivec4", TYPE_IVEC4, { TYPE_IVEC2, TYPE_INT, TYPE_INT, TYPE_VOID } }, - { "ivec4", TYPE_IVEC4, { TYPE_INT, TYPE_INT, TYPE_IVEC2, TYPE_VOID } }, - { "ivec4", TYPE_IVEC4, { TYPE_INT, TYPE_IVEC3, TYPE_VOID } }, - { "ivec4", TYPE_IVEC4, { TYPE_IVEC3, TYPE_INT, TYPE_VOID } }, - { "ivec4", TYPE_IVEC4, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID } }, - - { "uint", TYPE_UINT, { TYPE_UINT, TYPE_VOID } }, - { "uvec2", TYPE_UVEC2, { TYPE_UINT, TYPE_VOID } }, - { "uvec2", TYPE_UVEC2, { TYPE_UINT, TYPE_UINT, TYPE_VOID } }, - { "uvec3", TYPE_UVEC3, { TYPE_UINT, TYPE_VOID } }, - { "uvec3", TYPE_UVEC3, { TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_VOID } }, - { "uvec3", TYPE_UVEC3, { TYPE_UVEC2, TYPE_UINT, TYPE_VOID } }, - { "uvec3", TYPE_UVEC3, { TYPE_UINT, TYPE_UVEC2, TYPE_VOID } }, - { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_VOID } }, - { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_VOID } }, - { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UVEC2, TYPE_UINT, TYPE_VOID } }, - { "uvec4", TYPE_UVEC4, { TYPE_UVEC2, TYPE_UINT, TYPE_UINT, TYPE_VOID } }, - { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UINT, TYPE_UVEC2, TYPE_VOID } }, - { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UVEC3, TYPE_VOID } }, - { "uvec4", TYPE_UVEC4, { TYPE_UVEC3, TYPE_UINT, TYPE_VOID } }, - { "uvec4", TYPE_UVEC4, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID } }, - - { "mat2", TYPE_MAT2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "mat3", TYPE_MAT3, { TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "mat4", TYPE_MAT4, { TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - - { "mat2", TYPE_MAT2, { TYPE_FLOAT, TYPE_VOID } }, - { "mat3", TYPE_MAT3, { TYPE_FLOAT, TYPE_VOID } }, - { "mat4", TYPE_MAT4, { TYPE_FLOAT, TYPE_VOID } }, + { "bool", TYPE_BOOL, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, + { "bvec2", TYPE_BVEC2, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, + { "bvec2", TYPE_BVEC2, { TYPE_BOOL, TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, + { "bvec3", TYPE_BVEC3, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, + { "bvec3", TYPE_BVEC3, { TYPE_BOOL, TYPE_BOOL, TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, + { "bvec3", TYPE_BVEC3, { TYPE_BVEC2, TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, + { "bvec3", TYPE_BVEC3, { TYPE_BOOL, TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "bvec4", TYPE_BVEC4, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, + { "bvec4", TYPE_BVEC4, { TYPE_BOOL, TYPE_BOOL, TYPE_BOOL, TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, + { "bvec4", TYPE_BVEC4, { TYPE_BOOL, TYPE_BVEC2, TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, + { "bvec4", TYPE_BVEC4, { TYPE_BVEC2, TYPE_BOOL, TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, + { "bvec4", TYPE_BVEC4, { TYPE_BOOL, TYPE_BOOL, TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "bvec4", TYPE_BVEC4, { TYPE_BOOL, TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "bvec4", TYPE_BVEC4, { TYPE_BVEC3, TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, + { "bvec4", TYPE_BVEC4, { TYPE_BVEC2, TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL }, + + { "float", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "vec2", TYPE_VEC2, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "vec2", TYPE_VEC2, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "vec3", TYPE_VEC3, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "vec3", TYPE_VEC3, { TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "vec3", TYPE_VEC3, { TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "vec3", TYPE_VEC3, { TYPE_FLOAT, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "vec4", TYPE_VEC4, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "vec4", TYPE_VEC4, { TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "vec4", TYPE_VEC4, { TYPE_FLOAT, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "vec4", TYPE_VEC4, { TYPE_VEC2, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "vec4", TYPE_VEC4, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "vec4", TYPE_VEC4, { TYPE_FLOAT, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "vec4", TYPE_VEC4, { TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "vec4", TYPE_VEC4, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + + { "int", TYPE_INT, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "ivec2", TYPE_IVEC2, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "ivec2", TYPE_IVEC2, { TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "ivec3", TYPE_IVEC3, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "ivec3", TYPE_IVEC3, { TYPE_INT, TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "ivec3", TYPE_IVEC3, { TYPE_IVEC2, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "ivec3", TYPE_IVEC3, { TYPE_INT, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "ivec4", TYPE_IVEC4, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "ivec4", TYPE_IVEC4, { TYPE_INT, TYPE_INT, TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "ivec4", TYPE_IVEC4, { TYPE_INT, TYPE_IVEC2, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "ivec4", TYPE_IVEC4, { TYPE_IVEC2, TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "ivec4", TYPE_IVEC4, { TYPE_INT, TYPE_INT, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "ivec4", TYPE_IVEC4, { TYPE_INT, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "ivec4", TYPE_IVEC4, { TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "ivec4", TYPE_IVEC4, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, + + { "uint", TYPE_UINT, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + { "uvec2", TYPE_UVEC2, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + { "uvec2", TYPE_UVEC2, { TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + { "uvec3", TYPE_UVEC3, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + { "uvec3", TYPE_UVEC3, { TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + { "uvec3", TYPE_UVEC3, { TYPE_UVEC2, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + { "uvec3", TYPE_UVEC3, { TYPE_UINT, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UVEC2, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + { "uvec4", TYPE_UVEC4, { TYPE_UVEC2, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UINT, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "uvec4", TYPE_UVEC4, { TYPE_UINT, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "uvec4", TYPE_UVEC4, { TYPE_UVEC3, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + { "uvec4", TYPE_UVEC4, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, + + { "mat2", TYPE_MAT2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "mat3", TYPE_MAT3, { TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "mat4", TYPE_MAT4, { TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "mat2", TYPE_MAT2, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "mat3", TYPE_MAT3, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "mat4", TYPE_MAT4, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, //conversion scalars - { "int", TYPE_INT, { TYPE_BOOL, TYPE_VOID } }, - { "int", TYPE_INT, { TYPE_INT, TYPE_VOID } }, - { "int", TYPE_INT, { TYPE_UINT, TYPE_VOID } }, - { "int", TYPE_INT, { TYPE_FLOAT, TYPE_VOID } }, + { "int", TYPE_INT, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, + { "int", TYPE_INT, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "int", TYPE_INT, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + { "int", TYPE_INT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "float", TYPE_FLOAT, { TYPE_BOOL, TYPE_VOID } }, - { "float", TYPE_FLOAT, { TYPE_INT, TYPE_VOID } }, - { "float", TYPE_FLOAT, { TYPE_UINT, TYPE_VOID } }, - { "float", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, + { "float", TYPE_FLOAT, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, + { "float", TYPE_FLOAT, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "float", TYPE_FLOAT, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + { "float", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "uint", TYPE_UINT, { TYPE_BOOL, TYPE_VOID } }, - { "uint", TYPE_UINT, { TYPE_INT, TYPE_VOID } }, - { "uint", TYPE_UINT, { TYPE_UINT, TYPE_VOID } }, - { "uint", TYPE_UINT, { TYPE_FLOAT, TYPE_VOID } }, + { "uint", TYPE_UINT, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, + { "uint", TYPE_UINT, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "uint", TYPE_UINT, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + { "uint", TYPE_UINT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, - { "bool", TYPE_BOOL, { TYPE_BOOL, TYPE_VOID } }, - { "bool", TYPE_BOOL, { TYPE_INT, TYPE_VOID } }, - { "bool", TYPE_BOOL, { TYPE_UINT, TYPE_VOID } }, - { "bool", TYPE_BOOL, { TYPE_FLOAT, TYPE_VOID } }, + { "bool", TYPE_BOOL, { TYPE_BOOL, TYPE_VOID }, TAG_GLOBAL }, + { "bool", TYPE_BOOL, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "bool", TYPE_BOOL, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + { "bool", TYPE_BOOL, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, //conversion vectors - { "ivec2", TYPE_IVEC2, { TYPE_BVEC2, TYPE_VOID } }, - { "ivec2", TYPE_IVEC2, { TYPE_IVEC2, TYPE_VOID } }, - { "ivec2", TYPE_IVEC2, { TYPE_UVEC2, TYPE_VOID } }, - { "ivec2", TYPE_IVEC2, { TYPE_VEC2, TYPE_VOID } }, - - { "vec2", TYPE_VEC2, { TYPE_BVEC2, TYPE_VOID } }, - { "vec2", TYPE_VEC2, { TYPE_IVEC2, TYPE_VOID } }, - { "vec2", TYPE_VEC2, { TYPE_UVEC2, TYPE_VOID } }, - { "vec2", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - - { "uvec2", TYPE_UVEC2, { TYPE_BVEC2, TYPE_VOID } }, - { "uvec2", TYPE_UVEC2, { TYPE_IVEC2, TYPE_VOID } }, - { "uvec2", TYPE_UVEC2, { TYPE_UVEC2, TYPE_VOID } }, - { "uvec2", TYPE_UVEC2, { TYPE_VEC2, TYPE_VOID } }, - - { "bvec2", TYPE_BVEC2, { TYPE_BVEC2, TYPE_VOID } }, - { "bvec2", TYPE_BVEC2, { TYPE_IVEC2, TYPE_VOID } }, - { "bvec2", TYPE_BVEC2, { TYPE_UVEC2, TYPE_VOID } }, - { "bvec2", TYPE_BVEC2, { TYPE_VEC2, TYPE_VOID } }, - - { "ivec3", TYPE_IVEC3, { TYPE_BVEC3, TYPE_VOID } }, - { "ivec3", TYPE_IVEC3, { TYPE_IVEC3, TYPE_VOID } }, - { "ivec3", TYPE_IVEC3, { TYPE_UVEC3, TYPE_VOID } }, - { "ivec3", TYPE_IVEC3, { TYPE_VEC3, TYPE_VOID } }, - - { "vec3", TYPE_VEC3, { TYPE_BVEC3, TYPE_VOID } }, - { "vec3", TYPE_VEC3, { TYPE_IVEC3, TYPE_VOID } }, - { "vec3", TYPE_VEC3, { TYPE_UVEC3, TYPE_VOID } }, - { "vec3", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - - { "uvec3", TYPE_UVEC3, { TYPE_BVEC3, TYPE_VOID } }, - { "uvec3", TYPE_UVEC3, { TYPE_IVEC3, TYPE_VOID } }, - { "uvec3", TYPE_UVEC3, { TYPE_UVEC3, TYPE_VOID } }, - { "uvec3", TYPE_UVEC3, { TYPE_VEC3, TYPE_VOID } }, - - { "bvec3", TYPE_BVEC3, { TYPE_BVEC3, TYPE_VOID } }, - { "bvec3", TYPE_BVEC3, { TYPE_IVEC3, TYPE_VOID } }, - { "bvec3", TYPE_BVEC3, { TYPE_UVEC3, TYPE_VOID } }, - { "bvec3", TYPE_BVEC3, { TYPE_VEC3, TYPE_VOID } }, - - { "ivec4", TYPE_IVEC4, { TYPE_BVEC4, TYPE_VOID } }, - { "ivec4", TYPE_IVEC4, { TYPE_IVEC4, TYPE_VOID } }, - { "ivec4", TYPE_IVEC4, { TYPE_UVEC4, TYPE_VOID } }, - { "ivec4", TYPE_IVEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "vec4", TYPE_VEC4, { TYPE_BVEC4, TYPE_VOID } }, - { "vec4", TYPE_VEC4, { TYPE_IVEC4, TYPE_VOID } }, - { "vec4", TYPE_VEC4, { TYPE_UVEC4, TYPE_VOID } }, - { "vec4", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "uvec4", TYPE_UVEC4, { TYPE_BVEC4, TYPE_VOID } }, - { "uvec4", TYPE_UVEC4, { TYPE_IVEC4, TYPE_VOID } }, - { "uvec4", TYPE_UVEC4, { TYPE_UVEC4, TYPE_VOID } }, - { "uvec4", TYPE_UVEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "bvec4", TYPE_BVEC4, { TYPE_BVEC4, TYPE_VOID } }, - { "bvec4", TYPE_BVEC4, { TYPE_IVEC4, TYPE_VOID } }, - { "bvec4", TYPE_BVEC4, { TYPE_UVEC4, TYPE_VOID } }, - { "bvec4", TYPE_BVEC4, { TYPE_VEC4, TYPE_VOID } }, + { "ivec2", TYPE_IVEC2, { TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "ivec2", TYPE_IVEC2, { TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "ivec2", TYPE_IVEC2, { TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "ivec2", TYPE_IVEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + + { "vec2", TYPE_VEC2, { TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "vec2", TYPE_VEC2, { TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "vec2", TYPE_VEC2, { TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "vec2", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + + { "uvec2", TYPE_UVEC2, { TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "uvec2", TYPE_UVEC2, { TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "uvec2", TYPE_UVEC2, { TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "uvec2", TYPE_UVEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + + { "bvec2", TYPE_BVEC2, { TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "bvec2", TYPE_BVEC2, { TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "bvec2", TYPE_BVEC2, { TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "bvec2", TYPE_BVEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + + { "ivec3", TYPE_IVEC3, { TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "ivec3", TYPE_IVEC3, { TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "ivec3", TYPE_IVEC3, { TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "ivec3", TYPE_IVEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + + { "vec3", TYPE_VEC3, { TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "vec3", TYPE_VEC3, { TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "vec3", TYPE_VEC3, { TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "vec3", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + + { "uvec3", TYPE_UVEC3, { TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "uvec3", TYPE_UVEC3, { TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "uvec3", TYPE_UVEC3, { TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "uvec3", TYPE_UVEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + + { "bvec3", TYPE_BVEC3, { TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "bvec3", TYPE_BVEC3, { TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "bvec3", TYPE_BVEC3, { TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "bvec3", TYPE_BVEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + + { "ivec4", TYPE_IVEC4, { TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL }, + { "ivec4", TYPE_IVEC4, { TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, + { "ivec4", TYPE_IVEC4, { TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, + { "ivec4", TYPE_IVEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "vec4", TYPE_VEC4, { TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL }, + { "vec4", TYPE_VEC4, { TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, + { "vec4", TYPE_VEC4, { TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, + { "vec4", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "uvec4", TYPE_UVEC4, { TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL }, + { "uvec4", TYPE_UVEC4, { TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, + { "uvec4", TYPE_UVEC4, { TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, + { "uvec4", TYPE_UVEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "bvec4", TYPE_BVEC4, { TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL }, + { "bvec4", TYPE_BVEC4, { TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, + { "bvec4", TYPE_BVEC4, { TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, + { "bvec4", TYPE_BVEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, //conversion between matrixes - { "mat2", TYPE_MAT2, { TYPE_MAT3, TYPE_VOID } }, - { "mat2", TYPE_MAT2, { TYPE_MAT4, TYPE_VOID } }, - { "mat3", TYPE_MAT3, { TYPE_MAT2, TYPE_VOID } }, - { "mat3", TYPE_MAT3, { TYPE_MAT4, TYPE_VOID } }, - { "mat4", TYPE_MAT4, { TYPE_MAT2, TYPE_VOID } }, - { "mat4", TYPE_MAT4, { TYPE_MAT3, TYPE_VOID } }, + { "mat2", TYPE_MAT2, { TYPE_MAT3, TYPE_VOID }, TAG_GLOBAL }, + { "mat2", TYPE_MAT2, { TYPE_MAT4, TYPE_VOID }, TAG_GLOBAL }, + { "mat3", TYPE_MAT3, { TYPE_MAT2, TYPE_VOID }, TAG_GLOBAL }, + { "mat3", TYPE_MAT3, { TYPE_MAT4, TYPE_VOID }, TAG_GLOBAL }, + { "mat4", TYPE_MAT4, { TYPE_MAT2, TYPE_VOID }, TAG_GLOBAL }, + { "mat4", TYPE_MAT4, { TYPE_MAT3, TYPE_VOID }, TAG_GLOBAL }, //builtins - trigonometry - { "radians", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "radians", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "radians", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "radians", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "degrees", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "degrees", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "degrees", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "degrees", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "sin", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "sin", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "sin", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "sin", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "cos", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "cos", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "cos", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "cos", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "tan", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "tan", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "tan", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "tan", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "asin", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "asin", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "asin", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "asin", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "acos", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "acos", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "acos", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "acos", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "atan", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "atan", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "atan", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "atan", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - { "atan", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "atan", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "atan", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "atan", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - - { "sinh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "sinh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "sinh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "sinh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "cosh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "cosh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "cosh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "cosh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "tanh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "tanh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "tanh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "tanh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "asinh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "asinh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "asinh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "asinh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "acosh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "acosh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "acosh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "acosh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "atanh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "atanh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "atanh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "atanh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, + { "radians", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "radians", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "radians", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "radians", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "degrees", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "degrees", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "degrees", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "degrees", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "sin", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "sin", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "sin", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "sin", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "cos", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "cos", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "cos", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "cos", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "tan", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "tan", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "tan", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "tan", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "asin", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "asin", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "asin", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "asin", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "acos", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "acos", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "acos", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "acos", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "atan", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "atan", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "atan", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "atan", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "atan", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "atan", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "atan", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "atan", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "sinh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "sinh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "sinh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "sinh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "cosh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "cosh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "cosh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "cosh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "tanh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "tanh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "tanh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "tanh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "asinh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "asinh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "asinh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "asinh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "acosh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "acosh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "acosh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "acosh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "atanh", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "atanh", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "atanh", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "atanh", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, //builtins - exponential - { "pow", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "pow", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "pow", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "pow", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - { "exp", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "exp", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "exp", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "exp", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - { "log", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "log", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "log", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "log", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - { "exp2", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "exp2", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "exp2", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "exp2", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - { "log2", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "log2", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "log2", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "log2", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - { "sqrt", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "sqrt", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "sqrt", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "sqrt", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - { "inversesqrt", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "inversesqrt", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "inversesqrt", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "inversesqrt", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, + { "pow", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "pow", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "pow", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "pow", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "exp", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "exp", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "exp", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "exp", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "log", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "log", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "log", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "log", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "exp2", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "exp2", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "exp2", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "exp2", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "log2", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "log2", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "log2", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "log2", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "sqrt", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "sqrt", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "sqrt", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "sqrt", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "inversesqrt", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "inversesqrt", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "inversesqrt", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "inversesqrt", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, //builtins - common - { "abs", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "abs", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "abs", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "abs", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "abs", TYPE_INT, { TYPE_INT, TYPE_VOID } }, - { "abs", TYPE_IVEC2, { TYPE_IVEC2, TYPE_VOID } }, - { "abs", TYPE_IVEC3, { TYPE_IVEC3, TYPE_VOID } }, - { "abs", TYPE_IVEC4, { TYPE_IVEC4, TYPE_VOID } }, - - { "sign", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "sign", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "sign", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "sign", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "sign", TYPE_INT, { TYPE_INT, TYPE_VOID } }, - { "sign", TYPE_IVEC2, { TYPE_IVEC2, TYPE_VOID } }, - { "sign", TYPE_IVEC3, { TYPE_IVEC3, TYPE_VOID } }, - { "sign", TYPE_IVEC4, { TYPE_IVEC4, TYPE_VOID } }, - - { "floor", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "floor", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "floor", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "floor", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - { "trunc", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "trunc", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "trunc", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "trunc", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - { "round", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "round", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "round", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "round", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - { "roundEven", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "roundEven", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "roundEven", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "roundEven", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - { "ceil", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "ceil", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "ceil", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "ceil", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - { "fract", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "fract", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "fract", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "fract", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "mod", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "mod", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "mod", TYPE_VEC2, { TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } }, - { "mod", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "mod", TYPE_VEC3, { TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "mod", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - { "mod", TYPE_VEC4, { TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } }, - - { "modf", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "modf", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "modf", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "modf", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - - { "min", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "min", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "min", TYPE_VEC2, { TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } }, - { "min", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "min", TYPE_VEC3, { TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "min", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - { "min", TYPE_VEC4, { TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } }, - - { "min", TYPE_INT, { TYPE_INT, TYPE_INT, TYPE_VOID } }, - { "min", TYPE_IVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID } }, - { "min", TYPE_IVEC2, { TYPE_IVEC2, TYPE_INT, TYPE_VOID } }, - { "min", TYPE_IVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID } }, - { "min", TYPE_IVEC3, { TYPE_IVEC3, TYPE_INT, TYPE_VOID } }, - { "min", TYPE_IVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID } }, - { "min", TYPE_IVEC4, { TYPE_IVEC4, TYPE_INT, TYPE_VOID } }, - - { "min", TYPE_UINT, { TYPE_UINT, TYPE_UINT, TYPE_VOID } }, - { "min", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID } }, - { "min", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UINT, TYPE_VOID } }, - { "min", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID } }, - { "min", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UINT, TYPE_VOID } }, - { "min", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID } }, - { "min", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UINT, TYPE_VOID } }, - - { "max", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "max", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "max", TYPE_VEC2, { TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } }, - { "max", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "max", TYPE_VEC3, { TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "max", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - { "max", TYPE_VEC4, { TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } }, - - { "max", TYPE_INT, { TYPE_INT, TYPE_INT, TYPE_VOID } }, - { "max", TYPE_IVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID } }, - { "max", TYPE_IVEC2, { TYPE_IVEC2, TYPE_INT, TYPE_VOID } }, - { "max", TYPE_IVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID } }, - { "max", TYPE_IVEC3, { TYPE_IVEC3, TYPE_INT, TYPE_VOID } }, - { "max", TYPE_IVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID } }, - { "max", TYPE_IVEC4, { TYPE_IVEC4, TYPE_INT, TYPE_VOID } }, - - { "max", TYPE_UINT, { TYPE_UINT, TYPE_UINT, TYPE_VOID } }, - { "max", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID } }, - { "max", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UINT, TYPE_VOID } }, - { "max", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID } }, - { "max", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UINT, TYPE_VOID } }, - { "max", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID } }, - { "max", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UINT, TYPE_VOID } }, - - { "clamp", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "clamp", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "clamp", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "clamp", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - { "clamp", TYPE_VEC2, { TYPE_VEC2, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "clamp", TYPE_VEC3, { TYPE_VEC3, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "clamp", TYPE_VEC4, { TYPE_VEC4, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - - { "clamp", TYPE_INT, { TYPE_INT, TYPE_INT, TYPE_INT, TYPE_VOID } }, - { "clamp", TYPE_IVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID } }, - { "clamp", TYPE_IVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID } }, - { "clamp", TYPE_IVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID } }, - { "clamp", TYPE_IVEC2, { TYPE_IVEC2, TYPE_INT, TYPE_INT, TYPE_VOID } }, - { "clamp", TYPE_IVEC3, { TYPE_IVEC3, TYPE_INT, TYPE_INT, TYPE_VOID } }, - { "clamp", TYPE_IVEC4, { TYPE_IVEC4, TYPE_INT, TYPE_INT, TYPE_VOID } }, - - { "clamp", TYPE_UINT, { TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_VOID } }, - { "clamp", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID } }, - { "clamp", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID } }, - { "clamp", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID } }, - { "clamp", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UINT, TYPE_UINT, TYPE_VOID } }, - { "clamp", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UINT, TYPE_UINT, TYPE_VOID } }, - { "clamp", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UINT, TYPE_UINT, TYPE_VOID } }, - - { "mix", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "mix", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } }, - { "mix", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_BVEC2, TYPE_VOID } }, - { "mix", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "mix", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "mix", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_BVEC3, TYPE_VOID } }, - { "mix", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "mix", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } }, - { "mix", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_BVEC4, TYPE_VOID } }, - { "mix", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - - { "step", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "step", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "step", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "step", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - { "step", TYPE_VEC2, { TYPE_FLOAT, TYPE_VEC2, TYPE_VOID } }, - { "step", TYPE_VEC3, { TYPE_FLOAT, TYPE_VEC3, TYPE_VOID } }, - { "step", TYPE_VEC4, { TYPE_FLOAT, TYPE_VEC4, TYPE_VOID } }, - { "smoothstep", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID } }, - { "smoothstep", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "smoothstep", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "smoothstep", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - { "smoothstep", TYPE_VEC2, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VEC2, TYPE_VOID } }, - { "smoothstep", TYPE_VEC3, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VEC3, TYPE_VOID } }, - { "smoothstep", TYPE_VEC4, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VEC4, TYPE_VOID } }, - - { "isnan", TYPE_BOOL, { TYPE_FLOAT, TYPE_VOID } }, - { "isnan", TYPE_BVEC2, { TYPE_VEC2, TYPE_VOID } }, - { "isnan", TYPE_BVEC3, { TYPE_VEC3, TYPE_VOID } }, - { "isnan", TYPE_BVEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "isinf", TYPE_BOOL, { TYPE_FLOAT, TYPE_VOID } }, - { "isinf", TYPE_BVEC2, { TYPE_VEC2, TYPE_VOID } }, - { "isinf", TYPE_BVEC3, { TYPE_VEC3, TYPE_VOID } }, - { "isinf", TYPE_BVEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "floatBitsToInt", TYPE_INT, { TYPE_FLOAT, TYPE_VOID } }, - { "floatBitsToInt", TYPE_IVEC2, { TYPE_VEC2, TYPE_VOID } }, - { "floatBitsToInt", TYPE_IVEC3, { TYPE_VEC3, TYPE_VOID } }, - { "floatBitsToInt", TYPE_IVEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "floatBitsToUint", TYPE_UINT, { TYPE_FLOAT, TYPE_VOID } }, - { "floatBitsToUint", TYPE_UVEC2, { TYPE_VEC2, TYPE_VOID } }, - { "floatBitsToUint", TYPE_UVEC3, { TYPE_VEC3, TYPE_VOID } }, - { "floatBitsToUint", TYPE_UVEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "intBitsToFloat", TYPE_FLOAT, { TYPE_INT, TYPE_VOID } }, - { "intBitsToFloat", TYPE_VEC2, { TYPE_IVEC2, TYPE_VOID } }, - { "intBitsToFloat", TYPE_VEC3, { TYPE_IVEC3, TYPE_VOID } }, - { "intBitsToFloat", TYPE_VEC4, { TYPE_IVEC4, TYPE_VOID } }, - - { "uintBitsToFloat", TYPE_FLOAT, { TYPE_UINT, TYPE_VOID } }, - { "uintBitsToFloat", TYPE_VEC2, { TYPE_UVEC2, TYPE_VOID } }, - { "uintBitsToFloat", TYPE_VEC3, { TYPE_UVEC3, TYPE_VOID } }, - { "uintBitsToFloat", TYPE_VEC4, { TYPE_UVEC4, TYPE_VOID } }, + { "abs", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "abs", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "abs", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "abs", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "abs", TYPE_INT, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "abs", TYPE_IVEC2, { TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "abs", TYPE_IVEC3, { TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "abs", TYPE_IVEC4, { TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "sign", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "sign", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "sign", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "sign", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "sign", TYPE_INT, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "sign", TYPE_IVEC2, { TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "sign", TYPE_IVEC3, { TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "sign", TYPE_IVEC4, { TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "floor", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "floor", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "floor", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "floor", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "trunc", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "trunc", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "trunc", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "trunc", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "round", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "round", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "round", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "round", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "roundEven", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "roundEven", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "roundEven", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "roundEven", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "ceil", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "ceil", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "ceil", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "ceil", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "fract", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "fract", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "fract", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "fract", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "mod", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "mod", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "mod", TYPE_VEC2, { TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "mod", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "mod", TYPE_VEC3, { TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "mod", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "mod", TYPE_VEC4, { TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + + { "modf", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "modf", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "modf", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "modf", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "min", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "min", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "min", TYPE_VEC2, { TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "min", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "min", TYPE_VEC3, { TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "min", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "min", TYPE_VEC4, { TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + + { "min", TYPE_INT, { TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "min", TYPE_IVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "min", TYPE_IVEC2, { TYPE_IVEC2, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "min", TYPE_IVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "min", TYPE_IVEC3, { TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "min", TYPE_IVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, + { "min", TYPE_IVEC4, { TYPE_IVEC4, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + + { "min", TYPE_UINT, { TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + { "min", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "min", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + { "min", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "min", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + { "min", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, + { "min", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + + { "max", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "max", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "max", TYPE_VEC2, { TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "max", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "max", TYPE_VEC3, { TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "max", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "max", TYPE_VEC4, { TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + + { "max", TYPE_INT, { TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "max", TYPE_IVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "max", TYPE_IVEC2, { TYPE_IVEC2, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "max", TYPE_IVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "max", TYPE_IVEC3, { TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "max", TYPE_IVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, + { "max", TYPE_IVEC4, { TYPE_IVEC4, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + + { "max", TYPE_UINT, { TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + { "max", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "max", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + { "max", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "max", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + { "max", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, + { "max", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + + { "clamp", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "clamp", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "clamp", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "clamp", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "clamp", TYPE_VEC2, { TYPE_VEC2, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "clamp", TYPE_VEC3, { TYPE_VEC3, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "clamp", TYPE_VEC4, { TYPE_VEC4, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + + { "clamp", TYPE_INT, { TYPE_INT, TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "clamp", TYPE_IVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "clamp", TYPE_IVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "clamp", TYPE_IVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, + { "clamp", TYPE_IVEC2, { TYPE_IVEC2, TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "clamp", TYPE_IVEC3, { TYPE_IVEC3, TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "clamp", TYPE_IVEC4, { TYPE_IVEC4, TYPE_INT, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + + { "clamp", TYPE_UINT, { TYPE_UINT, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + { "clamp", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "clamp", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "clamp", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, + { "clamp", TYPE_UVEC2, { TYPE_UVEC2, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + { "clamp", TYPE_UVEC3, { TYPE_UVEC3, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + { "clamp", TYPE_UVEC4, { TYPE_UVEC4, TYPE_UINT, TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + + { "mix", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "mix", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "mix", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "mix", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "mix", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "mix", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "mix", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "mix", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "mix", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL }, + { "mix", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "step", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "step", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "step", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "step", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "step", TYPE_VEC2, { TYPE_FLOAT, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "step", TYPE_VEC3, { TYPE_FLOAT, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "step", TYPE_VEC4, { TYPE_FLOAT, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "smoothstep", TYPE_FLOAT, { TYPE_FLOAT, TYPE_FLOAT, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "smoothstep", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "smoothstep", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "smoothstep", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "smoothstep", TYPE_VEC2, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "smoothstep", TYPE_VEC3, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "smoothstep", TYPE_VEC4, { TYPE_FLOAT, TYPE_FLOAT, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "isnan", TYPE_BOOL, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "isnan", TYPE_BVEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "isnan", TYPE_BVEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "isnan", TYPE_BVEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "isinf", TYPE_BOOL, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "isinf", TYPE_BVEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "isinf", TYPE_BVEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "isinf", TYPE_BVEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "floatBitsToInt", TYPE_INT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "floatBitsToInt", TYPE_IVEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "floatBitsToInt", TYPE_IVEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "floatBitsToInt", TYPE_IVEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "floatBitsToUint", TYPE_UINT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "floatBitsToUint", TYPE_UVEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "floatBitsToUint", TYPE_UVEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "floatBitsToUint", TYPE_UVEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "intBitsToFloat", TYPE_FLOAT, { TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "intBitsToFloat", TYPE_VEC2, { TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "intBitsToFloat", TYPE_VEC3, { TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "intBitsToFloat", TYPE_VEC4, { TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "uintBitsToFloat", TYPE_FLOAT, { TYPE_UINT, TYPE_VOID }, TAG_GLOBAL }, + { "uintBitsToFloat", TYPE_VEC2, { TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "uintBitsToFloat", TYPE_VEC3, { TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "uintBitsToFloat", TYPE_VEC4, { TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, //builtins - geometric - { "length", TYPE_FLOAT, { TYPE_VEC2, TYPE_VOID } }, - { "length", TYPE_FLOAT, { TYPE_VEC3, TYPE_VOID } }, - { "length", TYPE_FLOAT, { TYPE_VEC4, TYPE_VOID } }, - { "distance", TYPE_FLOAT, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "distance", TYPE_FLOAT, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "distance", TYPE_FLOAT, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - { "dot", TYPE_FLOAT, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "dot", TYPE_FLOAT, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "dot", TYPE_FLOAT, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - { "cross", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "normalize", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "normalize", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "normalize", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - { "reflect", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "refract", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - - { "faceforward", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "faceforward", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "faceforward", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - - { "matrixCompMult", TYPE_MAT2, { TYPE_MAT2, TYPE_MAT2, TYPE_VOID } }, - { "matrixCompMult", TYPE_MAT3, { TYPE_MAT3, TYPE_MAT3, TYPE_VOID } }, - { "matrixCompMult", TYPE_MAT4, { TYPE_MAT4, TYPE_MAT4, TYPE_VOID } }, - - { "outerProduct", TYPE_MAT2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "outerProduct", TYPE_MAT3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "outerProduct", TYPE_MAT4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - - { "transpose", TYPE_MAT2, { TYPE_MAT2, TYPE_VOID } }, - { "transpose", TYPE_MAT3, { TYPE_MAT3, TYPE_VOID } }, - { "transpose", TYPE_MAT4, { TYPE_MAT4, TYPE_VOID } }, - - { "determinant", TYPE_FLOAT, { TYPE_MAT2, TYPE_VOID } }, - { "determinant", TYPE_FLOAT, { TYPE_MAT3, TYPE_VOID } }, - { "determinant", TYPE_FLOAT, { TYPE_MAT4, TYPE_VOID } }, - - { "inverse", TYPE_MAT2, { TYPE_MAT2, TYPE_VOID } }, - { "inverse", TYPE_MAT3, { TYPE_MAT3, TYPE_VOID } }, - { "inverse", TYPE_MAT4, { TYPE_MAT4, TYPE_VOID } }, - - { "lessThan", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "lessThan", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "lessThan", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - - { "lessThan", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID } }, - { "lessThan", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID } }, - { "lessThan", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID } }, - - { "lessThan", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID } }, - { "lessThan", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID } }, - { "lessThan", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID } }, - - { "greaterThan", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "greaterThan", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "greaterThan", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - - { "greaterThan", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID } }, - { "greaterThan", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID } }, - { "greaterThan", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID } }, - - { "greaterThan", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID } }, - { "greaterThan", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID } }, - { "greaterThan", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID } }, - - { "lessThanEqual", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "lessThanEqual", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "lessThanEqual", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - - { "lessThanEqual", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID } }, - { "lessThanEqual", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID } }, - { "lessThanEqual", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID } }, - - { "lessThanEqual", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID } }, - { "lessThanEqual", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID } }, - { "lessThanEqual", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID } }, - - { "greaterThanEqual", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "greaterThanEqual", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "greaterThanEqual", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - - { "greaterThanEqual", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID } }, - { "greaterThanEqual", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID } }, - { "greaterThanEqual", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID } }, - - { "greaterThanEqual", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID } }, - { "greaterThanEqual", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID } }, - { "greaterThanEqual", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID } }, - - { "equal", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "equal", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "equal", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - - { "equal", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID } }, - { "equal", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID } }, - { "equal", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID } }, - - { "equal", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID } }, - { "equal", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID } }, - { "equal", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID } }, - - { "equal", TYPE_BVEC2, { TYPE_BVEC2, TYPE_BVEC2, TYPE_VOID } }, - { "equal", TYPE_BVEC3, { TYPE_BVEC3, TYPE_BVEC3, TYPE_VOID } }, - { "equal", TYPE_BVEC4, { TYPE_BVEC4, TYPE_BVEC4, TYPE_VOID } }, - - { "notEqual", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "notEqual", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "notEqual", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID } }, - - { "notEqual", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID } }, - { "notEqual", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID } }, - { "notEqual", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID } }, + { "length", TYPE_FLOAT, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "length", TYPE_FLOAT, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "length", TYPE_FLOAT, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "distance", TYPE_FLOAT, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "distance", TYPE_FLOAT, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "distance", TYPE_FLOAT, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "dot", TYPE_FLOAT, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "dot", TYPE_FLOAT, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "dot", TYPE_FLOAT, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "cross", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "normalize", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "normalize", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "normalize", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "reflect", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "refract", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + + { "faceforward", TYPE_VEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "faceforward", TYPE_VEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "faceforward", TYPE_VEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "matrixCompMult", TYPE_MAT2, { TYPE_MAT2, TYPE_MAT2, TYPE_VOID }, TAG_GLOBAL }, + { "matrixCompMult", TYPE_MAT3, { TYPE_MAT3, TYPE_MAT3, TYPE_VOID }, TAG_GLOBAL }, + { "matrixCompMult", TYPE_MAT4, { TYPE_MAT4, TYPE_MAT4, TYPE_VOID }, TAG_GLOBAL }, + + { "outerProduct", TYPE_MAT2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "outerProduct", TYPE_MAT3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "outerProduct", TYPE_MAT4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "transpose", TYPE_MAT2, { TYPE_MAT2, TYPE_VOID }, TAG_GLOBAL }, + { "transpose", TYPE_MAT3, { TYPE_MAT3, TYPE_VOID }, TAG_GLOBAL }, + { "transpose", TYPE_MAT4, { TYPE_MAT4, TYPE_VOID }, TAG_GLOBAL }, + + { "determinant", TYPE_FLOAT, { TYPE_MAT2, TYPE_VOID }, TAG_GLOBAL }, + { "determinant", TYPE_FLOAT, { TYPE_MAT3, TYPE_VOID }, TAG_GLOBAL }, + { "determinant", TYPE_FLOAT, { TYPE_MAT4, TYPE_VOID }, TAG_GLOBAL }, + + { "inverse", TYPE_MAT2, { TYPE_MAT2, TYPE_VOID }, TAG_GLOBAL }, + { "inverse", TYPE_MAT3, { TYPE_MAT3, TYPE_VOID }, TAG_GLOBAL }, + { "inverse", TYPE_MAT4, { TYPE_MAT4, TYPE_VOID }, TAG_GLOBAL }, + + { "lessThan", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "lessThan", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "lessThan", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "lessThan", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "lessThan", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "lessThan", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "lessThan", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "lessThan", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "lessThan", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "greaterThan", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "greaterThan", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "greaterThan", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "greaterThan", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "greaterThan", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "greaterThan", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "greaterThan", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "greaterThan", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "greaterThan", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "lessThanEqual", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "lessThanEqual", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "lessThanEqual", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "lessThanEqual", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "lessThanEqual", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "lessThanEqual", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "lessThanEqual", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "lessThanEqual", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "lessThanEqual", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "greaterThanEqual", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "greaterThanEqual", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "greaterThanEqual", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "greaterThanEqual", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "greaterThanEqual", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "greaterThanEqual", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "greaterThanEqual", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "greaterThanEqual", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "greaterThanEqual", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "equal", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "equal", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "equal", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "equal", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "equal", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "equal", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "equal", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "equal", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "equal", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "equal", TYPE_BVEC2, { TYPE_BVEC2, TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "equal", TYPE_BVEC3, { TYPE_BVEC3, TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "equal", TYPE_BVEC4, { TYPE_BVEC4, TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "notEqual", TYPE_BVEC2, { TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "notEqual", TYPE_BVEC3, { TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "notEqual", TYPE_BVEC4, { TYPE_VEC4, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + { "notEqual", TYPE_BVEC2, { TYPE_IVEC2, TYPE_IVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "notEqual", TYPE_BVEC3, { TYPE_IVEC3, TYPE_IVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "notEqual", TYPE_BVEC4, { TYPE_IVEC4, TYPE_IVEC4, TYPE_VOID }, TAG_GLOBAL }, - { "notEqual", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID } }, - { "notEqual", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID } }, - { "notEqual", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID } }, + { "notEqual", TYPE_BVEC2, { TYPE_UVEC2, TYPE_UVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "notEqual", TYPE_BVEC3, { TYPE_UVEC3, TYPE_UVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "notEqual", TYPE_BVEC4, { TYPE_UVEC4, TYPE_UVEC4, TYPE_VOID }, TAG_GLOBAL }, - { "notEqual", TYPE_BVEC2, { TYPE_BVEC2, TYPE_BVEC2, TYPE_VOID } }, - { "notEqual", TYPE_BVEC3, { TYPE_BVEC3, TYPE_BVEC3, TYPE_VOID } }, - { "notEqual", TYPE_BVEC4, { TYPE_BVEC4, TYPE_BVEC4, TYPE_VOID } }, + { "notEqual", TYPE_BVEC2, { TYPE_BVEC2, TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "notEqual", TYPE_BVEC3, { TYPE_BVEC3, TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "notEqual", TYPE_BVEC4, { TYPE_BVEC4, TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL }, - { "any", TYPE_BOOL, { TYPE_BVEC2, TYPE_VOID } }, - { "any", TYPE_BOOL, { TYPE_BVEC3, TYPE_VOID } }, - { "any", TYPE_BOOL, { TYPE_BVEC4, TYPE_VOID } }, + { "any", TYPE_BOOL, { TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "any", TYPE_BOOL, { TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "any", TYPE_BOOL, { TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL }, - { "all", TYPE_BOOL, { TYPE_BVEC2, TYPE_VOID } }, - { "all", TYPE_BOOL, { TYPE_BVEC3, TYPE_VOID } }, - { "all", TYPE_BOOL, { TYPE_BVEC4, TYPE_VOID } }, + { "all", TYPE_BOOL, { TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "all", TYPE_BOOL, { TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "all", TYPE_BOOL, { TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL }, - { "not", TYPE_BVEC2, { TYPE_BVEC2, TYPE_VOID } }, - { "not", TYPE_BVEC3, { TYPE_BVEC3, TYPE_VOID } }, - { "not", TYPE_BVEC4, { TYPE_BVEC4, TYPE_VOID } }, + { "not", TYPE_BVEC2, { TYPE_BVEC2, TYPE_VOID }, TAG_GLOBAL }, + { "not", TYPE_BVEC3, { TYPE_BVEC3, TYPE_VOID }, TAG_GLOBAL }, + { "not", TYPE_BVEC4, { TYPE_BVEC4, TYPE_VOID }, TAG_GLOBAL }, //builtins - texture - { "textureSize", TYPE_IVEC2, { TYPE_SAMPLER2D, TYPE_INT, TYPE_VOID } }, - { "textureSize", TYPE_IVEC2, { TYPE_ISAMPLER2D, TYPE_INT, TYPE_VOID } }, - { "textureSize", TYPE_IVEC2, { TYPE_USAMPLER2D, TYPE_INT, TYPE_VOID } }, - { "textureSize", TYPE_IVEC3, { TYPE_SAMPLER2DARRAY, TYPE_INT, TYPE_VOID } }, - { "textureSize", TYPE_IVEC3, { TYPE_ISAMPLER2DARRAY, TYPE_INT, TYPE_VOID } }, - { "textureSize", TYPE_IVEC3, { TYPE_USAMPLER2DARRAY, TYPE_INT, TYPE_VOID } }, - { "textureSize", TYPE_IVEC3, { TYPE_SAMPLER3D, TYPE_INT, TYPE_VOID } }, - { "textureSize", TYPE_IVEC3, { TYPE_ISAMPLER3D, TYPE_INT, TYPE_VOID } }, - { "textureSize", TYPE_IVEC3, { TYPE_USAMPLER3D, TYPE_INT, TYPE_VOID } }, - { "textureSize", TYPE_IVEC2, { TYPE_SAMPLERCUBE, TYPE_INT, TYPE_VOID } }, - - { "texture", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC2, TYPE_VOID } }, - { "texture", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } }, - - { "texture", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC2, TYPE_VOID } }, - { "texture", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } }, - - { "texture", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC2, TYPE_VOID } }, - { "texture", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } }, - - { "texture", TYPE_VEC4, { TYPE_SAMPLER2DARRAY, TYPE_VEC3, TYPE_VOID } }, - { "texture", TYPE_VEC4, { TYPE_SAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - - { "texture", TYPE_UVEC4, { TYPE_USAMPLER2DARRAY, TYPE_VEC3, TYPE_VOID } }, - { "texture", TYPE_UVEC4, { TYPE_USAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - - { "texture", TYPE_IVEC4, { TYPE_ISAMPLER2DARRAY, TYPE_VEC3, TYPE_VOID } }, - { "texture", TYPE_IVEC4, { TYPE_ISAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - - { "texture", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC3, TYPE_VOID } }, - { "texture", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - - { "texture", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC3, TYPE_VOID } }, - { "texture", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - - { "texture", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC3, TYPE_VOID } }, - { "texture", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - - { "texture", TYPE_VEC4, { TYPE_SAMPLERCUBE, TYPE_VEC3, TYPE_VOID } }, - { "texture", TYPE_VEC4, { TYPE_SAMPLERCUBE, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - - { "textureProj", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC3, TYPE_VOID } }, - { "textureProj", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC4, TYPE_VOID } }, - { "textureProj", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "textureProj", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } }, - - { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC3, TYPE_VOID } }, - { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC4, TYPE_VOID } }, - { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } }, - - { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC3, TYPE_VOID } }, - { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC4, TYPE_VOID } }, - { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } }, - - { "textureProj", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC4, TYPE_VOID } }, - { "textureProj", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } }, - - { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC4, TYPE_VOID } }, - { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } }, - - { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC4, TYPE_VOID } }, - { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } }, - - { "textureLod", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } }, - { "textureLod", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } }, - { "textureLod", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID } }, - { "textureLod", TYPE_VEC4, { TYPE_SAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "textureLod", TYPE_IVEC4, { TYPE_ISAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "textureLod", TYPE_UVEC4, { TYPE_USAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "textureLod", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "textureLod", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "textureLod", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "textureLod", TYPE_VEC4, { TYPE_SAMPLERCUBE, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - - { "texelFetch", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_IVEC2, TYPE_INT, TYPE_VOID } }, - { "texelFetch", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_IVEC2, TYPE_INT, TYPE_VOID } }, - { "texelFetch", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_IVEC2, TYPE_INT, TYPE_VOID } }, - - { "texelFetch", TYPE_VEC4, { TYPE_SAMPLER2DARRAY, TYPE_IVEC3, TYPE_INT, TYPE_VOID } }, - { "texelFetch", TYPE_IVEC4, { TYPE_ISAMPLER2DARRAY, TYPE_IVEC3, TYPE_INT, TYPE_VOID } }, - { "texelFetch", TYPE_UVEC4, { TYPE_USAMPLER2DARRAY, TYPE_IVEC3, TYPE_INT, TYPE_VOID } }, - - { "texelFetch", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_IVEC3, TYPE_INT, TYPE_VOID } }, - { "texelFetch", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_IVEC3, TYPE_INT, TYPE_VOID } }, - { "texelFetch", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_IVEC3, TYPE_INT, TYPE_VOID } }, - - { "textureProjLod", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "textureProjLod", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } }, - - { "textureProjLod", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "textureProjLod", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } }, - - { "textureProjLod", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID } }, - { "textureProjLod", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID } }, - - { "textureGrad", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "textureGrad", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "textureGrad", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "textureGrad", TYPE_VEC4, { TYPE_SAMPLER2DARRAY, TYPE_VEC3, TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "textureGrad", TYPE_IVEC4, { TYPE_ISAMPLER2DARRAY, TYPE_VEC3, TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "textureGrad", TYPE_UVEC4, { TYPE_USAMPLER2DARRAY, TYPE_VEC3, TYPE_VEC2, TYPE_VEC2, TYPE_VOID } }, - { "textureGrad", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "textureGrad", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "textureGrad", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, - { "textureGrad", TYPE_VEC4, { TYPE_SAMPLERCUBE, TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID } }, + { "textureSize", TYPE_IVEC2, { TYPE_SAMPLER2D, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "textureSize", TYPE_IVEC2, { TYPE_ISAMPLER2D, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "textureSize", TYPE_IVEC2, { TYPE_USAMPLER2D, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "textureSize", TYPE_IVEC3, { TYPE_SAMPLER2DARRAY, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "textureSize", TYPE_IVEC3, { TYPE_ISAMPLER2DARRAY, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "textureSize", TYPE_IVEC3, { TYPE_USAMPLER2DARRAY, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "textureSize", TYPE_IVEC3, { TYPE_SAMPLER3D, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "textureSize", TYPE_IVEC3, { TYPE_ISAMPLER3D, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "textureSize", TYPE_IVEC3, { TYPE_USAMPLER3D, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "textureSize", TYPE_IVEC2, { TYPE_SAMPLERCUBE, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + + { "texture", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "texture", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + + { "texture", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "texture", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + + { "texture", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "texture", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + + { "texture", TYPE_VEC4, { TYPE_SAMPLER2DARRAY, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "texture", TYPE_VEC4, { TYPE_SAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + + { "texture", TYPE_UVEC4, { TYPE_USAMPLER2DARRAY, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "texture", TYPE_UVEC4, { TYPE_USAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + + { "texture", TYPE_IVEC4, { TYPE_ISAMPLER2DARRAY, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "texture", TYPE_IVEC4, { TYPE_ISAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + + { "texture", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "texture", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + + { "texture", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "texture", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + + { "texture", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "texture", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + + { "texture", TYPE_VEC4, { TYPE_SAMPLERCUBE, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "texture", TYPE_VEC4, { TYPE_SAMPLERCUBE, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + + { "textureProj", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "textureProj", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "textureProj", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "textureProj", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + + { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + + { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + + { "textureProj", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "textureProj", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + + { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + + { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + { "textureProj", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + + { "textureLod", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "textureLod", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "textureLod", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "textureLod", TYPE_VEC4, { TYPE_SAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "textureLod", TYPE_IVEC4, { TYPE_ISAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "textureLod", TYPE_UVEC4, { TYPE_USAMPLER2DARRAY, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "textureLod", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "textureLod", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "textureLod", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "textureLod", TYPE_VEC4, { TYPE_SAMPLERCUBE, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + + { "texelFetch", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_IVEC2, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "texelFetch", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_IVEC2, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "texelFetch", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_IVEC2, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + + { "texelFetch", TYPE_VEC4, { TYPE_SAMPLER2DARRAY, TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "texelFetch", TYPE_IVEC4, { TYPE_ISAMPLER2DARRAY, TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "texelFetch", TYPE_UVEC4, { TYPE_USAMPLER2DARRAY, TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + + { "texelFetch", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "texelFetch", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + { "texelFetch", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_IVEC3, TYPE_INT, TYPE_VOID }, TAG_GLOBAL }, + + { "textureProjLod", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "textureProjLod", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + + { "textureProjLod", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "textureProjLod", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + + { "textureProjLod", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "textureProjLod", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + + { "textureProjLod", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "textureProjLod", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "textureProjLod", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + + { "textureGrad", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "textureGrad", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "textureGrad", TYPE_UVEC4, { TYPE_USAMPLER2D, TYPE_VEC2, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "textureGrad", TYPE_VEC4, { TYPE_SAMPLER2DARRAY, TYPE_VEC3, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "textureGrad", TYPE_IVEC4, { TYPE_ISAMPLER2DARRAY, TYPE_VEC3, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "textureGrad", TYPE_UVEC4, { TYPE_USAMPLER2DARRAY, TYPE_VEC3, TYPE_VEC2, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "textureGrad", TYPE_VEC4, { TYPE_SAMPLER3D, TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "textureGrad", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "textureGrad", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "textureGrad", TYPE_VEC4, { TYPE_SAMPLERCUBE, TYPE_VEC3, TYPE_VEC3, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + + { "dFdx", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "dFdx", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "dFdx", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "dFdx", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "dFdx", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "dFdx", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "dFdx", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "dFdx", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, + { "dFdy", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "dFdy", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "dFdy", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "dFdy", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, - { "dFdy", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "dFdy", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "dFdy", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "dFdy", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, - - { "fwidth", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID } }, - { "fwidth", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID } }, - { "fwidth", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID } }, - { "fwidth", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID } }, + { "fwidth", TYPE_FLOAT, { TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL }, + { "fwidth", TYPE_VEC2, { TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL }, + { "fwidth", TYPE_VEC3, { TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL }, + { "fwidth", TYPE_VEC4, { TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL }, + + //sub-functions - { NULL, TYPE_VOID, { TYPE_VOID } } + //array + { "length", TYPE_INT, { TYPE_VOID }, TAG_ARRAY }, + + { NULL, TYPE_VOID, { TYPE_VOID }, TAG_GLOBAL } }; @@ -2076,6 +2099,11 @@ bool ShaderLanguage::_validate_function_call(BlockNode *p_block, OperatorNode *p while (builtin_func_defs[idx].name) { + if (completion_class != builtin_func_defs[idx].tag) { + idx++; + continue; + } + if (name == builtin_func_defs[idx].name) { failed_builtin = true; @@ -2716,6 +2744,8 @@ bool ShaderLanguage::_validate_assign(Node *p_node, const Map<StringName, BuiltI if (!(p_builtin_types.has(var->name) && p_builtin_types[var->name].constant)) { return true; } + } else if (p_node->type == Node::TYPE_ARRAY) { + return true; } if (r_message) @@ -2726,6 +2756,7 @@ bool ShaderLanguage::_validate_assign(Node *p_node, const Map<StringName, BuiltI ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, const Map<StringName, BuiltInInfo> &p_builtin_types) { Vector<Expression> expression; + //Vector<TokenType> operators; while (true) { @@ -2834,7 +2865,6 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons _set_error("No matching constructor found for: '" + String(funcname->name) + "'"); return NULL; } - //validate_Function_call() expr = _reduce_expression(p_block, func); @@ -2890,6 +2920,7 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons _set_error("No matching function found for: '" + String(funcname->name) + "'"); return NULL; } + completion_class = TAG_GLOBAL; // reset sub-class expr = func; @@ -2900,8 +2931,9 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons DataType data_type; IdentifierType ident_type; + int array_size = 0; - if (!_find_identifier(p_block, p_builtin_types, identifier, &data_type, &ident_type)) { + if (!_find_identifier(p_block, p_builtin_types, identifier, &data_type, &ident_type, &array_size)) { _set_error("Unknown identifier in expression: " + String(identifier)); return NULL; } @@ -2911,10 +2943,68 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons return NULL; } - VariableNode *varname = alloc_node<VariableNode>(); - varname->name = identifier; - varname->datatype_cache = data_type; - expr = varname; + Node *index_expression = NULL; + Node *call_expression = NULL; + + if (array_size > 0) { + tk = _get_token(); + + if (tk.type != TK_BRACKET_OPEN && tk.type != TK_PERIOD) { + _set_error("Expected '[' or '.'"); + return NULL; + } + + if (tk.type == TK_PERIOD) { + completion_class = TAG_ARRAY; + call_expression = _parse_and_reduce_expression(p_block, p_builtin_types); + if (!call_expression) + return NULL; + data_type = call_expression->get_datatype(); + } else { // indexing + + index_expression = _parse_and_reduce_expression(p_block, p_builtin_types); + if (!index_expression) + return NULL; + + if (index_expression->get_datatype() != TYPE_INT && index_expression->get_datatype() != TYPE_UINT) { + _set_error("Only integer expressions are allowed for indexing"); + return NULL; + } + + if (index_expression->type == Node::TYPE_CONSTANT) { + ConstantNode *cnode = (ConstantNode *)index_expression; + if (cnode) { + if (!cnode->values.empty()) { + int value = cnode->values[0].sint; + if (value < 0 || value >= array_size) { + _set_error(vformat("Index [%s] out of range [%s..%s]", value, 0, array_size - 1)); + return NULL; + } + } + } + } + + tk = _get_token(); + if (tk.type != TK_BRACKET_CLOSE) { + _set_error("Expected ']'"); + return NULL; + } + } + + ArrayNode *arrname = alloc_node<ArrayNode>(); + arrname->name = identifier; + arrname->datatype_cache = data_type; + arrname->index_expression = index_expression; + arrname->call_expression = call_expression; + expr = arrname; + + } else { + + VariableNode *varname = alloc_node<VariableNode>(); + varname->name = identifier; + varname->datatype_cache = data_type; + expr = varname; + } } } else if (tk.type == TK_OP_ADD) { @@ -2965,7 +3055,6 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons _set_error("Expected identifier as member"); return NULL; } - DataType dt = expr->get_datatype(); String ident = identifier; @@ -3701,11 +3790,7 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui tk = _get_token(); - VariableDeclarationNode *vardecl = alloc_node<VariableDeclarationNode>(); - vardecl->datatype = type; - vardecl->precision = precision; - - p_block->statements.push_back(vardecl); + Node *vardecl = NULL; while (true) { @@ -3724,15 +3809,207 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui var.type = type; var.precision = precision; var.line = tk_line; + var.array_size = 0; - VariableDeclarationNode::Declaration decl; + tk = _get_token(); - decl.name = name; - decl.initializer = NULL; + if (tk.type == TK_BRACKET_OPEN) { + bool unknown_size = false; - tk = _get_token(); + ArrayDeclarationNode *node = alloc_node<ArrayDeclarationNode>(); + node->datatype = type; + node->precision = precision; + vardecl = (Node *)node; + + ArrayDeclarationNode::Declaration decl; + decl.name = name; + decl.size = 0U; + + tk = _get_token(); + + if (tk.type == TK_BRACKET_CLOSE) { + unknown_size = true; + } else { + + if (tk.type != TK_INT_CONSTANT || ((int)tk.constant) <= 0) { + _set_error("Expected integer constant > 0 or ']'"); + return ERR_PARSE_ERROR; + } + + tk = _get_token(); + + if (tk.type != TK_BRACKET_CLOSE) { + _set_error("Expected ']'"); + return ERR_PARSE_ERROR; + } + + decl.size = ((uint32_t)tk.constant); + var.array_size = decl.size; + } + + bool full_def = false; + + tk = _get_token(); + if (tk.type == TK_OP_ASSIGN) { + tk = _get_token(); + + if (tk.type != TK_CURLY_BRACKET_OPEN) { + + if (unknown_size) { + _set_error("Expected '{'"); + return ERR_PARSE_ERROR; + } + + full_def = true; + + DataPrecision precision2 = PRECISION_DEFAULT; + if (is_token_precision(tk.type)) { + precision2 = get_token_precision(tk.type); + tk = _get_token(); + if (!is_token_nonvoid_datatype(tk.type)) { + _set_error("Expected datatype after precision"); + return ERR_PARSE_ERROR; + } + } + if (!is_token_variable_datatype(tk.type)) { + _set_error("Invalid data type for array"); + return ERR_PARSE_ERROR; + } + DataType type2 = get_token_datatype(tk.type); + + int array_size2 = 0; + + tk = _get_token(); + if (tk.type == TK_BRACKET_OPEN) { + Node *n = _parse_and_reduce_expression(p_block, p_builtin_types); + if (!n || n->type != Node::TYPE_CONSTANT || n->get_datatype() != TYPE_INT) { + _set_error("Expected single integer constant > 0"); + return ERR_PARSE_ERROR; + } + + ConstantNode *cnode = (ConstantNode *)n; + if (cnode->values.size() == 1) { + array_size2 = cnode->values[0].sint; + if (array_size2 <= 0) { + _set_error("Expected single integer constant > 0"); + return ERR_PARSE_ERROR; + } + } else { + _set_error("Expected single integer constant > 0"); + return ERR_PARSE_ERROR; + } + + tk = _get_token(); + if (tk.type != TK_BRACKET_CLOSE) { + _set_error("Expected ']"); + return ERR_PARSE_ERROR; + } else { + tk = _get_token(); + } + } else { + _set_error("Expected '["); + return ERR_PARSE_ERROR; + } + + if (precision != precision2 || type != type2 || var.array_size != array_size2) { + String error_str = "Cannot convert from '"; + if (precision2 != PRECISION_DEFAULT) { + error_str += get_precision_name(precision2); + error_str += " "; + } + error_str += get_datatype_name(type2); + error_str += "["; + error_str += itos(array_size2); + error_str += "]'"; + error_str += " to '"; + if (precision != PRECISION_DEFAULT) { + error_str += get_precision_name(precision); + error_str += " "; + } + error_str += get_datatype_name(type); + error_str += "["; + error_str += itos(var.array_size); + error_str += "]'"; + _set_error(error_str); + return ERR_PARSE_ERROR; + } + } + + bool curly = tk.type == TK_CURLY_BRACKET_OPEN; + + if (unknown_size) { + if (!curly) { + _set_error("Expected '{'"); + return ERR_PARSE_ERROR; + } + } else { + if (full_def) { + if (curly) { + _set_error("Expected '('"); + return ERR_PARSE_ERROR; + } + } + } + + if (tk.type == TK_PARENTHESIS_OPEN || curly) { // initialization + while (true) { + + Node *n = _parse_and_reduce_expression(p_block, p_builtin_types); + if (!n) { + return ERR_PARSE_ERROR; + } + + if (var.type != n->get_datatype()) { + _set_error("Invalid assignment of '" + get_datatype_name(n->get_datatype()) + "' to '" + get_datatype_name(var.type) + "'"); + return ERR_PARSE_ERROR; + } + + tk = _get_token(); + if (tk.type == TK_COMMA) { + decl.initializer.push_back(n); + continue; + } else if (!curly && tk.type == TK_PARENTHESIS_CLOSE) { + decl.initializer.push_back(n); + break; + } else if (curly && tk.type == TK_CURLY_BRACKET_CLOSE) { + decl.initializer.push_back(n); + break; + } else { + if (curly) + _set_error("Expected '}' or ','"); + else + _set_error("Expected ')' or ','"); + return ERR_PARSE_ERROR; + } + } + if (unknown_size) { + decl.size = decl.initializer.size(); + var.array_size = decl.initializer.size(); + } else if (decl.initializer.size() != var.array_size) { + _set_error("Array size mismatch"); + return ERR_PARSE_ERROR; + } + tk = _get_token(); + } + } else { + if (unknown_size) { + _set_error("Expected array initialization"); + return ERR_PARSE_ERROR; + } + } + + node->declarations.push_back(decl); + } else if (tk.type == TK_OP_ASSIGN) { + + VariableDeclarationNode *node = alloc_node<VariableDeclarationNode>(); + node->datatype = type; + node->precision = precision; + vardecl = (Node *)node; + + VariableDeclarationNode::Declaration decl; + decl.name = name; + decl.initializer = NULL; - if (tk.type == TK_OP_ASSIGN) { //variable created with assignment! must parse an expression Node *n = _parse_and_reduce_expression(p_block, p_builtin_types); if (!n) @@ -3745,11 +4022,22 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui return ERR_PARSE_ERROR; } tk = _get_token(); + node->declarations.push_back(decl); + } else { + VariableDeclarationNode *node = alloc_node<VariableDeclarationNode>(); + node->datatype = type; + node->precision = precision; + vardecl = (Node *)node; + + VariableDeclarationNode::Declaration decl; + decl.name = name; + decl.initializer = NULL; + node->declarations.push_back(decl); } - p_block->variables[name] = var; + p_block->statements.push_back(vardecl); - vardecl->declarations.push_back(decl); + p_block->variables[name] = var; if (tk.type == TK_COMMA) { tk = _get_token(); @@ -4365,6 +4653,14 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct type = get_token_datatype(tk.type); + TkPos prev_pos = _get_tkpos(); + tk = _get_token(); + if (tk.type == TK_BRACKET_OPEN) { + _set_error("Cannot use arrays as return types"); + return ERR_PARSE_ERROR; + } + _set_tkpos(prev_pos); + _get_completable_identifier(NULL, COMPLETION_MAIN_FUNCTION, name); if (name == StringName()) { @@ -4518,6 +4814,10 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct tk = _get_token(); + if (tk.type == TK_BRACKET_OPEN) { + _set_error("Arrays as parameters are not implemented yet"); + return ERR_PARSE_ERROR; + } if (tk.type != TK_IDENTIFIER) { _set_error("Expected identifier for argument name"); return ERR_PARSE_ERROR; @@ -4538,6 +4838,10 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct func_node->arguments.push_back(arg); tk = _get_token(); + if (tk.type == TK_BRACKET_OPEN) { + _set_error("Arrays as parameters are not implemented yet"); + return ERR_PARSE_ERROR; + } if (tk.type == TK_COMMA) { tk = _get_token(); @@ -4724,60 +5028,71 @@ Error ShaderLanguage::complete(const String &p_code, const Map<StringName, Funct StringName skip_function; BlockNode *block = completion_block; - while (block) { - - if (comp_ident) { - for (const Map<StringName, BlockNode::Variable>::Element *E = block->variables.front(); E; E = E->next()) { + if (completion_class == TAG_GLOBAL) { + while (block) { + if (comp_ident) { + for (const Map<StringName, BlockNode::Variable>::Element *E = block->variables.front(); E; E = E->next()) { - if (E->get().line < completion_line) { - matches.insert(E->key(), ScriptCodeCompletionOption::KIND_VARIABLE); + if (E->get().line < completion_line) { + matches.insert(E->key(), ScriptCodeCompletionOption::KIND_VARIABLE); + } } } - } - if (block->parent_function) { - if (comp_ident) { - for (int i = 0; i < block->parent_function->arguments.size(); i++) { - matches.insert(block->parent_function->arguments[i].name, ScriptCodeCompletionOption::KIND_FUNCTION); + if (block->parent_function) { + if (comp_ident) { + for (int i = 0; i < block->parent_function->arguments.size(); i++) { + matches.insert(block->parent_function->arguments[i].name, ScriptCodeCompletionOption::KIND_FUNCTION); + } } + skip_function = block->parent_function->name; } - skip_function = block->parent_function->name; + block = block->parent_block; } - block = block->parent_block; - } - if (comp_ident && skip_function != StringName() && p_functions.has(skip_function)) { + if (comp_ident && skip_function != StringName() && p_functions.has(skip_function)) { - for (Map<StringName, BuiltInInfo>::Element *E = p_functions[skip_function].built_ins.front(); E; E = E->next()) { - ScriptCodeCompletionOption::Kind kind = ScriptCodeCompletionOption::KIND_MEMBER; - if (E->get().constant) { - kind = ScriptCodeCompletionOption::KIND_CONSTANT; + for (Map<StringName, BuiltInInfo>::Element *E = p_functions[skip_function].built_ins.front(); E; E = E->next()) { + ScriptCodeCompletionOption::Kind kind = ScriptCodeCompletionOption::KIND_MEMBER; + if (E->get().constant) { + kind = ScriptCodeCompletionOption::KIND_CONSTANT; + } + matches.insert(E->key(), kind); } - matches.insert(E->key(), kind); } - } - if (comp_ident) { - for (const Map<StringName, ShaderNode::Varying>::Element *E = shader->varyings.front(); E; E = E->next()) { - matches.insert(E->key(), ScriptCodeCompletionOption::KIND_VARIABLE); + if (comp_ident) { + for (const Map<StringName, ShaderNode::Varying>::Element *E = shader->varyings.front(); E; E = E->next()) { + matches.insert(E->key(), ScriptCodeCompletionOption::KIND_VARIABLE); + } + for (const Map<StringName, ShaderNode::Uniform>::Element *E = shader->uniforms.front(); E; E = E->next()) { + matches.insert(E->key(), ScriptCodeCompletionOption::KIND_MEMBER); + } } - for (const Map<StringName, ShaderNode::Uniform>::Element *E = shader->uniforms.front(); E; E = E->next()) { - matches.insert(E->key(), ScriptCodeCompletionOption::KIND_MEMBER); + + for (int i = 0; i < shader->functions.size(); i++) { + if (!shader->functions[i].callable || shader->functions[i].name == skip_function) + continue; + matches.insert(String(shader->functions[i].name), ScriptCodeCompletionOption::KIND_FUNCTION); } - } - for (int i = 0; i < shader->functions.size(); i++) { - if (!shader->functions[i].callable || shader->functions[i].name == skip_function) - continue; - matches.insert(String(shader->functions[i].name), ScriptCodeCompletionOption::KIND_FUNCTION); - } + int idx = 0; - int idx = 0; + while (builtin_func_defs[idx].name) { - while (builtin_func_defs[idx].name) { + matches.insert(String(builtin_func_defs[idx].name), ScriptCodeCompletionOption::KIND_FUNCTION); + idx++; + } - matches.insert(String(builtin_func_defs[idx].name), ScriptCodeCompletionOption::KIND_FUNCTION); - idx++; + } else { // sub-class + int idx = 0; + + while (builtin_func_defs[idx].name) { + if (builtin_func_defs[idx].tag == completion_class) { + matches.insert(String(builtin_func_defs[idx].name), ScriptCodeCompletionOption::KIND_FUNCTION); + } + idx++; + } } for (Map<String, ScriptCodeCompletionOption::Kind>::Element *E = matches.front(); E; E = E->next()) { @@ -4789,7 +5104,6 @@ Error ShaderLanguage::complete(const String &p_code, const Map<StringName, Funct } return OK; - } break; case COMPLETION_CALL_ARGUMENTS: { @@ -4842,6 +5156,11 @@ Error ShaderLanguage::complete(const String &p_code, const Map<StringName, Funct if (completion_function == builtin_func_defs[idx].name) { + if (builtin_func_defs[idx].tag != completion_class) { + idx++; + continue; + } + if (calltip.length()) calltip += "\n"; @@ -4953,6 +5272,7 @@ ShaderLanguage::ShaderNode *ShaderLanguage::get_shader() { ShaderLanguage::ShaderLanguage() { nodes = NULL; + completion_class = TAG_GLOBAL; } ShaderLanguage::~ShaderLanguage() { diff --git a/servers/visual/shader_language.h b/servers/visual/shader_language.h index 65bf78bddd..8253bce468 100644 --- a/servers/visual/shader_language.h +++ b/servers/visual/shader_language.h @@ -288,7 +288,9 @@ public: TYPE_CONSTANT, TYPE_OPERATOR, TYPE_CONTROL_FLOW, - TYPE_MEMBER + TYPE_MEMBER, + TYPE_ARRAY, + TYPE_ARRAY_DECLARATION, }; Type type; @@ -352,6 +354,40 @@ public: datatype(TYPE_VOID) {} }; + struct ArrayNode : public Node { + DataType datatype_cache; + StringName name; + Node *index_expression; + Node *call_expression; + + virtual DataType get_datatype() const { return datatype_cache; } + + ArrayNode() : + Node(TYPE_ARRAY), + datatype_cache(TYPE_VOID), + index_expression(NULL), + call_expression(NULL) {} + }; + + struct ArrayDeclarationNode : public Node { + DataPrecision precision; + DataType datatype; + + struct Declaration { + StringName name; + uint32_t size; + Vector<Node *> initializer; + }; + + Vector<Declaration> declarations; + virtual DataType get_datatype() const { return datatype; } + + ArrayDeclarationNode() : + Node(TYPE_ARRAY_DECLARATION), + precision(PRECISION_DEFAULT), + datatype(TYPE_VOID) {} + }; + struct ConstantNode : public Node { DataType datatype; @@ -380,6 +416,7 @@ public: DataType type; DataPrecision precision; int line; //for completion + int array_size; }; Map<StringName, Variable> variables; @@ -552,6 +589,7 @@ public: static DataInterpolation get_token_interpolation(TokenType p_type); static bool is_token_precision(TokenType p_type); static DataPrecision get_token_precision(TokenType p_type); + static String get_precision_name(DataPrecision p_type); static String get_datatype_name(DataType p_type); static bool is_token_nonvoid_datatype(TokenType p_type); static bool is_token_operator(TokenType p_type); @@ -645,16 +683,22 @@ private: IDENTIFIER_CONSTANT, }; - bool _find_identifier(const BlockNode *p_block, const Map<StringName, BuiltInInfo> &p_builtin_types, const StringName &p_identifier, DataType *r_data_type = NULL, IdentifierType *r_type = NULL); + bool _find_identifier(const BlockNode *p_block, const Map<StringName, BuiltInInfo> &p_builtin_types, const StringName &p_identifier, DataType *r_data_type = NULL, IdentifierType *r_type = NULL, int *r_array_size = NULL); bool _is_operator_assign(Operator p_op) const; bool _validate_assign(Node *p_node, const Map<StringName, BuiltInInfo> &p_builtin_types, String *r_message = NULL); bool _validate_operator(OperatorNode *p_op, DataType *r_ret_type = NULL); + enum SubClassTag { + TAG_GLOBAL, + TAG_ARRAY + }; + struct BuiltinFuncDef { enum { MAX_ARGS = 5 }; const char *name; DataType rettype; const DataType args[MAX_ARGS]; + SubClassTag tag; }; struct BuiltinFuncOutArgs { //arguments used as out in built in functions @@ -666,6 +710,7 @@ private: int completion_line; BlockNode *completion_block; DataType completion_base; + SubClassTag completion_class; StringName completion_function; int completion_argument; diff --git a/thirdparty/README.md b/thirdparty/README.md index cb29eadeca..c6817e2389 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -511,7 +511,7 @@ folder. ## xatlas - Upstream: https://github.com/jpcy/xatlas -- Version: git (b7d7bb, 2019) +- Version: git (f65a664, 2019) - License: MIT Files extracted from upstream source: diff --git a/thirdparty/xatlas/xatlas.cpp b/thirdparty/xatlas/xatlas.cpp index c62be4e73a..1b30305cd4 100644 --- a/thirdparty/xatlas/xatlas.cpp +++ b/thirdparty/xatlas/xatlas.cpp @@ -299,29 +299,30 @@ static void *Realloc(void *ptr, size_t size, int /*tag*/, const char * /*file*/, #if XA_PROFILE #define XA_PROFILE_START(var) const clock_t var##Start = clock(); #define XA_PROFILE_END(var) internal::s_profile.var += clock() - var##Start; -#define XA_PROFILE_PRINT(label, var) XA_PRINT("%s%.2f seconds (%g ms)\n", label, internal::clockToSeconds(internal::s_profile.var), internal::clockToMs(internal::s_profile.var)); +#define XA_PROFILE_PRINT_AND_RESET(label, var) XA_PRINT("%s%.2f seconds (%g ms)\n", label, internal::clockToSeconds(internal::s_profile.var), internal::clockToMs(internal::s_profile.var)); internal::s_profile.var = 0; struct ProfileData { - clock_t addMeshConcurrent; - std::atomic<clock_t> addMesh; + clock_t addMeshReal; + std::atomic<clock_t> addMeshThread; std::atomic<clock_t> addMeshCreateColocals; std::atomic<clock_t> addMeshCreateFaceGroups; std::atomic<clock_t> addMeshCreateBoundaries; - std::atomic<clock_t> addMeshCreateChartGroupsConcurrent; - std::atomic<clock_t> addMeshCreateChartGroups; - clock_t computeChartsConcurrent; - std::atomic<clock_t> computeCharts; + std::atomic<clock_t> addMeshCreateChartGroupsReal; + std::atomic<clock_t> addMeshCreateChartGroupsThread; + clock_t computeChartsReal; + std::atomic<clock_t> computeChartsThread; std::atomic<clock_t> atlasBuilder; std::atomic<clock_t> atlasBuilderInit; std::atomic<clock_t> atlasBuilderCreateInitialCharts; std::atomic<clock_t> atlasBuilderGrowCharts; std::atomic<clock_t> atlasBuilderMergeCharts; - std::atomic<clock_t> createChartMeshes; + std::atomic<clock_t> createChartMeshesReal; + std::atomic<clock_t> createChartMeshesThread; std::atomic<clock_t> fixChartMeshTJunctions; std::atomic<clock_t> closeChartMeshHoles; - clock_t parameterizeChartsConcurrent; - std::atomic<clock_t> parameterizeCharts; + clock_t parameterizeChartsReal; + std::atomic<clock_t> parameterizeChartsThread; std::atomic<clock_t> parameterizeChartsOrthogonal; std::atomic<clock_t> parameterizeChartsLSCM; std::atomic<clock_t> parameterizeChartsEvaluateQuality; @@ -329,6 +330,7 @@ struct ProfileData clock_t packChartsRasterize; clock_t packChartsDilate; clock_t packChartsFindLocation; + std::atomic<clock_t> packChartsFindLocationThread; clock_t packChartsBlit; }; @@ -346,7 +348,7 @@ static double clockToSeconds(clock_t c) #else #define XA_PROFILE_START(var) #define XA_PROFILE_END(var) -#define XA_PROFILE_PRINT(label, var) +#define XA_PROFILE_PRINT_AND_RESET(label, var) #endif static constexpr float kPi = 3.14159265358979323846f; @@ -641,6 +643,7 @@ static bool linesIntersect(const Vector2 &a1, const Vector2 &a2, const Vector2 & struct Vector2i { + Vector2i() {} Vector2i(int32_t x, int32_t y) : x(x), y(y) {} int32_t x, y; @@ -3528,6 +3531,15 @@ private: std::mutex m_mutex; }; +struct Spinlock +{ + void lock() { while(m_lock.test_and_set(std::memory_order_acquire)) {} } + void unlock() { m_lock.clear(std::memory_order_release); } + +private: + std::atomic_flag m_lock = ATOMIC_FLAG_INIT; +}; + struct TaskGroupHandle { uint32_t value = UINT32_MAX; @@ -3545,6 +3557,14 @@ class TaskScheduler public: TaskScheduler() : m_shutdown(false) { + // Max with current task scheduler usage is 1 per thread + 1 deep nesting, but allow for some slop. + m_maxGroups = std::thread::hardware_concurrency() * 4; + m_groups = XA_ALLOC_ARRAY(MemTag::Default, TaskGroup, m_maxGroups); + for (uint32_t i = 0; i < m_maxGroups; i++) { + new (&m_groups[i]) TaskGroup(); + m_groups[i].free = true; + m_groups[i].ref = 0; + } m_workers.resize(std::thread::hardware_concurrency() <= 1 ? 1 : std::thread::hardware_concurrency() - 1); for (uint32_t i = 0; i < m_workers.size(); i++) { m_workers[i].wakeup = false; @@ -3565,36 +3585,42 @@ public: worker.thread->~thread(); XA_FREE(worker.thread); } - for (uint32_t i = 0; i < m_groups.size(); i++) - destroyGroup(i); + for (uint32_t i = 0; i < m_maxGroups; i++) + m_groups[i].~TaskGroup(); + XA_FREE(m_groups); } - void run(TaskGroupHandle *handle, Task task) + TaskGroupHandle createTaskGroup(uint32_t reserveSize = 0) { - // Allocate a task group if this is the first time using this handle. - TaskGroup *group; - if (handle->value == UINT32_MAX) { - group = XA_NEW(MemTag::Default, TaskGroup); - group->ref = 0; - std::lock_guard<std::mutex> lock(m_groupsMutex); - for (uint32_t i = 0; i < m_groups.size(); i++) { - if (!m_groups[i]) { - m_groups[i] = group; - handle->value = i; - break; - } - } - if (handle->value == UINT32_MAX) { - m_groups.push_back(group); - handle->value = m_groups.size() - 1; - } - } - group = m_groups[handle->value]; - { - std::lock_guard<std::mutex> lock(group->queueMutex); - group->queue.push_back(task); - } - group->ref++; + // Claim the first free group. + for (uint32_t i = 0; i < m_maxGroups; i++) { + TaskGroup &group = m_groups[i]; + bool expected = true; + if (!group.free.compare_exchange_strong(expected, false)) + continue; + group.queueLock.lock(); + group.queueHead = 0; + group.queue.clear(); + group.queue.reserve(reserveSize); + group.queueLock.unlock(); + TaskGroupHandle handle; + handle.value = i; + return handle; + } + XA_DEBUG_ASSERT(false); + TaskGroupHandle handle; + handle.value = UINT32_MAX; + return handle; + } + + void run(TaskGroupHandle handle, Task task) + { + XA_DEBUG_ASSERT(handle.value != UINT32_MAX); + TaskGroup &group = m_groups[handle.value]; + group.queueLock.lock(); + group.queue.push_back(task); + group.queueLock.unlock(); + group.ref++; // Wake up a worker to run this task. for (uint32_t i = 0; i < m_workers.size(); i++) { m_workers[i].wakeup = true; @@ -3609,33 +3635,32 @@ public: return; } // Run tasks from the group queue until empty. - TaskGroup *group = m_groups[handle->value]; + TaskGroup &group = m_groups[handle->value]; for (;;) { Task *task = nullptr; - { - std::lock_guard<std::mutex> lock(group->queueMutex); - if (group->queueHead < group->queue.size()) - task = &group->queue[group->queueHead++]; - } + group.queueLock.lock(); + if (group.queueHead < group.queue.size()) + task = &group.queue[group.queueHead++]; + group.queueLock.unlock(); if (!task) break; task->func(task->userData); - group->ref--; + group.ref--; } // Even though the task queue is empty, workers can still be running tasks. - while (group->ref > 0) + while (group.ref > 0) std::this_thread::yield(); - std::lock_guard<std::mutex> lock(m_groupsMutex); - destroyGroup(handle->value); + group.free = true; handle->value = UINT32_MAX; } private: struct TaskGroup { + std::atomic<bool> free; Array<Task> queue; // Items are never removed. queueHead is incremented to pop items. uint32_t queueHead = 0; - std::mutex queueMutex; + Spinlock queueLock; std::atomic<uint32_t> ref; // Increment when a task is enqueued, decrement when a task finishes. }; @@ -3647,21 +3672,11 @@ private: std::atomic<bool> wakeup; }; - Array<TaskGroup *> m_groups; - std::mutex m_groupsMutex; + TaskGroup *m_groups; + uint32_t m_maxGroups; Array<Worker> m_workers; std::atomic<bool> m_shutdown; - void destroyGroup(uint32_t index) - { - TaskGroup *group = m_groups[index]; - m_groups[index] = nullptr; - if (group) { - group->~TaskGroup(); - XA_FREE(group); - } - } - static void workerThread(TaskScheduler *scheduler, Worker *worker) { std::unique_lock<std::mutex> lock(worker->mutex); @@ -3674,18 +3689,17 @@ private: // Look for a task in any of the groups and run it. TaskGroup *group = nullptr; Task *task = nullptr; - { - std::lock_guard<std::mutex> groupsLock(scheduler->m_groupsMutex); - for (uint32_t i = 0; i < scheduler->m_groups.size(); i++) { - group = scheduler->m_groups[i]; - if (!group) - continue; - std::lock_guard<std::mutex> queueLock(group->queueMutex); - if (group->queueHead < group->queue.size()) { - task = &group->queue[group->queueHead++]; - break; - } + for (uint32_t i = 0; i < scheduler->m_maxGroups; i++) { + group = &scheduler->m_groups[i]; + if (group->free || group->ref == 0) + continue; + group->queueLock.lock(); + if (group->queueHead < group->queue.size()) { + task = &group->queue[group->queueHead++]; + group->queueLock.unlock(); + break; } + group->queueLock.unlock(); } if (!task) break; @@ -3705,23 +3719,19 @@ public: destroyGroup({ i }); } - void run(TaskGroupHandle *handle, Task task) + TaskGroupHandle createTaskGroup(uint32_t reserveSize = 0) { - if (handle->value == UINT32_MAX) { - TaskGroup *group = XA_NEW(MemTag::Default, TaskGroup); - for (uint32_t i = 0; i < m_groups.size(); i++) { - if (!m_groups[i]) { - m_groups[i] = group; - handle->value = i; - break; - } - } - if (handle->value == UINT32_MAX) { - m_groups.push_back(group); - handle->value = m_groups.size() - 1; - } - } - m_groups[handle->value]->queue.push_back(task); + TaskGroup *group = XA_NEW(MemTag::Default, TaskGroup); + group->queue.reserve(reserveSize); + m_groups.push_back(group); + TaskGroupHandle handle; + handle.value = m_groups.size() - 1; + return handle; + } + + void run(TaskGroupHandle handle, Task task) + { + m_groups[handle.value]->queue.push_back(task); } void wait(TaskGroupHandle *handle) @@ -5967,6 +5977,58 @@ private: #endif }; +struct CreateChartTaskArgs +{ + const Mesh *mesh; + const Array<uint32_t> *faceArray; + const Basis *basis; + uint32_t meshId; + uint32_t chartGroupId; + uint32_t chartId; + Chart **chart; +}; + +static void runCreateChartTask(void *userData) +{ + XA_PROFILE_START(createChartMeshesThread) + auto args = (CreateChartTaskArgs *)userData; + *(args->chart) = XA_NEW(MemTag::Default, Chart, args->mesh, *(args->faceArray), *(args->basis), args->meshId, args->chartGroupId, args->chartId); + XA_PROFILE_END(createChartMeshesThread) +} + +struct ParameterizeChartTaskArgs +{ + Chart *chart; + ParameterizeFunc func; +}; + +static void runParameterizeChartTask(void *userData) +{ + auto args = (ParameterizeChartTaskArgs *)userData; + Mesh *mesh = args->chart->unifiedMesh(); + XA_PROFILE_START(parameterizeChartsOrthogonal) +#if 1 + computeOrthogonalProjectionMap(mesh); +#else + for (uint32_t i = 0; i < vertexCount; i++) + mesh->texcoord(i) = Vector2(dot(args->chart->basis().tangent, mesh->position(i)), dot(args->chart->basis().bitangent, mesh->position(i))); +#endif + XA_PROFILE_END(parameterizeChartsOrthogonal) + args->chart->evaluateOrthoParameterizationQuality(); + if (!args->chart->isOrtho() && !args->chart->isPlanar()) { + XA_PROFILE_START(parameterizeChartsLSCM) + if (args->func) + args->func(&mesh->position(0).x, &mesh->texcoord(0).x, mesh->vertexCount(), mesh->indices(), mesh->indexCount()); + else if (args->chart->isDisk()) + computeLeastSquaresConformalMap(mesh); + XA_PROFILE_END(parameterizeChartsLSCM) + args->chart->evaluateParameterizationQuality(); + } + // @@ Check that parameterization quality is above a certain threshold. + // Transfer parameterization from unified mesh to chart mesh. + args->chart->transferParameterization(); +} + // Set of charts corresponding to mesh faces in the same face group. class ChartGroup { @@ -6107,7 +6169,7 @@ public: - emphasize roundness metrics to prevent those cases. - If interior self-overlaps: preserve boundary parameterization and use mean-value map. */ - void computeCharts(const ChartOptions &options) + void computeCharts(TaskScheduler *taskScheduler, const ChartOptions &options) { m_chartOptions = options; // This function may be called multiple times, so destroy existing charts. @@ -6128,13 +6190,30 @@ public: AtlasBuilder builder(m_mesh, nullptr, options); runAtlasBuilder(builder, options); XA_PROFILE_END(atlasBuilder) - XA_PROFILE_START(createChartMeshes) const uint32_t chartCount = builder.chartCount(); + m_chartArray.resize(chartCount); + Array<CreateChartTaskArgs> taskArgs; + taskArgs.resize(chartCount); + for (uint32_t i = 0; i < chartCount; i++) { + CreateChartTaskArgs &args = taskArgs[i]; + args.mesh = m_mesh; + args.faceArray = &builder.chartFaces(i); + args.basis = &builder.chartBasis(i); + args.meshId = m_sourceId; + args.chartGroupId = m_id; + args.chartId = i; + args.chart = &m_chartArray[i]; + } + XA_PROFILE_START(createChartMeshesReal) + TaskGroupHandle taskGroup = taskScheduler->createTaskGroup(chartCount); for (uint32_t i = 0; i < chartCount; i++) { - Chart *chart = XA_NEW(MemTag::Default, Chart, m_mesh, builder.chartFaces(i), builder.chartBasis(i), m_sourceId, m_id, i); - m_chartArray.push_back(chart); + Task task; + task.userData = &taskArgs[i]; + task.func = runCreateChartTask; + taskScheduler->run(taskGroup, task); } - XA_PROFILE_END(createChartMeshes) + taskScheduler->wait(&taskGroup); + XA_PROFILE_END(createChartMeshesReal) #endif #if XA_DEBUG_EXPORT_OBJ_CHARTS char filename[256]; @@ -6157,18 +6236,33 @@ public: #endif } - void parameterizeCharts(ParameterizeFunc func) + void parameterizeCharts(TaskScheduler *taskScheduler, ParameterizeFunc func) { + const uint32_t chartCount = m_chartArray.size(); + Array<ParameterizeChartTaskArgs> taskArgs; + taskArgs.resize(chartCount); + TaskGroupHandle taskGroup = taskScheduler->createTaskGroup(chartCount); + for (uint32_t i = 0; i < chartCount; i++) { + ParameterizeChartTaskArgs &args = taskArgs[i]; + args.chart = m_chartArray[i]; + args.func = func; + Task task; + task.userData = &args; + task.func = runParameterizeChartTask; + taskScheduler->run(taskGroup, task); + } + taskScheduler->wait(&taskGroup); #if XA_RECOMPUTE_CHARTS + // Find charts with invalid parameterizations. Array<Chart *> invalidCharts; - const uint32_t chartCount = m_chartArray.size(); for (uint32_t i = 0; i < chartCount; i++) { Chart *chart = m_chartArray[i]; - parameterizeChart(chart, func); const ParameterizationQuality &quality = chart->paramQuality(); if (quality.boundaryIntersection || quality.flippedTriangleCount > 0) invalidCharts.push_back(chart); } + if (invalidCharts.isEmpty()) + return; // Recompute charts with invalid parameterizations. Array<uint32_t> meshFaces; for (uint32_t i = 0; i < invalidCharts.size(); i++) { @@ -6211,8 +6305,18 @@ public: #endif } // Parameterize the new charts. - for (uint32_t i = chartCount; i < m_chartArray.size(); i++) - parameterizeChart(m_chartArray[i], func); + taskGroup = taskScheduler->createTaskGroup(m_chartArray.size() - chartCount); + taskArgs.resize(m_chartArray.size() - chartCount); + for (uint32_t i = chartCount; i < m_chartArray.size(); i++) { + ParameterizeChartTaskArgs &args = taskArgs[i - chartCount]; + args.chart = m_chartArray[i]; + args.func = func; + Task task; + task.userData = &args; + task.func = runParameterizeChartTask; + taskScheduler->run(taskGroup, task); + } + taskScheduler->wait(&taskGroup); // Remove and delete the invalid charts. for (uint32_t i = 0; i < invalidCharts.size(); i++) { Chart *chart = invalidCharts[i]; @@ -6221,12 +6325,6 @@ public: XA_FREE(chart); m_paramDeletedChartsCount++; } -#else - const uint32_t chartCount = m_chartArray.size(); - for (uint32_t i = 0; i < chartCount; i++) { - Chart *chart = m_chartArray[i]; - parameterizeChart(chart, func); - } #endif } @@ -6269,32 +6367,6 @@ private: XA_DEBUG_ASSERT(builder.facesLeft() == 0); } - void parameterizeChart(Chart *chart, ParameterizeFunc func) - { - Mesh *mesh = chart->unifiedMesh(); - XA_PROFILE_START(parameterizeChartsOrthogonal) -#if 1 - computeOrthogonalProjectionMap(mesh); -#else - for (uint32_t i = 0; i < vertexCount; i++) - mesh->texcoord(i) = Vector2(dot(chart->basis().tangent, mesh->position(i)), dot(chart->basis().bitangent, mesh->position(i))); -#endif - XA_PROFILE_END(parameterizeChartsOrthogonal) - chart->evaluateOrthoParameterizationQuality(); - if (!chart->isOrtho() && !chart->isPlanar()) { - XA_PROFILE_START(parameterizeChartsLSCM) - if (func) - func(&mesh->position(0).x, &mesh->texcoord(0).x, mesh->vertexCount(), mesh->indices(), mesh->indexCount()); - else if (chart->isDisk()) - computeLeastSquaresConformalMap(mesh); - XA_PROFILE_END(parameterizeChartsLSCM) - chart->evaluateParameterizationQuality(); - } - // @@ Check that parameterization quality is above a certain threshold. - // Transfer parameterization from unified mesh to chart mesh. - chart->transferParameterization(); - } - void removeChart(const Chart *chart) { for (uint32_t i = 0; i < m_chartArray.size(); i++) { @@ -6326,14 +6398,15 @@ struct CreateChartGroupTaskArgs static void runCreateChartGroupTask(void *userData) { - XA_PROFILE_START(addMeshCreateChartGroups) + XA_PROFILE_START(addMeshCreateChartGroupsThread) auto args = (CreateChartGroupTaskArgs *)userData; *(args->chartGroup) = XA_NEW(MemTag::Default, ChartGroup, args->groupId, args->mesh, args->faceGroup); - XA_PROFILE_END(addMeshCreateChartGroups) + XA_PROFILE_END(addMeshCreateChartGroupsThread) } struct ComputeChartsTaskArgs { + TaskScheduler *taskScheduler; ChartGroup *chartGroup; const ChartOptions *options; Progress *progress; @@ -6341,18 +6414,19 @@ struct ComputeChartsTaskArgs static void runComputeChartsJob(void *userData) { - ComputeChartsTaskArgs *args = (ComputeChartsTaskArgs *)userData; + auto args = (ComputeChartsTaskArgs *)userData; if (args->progress->cancel) return; - XA_PROFILE_START(computeCharts) - args->chartGroup->computeCharts(*args->options); - XA_PROFILE_END(computeCharts) + XA_PROFILE_START(computeChartsThread) + args->chartGroup->computeCharts(args->taskScheduler, *args->options); + XA_PROFILE_END(computeChartsThread) args->progress->value++; args->progress->update(); } struct ParameterizeChartsTaskArgs { + TaskScheduler *taskScheduler; ChartGroup *chartGroup; ParameterizeFunc func; Progress *progress; @@ -6360,12 +6434,12 @@ struct ParameterizeChartsTaskArgs static void runParameterizeChartsJob(void *userData) { - ParameterizeChartsTaskArgs *args = (ParameterizeChartsTaskArgs *)userData; + auto args = (ParameterizeChartsTaskArgs *)userData; if (args->progress->cancel) return; - XA_PROFILE_START(parameterizeCharts) - args->chartGroup->parameterizeCharts(args->func); - XA_PROFILE_END(parameterizeCharts) + XA_PROFILE_START(parameterizeChartsThread) + args->chartGroup->parameterizeCharts(args->taskScheduler, args->func); + XA_PROFILE_END(parameterizeChartsThread) args->progress->value++; args->progress->update(); } @@ -6460,12 +6534,12 @@ public: args.groupId = g; args.mesh = mesh; } - TaskGroupHandle taskGroup; + TaskGroupHandle taskGroup = taskScheduler->createTaskGroup(chartGroups.size()); for (uint32_t g = 0; g < chartGroups.size(); g++) { Task task; task.userData = &taskArgs[g]; task.func = runCreateChartGroupTask; - taskScheduler->run(&taskGroup, task); + taskScheduler->run(taskGroup, task); } taskScheduler->wait(&taskGroup); // Thread-safe append. @@ -6481,29 +6555,39 @@ public: { m_chartsComputed = false; m_chartsParameterized = false; - uint32_t taskCount = 0; + // Ignore vertex maps. + uint32_t chartGroupCount = 0; for (uint32_t i = 0; i < m_chartGroups.size(); i++) { if (!m_chartGroups[i]->isVertexMap()) - taskCount++; + chartGroupCount++; } - Progress progress(ProgressCategory::ComputeCharts, progressFunc, progressUserData, taskCount); + Progress progress(ProgressCategory::ComputeCharts, progressFunc, progressUserData, chartGroupCount); Array<ComputeChartsTaskArgs> taskArgs; - taskArgs.reserve(taskCount); + taskArgs.reserve(chartGroupCount); for (uint32_t i = 0; i < m_chartGroups.size(); i++) { if (!m_chartGroups[i]->isVertexMap()) { ComputeChartsTaskArgs args; + args.taskScheduler = taskScheduler; args.chartGroup = m_chartGroups[i]; args.options = &options; args.progress = &progress; taskArgs.push_back(args); } } - TaskGroupHandle taskGroup; - for (uint32_t i = 0; i < taskCount; i++) { + // Sort chart groups by mesh indexCount. + m_chartGroupsRadix = RadixSort(); + Array<float> chartGroupSortData; + chartGroupSortData.resize(chartGroupCount); + for (uint32_t i = 0; i < chartGroupCount; i++) + chartGroupSortData[i] = (float)taskArgs[i].chartGroup->mesh()->indexCount(); + m_chartGroupsRadix.sort(chartGroupSortData); + // Larger chart group meshes are added first to reduce the chance of thread starvation. + TaskGroupHandle taskGroup = taskScheduler->createTaskGroup(chartGroupCount); + for (uint32_t i = 0; i < chartGroupCount; i++) { Task task; - task.userData = &taskArgs[i]; + task.userData = &taskArgs[m_chartGroupsRadix.ranks()[chartGroupCount - i - 1]]; task.func = runComputeChartsJob; - taskScheduler->run(&taskGroup, task); + taskScheduler->run(taskGroup, task); } taskScheduler->wait(&taskGroup); if (progress.cancel) @@ -6515,29 +6599,32 @@ public: bool parameterizeCharts(TaskScheduler *taskScheduler, ParameterizeFunc func, ProgressFunc progressFunc, void *progressUserData) { m_chartsParameterized = false; - uint32_t taskCount = 0; + // Ignore vertex maps. + uint32_t chartGroupCount = 0; for (uint32_t i = 0; i < m_chartGroups.size(); i++) { if (!m_chartGroups[i]->isVertexMap()) - taskCount++; + chartGroupCount++; } - Progress progress(ProgressCategory::ParameterizeCharts, progressFunc, progressUserData, taskCount); + Progress progress(ProgressCategory::ParameterizeCharts, progressFunc, progressUserData, chartGroupCount); Array<ParameterizeChartsTaskArgs> taskArgs; - taskArgs.reserve(taskCount); + taskArgs.reserve(chartGroupCount); for (uint32_t i = 0; i < m_chartGroups.size(); i++) { if (!m_chartGroups[i]->isVertexMap()) { ParameterizeChartsTaskArgs args; + args.taskScheduler = taskScheduler; args.chartGroup = m_chartGroups[i]; args.func = func; args.progress = &progress; taskArgs.push_back(args); } } - TaskGroupHandle taskGroup; - for (uint32_t i = 0; i < taskCount; i++) { + // Larger chart group meshes are added first to reduce the chance of thread starvation. + TaskGroupHandle taskGroup = taskScheduler->createTaskGroup(chartGroupCount); + for (uint32_t i = 0; i < chartGroupCount; i++) { Task task; - task.userData = &taskArgs[i]; + task.userData = &taskArgs[m_chartGroupsRadix.ranks()[chartGroupCount - i - 1]]; task.func = runParameterizeChartsJob; - taskScheduler->run(&taskGroup, task); + taskScheduler->run(taskGroup, task); } taskScheduler->wait(&taskGroup); if (progress.cancel) @@ -6570,6 +6657,7 @@ private: bool m_chartsComputed; bool m_chartsParameterized; Array<ChartGroup *> m_chartGroups; + RadixSort m_chartGroupsRadix; // By mesh indexCount. Array<uint32_t> m_chartGroupSourceMeshes; Array<Array<Vector2> > m_originalChartTexcoords; }; @@ -6734,6 +6822,71 @@ struct Chart uint32_t uniqueVertexCount() const { return uniqueVertices.isEmpty() ? vertexCount : uniqueVertices.size(); } }; +struct FindChartLocationBruteForceTaskArgs +{ + std::atomic<bool> *finished; // One of the tasks found a location that doesn't expand the atlas. + Vector2i startPosition; + const BitImage *atlasBitImage; + const BitImage *chartBitImage; + const BitImage *chartBitImageRotated; + int w, h; + bool blockAligned, resizableAtlas, allowRotate; + // out + bool best_insideAtlas; + int best_metric, best_x, best_y, best_w, best_h, best_r; +}; + +static void runFindChartLocationBruteForceTask(void *userData) +{ + XA_PROFILE_START(packChartsFindLocationThread) + auto args = (FindChartLocationBruteForceTaskArgs *)userData; + args->best_metric = INT_MAX; + if (args->finished->load()) + return; + // Try two different orientations. + for (int r = 0; r < 2; r++) { + int cw = args->chartBitImage->width(); + int ch = args->chartBitImage->height(); + if (r == 1) { + if (args->allowRotate) + swap(cw, ch); + else + break; + } + const int y = args->startPosition.y; + const int stepSize = args->blockAligned ? 4 : 1; + for (int x = args->startPosition.x; x <= args->w + stepSize; x += stepSize) { // + 1 not really necessary here. + if (!args->resizableAtlas && (x > (int)args->atlasBitImage->width() - cw || y > (int)args->atlasBitImage->height() - ch)) + continue; + if (args->finished->load()) + break; + // Early out if metric not better. + const int area = max(args->w, x + cw) * max(args->h, y + ch); + const int extents = max(max(args->w, x + cw), max(args->h, y + ch)); + const int metric = extents * extents + area; + if (metric > args->best_metric) + continue; + // If metric is the same, pick the one closest to the origin. + if (metric == args->best_metric && max(x, y) >= max(args->best_x, args->best_y)) + continue; + if (!args->atlasBitImage->canBlit(r == 1 ? *(args->chartBitImageRotated) : *(args->chartBitImage), x, y)) + continue; + args->best_metric = metric; + args->best_insideAtlas = area == args->w * args->h; + args->best_x = x; + args->best_y = y; + args->best_w = cw; + args->best_h = ch; + args->best_r = r; + if (args->best_insideAtlas) { + args->finished->store(true); + break; + } + } + } + XA_PROFILE_END(packChartsFindLocationThread) +} + struct Atlas { ~Atlas() @@ -6854,7 +7007,7 @@ struct Atlas } // Pack charts in the smallest possible rectangle. - bool packCharts(const PackOptions &options, ProgressFunc progressFunc, void *progressUserData) + bool packCharts(TaskScheduler *taskScheduler, const PackOptions &options, ProgressFunc progressFunc, void *progressUserData) { if (progressFunc) { if (!progressFunc(ProgressCategory::PackCharts, 0, progressUserData)) @@ -7069,7 +7222,7 @@ struct Atlas chartStartPositions.push_back(Vector2i(0, 0)); } XA_PROFILE_START(packChartsFindLocation) - const bool foundLocation = findChartLocation(chartStartPositions[currentAtlas], options.bruteForce, m_bitImages[currentAtlas], &chartBitImage, &chartBitImageRotated, atlasWidth, atlasHeight, &best_x, &best_y, &best_cw, &best_ch, &best_r, options.blockAlign, resizableAtlas, chart->allowRotate); + const bool foundLocation = findChartLocation(taskScheduler, chartStartPositions[currentAtlas], options.bruteForce, m_bitImages[currentAtlas], &chartBitImage, &chartBitImageRotated, atlasWidth, atlasHeight, &best_x, &best_y, &best_cw, &best_ch, &best_r, options.blockAlign, resizableAtlas, chart->allowRotate); XA_PROFILE_END(packChartsFindLocation) if (firstChartInBitImage && !foundLocation) { // Chart doesn't fit in an empty, newly allocated bitImage. texelsPerUnit must be too large for the resolution. @@ -7181,65 +7334,66 @@ private: // is occupied at this point. At the end we have many small charts and a large atlas with sparse holes. Finding those holes randomly is slow. A better approach would be to // start stacking large charts as if they were tetris pieces. Once charts get small try to place them randomly. It may be interesting to try a intermediate strategy, first try // along one axis and then try exhaustively along that axis. - bool findChartLocation(const Vector2i &startPosition, bool bruteForce, const BitImage *atlasBitImage, const BitImage *chartBitImage, const BitImage *chartBitImageRotated, int w, int h, int *best_x, int *best_y, int *best_w, int *best_h, int *best_r, bool blockAligned, bool resizableAtlas, bool allowRotate) + bool findChartLocation(TaskScheduler *taskScheduler, const Vector2i &startPosition, bool bruteForce, const BitImage *atlasBitImage, const BitImage *chartBitImage, const BitImage *chartBitImageRotated, int w, int h, int *best_x, int *best_y, int *best_w, int *best_h, int *best_r, bool blockAligned, bool resizableAtlas, bool allowRotate) { const int attempts = 4096; if (bruteForce || attempts >= w * h) - return findChartLocation_bruteForce(startPosition, atlasBitImage, chartBitImage, chartBitImageRotated, w, h, best_x, best_y, best_w, best_h, best_r, blockAligned, resizableAtlas, allowRotate); + return findChartLocation_bruteForce(taskScheduler, startPosition, atlasBitImage, chartBitImage, chartBitImageRotated, w, h, best_x, best_y, best_w, best_h, best_r, blockAligned, resizableAtlas, allowRotate); return findChartLocation_random(atlasBitImage, chartBitImage, chartBitImageRotated, w, h, best_x, best_y, best_w, best_h, best_r, attempts, blockAligned, resizableAtlas, allowRotate); } - bool findChartLocation_bruteForce(const Vector2i &startPosition, const BitImage *atlasBitImage, const BitImage *chartBitImage, const BitImage *chartBitImageRotated, int w, int h, int *best_x, int *best_y, int *best_w, int *best_h, int *best_r, bool blockAligned, bool resizableAtlas, bool allowRotate) + bool findChartLocation_bruteForce(TaskScheduler *taskScheduler, const Vector2i &startPosition, const BitImage *atlasBitImage, const BitImage *chartBitImage, const BitImage *chartBitImageRotated, int w, int h, int *best_x, int *best_y, int *best_w, int *best_h, int *best_r, bool blockAligned, bool resizableAtlas, bool allowRotate) { - bool result = false; - const int BLOCK_SIZE = 4; + const int stepSize = blockAligned ? 4 : 1; + uint32_t taskCount = 0; + for (int y = startPosition.y; y <= h + stepSize; y += stepSize) + taskCount++; + Array<FindChartLocationBruteForceTaskArgs> taskArgs; + taskArgs.resize(taskCount); + TaskGroupHandle taskGroup = taskScheduler->createTaskGroup(taskCount); + std::atomic<bool> finished(false); // One of the tasks found a location that doesn't expand the atlas. + uint32_t i = 0; + for (int y = startPosition.y; y <= h + stepSize; y += stepSize) { + FindChartLocationBruteForceTaskArgs &args = taskArgs[i]; + args.finished = &finished; + args.startPosition = Vector2i(y == startPosition.y ? startPosition.x : 0, y); + args.atlasBitImage = atlasBitImage; + args.chartBitImage = chartBitImage; + args.chartBitImageRotated = chartBitImageRotated; + args.w = w; + args.h = h; + args.blockAligned = blockAligned; + args.resizableAtlas = resizableAtlas; + args.allowRotate = allowRotate; + Task task; + task.userData = &taskArgs[i]; + task.func = runFindChartLocationBruteForceTask; + taskScheduler->run(taskGroup, task); + i++; + } + taskScheduler->wait(&taskGroup); + // Find the task result with the best metric. int best_metric = INT_MAX; - int step_size = blockAligned ? BLOCK_SIZE : 1; - // Try two different orientations. - for (int r = 0; r < 2; r++) { - int cw = chartBitImage->width(); - int ch = chartBitImage->height(); - if (r == 1) { - if (allowRotate) - swap(cw, ch); - else - break; - } - for (int y = startPosition.y; y <= h + step_size; y += step_size) { // + 1 to extend atlas in case atlas full. - for (int x = (y == startPosition.y ? startPosition.x : 0); x <= w + step_size; x += step_size) { // + 1 not really necessary here. - if (!resizableAtlas && (x > (int)atlasBitImage->width() - cw || y > (int)atlasBitImage->height() - ch)) - continue; - // Early out. - int area = max(w, x + cw) * max(h, y + ch); - //int perimeter = max(w, x+cw) + max(h, y+ch); - int extents = max(max(w, x + cw), max(h, y + ch)); - int metric = extents * extents + area; - if (metric > best_metric) { - continue; - } - if (metric == best_metric && max(x, y) >= max(*best_x, *best_y)) { - // If metric is the same, pick the one closest to the origin. - continue; - } - if (atlasBitImage->canBlit(r == 1 ? *chartBitImageRotated : *chartBitImage, x, y)) { - result = true; - best_metric = metric; - *best_x = x; - *best_y = y; - *best_w = cw; - *best_h = ch; - *best_r = r; - if (area == w * h) { - // Chart is completely inside, do not look at any other location. - goto done; - } - } - } - } + bool best_insideAtlas = false; + for (i = 0; i < taskCount; i++) { + FindChartLocationBruteForceTaskArgs &args = taskArgs[i]; + if (args.best_metric > best_metric) + continue; + // A location that doesn't expand the atlas is always preferred. + if (!args.best_insideAtlas && best_insideAtlas) + continue; + // If metric is the same, pick the one closest to the origin. + if (args.best_insideAtlas == best_insideAtlas && args.best_metric == best_metric && max(args.best_x, args.best_y) >= max(*best_x, *best_y)) + continue; + best_metric = args.best_metric; + best_insideAtlas = args.best_insideAtlas; + *best_x = args.best_x; + *best_y = args.best_y; + *best_w = args.best_w; + *best_h = args.best_h; + *best_r = args.best_r; } - done: - XA_DEBUG_ASSERT (best_metric != INT_MAX); - return result; + return best_metric != INT_MAX; } bool findChartLocation_random(const BitImage *atlasBitImage, const BitImage *chartBitImage, const BitImage *chartBitImageRotated, int w, int h, int *best_x, int *best_y, int *best_w, int *best_h, int *best_r, int minTrialCount, bool blockAligned, bool resizableAtlas, bool allowRotate) @@ -7439,25 +7593,31 @@ struct AddMeshTaskArgs static void runAddMeshTask(void *userData) { - XA_PROFILE_START(addMesh) + XA_PROFILE_START(addMeshThread) auto args = (AddMeshTaskArgs *)userData; // Responsible for freeing this. internal::Mesh *mesh = args->mesh; internal::Progress *progress = args->ctx->addMeshProgress; if (progress->cancel) goto cleanup; - XA_PROFILE_START(addMeshCreateColocals) - mesh->createColocals(); - XA_PROFILE_END(addMeshCreateColocals) + { + XA_PROFILE_START(addMeshCreateColocals) + mesh->createColocals(); + XA_PROFILE_END(addMeshCreateColocals) + } if (progress->cancel) goto cleanup; - XA_PROFILE_START(addMeshCreateFaceGroups) - mesh->createFaceGroups(); - XA_PROFILE_END(addMeshCreateFaceGroups) + { + XA_PROFILE_START(addMeshCreateFaceGroups) + mesh->createFaceGroups(); + XA_PROFILE_END(addMeshCreateFaceGroups) + } if (progress->cancel) goto cleanup; - XA_PROFILE_START(addMeshCreateBoundaries) - mesh->createBoundaries(); - XA_PROFILE_END(addMeshCreateBoundaries) + { + XA_PROFILE_START(addMeshCreateBoundaries) + mesh->createBoundaries(); + XA_PROFILE_END(addMeshCreateBoundaries) + } if (progress->cancel) goto cleanup; #if XA_DEBUG_EXPORT_OBJ_SOURCE_MESHES @@ -7491,9 +7651,11 @@ static void runAddMeshTask(void *userData) fclose(file); } #endif - XA_PROFILE_START(addMeshCreateChartGroupsConcurrent) - args->ctx->paramAtlas.addMesh(args->ctx->taskScheduler, mesh); // addMesh is thread safe - XA_PROFILE_END(addMeshCreateChartGroupsConcurrent) + { + XA_PROFILE_START(addMeshCreateChartGroupsReal) + args->ctx->paramAtlas.addMesh(args->ctx->taskScheduler, mesh); // addMesh is thread safe + XA_PROFILE_END(addMeshCreateChartGroupsReal) + } if (progress->cancel) goto cleanup; progress->value++; @@ -7503,7 +7665,7 @@ cleanup: XA_FREE(mesh); args->~AddMeshTaskArgs(); XA_FREE(args); - XA_PROFILE_END(addMesh) + XA_PROFILE_END(addMeshThread) } static internal::Vector3 DecodePosition(const MeshDecl &meshDecl, uint32_t index) @@ -7547,12 +7709,13 @@ AddMeshError::Enum AddMesh(Atlas *atlas, const MeshDecl &meshDecl, uint32_t mesh XA_PRINT_WARNING("AddMesh: Meshes and UV meshes cannot be added to the same atlas.\n"); return AddMeshError::Error; } +#if XA_PROFILE + if (ctx->meshCount == 0) + internal::s_profile.addMeshReal = clock(); +#endif // Don't know how many times AddMesh will be called, so progress needs to adjusted each time. if (!ctx->addMeshProgress) { ctx->addMeshProgress = XA_NEW(internal::MemTag::Default, internal::Progress, ProgressCategory::AddMesh, ctx->progressFunc, ctx->progressUserData, 1); -#if XA_PROFILE - internal::s_profile.addMeshConcurrent = clock(); -#endif } else { ctx->addMeshProgress->setMaxValue(internal::max(ctx->meshCount + 1, meshCountHint)); @@ -7560,7 +7723,6 @@ AddMeshError::Enum AddMesh(Atlas *atlas, const MeshDecl &meshDecl, uint32_t mesh bool decoded = (meshDecl.indexCount <= 0); uint32_t indexCount = decoded ? meshDecl.vertexCount : meshDecl.indexCount; XA_PRINT("Adding mesh %d: %u vertices, %u triangles\n", ctx->meshCount, meshDecl.vertexCount, indexCount / 3); - XA_PROFILE_START(addMesh) // Expecting triangle faces. if ((indexCount % 3) != 0) return AddMeshError::InvalidIndexCount; @@ -7629,15 +7791,16 @@ AddMeshError::Enum AddMesh(Atlas *atlas, const MeshDecl &meshDecl, uint32_t mesh ignore = true; mesh->addFace(tri[0], tri[1], tri[2], ignore); } + if (ctx->addMeshTaskGroup.value == UINT32_MAX) + ctx->addMeshTaskGroup = ctx->taskScheduler->createTaskGroup(); AddMeshTaskArgs *taskArgs = XA_NEW(internal::MemTag::Default, AddMeshTaskArgs); // The task frees this. taskArgs->ctx = ctx; taskArgs->mesh = mesh; internal::Task task; task.userData = taskArgs; task.func = runAddMeshTask; - ctx->taskScheduler->run(&ctx->addMeshTaskGroup, task); + ctx->taskScheduler->run(ctx->addMeshTaskGroup, task); ctx->meshCount++; - XA_PROFILE_END(addMesh) return AddMeshError::Success; } @@ -7657,15 +7820,15 @@ void AddMeshJoin(Atlas *atlas) ctx->addMeshProgress = nullptr; #if XA_PROFILE XA_PRINT("Added %u meshes\n", ctx->meshCount); - internal::s_profile.addMeshConcurrent = clock() - internal::s_profile.addMeshConcurrent; + internal::s_profile.addMeshReal = clock() - internal::s_profile.addMeshReal; #endif - XA_PROFILE_PRINT(" Total (concurrent): ", addMeshConcurrent) - XA_PROFILE_PRINT(" Total: ", addMesh) - XA_PROFILE_PRINT(" Create colocals: ", addMeshCreateColocals) - XA_PROFILE_PRINT(" Create face groups: ", addMeshCreateFaceGroups) - XA_PROFILE_PRINT(" Create boundaries: ", addMeshCreateBoundaries) - XA_PROFILE_PRINT(" Create chart groups (concurrent): ", addMeshCreateChartGroupsConcurrent) - XA_PROFILE_PRINT(" Create chart groups: ", addMeshCreateChartGroups) + XA_PROFILE_PRINT_AND_RESET(" Total (real): ", addMeshReal) + XA_PROFILE_PRINT_AND_RESET(" Total (thread): ", addMeshThread) + XA_PROFILE_PRINT_AND_RESET(" Create colocals: ", addMeshCreateColocals) + XA_PROFILE_PRINT_AND_RESET(" Create face groups: ", addMeshCreateFaceGroups) + XA_PROFILE_PRINT_AND_RESET(" Create boundaries: ", addMeshCreateBoundaries) + XA_PROFILE_PRINT_AND_RESET(" Create chart groups (real): ", addMeshCreateChartGroupsReal) + XA_PROFILE_PRINT_AND_RESET(" Create chart groups (thread): ", addMeshCreateChartGroupsThread) XA_PRINT_MEM_USAGE } @@ -7815,12 +7978,12 @@ void ComputeCharts(Atlas *atlas, ChartOptions chartOptions) } XA_PRINT("Computing charts\n"); uint32_t chartCount = 0, chartsWithHolesCount = 0, holesCount = 0, chartsWithTJunctionsCount = 0, tJunctionsCount = 0; - XA_PROFILE_START(computeChartsConcurrent) + XA_PROFILE_START(computeChartsReal) if (!ctx->paramAtlas.computeCharts(ctx->taskScheduler, chartOptions, ctx->progressFunc, ctx->progressUserData)) { XA_PRINT(" Cancelled by user\n"); return; } - XA_PROFILE_END(computeChartsConcurrent) + XA_PROFILE_END(computeChartsReal) // Count charts and print warnings. for (uint32_t i = 0; i < ctx->meshCount; i++) { for (uint32_t j = 0; j < ctx->paramAtlas.chartGroupCount(i); j++) { @@ -7854,16 +8017,17 @@ void ComputeCharts(Atlas *atlas, ChartOptions chartOptions) if (tJunctionsCount > 0) XA_PRINT(" Fixed %u t-junctions in %u charts\n", tJunctionsCount, chartsWithTJunctionsCount); XA_PRINT(" %u charts\n", chartCount); - XA_PROFILE_PRINT(" Total (concurrent): ", computeChartsConcurrent) - XA_PROFILE_PRINT(" Total: ", computeCharts) - XA_PROFILE_PRINT(" Atlas builder: ", atlasBuilder) - XA_PROFILE_PRINT(" Init: ", atlasBuilderInit) - XA_PROFILE_PRINT(" Create initial charts: ", atlasBuilderCreateInitialCharts) - XA_PROFILE_PRINT(" Grow charts: ", atlasBuilderGrowCharts) - XA_PROFILE_PRINT(" Merge charts: ", atlasBuilderMergeCharts) - XA_PROFILE_PRINT(" Create chart meshes: ", createChartMeshes) - XA_PROFILE_PRINT(" Fix t-junctions: ", fixChartMeshTJunctions); - XA_PROFILE_PRINT(" Close holes: ", closeChartMeshHoles) + XA_PROFILE_PRINT_AND_RESET(" Total (real): ", computeChartsReal) + XA_PROFILE_PRINT_AND_RESET(" Total (thread): ", computeChartsThread) + XA_PROFILE_PRINT_AND_RESET(" Atlas builder: ", atlasBuilder) + XA_PROFILE_PRINT_AND_RESET(" Init: ", atlasBuilderInit) + XA_PROFILE_PRINT_AND_RESET(" Create initial charts: ", atlasBuilderCreateInitialCharts) + XA_PROFILE_PRINT_AND_RESET(" Grow charts: ", atlasBuilderGrowCharts) + XA_PROFILE_PRINT_AND_RESET(" Merge charts: ", atlasBuilderMergeCharts) + XA_PROFILE_PRINT_AND_RESET(" Create chart meshes (real): ", createChartMeshesReal) + XA_PROFILE_PRINT_AND_RESET(" Create chart meshes (thread): ", createChartMeshesThread) + XA_PROFILE_PRINT_AND_RESET(" Fix t-junctions: ", fixChartMeshTJunctions) + XA_PROFILE_PRINT_AND_RESET(" Close holes: ", closeChartMeshHoles) XA_PRINT_MEM_USAGE } @@ -7896,12 +8060,12 @@ void ParameterizeCharts(Atlas *atlas, ParameterizeFunc func) } DestroyOutputMeshes(ctx); XA_PRINT("Parameterizing charts\n"); - XA_PROFILE_START(parameterizeChartsConcurrent) + XA_PROFILE_START(parameterizeChartsReal) if (!ctx->paramAtlas.parameterizeCharts(ctx->taskScheduler, func, ctx->progressFunc, ctx->progressUserData)) { XA_PRINT(" Cancelled by user\n"); return; } - XA_PROFILE_END(parameterizeChartsConcurrent) + XA_PROFILE_END(parameterizeChartsReal) uint32_t chartCount = 0, orthoChartsCount = 0, planarChartsCount = 0, chartsAddedCount = 0, chartsDeletedCount = 0; for (uint32_t i = 0; i < ctx->meshCount; i++) { for (uint32_t j = 0; j < ctx->paramAtlas.chartGroupCount(i); j++) { @@ -7982,11 +8146,11 @@ void ParameterizeCharts(Atlas *atlas, ParameterizeFunc func) } if (invalidParamCount > 0) XA_PRINT_WARNING(" %u charts with invalid parameterizations\n", invalidParamCount); - XA_PROFILE_PRINT(" Total (concurrent): ", parameterizeChartsConcurrent) - XA_PROFILE_PRINT(" Total: ", parameterizeCharts) - XA_PROFILE_PRINT(" Orthogonal: ", parameterizeChartsOrthogonal) - XA_PROFILE_PRINT(" LSCM: ", parameterizeChartsLSCM) - XA_PROFILE_PRINT(" Evaluate quality: ", parameterizeChartsEvaluateQuality) + XA_PROFILE_PRINT_AND_RESET(" Total (real): ", parameterizeChartsReal) + XA_PROFILE_PRINT_AND_RESET(" Total (thread): ", parameterizeChartsThread) + XA_PROFILE_PRINT_AND_RESET(" Orthogonal: ", parameterizeChartsOrthogonal) + XA_PROFILE_PRINT_AND_RESET(" LSCM: ", parameterizeChartsLSCM) + XA_PROFILE_PRINT_AND_RESET(" Evaluate quality: ", parameterizeChartsEvaluateQuality) XA_PRINT_MEM_USAGE } @@ -8039,7 +8203,7 @@ void PackCharts(Atlas *atlas, PackOptions packOptions) packAtlas.addChart(ctx->paramAtlas.chartAt(i)); } XA_PROFILE_START(packCharts) - if (!packAtlas.packCharts(packOptions, ctx->progressFunc, ctx->progressUserData)) + if (!packAtlas.packCharts(ctx->taskScheduler, packOptions, ctx->progressFunc, ctx->progressUserData)) return; XA_PROFILE_END(packCharts) // Populate atlas object with pack results. @@ -8058,19 +8222,13 @@ void PackCharts(Atlas *atlas, PackOptions packOptions) for (uint32_t i = 0; i < atlas->atlasCount; i++) packAtlas.getImages()[i]->copyTo(&atlas->image[atlas->width * atlas->height * i], atlas->width, atlas->height); } - XA_PROFILE_PRINT(" Total: ", packCharts) - XA_PROFILE_PRINT(" Rasterize: ", packChartsRasterize) - XA_PROFILE_PRINT(" Dilate (padding): ", packChartsDilate) - XA_PROFILE_PRINT(" Find location: ", packChartsFindLocation) - XA_PROFILE_PRINT(" Blit: ", packChartsBlit) + XA_PROFILE_PRINT_AND_RESET(" Total: ", packCharts) + XA_PROFILE_PRINT_AND_RESET(" Rasterize: ", packChartsRasterize) + XA_PROFILE_PRINT_AND_RESET(" Dilate (padding): ", packChartsDilate) + XA_PROFILE_PRINT_AND_RESET(" Find location (real): ", packChartsFindLocation) + XA_PROFILE_PRINT_AND_RESET(" Find location (thread): ", packChartsFindLocationThread) + XA_PROFILE_PRINT_AND_RESET(" Blit: ", packChartsBlit) XA_PRINT_MEM_USAGE -#if XA_PROFILE - internal::s_profile.packCharts = 0; - internal::s_profile.packChartsRasterize = 0; - internal::s_profile.packChartsDilate = 0; - internal::s_profile.packChartsFindLocation = 0; - internal::s_profile.packChartsBlit = 0; -#endif XA_PRINT("Building output meshes\n"); int progress = 0; if (ctx->progressFunc) { |