WIP: Streamline Interiors System #16
|
@ -5,3 +5,5 @@
|
||||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||||
*.scn filter=lfs diff=lfs merge=lfs -text
|
*.scn filter=lfs diff=lfs merge=lfs -text
|
||||||
*.res filter=lfs diff=lfs merge=lfs -text
|
*.res filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.glb filter=lfs diff=lfs merge=lfs -text
|
||||||
|
|
||||||
|
|
Binary file not shown.
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://3m7gvnsmb4g"
|
uid="uid://chujdd7dvyclj"
|
||||||
path.s3tc="res://.godot/imported/hole_albedo.png-ef88dfc602c85c58e849d6654804eb67.s3tc.ctex"
|
path.s3tc="res://.godot/imported/detail_albedo.png-9f445a992dc42ff5e245033c09348a9d.s3tc.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"imported_formats": ["s3tc_bptc"],
|
"imported_formats": ["s3tc_bptc"],
|
||||||
"vram_texture": true
|
"vram_texture": true
|
||||||
|
@ -11,8 +11,8 @@ metadata={
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://interior/tiles/limestone_dungeon/hole_albedo.png"
|
source_file="res://interior/floors/dungeon_01/detail_albedo.png"
|
||||||
dest_files=["res://.godot/imported/hole_albedo.png-ef88dfc602c85c58e849d6654804eb67.s3tc.ctex"]
|
dest_files=["res://.godot/imported/detail_albedo.png-9f445a992dc42ff5e245033c09348a9d.s3tc.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
Binary file not shown.
|
@ -0,0 +1,35 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://b6qji7ybqaga2"
|
||||||
|
path.s3tc="res://.godot/imported/detail_displacement.png-47cde77fb53fc7ae6babfbbfef6cdb4f.s3tc.ctex"
|
||||||
|
metadata={
|
||||||
|
"imported_formats": ["s3tc_bptc"],
|
||||||
|
"vram_texture": true
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://interior/floors/dungeon_01/detail_displacement.png"
|
||||||
|
dest_files=["res://.godot/imported/detail_displacement.png-47cde77fb53fc7ae6babfbbfef6cdb4f.s3tc.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=2
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=true
|
||||||
|
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=0
|
Binary file not shown.
Binary file not shown.
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://c4eby3i7q2wts"
|
uid="uid://waqtv8flqslo"
|
||||||
path.s3tc="res://.godot/imported/hole_normal.png-9c2f1eac05804bab609d1c67adcf7dba.s3tc.ctex"
|
path.s3tc="res://.godot/imported/detail_normal.png-7595efd28a96c6bf905bfa3c115551eb.s3tc.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"imported_formats": ["s3tc_bptc"],
|
"imported_formats": ["s3tc_bptc"],
|
||||||
"vram_texture": true
|
"vram_texture": true
|
||||||
|
@ -11,8 +11,8 @@ metadata={
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://interior/tiles/limestone_dungeon/hole_normal.png"
|
source_file="res://interior/floors/dungeon_01/detail_normal.png"
|
||||||
dest_files=["res://.godot/imported/hole_normal.png-9c2f1eac05804bab609d1c67adcf7dba.s3tc.ctex"]
|
dest_files=["res://.godot/imported/detail_normal.png-7595efd28a96c6bf905bfa3c115551eb.s3tc.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ compress/channel_pack=0
|
||||||
mipmaps/generate=true
|
mipmaps/generate=true
|
||||||
mipmaps/limit=-1
|
mipmaps/limit=-1
|
||||||
roughness/mode=1
|
roughness/mode=1
|
||||||
roughness/src_normal="res://tiles/tiles/limestone_dungeon/hole_normal.png"
|
roughness/src_normal="res://interior/base/dungeon_01/detail_normal.png"
|
||||||
process/fix_alpha_border=true
|
process/fix_alpha_border=true
|
||||||
process/premult_alpha=false
|
process/premult_alpha=false
|
||||||
process/normal_map_invert_y=false
|
process/normal_map_invert_y=false
|
Binary file not shown.
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://bkpucv0ydae5v"
|
uid="uid://drq7jupbmwjil"
|
||||||
path.s3tc="res://.godot/imported/piping_orm.png-7131df07403ecb346d6a4793ca7929cb.s3tc.ctex"
|
path.s3tc="res://.godot/imported/detail_roughness.png-a65497af25f070db34e2dc4c6cdc9e62.s3tc.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"imported_formats": ["s3tc_bptc"],
|
"imported_formats": ["s3tc_bptc"],
|
||||||
"vram_texture": true
|
"vram_texture": true
|
||||||
|
@ -11,8 +11,8 @@ metadata={
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://interior/tiles/limestone_dungeon/piping_orm.png"
|
source_file="res://interior/floors/dungeon_01/detail_roughness.png"
|
||||||
dest_files=["res://.godot/imported/piping_orm.png-7131df07403ecb346d6a4793ca7929cb.s3tc.ctex"]
|
dest_files=["res://.godot/imported/detail_roughness.png-a65497af25f070db34e2dc4c6cdc9e62.s3tc.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
Binary file not shown.
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://leoab2fjmxgk"
|
uid="uid://c18mqalexrvc7"
|
||||||
path.s3tc="res://.godot/imported/tiling_orm.png-48bc1a5d8b2eae43d49ed818fa664d0d.s3tc.ctex"
|
path.s3tc="res://.godot/imported/floor_albedo.png-599373c4c817157e929da39c9a51e0ca.s3tc.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"imported_formats": ["s3tc_bptc"],
|
"imported_formats": ["s3tc_bptc"],
|
||||||
"vram_texture": true
|
"vram_texture": true
|
||||||
|
@ -11,8 +11,8 @@ metadata={
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://interior/tiles/limestone_dungeon/tiling_orm.png"
|
source_file="res://interior/floors/dungeon_01/floor_albedo.png"
|
||||||
dest_files=["res://.godot/imported/tiling_orm.png-48bc1a5d8b2eae43d49ed818fa664d0d.s3tc.ctex"]
|
dest_files=["res://.godot/imported/floor_albedo.png-599373c4c817157e929da39c9a51e0ca.s3tc.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
0
interior/tiles/limestone_dungeon/tiling_height.png → interior/floors/dungeon_01/floor_displacement.png
Executable file → Normal file
0
interior/tiles/limestone_dungeon/tiling_height.png → interior/floors/dungeon_01/floor_displacement.png
Executable file → Normal file
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://yu0p5ryoh7gr"
|
uid="uid://dfqtk4fo4t06c"
|
||||||
path.s3tc="res://.godot/imported/piping_albedo.png-e55409f9baf27938796d954b957086ac.s3tc.ctex"
|
path.s3tc="res://.godot/imported/floor_displacement.png-f55e2b97692cdec8c2f27530099f39e7.s3tc.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"imported_formats": ["s3tc_bptc"],
|
"imported_formats": ["s3tc_bptc"],
|
||||||
"vram_texture": true
|
"vram_texture": true
|
||||||
|
@ -11,8 +11,8 @@ metadata={
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://interior/tiles/limestone_dungeon/piping_albedo.png"
|
source_file="res://interior/floors/dungeon_01/floor_displacement.png"
|
||||||
dest_files=["res://.godot/imported/piping_albedo.png-e55409f9baf27938796d954b957086ac.s3tc.ctex"]
|
dest_files=["res://.godot/imported/floor_displacement.png-f55e2b97692cdec8c2f27530099f39e7.s3tc.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://bypqkn1tm036p"
|
uid="uid://tjepq8p30cxx"
|
||||||
path.s3tc="res://.godot/imported/piping_normal.png-4b6b5fc6d6cbc5e05f054f9e19463644.s3tc.ctex"
|
path.s3tc="res://.godot/imported/floor_normal.png-7eb4d134761af85dcd1aaa7f0004dc65.s3tc.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"imported_formats": ["s3tc_bptc"],
|
"imported_formats": ["s3tc_bptc"],
|
||||||
"vram_texture": true
|
"vram_texture": true
|
||||||
|
@ -11,8 +11,8 @@ metadata={
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://interior/tiles/limestone_dungeon/piping_normal.png"
|
source_file="res://interior/floors/dungeon_01/floor_normal.png"
|
||||||
dest_files=["res://.godot/imported/piping_normal.png-4b6b5fc6d6cbc5e05f054f9e19463644.s3tc.ctex"]
|
dest_files=["res://.godot/imported/floor_normal.png-7eb4d134761af85dcd1aaa7f0004dc65.s3tc.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ compress/channel_pack=0
|
||||||
mipmaps/generate=true
|
mipmaps/generate=true
|
||||||
mipmaps/limit=-1
|
mipmaps/limit=-1
|
||||||
roughness/mode=1
|
roughness/mode=1
|
||||||
roughness/src_normal="res://tiles/tiles/limestone_dungeon/piping_normal.png"
|
roughness/src_normal="res://interior/base/dungeon_01/floor_normal.png"
|
||||||
process/fix_alpha_border=true
|
process/fix_alpha_border=true
|
||||||
process/premult_alpha=false
|
process/premult_alpha=false
|
||||||
process/normal_map_invert_y=false
|
process/normal_map_invert_y=false
|
Binary file not shown.
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://dvqqmbf6r1jfm"
|
uid="uid://gry3ow88pjud"
|
||||||
path.s3tc="res://.godot/imported/hole_orm.png-00b1427da2cca528c854a97655dfff24.s3tc.ctex"
|
path.s3tc="res://.godot/imported/floor_orm.png-ad734700b85932ea8fe8e780643641b4.s3tc.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"imported_formats": ["s3tc_bptc"],
|
"imported_formats": ["s3tc_bptc"],
|
||||||
"vram_texture": true
|
"vram_texture": true
|
||||||
|
@ -11,8 +11,8 @@ metadata={
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://interior/tiles/limestone_dungeon/hole_orm.png"
|
source_file="res://interior/floors/dungeon_01/floor_orm.png"
|
||||||
dest_files=["res://.godot/imported/hole_orm.png-00b1427da2cca528c854a97655dfff24.s3tc.ctex"]
|
dest_files=["res://.godot/imported/floor_orm.png-ad734700b85932ea8fe8e780643641b4.s3tc.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
Binary file not shown.
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://c8p7qvcrfsio7"
|
uid="uid://bvmabp7btg0wo"
|
||||||
path.s3tc="res://.godot/imported/hole_height.png-875fd265b9470b3f52656ba603fc8eae.s3tc.ctex"
|
path.s3tc="res://.godot/imported/pillar_albedo.png-5307fa2f26f1bff72deafa48c97429c8.s3tc.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"imported_formats": ["s3tc_bptc"],
|
"imported_formats": ["s3tc_bptc"],
|
||||||
"vram_texture": true
|
"vram_texture": true
|
||||||
|
@ -11,8 +11,8 @@ metadata={
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://interior/tiles/limestone_dungeon/hole_height.png"
|
source_file="res://interior/floors/dungeon_01/pillar_albedo.png"
|
||||||
dest_files=["res://.godot/imported/hole_height.png-875fd265b9470b3f52656ba603fc8eae.s3tc.ctex"]
|
dest_files=["res://.godot/imported/pillar_albedo.png-5307fa2f26f1bff72deafa48c97429c8.s3tc.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
Binary file not shown.
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://byw6qkgod61ip"
|
uid="uid://y3fjjegrdm5t"
|
||||||
path.s3tc="res://.godot/imported/piping_height.png-d458ffb714345b35977ee0de9b01359f.s3tc.ctex"
|
path.s3tc="res://.godot/imported/pillar_displacement.png-86e9892e28aca9f87c864a28e6dfa2b7.s3tc.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"imported_formats": ["s3tc_bptc"],
|
"imported_formats": ["s3tc_bptc"],
|
||||||
"vram_texture": true
|
"vram_texture": true
|
||||||
|
@ -11,8 +11,8 @@ metadata={
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://interior/tiles/limestone_dungeon/piping_height.png"
|
source_file="res://interior/floors/dungeon_01/pillar_displacement.png"
|
||||||
dest_files=["res://.godot/imported/piping_height.png-d458ffb714345b35977ee0de9b01359f.s3tc.ctex"]
|
dest_files=["res://.godot/imported/pillar_displacement.png-86e9892e28aca9f87c864a28e6dfa2b7.s3tc.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://cv8yiluvc6mol"
|
uid="uid://dgteu01p0yvb1"
|
||||||
path.s3tc="res://.godot/imported/tiling_normal.png-877f08b7359b5aba3ea7d5681fd4e5a9.s3tc.ctex"
|
path.s3tc="res://.godot/imported/pillar_normal.png-3acce01d6d5a45e72d80bc85d1cccfeb.s3tc.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"imported_formats": ["s3tc_bptc"],
|
"imported_formats": ["s3tc_bptc"],
|
||||||
"vram_texture": true
|
"vram_texture": true
|
||||||
|
@ -11,8 +11,8 @@ metadata={
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://interior/tiles/limestone_dungeon/tiling_normal.png"
|
source_file="res://interior/floors/dungeon_01/pillar_normal.png"
|
||||||
dest_files=["res://.godot/imported/tiling_normal.png-877f08b7359b5aba3ea7d5681fd4e5a9.s3tc.ctex"]
|
dest_files=["res://.godot/imported/pillar_normal.png-3acce01d6d5a45e72d80bc85d1cccfeb.s3tc.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ compress/channel_pack=0
|
||||||
mipmaps/generate=true
|
mipmaps/generate=true
|
||||||
mipmaps/limit=-1
|
mipmaps/limit=-1
|
||||||
roughness/mode=1
|
roughness/mode=1
|
||||||
roughness/src_normal="res://tiles/tiles/limestone_dungeon/tiling_normal.png"
|
roughness/src_normal="res://interior/base/dungeon_01/pillar_normal.png"
|
||||||
process/fix_alpha_border=true
|
process/fix_alpha_border=true
|
||||||
process/premult_alpha=false
|
process/premult_alpha=false
|
||||||
process/normal_map_invert_y=false
|
process/normal_map_invert_y=false
|
Binary file not shown.
|
@ -0,0 +1,34 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://bm2n01vq8gfr6"
|
||||||
|
path="res://.godot/imported/pillar_roughness.png-0687f96b048e5362061de3455df15e28.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://interior/floors/dungeon_01/pillar_roughness.png"
|
||||||
|
dest_files=["res://.godot/imported/pillar_roughness.png-0687f96b048e5362061de3455df15e28.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
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
|
Binary file not shown.
|
@ -0,0 +1,209 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="scene"
|
||||||
|
importer_version=1
|
||||||
|
type="PackedScene"
|
||||||
|
uid="uid://4bd55k678gi7"
|
||||||
|
path="res://.godot/imported/tiles.glb-14a9c594afd12965ca2410ae30c0dee5.scn"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://interior/floors/dungeon_01/tiles.glb"
|
||||||
|
dest_files=["res://.godot/imported/tiles.glb-14a9c594afd12965ca2410ae30c0dee5.scn"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
nodes/root_type="Node3D"
|
||||||
|
nodes/root_name="Scene Root"
|
||||||
|
nodes/apply_root_scale=true
|
||||||
|
nodes/root_scale=1.0
|
||||||
|
meshes/ensure_tangents=true
|
||||||
|
meshes/generate_lods=true
|
||||||
|
meshes/create_shadow_meshes=true
|
||||||
|
meshes/light_baking=1
|
||||||
|
meshes/lightmap_texel_size=0.2
|
||||||
|
skins/use_named_skins=true
|
||||||
|
animation/import=false
|
||||||
|
animation/fps=30
|
||||||
|
animation/trimming=false
|
||||||
|
animation/remove_immutable_tracks=true
|
||||||
|
import_script/path=""
|
||||||
|
_subresources={
|
||||||
|
"materials": {
|
||||||
|
"Detail": {
|
||||||
|
"use_external/enabled": true,
|
||||||
|
"use_external/path": "res://interior/base/dungeon_01/detail_material.res"
|
||||||
|
},
|
||||||
|
"Floor": {
|
||||||
|
"use_external/enabled": true,
|
||||||
|
"use_external/path": "res://interior/base/dungeon_01/floor_material.res"
|
||||||
|
},
|
||||||
|
"Pillar": {
|
||||||
|
"use_external/enabled": true,
|
||||||
|
"use_external/path": "res://interior/base/dungeon_01/pillar_material.res"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"meshes": {
|
||||||
|
"tiles_corner_north_east": {
|
||||||
|
"generate/lightmap_uv": 0,
|
||||||
|
"generate/lods": 0,
|
||||||
|
"generate/shadow_meshes": 0,
|
||||||
|
"lods/normal_merge_angle": 60.0,
|
||||||
|
"lods/normal_split_angle": 25.0,
|
||||||
|
"save_to_file/enabled": true,
|
||||||
|
"save_to_file/make_streamable": "",
|
||||||
|
"save_to_file/path": "res://interior/base/dungeon_01/tiles_corner_north_east.res"
|
||||||
|
},
|
||||||
|
"tiles_corner_north_west": {
|
||||||
|
"generate/lightmap_uv": 0,
|
||||||
|
"generate/lods": 0,
|
||||||
|
"generate/shadow_meshes": 0,
|
||||||
|
"lods/normal_merge_angle": 60.0,
|
||||||
|
"lods/normal_split_angle": 25.0,
|
||||||
|
"save_to_file/enabled": true,
|
||||||
|
"save_to_file/make_streamable": "",
|
||||||
|
"save_to_file/path": "res://interior/base/dungeon_01/tiles_corner_north_west.res"
|
||||||
|
},
|
||||||
|
"tiles_corner_south_east": {
|
||||||
|
"generate/lightmap_uv": 0,
|
||||||
|
"generate/lods": 0,
|
||||||
|
"generate/shadow_meshes": 0,
|
||||||
|
"lods/normal_merge_angle": 60.0,
|
||||||
|
"lods/normal_split_angle": 25.0,
|
||||||
|
"save_to_file/enabled": true,
|
||||||
|
"save_to_file/make_streamable": "",
|
||||||
|
"save_to_file/path": "res://interior/base/dungeon_01/tiles_corner_south_east.res"
|
||||||
|
},
|
||||||
|
"tiles_corner_south_west": {
|
||||||
|
"generate/lightmap_uv": 0,
|
||||||
|
"generate/lods": 0,
|
||||||
|
"generate/shadow_meshes": 0,
|
||||||
|
"lods/normal_merge_angle": 60.0,
|
||||||
|
"lods/normal_split_angle": 25.0,
|
||||||
|
"save_to_file/enabled": true,
|
||||||
|
"save_to_file/make_streamable": "",
|
||||||
|
"save_to_file/path": "res://interior/base/dungeon_01/tiles_corner_south_west.res"
|
||||||
|
},
|
||||||
|
"tiles_edge_east": {
|
||||||
|
"generate/lightmap_uv": 0,
|
||||||
|
"generate/lods": 0,
|
||||||
|
"generate/shadow_meshes": 0,
|
||||||
|
"lods/normal_merge_angle": 60.0,
|
||||||
|
"lods/normal_split_angle": 25.0,
|
||||||
|
"save_to_file/enabled": true,
|
||||||
|
"save_to_file/make_streamable": "",
|
||||||
|
"save_to_file/path": "res://interior/base/dungeon_01/tiles_edge_east.res"
|
||||||
|
},
|
||||||
|
"tiles_edge_north": {
|
||||||
|
"generate/lightmap_uv": 0,
|
||||||
|
"generate/lods": 0,
|
||||||
|
"generate/shadow_meshes": 0,
|
||||||
|
"lods/normal_merge_angle": 60.0,
|
||||||
|
"lods/normal_split_angle": 25.0,
|
||||||
|
"save_to_file/enabled": true,
|
||||||
|
"save_to_file/make_streamable": "",
|
||||||
|
"save_to_file/path": "res://interior/base/dungeon_01/tiles_edge_north.res"
|
||||||
|
},
|
||||||
|
"tiles_edge_south": {
|
||||||
|
"generate/lightmap_uv": 0,
|
||||||
|
"generate/lods": 0,
|
||||||
|
"generate/shadow_meshes": 0,
|
||||||
|
"lods/normal_merge_angle": 60.0,
|
||||||
|
"lods/normal_split_angle": 25.0,
|
||||||
|
"save_to_file/enabled": true,
|
||||||
|
"save_to_file/make_streamable": "",
|
||||||
|
"save_to_file/path": "res://interior/base/dungeon_01/tiles_edge_south.res"
|
||||||
|
},
|
||||||
|
"tiles_edge_west": {
|
||||||
|
"generate/lightmap_uv": 0,
|
||||||
|
"generate/lods": 0,
|
||||||
|
"generate/shadow_meshes": 0,
|
||||||
|
"lods/normal_merge_angle": 60.0,
|
||||||
|
"lods/normal_split_angle": 25.0,
|
||||||
|
"save_to_file/enabled": true,
|
||||||
|
"save_to_file/make_streamable": "",
|
||||||
|
"save_to_file/path": "res://interior/base/dungeon_01/tiles_edge_west.res"
|
||||||
|
},
|
||||||
|
"tiles_endcap_east": {
|
||||||
|
"generate/lightmap_uv": 0,
|
||||||
|
"generate/lods": 0,
|
||||||
|
"generate/shadow_meshes": 0,
|
||||||
|
"lods/normal_merge_angle": 60.0,
|
||||||
|
"lods/normal_split_angle": 25.0,
|
||||||
|
"save_to_file/enabled": true,
|
||||||
|
"save_to_file/make_streamable": "",
|
||||||
|
"save_to_file/path": "res://interior/base/dungeon_01/tiles_endcap_east.res"
|
||||||
|
},
|
||||||
|
"tiles_endcap_north": {
|
||||||
|
"generate/lightmap_uv": 0,
|
||||||
|
"generate/lods": 0,
|
||||||
|
"generate/shadow_meshes": 0,
|
||||||
|
"lods/normal_merge_angle": 60.0,
|
||||||
|
"lods/normal_split_angle": 25.0,
|
||||||
|
"save_to_file/enabled": true,
|
||||||
|
"save_to_file/make_streamable": "",
|
||||||
|
"save_to_file/path": "res://interior/base/dungeon_01/tiles_endcap_north.res"
|
||||||
|
},
|
||||||
|
"tiles_endcap_south": {
|
||||||
|
"generate/lightmap_uv": 0,
|
||||||
|
"generate/lods": 0,
|
||||||
|
"generate/shadow_meshes": 0,
|
||||||
|
"lods/normal_merge_angle": 60.0,
|
||||||
|
"lods/normal_split_angle": 25.0,
|
||||||
|
"save_to_file/enabled": true,
|
||||||
|
"save_to_file/make_streamable": "",
|
||||||
|
"save_to_file/path": "res://interior/base/dungeon_01/tiles_endcap_south.res"
|
||||||
|
},
|
||||||
|
"tiles_endcap_west": {
|
||||||
|
"generate/lightmap_uv": 0,
|
||||||
|
"generate/lods": 0,
|
||||||
|
"generate/shadow_meshes": 0,
|
||||||
|
"lods/normal_merge_angle": 60.0,
|
||||||
|
"lods/normal_split_angle": 25.0,
|
||||||
|
"save_to_file/enabled": true,
|
||||||
|
"save_to_file/make_streamable": "",
|
||||||
|
"save_to_file/path": "res://interior/base/dungeon_01/tiles_endcap_west.res"
|
||||||
|
},
|
||||||
|
"tiles_fill": {
|
||||||
|
"generate/lightmap_uv": 0,
|
||||||
|
"generate/lods": 0,
|
||||||
|
"generate/shadow_meshes": 0,
|
||||||
|
"lods/normal_merge_angle": 60.0,
|
||||||
|
"lods/normal_split_angle": 25.0,
|
||||||
|
"save_to_file/enabled": true,
|
||||||
|
"save_to_file/make_streamable": "",
|
||||||
|
"save_to_file/path": "res://interior/base/dungeon_01/tiles_fill.res"
|
||||||
|
},
|
||||||
|
"tiles_island": {
|
||||||
|
"generate/lightmap_uv": 0,
|
||||||
|
"generate/lods": 0,
|
||||||
|
"generate/shadow_meshes": 0,
|
||||||
|
"lods/normal_merge_angle": 60.0,
|
||||||
|
"lods/normal_split_angle": 25.0,
|
||||||
|
"save_to_file/enabled": true,
|
||||||
|
"save_to_file/make_streamable": "",
|
||||||
|
"save_to_file/path": "res://interior/base/dungeon_01/tiles_island.res"
|
||||||
|
},
|
||||||
|
"tiles_path_horizontal": {
|
||||||
|
"generate/lightmap_uv": 0,
|
||||||
|
"generate/lods": 0,
|
||||||
|
"generate/shadow_meshes": 0,
|
||||||
|
"lods/normal_merge_angle": 60.0,
|
||||||
|
"lods/normal_split_angle": 25.0,
|
||||||
|
"save_to_file/enabled": true,
|
||||||
|
"save_to_file/make_streamable": "",
|
||||||
|
"save_to_file/path": "res://interior/base/dungeon_01/tiles_path_horizontal.res"
|
||||||
|
},
|
||||||
|
"tiles_path_vertical": {
|
||||||
|
"generate/lightmap_uv": 0,
|
||||||
|
"generate/lods": 0,
|
||||||
|
"generate/shadow_meshes": 0,
|
||||||
|
"lods/normal_merge_angle": 60.0,
|
||||||
|
"lods/normal_split_angle": 25.0,
|
||||||
|
"save_to_file/enabled": true,
|
||||||
|
"save_to_file/make_streamable": "",
|
||||||
|
"save_to_file/path": "res://interior/base/dungeon_01/tiles_path_vertical.res"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
gltf/embedded_image_handling=0
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -3,7 +3,7 @@
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://didp3nfacohwd"
|
uid="uid://didp3nfacohwd"
|
||||||
path.s3tc="res://.godot/imported/tiling_height.png-2ead72b43d4a6de847e50bcbd8e8c7f7.s3tc.ctex"
|
path.s3tc="res://.godot/imported/dungeon_01_tiles_height.png-7733c18dddd7d5bf80deae891d3de52e.s3tc.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"imported_formats": ["s3tc_bptc"],
|
"imported_formats": ["s3tc_bptc"],
|
||||||
"vram_texture": true
|
"vram_texture": true
|
||||||
|
@ -11,8 +11,8 @@ metadata={
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://interior/tiles/limestone_dungeon/tiling_height.png"
|
source_file="res://interior/base/dungeon_01_tiles_height.png"
|
||||||
dest_files=["res://.godot/imported/tiling_height.png-2ead72b43d4a6de847e50bcbd8e8c7f7.s3tc.ctex"]
|
dest_files=["res://.godot/imported/dungeon_01_tiles_height.png-7733c18dddd7d5bf80deae891d3de52e.s3tc.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
class_name InteriorFloor extends Resource
|
||||||
|
|
||||||
|
@export
|
||||||
|
var corner_north_east_mesh: Mesh = null
|
||||||
|
|
||||||
|
@export
|
||||||
|
var corner_north_west_mesh: Mesh = null
|
||||||
|
|
||||||
|
@export
|
||||||
|
var corner_south_east_mesh: Mesh = null
|
||||||
|
|
||||||
|
@export
|
||||||
|
var corner_south_west_mesh: Mesh = null
|
||||||
|
|
||||||
|
@export
|
||||||
|
var edge_east_mesh: Mesh = null
|
||||||
|
|
||||||
|
@export
|
||||||
|
var edge_north_mesh: Mesh = null
|
||||||
|
|
||||||
|
@export
|
||||||
|
var edge_south_mesh: Mesh = null
|
||||||
|
|
||||||
|
@export
|
||||||
|
var edge_west_mesh: Mesh = null
|
||||||
|
|
||||||
|
@export
|
||||||
|
var endcap_east_mesh: Mesh = null
|
||||||
|
|
||||||
|
@export
|
||||||
|
var endcap_north_mesh: Mesh = null
|
||||||
|
|
||||||
|
@export
|
||||||
|
var endcap_south_mesh: Mesh = null
|
||||||
|
|
||||||
|
@export
|
||||||
|
var endcap_west_mesh: Mesh = null
|
||||||
|
|
||||||
|
@export
|
||||||
|
var fill_mesh: Mesh = null
|
||||||
|
|
||||||
|
@export
|
||||||
|
var island_mesh: Mesh = null
|
||||||
|
|
||||||
|
@export
|
||||||
|
var path_horizontal_mesh: Mesh = null
|
||||||
|
|
||||||
|
@export
|
||||||
|
var path_vertical_mesh: Mesh = null
|
|
@ -2,173 +2,212 @@ class_name InteriorMap extends Node3D
|
||||||
|
|
||||||
const _CHUNK_SIZE := 32
|
const _CHUNK_SIZE := 32
|
||||||
|
|
||||||
|
const _HALF_PI := PI / 2
|
||||||
|
|
||||||
const _GRID_ORIGIN := Vector2(0.5, 0.5)
|
const _GRID_ORIGIN := Vector2(0.5, 0.5)
|
||||||
|
|
||||||
##
|
##
|
||||||
## Cardinal orientation referencing the direction of a tile.
|
|
||||||
##
|
##
|
||||||
|
##
|
||||||
|
enum FloorTile {
|
||||||
|
ISLAND,
|
||||||
|
ENDCAP_WEST,
|
||||||
|
ENDCAP_NORTH,
|
||||||
|
CORNER_NORTH_WEST,
|
||||||
|
ENDCAP_EAST,
|
||||||
|
PATH_HORIZONTAL,
|
||||||
|
CORNER_NORTH_EAST,
|
||||||
|
EDGE_NORTH,
|
||||||
|
ENDCAP_SOUTH,
|
||||||
|
CORNER_SOUTH_WEST,
|
||||||
|
PATH_VERTICAL,
|
||||||
|
EDGE_WEST,
|
||||||
|
CORNER_SOUTH_EAST,
|
||||||
|
EDGE_SOUTH,
|
||||||
|
EDGE_EAST,
|
||||||
|
FILL,
|
||||||
|
}
|
||||||
|
|
||||||
enum Orientation {
|
enum Orientation {
|
||||||
NORTH,
|
EAST = 2 ** 0,
|
||||||
EAST,
|
SOUTH = 2 ** 1,
|
||||||
SOUTH,
|
WEST = 2 ** 2,
|
||||||
WEST,
|
NORTH = 2 ** 3,
|
||||||
}
|
}
|
||||||
|
|
||||||
##
|
##
|
||||||
## Baked block of meshes making up a segment of the grid.
|
## Baked block of meshes making up a segment of the grid.
|
||||||
##
|
##
|
||||||
class Chunk:
|
class Chunk:
|
||||||
var _floor_meshes: Array[Mesh] = []
|
var _coordinates := Vector2i.ZERO
|
||||||
|
|
||||||
var _floor_orientation := PackedInt32Array()
|
var _interior_map: InteriorMap = null
|
||||||
|
|
||||||
var _multi_mesh_instances: Array[MultiMeshInstance] = []
|
var _meshes_by_floor_tile: Array[Mesh] = []
|
||||||
|
|
||||||
var _wall_meshes: Array[Mesh] = []
|
var _renderable_by_floor_tile: Array[Renderable] = []
|
||||||
|
|
||||||
var _wall_orientation := PackedInt32Array()
|
func _init(interior_map: InteriorMap, coordinates: Vector2i) -> void:
|
||||||
|
_interior_map = interior_map
|
||||||
|
_coordinates = coordinates
|
||||||
|
|
||||||
func _init() -> void:
|
var floor_tile_count := FloorTile.size()
|
||||||
var buffer_size := _CHUNK_SIZE * _CHUNK_SIZE
|
|
||||||
|
|
||||||
_floor_meshes.resize(buffer_size)
|
_renderable_by_floor_tile.resize(floor_tile_count)
|
||||||
_floor_orientation.resize(buffer_size)
|
_meshes_by_floor_tile.resize(floor_tile_count)
|
||||||
_wall_meshes.resize(buffer_size)
|
|
||||||
_wall_orientation.resize(buffer_size)
|
|
||||||
|
|
||||||
##
|
##
|
||||||
## Invalidates the mesh block, re-baking its contents from the current mesh data set.
|
## Invalidates the mesh block, re-baking its contents from the current mesh data set.
|
||||||
##
|
##
|
||||||
func invalidate(interior_map: InteriorMap, coordinate: Vector2i) -> void:
|
func invalidate() -> void:
|
||||||
# TODO: Once this is all lowered into native code, look for ways to parallelize the loops.
|
_renderable_by_floor_tile.fill(null)
|
||||||
for multi_mesh_instance in _multi_mesh_instances:
|
|
||||||
RenderingServer.free_rid(multi_mesh_instance._instance_rid)
|
|
||||||
RenderingServer.free_rid(multi_mesh_instance._multimesh_rid)
|
|
||||||
|
|
||||||
_multi_mesh_instances.clear()
|
var interior_floor := _interior_map.interior_floor
|
||||||
|
|
||||||
# Normalize mesh instance data for the chunk.
|
if interior_floor == null:
|
||||||
var transforms_by_mesh := {}
|
_meshes_by_floor_tile.fill(null)
|
||||||
var grid_size := interior_map.size
|
|
||||||
var half_pi := PI / 2
|
|
||||||
|
|
||||||
for i in _floor_meshes.size():
|
else:
|
||||||
var mesh := _floor_meshes[i]
|
_meshes_by_floor_tile[FloorTile.CORNER_NORTH_EAST] = interior_floor.corner_north_east_mesh
|
||||||
|
_meshes_by_floor_tile[FloorTile.CORNER_NORTH_WEST] = interior_floor.corner_north_west_mesh
|
||||||
|
_meshes_by_floor_tile[FloorTile.CORNER_SOUTH_EAST] = interior_floor.corner_south_east_mesh
|
||||||
|
_meshes_by_floor_tile[FloorTile.CORNER_SOUTH_WEST] = interior_floor.corner_south_west_mesh
|
||||||
|
_meshes_by_floor_tile[FloorTile.EDGE_EAST] = interior_floor.edge_east_mesh
|
||||||
|
_meshes_by_floor_tile[FloorTile.EDGE_NORTH] = interior_floor.edge_north_mesh
|
||||||
|
_meshes_by_floor_tile[FloorTile.EDGE_SOUTH] = interior_floor.edge_south_mesh
|
||||||
|
_meshes_by_floor_tile[FloorTile.EDGE_WEST] = interior_floor.edge_west_mesh
|
||||||
|
_meshes_by_floor_tile[FloorTile.ENDCAP_EAST] = interior_floor.endcap_east_mesh
|
||||||
|
_meshes_by_floor_tile[FloorTile.ENDCAP_NORTH] = interior_floor.endcap_north_mesh
|
||||||
|
_meshes_by_floor_tile[FloorTile.ENDCAP_SOUTH] = interior_floor.endcap_south_mesh
|
||||||
|
_meshes_by_floor_tile[FloorTile.ENDCAP_WEST] = interior_floor.endcap_west_mesh
|
||||||
|
_meshes_by_floor_tile[FloorTile.FILL] = interior_floor.fill_mesh
|
||||||
|
_meshes_by_floor_tile[FloorTile.ISLAND] = interior_floor.island_mesh
|
||||||
|
_meshes_by_floor_tile[FloorTile.PATH_HORIZONTAL] = interior_floor.path_horizontal_mesh
|
||||||
|
_meshes_by_floor_tile[FloorTile.PATH_VERTICAL] = interior_floor.path_vertical_mesh
|
||||||
|
|
||||||
|
var floor_map := _interior_map._floor_map
|
||||||
|
var map_size := _interior_map.size
|
||||||
|
var offset := _coordinates * _CHUNK_SIZE
|
||||||
|
var positions_by_floor_tile: Array[PackedVector2Array] = []
|
||||||
|
|
||||||
|
positions_by_floor_tile.resize(FloorTile.size())
|
||||||
|
|
||||||
|
# Find floor tile types.
|
||||||
|
for y in _CHUNK_SIZE:
|
||||||
|
for x in _CHUNK_SIZE:
|
||||||
|
if floor_map.get_bitv(offset + Vector2i(x, y)):
|
||||||
|
var tile := 0
|
||||||
|
|
||||||
|
for i in Orientation.values().size():
|
||||||
|
var delta_x := roundi(cos(i * PI / 2.0))
|
||||||
|
var delta_y := roundi(sin(i * PI / 2.0))
|
||||||
|
|
||||||
|
if (0 <= (y + int(delta_y < map_size.y))) and (0 <= (x + int(delta_x < map_size.x))):
|
||||||
|
tile += int(floor_map.get_bit(x + delta_x, y + delta_y)) * 2 ** i
|
||||||
|
|
||||||
|
positions_by_floor_tile[tile].append(Vector2(x, y))
|
||||||
|
|
||||||
|
# (Re)-bake tiles into multimesh instances for the chunk.
|
||||||
|
var scenario_rid := _interior_map.get_world_3d().scenario
|
||||||
|
|
||||||
|
for i in FloorTile.size():
|
||||||
|
var floor_positions := positions_by_floor_tile[i]
|
||||||
|
|
||||||
|
if not(floor_positions.is_empty()):
|
||||||
|
var mesh := _meshes_by_floor_tile[i]
|
||||||
|
|
||||||
if mesh != null:
|
if mesh != null:
|
||||||
if not(mesh in transforms_by_mesh):
|
var floor_position_count := floor_positions.size()
|
||||||
transforms_by_mesh[mesh] = []
|
var renderable := Renderable.new(scenario_rid, _meshes_by_floor_tile[i].get_rid(), floor_position_count)
|
||||||
|
|
||||||
transforms_by_mesh[mesh].append(Transform3D(
|
for j in floor_position_count:
|
||||||
Basis.IDENTITY.rotated(Vector3.UP, half_pi * _floor_orientation[i]), Vector3(
|
var tile_position := floor_positions[j]
|
||||||
(float(coordinate.x * _CHUNK_SIZE) + (i % _CHUNK_SIZE)) -
|
|
||||||
(float(grid_size.x) * _GRID_ORIGIN.x) + 0.5, 0.0,
|
|
||||||
(float(coordinate.y * _CHUNK_SIZE) + (i / _CHUNK_SIZE)) -
|
|
||||||
(float(grid_size.y) * _GRID_ORIGIN.y) + 0.5)))
|
|
||||||
|
|
||||||
for i in _wall_meshes.size():
|
renderable.set_instance_transform(j, Transform3D(Basis.IDENTITY, Vector3(
|
||||||
var mesh := _wall_meshes[i]
|
((float(offset.x) + tile_position.x) - (float(map_size.x) * _GRID_ORIGIN.x)) + 0.5,
|
||||||
|
0.0,
|
||||||
|
((float(offset.y) + tile_position.y) - (float(map_size.y) * _GRID_ORIGIN.y)) + 0.5)))
|
||||||
|
|
||||||
if mesh != null:
|
_renderable_by_floor_tile[i] = renderable
|
||||||
if not(mesh in transforms_by_mesh):
|
|
||||||
transforms_by_mesh[mesh] = []
|
|
||||||
|
|
||||||
transforms_by_mesh[mesh].append(Transform3D(
|
func set_transform(transform: Transform3D) -> void:
|
||||||
Basis.IDENTITY.rotated(Vector3.UP, half_pi * _wall_orientation[i]), Vector3(
|
for renderable in _renderable_by_floor_tile:
|
||||||
(float(coordinate.x * _CHUNK_SIZE) + (i % _CHUNK_SIZE)) -
|
if renderable != null:
|
||||||
(float(grid_size.x) * _GRID_ORIGIN.x) + 0.5, 0.0,
|
renderable.set_transform(transform)
|
||||||
(float(coordinate.y * _CHUNK_SIZE) + (i / _CHUNK_SIZE)) -
|
|
||||||
(float(grid_size.y) * _GRID_ORIGIN.y) + 0.5)))
|
|
||||||
|
|
||||||
# (Re)-bake into multimesh instances for the chunk.
|
func set_visible(visible: bool) -> void:
|
||||||
var scenario_rid := interior_map.get_world_3d().scenario
|
for renderable in _renderable_by_floor_tile:
|
||||||
var global_transform := interior_map.global_transform
|
if renderable != null:
|
||||||
|
renderable.set_visible(visible)
|
||||||
for chunk_mesh in transforms_by_mesh:
|
|
||||||
var multi_mesh_instance := MultiMeshInstance.new(
|
|
||||||
scenario_rid, chunk_mesh.get_rid(), transforms_by_mesh[chunk_mesh])
|
|
||||||
|
|
||||||
multi_mesh_instance.set_offset(global_transform)
|
|
||||||
_multi_mesh_instances.append(multi_mesh_instance)
|
|
||||||
|
|
||||||
##
|
##
|
||||||
## Sets the floor mesh in the chunk at the location relative [code]coordinatess[/code] to
|
|
||||||
## [code]mesh[/code].
|
|
||||||
##
|
##
|
||||||
## *Note* that [method Chunk.invalidate] must be called at some point after to visually update
|
|
||||||
## the chunk.
|
|
||||||
##
|
##
|
||||||
func set_floor_mesh(coordinates: Vector2i, orientation: Orientation, mesh: Mesh) -> void:
|
class Renderable:
|
||||||
var index := (_CHUNK_SIZE * coordinates.y) + coordinates.x
|
|
||||||
|
|
||||||
_floor_orientation[index] = orientation
|
|
||||||
_floor_meshes[index] = mesh
|
|
||||||
|
|
||||||
##
|
|
||||||
## Sets the wall mesh in the chunk at the location relative [code]coordinatess[/code] to
|
|
||||||
## [code]mesh[/code].
|
|
||||||
##
|
|
||||||
## *Note* that [method Chunk.invalidate] must be called at some point after to visually update
|
|
||||||
## the chunk.
|
|
||||||
##
|
|
||||||
func set_wall_mesh(coordinates: Vector2i, orientation: Orientation, mesh: Mesh) -> void:
|
|
||||||
var index := (_CHUNK_SIZE * coordinates.y) + coordinates.x
|
|
||||||
|
|
||||||
_wall_orientation[index] = orientation
|
|
||||||
_wall_meshes[index] = mesh
|
|
||||||
|
|
||||||
##
|
|
||||||
## Specialized multi-mesh instance convenience for use within the tile grid and its chunks.
|
|
||||||
##
|
|
||||||
class MultiMeshInstance:
|
|
||||||
var _instance_rid := RID()
|
var _instance_rid := RID()
|
||||||
|
|
||||||
var _multimesh_rid := RID()
|
var _multimesh_rid := RID()
|
||||||
|
|
||||||
func _init(scenario_rid: RID, mesh_rid: RID, transforms: Array) -> void:
|
func _init(scenario_rid: RID, mesh_rid: RID, transform_count: int) -> void:
|
||||||
_multimesh_rid = RenderingServer.multimesh_create()
|
_multimesh_rid = RenderingServer.multimesh_create()
|
||||||
_instance_rid = RenderingServer.instance_create2(_multimesh_rid, scenario_rid)
|
_instance_rid = RenderingServer.instance_create2(_multimesh_rid, scenario_rid)
|
||||||
|
|
||||||
RenderingServer.multimesh_set_mesh(_multimesh_rid, mesh_rid)
|
RenderingServer.multimesh_set_mesh(_multimesh_rid, mesh_rid)
|
||||||
|
|
||||||
var transform_count := transforms.size()
|
|
||||||
|
|
||||||
RenderingServer.multimesh_allocate_data(_multimesh_rid,
|
RenderingServer.multimesh_allocate_data(_multimesh_rid,
|
||||||
transform_count, RenderingServer.MULTIMESH_TRANSFORM_3D, true)
|
transform_count, RenderingServer.MULTIMESH_TRANSFORM_3D, true)
|
||||||
|
|
||||||
for i in transform_count:
|
func _notification(what: int) -> void:
|
||||||
RenderingServer.multimesh_instance_set_transform(_multimesh_rid, i, transforms[i])
|
match what:
|
||||||
|
NOTIFICATION_PREDELETE:
|
||||||
|
RenderingServer.free_rid(_instance_rid)
|
||||||
|
RenderingServer.free_rid(_multimesh_rid)
|
||||||
|
|
||||||
##
|
##
|
||||||
## Sets the transform of the instance to [code]offset[/code].
|
|
||||||
##
|
##
|
||||||
func set_offset(offset: Transform3D) -> void:
|
##
|
||||||
RenderingServer.instance_set_transform(_instance_rid, offset)
|
func set_instance_transform(instance_index: int, transform: Transform3D) -> void:
|
||||||
|
RenderingServer.multimesh_instance_set_transform(_multimesh_rid, instance_index, transform)
|
||||||
|
|
||||||
##
|
##
|
||||||
## Sets the visibility of the instance to [code]is_visible[/code].
|
|
||||||
##
|
##
|
||||||
func set_visible(is_visible: bool) -> void:
|
##
|
||||||
RenderingServer.instance_set_visible(_instance_rid, is_visible)
|
func set_visible(visible: bool) -> void:
|
||||||
|
RenderingServer.instance_set_visible(_instance_rid, visible)
|
||||||
|
|
||||||
|
##
|
||||||
|
##
|
||||||
|
##
|
||||||
|
func set_transform(transform: Transform3D) -> void:
|
||||||
|
RenderingServer.instance_set_transform(_instance_rid, transform)
|
||||||
|
|
||||||
var _chunks: Array[Chunk] = []
|
var _chunks: Array[Chunk] = []
|
||||||
|
|
||||||
var _chunks_size := Vector2i.ZERO
|
var _chunks_size := Vector2i.ZERO
|
||||||
|
|
||||||
|
var _floor_map := BitMap.new()
|
||||||
|
|
||||||
|
##
|
||||||
|
##
|
||||||
|
##
|
||||||
|
@export
|
||||||
|
var interior_floor: InteriorFloor = null
|
||||||
|
|
||||||
##
|
##
|
||||||
## Size of the tile grid (in engine units).
|
## Size of the tile grid (in engine units).
|
||||||
##
|
##
|
||||||
@export
|
@export
|
||||||
var size: Vector2i:
|
var size: Vector2i:
|
||||||
set(value):
|
set(value):
|
||||||
var chunk_size_factor := float(_CHUNK_SIZE)
|
|
||||||
|
|
||||||
_chunks.resize(int(ceilf(value.x / chunk_size_factor) * ceilf(value.y / chunk_size_factor)))
|
|
||||||
|
|
||||||
for i in _chunks.size():
|
|
||||||
_chunks[i] = Chunk.new()
|
|
||||||
|
|
||||||
_chunks_size = Vector2i((value / float(_CHUNK_SIZE)).ceil())
|
_chunks_size = Vector2i((value / float(_CHUNK_SIZE)).ceil())
|
||||||
|
|
||||||
|
_floor_map.resize(value)
|
||||||
|
_chunks.resize(_chunks_size.x * _chunks_size.y)
|
||||||
|
|
||||||
|
for y in _chunks_size.y:
|
||||||
|
for x in _chunks_size.x:
|
||||||
|
_chunks[(y * _CHUNK_SIZE) + x] = Chunk.new(self, Vector2i(x, y))
|
||||||
|
|
||||||
size = value
|
size = value
|
||||||
|
|
||||||
func _get_chunk(chunk_coordinate: Vector2i) -> Chunk:
|
func _get_chunk(chunk_coordinate: Vector2i) -> Chunk:
|
||||||
|
@ -178,13 +217,11 @@ func _notification(what: int) -> void:
|
||||||
match what:
|
match what:
|
||||||
NOTIFICATION_TRANSFORM_CHANGED:
|
NOTIFICATION_TRANSFORM_CHANGED:
|
||||||
for chunk in _chunks:
|
for chunk in _chunks:
|
||||||
for multi_mesh_instance in chunk._multi_mesh_instances:
|
chunk.set_transform(global_transform)
|
||||||
multi_mesh_instance.set_offset_transform(global_transform)
|
|
||||||
|
|
||||||
NOTIFICATION_VISIBILITY_CHANGED:
|
NOTIFICATION_VISIBILITY_CHANGED:
|
||||||
for chunk in _chunks:
|
for chunk in _chunks:
|
||||||
for multi_mesh_instance in chunk._multi_mesh_instances:
|
chunk.set_visible(visible)
|
||||||
multi_mesh_instance.set_visible(visible)
|
|
||||||
|
|
||||||
##
|
##
|
||||||
## Clears the entirety of the tile grid to only contain tiles of instance [code]tile[/code] pointing
|
## Clears the entirety of the tile grid to only contain tiles of instance [code]tile[/code] pointing
|
||||||
|
@ -192,42 +229,14 @@ func _notification(what: int) -> void:
|
||||||
##
|
##
|
||||||
## For clearing a specific region of the mesh grid, see [method fill_mesh].
|
## For clearing a specific region of the mesh grid, see [method fill_mesh].
|
||||||
##
|
##
|
||||||
func clear_tiles(orientation: Orientation, tile: InteriorTile) -> void:
|
func clear() -> void:
|
||||||
if tile == null:
|
|
||||||
for y in size.y:
|
for y in size.y:
|
||||||
for x in size.x:
|
for x in size.x:
|
||||||
var coordinates := Vector2i(x, y)
|
_floor_map.set_bit(x, y, false)
|
||||||
var chunk := _get_chunk(coordinates / _CHUNK_SIZE)
|
|
||||||
var chunk_coordinates := coordinates % _CHUNK_SIZE
|
|
||||||
|
|
||||||
chunk.set_floor_mesh(chunk_coordinates, orientation, null)
|
|
||||||
chunk.set_wall_mesh(chunk_coordinates, orientation, null)
|
|
||||||
|
|
||||||
else:
|
|
||||||
var mesh := tile.mesh
|
|
||||||
|
|
||||||
match tile.kind:
|
|
||||||
InteriorTile.Kind.FLOOR:
|
|
||||||
for y in size.y:
|
|
||||||
for x in size.x:
|
|
||||||
var coordinate := Vector2i(x, y)
|
|
||||||
|
|
||||||
_get_chunk(coordinate / _CHUNK_SIZE).\
|
|
||||||
set_floor_mesh(coordinate % _CHUNK_SIZE, orientation, mesh)
|
|
||||||
|
|
||||||
InteriorTile.Kind.WALL:
|
|
||||||
for y in size.y:
|
|
||||||
for x in size.x:
|
|
||||||
var coordinate := Vector2i(x, y)
|
|
||||||
|
|
||||||
_get_chunk(coordinate / _CHUNK_SIZE).\
|
|
||||||
set_floor_mesh(coordinate % _CHUNK_SIZE, orientation, mesh)
|
|
||||||
|
|
||||||
for y in _chunks_size.y:
|
for y in _chunks_size.y:
|
||||||
for x in _chunks_size.x:
|
for x in _chunks_size.x:
|
||||||
var chunk_coordinate := Vector2i(x, y)
|
_get_chunk(Vector2i(x, y)).invalidate()
|
||||||
|
|
||||||
_get_chunk(chunk_coordinate).invalidate(self, chunk_coordinate)
|
|
||||||
|
|
||||||
##
|
##
|
||||||
## Clears the region of the tile grid at [code]area[/code] to only contain instances of
|
## Clears the region of the tile grid at [code]area[/code] to only contain instances of
|
||||||
|
@ -239,66 +248,22 @@ func clear_tiles(orientation: Orientation, tile: InteriorTile) -> void:
|
||||||
##
|
##
|
||||||
## For clearing the whole of the mesh grid, see [method clear_mesh].
|
## For clearing the whole of the mesh grid, see [method clear_mesh].
|
||||||
##
|
##
|
||||||
func fill_tiles(area: Rect2i, orientation: Orientation, tile: InteriorTile) -> void:
|
func fill_floor(area: Rect2i, exists: bool) -> void:
|
||||||
assert(get_area().encloses(area), "area must be within grid")
|
assert(Rect2i(Vector2i.ZERO, size).encloses(area), "area must be within grid")
|
||||||
|
|
||||||
var filled_chunks := BitMap.new()
|
var filled_chunks := BitMap.new()
|
||||||
|
|
||||||
filled_chunks.resize(_chunks_size)
|
filled_chunks.resize(_chunks_size)
|
||||||
|
|
||||||
if tile == null:
|
|
||||||
for y in range(area.position.y, area.end.y):
|
for y in range(area.position.y, area.end.y):
|
||||||
for x in range(area.position.x, area.end.x):
|
for x in range(area.position.x, area.end.x):
|
||||||
var coordinates := Vector2i(x, y)
|
_floor_map.set_bit(x, y, exists)
|
||||||
var chunk_coordinates := coordinates / _CHUNK_SIZE
|
filled_chunks.set_bitv(Vector2i(x, y) / _CHUNK_SIZE, true)
|
||||||
var chunk := _get_chunk(coordinates / _CHUNK_SIZE)
|
|
||||||
var local_coordinates := coordinates % _CHUNK_SIZE
|
|
||||||
|
|
||||||
chunk.set_floor_mesh(local_coordinates, orientation, null)
|
|
||||||
chunk.set_wall_mesh(local_coordinates, orientation, null)
|
|
||||||
filled_chunks.set_bitv(chunk_coordinates, true)
|
|
||||||
|
|
||||||
else:
|
|
||||||
var mesh := tile.mesh
|
|
||||||
|
|
||||||
if tile.fixed_orientation:
|
|
||||||
orientation = Orientation.NORTH
|
|
||||||
|
|
||||||
match tile.kind:
|
|
||||||
InteriorTile.Kind.FLOOR:
|
|
||||||
for y in range(area.position.y, area.end.y):
|
|
||||||
for x in range(area.position.x, area.end.x):
|
|
||||||
var coordinate := Vector2i(x, y)
|
|
||||||
var chunk_coordinate := coordinate / _CHUNK_SIZE
|
|
||||||
|
|
||||||
_get_chunk(chunk_coordinate).set_floor_mesh(
|
|
||||||
coordinate % _CHUNK_SIZE, orientation, mesh)
|
|
||||||
|
|
||||||
filled_chunks.set_bitv(chunk_coordinate, true)
|
|
||||||
|
|
||||||
InteriorTile.Kind.WALL:
|
|
||||||
for y in range(area.position.y, area.end.y):
|
|
||||||
for x in range(area.position.x, area.end.x):
|
|
||||||
var coordinate := Vector2i(x, y)
|
|
||||||
var chunk_coordinate := coordinate / _CHUNK_SIZE
|
|
||||||
|
|
||||||
_get_chunk(chunk_coordinate).set_wall_mesh(
|
|
||||||
coordinate % _CHUNK_SIZE, orientation, mesh)
|
|
||||||
|
|
||||||
filled_chunks.set_bitv(chunk_coordinate, true)
|
|
||||||
|
|
||||||
for y in _chunks_size.y:
|
for y in _chunks_size.y:
|
||||||
for x in _chunks_size.x:
|
for x in _chunks_size.x:
|
||||||
if filled_chunks.get_bit(x, y):
|
if filled_chunks.get_bit(x, y):
|
||||||
var chunk_coordinate := Vector2i(x, y)
|
_get_chunk(Vector2i(x, y)).invalidate()
|
||||||
|
|
||||||
_get_chunk(chunk_coordinate).invalidate(self, chunk_coordinate)
|
|
||||||
|
|
||||||
##
|
|
||||||
## Returns the area of the interior map based on its current size.
|
|
||||||
##
|
|
||||||
func get_area() -> Rect2i:
|
|
||||||
return Rect2i(Vector2i.ZERO, size)
|
|
||||||
|
|
||||||
##
|
##
|
||||||
## Plots a single tile at [code]coordinates[/code] to be an instance of [code]tile[/code] pointing
|
## Plots a single tile at [code]coordinates[/code] to be an instance of [code]tile[/code] pointing
|
||||||
|
@ -310,30 +275,7 @@ func get_area() -> Rect2i:
|
||||||
##
|
##
|
||||||
## For bulk-setting many meshes at once, see [method fill_mesh] and [method clear_mesh].
|
## For bulk-setting many meshes at once, see [method fill_mesh] and [method clear_mesh].
|
||||||
##
|
##
|
||||||
func plot_tile(coordinates: Vector2i, orientation: Orientation, tile: InteriorTile) -> void:
|
func plot_floor(coordinates: Vector2i, exists: bool) -> void:
|
||||||
assert(get_area().has_point(coordinates), "coordinate must be within grid")
|
assert(Rect2i(Vector2i.ZERO, size).has_point(coordinates), "coordinate must be within grid")
|
||||||
|
_floor_map.set_bitv(coordinates, exists)
|
||||||
var chunk_coordinates := coordinates / _CHUNK_SIZE
|
_get_chunk(coordinates / _CHUNK_SIZE).invalidate()
|
||||||
var chunk := _get_chunk(chunk_coordinates)
|
|
||||||
|
|
||||||
if tile == null:
|
|
||||||
var local_coordinates := coordinates % _CHUNK_SIZE
|
|
||||||
|
|
||||||
chunk.set_floor_mesh(local_coordinates, orientation, null)
|
|
||||||
chunk.set_wall_mesh(local_coordinates, orientation, null)
|
|
||||||
chunk.invalidate(self, chunk_coordinates)
|
|
||||||
|
|
||||||
else:
|
|
||||||
var mesh := tile.mesh
|
|
||||||
|
|
||||||
if tile.fixed_orientation:
|
|
||||||
orientation = Orientation.NORTH
|
|
||||||
|
|
||||||
match tile.kind:
|
|
||||||
InteriorTile.Kind.FLOOR:
|
|
||||||
chunk.set_floor_mesh(coordinates % _CHUNK_SIZE, orientation, mesh)
|
|
||||||
chunk.invalidate(self, chunk_coordinates)
|
|
||||||
|
|
||||||
InteriorTile.Kind.WALL:
|
|
||||||
chunk.set_wall_mesh(coordinates % _CHUNK_SIZE, orientation, mesh)
|
|
||||||
chunk.invalidate(self, chunk_coordinates)
|
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
class_name InteriorTile extends Resource
|
|
||||||
|
|
||||||
##
|
|
||||||
## Identifier for the kind of interior tile.
|
|
||||||
##
|
|
||||||
enum Kind {
|
|
||||||
FLOOR,
|
|
||||||
WALL,
|
|
||||||
}
|
|
||||||
|
|
||||||
##
|
|
||||||
## Flag for determining if the tile is affected by orientations specified in an [InteriorMap].
|
|
||||||
##
|
|
||||||
@export
|
|
||||||
var fixed_orientation := false
|
|
||||||
|
|
||||||
##
|
|
||||||
## See [enum Kind].
|
|
||||||
##
|
|
||||||
## Interior tiles of different kinds will not conflict when placing them.
|
|
||||||
##
|
|
||||||
@export
|
|
||||||
var kind := Kind.FLOOR
|
|
||||||
|
|
||||||
##
|
|
||||||
## Used to visualize the interior tile.
|
|
||||||
##
|
|
||||||
@export
|
|
||||||
var mesh: Mesh = null
|
|
BIN
interior/tiles/dungeon_01_pipehole_tile.res (Stored with Git LFS)
BIN
interior/tiles/dungeon_01_pipehole_tile.res (Stored with Git LFS)
Binary file not shown.
BIN
interior/tiles/dungeon_01_tiling_tile.res (Stored with Git LFS)
BIN
interior/tiles/dungeon_01_tiling_tile.res (Stored with Git LFS)
Binary file not shown.
BIN
interior/tiles/limestone_dungeon/hole_albedo.png (Stored with Git LFS)
BIN
interior/tiles/limestone_dungeon/hole_albedo.png (Stored with Git LFS)
Binary file not shown.
BIN
interior/tiles/limestone_dungeon/hole_height.png (Stored with Git LFS)
BIN
interior/tiles/limestone_dungeon/hole_height.png (Stored with Git LFS)
Binary file not shown.
BIN
interior/tiles/limestone_dungeon/hole_material.res (Stored with Git LFS)
BIN
interior/tiles/limestone_dungeon/hole_material.res (Stored with Git LFS)
Binary file not shown.
BIN
interior/tiles/limestone_dungeon/hole_normal.png (Stored with Git LFS)
BIN
interior/tiles/limestone_dungeon/hole_normal.png (Stored with Git LFS)
Binary file not shown.
BIN
interior/tiles/limestone_dungeon/hole_orm.png (Stored with Git LFS)
BIN
interior/tiles/limestone_dungeon/hole_orm.png (Stored with Git LFS)
Binary file not shown.
BIN
interior/tiles/limestone_dungeon/piping_albedo.png (Stored with Git LFS)
BIN
interior/tiles/limestone_dungeon/piping_albedo.png (Stored with Git LFS)
Binary file not shown.
BIN
interior/tiles/limestone_dungeon/piping_height.png (Stored with Git LFS)
BIN
interior/tiles/limestone_dungeon/piping_height.png (Stored with Git LFS)
Binary file not shown.
BIN
interior/tiles/limestone_dungeon/piping_material.res (Stored with Git LFS)
BIN
interior/tiles/limestone_dungeon/piping_material.res (Stored with Git LFS)
Binary file not shown.
BIN
interior/tiles/limestone_dungeon/piping_normal.png (Stored with Git LFS)
BIN
interior/tiles/limestone_dungeon/piping_normal.png (Stored with Git LFS)
Binary file not shown.
BIN
interior/tiles/limestone_dungeon/piping_orm.png (Stored with Git LFS)
BIN
interior/tiles/limestone_dungeon/piping_orm.png (Stored with Git LFS)
Binary file not shown.
BIN
interior/tiles/limestone_dungeon/tiling_albedo.png (Stored with Git LFS)
BIN
interior/tiles/limestone_dungeon/tiling_albedo.png (Stored with Git LFS)
Binary file not shown.
|
@ -1,35 +0,0 @@
|
||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://bydc62557j2d0"
|
|
||||||
path.s3tc="res://.godot/imported/tiling_albedo.png-1570a8acdedf3400258f8b15e49e5d5b.s3tc.ctex"
|
|
||||||
metadata={
|
|
||||||
"imported_formats": ["s3tc_bptc"],
|
|
||||||
"vram_texture": true
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://interior/tiles/limestone_dungeon/tiling_albedo.png"
|
|
||||||
dest_files=["res://.godot/imported/tiling_albedo.png-1570a8acdedf3400258f8b15e49e5d5b.s3tc.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=2
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=true
|
|
||||||
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=0
|
|
BIN
interior/tiles/limestone_dungeon/tiling_material.res (Stored with Git LFS)
BIN
interior/tiles/limestone_dungeon/tiling_material.res (Stored with Git LFS)
Binary file not shown.
BIN
interior/tiles/limestone_dungeon/tiling_normal.png (Stored with Git LFS)
BIN
interior/tiles/limestone_dungeon/tiling_normal.png (Stored with Git LFS)
Binary file not shown.
BIN
interior/tiles/limestone_dungeon/tiling_orm.png (Stored with Git LFS)
BIN
interior/tiles/limestone_dungeon/tiling_orm.png (Stored with Git LFS)
Binary file not shown.
BIN
map_editor.scn (Stored with Git LFS)
BIN
map_editor.scn (Stored with Git LFS)
Binary file not shown.
BIN
map_editor/selection_area_mesh.res (Stored with Git LFS)
BIN
map_editor/selection_area_mesh.res (Stored with Git LFS)
Binary file not shown.
Loading…
Reference in New Issue