Work on the style. Now the transvoxel mesher will scale the textures (like standard terrarin engines). Update to HEADS.

This commit is contained in:
Relintai 2020-01-14 23:15:46 +01:00
parent eab9d82d0c
commit 6aa08476e1
12 changed files with 81 additions and 13 deletions

2
HEADS
View File

@ -1 +1 @@
{"engine": "269eb5f06c8874e1257137eabe121d4501758ded", "world_generator": "e5f5d205f8aea478294ad4796b0f3c771dd7e7cf", "entity_spell_system": "6f3744e2cbd4ba8c0ac7c331876c2d7a28beb4b2", "ui_extensions": "8a81cc53100c5a138fbaf927080410025c64c88e", "voxelman": "01bb4927607e4bb937e9f8d066f3c1b5f6ba1e3b", "texture_packer": "8d3b160f02054323a1dc4a9bc8b7e1c44fc57753", "fastnoise": "41b7ea05a1f7aa2b8ecddaa1fd739e64d6970f7e", "entity-spell-system-addons": "d60e746b158d3ebf9d2ea306af1dd24bcae49be5", "mesh_data_resource": "3fedb4c8534af36d89a1a1a34a6b5ed4d333927a", "ess_data": "3bd637fdd3304b64a18287a49a6b7387acf2f5de", "prop_tool": "df438053ebc900966f8f842fc65f0264f1271d49"}
{"engine": "083f68ebf48ef44599bad864f6ce5c9301bd400b", "world_generator": "e5f5d205f8aea478294ad4796b0f3c771dd7e7cf", "entity_spell_system": "6f3744e2cbd4ba8c0ac7c331876c2d7a28beb4b2", "ui_extensions": "8a81cc53100c5a138fbaf927080410025c64c88e", "voxelman": "2b9f28e5739d5163a27fcf97b404d670b41be4eb", "texture_packer": "8d3b160f02054323a1dc4a9bc8b7e1c44fc57753", "fastnoise": "41b7ea05a1f7aa2b8ecddaa1fd739e64d6970f7e", "entity-spell-system-addons": "d60e746b158d3ebf9d2ea306af1dd24bcae49be5", "mesh_data_resource": "7bef6db99e52e2340d5d655c16d27c7bbe999247", "ess_data": "3bd637fdd3304b64a18287a49a6b7387acf2f5de", "prop_tool": "df438053ebc900966f8f842fc65f0264f1271d49"}

View File

@ -1,6 +1,6 @@
[gd_resource type="VoxelSurfaceMerger" load_steps=2 format=2]
[ext_resource path="res://data/voxel_textures/Rock24_col.png" type="Texture" id=1]
[ext_resource path="res://data/voxel_textures/Rock24_col2.png" type="Texture" id=1]
[resource]
resource_name = "Test"

View File

@ -1,6 +1,6 @@
[gd_resource type="VoxelSurfaceMerger" load_steps=2 format=2]
[ext_resource path="res://data/voxel_textures/Ground03_col.png" type="Texture" id=1]
[ext_resource path="res://data/voxel_textures/Ground03_col2.png" type="Texture" id=1]
[resource]
resource_name = "Test2"

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Ground03_col2.png-8e6b105ba2bca96f6345fd816abd4b8e.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://data/voxel_textures/Ground03_col2.png"
dest_files=[ "res://.import/Ground03_col2.png-8e6b105ba2bca96f6345fd816abd4b8e.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=false
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Rock24_col2.png-550377381889900c805e3a85cc80c40a.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://data/voxel_textures/Rock24_col2.png"
dest_files=[ "res://.import/Rock24_col2.png-550377381889900c805e3a85cc80c40a.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=false
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

View File

@ -550,7 +550,7 @@ margin_bottom = 127.5
visible = false
[node name="Char" type="Spatial" parent="."]
transform = Transform( 0.359313, 0, 0.933217, 0, 1, 0, -0.933217, 0, 0.359313, -2.44425, 2.36948, 0 )
transform = Transform( 0.359313, 0, 0.933217, 0, 1, 0, -0.933217, 0, 0.359313, -2.44425, 0.926699, 0 )
[node name="CharacterDisplay" type="Spatial" parent="Char"]
transform = Transform( 1, 0, 0, 0, 0.990268, -0.139173, 0, 0.139173, 0.990268, 0, 0, 0 )
@ -566,7 +566,6 @@ use_threads = false
max_concurrent_generations = 1
library = ExtResource( 17 )
level_generator = SubResource( 1 )
voxel_scale = 3.0
chunk_spawn_range = 1
script = ExtResource( 16 )
show_loading_screen = false

View File

@ -60,7 +60,6 @@ use_threads = false
max_concurrent_generations = 1
library = ExtResource( 2 )
level_generator = SubResource( 1 )
voxel_scale = 3.0
chunk_spawn_range = 3
script = ExtResource( 8 )

View File

@ -32,19 +32,19 @@ func generate_terrarin(chunk : VoxelChunk, spawn_mobs: bool) -> void:
var noise : OpenSimplexNoise = OpenSimplexNoise.new()
noise.seed = 10 * current_seed
noise.octaves = 4
noise.period = 180.0
noise.period = 280.0
noise.persistence = 0.8
var terr_noise : OpenSimplexNoise = OpenSimplexNoise.new()
terr_noise.seed = 10 * 321 + 112 * current_seed
terr_noise.octaves = 4
terr_noise.period = 20.0
terr_noise.period = 90.0
terr_noise.persistence = 0.9
var det_noise : OpenSimplexNoise = OpenSimplexNoise.new()
det_noise.seed = 10 * 3231 + 112 * current_seed
det_noise.octaves = 6
det_noise.period = 10.0
det_noise.period = 80.0
det_noise.persistence = 0.3
for x in range(0, chunk.size_x + 1):

View File

@ -229,7 +229,7 @@ func generate_random_ao() -> void:
var noise : OpenSimplexNoise = OpenSimplexNoise.new()
noise.seed = 123
noise.octaves = 4
noise.period = 6
noise.period = 30
noise.persistence = 0.3
for x in range(0, size_x + 1):

View File

@ -51,6 +51,8 @@ var lod_data : Array = [
1 #CHUNK_INDEX_BACK
]
const TEXTURE_SCALE = 4
func get_case_code(buffer : VoxelChunk, x : int, y : int, z : int, size : int = 1) -> int:
var case_code : int = 0
@ -263,7 +265,7 @@ func add_buffer_normal(buffer : VoxelChunk) -> void:
uv.x += umargin.position.x
uv.y += umargin.position.y
add_uv(surface.transform_uv(VoxelSurface.VOXEL_SIDE_SIDE, uv))
add_uv(surface.transform_uv_scaled(VoxelSurface.VOXEL_SIDE_SIDE, uv, x % TEXTURE_SCALE, z % TEXTURE_SCALE, TEXTURE_SCALE))
elif (bz + 0.0001 > bx and bz + 0.0001 > by):
var uv : Vector2 = Vector2(s.z, t.z)
var umargin : Rect2 = uv_margin
@ -273,7 +275,7 @@ func add_buffer_normal(buffer : VoxelChunk) -> void:
uv.x += umargin.position.x
uv.y += umargin.position.y
add_uv(surface.transform_uv(VoxelSurface.VOXEL_SIDE_SIDE, uv))
add_uv(surface.transform_uv_scaled(VoxelSurface.VOXEL_SIDE_SIDE, uv, x % TEXTURE_SCALE, z % TEXTURE_SCALE, TEXTURE_SCALE))
else:
var uv : Vector2 = Vector2(s.y, t.y)
var umargin : Rect2 = uv_margin
@ -283,7 +285,7 @@ func add_buffer_normal(buffer : VoxelChunk) -> void:
uv.x += umargin.position.x
uv.y += umargin.position.y
add_uv(surface.transform_uv(VoxelSurface.VOXEL_SIDE_TOP, uv))
add_uv(surface.transform_uv_scaled(VoxelSurface.VOXEL_SIDE_TOP, uv, x % TEXTURE_SCALE, z % TEXTURE_SCALE, TEXTURE_SCALE))
for i in range(len(temp_verts)):