diff --git a/brush_soft_mask.png.import b/brush_soft_mask.png.import deleted file mode 100644 index 352c9d7..0000000 --- a/brush_soft_mask.png.import +++ /dev/null @@ -1,14 +0,0 @@ -[remap] - -importer="image" -type="Image" -uid="uid://bbdh4btpg08do" -path="res://.godot/imported/brush_soft_mask.png-211f364dba674d8d697543d1b1246d6a.image" - -[deps] - -source_file="res://brush_soft_mask.png" -dest_files=["res://.godot/imported/brush_soft_mask.png-211f364dba674d8d697543d1b1246d6a.image"] - -[params] - diff --git a/editor.scn b/editor.scn index a608282..d4a8843 100644 --- a/editor.scn +++ b/editor.scn @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:97bb96d844de0fd20acaa3c96dc809913496dd41da46dd0024ef7bb98f07f914 -size 6834 +oid sha256:b841803f8745cadd71a2e9ae8c0eeae8f2a5a449558dca5a24f43d87a904c312 +size 7748 diff --git a/brush_soft_mask.png b/editor/brush_soft_mask.png similarity index 100% rename from brush_soft_mask.png rename to editor/brush_soft_mask.png diff --git a/editor/brush_soft_mask.png.import b/editor/brush_soft_mask.png.import new file mode 100644 index 0000000..187ed45 --- /dev/null +++ b/editor/brush_soft_mask.png.import @@ -0,0 +1,14 @@ +[remap] + +importer="image" +type="Image" +uid="uid://bbdh4btpg08do" +path="res://.godot/imported/brush_soft_mask.png-cec601fece9e15b1942ebb0d73b51015.image" + +[deps] + +source_file="res://editor/brush_soft_mask.png" +dest_files=["res://.godot/imported/brush_soft_mask.png-cec601fece9e15b1942ebb0d73b51015.image"] + +[params] + diff --git a/editor_theme.res b/editor/menus_theme.res similarity index 100% rename from editor_theme.res rename to editor/menus_theme.res diff --git a/prototype_tiles_large_albedo.png b/terrain/default_albedo.png similarity index 100% rename from prototype_tiles_large_albedo.png rename to terrain/default_albedo.png diff --git a/prototype_tiles_large_albedo.png.import b/terrain/default_albedo.png.import similarity index 54% rename from prototype_tiles_large_albedo.png.import rename to terrain/default_albedo.png.import index 073e101..3be27a2 100644 --- a/prototype_tiles_large_albedo.png.import +++ b/terrain/default_albedo.png.import @@ -3,8 +3,8 @@ importer="texture" type="CompressedTexture2D" uid="uid://bgpk15qrqxly8" -path.s3tc="res://.godot/imported/prototype_tiles_large_albedo.png-c3984e5db888f4b509766546fda5695b.s3tc.ctex" -path.etc2="res://.godot/imported/prototype_tiles_large_albedo.png-c3984e5db888f4b509766546fda5695b.etc2.ctex" +path.s3tc="res://.godot/imported/default_albedo.png-92a6d62c2ead547c4c35766bdeaf9065.s3tc.ctex" +path.etc2="res://.godot/imported/default_albedo.png-92a6d62c2ead547c4c35766bdeaf9065.etc2.ctex" metadata={ "imported_formats": ["s3tc", "etc2"], "vram_texture": true @@ -12,8 +12,8 @@ metadata={ [deps] -source_file="res://prototype_tiles_large_albedo.png" -dest_files=["res://.godot/imported/prototype_tiles_large_albedo.png-c3984e5db888f4b509766546fda5695b.s3tc.ctex", "res://.godot/imported/prototype_tiles_large_albedo.png-c3984e5db888f4b509766546fda5695b.etc2.ctex"] +source_file="res://terrain/default_albedo.png" +dest_files=["res://.godot/imported/default_albedo.png-92a6d62c2ead547c4c35766bdeaf9065.s3tc.ctex", "res://.godot/imported/default_albedo.png-92a6d62c2ead547c4c35766bdeaf9065.etc2.ctex"] [params] diff --git a/terrain/desert_sand_albedo.png b/terrain/desert_sand_albedo.png new file mode 100644 index 0000000..10b6a16 --- /dev/null +++ b/terrain/desert_sand_albedo.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:620d5c5b1421ee188681e1f2dd184b56787c9225b1f606f13802b64de0fdf811 +size 3433382 diff --git a/terrain/desert_sand_albedo.png.import b/terrain/desert_sand_albedo.png.import new file mode 100644 index 0000000..783a2e1 --- /dev/null +++ b/terrain/desert_sand_albedo.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b8cv4q43fsglu" +path="res://.godot/imported/desert_sand_albedo.png-5307ce3455129127b5c6f3a135f5cbc7.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://terrain/desert_sand_albedo.png" +dest_files=["res://.godot/imported/desert_sand_albedo.png-5307ce3455129127b5c6f3a135f5cbc7.ctex"] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/terrain/desert_sand_depth.png b/terrain/desert_sand_depth.png new file mode 100644 index 0000000..6aa3a34 --- /dev/null +++ b/terrain/desert_sand_depth.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:299d87da87ba51e2bef7963fe0f7a393a0028b91a01c7f7b334ff553542f9798 +size 3749261 diff --git a/terrain/desert_sand_depth.png.import b/terrain/desert_sand_depth.png.import new file mode 100644 index 0000000..0fecb9c --- /dev/null +++ b/terrain/desert_sand_depth.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cb4ldm1dda1bo" +path="res://.godot/imported/desert_sand_depth.png-add0a002b33efe8fd04b2cf4bf524515.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://terrain/desert_sand_depth.png" +dest_files=["res://.godot/imported/desert_sand_depth.png-add0a002b33efe8fd04b2cf4bf524515.ctex"] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/terrain/desert_sand_normal.png b/terrain/desert_sand_normal.png new file mode 100644 index 0000000..4bd2790 --- /dev/null +++ b/terrain/desert_sand_normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b79420ad4ad1863b9b82dbe8ee93fdbac60f693c1a0842afe6969d552c21697b +size 10321853 diff --git a/terrain/desert_sand_normal.png.import b/terrain/desert_sand_normal.png.import new file mode 100644 index 0000000..6efdb8b --- /dev/null +++ b/terrain/desert_sand_normal.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c40cc5b5sq4yu" +path="res://.godot/imported/desert_sand_normal.png-9b37ed7fc3712ce013db97500f604934.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://terrain/desert_sand_normal.png" +dest_files=["res://.godot/imported/desert_sand_normal.png-9b37ed7fc3712ce013db97500f604934.ctex"] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/terrain_instance_3d.gd b/terrain_instance_3d.gd index f70fcaa..361ce96 100644 --- a/terrain_instance_3d.gd +++ b/terrain_instance_3d.gd @@ -37,105 +37,105 @@ var size: Vector2i = Vector2i.ZERO: ## ## @export -var layer_1_albedo: Texture2D = null: +var albedo_map: Texture2D = null: get: - return layer_1_albedo + return albedo_map set(value): - self._material.set_shader_parameter("LAYER_1_ALBEDO", value) + self._material.set_shader_parameter("ALBEDO_MAP_0", value) - layer_1_albedo = value + albedo_map = value ## ## ## @export -var layer_1_normal_map: Texture2D = null: +var albedo_map_b: Texture2D = null: get: - return layer_1_normal_map + return albedo_map_b set(value): - self._material.set_shader_parameter("LAYER_1_NORMAL_MAP", value) + self._material.set_shader_parameter("ALBEDO_MAP_B", value) - layer_1_normal_map = value + albedo_map_b = value ## ## ## @export -var layer_2_albedo: Texture2D = null: +var albedo_map_g: Texture2D = null: get: - return layer_2_albedo + return albedo_map_g set(value): - self._material.set_shader_parameter("LAYER_2_ALBEDO", value) + self._material.set_shader_parameter("ALBEDO_MAP_G", value) - layer_2_albedo = value + albedo_map_g = value ## ## ## @export -var layer_2_normal_map: Texture2D = null: +var albedo_map_r: Texture2D = null: get: - return layer_2_normal_map + return albedo_map_r set(value): - self._material.set_shader_parameter("LAYER_2_NORMAL_MAP", value) + self._material.set_shader_parameter("ALBEDO_MAP_R", value) - layer_2_normal_map = value + albedo_map_r = value ## ## ## @export -var layer_3_albedo: Texture2D = null: +var normal_map: Texture2D = null: get: - return layer_3_albedo + return normal_map set(value): - self._material.set_shader_parameter("LAYER_3_ALBEDO", value) + self._material.set_shader_parameter("NORMAL_MAP_0", value) - layer_3_albedo = value + normal_map = value ## ## ## @export -var layer_3_normal_map: Texture2D = null: +var normal_map_b: Texture2D = null: get: - return layer_3_normal_map + return normal_map_b set(value): - self._material.set_shader_parameter("LAYER_3_NORMAL_MAP", value) + self._material.set_shader_parameter("NORMAL_MAP_B", value) - layer_3_normal_map = value + normal_map_b = value ## ## ## @export -var layer_4_albedo: Texture2D = null: +var normal_map_g: Texture2D = null: get: - return layer_4_albedo + return normal_map_g set(value): - self._material.set_shader_parameter("LAYER_4_ALBEDO", value) + self._material.set_shader_parameter("NORMAL_MAP_G", value) - layer_4_albedo = value + normal_map_g = value ## ## ## @export -var layer_4_normal_map: Texture2D = null: +var normal_map_r: Texture2D = null: get: - return layer_4_normal_map + return normal_map_r set(value): - self._material.set_shader_parameter("LAYER_4_NORMAL_MAP", value) + self._material.set_shader_parameter("ALBEDO_MAP_R", value) - layer_4_normal_map = value + normal_map_r = value ## ## diff --git a/terrain_shader.gdshader b/terrain_shader.gdshader index dfac4b8..933a6cf 100644 --- a/terrain_shader.gdshader +++ b/terrain_shader.gdshader @@ -1,23 +1,23 @@ shader_type spatial; -uniform sampler2D LAYER_1_ALBEDO : hint_default_black; +uniform sampler2D ALBEDO_MAP_0 : hint_default_black; -uniform sampler2D LAYER_1_NORMAL_MAP : hint_default_black; +uniform sampler2D ALBEDO_MAP_R : hint_default_black; -uniform sampler2D LAYER_2_ALBEDO : hint_default_black; +uniform sampler2D ALBEDO_MAP_G : hint_default_black; -uniform sampler2D LAYER_2_NORMAL_MAP : hint_default_black; - -uniform sampler2D LAYER_3_ALBEDO : hint_default_black; - -uniform sampler2D LAYER_3_NORMAL_MAP : hint_default_black; - -uniform sampler2D LAYER_4_ALBEDO : hint_default_black; - -uniform sampler2D LAYER_4_NORMAL_MAP : hint_default_black; +uniform sampler2D ALBEDO_MAP_B : hint_default_black; uniform float MAX_HEIGHT = 100.0; +uniform sampler2D NORMAL_MAP_0 : hint_default_black; + +uniform sampler2D NORMAL_MAP_R : hint_default_black; + +uniform sampler2D NORMAL_MAP_G : hint_default_black; + +uniform sampler2D NORMAL_MAP_B : hint_default_black; + uniform vec2 SIZE; uniform sampler2D TERRAIN_MAP : hint_default_transparent, repeat_disable; @@ -28,15 +28,15 @@ void fragment() { vec3 splat_map = texture(TERRAIN_MAP, UV).rgb; float blank = clamp(1.0 - splat_map.r - splat_map.g - splat_map.b, 0.0, 1.0); - ALBEDO = blank * 0.5 * (texture(LAYER_1_ALBEDO, uv).rgb + texture(LAYER_1_ALBEDO, uv_alt).rgb); - ALBEDO += splat_map.r * 0.5 * (texture(LAYER_2_ALBEDO, uv).rgb + texture(LAYER_2_ALBEDO, uv_alt).rgb); - ALBEDO += splat_map.g * 0.5 * (texture(LAYER_3_ALBEDO, uv).rgb + texture(LAYER_3_ALBEDO, uv_alt).rgb); - ALBEDO += splat_map.b * 0.5 * (texture(LAYER_4_ALBEDO, uv).rgb + texture(LAYER_4_ALBEDO, uv_alt).rgb); + ALBEDO = blank * 0.5 * (texture(ALBEDO_MAP_0, uv).rgb + texture(ALBEDO_MAP_0, uv_alt).rgb); + ALBEDO += splat_map.r * 0.5 * (texture(ALBEDO_MAP_R, uv).rgb + texture(ALBEDO_MAP_R, uv_alt).rgb); + ALBEDO += splat_map.g * 0.5 * (texture(ALBEDO_MAP_G, uv).rgb + texture(ALBEDO_MAP_G, uv_alt).rgb); + ALBEDO += splat_map.b * 0.5 * (texture(ALBEDO_MAP_B, uv).rgb + texture(ALBEDO_MAP_B, uv_alt).rgb); - NORMAL_MAP = blank * 0.5 * (texture(LAYER_1_NORMAL_MAP, uv).rgb + texture(LAYER_1_NORMAL_MAP, uv_alt).rgb); - NORMAL_MAP += splat_map.r * 0.5 * (texture(LAYER_1_NORMAL_MAP, uv).rgb + texture(LAYER_2_NORMAL_MAP, uv_alt).rgb); - NORMAL_MAP += splat_map.g * 0.5 * (texture(LAYER_2_NORMAL_MAP, uv).rgb + texture(LAYER_3_NORMAL_MAP, uv_alt).rgb); - NORMAL_MAP += splat_map.b * 0.5 * (texture(LAYER_3_NORMAL_MAP, uv).rgb + texture(LAYER_4_NORMAL_MAP, uv_alt).rgb); + NORMAL_MAP = blank * 0.5 * (texture(NORMAL_MAP_0, uv).rgb + texture(NORMAL_MAP_0, uv_alt).rgb); + NORMAL_MAP += splat_map.r * 0.5 * (texture(NORMAL_MAP_R, uv).rgb + texture(NORMAL_MAP_R, uv_alt).rgb); + NORMAL_MAP += splat_map.g * 0.5 * (texture(NORMAL_MAP_G, uv).rgb + texture(NORMAL_MAP_G, uv_alt).rgb); + NORMAL_MAP += splat_map.b * 0.5 * (texture(NORMAL_MAP_B, uv).rgb + texture(NORMAL_MAP_B, uv_alt).rgb); } float height(vec2 uv) {