└── addons └── simplegrasstextured ├── LICENSE ├── default_mesh.tres ├── default_mesh_builder.gd ├── default_mesh_builder.gd.uid ├── grass.gd ├── grass.gd.uid ├── gui ├── about.gd ├── about.gd.uid ├── about.tscn ├── clear_all_confirmation_dialog.gd ├── clear_all_confirmation_dialog.gd.uid ├── clear_all_confirmation_dialog.tscn ├── domain_range.gd ├── domain_range.gd.uid ├── domain_range.tscn ├── global_parameters.gd ├── global_parameters.gd.uid ├── global_parameters.tscn ├── toolbar.gd ├── toolbar.gd.uid ├── toolbar.tscn ├── toolbar_menu.gd ├── toolbar_menu.gd.uid ├── toolbar_menu.tscn ├── toolbar_up.gd ├── toolbar_up.gd.uid └── toolbar_up.tscn ├── images ├── motion.png ├── motion.png.import ├── motion_frame.png ├── motion_frame.png.import ├── normal.png ├── normal.png.import ├── normal_frame.png ├── normal_frame.png.import ├── pointer.png ├── pointer.png.import ├── pointer_rect.png ├── pointer_rect.png.import ├── sgt_icon_airbrush.svg ├── sgt_icon_airbrush.svg.import ├── sgt_icon_airbrush_dark.svg ├── sgt_icon_airbrush_dark.svg.import ├── sgt_icon_arrow_up.svg ├── sgt_icon_arrow_up.svg.import ├── sgt_icon_arrow_up_dark.svg ├── sgt_icon_arrow_up_dark.svg.import ├── sgt_icon_density.svg ├── sgt_icon_density.svg.import ├── sgt_icon_density_dark.svg ├── sgt_icon_density_dark.svg.import ├── sgt_icon_distance.svg ├── sgt_icon_distance.svg.import ├── sgt_icon_distance_dark.svg ├── sgt_icon_distance_dark.svg.import ├── sgt_icon_eraser.svg ├── sgt_icon_eraser.svg.import ├── sgt_icon_eraser_dark.svg ├── sgt_icon_eraser_dark.svg.import ├── sgt_icon_pen.svg ├── sgt_icon_pen.svg.import ├── sgt_icon_pen_dark.svg ├── sgt_icon_pen_dark.svg.import ├── sgt_icon_radius.svg ├── sgt_icon_radius.svg.import ├── sgt_icon_radius_dark.svg ├── sgt_icon_radius_dark.svg.import ├── sgt_icon_slope.svg ├── sgt_icon_slope.svg.import ├── sgt_icon_slope_dark.svg ├── sgt_icon_slope_dark.svg.import ├── wind_pattern.png └── wind_pattern.png.import ├── materials ├── .gdignore ├── grass.material ├── icon.material └── position.material ├── plugin.cfg ├── plugin.gd ├── plugin.gd.uid ├── sgt_icon.svg ├── sgt_icon.svg.import ├── sgt_icon_48.svg ├── sgt_icon_48.svg.import ├── sgt_inspector.gd ├── sgt_inspector.gd.uid ├── shaders ├── .gdignore ├── blur1.gdshader ├── blur1.gdshader.uid ├── blur2.gdshader ├── blur2.gdshader.uid ├── distance.gdshader ├── distance.gdshader.uid ├── grass.gdshader ├── grass.gdshader.uid ├── grass.gdshaderinc ├── grass.gdshaderinc.uid ├── grass_linear.gdshader ├── grass_linear.gdshader.uid ├── grass_nearest.gdshader ├── grass_nearest.gdshader.uid ├── grass_nearest_mipmap.gdshader ├── grass_nearest_mipmap.gdshader.uid ├── grass_unshaded.gdshader ├── grass_unshaded.gdshader.uid ├── grass_unshaded_linear.gdshader ├── grass_unshaded_linear.gdshader.uid ├── grass_unshaded_nearest.gdshader ├── grass_unshaded_nearest.gdshader.uid ├── grass_unshaded_nearest_mipmap.gdshader ├── grass_unshaded_nearest_mipmap.gdshader.uid ├── motion1.gdshader ├── motion1.gdshader.uid ├── motion2.gdshader ├── motion2.gdshader.uid ├── normal.gdshader ├── normal.gdshader.uid ├── position.gdshader └── position.gdshader.uid ├── singleton.gd ├── singleton.gd.uid ├── singleton.tscn └── textures ├── grassbushcc008.png └── grassbushcc008.png.import /addons/simplegrasstextured/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 IcterusGames 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/default_mesh.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="ArrayMesh" format=4 uid="uid://sptcpdx6wtm8"] 2 | 3 | [resource] 4 | _surfaces = [{ 5 | "aabb": AABB(-0.5, 0, -0.5, 1, 1, 1), 6 | "attribute_data": PackedByteArray("/wAA/wAAAAAAAAAAAAAA/wAAgD8AAIA/AAAA/wAAAAAAAIA//wAA/wAAgD8AAAAA/wAA/wAAAAAAAAAAAAAA/wAAgD8AAIA/AAAA/wAAAAAAAIA//wAA/wAAgD8AAAAA"), 7 | "format": 34359742495, 8 | "index_count": 12, 9 | "index_data": PackedByteArray("AAABAAIAAwABAAAABAAFAAYABwAFAAQA"), 10 | "primitive": 3, 11 | "uv_scale": Vector4(0, 0, 0, 0), 12 | "vertex_count": 8, 13 | "vertex_data": PackedByteArray("AAAAvwAAgD8AAAAAAAAAPwAAAAAAAAAAAAAAvwAAAAAAAAAAAAAAPwAAgD8AAAAAAAAAAAAAgD8AAAC/AAAAAAAAAAAAAAA/AAAAAAAAAAAAAAC/AAAAAAAAgD8AAAA//3//f////7//f/9/////v/9//3////+//3//f////78AAP9//3//vwAA/3//f/+/AAD/f/9//78AAP9//3//vw==") 14 | }] 15 | metadata/GodotVersion = "4.4-stable (official)" 16 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/default_mesh_builder.gd: -------------------------------------------------------------------------------- 1 | # default_mesh_builder.gd 2 | # This file is part of: SimpleGrassTextured 3 | # Copyright (c) 2023 IcterusGames 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining 6 | # a copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be 14 | # included in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | ## Builds and saves the default grass mesh when called. 25 | func rebuild_and_save_default_mesh() -> void: 26 | var array_mesh := ArrayMesh.new() 27 | var vertices := PackedVector3Array() 28 | var normals := PackedVector3Array() 29 | var tangents := PackedFloat32Array() 30 | var colors := PackedColorArray() 31 | var uvs := PackedVector2Array() 32 | var index := PackedInt32Array() 33 | 34 | vertices.push_back(Vector3(-0.5, 1, 0)) 35 | vertices.push_back(Vector3(0.5, 0, 0)) 36 | vertices.push_back(Vector3(-0.5, 0, 0)) 37 | vertices.push_back(Vector3(0.5, 1, 0)) 38 | vertices.push_back(Vector3(0, 1, -0.5)) 39 | vertices.push_back(Vector3(0, 0, 0.5)) 40 | vertices.push_back(Vector3(0, 0, -0.5)) 41 | vertices.push_back(Vector3(0, 1, 0.5)) 42 | normals.push_back(Vector3(0, 0, 1)) 43 | normals.push_back(Vector3(0, 0, 1)) 44 | normals.push_back(Vector3(0, 0, 1)) 45 | normals.push_back(Vector3(0, 0, 1)) 46 | normals.push_back(Vector3(-1, 0, 0)) 47 | normals.push_back(Vector3(-1, 0, 0)) 48 | normals.push_back(Vector3(-1, 0, 0)) 49 | normals.push_back(Vector3(-1, 0, 0)) 50 | for i in range(4): 51 | tangents.push_back(1) 52 | tangents.push_back(0) 53 | tangents.push_back(0) 54 | tangents.push_back(1) 55 | for i in range(4): 56 | tangents.push_back(0) 57 | tangents.push_back(0) 58 | tangents.push_back(1) 59 | tangents.push_back(1) 60 | uvs.push_back(Vector2(0, 0)) 61 | uvs.push_back(Vector2(1, 1)) 62 | uvs.push_back(Vector2(0, 1)) 63 | uvs.push_back(Vector2(1, 0)) 64 | uvs.push_back(Vector2(0, 0)) 65 | uvs.push_back(Vector2(1, 1)) 66 | uvs.push_back(Vector2(0, 1)) 67 | uvs.push_back(Vector2(1, 0)) 68 | colors.push_back(Color(1, 0, 0)) 69 | colors.push_back(Color(0, 0, 0)) 70 | colors.push_back(Color(0, 0, 0)) 71 | colors.push_back(Color(1, 0, 0)) 72 | colors.push_back(Color(1, 0, 0)) 73 | colors.push_back(Color(0, 0, 0)) 74 | colors.push_back(Color(0, 0, 0)) 75 | colors.push_back(Color(1, 0, 0)) 76 | index.push_back(0) 77 | index.push_back(1) 78 | index.push_back(2) 79 | index.push_back(3) 80 | index.push_back(1) 81 | index.push_back(0) 82 | index.push_back(4) 83 | index.push_back(5) 84 | index.push_back(6) 85 | index.push_back(7) 86 | index.push_back(5) 87 | index.push_back(4) 88 | 89 | var arrays := [] 90 | arrays.resize(Mesh.ARRAY_MAX) 91 | arrays[Mesh.ARRAY_VERTEX] = vertices 92 | arrays[ArrayMesh.ARRAY_NORMAL] = normals 93 | arrays[ArrayMesh.ARRAY_TANGENT] = tangents 94 | arrays[ArrayMesh.ARRAY_TEX_UV] = uvs 95 | arrays[ArrayMesh.ARRAY_COLOR] = colors 96 | arrays[ArrayMesh.ARRAY_INDEX] = index 97 | 98 | array_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays) 99 | array_mesh.set_meta(&"GodotVersion", Engine.get_version_info()["string"]) 100 | ResourceSaver.save(array_mesh, "res://addons/simplegrasstextured/default_mesh.tres") 101 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/default_mesh_builder.gd.uid: -------------------------------------------------------------------------------- 1 | uid://deh0tfs84csxo 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/grass.gd.uid: -------------------------------------------------------------------------------- 1 | uid://2juaclm8gc1n 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/gui/about.gd.uid: -------------------------------------------------------------------------------- 1 | uid://cu72rjuvdnnx 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/gui/about.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=7 format=3 uid="uid://cb8klhv6nwvtl"] 2 | 3 | [ext_resource type="Script" uid="uid://cu72rjuvdnnx" path="res://addons/simplegrasstextured/gui/about.gd" id="1_r23hh"] 4 | [ext_resource type="Material" uid="uid://cl74usvfymgvs" path="res://addons/simplegrasstextured/materials/icon.material" id="2_4glo1"] 5 | [ext_resource type="Texture2D" uid="uid://cubr1a55brlfp" path="res://addons/simplegrasstextured/sgt_icon_48.svg" id="3_7w1su"] 6 | 7 | [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_hnw4u"] 8 | 9 | [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_lwftf"] 10 | 11 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_5fhmg"] 12 | content_margin_left = 5.0 13 | content_margin_top = 5.0 14 | content_margin_right = 5.0 15 | content_margin_bottom = 5.0 16 | draw_center = false 17 | 18 | [node name="SimpleGrassTexturedHelpAbout" type="AcceptDialog"] 19 | title = "About" 20 | position = Vector2i(0, 36) 21 | size = Vector2i(644, 475) 22 | visible = true 23 | min_size = Vector2i(520, 200) 24 | max_size = Vector2i(1280, 720) 25 | script = ExtResource("1_r23hh") 26 | message = "Simple Grass Textured Plugin 27 | v. {_version_num} 28 | by IcterusGames 29 | [font_size=7] [/font_size] 30 | [b]Support me on:[/b]" 31 | 32 | [node name="MarginContainer" type="MarginContainer" parent="."] 33 | offset_left = 8.0 34 | offset_top = 8.0 35 | offset_right = 636.0 36 | offset_bottom = 426.0 37 | theme_override_constants/margin_left = 10 38 | theme_override_constants/margin_top = 10 39 | theme_override_constants/margin_right = 10 40 | theme_override_constants/margin_bottom = 10 41 | 42 | [node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"] 43 | layout_mode = 2 44 | theme_override_constants/separation = 20 45 | 46 | [node name="TextureRect" type="TextureRect" parent="MarginContainer/HBoxContainer"] 47 | material = ExtResource("2_4glo1") 48 | custom_minimum_size = Vector2(48, 48) 49 | layout_mode = 2 50 | texture = ExtResource("3_7w1su") 51 | stretch_mode = 4 52 | 53 | [node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/HBoxContainer"] 54 | layout_mode = 2 55 | size_flags_horizontal = 3 56 | 57 | [node name="RichTextLabel" type="RichTextLabel" parent="MarginContainer/HBoxContainer/VBoxContainer"] 58 | unique_name_in_owner = true 59 | custom_minimum_size = Vector2(420, 0) 60 | layout_mode = 2 61 | size_flags_horizontal = 3 62 | theme_override_styles/focus = SubResource("StyleBoxEmpty_hnw4u") 63 | theme_override_styles/normal = SubResource("StyleBoxEmpty_lwftf") 64 | bbcode_enabled = true 65 | text = "Simple Grass Textured Plugin 66 | v. 2.0.8 67 | by IcterusGames 68 | [font_size=7] [/font_size] 69 | [b]Support me on:[/b]" 70 | fit_content = true 71 | 72 | [node name="MarginContainer" type="MarginContainer" parent="MarginContainer/HBoxContainer/VBoxContainer"] 73 | layout_mode = 2 74 | mouse_filter = 2 75 | theme_override_constants/margin_left = 15 76 | 77 | [node name="ItchButton" type="Button" parent="MarginContainer/HBoxContainer/VBoxContainer/MarginContainer"] 78 | layout_mode = 2 79 | size_flags_horizontal = 3 80 | 81 | [node name="MarginContainer" type="MarginContainer" parent="MarginContainer/HBoxContainer/VBoxContainer/MarginContainer"] 82 | layout_mode = 2 83 | mouse_filter = 2 84 | theme_override_constants/margin_left = 5 85 | theme_override_constants/margin_top = 5 86 | theme_override_constants/margin_right = 5 87 | theme_override_constants/margin_bottom = 5 88 | 89 | [node name="ItchContainer" type="HBoxContainer" parent="MarginContainer/HBoxContainer/VBoxContainer/MarginContainer/MarginContainer"] 90 | unique_name_in_owner = true 91 | layout_mode = 2 92 | mouse_filter = 2 93 | 94 | [node name="RichTextLabel" type="RichTextLabel" parent="MarginContainer/HBoxContainer/VBoxContainer/MarginContainer/MarginContainer/ItchContainer"] 95 | custom_minimum_size = Vector2(400, 0) 96 | layout_mode = 2 97 | size_flags_vertical = 4 98 | mouse_filter = 2 99 | theme_override_styles/normal = SubResource("StyleBoxFlat_5fhmg") 100 | bbcode_enabled = true 101 | text = "[b]Itch.io[/b] 102 | [url]https://icterusgames.itch.io[url]" 103 | fit_content = true 104 | 105 | [node name="MarginContainer2" type="MarginContainer" parent="MarginContainer/HBoxContainer/VBoxContainer"] 106 | layout_mode = 2 107 | mouse_filter = 2 108 | theme_override_constants/margin_left = 15 109 | 110 | [node name="PatreonButton" type="Button" parent="MarginContainer/HBoxContainer/VBoxContainer/MarginContainer2"] 111 | layout_mode = 2 112 | size_flags_horizontal = 3 113 | 114 | [node name="MarginContainer" type="MarginContainer" parent="MarginContainer/HBoxContainer/VBoxContainer/MarginContainer2"] 115 | layout_mode = 2 116 | mouse_filter = 2 117 | theme_override_constants/margin_left = 5 118 | theme_override_constants/margin_top = 5 119 | theme_override_constants/margin_right = 5 120 | theme_override_constants/margin_bottom = 5 121 | 122 | [node name="PatreonContainer" type="HBoxContainer" parent="MarginContainer/HBoxContainer/VBoxContainer/MarginContainer2/MarginContainer"] 123 | unique_name_in_owner = true 124 | layout_mode = 2 125 | mouse_filter = 2 126 | 127 | [node name="RichTextLabel" type="RichTextLabel" parent="MarginContainer/HBoxContainer/VBoxContainer/MarginContainer2/MarginContainer/PatreonContainer"] 128 | custom_minimum_size = Vector2(400, 0) 129 | layout_mode = 2 130 | size_flags_vertical = 4 131 | mouse_filter = 2 132 | theme_override_styles/normal = SubResource("StyleBoxFlat_5fhmg") 133 | bbcode_enabled = true 134 | text = "[b]Patreon[/b] 135 | [url]https://www.patreon.com/IcterusGames[/url]" 136 | fit_content = true 137 | 138 | [node name="RichTextLabel2" type="RichTextLabel" parent="MarginContainer/HBoxContainer/VBoxContainer"] 139 | unique_name_in_owner = true 140 | custom_minimum_size = Vector2(420, 0) 141 | layout_mode = 2 142 | size_flags_horizontal = 3 143 | theme_override_styles/focus = SubResource("StyleBoxEmpty_hnw4u") 144 | theme_override_styles/normal = SubResource("StyleBoxEmpty_lwftf") 145 | bbcode_enabled = true 146 | text = "[font_size=7] [/font_size] 147 | [b]Source code on:[/b]" 148 | fit_content = true 149 | 150 | [node name="MarginContainer3" type="MarginContainer" parent="MarginContainer/HBoxContainer/VBoxContainer"] 151 | layout_mode = 2 152 | mouse_filter = 2 153 | theme_override_constants/margin_left = 15 154 | 155 | [node name="GithubButton" type="Button" parent="MarginContainer/HBoxContainer/VBoxContainer/MarginContainer3"] 156 | layout_mode = 2 157 | size_flags_horizontal = 3 158 | 159 | [node name="MarginContainer" type="MarginContainer" parent="MarginContainer/HBoxContainer/VBoxContainer/MarginContainer3"] 160 | layout_mode = 2 161 | mouse_filter = 2 162 | theme_override_constants/margin_left = 5 163 | theme_override_constants/margin_top = 5 164 | theme_override_constants/margin_right = 5 165 | theme_override_constants/margin_bottom = 5 166 | 167 | [node name="GithubContainer" type="HBoxContainer" parent="MarginContainer/HBoxContainer/VBoxContainer/MarginContainer3/MarginContainer"] 168 | unique_name_in_owner = true 169 | layout_mode = 2 170 | mouse_filter = 2 171 | 172 | [node name="RichTextLabel" type="RichTextLabel" parent="MarginContainer/HBoxContainer/VBoxContainer/MarginContainer3/MarginContainer/GithubContainer"] 173 | custom_minimum_size = Vector2(400, 0) 174 | layout_mode = 2 175 | size_flags_vertical = 4 176 | mouse_filter = 2 177 | theme_override_styles/normal = SubResource("StyleBoxFlat_5fhmg") 178 | bbcode_enabled = true 179 | text = "[b]Github[/b] 180 | [url]https://github.com/IcterusGames/SimpleGrassTextured[/url]" 181 | fit_content = true 182 | 183 | [connection signal="canceled" from="." to="." method="_on_canceled"] 184 | [connection signal="confirmed" from="." to="." method="_on_confirmed"] 185 | [connection signal="pressed" from="MarginContainer/HBoxContainer/VBoxContainer/MarginContainer/ItchButton" to="." method="_on_itch_button_pressed"] 186 | [connection signal="pressed" from="MarginContainer/HBoxContainer/VBoxContainer/MarginContainer2/PatreonButton" to="." method="_on_patreon_button_pressed"] 187 | [connection signal="pressed" from="MarginContainer/HBoxContainer/VBoxContainer/MarginContainer3/GithubButton" to="." method="_on_github_button_pressed"] 188 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/gui/clear_all_confirmation_dialog.gd: -------------------------------------------------------------------------------- 1 | # clear_all_confirmation_dialog.gd 2 | # This file is part of: SimpleGrassTextured 3 | # Copyright (c) 2023 IcterusGames 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining 6 | # a copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be 14 | # included in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | @tool 25 | extends ConfirmationDialog 26 | 27 | 28 | func _ready() -> void: 29 | get_ok_button().custom_minimum_size.x = 100 30 | get_cancel_button().custom_minimum_size.x = 100 31 | 32 | 33 | func _on_confirmed() -> void: 34 | queue_free() 35 | 36 | 37 | func _on_canceled() -> void: 38 | queue_free() 39 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/gui/clear_all_confirmation_dialog.gd.uid: -------------------------------------------------------------------------------- 1 | uid://wckg68rm05vd 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/gui/clear_all_confirmation_dialog.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=3 uid="uid://c1242d1bef7lb"] 2 | 3 | [ext_resource type="Script" uid="uid://wckg68rm05vd" path="res://addons/simplegrasstextured/gui/clear_all_confirmation_dialog.gd" id="1_xk6u2"] 4 | 5 | [node name="ClearAllConfirmationDialog" type="ConfirmationDialog"] 6 | size = Vector2i(377, 109) 7 | ok_button_text = "Yes" 8 | dialog_text = "Are you sure you want to remove all the grass?" 9 | cancel_button_text = "No" 10 | script = ExtResource("1_xk6u2") 11 | 12 | [connection signal="canceled" from="." to="." method="_on_canceled"] 13 | [connection signal="confirmed" from="." to="." method="_on_confirmed"] 14 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/gui/domain_range.gd: -------------------------------------------------------------------------------- 1 | # domain_range.gd 2 | # This file is part of: SimpleGrassTextured 3 | # Copyright (c) 2025 IcterusGames 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining 6 | # a copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be 14 | # included in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | @tool 25 | extends Control 26 | 27 | signal value_changed(value_min: float, value_max: float) 28 | 29 | @export var range_min: float = 0.0 30 | @export var range_max: float = 180.0 31 | @export var step: float = 1.0 32 | @export var value_min: float = 0.0 : set = set_value_min 33 | @export var value_max: float = 45.0 : set = set_value_max 34 | 35 | var _ed_scale: float = 1.0 36 | var _slider_area := Rect2() 37 | var _slider_range := Rect2() 38 | var _grabber_min_pos := Vector2.ZERO 39 | var _grabber_max_pos := Vector2.ZERO 40 | var _is_grabbing_min_grab := false 41 | var _is_grabbing_max_grab := false 42 | var _is_grabbing_min_value := false 43 | var _is_grabbing_max_value := false 44 | var _is_editing_min := false 45 | var _is_editing_max := false 46 | var _mouse_over := false 47 | var _mouse_click_pos := Vector2.ONE * 100000 48 | var _mouse_click_rel := Vector2.ZERO 49 | var _mouse_click_value := 0.0 50 | var _mouse_over_grabber_min := false 51 | var _mouse_over_grabber_max := false 52 | 53 | @onready var _line_edit: LineEdit = $LineEdit 54 | 55 | 56 | func _ready() -> void: 57 | theme_changed.connect(_on_theme_changed) 58 | _on_theme_changed() 59 | _update_tooltip() 60 | 61 | 62 | func _notification(what: int) -> void: 63 | if what == NOTIFICATION_MOUSE_ENTER_SELF: 64 | _mouse_over = true 65 | queue_redraw() 66 | if what == NOTIFICATION_MOUSE_EXIT_SELF: 67 | _mouse_over = false 68 | _mouse_over_grabber_min = false 69 | _mouse_over_grabber_max = false 70 | queue_redraw() 71 | 72 | 73 | func _gui_input(event: InputEvent) -> void: 74 | if event is InputEventMouseMotion: 75 | _mouse_over_grabber_min = false 76 | _mouse_over_grabber_max = false 77 | if _is_grabbing_max_value: 78 | if event.position.distance_to(_mouse_click_pos) > 8 * _ed_scale: 79 | _mouse_click_pos = Vector2.ONE * 100000 80 | set_value_max(value_max + event.screen_relative.x * step) 81 | Input.mouse_mode = Input.MOUSE_MODE_CAPTURED 82 | elif _is_grabbing_min_value: 83 | if event.position.distance_to(_mouse_click_pos) > 8 * _ed_scale: 84 | _mouse_click_pos = Vector2.ONE * 100000 85 | set_value_min(value_min + event.screen_relative.x * step) 86 | Input.mouse_mode = Input.MOUSE_MODE_CAPTURED 87 | elif _is_grabbing_max_grab: 88 | _mouse_click_pos = Vector2.ONE * 100000 89 | set_value_max((event.position.x - _mouse_click_rel.x - _slider_area.position.x) / _slider_area.size.x * range_max) 90 | elif _is_grabbing_min_grab: 91 | _mouse_click_pos = Vector2.ONE * 100000 92 | set_value_min((event.position.x - _mouse_click_rel.x - _slider_area.position.x) / _slider_area.size.x * range_max) 93 | if event.position.distance_to(_grabber_max_pos) <= 8 * _ed_scale: 94 | _mouse_over_grabber_max = true 95 | if event.position.distance_to(_grabber_min_pos) <= 8 * _ed_scale: 96 | _mouse_over_grabber_min = true 97 | queue_redraw() 98 | 99 | if event is InputEventMouseButton: 100 | if event.button_index == MOUSE_BUTTON_LEFT: 101 | if event.pressed: 102 | _mouse_click_pos = event.position 103 | if (event.position.distance_to(_grabber_min_pos) <= 8 * _ed_scale and 104 | event.position.distance_to(_grabber_max_pos) <= 8 * _ed_scale): 105 | if event.position.x < (_grabber_min_pos.x + _grabber_max_pos.x) / 2: 106 | _is_grabbing_min_grab = true 107 | _mouse_click_rel = event.position - _grabber_min_pos 108 | _mouse_click_value = value_min 109 | else: 110 | _is_grabbing_max_grab = true 111 | _mouse_click_rel = event.position - _grabber_max_pos 112 | _mouse_click_value = value_max 113 | elif event.position.distance_to(_grabber_min_pos) <= 8 * _ed_scale: 114 | _is_grabbing_min_grab = true 115 | _mouse_click_rel = event.position - _grabber_min_pos 116 | _mouse_click_value = value_min 117 | elif event.position.distance_to(_grabber_max_pos) <= 8 * _ed_scale: 118 | _is_grabbing_max_grab = true 119 | _mouse_click_rel = event.position - _grabber_max_pos 120 | _mouse_click_value = value_max 121 | elif event.position.x < size.x / 2: 122 | _is_grabbing_min_value = true 123 | _mouse_click_value = value_min 124 | else: 125 | _is_grabbing_max_value = true 126 | _mouse_click_value = value_max 127 | else: # Mouse left released 128 | if _mouse_click_pos.distance_to(event.position) <= 8 * _ed_scale: 129 | _grab_end() 130 | if event.position.x < size.x / 2: 131 | _line_edit.text = str(value_min) 132 | _is_editing_min = true 133 | _is_editing_max = false 134 | else: 135 | _line_edit.text = str(value_max) 136 | _is_editing_min = false 137 | _is_editing_max = true 138 | _line_edit.visible = true 139 | _line_edit.select() 140 | _line_edit.grab_focus() 141 | elif _is_grabbing_max_grab or _is_grabbing_max_value: 142 | _grab_end() 143 | queue_redraw() 144 | elif _is_grabbing_min_grab or _is_grabbing_min_value: 145 | _grab_end() 146 | queue_redraw() 147 | elif event.button_index == MOUSE_BUTTON_RIGHT: 148 | if event.pressed: 149 | if _is_grabbing_max_grab or _is_grabbing_max_value: 150 | _grab_end() 151 | set_value_max(_mouse_click_value) 152 | elif _is_grabbing_min_grab or _is_grabbing_min_value: 153 | _grab_end() 154 | set_value_min(_mouse_click_value) 155 | elif event.button_index == MOUSE_BUTTON_WHEEL_UP or event.button_index == MOUSE_BUTTON_WHEEL_LEFT: 156 | if event.pressed: 157 | if event.position.x < size.x / 2: 158 | set_value_min(value_min + step) 159 | else: 160 | set_value_max(value_max + step) 161 | elif event.button_index == MOUSE_BUTTON_WHEEL_DOWN or event.button_index == MOUSE_BUTTON_WHEEL_RIGHT: 162 | if event.pressed: 163 | if event.position.x < size.x / 2: 164 | set_value_min(value_min - step) 165 | else: 166 | set_value_max(value_max - step) 167 | 168 | 169 | func _draw() -> void: 170 | var sb := get_theme_stylebox(&"normal", &"LineEdit") 171 | var font := get_theme_font(&"font", &"LineEdit") 172 | var font_size := get_theme_font_size(&"font_size", &"LineEdit") 173 | var label_min := "%0.0f" % value_min 174 | var label_max := "%0.0f" % value_max 175 | var label_w_min := font.get_string_size(label_min, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x 176 | var label_w_max := font.get_string_size(label_max, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x 177 | var label_y := (size.y - font.get_height(font_size)) / 2.0 + font.get_ascent(font_size) 178 | var color := get_theme_color(&"font_color", &"LineEdit") 179 | 180 | draw_style_box(sb, Rect2(Vector2.ZERO, size)) 181 | if has_focus(): 182 | var sb_focus = get_theme_stylebox(&"focus", &"LineEdit") 183 | draw_style_box(sb_focus, Rect2(Vector2(), size)) 184 | 185 | color.a = 0.9 186 | draw_line(Vector2(size.x / 2.0, label_y - 10.0 * _ed_scale), Vector2(size.x / 2.0, label_y), color, max(1.0, _ed_scale)) 187 | 188 | draw_string(font, Vector2(size.x * 0.25 - label_w_min / 2.0, label_y), label_min, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, color) 189 | draw_string(font, Vector2(size.x * 0.75 - label_w_max / 2.0, label_y), label_max, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, color) 190 | 191 | _slider_area = Rect2(_ed_scale * 6.0, size.y - _ed_scale * 5.0, size.x - _ed_scale * 12.0, _ed_scale * 2.0) 192 | color.a = 0.2 193 | draw_rect(_slider_area, color) 194 | 195 | _slider_range = _slider_area 196 | _slider_range.size.x *= (value_max - value_min) / (range_max - range_min) 197 | _slider_range.position.x += value_min / (range_max - range_min) * _slider_area.size.x 198 | color.a = 0.45 199 | draw_rect(_slider_range, color) 200 | 201 | _grabber_min_pos = _slider_range.position 202 | _grabber_max_pos = _slider_range.position + Vector2(_slider_range.size.x, 0) 203 | 204 | color.a = 0.9 205 | var tex: Texture2D = null 206 | if not _is_grabbing_max_grab: 207 | if _mouse_over_grabber_min or _is_grabbing_min_grab: 208 | tex = get_theme_icon(&"grabber_highlight", &"HSlider") 209 | elif _mouse_over and not _mouse_over_grabber_max: 210 | tex = get_theme_icon(&"grabber", &"HSlider") 211 | if tex: 212 | draw_texture(tex, (_grabber_min_pos - tex.get_size() / 2.0) + Vector2.DOWN) 213 | else: 214 | draw_rect(Rect2(_grabber_min_pos.x - 2 * _ed_scale, _grabber_min_pos.y - 1 * _ed_scale, 4 * _ed_scale, 4 * _ed_scale), color) 215 | 216 | tex = null 217 | if not _is_grabbing_min_grab: 218 | if _mouse_over_grabber_max or _is_grabbing_max_grab: 219 | tex = get_theme_icon(&"grabber_highlight", &"HSlider") 220 | elif _mouse_over and not _mouse_over_grabber_min: 221 | tex = get_theme_icon(&"grabber", &"HSlider") 222 | if tex: 223 | draw_texture(tex, (_grabber_max_pos - tex.get_size() / 2.0) + Vector2.DOWN) 224 | else: 225 | draw_rect(Rect2(_grabber_max_pos.x - 2 * _ed_scale, _grabber_max_pos.y - 1 * _ed_scale, 4 * _ed_scale, 4 * _ed_scale), color) 226 | 227 | 228 | func set_value(v_min: float, v_max: float) -> void: 229 | v_min = max(min(v_min, v_max), range_min) 230 | v_max = min(max(v_min, v_max), range_max) 231 | if v_min != value_min or v_max != value_max: 232 | value_min = v_min 233 | value_max = v_max 234 | value_changed.emit(value_min, value_max) 235 | _update_tooltip() 236 | queue_redraw() 237 | 238 | 239 | func set_value_min(value: float) -> void: 240 | value = clampf(snappedf(value, step), range_min, value_max) 241 | if value != value_min: 242 | value_min = value 243 | value_changed.emit(value_min, value_max) 244 | _update_tooltip() 245 | queue_redraw() 246 | 247 | 248 | func set_value_max(value: float) -> void: 249 | value = clampf(snappedf(value, step), value_min, range_max) 250 | if value != value_max: 251 | value_max = value 252 | value_changed.emit(value_min, value_max) 253 | _update_tooltip() 254 | queue_redraw() 255 | 256 | 257 | func _update_tooltip() -> void: 258 | tooltip_text = "Slope to avoid:\n" 259 | tooltip_text += "Min: %0.*f°\n" %[step_decimals(step), value_min] 260 | tooltip_text += "Max: %0.*f°\n" %[step_decimals(step), value_max] 261 | 262 | 263 | func _grab_end() -> void: 264 | Input.mouse_mode = Input.MOUSE_MODE_VISIBLE 265 | if _is_grabbing_max_value: 266 | Input.warp_mouse(_grabber_max_pos + global_position) 267 | elif _is_grabbing_min_value: 268 | Input.warp_mouse(_grabber_min_pos + global_position) 269 | _is_grabbing_min_grab = false 270 | _is_grabbing_max_grab = false 271 | _is_grabbing_min_value = false 272 | _is_grabbing_max_value = false 273 | 274 | 275 | func _on_theme_changed() -> void: 276 | var es: int = EditorInterface.get_editor_settings().get_setting("interface/editor/display_scale") 277 | if es == 7: 278 | _ed_scale = EditorInterface.get_editor_settings().get_setting("interface/editor/custom_display_scale") 279 | else: 280 | _ed_scale = [1.0, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0][clamp(es, 0, 6)] 281 | _line_edit.caret_blink = EditorInterface.get_editor_settings().get_setting("text_editor/appearance/caret/caret_blink") 282 | 283 | 284 | func _on_line_edit_text_submitted(new_text: String) -> void: 285 | var value := range_min 286 | var expression = Expression.new() 287 | if expression.parse(new_text) == OK: 288 | var result = expression.execute() 289 | if not expression.has_execute_failed() and (typeof(result) == TYPE_FLOAT or typeof(result) == TYPE_INT): 290 | value = result 291 | if _is_editing_min: 292 | set_value_min(value) 293 | elif _is_editing_max: 294 | set_value_max(value) 295 | _is_editing_min = false 296 | _is_editing_max = false 297 | _line_edit.visible = false 298 | grab_focus() 299 | 300 | 301 | func _on_line_edit_focus_exited() -> void: 302 | _line_edit.visible = false 303 | 304 | 305 | func _on_line_edit_gui_input(event: InputEvent) -> void: 306 | if event is InputEventKey: 307 | if event.keycode == KEY_ESCAPE and event.pressed: 308 | _line_edit.visible = false 309 | grab_focus() 310 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/gui/domain_range.gd.uid: -------------------------------------------------------------------------------- 1 | uid://dmpm4vrmag0ru 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/gui/domain_range.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=3 uid="uid://r30ih7dtx1uo"] 2 | 3 | [ext_resource type="Script" uid="uid://dmpm4vrmag0ru" path="res://addons/simplegrasstextured/gui/domain_range.gd" id="1_xiopc"] 4 | 5 | [node name="DomainRange" type="Control"] 6 | custom_minimum_size = Vector2(80, 0) 7 | layout_mode = 3 8 | anchors_preset = 15 9 | anchor_right = 1.0 10 | anchor_bottom = 1.0 11 | grow_horizontal = 2 12 | grow_vertical = 2 13 | focus_mode = 2 14 | script = ExtResource("1_xiopc") 15 | 16 | [node name="LineEdit" type="LineEdit" parent="."] 17 | visible = false 18 | layout_mode = 1 19 | anchors_preset = 15 20 | anchor_right = 1.0 21 | anchor_bottom = 1.0 22 | grow_horizontal = 2 23 | grow_vertical = 2 24 | caret_blink = true 25 | 26 | [connection signal="focus_exited" from="LineEdit" to="." method="_on_line_edit_focus_exited"] 27 | [connection signal="gui_input" from="LineEdit" to="." method="_on_line_edit_gui_input"] 28 | [connection signal="text_submitted" from="LineEdit" to="." method="_on_line_edit_text_submitted"] 29 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/gui/global_parameters.gd: -------------------------------------------------------------------------------- 1 | # global_parameters.gd 2 | # This file is part of: SimpleGrassTextured 3 | # Copyright (c) 2023 IcterusGames 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining 6 | # a copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be 14 | # included in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | @tool 25 | extends AcceptDialog 26 | 27 | const DEFAULT_WIND_DIR := Vector3.RIGHT 28 | const DEFAULT_WIND_STRENGTH := 0.15 29 | const DEFAULT_WIND_TURBULENCE := 1.0 30 | const DEFAULT_WIND_PATTERN := "res://addons/simplegrasstextured/images/wind_pattern.png" 31 | 32 | var _wind_dir_x_slider :EditorSpinSlider 33 | var _wind_dir_y_slider :EditorSpinSlider 34 | var _wind_dir_z_slider :EditorSpinSlider 35 | var _wind_strength_slider :EditorSpinSlider 36 | var _wind_turbulence_slider :EditorSpinSlider 37 | var _wind_pattern :EditorResourcePicker 38 | 39 | 40 | func _ready() -> void: 41 | name = &"SimpleGrassTexturedGlobalParameters" 42 | size = Vector2.ZERO 43 | _wind_dir_x_slider = _create_slider("X", -1, 1, 0.01) 44 | _wind_dir_y_slider = _create_slider("Y", -1, 1, 0.01) 45 | _wind_dir_z_slider = _create_slider("Z", -1, 1, 0.01) 46 | _wind_strength_slider = _create_slider("", 0, 1, 0.001) 47 | _wind_turbulence_slider = _create_slider("", 0, 20, 0.01) 48 | _wind_pattern = EditorResourcePicker.new() 49 | _wind_pattern.base_type = "Texture" 50 | _wind_pattern.size_flags_horizontal = Control.SIZE_EXPAND_FILL 51 | _wind_dir_x_slider.value_changed.connect(_on_wind_dir_x_value_changed) 52 | _wind_dir_y_slider.value_changed.connect(_on_wind_dir_y_value_changed) 53 | _wind_dir_z_slider.value_changed.connect(_on_wind_dir_z_value_changed) 54 | _wind_strength_slider.value_changed.connect(_on_wind_strength_value_changed) 55 | _wind_turbulence_slider.value_changed.connect(_on_wind_turbulence_value_changed) 56 | _wind_pattern.resource_changed.connect(_on_wind_pattern_resource_changed) 57 | %WindDirHbox.add_child(_wind_dir_x_slider) 58 | %WindDirHbox.add_child(_wind_dir_y_slider) 59 | %WindDirHbox.add_child(_wind_dir_z_slider) 60 | %WindStrengthHBox.add_child(_wind_strength_slider) 61 | %WindTurbulenceHBox.add_child(_wind_turbulence_slider) 62 | %WindPatternHBox.add_child(_wind_pattern) 63 | get_ok_button().custom_minimum_size.x = 100 64 | 65 | 66 | func _create_slider(label :String, min :float, max :float, step :float) -> EditorSpinSlider: 67 | var slider := EditorSpinSlider.new() 68 | slider.size_flags_horizontal = Control.SIZE_EXPAND_FILL 69 | slider.step = step; 70 | slider.min_value = min 71 | slider.max_value = max 72 | slider.label = label 73 | slider.custom_minimum_size.x = 80 74 | return slider 75 | 76 | 77 | func disable_button(button :Button, disabled :bool) -> void: 78 | if disabled: 79 | button.disabled = true 80 | button.modulate.a = 0 81 | button.focus_mode = Control.FOCUS_NONE 82 | else: 83 | button.disabled = false 84 | button.modulate.a = 1 85 | button.focus_mode = Control.FOCUS_ALL 86 | 87 | 88 | func on_theme_changed() -> void: 89 | %DefaultWindDirButton.icon = get_theme_icon(&"Reload", &"EditorIcons") 90 | %DefaultWindStrengthButton.icon = get_theme_icon(&"Reload", &"EditorIcons") 91 | %DefaultWindTurbulenceButton.icon = get_theme_icon(&"Reload", &"EditorIcons") 92 | %DefaultWindPatternButton.icon = get_theme_icon(&"Reload", &"EditorIcons") 93 | 94 | 95 | func _on_about_to_popup() -> void: 96 | var windir :Vector3 = ProjectSettings.get_setting("shader_globals/sgt_wind_direction").value 97 | _wind_dir_x_slider.value = windir.x 98 | _wind_dir_y_slider.value = windir.y 99 | _wind_dir_z_slider.value = windir.z 100 | _wind_strength_slider.value = ProjectSettings.get_setting("shader_globals/sgt_wind_strength").value 101 | _wind_turbulence_slider.value = ProjectSettings.get_setting("shader_globals/sgt_wind_turbulence").value 102 | _wind_pattern.edited_resource = load(ProjectSettings.get_setting("shader_globals/sgt_wind_pattern").value) 103 | _on_wind_pattern_resource_changed(_wind_pattern.edited_resource) 104 | on_theme_changed() 105 | 106 | 107 | func _on_wind_dir_x_value_changed(value :float) -> void: 108 | var windir :Vector3 = ProjectSettings.get_setting("shader_globals/sgt_wind_direction", {"value":Vector3.RIGHT}).value 109 | windir.x = value 110 | ProjectSettings.set_setting("shader_globals/sgt_wind_direction", { 111 | "type": "vec3", 112 | "value": windir 113 | }) 114 | RenderingServer.global_shader_parameter_set("sgt_wind_direction", windir) 115 | $SaveConfigTimer.start() 116 | get_tree().emit_signal(&"sgt_globals_params_changed") 117 | disable_button(%DefaultWindDirButton, windir == DEFAULT_WIND_DIR) 118 | 119 | 120 | func _on_wind_dir_y_value_changed(value :float) -> void: 121 | var windir :Vector3 = ProjectSettings.get_setting("shader_globals/sgt_wind_direction", {"value":Vector3.RIGHT}).value 122 | windir.y = value 123 | ProjectSettings.set_setting("shader_globals/sgt_wind_direction", { 124 | "type": "vec3", 125 | "value": windir 126 | }) 127 | RenderingServer.global_shader_parameter_set("sgt_wind_direction", windir) 128 | $SaveConfigTimer.start() 129 | get_tree().emit_signal(&"sgt_globals_params_changed") 130 | disable_button(%DefaultWindDirButton, windir == DEFAULT_WIND_DIR) 131 | 132 | 133 | func _on_wind_dir_z_value_changed(value :float) -> void: 134 | var windir :Vector3 = ProjectSettings.get_setting("shader_globals/sgt_wind_direction", {"value":Vector3.RIGHT}).value 135 | windir.z = value 136 | ProjectSettings.set_setting("shader_globals/sgt_wind_direction", { 137 | "type": "vec3", 138 | "value": windir 139 | }) 140 | RenderingServer.global_shader_parameter_set("sgt_wind_direction", windir) 141 | $SaveConfigTimer.start() 142 | get_tree().emit_signal(&"sgt_globals_params_changed") 143 | disable_button(%DefaultWindDirButton, windir == DEFAULT_WIND_DIR) 144 | 145 | 146 | func _on_wind_strength_value_changed(value :float) -> void: 147 | ProjectSettings.set_setting("shader_globals/sgt_wind_strength", { 148 | "type": "float", 149 | "value": value 150 | }) 151 | RenderingServer.global_shader_parameter_set("sgt_wind_strength", value) 152 | $SaveConfigTimer.start() 153 | get_tree().emit_signal(&"sgt_globals_params_changed") 154 | disable_button(%DefaultWindStrengthButton, _wind_strength_slider.value == DEFAULT_WIND_STRENGTH) 155 | 156 | 157 | func _on_wind_turbulence_value_changed(value :float) -> void: 158 | ProjectSettings.set_setting("shader_globals/sgt_wind_turbulence", { 159 | "type": "float", 160 | "value": value 161 | }) 162 | RenderingServer.global_shader_parameter_set("sgt_wind_turbulence", value) 163 | $SaveConfigTimer.start() 164 | get_tree().emit_signal(&"sgt_globals_params_changed") 165 | disable_button(%DefaultWindTurbulenceButton, _wind_turbulence_slider.value == DEFAULT_WIND_TURBULENCE) 166 | 167 | 168 | func _on_wind_pattern_resource_changed(resource :Resource) -> void: 169 | if resource.resource_path == "": 170 | _wind_pattern.edited_resource = load(DEFAULT_WIND_PATTERN) 171 | _on_wind_pattern_resource_changed(_wind_pattern.edited_resource) 172 | return 173 | ProjectSettings.set_setting("shader_globals/sgt_wind_pattern", { 174 | "type": "sampler2D", 175 | "value": resource.resource_path 176 | }) 177 | RenderingServer.global_shader_parameter_set("sgt_wind_pattern", load(resource.resource_path)) 178 | $SaveConfigTimer.start() 179 | get_tree().emit_signal(&"sgt_globals_params_changed") 180 | disable_button(%DefaultWindPatternButton, resource.resource_path == DEFAULT_WIND_PATTERN) 181 | 182 | 183 | func _on_save_config_timer_timeout() -> void: 184 | ProjectSettings.save() 185 | 186 | 187 | func _on_canceled(): 188 | queue_free() 189 | 190 | 191 | func _on_confirmed() -> void: 192 | ProjectSettings.save() 193 | queue_free() 194 | 195 | 196 | func _on_default_wind_dir_button_pressed() -> void: 197 | _wind_dir_x_slider.value = DEFAULT_WIND_DIR.x 198 | _wind_dir_y_slider.value = DEFAULT_WIND_DIR.y 199 | _wind_dir_z_slider.value = DEFAULT_WIND_DIR.z 200 | 201 | 202 | func _on_default_wind_strength_button_pressed() -> void: 203 | _wind_strength_slider.value = DEFAULT_WIND_STRENGTH 204 | 205 | 206 | func _on_default_wind_turbulence_button_pressed() -> void: 207 | _wind_turbulence_slider.value = DEFAULT_WIND_TURBULENCE 208 | 209 | 210 | func _on_default_wind_pattern_button_pressed() -> void: 211 | _wind_pattern.edited_resource = load(DEFAULT_WIND_PATTERN) 212 | _on_wind_pattern_resource_changed(_wind_pattern.edited_resource) 213 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/gui/global_parameters.gd.uid: -------------------------------------------------------------------------------- 1 | uid://b1ddeyowx86m3 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/gui/global_parameters.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=3 uid="uid://bbbcb5o176677"] 2 | 3 | [ext_resource type="Script" uid="uid://b1ddeyowx86m3" path="res://addons/simplegrasstextured/gui/global_parameters.gd" id="1_f1c1a"] 4 | 5 | [node name="SimpleGrassTexturedGlobalParameters" type="AcceptDialog"] 6 | title = "Simple Grass Texture: Global Parameters" 7 | initial_position = 2 8 | size = Vector2i(197, 181) 9 | unresizable = true 10 | script = ExtResource("1_f1c1a") 11 | 12 | [node name="MarginContainer" type="MarginContainer" parent="."] 13 | offset_left = 8.0 14 | offset_top = 8.0 15 | offset_right = 441.0 16 | offset_bottom = 164.0 17 | theme_override_constants/margin_left = 10 18 | theme_override_constants/margin_top = 10 19 | theme_override_constants/margin_right = 10 20 | theme_override_constants/margin_bottom = 10 21 | 22 | [node name="GridContainer" type="GridContainer" parent="MarginContainer"] 23 | layout_mode = 2 24 | theme_override_constants/h_separation = 20 25 | columns = 2 26 | 27 | [node name="Label" type="Label" parent="MarginContainer/GridContainer"] 28 | layout_mode = 2 29 | text = "Wind direction:" 30 | 31 | [node name="WindDirHbox" type="HBoxContainer" parent="MarginContainer/GridContainer"] 32 | unique_name_in_owner = true 33 | layout_mode = 2 34 | 35 | [node name="DefaultWindDirButton" type="Button" parent="MarginContainer/GridContainer/WindDirHbox"] 36 | unique_name_in_owner = true 37 | layout_mode = 2 38 | flat = true 39 | 40 | [node name="Label2" type="Label" parent="MarginContainer/GridContainer"] 41 | layout_mode = 2 42 | text = "Wind strength:" 43 | 44 | [node name="WindStrengthHBox" type="HBoxContainer" parent="MarginContainer/GridContainer"] 45 | unique_name_in_owner = true 46 | layout_mode = 2 47 | 48 | [node name="DefaultWindStrengthButton" type="Button" parent="MarginContainer/GridContainer/WindStrengthHBox"] 49 | unique_name_in_owner = true 50 | layout_mode = 2 51 | flat = true 52 | 53 | [node name="Label3" type="Label" parent="MarginContainer/GridContainer"] 54 | layout_mode = 2 55 | text = "Wind turbulence:" 56 | 57 | [node name="WindTurbulenceHBox" type="HBoxContainer" parent="MarginContainer/GridContainer"] 58 | unique_name_in_owner = true 59 | layout_mode = 2 60 | 61 | [node name="DefaultWindTurbulenceButton" type="Button" parent="MarginContainer/GridContainer/WindTurbulenceHBox"] 62 | unique_name_in_owner = true 63 | layout_mode = 2 64 | flat = true 65 | 66 | [node name="Label4" type="Label" parent="MarginContainer/GridContainer"] 67 | layout_mode = 2 68 | text = "Wind pattern:" 69 | 70 | [node name="WindPatternHBox" type="HBoxContainer" parent="MarginContainer/GridContainer"] 71 | unique_name_in_owner = true 72 | layout_mode = 2 73 | 74 | [node name="DefaultWindPatternButton" type="Button" parent="MarginContainer/GridContainer/WindPatternHBox"] 75 | unique_name_in_owner = true 76 | layout_mode = 2 77 | flat = true 78 | 79 | [node name="SaveConfigTimer" type="Timer" parent="."] 80 | wait_time = 5.0 81 | one_shot = true 82 | 83 | [connection signal="about_to_popup" from="." to="." method="_on_about_to_popup"] 84 | [connection signal="canceled" from="." to="." method="_on_canceled"] 85 | [connection signal="confirmed" from="." to="." method="_on_confirmed"] 86 | [connection signal="pressed" from="MarginContainer/GridContainer/WindDirHbox/DefaultWindDirButton" to="." method="_on_default_wind_dir_button_pressed"] 87 | [connection signal="pressed" from="MarginContainer/GridContainer/WindStrengthHBox/DefaultWindStrengthButton" to="." method="_on_default_wind_strength_button_pressed"] 88 | [connection signal="pressed" from="MarginContainer/GridContainer/WindTurbulenceHBox/DefaultWindTurbulenceButton" to="." method="_on_default_wind_turbulence_button_pressed"] 89 | [connection signal="pressed" from="MarginContainer/GridContainer/WindPatternHBox/DefaultWindPatternButton" to="." method="_on_default_wind_pattern_button_pressed"] 90 | [connection signal="timeout" from="SaveConfigTimer" to="." method="_on_save_config_timer_timeout"] 91 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/gui/toolbar.gd.uid: -------------------------------------------------------------------------------- 1 | uid://usxgr64t746m 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/gui/toolbar.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=16 format=3 uid="uid://dsim5cbhc6kwm"] 2 | 3 | [ext_resource type="Script" uid="uid://usxgr64t746m" path="res://addons/simplegrasstextured/gui/toolbar.gd" id="1_aa1o6"] 4 | [ext_resource type="Material" uid="uid://cl74usvfymgvs" path="res://addons/simplegrasstextured/materials/icon.material" id="2_p7k4b"] 5 | [ext_resource type="Texture2D" uid="uid://bsmcpupaj02v8" path="res://addons/simplegrasstextured/sgt_icon.svg" id="3_tl64l"] 6 | [ext_resource type="PackedScene" uid="uid://der2mmxtog2mt" path="res://addons/simplegrasstextured/gui/toolbar_menu.tscn" id="4_1u4kn"] 7 | [ext_resource type="Texture2D" uid="uid://c2kunxv5wepih" path="res://addons/simplegrasstextured/images/sgt_icon_airbrush.svg" id="4_weijg"] 8 | [ext_resource type="Texture2D" uid="uid://clm6vd2es8xm7" path="res://addons/simplegrasstextured/images/sgt_icon_radius.svg" id="5_55kgh"] 9 | [ext_resource type="Texture2D" uid="uid://dtal42g10x1ay" path="res://addons/simplegrasstextured/images/sgt_icon_pen.svg" id="5_itpep"] 10 | [ext_resource type="Texture2D" uid="uid://bda52g6s88x5d" path="res://addons/simplegrasstextured/images/sgt_icon_arrow_up.svg" id="5_jg7h4"] 11 | [ext_resource type="Texture2D" uid="uid://brugf6rnck1tk" path="res://addons/simplegrasstextured/images/sgt_icon_eraser.svg" id="6_jg7h4"] 12 | [ext_resource type="Texture2D" uid="uid://tqiak77omdnr" path="res://addons/simplegrasstextured/images/sgt_icon_density.svg" id="6_wboky"] 13 | [ext_resource type="Texture2D" uid="uid://24avwtyvf01r" path="res://addons/simplegrasstextured/images/sgt_icon_slope.svg" id="7_4wrj3"] 14 | [ext_resource type="Texture2D" uid="uid://d28dlfkm62t6e" path="res://addons/simplegrasstextured/images/sgt_icon_distance.svg" id="7_ao3h0"] 15 | [ext_resource type="PackedScene" uid="uid://r30ih7dtx1uo" path="res://addons/simplegrasstextured/gui/domain_range.tscn" id="8_y7yf0"] 16 | 17 | [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_6mh15"] 18 | 19 | [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_hc7jq"] 20 | 21 | [node name="SGTToolbar" type="HFlowContainer"] 22 | anchors_preset = 10 23 | anchor_right = 1.0 24 | offset_bottom = 31.0 25 | grow_horizontal = 2 26 | script = ExtResource("1_aa1o6") 27 | 28 | [node name="PanelContainer" type="PanelContainer" parent="."] 29 | custom_minimum_size = Vector2(24, 0) 30 | layout_mode = 2 31 | mouse_default_cursor_shape = 2 32 | theme_override_styles/panel = SubResource("StyleBoxEmpty_6mh15") 33 | 34 | [node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"] 35 | layout_mode = 2 36 | mouse_filter = 2 37 | alignment = 1 38 | 39 | [node name="MarginContainer" type="MarginContainer" parent="PanelContainer/VBoxContainer"] 40 | custom_minimum_size = Vector2(24, 0) 41 | layout_mode = 2 42 | mouse_filter = 2 43 | theme_override_constants/margin_bottom = 3 44 | 45 | [node name="TextureRect" type="TextureRect" parent="PanelContainer/VBoxContainer/MarginContainer"] 46 | material = ExtResource("2_p7k4b") 47 | custom_minimum_size = Vector2(24, 0) 48 | layout_mode = 2 49 | mouse_filter = 2 50 | texture = ExtResource("3_tl64l") 51 | stretch_mode = 3 52 | 53 | [node name="LabelVersion" type="Label" parent="PanelContainer"] 54 | unique_name_in_owner = true 55 | auto_translate_mode = 2 56 | clip_contents = true 57 | layout_mode = 2 58 | size_flags_vertical = 1 59 | localize_numeral_system = false 60 | theme_override_font_sizes/font_size = 7 61 | theme_override_styles/normal = SubResource("StyleBoxEmpty_hc7jq") 62 | text = "2.0.5" 63 | horizontal_alignment = 1 64 | vertical_alignment = 2 65 | 66 | [node name="VSeparator" type="VSeparator" parent="."] 67 | layout_mode = 2 68 | 69 | [node name="HBoxContainer" type="HBoxContainer" parent="."] 70 | layout_mode = 2 71 | theme_override_constants/separation = 0 72 | 73 | [node name="ButtonAirbrush" type="Button" parent="HBoxContainer"] 74 | unique_name_in_owner = true 75 | layout_mode = 2 76 | tooltip_text = "Airdraw tool 77 | (right button for more options)" 78 | theme_type_variation = &"FlatButton" 79 | toggle_mode = true 80 | icon = ExtResource("4_weijg") 81 | 82 | [node name="AirbrushOptions" type="MenuButton" parent="HBoxContainer"] 83 | unique_name_in_owner = true 84 | visible = false 85 | layout_mode = 2 86 | theme_type_variation = &"FlatMenuButton" 87 | icon = ExtResource("5_jg7h4") 88 | flat = false 89 | 90 | [node name="HBoxContainer2" type="HBoxContainer" parent="."] 91 | layout_mode = 2 92 | theme_override_constants/separation = 0 93 | 94 | [node name="ButtonPencil" type="Button" parent="HBoxContainer2"] 95 | unique_name_in_owner = true 96 | layout_mode = 2 97 | tooltip_text = "Pencil tool 98 | (right button for more options)" 99 | theme_type_variation = &"FlatButton" 100 | toggle_mode = true 101 | icon = ExtResource("5_itpep") 102 | 103 | [node name="PencilOptions" type="MenuButton" parent="HBoxContainer2"] 104 | unique_name_in_owner = true 105 | visible = false 106 | layout_mode = 2 107 | theme_type_variation = &"FlatMenuButton" 108 | icon = ExtResource("5_jg7h4") 109 | flat = false 110 | 111 | [node name="HBoxContainer3" type="HBoxContainer" parent="."] 112 | layout_mode = 2 113 | theme_override_constants/separation = 0 114 | 115 | [node name="ButtonEraser" type="Button" parent="HBoxContainer3"] 116 | unique_name_in_owner = true 117 | layout_mode = 2 118 | tooltip_text = "Eraser tool 119 | (right button for more options)" 120 | theme_type_variation = &"FlatButton" 121 | toggle_mode = true 122 | icon = ExtResource("6_jg7h4") 123 | 124 | [node name="EraserOptions" type="MenuButton" parent="HBoxContainer3"] 125 | unique_name_in_owner = true 126 | visible = false 127 | layout_mode = 2 128 | theme_type_variation = &"FlatMenuButton" 129 | icon = ExtResource("5_jg7h4") 130 | flat = false 131 | 132 | [node name="ButtonMore" parent="." instance=ExtResource("4_1u4kn")] 133 | unique_name_in_owner = true 134 | layout_mode = 2 135 | theme_type_variation = &"FlatMenuButton" 136 | flat = false 137 | switch_on_hover = true 138 | 139 | [node name="VSeparator2" type="VSeparator" parent="."] 140 | layout_mode = 2 141 | 142 | [node name="IconRadius" type="Button" parent="."] 143 | unique_name_in_owner = true 144 | texture_filter = 1 145 | layout_mode = 2 146 | tooltip_text = "Radius" 147 | icon = ExtResource("5_55kgh") 148 | flat = true 149 | 150 | [node name="HSliderRadius" type="HSlider" parent="."] 151 | custom_minimum_size = Vector2(100, 0) 152 | layout_mode = 2 153 | size_flags_vertical = 1 154 | tooltip_text = "Radius" 155 | min_value = 0.1 156 | max_value = 10.0 157 | step = 0.1 158 | value = 1.0 159 | 160 | [node name="Label" type="Label" parent="HSliderRadius"] 161 | layout_mode = 1 162 | anchors_preset = 15 163 | anchor_right = 1.0 164 | anchor_bottom = 1.0 165 | grow_horizontal = 2 166 | grow_vertical = 2 167 | theme_override_colors/font_outline_color = Color(0, 0, 0, 1) 168 | theme_override_constants/outline_size = 2 169 | horizontal_alignment = 1 170 | vertical_alignment = 1 171 | 172 | [node name="Separator" type="Control" parent="."] 173 | custom_minimum_size = Vector2(15, 0) 174 | layout_mode = 2 175 | 176 | [node name="IconDensity" type="Button" parent="."] 177 | unique_name_in_owner = true 178 | texture_filter = 1 179 | layout_mode = 2 180 | tooltip_text = "Density" 181 | icon = ExtResource("6_wboky") 182 | flat = true 183 | 184 | [node name="HSliderDensity" type="HSlider" parent="."] 185 | custom_minimum_size = Vector2(100, 0) 186 | layout_mode = 2 187 | size_flags_vertical = 1 188 | tooltip_text = "Density" 189 | min_value = 1.0 190 | max_value = 200.0 191 | value = 1.0 192 | 193 | [node name="Label" type="Label" parent="HSliderDensity"] 194 | layout_mode = 1 195 | anchors_preset = 15 196 | anchor_right = 1.0 197 | anchor_bottom = 1.0 198 | grow_horizontal = 2 199 | grow_vertical = 2 200 | theme_override_colors/font_outline_color = Color(0, 0, 0, 1) 201 | theme_override_constants/outline_size = 2 202 | horizontal_alignment = 1 203 | vertical_alignment = 1 204 | 205 | [node name="Separator2" type="Control" parent="."] 206 | custom_minimum_size = Vector2(15, 0) 207 | layout_mode = 2 208 | 209 | [node name="SlopeCont" type="HBoxContainer" parent="."] 210 | unique_name_in_owner = true 211 | layout_mode = 2 212 | 213 | [node name="IconSlope" type="Button" parent="SlopeCont"] 214 | unique_name_in_owner = true 215 | texture_filter = 1 216 | layout_mode = 2 217 | tooltip_text = "Slope" 218 | icon = ExtResource("7_4wrj3") 219 | flat = true 220 | 221 | [node name="SlopeRange" parent="SlopeCont" instance=ExtResource("8_y7yf0")] 222 | unique_name_in_owner = true 223 | layout_mode = 2 224 | tooltip_text = "Slope to avoid: 225 | Min: 0° 226 | Max: 45° 227 | " 228 | 229 | [node name="ScaleCont" type="HBoxContainer" parent="."] 230 | unique_name_in_owner = true 231 | layout_mode = 2 232 | 233 | [node name="IconScale" type="Button" parent="ScaleCont"] 234 | unique_name_in_owner = true 235 | texture_filter = 1 236 | layout_mode = 2 237 | tooltip_text = "Scale" 238 | flat = true 239 | 240 | [node name="Separator3" type="Control" parent="."] 241 | custom_minimum_size = Vector2(15, 0) 242 | layout_mode = 2 243 | 244 | [node name="RotationCont" type="HBoxContainer" parent="."] 245 | unique_name_in_owner = true 246 | layout_mode = 2 247 | 248 | [node name="IconRotation" type="Button" parent="RotationCont"] 249 | unique_name_in_owner = true 250 | texture_filter = 1 251 | layout_mode = 2 252 | tooltip_text = "Rotation" 253 | flat = true 254 | 255 | [node name="RotationRandCont" type="HBoxContainer" parent="."] 256 | unique_name_in_owner = true 257 | layout_mode = 2 258 | 259 | [node name="IconRotationRand" type="Button" parent="RotationRandCont"] 260 | unique_name_in_owner = true 261 | texture_filter = 1 262 | layout_mode = 2 263 | tooltip_text = "Rotation randomizer" 264 | flat = true 265 | 266 | [node name="Separator4" type="Control" parent="."] 267 | custom_minimum_size = Vector2(15, 0) 268 | layout_mode = 2 269 | 270 | [node name="DistanceCont" type="HBoxContainer" parent="."] 271 | unique_name_in_owner = true 272 | layout_mode = 2 273 | 274 | [node name="IconDistance" type="Button" parent="DistanceCont"] 275 | unique_name_in_owner = true 276 | texture_filter = 1 277 | layout_mode = 2 278 | tooltip_text = "Minimum distance between grasses" 279 | icon = ExtResource("7_ao3h0") 280 | flat = true 281 | 282 | [node name="Separator5" type="Control" parent="."] 283 | custom_minimum_size = Vector2(15, 0) 284 | layout_mode = 2 285 | 286 | [node name="LabelStats" type="Label" parent="."] 287 | layout_mode = 2 288 | size_flags_horizontal = 3 289 | text = "Count: 0" 290 | horizontal_alignment = 2 291 | vertical_alignment = 1 292 | 293 | [node name="TimerReimportIcons" type="Timer" parent="."] 294 | 295 | [connection signal="gui_input" from="PanelContainer" to="." method="_on_panel_container_gui_input"] 296 | [connection signal="pressed" from="IconRadius" to="." method="_on_icon_radius_pressed"] 297 | [connection signal="value_changed" from="HSliderRadius" to="." method="_on_h_slider_radius_value_changed"] 298 | [connection signal="pressed" from="IconDensity" to="." method="_on_icon_radius_2_pressed"] 299 | [connection signal="value_changed" from="HSliderDensity" to="." method="_on_h_slider_density_value_changed"] 300 | [connection signal="pressed" from="SlopeCont/IconSlope" to="." method="_on_icon_slope_pressed"] 301 | [connection signal="pressed" from="ScaleCont/IconScale" to="." method="_on_icon_scale_pressed"] 302 | [connection signal="pressed" from="RotationCont/IconRotation" to="." method="_on_icon_rotation_pressed"] 303 | [connection signal="pressed" from="RotationRandCont/IconRotationRand" to="." method="_on_icon_rotation_rand_pressed"] 304 | [connection signal="pressed" from="DistanceCont/IconDistance" to="." method="_on_icon_distance_pressed"] 305 | [connection signal="timeout" from="TimerReimportIcons" to="." method="_on_timer_reimport_icons_timeout"] 306 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/gui/toolbar_menu.gd: -------------------------------------------------------------------------------- 1 | # toolbar_menu.gd 2 | # This file is part of: SimpleGrassTextured 3 | # Copyright (c) 2023 IcterusGames 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining 6 | # a copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be 14 | # included in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | @tool 25 | extends MenuButton 26 | 27 | enum MENU_ID { 28 | TOOL_FOLLOW_NORMAL, 29 | TOOL_SHAPE_AIRBRUSH, 30 | TOOL_SHAPE_PENCIL, 31 | TOOL_SHAPE_ERASER, 32 | AUTO_CENTER_POSITION, 33 | CAST_SHADOW, 34 | BAKE_HEIGHT_MAP, 35 | GLOBAL_PARAMETERS, 36 | CLEAR_ALL, 37 | HELP_ABOUT, 38 | RECALCULATE_AABB, 39 | } 40 | 41 | enum MENU_SHAPE_ID { 42 | TOOL_SHAPE_SPHERE, 43 | TOOL_SHAPE_CYLINDER, 44 | TOOL_SHAPE_CYLINDER_INF_H, 45 | TOOL_SHAPE_BOX, 46 | TOOL_SHAPE_BOX_INF_H, 47 | } 48 | 49 | var _plugin: EditorPlugin = null 50 | var _grass_selected = null 51 | var _tools_menu: PopupMenu = null 52 | var _airbrush_shape_menu: PopupMenu = null 53 | var _pencil_shape_menu: PopupMenu = null 54 | var _eraser_shape_menu: PopupMenu = null 55 | 56 | 57 | func set_plugin(plugin :EditorPlugin) -> void: 58 | var popup := get_popup() 59 | _plugin = plugin 60 | _airbrush_shape_menu = PopupMenu.new() 61 | _airbrush_shape_menu.name = &"AirbrushShapeMenu" 62 | _airbrush_shape_menu.add_radio_check_item("Cylinder", MENU_SHAPE_ID.TOOL_SHAPE_CYLINDER) 63 | _airbrush_shape_menu.add_radio_check_item("Box", MENU_SHAPE_ID.TOOL_SHAPE_BOX) 64 | _pencil_shape_menu = PopupMenu.new() 65 | _pencil_shape_menu.name = &"PencilShapeMenu" 66 | _pencil_shape_menu.add_radio_check_item("Cylinder", MENU_SHAPE_ID.TOOL_SHAPE_CYLINDER) 67 | _pencil_shape_menu.add_radio_check_item("Box", MENU_SHAPE_ID.TOOL_SHAPE_BOX) 68 | _eraser_shape_menu = PopupMenu.new() 69 | _eraser_shape_menu.name = &"EraserShapeMenu" 70 | _eraser_shape_menu.add_radio_check_item("Sphere", MENU_SHAPE_ID.TOOL_SHAPE_SPHERE) 71 | _eraser_shape_menu.add_radio_check_item("Cylinder", MENU_SHAPE_ID.TOOL_SHAPE_CYLINDER) 72 | _eraser_shape_menu.add_radio_check_item("Infinite vertical cylinder", MENU_SHAPE_ID.TOOL_SHAPE_CYLINDER_INF_H) 73 | _eraser_shape_menu.add_radio_check_item("Box", MENU_SHAPE_ID.TOOL_SHAPE_BOX) 74 | _eraser_shape_menu.add_radio_check_item("Infinite vertical box", MENU_SHAPE_ID.TOOL_SHAPE_BOX_INF_H) 75 | _tools_menu = PopupMenu.new() 76 | _tools_menu.add_child(_airbrush_shape_menu) 77 | _tools_menu.add_child(_pencil_shape_menu) 78 | _tools_menu.add_child(_eraser_shape_menu) 79 | _tools_menu.name = &"ToolsMenu" 80 | _tools_menu.add_check_item("Follow terrain's normal", MENU_ID.TOOL_FOLLOW_NORMAL) 81 | _tools_menu.add_submenu_item("Airbrush shape", "AirbrushShapeMenu") 82 | _tools_menu.add_submenu_item("Pencil shape", "PencilShapeMenu") 83 | _tools_menu.add_submenu_item("Eraser shape", "EraserShapeMenu") 84 | popup.add_child(_tools_menu) 85 | popup.clear() 86 | popup.add_submenu_item("Tools", "ToolsMenu") 87 | popup.add_separator() 88 | popup.add_item("Auto center position", MENU_ID.AUTO_CENTER_POSITION) 89 | popup.add_item("Recalculate custom AABB", MENU_ID.RECALCULATE_AABB) 90 | popup.add_item("Bake height map", MENU_ID.BAKE_HEIGHT_MAP) 91 | popup.add_check_item("Cast shadow", MENU_ID.CAST_SHADOW) 92 | popup.add_item("Global parameters", MENU_ID.GLOBAL_PARAMETERS) 93 | popup.add_separator() 94 | popup.add_item("Clear all", MENU_ID.CLEAR_ALL) 95 | popup.add_separator() 96 | popup.add_item("About SimpleGrassTextured", MENU_ID.HELP_ABOUT) 97 | popup.id_pressed.connect(_on_sgt_menu_button) 98 | _tools_menu.id_pressed.connect(_on_sgt_tools_menu_button) 99 | _airbrush_shape_menu.id_pressed.connect(_on_sgt_shape_menu_pressed.bind("airbrush", _airbrush_shape_menu)) 100 | _pencil_shape_menu.id_pressed.connect(_on_sgt_shape_menu_pressed.bind("pencil", _pencil_shape_menu)) 101 | _eraser_shape_menu.id_pressed.connect(_on_sgt_shape_menu_pressed.bind("eraser", _eraser_shape_menu)) 102 | about_to_popup.connect(_on_about_to_popup) 103 | 104 | 105 | func set_current_grass(grass_selected) -> void: 106 | _grass_selected = grass_selected 107 | if grass_selected == null: 108 | return 109 | var popup := get_popup() 110 | if grass_selected.cast_shadow == GeometryInstance3D.SHADOW_CASTING_SETTING_OFF: 111 | popup.set_item_checked(popup.get_item_index(MENU_ID.CAST_SHADOW), false) 112 | else: 113 | popup.set_item_checked(popup.get_item_index(MENU_ID.CAST_SHADOW), true) 114 | if _grass_selected.baked_height_map != null: 115 | popup.set_item_text(popup.get_item_index(MENU_ID.BAKE_HEIGHT_MAP), "Bake height map (already baked)") 116 | popup.set_item_disabled(popup.get_item_index(MENU_ID.BAKE_HEIGHT_MAP), true) 117 | else: 118 | popup.set_item_text(popup.get_item_index(MENU_ID.BAKE_HEIGHT_MAP), "Bake height map") 119 | popup.set_item_disabled(popup.get_item_index(MENU_ID.BAKE_HEIGHT_MAP), false) 120 | _tools_menu.set_item_checked(_tools_menu.get_item_index(MENU_ID.TOOL_FOLLOW_NORMAL), _grass_selected.sgt_follow_normal) 121 | for tool_name in _grass_selected.sgt_tool_shape: 122 | match tool_name: 123 | "airbrush": 124 | _update_shape_menu_from_grass(_airbrush_shape_menu, _grass_selected.sgt_tool_shape[tool_name]) 125 | "pencil": 126 | _update_shape_menu_from_grass(_pencil_shape_menu, _grass_selected.sgt_tool_shape[tool_name]) 127 | "eraser": 128 | _update_shape_menu_from_grass(_eraser_shape_menu, _grass_selected.sgt_tool_shape[tool_name]) 129 | 130 | 131 | func _update_shape_menu_from_grass(popupmenu: PopupMenu, plugin_id_shape: int) -> void: 132 | for i in popupmenu.item_count: 133 | popupmenu.set_item_checked(i, false) 134 | var idx := -1 135 | match _plugin.get_tool_shape_name(plugin_id_shape): 136 | "sphere": 137 | idx = popupmenu.get_item_index(MENU_SHAPE_ID.TOOL_SHAPE_SPHERE) 138 | "cylinder": 139 | idx = popupmenu.get_item_index(MENU_SHAPE_ID.TOOL_SHAPE_CYLINDER) 140 | "cylinder_inf_h": 141 | idx = popupmenu.get_item_index(MENU_SHAPE_ID.TOOL_SHAPE_CYLINDER_INF_H) 142 | "box": 143 | idx = popupmenu.get_item_index(MENU_SHAPE_ID.TOOL_SHAPE_BOX) 144 | "box_inf_h": 145 | idx = popupmenu.get_item_index(MENU_SHAPE_ID.TOOL_SHAPE_BOX_INF_H) 146 | _: 147 | idx = -1 148 | if idx == -1: 149 | return 150 | popupmenu.set_item_checked(idx, true) 151 | 152 | 153 | func _on_sgt_menu_button(id :int) -> void: 154 | if _grass_selected == null: 155 | return 156 | match id: 157 | MENU_ID.AUTO_CENTER_POSITION: 158 | _plugin.get_undo_redo().create_action(_grass_selected.name + " Auto Center Position") 159 | _plugin.get_undo_redo().add_undo_property(_grass_selected, &"baked_height_map", _grass_selected.baked_height_map) 160 | _plugin.get_undo_redo().add_undo_property(_grass_selected, &"multimesh", _grass_selected.multimesh) 161 | _plugin.get_undo_redo().add_undo_property(_grass_selected, &"global_position", _grass_selected.global_position) 162 | _grass_selected.auto_center_position() 163 | _plugin.get_undo_redo().add_do_property(_grass_selected, &"baked_height_map", _grass_selected.baked_height_map) 164 | _plugin.get_undo_redo().add_do_property(_grass_selected, &"multimesh", _grass_selected.multimesh) 165 | _plugin.get_undo_redo().add_do_property(_grass_selected, &"global_position", _grass_selected.global_position) 166 | _plugin.get_undo_redo().commit_action() 167 | MENU_ID.RECALCULATE_AABB: 168 | _plugin.get_undo_redo().create_action(_grass_selected.name + " Recalculate Custom AABB") 169 | _plugin.get_undo_redo().add_undo_property(_grass_selected, &"custom_aabb", _grass_selected.custom_aabb) 170 | _grass_selected.recalculate_custom_aabb() 171 | _plugin.get_undo_redo().add_do_property(_grass_selected, &"custom_aabb", _grass_selected.custom_aabb) 172 | _plugin.get_undo_redo().commit_action() 173 | MENU_ID.CAST_SHADOW: 174 | _plugin.get_undo_redo().create_action(_grass_selected.name + " Toogle Cast Shadow") 175 | _plugin.get_undo_redo().add_undo_property(_grass_selected, &"cast_shadow", _grass_selected.cast_shadow) 176 | for child in _grass_selected.get_children(): 177 | if child.has_meta(&"SimpleGrassTexturedRegion"): 178 | _plugin.get_undo_redo().add_undo_property(child, &"cast_shadow", child.cast_shadow) 179 | if _grass_selected.cast_shadow == GeometryInstance3D.SHADOW_CASTING_SETTING_OFF: 180 | _grass_selected.cast_shadow = GeometryInstance3D.SHADOW_CASTING_SETTING_ON 181 | else: 182 | _grass_selected.cast_shadow = GeometryInstance3D.SHADOW_CASTING_SETTING_OFF 183 | _plugin.get_undo_redo().add_do_property(_grass_selected, &"cast_shadow", _grass_selected.cast_shadow) 184 | for child in _grass_selected.get_children(): 185 | if child.has_meta(&"SimpleGrassTexturedRegion"): 186 | child.cast_shadow = _grass_selected.cast_shadow 187 | _plugin.get_undo_redo().add_do_property(child, &"cast_shadow", child.cast_shadow) 188 | _plugin.get_undo_redo().commit_action() 189 | MENU_ID.BAKE_HEIGHT_MAP: 190 | _grass_selected.bake_height_map() 191 | MENU_ID.GLOBAL_PARAMETERS: 192 | var _global_parameters = load("res://addons/simplegrasstextured/gui/global_parameters.tscn").instantiate() 193 | get_window().add_child(_global_parameters) 194 | _global_parameters.popup_centered() 195 | MENU_ID.CLEAR_ALL: 196 | var win = load("res://addons/simplegrasstextured/gui/clear_all_confirmation_dialog.tscn").instantiate() 197 | get_window().add_child(win) 198 | win.confirmed.connect(_on_clear_all_confirmation_dialog_confirmed) 199 | win.popup_centered() 200 | MENU_ID.HELP_ABOUT: 201 | var win = load("res://addons/simplegrasstextured/gui/about.tscn").instantiate() 202 | get_window().add_child(win) 203 | win.popup_centered() 204 | 205 | 206 | func _on_sgt_tools_menu_button(id :int) -> void: 207 | if _grass_selected == null: 208 | return 209 | match id: 210 | MENU_ID.TOOL_FOLLOW_NORMAL: 211 | var idx := _tools_menu.get_item_index(id) 212 | _tools_menu.set_item_checked(idx, not _tools_menu.is_item_checked(idx)) 213 | _grass_selected.sgt_follow_normal = _tools_menu.is_item_checked(idx) 214 | 215 | 216 | func _on_sgt_shape_menu_pressed(id: int, tool_name: String, popupmenu: PopupMenu) -> void: 217 | if _grass_selected == null: 218 | return 219 | for i in popupmenu.item_count: 220 | popupmenu.set_item_checked(i, false) 221 | var idx := popupmenu.get_item_index(id) 222 | if idx == -1: 223 | return 224 | popupmenu.set_item_checked(idx, true) 225 | var shape_name := "" 226 | match id: 227 | MENU_SHAPE_ID.TOOL_SHAPE_SPHERE: 228 | shape_name = "sphere" 229 | MENU_SHAPE_ID.TOOL_SHAPE_CYLINDER: 230 | shape_name = "cylinder" 231 | MENU_SHAPE_ID.TOOL_SHAPE_CYLINDER_INF_H: 232 | shape_name = "cylinder_inf_h" 233 | MENU_SHAPE_ID.TOOL_SHAPE_BOX: 234 | shape_name = "box" 235 | MENU_SHAPE_ID.TOOL_SHAPE_BOX_INF_H: 236 | shape_name = "box_inf_h" 237 | _plugin.set_tool_shape(tool_name, shape_name) 238 | 239 | 240 | func _on_about_to_popup() -> void: 241 | set_current_grass(_grass_selected) 242 | 243 | 244 | func _on_clear_all_confirmation_dialog_confirmed() -> void: 245 | if _grass_selected == null: 246 | return 247 | _plugin.get_undo_redo().create_action(_grass_selected.name + " Clear All Grass") 248 | _plugin.get_undo_redo().add_undo_property(_grass_selected, &"baked_height_map", _grass_selected.baked_height_map) 249 | _plugin.get_undo_redo().add_undo_property(_grass_selected, &"multimesh", _grass_selected.multimesh) 250 | _grass_selected.clear_all() 251 | _plugin.get_undo_redo().add_do_property(_grass_selected, &"baked_height_map", _grass_selected.baked_height_map) 252 | _plugin.get_undo_redo().add_do_property(_grass_selected, &"multimesh", _grass_selected.multimesh) 253 | _plugin.get_undo_redo().commit_action() 254 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/gui/toolbar_menu.gd.uid: -------------------------------------------------------------------------------- 1 | uid://bk4wcnwns36qk 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/gui/toolbar_menu.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=3 uid="uid://der2mmxtog2mt"] 2 | 3 | [ext_resource type="Script" uid="uid://bk4wcnwns36qk" path="res://addons/simplegrasstextured/gui/toolbar_menu.gd" id="1_mmgcy"] 4 | 5 | [node name="ToolbarMenu" type="MenuButton"] 6 | item_count = 11 7 | popup/item_0/text = "Tools" 8 | popup/item_0/id = 0 9 | popup/item_1/id = -1 10 | popup/item_1/separator = true 11 | popup/item_2/text = "Auto center position" 12 | popup/item_2/id = 1 13 | popup/item_3/text = "Recalculate custom AABB" 14 | popup/item_3/id = 7 15 | popup/item_4/text = "Bake height map" 16 | popup/item_4/checkable = 1 17 | popup/item_4/id = 3 18 | popup/item_5/text = "Cast shadow" 19 | popup/item_5/checkable = 1 20 | popup/item_5/id = 2 21 | popup/item_6/text = "Global parameters" 22 | popup/item_6/id = 4 23 | popup/item_7/id = -1 24 | popup/item_7/separator = true 25 | popup/item_8/text = "Clear all" 26 | popup/item_8/id = 5 27 | popup/item_9/id = -1 28 | popup/item_9/separator = true 29 | popup/item_10/text = "About SimpleGrassTextured" 30 | popup/item_10/id = 6 31 | script = ExtResource("1_mmgcy") 32 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/gui/toolbar_up.gd: -------------------------------------------------------------------------------- 1 | # toolbar_up.gd 2 | # This file is part of: SimpleGrassTextured 3 | # Copyright (c) 2023 IcterusGames 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining 6 | # a copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be 14 | # included in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | @tool 25 | extends Control 26 | 27 | 28 | func set_plugin(plugin :EditorPlugin) -> void: 29 | $MenuButton.set_plugin(plugin) 30 | 31 | 32 | func set_current_grass(grass) -> void: 33 | $MenuButton.set_current_grass(grass) 34 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/gui/toolbar_up.gd.uid: -------------------------------------------------------------------------------- 1 | uid://cdfq5jjtnlcwg 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/gui/toolbar_up.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=3 uid="uid://bfy4swcp2kwpq"] 2 | 3 | [ext_resource type="Script" uid="uid://cdfq5jjtnlcwg" path="res://addons/simplegrasstextured/gui/toolbar_up.gd" id="1_h2433"] 4 | [ext_resource type="Texture2D" uid="uid://bsmcpupaj02v8" path="res://addons/simplegrasstextured/sgt_icon.svg" id="3_637xa"] 5 | [ext_resource type="PackedScene" uid="uid://der2mmxtog2mt" path="res://addons/simplegrasstextured/gui/toolbar_menu.tscn" id="3_suvo1"] 6 | 7 | [node name="SGTToolbarUp" type="HBoxContainer"] 8 | anchors_preset = 10 9 | anchor_right = 1.0 10 | grow_horizontal = 2 11 | script = ExtResource("1_h2433") 12 | 13 | [node name="MenuButton" parent="." instance=ExtResource("3_suvo1")] 14 | layout_mode = 2 15 | text = "SimpleGrassTextured" 16 | icon = ExtResource("3_637xa") 17 | switch_on_hover = true 18 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/motion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IcterusGames/SimpleGrassTextured/4d72e6258da612b707f22dc173f4278864599b2e/addons/simplegrasstextured/images/motion.png -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/motion.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://dk6rqq2wmb45o" 6 | path.s3tc="res://.godot/imported/motion.png-ac3355e19edb929f8c8fd048d57b67cc.s3tc.ctex" 7 | metadata={ 8 | "imported_formats": ["s3tc_bptc"], 9 | "vram_texture": true 10 | } 11 | 12 | [deps] 13 | 14 | source_file="res://addons/simplegrasstextured/images/motion.png" 15 | dest_files=["res://.godot/imported/motion.png-ac3355e19edb929f8c8fd048d57b67cc.s3tc.ctex"] 16 | 17 | [params] 18 | 19 | compress/mode=2 20 | compress/high_quality=false 21 | compress/lossy_quality=0.7 22 | compress/hdr_compression=1 23 | compress/normal_map=1 24 | compress/channel_pack=0 25 | mipmaps/generate=true 26 | mipmaps/limit=-1 27 | roughness/mode=7 28 | roughness/src_normal="res://textures/fern_normal.tga" 29 | process/fix_alpha_border=true 30 | process/premult_alpha=false 31 | process/normal_map_invert_y=false 32 | process/hdr_as_srgb=false 33 | process/hdr_clamp_exposure=false 34 | process/size_limit=0 35 | detect_3d/compress_to=0 36 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/motion_frame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IcterusGames/SimpleGrassTextured/4d72e6258da612b707f22dc173f4278864599b2e/addons/simplegrasstextured/images/motion_frame.png -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/motion_frame.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://bovwvrkiruiat" 6 | path="res://.godot/imported/motion_frame.png-9de9ce804cbe9c1e551304fef14b5bcc.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/simplegrasstextured/images/motion_frame.png" 14 | dest_files=["res://.godot/imported/motion_frame.png-9de9ce804cbe9c1e551304fef14b5bcc.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=false 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=0 35 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IcterusGames/SimpleGrassTextured/4d72e6258da612b707f22dc173f4278864599b2e/addons/simplegrasstextured/images/normal.png -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/normal.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://cho4etu1eahnx" 6 | path="res://.godot/imported/normal.png-3aae11463fd3b57390bff030445d49dc.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/simplegrasstextured/images/normal.png" 14 | dest_files=["res://.godot/imported/normal.png-3aae11463fd3b57390bff030445d49dc.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=2 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="res://textures/fern_normal.tga" 28 | process/fix_alpha_border=false 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=0 35 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/normal_frame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IcterusGames/SimpleGrassTextured/4d72e6258da612b707f22dc173f4278864599b2e/addons/simplegrasstextured/images/normal_frame.png -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/normal_frame.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://m77dlrqfdeef" 6 | path="res://.godot/imported/normal_frame.png-be2572e361af9089032fcc292b3b150e.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/simplegrasstextured/images/normal_frame.png" 14 | dest_files=["res://.godot/imported/normal_frame.png-be2572e361af9089032fcc292b3b150e.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=false 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=0 35 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/pointer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IcterusGames/SimpleGrassTextured/4d72e6258da612b707f22dc173f4278864599b2e/addons/simplegrasstextured/images/pointer.png -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/pointer.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://35qfdmr0xvq3" 6 | path="res://.godot/imported/pointer.png-292374924e7ba5a25097927bb55f262e.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/simplegrasstextured/images/pointer.png" 14 | dest_files=["res://.godot/imported/pointer.png-292374924e7ba5a25097927bb55f262e.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/pointer_rect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IcterusGames/SimpleGrassTextured/4d72e6258da612b707f22dc173f4278864599b2e/addons/simplegrasstextured/images/pointer_rect.png -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/pointer_rect.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://bianpj3vn603i" 6 | path="res://.godot/imported/pointer_rect.png-44cc567cfff567b7aef3c6a89033a7fa.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/simplegrasstextured/images/pointer_rect.png" 14 | dest_files=["res://.godot/imported/pointer_rect.png-44cc567cfff567b7aef3c6a89033a7fa.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_airbrush.svg: -------------------------------------------------------------------------------- 1 | 2 | 14 | 16 | 35 | 38 | 39 | 44 | 49 | 53 | 54 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_airbrush.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://c2kunxv5wepih" 6 | path="res://.godot/imported/sgt_icon_airbrush.svg-fb575618de9fc813b83450db0db42f43.ctex" 7 | metadata={ 8 | "has_editor_variant": true, 9 | "vram_texture": false 10 | } 11 | 12 | [deps] 13 | 14 | source_file="res://addons/simplegrasstextured/images/sgt_icon_airbrush.svg" 15 | dest_files=["res://.godot/imported/sgt_icon_airbrush.svg-fb575618de9fc813b83450db0db42f43.ctex"] 16 | 17 | [params] 18 | 19 | compress/mode=0 20 | compress/high_quality=false 21 | compress/lossy_quality=0.7 22 | compress/hdr_compression=1 23 | compress/normal_map=0 24 | compress/channel_pack=0 25 | mipmaps/generate=false 26 | mipmaps/limit=-1 27 | roughness/mode=0 28 | roughness/src_normal="" 29 | process/fix_alpha_border=true 30 | process/premult_alpha=false 31 | process/normal_map_invert_y=false 32 | process/hdr_as_srgb=false 33 | process/hdr_clamp_exposure=false 34 | process/size_limit=0 35 | detect_3d/compress_to=1 36 | svg/scale=1.0 37 | editor/scale_with_editor_scale=true 38 | editor/convert_colors_with_editor_theme=false 39 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_airbrush_dark.svg: -------------------------------------------------------------------------------- 1 | 2 | 14 | 16 | 35 | 38 | 39 | 44 | 49 | 53 | 54 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_airbrush_dark.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://bx0eldcaeq06i" 6 | path="res://.godot/imported/sgt_icon_airbrush_dark.svg-5225c2c5467c46128914e641f3987ecb.ctex" 7 | metadata={ 8 | "has_editor_variant": true, 9 | "vram_texture": false 10 | } 11 | 12 | [deps] 13 | 14 | source_file="res://addons/simplegrasstextured/images/sgt_icon_airbrush_dark.svg" 15 | dest_files=["res://.godot/imported/sgt_icon_airbrush_dark.svg-5225c2c5467c46128914e641f3987ecb.ctex"] 16 | 17 | [params] 18 | 19 | compress/mode=0 20 | compress/high_quality=false 21 | compress/lossy_quality=0.7 22 | compress/hdr_compression=1 23 | compress/normal_map=0 24 | compress/channel_pack=0 25 | mipmaps/generate=false 26 | mipmaps/limit=-1 27 | roughness/mode=0 28 | roughness/src_normal="" 29 | process/fix_alpha_border=true 30 | process/premult_alpha=false 31 | process/normal_map_invert_y=false 32 | process/hdr_as_srgb=false 33 | process/hdr_clamp_exposure=false 34 | process/size_limit=0 35 | detect_3d/compress_to=1 36 | svg/scale=1.0 37 | editor/scale_with_editor_scale=true 38 | editor/convert_colors_with_editor_theme=false 39 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_arrow_up.svg: -------------------------------------------------------------------------------- 1 | 2 | 14 | 16 | 35 | 40 | 41 | 46 | 47 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_arrow_up.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://bda52g6s88x5d" 6 | path="res://.godot/imported/sgt_icon_arrow_up.svg-43e0412f6c6d1db6334668717d304875.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/simplegrasstextured/images/sgt_icon_arrow_up.svg" 14 | dest_files=["res://.godot/imported/sgt_icon_arrow_up.svg-43e0412f6c6d1db6334668717d304875.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | svg/scale=1.0 36 | editor/scale_with_editor_scale=false 37 | editor/convert_colors_with_editor_theme=false 38 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_arrow_up_dark.svg: -------------------------------------------------------------------------------- 1 | 2 | 14 | 16 | 35 | 40 | 41 | 46 | 47 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_arrow_up_dark.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://d3br7bufrmi53" 6 | path="res://.godot/imported/sgt_icon_arrow_up_dark.svg-e4923556b0287e0e1b572ab51887d9b2.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/simplegrasstextured/images/sgt_icon_arrow_up_dark.svg" 14 | dest_files=["res://.godot/imported/sgt_icon_arrow_up_dark.svg-e4923556b0287e0e1b572ab51887d9b2.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | svg/scale=1.0 36 | editor/scale_with_editor_scale=false 37 | editor/convert_colors_with_editor_theme=false 38 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_density.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_density.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://tqiak77omdnr" 6 | path="res://.godot/imported/sgt_icon_density.svg-9c44dd38d1d502aa0cebccf5e2c9d3d3.ctex" 7 | metadata={ 8 | "has_editor_variant": true, 9 | "vram_texture": false 10 | } 11 | 12 | [deps] 13 | 14 | source_file="res://addons/simplegrasstextured/images/sgt_icon_density.svg" 15 | dest_files=["res://.godot/imported/sgt_icon_density.svg-9c44dd38d1d502aa0cebccf5e2c9d3d3.ctex"] 16 | 17 | [params] 18 | 19 | compress/mode=0 20 | compress/high_quality=false 21 | compress/lossy_quality=0.7 22 | compress/hdr_compression=1 23 | compress/normal_map=0 24 | compress/channel_pack=0 25 | mipmaps/generate=false 26 | mipmaps/limit=-1 27 | roughness/mode=0 28 | roughness/src_normal="" 29 | process/fix_alpha_border=true 30 | process/premult_alpha=false 31 | process/normal_map_invert_y=false 32 | process/hdr_as_srgb=false 33 | process/hdr_clamp_exposure=false 34 | process/size_limit=0 35 | detect_3d/compress_to=0 36 | svg/scale=1.0 37 | editor/scale_with_editor_scale=true 38 | editor/convert_colors_with_editor_theme=false 39 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_density_dark.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 44 | 47 | 48 | 50 | 58 | 63 | 64 | 72 | 77 | 78 | 86 | 91 | 92 | 100 | 105 | 106 | 107 | 111 | 117 | 123 | 129 | 135 | 141 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_density_dark.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://laar7ny28dqe" 6 | path="res://.godot/imported/sgt_icon_density_dark.svg-c4782bd2e0aa1f3996b84f700be97f61.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/simplegrasstextured/images/sgt_icon_density_dark.svg" 14 | dest_files=["res://.godot/imported/sgt_icon_density_dark.svg-c4782bd2e0aa1f3996b84f700be97f61.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | svg/scale=1.0 36 | editor/scale_with_editor_scale=false 37 | editor/convert_colors_with_editor_theme=false 38 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_distance.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_distance.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://d28dlfkm62t6e" 6 | path="res://.godot/imported/sgt_icon_distance.svg-77e66b67426f6dd1ba80a0a28564d425.ctex" 7 | metadata={ 8 | "has_editor_variant": true, 9 | "vram_texture": false 10 | } 11 | 12 | [deps] 13 | 14 | source_file="res://addons/simplegrasstextured/images/sgt_icon_distance.svg" 15 | dest_files=["res://.godot/imported/sgt_icon_distance.svg-77e66b67426f6dd1ba80a0a28564d425.ctex"] 16 | 17 | [params] 18 | 19 | compress/mode=0 20 | compress/high_quality=false 21 | compress/lossy_quality=0.7 22 | compress/hdr_compression=1 23 | compress/normal_map=0 24 | compress/channel_pack=0 25 | mipmaps/generate=false 26 | mipmaps/limit=-1 27 | roughness/mode=0 28 | roughness/src_normal="" 29 | process/fix_alpha_border=true 30 | process/premult_alpha=false 31 | process/normal_map_invert_y=false 32 | process/hdr_as_srgb=false 33 | process/hdr_clamp_exposure=false 34 | process/size_limit=0 35 | detect_3d/compress_to=0 36 | svg/scale=1.0 37 | editor/scale_with_editor_scale=true 38 | editor/convert_colors_with_editor_theme=false 39 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_distance_dark.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 44 | 51 | 52 | 54 | 62 | 67 | 68 | 76 | 81 | 82 | 90 | 95 | 96 | 104 | 109 | 110 | 111 | 115 | 119 | 123 | 128 | 133 | 138 | 139 | 140 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_distance_dark.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://dji5ff3k0qrgj" 6 | path="res://.godot/imported/sgt_icon_distance_dark.svg-b4abdf7bea37b691aed1d750518c30f6.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/simplegrasstextured/images/sgt_icon_distance_dark.svg" 14 | dest_files=["res://.godot/imported/sgt_icon_distance_dark.svg-b4abdf7bea37b691aed1d750518c30f6.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | svg/scale=1.0 36 | editor/scale_with_editor_scale=false 37 | editor/convert_colors_with_editor_theme=false 38 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_eraser.svg: -------------------------------------------------------------------------------- 1 | 2 | 14 | 16 | 35 | 40 | 41 | 46 | 51 | 56 | 58 | 63 | 64 | 68 | 69 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_eraser.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://brugf6rnck1tk" 6 | path="res://.godot/imported/sgt_icon_eraser.svg-e97e67f5b13a9a2f6e85bac1e1474a98.ctex" 7 | metadata={ 8 | "has_editor_variant": true, 9 | "vram_texture": false 10 | } 11 | 12 | [deps] 13 | 14 | source_file="res://addons/simplegrasstextured/images/sgt_icon_eraser.svg" 15 | dest_files=["res://.godot/imported/sgt_icon_eraser.svg-e97e67f5b13a9a2f6e85bac1e1474a98.ctex"] 16 | 17 | [params] 18 | 19 | compress/mode=0 20 | compress/high_quality=false 21 | compress/lossy_quality=0.7 22 | compress/hdr_compression=1 23 | compress/normal_map=0 24 | compress/channel_pack=0 25 | mipmaps/generate=false 26 | mipmaps/limit=-1 27 | roughness/mode=0 28 | roughness/src_normal="" 29 | process/fix_alpha_border=true 30 | process/premult_alpha=false 31 | process/normal_map_invert_y=false 32 | process/hdr_as_srgb=false 33 | process/hdr_clamp_exposure=false 34 | process/size_limit=0 35 | detect_3d/compress_to=1 36 | svg/scale=1.0 37 | editor/scale_with_editor_scale=true 38 | editor/convert_colors_with_editor_theme=false 39 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_eraser_dark.svg: -------------------------------------------------------------------------------- 1 | 2 | 14 | 16 | 35 | 40 | 41 | 46 | 51 | 56 | 59 | 64 | 65 | 69 | 70 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_eraser_dark.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://cig4ev2rdad8h" 6 | path="res://.godot/imported/sgt_icon_eraser_dark.svg-343cd82d6b551fa833c0dca85237188a.ctex" 7 | metadata={ 8 | "has_editor_variant": true, 9 | "vram_texture": false 10 | } 11 | 12 | [deps] 13 | 14 | source_file="res://addons/simplegrasstextured/images/sgt_icon_eraser_dark.svg" 15 | dest_files=["res://.godot/imported/sgt_icon_eraser_dark.svg-343cd82d6b551fa833c0dca85237188a.ctex"] 16 | 17 | [params] 18 | 19 | compress/mode=0 20 | compress/high_quality=false 21 | compress/lossy_quality=0.7 22 | compress/hdr_compression=1 23 | compress/normal_map=0 24 | compress/channel_pack=0 25 | mipmaps/generate=false 26 | mipmaps/limit=-1 27 | roughness/mode=0 28 | roughness/src_normal="" 29 | process/fix_alpha_border=true 30 | process/premult_alpha=false 31 | process/normal_map_invert_y=false 32 | process/hdr_as_srgb=false 33 | process/hdr_clamp_exposure=false 34 | process/size_limit=0 35 | detect_3d/compress_to=1 36 | svg/scale=1.0 37 | editor/scale_with_editor_scale=true 38 | editor/convert_colors_with_editor_theme=false 39 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_pen.svg: -------------------------------------------------------------------------------- 1 | 2 | 14 | 16 | 35 | 38 | 39 | 44 | 49 | 50 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_pen.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://dtal42g10x1ay" 6 | path="res://.godot/imported/sgt_icon_pen.svg-c2f5516279abcab0d8d8d2c717868248.ctex" 7 | metadata={ 8 | "has_editor_variant": true, 9 | "vram_texture": false 10 | } 11 | 12 | [deps] 13 | 14 | source_file="res://addons/simplegrasstextured/images/sgt_icon_pen.svg" 15 | dest_files=["res://.godot/imported/sgt_icon_pen.svg-c2f5516279abcab0d8d8d2c717868248.ctex"] 16 | 17 | [params] 18 | 19 | compress/mode=0 20 | compress/high_quality=false 21 | compress/lossy_quality=0.7 22 | compress/hdr_compression=1 23 | compress/normal_map=0 24 | compress/channel_pack=0 25 | mipmaps/generate=false 26 | mipmaps/limit=-1 27 | roughness/mode=0 28 | roughness/src_normal="" 29 | process/fix_alpha_border=true 30 | process/premult_alpha=false 31 | process/normal_map_invert_y=false 32 | process/hdr_as_srgb=false 33 | process/hdr_clamp_exposure=false 34 | process/size_limit=0 35 | detect_3d/compress_to=1 36 | svg/scale=1.0 37 | editor/scale_with_editor_scale=true 38 | editor/convert_colors_with_editor_theme=false 39 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_pen_dark.svg: -------------------------------------------------------------------------------- 1 | 2 | 14 | 16 | 35 | 38 | 39 | 44 | 49 | 50 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_pen_dark.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://toenq726k1ir" 6 | path="res://.godot/imported/sgt_icon_pen_dark.svg-a5711368f0cbd52073eb63daeaabd1ee.ctex" 7 | metadata={ 8 | "has_editor_variant": true, 9 | "vram_texture": false 10 | } 11 | 12 | [deps] 13 | 14 | source_file="res://addons/simplegrasstextured/images/sgt_icon_pen_dark.svg" 15 | dest_files=["res://.godot/imported/sgt_icon_pen_dark.svg-a5711368f0cbd52073eb63daeaabd1ee.ctex"] 16 | 17 | [params] 18 | 19 | compress/mode=0 20 | compress/high_quality=false 21 | compress/lossy_quality=0.7 22 | compress/hdr_compression=1 23 | compress/normal_map=0 24 | compress/channel_pack=0 25 | mipmaps/generate=false 26 | mipmaps/limit=-1 27 | roughness/mode=0 28 | roughness/src_normal="" 29 | process/fix_alpha_border=true 30 | process/premult_alpha=false 31 | process/normal_map_invert_y=false 32 | process/hdr_as_srgb=false 33 | process/hdr_clamp_exposure=false 34 | process/size_limit=0 35 | detect_3d/compress_to=1 36 | svg/scale=1.0 37 | editor/scale_with_editor_scale=true 38 | editor/convert_colors_with_editor_theme=false 39 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_radius.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_radius.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://clm6vd2es8xm7" 6 | path="res://.godot/imported/sgt_icon_radius.svg-e958950c7ee38ebcf9793340191c6248.ctex" 7 | metadata={ 8 | "has_editor_variant": true, 9 | "vram_texture": false 10 | } 11 | 12 | [deps] 13 | 14 | source_file="res://addons/simplegrasstextured/images/sgt_icon_radius.svg" 15 | dest_files=["res://.godot/imported/sgt_icon_radius.svg-e958950c7ee38ebcf9793340191c6248.ctex"] 16 | 17 | [params] 18 | 19 | compress/mode=0 20 | compress/high_quality=false 21 | compress/lossy_quality=0.7 22 | compress/hdr_compression=1 23 | compress/normal_map=0 24 | compress/channel_pack=0 25 | mipmaps/generate=false 26 | mipmaps/limit=-1 27 | roughness/mode=0 28 | roughness/src_normal="" 29 | process/fix_alpha_border=true 30 | process/premult_alpha=false 31 | process/normal_map_invert_y=false 32 | process/hdr_as_srgb=false 33 | process/hdr_clamp_exposure=false 34 | process/size_limit=0 35 | detect_3d/compress_to=0 36 | svg/scale=1.0 37 | editor/scale_with_editor_scale=true 38 | editor/convert_colors_with_editor_theme=false 39 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_radius_dark.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 43 | 46 | 47 | 49 | 57 | 62 | 63 | 71 | 76 | 77 | 85 | 90 | 91 | 99 | 104 | 105 | 106 | 110 | 123 | 130 | 138 | 146 | 147 | 148 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_radius_dark.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://ie4tguvft6x6" 6 | path="res://.godot/imported/sgt_icon_radius_dark.svg-ea6d9b3ce54dd74a1591724bc7148489.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/simplegrasstextured/images/sgt_icon_radius_dark.svg" 14 | dest_files=["res://.godot/imported/sgt_icon_radius_dark.svg-ea6d9b3ce54dd74a1591724bc7148489.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | svg/scale=1.0 36 | editor/scale_with_editor_scale=false 37 | editor/convert_colors_with_editor_theme=false 38 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_slope.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_slope.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://24avwtyvf01r" 6 | path="res://.godot/imported/sgt_icon_slope.svg-8e8415d31ce58509819b0e249773a098.ctex" 7 | metadata={ 8 | "has_editor_variant": true, 9 | "vram_texture": false 10 | } 11 | 12 | [deps] 13 | 14 | source_file="res://addons/simplegrasstextured/images/sgt_icon_slope.svg" 15 | dest_files=["res://.godot/imported/sgt_icon_slope.svg-8e8415d31ce58509819b0e249773a098.ctex"] 16 | 17 | [params] 18 | 19 | compress/mode=0 20 | compress/high_quality=false 21 | compress/lossy_quality=0.7 22 | compress/hdr_compression=1 23 | compress/normal_map=0 24 | compress/channel_pack=0 25 | mipmaps/generate=false 26 | mipmaps/limit=-1 27 | roughness/mode=0 28 | roughness/src_normal="" 29 | process/fix_alpha_border=true 30 | process/premult_alpha=false 31 | process/normal_map_invert_y=false 32 | process/hdr_as_srgb=false 33 | process/hdr_clamp_exposure=false 34 | process/size_limit=0 35 | detect_3d/compress_to=0 36 | svg/scale=1.0 37 | editor/scale_with_editor_scale=true 38 | editor/convert_colors_with_editor_theme=false 39 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_slope_dark.svg: -------------------------------------------------------------------------------- 1 | 2 | 14 | 16 | 35 | 38 | 39 | 44 | 48 | 53 | 54 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/sgt_icon_slope_dark.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://dde4j4w233rnv" 6 | path="res://.godot/imported/sgt_icon_slope_dark.svg-d0a7497efb4393f6bf2567a427bd889e.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/simplegrasstextured/images/sgt_icon_slope_dark.svg" 14 | dest_files=["res://.godot/imported/sgt_icon_slope_dark.svg-d0a7497efb4393f6bf2567a427bd889e.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | svg/scale=1.0 36 | editor/scale_with_editor_scale=false 37 | editor/convert_colors_with_editor_theme=false 38 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/wind_pattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IcterusGames/SimpleGrassTextured/4d72e6258da612b707f22dc173f4278864599b2e/addons/simplegrasstextured/images/wind_pattern.png -------------------------------------------------------------------------------- /addons/simplegrasstextured/images/wind_pattern.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://i566v0wqsfa" 6 | path.s3tc="res://.godot/imported/wind_pattern.png-414bc96d501e14f1400565420145e185.s3tc.ctex" 7 | metadata={ 8 | "imported_formats": ["s3tc_bptc"], 9 | "vram_texture": true 10 | } 11 | 12 | [deps] 13 | 14 | source_file="res://addons/simplegrasstextured/images/wind_pattern.png" 15 | dest_files=["res://.godot/imported/wind_pattern.png-414bc96d501e14f1400565420145e185.s3tc.ctex"] 16 | 17 | [params] 18 | 19 | compress/mode=2 20 | compress/high_quality=false 21 | compress/lossy_quality=0.7 22 | compress/hdr_compression=1 23 | compress/normal_map=0 24 | compress/channel_pack=0 25 | mipmaps/generate=true 26 | mipmaps/limit=-1 27 | roughness/mode=-3 28 | roughness/src_normal="res://textures/fern_normal.tga" 29 | process/fix_alpha_border=true 30 | process/premult_alpha=false 31 | process/normal_map_invert_y=false 32 | process/hdr_as_srgb=false 33 | process/hdr_clamp_exposure=false 34 | process/size_limit=0 35 | detect_3d/compress_to=0 36 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/materials/.gdignore: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/materials/grass.material: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IcterusGames/SimpleGrassTextured/4d72e6258da612b707f22dc173f4278864599b2e/addons/simplegrasstextured/materials/grass.material -------------------------------------------------------------------------------- /addons/simplegrasstextured/materials/icon.material: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IcterusGames/SimpleGrassTextured/4d72e6258da612b707f22dc173f4278864599b2e/addons/simplegrasstextured/materials/icon.material -------------------------------------------------------------------------------- /addons/simplegrasstextured/materials/position.material: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IcterusGames/SimpleGrassTextured/4d72e6258da612b707f22dc173f4278864599b2e/addons/simplegrasstextured/materials/position.material -------------------------------------------------------------------------------- /addons/simplegrasstextured/plugin.cfg: -------------------------------------------------------------------------------- 1 | [plugin] 2 | 3 | name="SimpleGrassTextured" 4 | description="Create simple grass textured" 5 | author="IcterusGames" 6 | version="2.0.8" 7 | script="plugin.gd" 8 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/plugin.gd.uid: -------------------------------------------------------------------------------- 1 | uid://60a3gi7u2kf 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/sgt_icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/sgt_icon.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://bsmcpupaj02v8" 6 | path="res://.godot/imported/sgt_icon.svg-b482cb8a790485e8c790170e86f09785.ctex" 7 | metadata={ 8 | "has_editor_variant": true, 9 | "vram_texture": false 10 | } 11 | 12 | [deps] 13 | 14 | source_file="res://addons/simplegrasstextured/sgt_icon.svg" 15 | dest_files=["res://.godot/imported/sgt_icon.svg-b482cb8a790485e8c790170e86f09785.ctex"] 16 | 17 | [params] 18 | 19 | compress/mode=0 20 | compress/high_quality=false 21 | compress/lossy_quality=0.7 22 | compress/hdr_compression=1 23 | compress/normal_map=0 24 | compress/channel_pack=0 25 | mipmaps/generate=false 26 | mipmaps/limit=-1 27 | roughness/mode=0 28 | roughness/src_normal="" 29 | process/fix_alpha_border=true 30 | process/premult_alpha=false 31 | process/normal_map_invert_y=false 32 | process/hdr_as_srgb=false 33 | process/hdr_clamp_exposure=false 34 | process/size_limit=0 35 | detect_3d/compress_to=0 36 | svg/scale=1.0 37 | editor/scale_with_editor_scale=true 38 | editor/convert_colors_with_editor_theme=false 39 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/sgt_icon_48.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/sgt_icon_48.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://cubr1a55brlfp" 6 | path="res://.godot/imported/sgt_icon_48.svg-9d7978c1835cd43fb6d195cc3fe6772f.ctex" 7 | metadata={ 8 | "has_editor_variant": true, 9 | "vram_texture": false 10 | } 11 | 12 | [deps] 13 | 14 | source_file="res://addons/simplegrasstextured/sgt_icon_48.svg" 15 | dest_files=["res://.godot/imported/sgt_icon_48.svg-9d7978c1835cd43fb6d195cc3fe6772f.ctex"] 16 | 17 | [params] 18 | 19 | compress/mode=0 20 | compress/high_quality=false 21 | compress/lossy_quality=0.7 22 | compress/hdr_compression=1 23 | compress/normal_map=0 24 | compress/channel_pack=0 25 | mipmaps/generate=false 26 | mipmaps/limit=-1 27 | roughness/mode=0 28 | roughness/src_normal="" 29 | process/fix_alpha_border=true 30 | process/premult_alpha=false 31 | process/normal_map_invert_y=false 32 | process/hdr_as_srgb=false 33 | process/hdr_clamp_exposure=false 34 | process/size_limit=0 35 | detect_3d/compress_to=0 36 | svg/scale=3.0 37 | editor/scale_with_editor_scale=true 38 | editor/convert_colors_with_editor_theme=false 39 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/sgt_inspector.gd: -------------------------------------------------------------------------------- 1 | # sgt_inspector.gd 2 | # This file is part of: SimpleGrassTextured 3 | # Copyright (c) 2023 IcterusGames 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining 6 | # a copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be 14 | # included in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | extends EditorInspectorPlugin 25 | 26 | 27 | func _can_handle(object: Object) -> bool: 28 | if object != null: 29 | if object.has_meta("SimpleGrassTextured"): 30 | return true 31 | return false 32 | 33 | 34 | func _parse_category(object: Object, category: String): 35 | if category != "grass.gd": 36 | return 37 | var hbox = HBoxContainer.new() 38 | var label := RichTextLabel.new() 39 | var button := Button.new() 40 | label.fit_content = true 41 | label.bbcode_enabled = true 42 | label.size_flags_horizontal = Control.SIZE_EXPAND_FILL 43 | label.text = "[b]by IcterusGames:[/b]" 44 | button.text = "About" 45 | button.size_flags_horizontal = Control.SIZE_EXPAND_FILL 46 | button.pressed.connect(_on_button_about_pressed.bind(button)) 47 | hbox.add_child(label) 48 | hbox.add_child(button) 49 | add_custom_control(hbox) 50 | 51 | 52 | func _on_button_about_pressed(button :Button): 53 | var win = load("res://addons/simplegrasstextured/gui/about.tscn").instantiate() 54 | button.get_window().add_child(win) 55 | win.popup_centered() 56 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/sgt_inspector.gd.uid: -------------------------------------------------------------------------------- 1 | uid://cp54123dwlv7j 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/.gdignore: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/blur1.gdshader: -------------------------------------------------------------------------------- 1 | /* blur1.gdshader 2 | This file is part of: SimpleGrassTextured 3 | Copyright (c) 2023 IcterusGames 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ 23 | 24 | shader_type canvas_item; 25 | 26 | uniform sampler2D normal_texture : hint_normal, filter_nearest, repeat_disable; 27 | 28 | 29 | void fragment() { 30 | vec2 pixel = 1.0 / vec2(textureSize(normal_texture, 0)); 31 | float lvl = round(float(textureSize(normal_texture, 0).y) * 0.01); 32 | highp vec4 color = vec4(0.0); 33 | highp float total = 0.0; 34 | for(float x = -lvl * 2.0; x <= lvl * 2.0; x += 1.0) { 35 | float gauss = (1.0 / (sqrt(TAU * lvl * lvl))) * pow(E, -((x * x) / (2.0 * lvl * lvl))); 36 | color += texture(normal_texture, UV + vec2(0.0, x * pixel.x)) * gauss; 37 | total += gauss; 38 | } 39 | COLOR = color / total; 40 | } 41 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/blur1.gdshader.uid: -------------------------------------------------------------------------------- 1 | uid://dii7jpdyaypc6 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/blur2.gdshader: -------------------------------------------------------------------------------- 1 | /* blur2.gdshader 2 | This file is part of: SimpleGrassTextured 3 | Copyright (c) 2023 IcterusGames 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ 23 | 24 | shader_type canvas_item; 25 | 26 | uniform sampler2D normal_frame : hint_default_transparent, filter_nearest, repeat_disable; 27 | uniform sampler2D normal_texture : hint_normal, filter_nearest, repeat_disable; 28 | 29 | 30 | void fragment() { 31 | vec2 pixel = 1.0 / vec2(textureSize(normal_texture, 0)); 32 | float lvl = round(float(textureSize(normal_texture, 0).y) * 0.01); 33 | highp vec4 color = vec4(0.0); 34 | highp float total = 0.0; 35 | for(float x = -lvl * 2.0; x <= lvl * 2.0; x += 1.0) { 36 | float gauss = (1.0 / (sqrt(TAU * lvl * lvl))) * pow(E, -((x * x) / (2.0 * lvl * lvl))); 37 | color += texture(normal_texture, UV + vec2(x * pixel.x, 0.0)) * gauss; 38 | total += gauss; 39 | } 40 | vec4 color_frame = texture(normal_frame, UV); 41 | COLOR = ((color / total) * (1.0 - color_frame.a)) + color_frame; 42 | } 43 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/blur2.gdshader.uid: -------------------------------------------------------------------------------- 1 | uid://ct0c3akkhiaf 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/distance.gdshader: -------------------------------------------------------------------------------- 1 | /* distance.gdshader 2 | This file is part of: SimpleGrassTextured 3 | Copyright (c) 2023 IcterusGames 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ 23 | 24 | shader_type spatial; 25 | render_mode blend_mix,depth_draw_never,cull_back,unshaded,ambient_light_disabled; 26 | uniform sampler2D heightmap_texture : hint_default_white, repeat_disable, filter_nearest; 27 | uniform sampler2D depth_texture : hint_depth_texture, repeat_disable, filter_nearest; 28 | 29 | global uniform int sgt_legacy_renderer = 0; 30 | 31 | void fragment() { 32 | vec2 uv = SCREEN_UV; 33 | uv.y = 1.0 - uv.y; 34 | float depth = textureLod(depth_texture, uv, 0.0).r; 35 | 36 | // If using Compatibility renderer, apply proper depth range 37 | vec3 ndc = mix(vec3(uv * 2.0 - 1.0, depth), vec3(uv, depth) * 2.0 - 1.0, float(sgt_legacy_renderer)); 38 | vec4 upos = INV_PROJECTION_MATRIX * vec4(ndc, 1.0); 39 | float pos_y = -upos.z + CAMERA_POSITION_WORLD.y; 40 | vec3 color_h = textureLod(heightmap_texture, UV, 0).rgb; 41 | highp float map_y = (((round(color_h.r * 255.0) - 75.0) * 180.0) + (round(color_h.g * 255.0) - 75.0) + color_h.b) - 16200.0; 42 | float dist = clamp(abs(map_y - pos_y) / 0.35, 0.0, 1.0) * 65535.0; 43 | ALBEDO.r = floor(dist / 256.0) / 255.0; 44 | ALBEDO.g = (dist - round(ALBEDO.r * 65280.0)) / 255.0; 45 | ALBEDO.b = 0.0; 46 | ALPHA = 1.0; 47 | } 48 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/distance.gdshader.uid: -------------------------------------------------------------------------------- 1 | uid://h3cmhcmf6wwy 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/grass.gdshader: -------------------------------------------------------------------------------- 1 | /* grass.gdshader 2 | This file is part of: SimpleGrassTextured 3 | Copyright (c) 2023 IcterusGames 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ 23 | 24 | shader_type spatial; 25 | render_mode blend_mix,depth_draw_opaque,cull_disabled,specular_schlick_ggx,world_vertex_coords; 26 | #define FILTER_TYPE filter_linear_mipmap 27 | #include "grass.gdshaderinc" 28 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/grass.gdshader.uid: -------------------------------------------------------------------------------- 1 | uid://bi3o8elbtqoni 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/grass.gdshaderinc: -------------------------------------------------------------------------------- 1 | /* grass.gdshaderinc 2 | This file is part of: SimpleGrassTextured 3 | Copyright (c) 2023 IcterusGames 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ 23 | 24 | #ifndef FILTER_TYPE 25 | #define FILTER_TYPE filter_linear_mipmap 26 | #endif 27 | 28 | uniform vec4 albedo : source_color = vec4(1.0); 29 | uniform sampler2D texture_albedo : source_color,FILTER_TYPE,repeat_disable; 30 | uniform sampler2D texture_normal : hint_roughness_normal,FILTER_TYPE,repeat_enable; 31 | uniform sampler2D texture_metallic : hint_default_white,FILTER_TYPE,repeat_enable; 32 | uniform sampler2D texture_roughness : hint_roughness_r,FILTER_TYPE,repeat_enable; 33 | uniform vec2 texture_frames = vec2(1.0,1.0); 34 | uniform int light_mode = 0; 35 | uniform float alpha_scissor_threshold = 0.5; 36 | uniform float normal_scale : hint_range(-16,16) = 1.0; 37 | uniform float metallic : hint_range(0,1) = 0.0; 38 | uniform vec4 metallic_texture_channel = vec4(1.0, 0.0, 0.0, 0.0); 39 | uniform float roughness : hint_range(0,1) = 1.0; 40 | uniform vec4 roughness_texture_channel = vec4(1.0, 0.0, 0.0, 0.0); 41 | uniform float specular : hint_range(0,1) = 0.0; 42 | uniform float scale_h = 1.0; 43 | uniform float scale_w = 1.0; 44 | uniform float scale_var : hint_range(-1.0, 1.0) = -0.25; 45 | uniform float grass_strength : hint_range(0.0, 1.0) = 0.55; 46 | uniform bool optimization_by_distance = false; 47 | uniform float optimization_level = 7.0; 48 | uniform float optimization_dist_min = 10.0; 49 | uniform float optimization_dist_max = 50.0; 50 | uniform float grass_size_y = 1.0; 51 | uniform bool interactive_mode = true; 52 | uniform float interactive_level_xz = 3.0; 53 | uniform float interactive_level_y = 0.3; 54 | 55 | global uniform vec3 sgt_player_position = vec3(100000.0); 56 | global uniform vec3 sgt_player_mov = vec3(0.0); 57 | global uniform sampler2D sgt_normal_displacement : repeat_disable, filter_nearest, hint_normal; 58 | global uniform sampler2D sgt_motion_texture : repeat_disable, filter_nearest, hint_default_black; 59 | global uniform vec3 sgt_wind_direction = vec3(1.0, 0.0, 0.0); 60 | global uniform float sgt_wind_strength = 0.15; 61 | global uniform float sgt_wind_turbulence = 1.0; 62 | global uniform vec3 sgt_wind_movement = vec3(0.0, 0.0, 0.0); 63 | global uniform sampler2D sgt_wind_pattern : source_color, repeat_enable, filter_linear, hint_default_white; 64 | 65 | varying vec2 uv_align; 66 | varying vec2 uv_scale; 67 | varying flat vec3 v_normal_grass; 68 | 69 | const highp float EPSILON = 0.0001; 70 | 71 | 72 | float get_value(sampler2D tex, vec2 uv) { 73 | vec4 color = textureLod(tex, uv, 0); 74 | float value = round(color.r * 65280.0) + round(color.g * 255.0); 75 | return value; 76 | } 77 | 78 | 79 | float wrap(float value, float min, float max) { 80 | float range = max - min; 81 | if (range < EPSILON) { 82 | return min; 83 | } 84 | float result = value - (range * floor((value - min) / range)); 85 | if (result >= max - EPSILON && result <= max + EPSILON) { 86 | return min; 87 | } 88 | return result; 89 | } 90 | 91 | 92 | void vertex() { 93 | float lev = pow(abs((VERTEX.y - NODE_POSITION_WORLD.y) / grass_size_y), 1.7 + sgt_wind_strength); 94 | float rand = wrap(dot(NODE_POSITION_WORLD, NODE_POSITION_WORLD * 10.0), 0.0, 256.0); 95 | float randf = fract(rand); 96 | int randi = int(randf * 10.0); 97 | 98 | uv_align = vec2(float(randi % int(texture_frames.x)), float(int(randf * 100.0) % int(texture_frames.y))); 99 | uv_align /= texture_frames; 100 | uv_scale = vec2(1.0 / texture_frames.x, 1.0 / texture_frames.y); 101 | 102 | float text_wind = texture(sgt_wind_pattern, (vec2(NODE_POSITION_WORLD.x, NODE_POSITION_WORLD.z) * 0.005) - sgt_wind_movement.xz).r; 103 | VERTEX.x += text_wind * lev * sgt_wind_strength * sgt_wind_direction.x * (1.0 - grass_strength); 104 | VERTEX.z += text_wind * lev * sgt_wind_strength * sgt_wind_direction.z * (1.0 - grass_strength); 105 | VERTEX.x += sin(rand + sgt_wind_movement.y) * lev * ((1.0 - grass_strength) / 10.0); 106 | VERTEX.x += sgt_wind_direction.x * lev * (sgt_wind_strength + (sin(TIME + rand) * 0.2 * (1.0 - grass_strength) * min(1.0, sgt_wind_turbulence))) * (1.0 - grass_strength); 107 | VERTEX.y += sin(rand + sgt_wind_movement.y) * lev * ((1.0 - grass_strength) / 10.0) * sgt_wind_direction.y; 108 | VERTEX.y += sgt_wind_direction.y * lev * (sgt_wind_strength + (sin(TIME + rand) * 0.2 * (1.0 - grass_strength) * min(1.0, sgt_wind_turbulence))) * (1.0 - grass_strength); 109 | VERTEX.z += cos(rand + sgt_wind_movement.y) * lev * ((1.0 - grass_strength) / 10.0); 110 | VERTEX.z += sgt_wind_direction.z * lev * (sgt_wind_strength + (sin(TIME + rand) * 0.2 * (1.0 - grass_strength) * min(1.0, sgt_wind_turbulence))) * (1.0 - grass_strength); 111 | 112 | vec3 align = VERTEX - NODE_POSITION_WORLD; 113 | float scale_rand = ((float(randi % 5) / 5.0) * scale_var); 114 | float dist = 1.0; 115 | if(optimization_by_distance) { 116 | float node_dist = distance(NODE_POSITION_WORLD, MAIN_CAM_INV_VIEW_MATRIX[3].xyz); 117 | dist = 1.0 - clamp(0.0, 1.0, float(randi % int(max(1.0, node_dist / optimization_level)))); 118 | dist *= smoothstep(optimization_dist_max, optimization_dist_min, node_dist); 119 | } 120 | 121 | vec3 scale = vec3(scale_w, scale_h, scale_w) * (1.0 + scale_rand); 122 | VERTEX = NODE_POSITION_WORLD + (align * dist * scale); 123 | 124 | if(dist > 0.0 && interactive_mode) { 125 | float node_x = NODE_POSITION_WORLD.x / 50.0; 126 | float node_z = NODE_POSITION_WORLD.z / 50.0; 127 | vec2 uv_disp = vec2(clamp((node_x - (sgt_player_position.x - 0.5)), 0.0, 1.0), clamp((node_z - (sgt_player_position.z - 0.5)), 0.0, 1.0)); 128 | vec3 norm_mov = textureLod(sgt_normal_displacement, uv_disp - sgt_player_mov.xz, 0).rgb; 129 | float time = get_value(sgt_motion_texture, uv_disp) / 65535.0; 130 | norm_mov.xy = (norm_mov.xy * 2.0 - 1.0) * interactive_level_xz * lev; 131 | VERTEX.xz += norm_mov.xy * (sin(time * time * 15.0) / 2.0) * (1.0 - time); 132 | VERTEX.xz += norm_mov.xy * 0.5; 133 | VERTEX.y -= (VERTEX.y - NODE_POSITION_WORLD.y) * norm_mov.b * interactive_level_y; 134 | } 135 | v_normal_grass = (MODELVIEW_MATRIX * vec4(0.0, 1.0, 0.0, 1.0)).xyz - NODE_POSITION_VIEW; 136 | } 137 | 138 | 139 | void light() { 140 | switch(light_mode) { 141 | case 0: // Lambert 142 | DIFFUSE_LIGHT += clamp(dot(NORMAL, LIGHT), 0.0, 1.0) * ATTENUATION * 0.3 * LIGHT_COLOR; 143 | break; 144 | case 1: // Normal grass 145 | DIFFUSE_LIGHT += clamp(dot(v_normal_grass, LIGHT), 0.0, 1.0) * ATTENUATION * 0.3 * LIGHT_COLOR; 146 | break; 147 | case 2: // Unshaded 148 | DIFFUSE_LIGHT = vec3(1.0); 149 | break; 150 | } 151 | } 152 | 153 | 154 | void fragment() { 155 | vec2 uv = (UV * uv_scale) + uv_align; 156 | vec4 albedo_tex = texture(texture_albedo, uv); 157 | ALBEDO = albedo.rgb * albedo_tex.rgb; 158 | NORMAL_MAP = texture(texture_normal, uv).rgb; 159 | NORMAL_MAP_DEPTH = normal_scale; 160 | METALLIC = metallic; 161 | ROUGHNESS = roughness; 162 | SPECULAR = specular; 163 | float metallic_tex = dot(texture(texture_metallic, uv), metallic_texture_channel); 164 | METALLIC = metallic_tex * metallic; 165 | float roughness_tex = dot(texture(texture_roughness, uv), roughness_texture_channel); 166 | ROUGHNESS = roughness_tex * roughness; 167 | ALPHA *= albedo.a * albedo_tex.a; 168 | ALPHA_SCISSOR_THRESHOLD = alpha_scissor_threshold; 169 | } 170 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/grass.gdshaderinc.uid: -------------------------------------------------------------------------------- 1 | uid://cvdyxro7g1dic 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/grass_linear.gdshader: -------------------------------------------------------------------------------- 1 | /* grass_linear.gdshader 2 | This file is part of: SimpleGrassTextured 3 | Copyright (c) 2023 IcterusGames 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ 23 | 24 | shader_type spatial; 25 | render_mode blend_mix,depth_draw_opaque,cull_disabled,specular_schlick_ggx,world_vertex_coords; 26 | #define FILTER_TYPE filter_linear 27 | #include "grass.gdshaderinc" 28 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/grass_linear.gdshader.uid: -------------------------------------------------------------------------------- 1 | uid://bdx4su8bw3dmw 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/grass_nearest.gdshader: -------------------------------------------------------------------------------- 1 | /* grass_nearest.gdshader 2 | This file is part of: SimpleGrassTextured 3 | Copyright (c) 2023 IcterusGames 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ 23 | 24 | shader_type spatial; 25 | render_mode blend_mix,depth_draw_opaque,cull_disabled,specular_schlick_ggx,world_vertex_coords; 26 | #define FILTER_TYPE filter_nearest 27 | #include "grass.gdshaderinc" 28 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/grass_nearest.gdshader.uid: -------------------------------------------------------------------------------- 1 | uid://ch7elftpoqayg 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/grass_nearest_mipmap.gdshader: -------------------------------------------------------------------------------- 1 | /* grass_nearest_mipmap.gdshader 2 | This file is part of: SimpleGrassTextured 3 | Copyright (c) 2023 IcterusGames 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ 23 | 24 | shader_type spatial; 25 | render_mode blend_mix,depth_draw_opaque,cull_disabled,specular_schlick_ggx,world_vertex_coords; 26 | #define FILTER_TYPE filter_nearest_mipmap 27 | #include "grass.gdshaderinc" 28 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/grass_nearest_mipmap.gdshader.uid: -------------------------------------------------------------------------------- 1 | uid://c56hanl0enhx2 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/grass_unshaded.gdshader: -------------------------------------------------------------------------------- 1 | /* grass_unshaded.gdshader 2 | This file is part of: SimpleGrassTextured 3 | Copyright (c) 2023 IcterusGames 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ 23 | 24 | shader_type spatial; 25 | render_mode blend_mix,depth_draw_opaque,cull_disabled,specular_schlick_ggx,world_vertex_coords; 26 | render_mode unshaded; 27 | #define FILTER_TYPE filter_linear_mipmap 28 | #include "grass.gdshaderinc" 29 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/grass_unshaded.gdshader.uid: -------------------------------------------------------------------------------- 1 | uid://bdgbdmw2hh77q 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/grass_unshaded_linear.gdshader: -------------------------------------------------------------------------------- 1 | /* grass_unshaded_linear.gdshader 2 | This file is part of: SimpleGrassTextured 3 | Copyright (c) 2023 IcterusGames 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ 23 | 24 | shader_type spatial; 25 | render_mode blend_mix,depth_draw_opaque,cull_disabled,specular_schlick_ggx,world_vertex_coords; 26 | render_mode unshaded; 27 | #define FILTER_TYPE filter_linear 28 | #include "grass.gdshaderinc" 29 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/grass_unshaded_linear.gdshader.uid: -------------------------------------------------------------------------------- 1 | uid://c4damqkvtgm4i 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/grass_unshaded_nearest.gdshader: -------------------------------------------------------------------------------- 1 | /* grass_unshaded_nearest.gdshader 2 | This file is part of: SimpleGrassTextured 3 | Copyright (c) 2023 IcterusGames 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ 23 | 24 | shader_type spatial; 25 | render_mode blend_mix,depth_draw_opaque,cull_disabled,specular_schlick_ggx,world_vertex_coords; 26 | render_mode unshaded; 27 | #define FILTER_TYPE filter_nearest 28 | #include "grass.gdshaderinc" 29 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/grass_unshaded_nearest.gdshader.uid: -------------------------------------------------------------------------------- 1 | uid://cdooqj4aiumdm 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/grass_unshaded_nearest_mipmap.gdshader: -------------------------------------------------------------------------------- 1 | /* grass_unshaded_nearest_mipmap.gdshader 2 | This file is part of: SimpleGrassTextured 3 | Copyright (c) 2023 IcterusGames 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ 23 | 24 | shader_type spatial; 25 | render_mode blend_mix,depth_draw_opaque,cull_disabled,specular_schlick_ggx,world_vertex_coords; 26 | render_mode unshaded; 27 | #define FILTER_TYPE filter_nearest_mipmap 28 | #include "grass.gdshaderinc" 29 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/grass_unshaded_nearest_mipmap.gdshader.uid: -------------------------------------------------------------------------------- 1 | uid://cuplxuwag3dnn 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/motion1.gdshader: -------------------------------------------------------------------------------- 1 | /* motion1.gdshader 2 | This file is part of: SimpleGrassTextured 3 | Copyright (c) 2023 IcterusGames 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ 23 | 24 | shader_type canvas_item; 25 | render_mode blend_mix; 26 | 27 | uniform float delta = 1.0; 28 | uniform sampler2D prev_depth : hint_default_black, repeat_disable, filter_nearest; 29 | uniform sampler2D cur_depth : hint_default_black, repeat_disable, filter_nearest; 30 | uniform sampler2D motion_frame : hint_default_transparent, repeat_disable, filter_nearest; 31 | 32 | global uniform vec3 sgt_player_mov = vec3(0.0); 33 | 34 | 35 | float get_value(sampler2D tex, vec2 uv) { 36 | vec4 color = textureLod(tex, uv, 0); 37 | float value = round(color.r * 65280.0) + round(color.g * 255.0); 38 | return value; 39 | } 40 | 41 | 42 | void fragment() { 43 | float value1 = get_value(cur_depth, UV); 44 | float value2 = get_value(prev_depth, UV - sgt_player_mov.xz) + ((1.0 - clamp(TIME, 0.0, 1.0)) * 65535.0); 45 | vec4 color_frame = texture(motion_frame, UV); 46 | value1 = min(value1, value2 + (40000.0 * delta)) * (1.0 - color_frame.a); 47 | value1 += 65535.0 * color_frame.a; 48 | COLOR.r = floor(value1 / 256.0) / 255.0; 49 | COLOR.g = floor(value1 - round(COLOR.r * 65280.0)) / 255.0; 50 | COLOR.b = 0.0; 51 | } 52 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/motion1.gdshader.uid: -------------------------------------------------------------------------------- 1 | uid://bpnki8vkbrrer 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/motion2.gdshader: -------------------------------------------------------------------------------- 1 | /* motion2.gdshader 2 | This file is part of: SimpleGrassTextured 3 | Copyright (c) 2023 IcterusGames 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ 23 | 24 | shader_type canvas_item; 25 | render_mode blend_mix; 26 | 27 | uniform sampler2D prev_depth : hint_default_black, repeat_disable, filter_nearest; 28 | 29 | 30 | void fragment() { 31 | COLOR = textureLod(prev_depth, UV, 0); 32 | } 33 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/motion2.gdshader.uid: -------------------------------------------------------------------------------- 1 | uid://brbm3okyt3jwq 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/normal.gdshader: -------------------------------------------------------------------------------- 1 | /* normal.gdshader 2 | This file is part of: SimpleGrassTextured 3 | Copyright (c) 2023 IcterusGames 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ 23 | 24 | shader_type canvas_item; 25 | render_mode blend_mix; 26 | 27 | const float LVL = 4.0; 28 | 29 | uniform sampler2D depth_texture : repeat_disable, filter_nearest, hint_default_white; 30 | 31 | 32 | float get_value(sampler2D tex, vec2 uv) { 33 | vec4 color = textureLod(tex, uv, 0); 34 | return (round(color.r * 65280.0) + round(color.g * 255.0)) / 65535.0; 35 | } 36 | 37 | 38 | void fragment() { 39 | vec2 pixel = 1.0 / vec2(textureSize(depth_texture, 0)); 40 | float c = get_value(depth_texture, UV); 41 | float l = get_value(depth_texture, UV - (vec2(1.0, 0.0) * pixel)); 42 | float r = get_value(depth_texture, UV + (vec2(1.0, 0.0) * pixel)); 43 | float u = get_value(depth_texture, UV - (vec2(0.0, 1.0) * pixel)); 44 | float d = get_value(depth_texture, UV + (vec2(0.0, 1.0) * pixel)); 45 | COLOR = vec4((r - l) * LVL * 0.5 + 0.5, (d - u) * LVL * 0.5 + 0.5, 1.0 - c, 1.0); 46 | } 47 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/normal.gdshader.uid: -------------------------------------------------------------------------------- 1 | uid://c4hxrek5kx6bn 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/position.gdshader: -------------------------------------------------------------------------------- 1 | /* position.gdshader 2 | This file is part of: SimpleGrassTextured 3 | Copyright (c) 2023 IcterusGames 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ 23 | 24 | shader_type spatial; 25 | render_mode blend_mix,depth_draw_never,cull_disabled,unshaded,ambient_light_disabled; 26 | 27 | uniform sampler2D texture_albedo : source_color,filter_nearest,repeat_disable; 28 | 29 | 30 | void fragment() { 31 | vec4 color = textureLod(texture_albedo, UV, 0.0); 32 | ALBEDO = color.rgb; 33 | ALPHA = color.a; 34 | } 35 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/shaders/position.gdshader.uid: -------------------------------------------------------------------------------- 1 | uid://brellka4w2k2s 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/singleton.gd: -------------------------------------------------------------------------------- 1 | # singleton.gd 2 | # This file is part of: SimpleGrassTextured 3 | # Copyright (c) 2023 IcterusGames 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining 6 | # a copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be 14 | # included in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | @tool 25 | extends Node3D 26 | 27 | var wind_direction := Vector3(1, 0, 0) : set = set_wind_direction 28 | var wind_strength := 0.15 : set = set_wind_strength 29 | var wind_turbulence := 1.0 : set = set_wind_turbulence 30 | var player_position := Vector3.ZERO : set = set_player_position 31 | var interactive := false : set = set_interactive 32 | 33 | var _RESOLUTION := 512.0 34 | var _PIXEL_STEEP := Vector3(50.0 / _RESOLUTION, 50.0 / _RESOLUTION, 50.0 / _RESOLUTION) 35 | var _CAM_DIST := Vector3(0, 25, 0) 36 | 37 | var _wind_movement := Vector3.ZERO 38 | var _time_wind := 0.0 39 | var _player_pos_snapped := Vector3.ZERO 40 | var _player_prev_pos := Vector3.ZERO 41 | var _player_mov := Vector3.ZERO 42 | var _gui_debug : VBoxContainer = null 43 | var _label_names_debug : Label = null 44 | var _label_datas_debug : Label = null 45 | var _timer_debug : Timer = null 46 | 47 | @onready var _height_view := $HeightMapView as SubViewport 48 | @onready var _height_cam := $HeightMapView/Camera as Camera3D 49 | @onready var _dist_view := $DistanceView as SubViewport 50 | @onready var _dist_cam := $DistanceView/Camera as Camera3D 51 | @onready var _dist_mesh := $DistanceView/Camera/Mesh as MeshInstance3D 52 | @onready var _motion1_view := $Motion1 as SubViewport 53 | @onready var _motion1_rect := $Motion1/Motion1Rect as ColorRect 54 | @onready var _motion2_view := $Motion2 as SubViewport 55 | @onready var _motion2_rect := $Motion2/Motion2Rect as ColorRect 56 | @onready var _normal_view := $Normal as SubViewport 57 | @onready var _normal_rect := $Normal/NormalRect as ColorRect 58 | @onready var _blur1_view := $Blur1 as SubViewport 59 | @onready var _blur1_rect := $Blur1/Blur1Rect as ColorRect 60 | @onready var _blur2_view := $Blur2 as SubViewport 61 | @onready var _blur2_rect := $Blur2/Blur2Rect as ColorRect 62 | 63 | 64 | func _ready() -> void: 65 | if ProjectSettings.has_setting("SimpleGrassTextured/General/interactive_resolution"): 66 | _RESOLUTION = ProjectSettings.get_setting_with_override("SimpleGrassTextured/General/interactive_resolution") 67 | elif OS.get_name() == "Android" or OS.get_name() == "iOS": 68 | _RESOLUTION = 256.0 69 | _PIXEL_STEEP = Vector3(50.0 / _RESOLUTION, 50.0 / _RESOLUTION, 50.0 / _RESOLUTION) 70 | var using_legacy_renderer = ProjectSettings.get_setting_with_override("rendering/renderer/rendering_method") == "gl_compatibility" 71 | RenderingServer.global_shader_parameter_set(&"sgt_legacy_renderer", 1 if using_legacy_renderer else 0) 72 | 73 | wind_direction = ProjectSettings.get_setting("shader_globals/sgt_wind_direction", {"value":wind_direction}).value 74 | wind_strength = ProjectSettings.get_setting("shader_globals/sgt_wind_strength", {"value":wind_strength}).value 75 | wind_turbulence = ProjectSettings.get_setting("shader_globals/sgt_wind_turbulence", {"value":wind_turbulence}).value 76 | RenderingServer.global_shader_parameter_set(&"sgt_wind_direction", wind_direction) 77 | RenderingServer.global_shader_parameter_set(&"sgt_wind_strength", wind_strength) 78 | RenderingServer.global_shader_parameter_set(&"sgt_wind_turbulence", wind_turbulence) 79 | _height_cam.size = 50.0 80 | _dist_cam.size = 50.0 81 | _dist_mesh.mesh.size = Vector2(50.0, 50.0) 82 | _dist_view.size = Vector2i(int(_RESOLUTION), int(_RESOLUTION)) 83 | _dist_view.size_2d_override = _dist_view.size 84 | _dist_cam.physics_interpolation_mode = Node.PHYSICS_INTERPOLATION_MODE_OFF 85 | _height_cam.physics_interpolation_mode = Node.PHYSICS_INTERPOLATION_MODE_OFF 86 | _motion1_view.size = _dist_view.size 87 | _motion1_view.size_2d_override = _dist_view.size 88 | _motion2_view.size = _dist_view.size 89 | _motion2_view.size_2d_override = _dist_view.size 90 | _normal_view.size = _dist_view.size 91 | _normal_view.size_2d_override = _dist_view.size 92 | _blur1_view.size = _dist_view.size 93 | _blur1_view.size_2d_override = _dist_view.size 94 | _blur2_view.size = _dist_view.size 95 | _blur2_view.size_2d_override = _dist_view.size 96 | if Engine.is_editor_hint(): 97 | if not get_tree().has_user_signal(&"sgt_globals_params_changed"): 98 | get_tree().add_user_signal(&"sgt_globals_params_changed") 99 | get_tree().connect(&"sgt_globals_params_changed", _on_globals_params_changed) 100 | else: 101 | set_interactive(false) 102 | 103 | 104 | func _process(delta : float) -> void: 105 | if interactive: 106 | _player_pos_snapped = player_position.snapped(_PIXEL_STEEP) / 50.0 107 | _player_mov = _player_prev_pos - _player_pos_snapped 108 | RenderingServer.global_shader_parameter_set(&"sgt_player_mov", _player_mov) 109 | _motion1_rect.material.set_shader_parameter(&"delta", delta) 110 | _player_prev_pos = _player_pos_snapped 111 | _dist_cam.global_position = player_position.snapped(_PIXEL_STEEP) - _CAM_DIST 112 | _height_cam.global_position = player_position + _CAM_DIST * 2 113 | RenderingServer.global_shader_parameter_set(&"sgt_player_position", _player_pos_snapped) 114 | _time_wind += delta * wind_turbulence 115 | _wind_movement += wind_direction * delta * 0.1 * wind_strength 116 | _wind_movement.y = _time_wind 117 | RenderingServer.global_shader_parameter_set(&"sgt_wind_movement", _wind_movement) 118 | 119 | 120 | func set_player_position(global_pos : Vector3) -> void: 121 | player_position = global_pos 122 | 123 | 124 | func set_wind_direction(direction : Vector3) -> void: 125 | wind_direction = direction 126 | RenderingServer.global_shader_parameter_set(&"sgt_wind_direction", wind_direction) 127 | 128 | 129 | func set_wind_strength(strength : float) -> void: 130 | wind_strength = strength 131 | RenderingServer.global_shader_parameter_set(&"sgt_wind_strength", wind_strength) 132 | 133 | 134 | func set_wind_turbulence(turbulence : float) -> void: 135 | wind_turbulence = turbulence 136 | RenderingServer.global_shader_parameter_set(&"sgt_wind_turbulence", wind_turbulence) 137 | 138 | 139 | func set_wind_pattern(pattern : Texture) -> void: 140 | RenderingServer.global_shader_parameter_set(&"sgt_wind_pattern", pattern) 141 | 142 | 143 | func set_interactive(enable : bool) -> void: 144 | var mode := SubViewport.UPDATE_ALWAYS 145 | interactive = enable 146 | _dist_mesh.visible = interactive 147 | if not interactive: 148 | mode = SubViewport.UPDATE_ONCE 149 | _dist_mesh.material_override.set_shader_parameter(&"heightmap_texture", _height_view.get_texture()) 150 | _motion2_rect.material.set_shader_parameter(&"prev_depth", load("res://addons/simplegrasstextured/images/motion.png")) 151 | _motion1_rect.material.set_shader_parameter(&"prev_depth", load("res://addons/simplegrasstextured/images/motion.png")) 152 | _motion1_rect.material.set_shader_parameter(&"cur_depth", load("res://addons/simplegrasstextured/images/motion.png")) 153 | _normal_rect.material.set_shader_parameter(&"depth_texture", _motion1_view.get_texture()) 154 | _blur1_rect.material.set_shader_parameter(&"normal_texture", load("res://addons/simplegrasstextured/images/normal.png")) 155 | _blur2_rect.material.set_shader_parameter(&"normal_texture", load("res://addons/simplegrasstextured/images/normal.png")) 156 | RenderingServer.global_shader_parameter_set(&"sgt_normal_displacement", _blur2_view.get_texture()) 157 | RenderingServer.global_shader_parameter_set(&"sgt_motion_texture", _motion1_view.get_texture()) 158 | else: 159 | _dist_mesh.material_override.set_shader_parameter(&"heightmap_texture", _height_view.get_texture()) 160 | _motion2_rect.material.set_shader_parameter(&"prev_depth", _motion1_view.get_texture()) 161 | _motion1_rect.material.set_shader_parameter(&"prev_depth", _motion2_view.get_texture()) 162 | _motion1_rect.material.set_shader_parameter(&"cur_depth", _dist_view.get_texture()) 163 | _normal_rect.material.set_shader_parameter(&"depth_texture", _motion1_view.get_texture()) 164 | _blur1_rect.material.set_shader_parameter(&"normal_texture", _normal_view.get_texture()) 165 | _blur2_rect.material.set_shader_parameter(&"normal_texture", _blur1_view.get_texture()) 166 | RenderingServer.global_shader_parameter_set(&"sgt_normal_displacement", _blur2_view.get_texture()) 167 | RenderingServer.global_shader_parameter_set(&"sgt_motion_texture", _motion1_view.get_texture()) 168 | _height_view.render_target_update_mode = mode 169 | _dist_view.render_target_update_mode = mode 170 | _normal_view.render_target_update_mode = mode 171 | _blur1_view.render_target_update_mode = mode 172 | _blur2_view.render_target_update_mode = mode 173 | _motion1_view.render_target_update_mode = mode 174 | _motion2_view.render_target_update_mode = mode 175 | 176 | 177 | func is_interactive() -> bool: 178 | return interactive 179 | 180 | 181 | func set_debugger_visible(show_debugger : bool) -> void: 182 | if show_debugger: 183 | if _gui_debug == null: 184 | _gui_debug = VBoxContainer.new() 185 | _gui_debug.position = Vector2(10, 10) 186 | var hbox := HBoxContainer.new() 187 | hbox.custom_minimum_size.y = 155 188 | _gui_debug.add_child(hbox) 189 | hbox.add_child(_new_debug_trect(_height_view.get_texture(), "Height map")) 190 | hbox.add_child(_new_debug_trect(_dist_view.get_texture(), "Distance")) 191 | hbox.add_child(_new_debug_trect(_motion1_view.get_texture(), "Motion #1")) 192 | hbox.add_child(_new_debug_trect(_motion2_view.get_texture(), "Motion #2")) 193 | hbox.add_child(_new_debug_trect(_normal_view.get_texture(), "Normal")) 194 | hbox.add_child(_new_debug_trect(_blur1_view.get_texture(), "Blur #1")) 195 | hbox.add_child(_new_debug_trect(_blur2_view.get_texture(), "Blur #2")) 196 | _label_names_debug = Label.new() 197 | _label_names_debug.label_settings = LabelSettings.new() 198 | _label_names_debug.label_settings.outline_color = Color.BLACK 199 | _label_names_debug.label_settings.font_size = 12 200 | _label_names_debug.label_settings.outline_size = 2 201 | _label_datas_debug = Label.new() 202 | _label_datas_debug.label_settings = _label_names_debug.label_settings 203 | var grid := GridContainer.new() 204 | grid.columns = 2 205 | grid.add_child(_label_names_debug) 206 | grid.add_child(_label_datas_debug) 207 | _gui_debug.add_child(grid) 208 | add_child(_gui_debug) 209 | _timer_debug = Timer.new() 210 | _timer_debug.timeout.connect(_on_timer_debug) 211 | add_child(_timer_debug) 212 | _timer_debug.start(0.03) 213 | else: 214 | if _gui_debug != null: 215 | _gui_debug.queue_free() 216 | _gui_debug = null 217 | _timer_debug.queue_free() 218 | _timer_debug = null 219 | 220 | 221 | func is_debugger_visible() -> bool: 222 | return _gui_debug != null 223 | 224 | 225 | func _on_globals_params_changed() -> void: 226 | wind_direction = ProjectSettings.get_setting("shader_globals/sgt_wind_direction", {"value":wind_direction}).value 227 | wind_strength = ProjectSettings.get_setting("shader_globals/sgt_wind_strength", {"value":wind_strength}).value 228 | wind_turbulence = ProjectSettings.get_setting("shader_globals/sgt_wind_turbulence", {"value":wind_turbulence}).value 229 | 230 | 231 | func _new_debug_trect(texture : ViewportTexture, title : String) -> TextureRect: 232 | var trect := TextureRect.new() 233 | var label := Label.new() 234 | trect.expand_mode = TextureRect.EXPAND_FIT_WIDTH 235 | trect.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT 236 | trect.texture = texture 237 | label.text = title 238 | label.label_settings = LabelSettings.new() 239 | label.label_settings.outline_color = Color.BLACK 240 | label.label_settings.font_size = 12 241 | label.label_settings.outline_size = 2 242 | label.position.y = 155 243 | trect.add_child(label) 244 | return trect 245 | 246 | 247 | func _on_timer_debug() -> void: 248 | var text1 := "" 249 | var text2 := "" 250 | text1 += "\nInteractive:" 251 | text2 += "\n" + str(interactive) 252 | text1 += "\nPlayer position:" 253 | text2 += "\n" + str(player_position) 254 | text1 += "\nPlayer movement:" 255 | text2 += "\n" + str(_player_mov) 256 | text1 += "\nWind direction:" 257 | text2 += "\n" + str(wind_direction) 258 | text1 += "\nWind strength:" 259 | text2 += "\n" + str(wind_strength) 260 | text1 += "\nWind turbulence:" 261 | text2 += "\n" + str(wind_turbulence) 262 | text1 += "\nWind movement:" 263 | text2 += "\n" + str(_wind_movement) 264 | text1 += "\nResolution:" 265 | text2 += "\n" + str(_RESOLUTION) 266 | text1 += "\nPixel steep:" 267 | text2 += "\n" + str(_PIXEL_STEEP) 268 | text1 += "\nCamera distance:" 269 | text2 += "\n" + str(_CAM_DIST) 270 | _label_names_debug.text = text1 271 | _label_datas_debug.text = text2 272 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/singleton.gd.uid: -------------------------------------------------------------------------------- 1 | uid://bcnq5eix75v5b 2 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/singleton.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=23 format=3 uid="uid://bfq0snth8sj3h"] 2 | 3 | [ext_resource type="Script" path="res://addons/simplegrasstextured/singleton.gd" id="1_bos4q"] 4 | [ext_resource type="Shader" path="res://addons/simplegrasstextured/shaders/distance.gdshader" id="2_x0p7u"] 5 | [ext_resource type="Shader" path="res://addons/simplegrasstextured/shaders/motion1.gdshader" id="3_amjfl"] 6 | [ext_resource type="Shader" path="res://addons/simplegrasstextured/shaders/motion2.gdshader" id="4_5b1gv"] 7 | [ext_resource type="Shader" path="res://addons/simplegrasstextured/shaders/normal.gdshader" id="5_0o4wf"] 8 | [ext_resource type="Texture2D" uid="uid://cho4etu1eahnx" path="res://addons/simplegrasstextured/images/normal.png" id="5_3dhao"] 9 | [ext_resource type="Texture2D" uid="uid://m77dlrqfdeef" path="res://addons/simplegrasstextured/images/normal_frame.png" id="6_2jauk"] 10 | [ext_resource type="Shader" path="res://addons/simplegrasstextured/shaders/blur1.gdshader" id="6_svfs0"] 11 | [ext_resource type="Shader" path="res://addons/simplegrasstextured/shaders/blur2.gdshader" id="7_u8c2b"] 12 | [ext_resource type="Texture2D" uid="uid://dk6rqq2wmb45o" path="res://addons/simplegrasstextured/images/motion.png" id="9_yreb8"] 13 | 14 | [sub_resource type="World3D" id="World3D_wpi3i"] 15 | 16 | [sub_resource type="Environment" id="Environment_ub5wl"] 17 | background_mode = 1 18 | background_color = Color(1, 1, 1, 1) 19 | 20 | [sub_resource type="Environment" id="Environment_hseyq"] 21 | 22 | [sub_resource type="ViewportTexture" id="ViewportTexture_2j2sn"] 23 | 24 | [sub_resource type="ShaderMaterial" id="ShaderMaterial_bhk8n"] 25 | render_priority = 0 26 | shader = ExtResource("2_x0p7u") 27 | shader_parameter/heightmap_texture = SubResource("ViewportTexture_2j2sn") 28 | 29 | [sub_resource type="QuadMesh" id="QuadMesh_2vmyu"] 30 | size = Vector2(50, 50) 31 | 32 | [sub_resource type="ViewportTexture" id="ViewportTexture_xom4q"] 33 | 34 | [sub_resource type="ShaderMaterial" id="ShaderMaterial_0yrkm"] 35 | shader = ExtResource("5_0o4wf") 36 | shader_parameter/depth_texture = SubResource("ViewportTexture_xom4q") 37 | 38 | [sub_resource type="ShaderMaterial" id="ShaderMaterial_7aqh4"] 39 | shader = ExtResource("6_svfs0") 40 | shader_parameter/normal_texture = ExtResource("5_3dhao") 41 | 42 | [sub_resource type="ShaderMaterial" id="ShaderMaterial_tt7gm"] 43 | shader = ExtResource("7_u8c2b") 44 | shader_parameter/normal_frame = ExtResource("6_2jauk") 45 | shader_parameter/normal_texture = ExtResource("5_3dhao") 46 | 47 | [sub_resource type="ShaderMaterial" id="ShaderMaterial_bi14c"] 48 | shader = ExtResource("3_amjfl") 49 | shader_parameter/delta = 1.0 50 | 51 | [sub_resource type="ShaderMaterial" id="ShaderMaterial_5hmhs"] 52 | shader = ExtResource("4_5b1gv") 53 | shader_parameter/prev_depth = ExtResource("9_yreb8") 54 | 55 | [node name="SimpleGrassSingleton" type="Node3D"] 56 | visible = false 57 | script = ExtResource("1_bos4q") 58 | 59 | [node name="HeightMapView" type="SubViewport" parent="."] 60 | own_world_3d = true 61 | world_3d = SubResource("World3D_wpi3i") 62 | size = Vector2i(128, 128) 63 | render_target_update_mode = 1 64 | 65 | [node name="Camera" type="Camera3D" parent="HeightMapView"] 66 | transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 50, 0) 67 | environment = SubResource("Environment_ub5wl") 68 | projection = 1 69 | size = 50.0 70 | 71 | [node name="DistanceView" type="SubViewport" parent="."] 72 | size_2d_override = Vector2i(512, 512) 73 | render_target_update_mode = 1 74 | 75 | [node name="Camera" type="Camera3D" parent="DistanceView"] 76 | transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, -25, 0) 77 | cull_mask = 65536 78 | environment = SubResource("Environment_hseyq") 79 | projection = 1 80 | size = 50.0 81 | far = 100.0 82 | 83 | [node name="Mesh" type="MeshInstance3D" parent="DistanceView/Camera"] 84 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -1) 85 | visible = false 86 | layers = 65536 87 | material_override = SubResource("ShaderMaterial_bhk8n") 88 | cast_shadow = 0 89 | mesh = SubResource("QuadMesh_2vmyu") 90 | 91 | [node name="Normal" type="SubViewport" parent="."] 92 | disable_3d = true 93 | size_2d_override = Vector2i(512, 512) 94 | render_target_update_mode = 1 95 | 96 | [node name="NormalRect" type="ColorRect" parent="Normal"] 97 | material = SubResource("ShaderMaterial_0yrkm") 98 | anchors_preset = 15 99 | anchor_right = 1.0 100 | anchor_bottom = 1.0 101 | grow_horizontal = 2 102 | grow_vertical = 2 103 | 104 | [node name="Blur1" type="SubViewport" parent="."] 105 | disable_3d = true 106 | size_2d_override = Vector2i(512, 512) 107 | render_target_update_mode = 1 108 | 109 | [node name="Blur1Rect" type="ColorRect" parent="Blur1"] 110 | material = SubResource("ShaderMaterial_7aqh4") 111 | anchors_preset = 15 112 | anchor_right = 1.0 113 | anchor_bottom = 1.0 114 | grow_horizontal = 2 115 | grow_vertical = 2 116 | 117 | [node name="Blur2" type="SubViewport" parent="."] 118 | disable_3d = true 119 | size_2d_override = Vector2i(512, 512) 120 | render_target_update_mode = 1 121 | 122 | [node name="Blur2Rect" type="ColorRect" parent="Blur2"] 123 | material = SubResource("ShaderMaterial_tt7gm") 124 | anchors_preset = 15 125 | anchor_right = 1.0 126 | anchor_bottom = 1.0 127 | grow_horizontal = 2 128 | grow_vertical = 2 129 | 130 | [node name="Motion1" type="SubViewport" parent="."] 131 | disable_3d = true 132 | size_2d_override = Vector2i(512, 512) 133 | render_target_update_mode = 1 134 | 135 | [node name="Motion1Rect" type="ColorRect" parent="Motion1"] 136 | material = SubResource("ShaderMaterial_bi14c") 137 | anchors_preset = 15 138 | anchor_right = 1.0 139 | anchor_bottom = 1.0 140 | grow_horizontal = 2 141 | grow_vertical = 2 142 | 143 | [node name="Motion2" type="SubViewport" parent="."] 144 | disable_3d = true 145 | size_2d_override = Vector2i(512, 512) 146 | render_target_update_mode = 1 147 | 148 | [node name="Motion2Rect" type="ColorRect" parent="Motion2"] 149 | material = SubResource("ShaderMaterial_5hmhs") 150 | anchors_preset = 15 151 | anchor_right = 1.0 152 | anchor_bottom = 1.0 153 | grow_horizontal = 2 154 | grow_vertical = 2 155 | -------------------------------------------------------------------------------- /addons/simplegrasstextured/textures/grassbushcc008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IcterusGames/SimpleGrassTextured/4d72e6258da612b707f22dc173f4278864599b2e/addons/simplegrasstextured/textures/grassbushcc008.png -------------------------------------------------------------------------------- /addons/simplegrasstextured/textures/grassbushcc008.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://c4ggdp0kg5wjk" 6 | path.s3tc="res://.godot/imported/grassbushcc008.png-7110abc2a2a9dc117662bb95ed60be39.s3tc.ctex" 7 | metadata={ 8 | "imported_formats": ["s3tc_bptc"], 9 | "vram_texture": true 10 | } 11 | 12 | [deps] 13 | 14 | source_file="res://addons/simplegrasstextured/textures/grassbushcc008.png" 15 | dest_files=["res://.godot/imported/grassbushcc008.png-7110abc2a2a9dc117662bb95ed60be39.s3tc.ctex"] 16 | 17 | [params] 18 | 19 | compress/mode=2 20 | compress/high_quality=false 21 | compress/lossy_quality=0.7 22 | compress/hdr_compression=1 23 | compress/normal_map=0 24 | compress/channel_pack=0 25 | mipmaps/generate=true 26 | mipmaps/limit=-1 27 | roughness/mode=0 28 | roughness/src_normal="" 29 | process/fix_alpha_border=true 30 | process/premult_alpha=false 31 | process/normal_map_invert_y=false 32 | process/hdr_as_srgb=false 33 | process/hdr_clamp_exposure=false 34 | process/size_limit=0 35 | detect_3d/compress_to=0 36 | --------------------------------------------------------------------------------