WIP: HexTile3D coloring based on TileWorld Colormap.

WorldChunkRefactoring
Martin Felis 2023-05-05 16:26:33 +02:00
parent 983bb792fa
commit 4c92a6c5c3
13 changed files with 432 additions and 222 deletions

BIN
assets/4x4checker.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 561 B

View File

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/4x4checker.png-2d12b07d9dea94e0b7f78a32f72bdad7.s3tc.stex"
path.etc2="res://.import/4x4checker.png-2d12b07d9dea94e0b7f78a32f72bdad7.etc2.stex"
metadata={
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://assets/4x4checker.png"
dest_files=[ "res://.import/4x4checker.png-2d12b07d9dea94e0b7f78a32f72bdad7.s3tc.stex", "res://.import/4x4checker.png-2d12b07d9dea94e0b7f78a32f72bdad7.etc2.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

BIN
assets/4x4checkerColor.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 585 B

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/4x4checkerColor.png-aa2feda4a05a30bbb021b287c7398aac.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/4x4checkerColor.png"
dest_files=[ "res://.import/4x4checkerColor.png-aa2feda4a05a30bbb021b287c7398aac.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=2
flags/repeat=true
flags/filter=false
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=1
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=0.001

View File

@ -0,0 +1,62 @@
shader_type spatial;
render_mode specular_schlick_ggx, async_visible;
uniform sampler2D MapAlbedoTexture : hint_black_albedo;
uniform mat4 HexAffineInverse;
varying vec2 map_coord;
const mat2 _HexAffineInverse = mat2(vec2(1.333333, -0.6666667), vec2(0, -1.154701));
vec2 axial_to_offset(vec2 axial) {
ivec2 axial_i = ivec2(axial);
int x = axial_i.x;
int y = axial_i.y;
int off_y = y + (x - (x % 1)) / 2;
return vec2(float(x), float(off_y));
}
void vertex() {
// Input:2
mat4 model_matrix = WORLD_MATRIX;
vec3 origin = vec4(WORLD_MATRIX * vec4(0, 0, 0, 1)).xyz;
vec3 axial_coords = vec3(_HexAffineInverse * origin.xz, 0);
// Output:0
map_coord = origin.xz * 0.25;
map_coord = axial_to_offset(axial_coords.xy) * 0.25;
}
void fragment() {
// Input:3
mat4 n_out3p0 = WORLD_MATRIX;
// TransformDecompose:5
vec3 n_out5p0 = n_out3p0[0].xyz;
vec3 n_out5p1 = n_out3p0[1].xyz;
vec3 n_out5p2 = n_out3p0[2].xyz;
vec3 n_out5p3 = n_out3p0[3].xyz;
// VectorOp:9
vec3 n_in9p1 = vec3(1.00000, 1.00000, 1.00000);
vec3 n_out9p0 = n_out5p3 * n_in9p1;
// TextureUniform:4
vec3 n_out4p0;
float n_out4p1;
{
vec4 n_tex_read = texture(MapAlbedoTexture, map_coord);
n_out4p0 = n_tex_read.rgb;
n_out4p1 = n_tex_read.a;
}
// Output:0
ALBEDO = n_out4p0;
}
void light() {
// Output:0
}

View File

@ -15,6 +15,7 @@ public class Game : Spatial
private Label _numCoordsAddedLabel;
private Label _numCoordsRemovedLabel;
private TextureRect _worldTextureRect;
private Button _generateWorldButton;
// scene nodes
private Spatial _tileHighlight;
@ -49,7 +50,8 @@ public class Game : Spatial
_mouseTileLabel = GetNode<Label>("Control/HBoxContainer/GridContainer/mouse_tile_label");
_numCoordsAddedLabel = GetNode<Label>("Control/HBoxContainer/GridContainer/num_coords_added_label");
_numCoordsRemovedLabel = GetNode<Label>("Control/HBoxContainer/GridContainer/num_coords_removed_label");
_worldTextureRect = GetNode<TextureRect>("Control/WorldTextureRect");
_worldTextureRect = (TextureRect)FindNode("WorldTextureRect");
_generateWorldButton = (Button)FindNode("WorldGenerateButton");
// scene nodes
_tileHighlight = GetNode<Spatial>("TileHighlight");
@ -81,6 +83,7 @@ public class Game : Spatial
_streamContainerArea.Connect("input_event", this, nameof(OnAreaInputEvent));
_streamContainer.Connect("TileClicked", this, nameof(OnTileClicked));
_tileWorld.Connect("WorldGenerated", this, nameof(OnWorldGenerated));
_generateWorldButton.Connect("pressed", this, nameof(OnGenerateButton));
// register entity events
Array entityNodes = FindNode("Entities").GetChildren();
@ -166,6 +169,15 @@ public class Game : Spatial
_camera.Transform = cameraTransform;
}
public void OnGenerateButton()
{
GD.Print("Generating");
_tileWorld.Seed = _tileWorld.Seed + 1;
_tileWorld.Generate();
}
public void OnAreaInputEvent(Node camera, InputEvent inputEvent, Vector3 position, Vector3 normal,
int shapeIndex)
{
@ -175,6 +187,7 @@ public class Game : Spatial
cellPlaneCoords = _hexGrid.GetHexCenterFromOffset(cellAtCursor.OffsetCoords);
highlightTransform.origin.x = cellPlaneCoords.x;
highlightTransform.origin.z = cellPlaneCoords.y;
highlightTransform.origin.y = 0.1f;
_mouseWorldLabel.Text = position.ToString();
_mouseTileLabel.Text = cellAtCursor.OffsetCoords.ToString();
@ -231,9 +244,9 @@ public class Game : Spatial
GD.Print("Using new map");
ImageTexture new_world_texture = new ImageTexture();
_tileWorld.Heightmap.Unlock();
new_world_texture.CreateFromImage(_tileWorld.Heightmap);
_tileWorld.Heightmap.Lock();
_tileWorld.Colormap.Unlock();
new_world_texture.CreateFromImage(_tileWorld.Colormap);
_tileWorld.Colormap.Lock();
_worldTextureRect.Texture = new_world_texture;
}

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=24 format=2]
[gd_scene load_steps=22 format=2]
[ext_resource path="res://scenes/StreamContainer.cs" type="Script" id=1]
[ext_resource path="res://components/NavigationComponent.cs" type="Script" id=2]
@ -7,19 +7,11 @@
[ext_resource path="res://utils/TileHighlight.tscn" type="PackedScene" id=5]
[ext_resource path="res://components/WorldInfoComponent.cs" type="Script" id=6]
[ext_resource path="res://entities/Chest.tscn" type="PackedScene" id=7]
[ext_resource path="res://scenes/TileWorld.cs" type="Script" id=8]
[ext_resource path="res://scenes/TileWorld.tscn" type="PackedScene" id=8]
[ext_resource path="res://scenes/Game.cs" type="Script" id=9]
[ext_resource path="res://scenes/DebugCamera.gd" type="Script" id=10]
[ext_resource path="res://assets/CreatusPiratePack/Models/Characters/gltf/Pirate1final.glb" type="PackedScene" id=11]
[sub_resource type="OpenSimplexNoise" id=10]
period = 39.6
[sub_resource type="NoiseTexture" id=11]
width = 100
height = 100
noise = SubResource( 10 )
[sub_resource type="CubeMesh" id=1]
size = Vector3( 1, 1, 1 )
@ -57,17 +49,13 @@ radius = 0.1
script = ExtResource( 9 )
[node name="TileHighlight" parent="." instance=ExtResource( 5 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.1, 0 )
visible = false
[node name="MouseTileHighlight" parent="." instance=ExtResource( 5 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.1, 0 )
[node name="TileWorld" type="Spatial" parent="."]
script = ExtResource( 8 )
[node name="DirectionalLight" type="DirectionalLight" parent="TileWorld"]
transform = Transform( 0.328059, -0.878387, 0.347583, 0, 0.367946, 0.929847, -0.944657, -0.305045, 0.120708, 0, 6.59293, 1.20265 )
shadow_enabled = true
directional_shadow_mode = 0
[node name="TileWorld" parent="." instance=ExtResource( 8 )]
[node name="Control" type="Control" parent="."]
margin_right = 40.0
@ -75,13 +63,32 @@ margin_bottom = 40.0
mouse_filter = 2
[node name="HBoxContainer" type="HBoxContainer" parent="Control"]
margin_right = 40.0
margin_bottom = 40.0
margin_right = 127.0
margin_bottom = 158.0
mouse_filter = 2
alignment = 2
[node name="VBoxContainer" type="VBoxContainer" parent="Control/HBoxContainer"]
margin_right = 100.0
margin_bottom = 158.0
alignment = 2
[node name="WorldTextureRect" type="TextureRect" parent="Control/HBoxContainer/VBoxContainer"]
margin_top = 34.0
margin_right = 100.0
margin_bottom = 134.0
rect_min_size = Vector2( 100, 100 )
stretch_mode = 1
[node name="WorldGenerateButton" type="Button" parent="Control/HBoxContainer/VBoxContainer"]
margin_top = 138.0
margin_right = 100.0
margin_bottom = 158.0
text = "Generate"
[node name="GridContainer" type="GridContainer" parent="Control/HBoxContainer"]
margin_right = 127.0
margin_left = 104.0
margin_right = 231.0
margin_bottom = 158.0
mouse_filter = 2
columns = 2
@ -205,13 +212,6 @@ margin_right = 127.0
margin_bottom = 158.0
text = "0"
[node name="WorldTextureRect" type="TextureRect" parent="Control"]
margin_left = 1.0
margin_top = 300.0
margin_right = 513.0
margin_bottom = 812.0
texture = SubResource( 11 )
[node name="StreamContainer" type="Spatial" parent="."]
script = ExtResource( 1 )
Dimensions = Vector2( 18, 17 )

View File

@ -1,3 +1,4 @@
using System.Diagnostics;
using Godot;
public class HexTile3D : Spatial
@ -31,6 +32,7 @@ public class HexTile3D : Spatial
public HexCell Cell = new HexCell();
public bool IsMouseOver = false;
public MeshInstance Mesh;
public Vector2 OffsetCoords
{
@ -57,24 +59,24 @@ public class HexTile3D : Spatial
{
_type = value;
switch (_type)
{
case TileType.Undefined:
_mesh.SetSurfaceMaterial(0, _undefinedMaterial);
break;
case TileType.Sand:
_mesh.SetSurfaceMaterial(0, _sandMaterial);
break;
case TileType.Grass:
_mesh.SetSurfaceMaterial(0, _grassMaterial);
break;
case TileType.DeepGrass:
_mesh.SetSurfaceMaterial(0, _deepGrassMaterial);
break;
default:
GD.Print("Invalid tile type: " + value.ToString());
break;
}
// switch (_type)
// {
// case TileType.Undefined:
// _mesh.SetSurfaceMaterial(0, _undefinedMaterial);
// break;
// case TileType.Sand:
// _mesh.SetSurfaceMaterial(0, _sandMaterial);
// break;
// case TileType.Grass:
// _mesh.SetSurfaceMaterial(0, _grassMaterial);
// break;
// case TileType.DeepGrass:
// _mesh.SetSurfaceMaterial(0, _deepGrassMaterial);
// break;
// default:
// GD.Print("Invalid tile type: " + value.ToString());
// break;
// }
}
}
@ -98,6 +100,9 @@ public class HexTile3D : Spatial
_grassMaterial = GD.Load<SpatialMaterial>("res://materials/GrassTile.tres");
_deepGrassMaterial = GD.Load<SpatialMaterial>("res://materials/DeepGrassTile.tres");
Mesh = GetNode<MeshInstance>("Mesh");
Debug.Assert(Mesh != null);
this.Type = TileType.Undefined;
}
@ -120,9 +125,9 @@ public class HexTile3D : Spatial
IsMouseOver = true;
_previousMaterial = (SpatialMaterial)_mesh.MaterialOverride;
SpatialMaterial clonedMaterial = (SpatialMaterial)_mesh.GetSurfaceMaterial(0).Duplicate();
clonedMaterial.AlbedoColor = new Color(1, 0, 0);
_mesh.MaterialOverride = clonedMaterial;
// SpatialMaterial clonedMaterial = (SpatialMaterial)_mesh.GetSurfaceMaterial(0).Duplicate();
// clonedMaterial.AlbedoColor = new Color(1, 0, 0);
// _mesh.MaterialOverride = clonedMaterial;
}
public void OnAreaMouseExited()

View File

@ -1,7 +1,7 @@
[gd_scene load_steps=5 format=2]
[gd_scene load_steps=7 format=2]
[ext_resource path="res://scenes/HexTile3D.cs" type="Script" id=1]
[ext_resource path="res://materials/UndefinedTile.tres" type="Material" id=2]
[ext_resource path="res://assets/4x4checkerColor.png" type="Texture" id=2]
[sub_resource type="CylinderMesh" id=6]
top_radius = 0.5
@ -10,17 +10,88 @@ height = 10.0
radial_segments = 6
rings = 1
[sub_resource type="Shader" id=11]
code = "shader_type spatial;
render_mode specular_schlick_ggx, async_visible;
uniform sampler2D MapAlbedoTexture : hint_black_albedo;
uniform mat4 HexAffineInverse;
varying vec2 map_coord;
const mat2 _HexAffineInverse = mat2(vec2(1.333333, -0.6666667), vec2(0, -1.154701));
vec2 axial_to_offset(vec2 axial) {
ivec2 axial_i = ivec2(axial);
int x = axial_i.x;
int y = axial_i.y;
int off_y = y + (x - (x % 1)) / 2;
return vec2(float(x), float(off_y));
}
void vertex() {
// Input:2
mat4 model_matrix = WORLD_MATRIX;
vec3 origin = vec4(WORLD_MATRIX * vec4(0, 0, 0, 1)).xyz;
vec3 axial_coords = vec3(_HexAffineInverse * origin.xz, 0);
// Output:0
map_coord = origin.xz * 0.25;
map_coord = axial_to_offset(axial_coords.xy) * 0.25;
}
void fragment() {
// Input:3
mat4 n_out3p0 = WORLD_MATRIX;
// TransformDecompose:5
vec3 n_out5p0 = n_out3p0[0].xyz;
vec3 n_out5p1 = n_out3p0[1].xyz;
vec3 n_out5p2 = n_out3p0[2].xyz;
vec3 n_out5p3 = n_out3p0[3].xyz;
// VectorOp:9
vec3 n_in9p1 = vec3(1.00000, 1.00000, 1.00000);
vec3 n_out9p0 = n_out5p3 * n_in9p1;
// TextureUniform:4
vec3 n_out4p0;
float n_out4p1;
{
vec4 n_tex_read = texture(MapAlbedoTexture, map_coord);
n_out4p0 = n_tex_read.rgb;
n_out4p1 = n_tex_read.a;
}
// Output:0
ALBEDO = n_out4p0;
}
void light() {
// Output:0
}
"
[sub_resource type="ShaderMaterial" id=10]
shader = SubResource( 11 )
shader_param/HexAffineInverse = null
shader_param/MapAlbedoTexture = ExtResource( 2 )
[sub_resource type="CylinderShape" id=5]
height = 1.0
radius = 0.5
[node name="HexTile3D" type="Spatial"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0096302, 0, 0 )
script = ExtResource( 1 )
[node name="Mesh" type="MeshInstance" parent="."]
transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, -5, 0 )
transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0.00399733, -5, 0 )
mesh = SubResource( 6 )
material/0 = ExtResource( 2 )
material/0 = SubResource( 10 )
[node name="StaticBody" type="StaticBody" parent="."]

View File

@ -5,301 +5,301 @@
[node name="Spatial" type="Spatial"]
[node name="HexTile3D1" parent="." instance=ExtResource( 1 )]
transform = Transform( -0.0119554, 0, 0.999929, 0, 1, 0, -0.999929, 0, -0.0119554, 0, 0, 0 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )
[node name="HexTile3D2" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 0, 0, 0.866 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.866 )
[node name="HexTile3D3" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 0, 0, 1.732 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1.732 )
[node name="HexTile3D4" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 0, 0, 2.598 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2.598 )
[node name="HexTile3D5" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 0, 0, 3.464 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 3.464 )
[node name="HexTile3D8" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 0, 0, 4.33 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 4.33 )
[node name="HexTile3D6" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 0, 0, 5.196 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 5.196 )
[node name="HexTile3D7" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 0, 0, 6.062 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 6.062 )
[node name="HexTile3D9" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 0, 0, 6.928 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 6.928 )
[node name="HexTile3D10" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 0, 0, 7.794 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 7.794 )
[node name="HexTile3D11" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 0.75, 0, 0.433 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.75, 0, 0.433 )
[node name="HexTile3D12" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 0.75, 0, 1.299 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.75, 0, 1.299 )
[node name="HexTile3D13" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 0.75, 0, 2.165 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.75, 0, 2.165 )
[node name="HexTile3D14" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 0.75, 0, 3.031 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.75, 0, 3.031 )
[node name="HexTile3D15" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 0.75, 0, 3.897 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.75, 0, 3.897 )
[node name="HexTile3D16" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 0.75, 0, 4.763 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.75, 0, 4.763 )
[node name="HexTile3D17" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 0.75, 0, 5.629 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.75, 0, 5.629 )
[node name="HexTile3D18" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 0.75, 0, 6.495 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.75, 0, 6.495 )
[node name="HexTile3D19" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 0.75, 0, 7.361 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.75, 0, 7.361 )
[node name="HexTile3D20" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 0.75, 0, -0.414769 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.75, 0, -0.414769 )
[node name="HexTile3D21" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 1.5, 0, 0 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5, 0, 0 )
[node name="HexTile3D22" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 1.5, 0, 0.866 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5, 0, 0.866 )
[node name="HexTile3D23" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 1.5, 0, 1.732 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5, 0, 1.732 )
[node name="HexTile3D24" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 1.5, 0, 2.598 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5, 0, 2.598 )
[node name="HexTile3D25" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 1.5, 0, 3.464 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5, 0, 3.464 )
[node name="HexTile3D26" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 1.5, 0, 4.33 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5, 0, 4.33 )
[node name="HexTile3D27" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 1.5, 0, 5.196 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5, 0, 5.196 )
[node name="HexTile3D28" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 1.5, 0, 6.062 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5, 0, 6.062 )
[node name="HexTile3D29" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 1.5, 0, 6.928 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5, 0, 6.928 )
[node name="HexTile3D30" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 1.5, 0, 7.794 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5, 0, 7.794 )
[node name="HexTile3D31" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 2.25, 0, 0.433 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.25, 0, 0.433 )
[node name="HexTile3D32" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 2.25, 0, 1.299 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.25, 0, 1.299 )
[node name="HexTile3D33" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 2.25, 0, 2.165 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.25, 0, 2.165 )
[node name="HexTile3D34" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 2.25, 0, 3.031 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.25, 0, 3.031 )
[node name="HexTile3D35" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 2.25, 0, 3.897 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.25, 0, 3.897 )
[node name="HexTile3D36" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 2.25, 0, 4.763 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.25, 0, 4.763 )
[node name="HexTile3D37" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 2.25, 0, 5.629 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.25, 0, 5.629 )
[node name="HexTile3D38" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 2.25, 0, 6.495 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.25, 0, 6.495 )
[node name="HexTile3D39" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 2.25, 0, 7.361 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.25, 0, 7.361 )
[node name="HexTile3D40" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 2.25, 0, -0.414769 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.25, 0, -0.414769 )
[node name="HexTile3D41" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 3, 0, 0 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, 0 )
[node name="HexTile3D42" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 3, 0, 0.866 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, 0.866 )
[node name="HexTile3D43" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 3, 0, 1.732 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, 1.732 )
[node name="HexTile3D44" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 3, 0, 2.598 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, 2.598 )
[node name="HexTile3D45" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 3, 0, 3.464 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, 3.464 )
[node name="HexTile3D46" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 3, 0, 4.33 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, 4.33 )
[node name="HexTile3D47" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 3, 0, 5.196 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, 5.196 )
[node name="HexTile3D48" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 3, 0, 6.062 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, 6.062 )
[node name="HexTile3D49" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 3, 0, 6.928 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, 6.928 )
[node name="HexTile3D50" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 3, 0, 7.794 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, 7.794 )
[node name="HexTile3D51" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 3.75, 0, 0.433 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3.75, 0, 0.433 )
[node name="HexTile3D52" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 3.75, 0, 1.299 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3.75, 0, 1.299 )
[node name="HexTile3D53" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 3.75, 0, 2.165 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3.75, 0, 2.165 )
[node name="HexTile3D54" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 3.75, 0, 3.031 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3.75, 0, 3.031 )
[node name="HexTile3D55" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 3.75, 0, 3.897 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3.75, 0, 3.897 )
[node name="HexTile3D56" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 3.75, 0, 4.763 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3.75, 0, 4.763 )
[node name="HexTile3D57" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 3.75, 0, 5.629 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3.75, 0, 5.629 )
[node name="HexTile3D58" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 3.75, 0, 6.495 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3.75, 0, 6.495 )
[node name="HexTile3D59" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 3.75, 0, 7.361 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3.75, 0, 7.361 )
[node name="HexTile3D60" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 3.75, 0, -0.414769 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3.75, 0, -0.414769 )
[node name="HexTile3D61" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 4.5, 0, 0 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4.5, 0, 0 )
[node name="HexTile3D62" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 4.5, 0, 0.866 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4.5, 0, 0.866 )
[node name="HexTile3D63" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 4.5, 0, 1.732 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4.5, 0, 1.732 )
[node name="HexTile3D64" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 4.5, 0, 2.598 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4.5, 0, 2.598 )
[node name="HexTile3D65" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 4.5, 0, 3.464 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4.5, 0, 3.464 )
[node name="HexTile3D66" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 4.5, 0, 4.33 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4.5, 0, 4.33 )
[node name="HexTile3D67" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 4.5, 0, 5.196 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4.5, 0, 5.196 )
[node name="HexTile3D68" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 4.5, 0, 6.062 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4.5, 0, 6.062 )
[node name="HexTile3D69" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 4.5, 0, 6.928 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4.5, 0, 6.928 )
[node name="HexTile3D70" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 4.5, 0, 7.794 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4.5, 0, 7.794 )
[node name="HexTile3D71" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 5.25, 0, 0.433 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 5.25, 0, 0.433 )
[node name="HexTile3D72" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 5.25, 0, 1.299 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 5.25, 0, 1.299 )
[node name="HexTile3D73" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 5.25, 0, 2.165 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 5.25, 0, 2.165 )
[node name="HexTile3D74" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 5.25, 0, 3.031 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 5.25, 0, 3.031 )
[node name="HexTile3D75" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 5.25, 0, 3.897 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 5.25, 0, 3.897 )
[node name="HexTile3D76" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 5.25, 0, 4.763 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 5.25, 0, 4.763 )
[node name="HexTile3D77" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 5.25, 0, 5.629 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 5.25, 0, 5.629 )
[node name="HexTile3D78" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 5.25, 0, 6.495 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 5.25, 0, 6.495 )
[node name="HexTile3D79" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 5.25, 0, 7.361 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 5.25, 0, 7.361 )
[node name="HexTile3D80" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 5.25, 0, -0.414769 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 5.25, 0, -0.414769 )
[node name="HexTile3D81" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 6, 0, 0 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 0, 0 )
[node name="HexTile3D82" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 6, 0, 0.866 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 0, 0.866 )
[node name="HexTile3D83" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 6, 0, 1.732 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 0, 1.732 )
[node name="HexTile3D84" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 6, 0, 2.598 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 0, 2.598 )
[node name="HexTile3D85" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 6, 0, 3.464 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 0, 3.464 )
[node name="HexTile3D86" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 6, 0, 4.33 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 0, 4.33 )
[node name="HexTile3D87" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 6, 0, 5.196 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 0, 5.196 )
[node name="HexTile3D88" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 6, 0, 6.062 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 0, 6.062 )
[node name="HexTile3D89" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 6, 0, 6.928 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 0, 6.928 )
[node name="HexTile3D90" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 6, 0, 7.794 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 0, 7.794 )
[node name="HexTile3D91" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 6.75, 0, 0.433 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 6.75, 0, 0.433 )
[node name="HexTile3D92" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 6.75, 0, 1.299 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 6.75, 0, 1.299 )
[node name="HexTile3D93" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 6.75, 0, 2.165 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 6.75, 0, 2.165 )
[node name="HexTile3D94" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 6.75, 0, 3.031 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 6.75, 0, 3.031 )
[node name="HexTile3D95" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 6.75, 0, 3.897 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 6.75, 0, 3.897 )
[node name="HexTile3D96" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 6.75, 0, 4.763 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 6.75, 0, 4.763 )
[node name="HexTile3D97" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 6.75, 0, 5.629 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 6.75, 0, 5.629 )
[node name="HexTile3D98" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 6.75, 0, 6.495 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 6.75, 0, 6.495 )
[node name="HexTile3D99" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 6.75, 0, 7.361 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 6.75, 0, 7.361 )
[node name="HexTile3D100" parent="." instance=ExtResource( 1 )]
transform = Transform( -1.62921e-07, 0, 1, 0, 1, 0, -1, 0, -1.62921e-07, 6.75, 0, -0.414769 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 6.75, 0, -0.414769 )

View File

@ -1,62 +1,6 @@
[gd_scene load_steps=5 format=2]
[gd_scene load_steps=4 format=2]
[sub_resource type="Shader" id=1]
code = "shader_type canvas_item;
render_mode skip_vertex_transform;
void vertex() {
VERTEX = (WORLD_MATRIX * (EXTRA_MATRIX * vec4(VERTEX, 0.0, 1.0))).xy;
}
vec3 color_ramp(float h) {
if (h < 0.4f) {
return vec3(0, 0, 0.6);
} else if (h < 0.45f) {
return vec3(0, 0, 0.7);
} else if (h < 0.5f) {
return vec3(0, 0, 1);
} else if (h < 0.55){
return vec3(0.8, 0.8, 0.1);
} else if (h < 0.6){
return vec3(0, 0.6, 0);
} else if (h < 0.68){
return vec3(0, 0.4, 0);
} else if (h <= 0.78){
return vec3(0.6, 0.6, 0.6);
} else if (h < 1.0){
return vec3(0.8, 0.8, 0.8);
}
return vec3(1.0);
}
vec3 rgbToGrayscale(vec3 color) {
return vec3(dot(color.rgb, vec3(0.299, 0.587, 0.144)));
}
float borderFalloff(vec2 uv) {
return min(
(0.5 - abs(-uv.x + 0.5)) * 2.0,
(0.5 - abs(-uv.y + 0.5)) * 2.0);
}
float borderFalloffCircle(vec2 uv) {
return (0.5 - length(vec2(uv - vec2(0.5, 0.5)))) * 2.0;
}
void fragment() {
vec4 texture_color = texture(TEXTURE, UV);
COLOR.rgb = vec3(abs(UV.x - 0.5) * 2.0);
//COLOR.rgb = color_ramp(texture_color.r * borderFalloffCircle(UV) * 1.8);
COLOR.rgb = color_ramp(texture_color.r * borderFalloff(UV) * 1.8);
}
"
[sub_resource type="ShaderMaterial" id=2]
shader = SubResource( 1 )
[ext_resource path="res://materials/IslandColorRampShader.tres" type="Material" id=1]
[sub_resource type="OpenSimplexNoise" id=3]
seed = 57
@ -79,7 +23,7 @@ margin_right = 861.0
margin_bottom = 595.0
[node name="TextureRect" type="TextureRect" parent="GridContainer"]
material = SubResource( 2 )
material = ExtResource( 1 )
margin_right = 861.0
margin_bottom = 595.0
size_flags_horizontal = 3

View File

@ -1,6 +1,11 @@
using Godot;
using System;
using System.Linq;
using System.Numerics;
using System.Diagnostics;
using GoDotLog;
using Vector2 = Godot.Vector2;
using Vector3 = Godot.Vector3;
public class TileWorld : Spatial
{
@ -9,27 +14,42 @@ public class TileWorld : Spatial
delegate void WorldGenerated();
// public members
public Image Heightmap;
public Vector2 Size = new Vector2(100, 100);
public Vector2 Size = new Vector2(10, 10);
public float HeightScale = 10;
public Image Heightmap;
public Image Colormap;
public int Seed = 0;
// private members
private HexGrid _hexGrid;
private Random _tileTypeRandom;
private Viewport _offscreenViewport;
private TextureRect _offscreenTextureRect;
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
_hexGrid = new HexGrid();
_tileTypeRandom = new Random();
_offscreenViewport = (Viewport)GetNode("OffscreenViewport");
Debug.Assert(_offscreenViewport != null);
_offscreenViewport.Size = Size;
_offscreenTextureRect = (TextureRect)GetNode("OffscreenViewport/TextureRect");
Debug.Assert(_offscreenTextureRect != null);
_offscreenTextureRect.SetSize(Size);
//VisualServer.Singleton.Connect("frame_post_draw", this, nameof(GenerateNoiseColorMap));
}
public void Generate()
{
GenerateSimpleMap();
//GenerateNoiseMap();
// GenerateNoiseMap();
GenerateNoiseColorMap();
EmitSignal("WorldGenerated");
}
@ -58,14 +78,36 @@ public class TileWorld : Spatial
NoiseTexture noise_texture = new NoiseTexture();
OpenSimplexNoise noise_generator = new OpenSimplexNoise();
noise_generator.Seed = -1626828106;
noise_generator.Octaves = 3;
noise_generator.Seed = Seed;
noise_generator.Octaves = 4;
noise_generator.Period = 20;
noise_generator.Persistence = 0.1f;
noise_generator.Lacunarity = 2;
Heightmap.CopyFrom(noise_generator.GetImage((int)Size.x, (int)Size.y, null));
}
private void GenerateNoiseColorMap()
{
Colormap = new Image();
Colormap.Create((int)Size.x, (int)Size.y, false, Image.Format.Rgba8);
NoiseTexture noise_texture = new NoiseTexture();
OpenSimplexNoise noise_generator = new OpenSimplexNoise();
noise_generator.Seed = Seed;
noise_generator.Octaves = 4;
noise_generator.Period = 20;
noise_generator.Persistence = 0.2f;
noise_generator.Lacunarity = 4;
ImageTexture imageTexture = new ImageTexture();
imageTexture.CreateFromImage(noise_generator.GetImage((int)Size.x, (int)Size.y, null));
imageTexture.Flags = 0;
_offscreenTextureRect.Texture = imageTexture;
Colormap.CopyFrom(_offscreenViewport.GetTexture().GetData());
}
private void ApplyHeightMap()

View File

@ -17,12 +17,13 @@ size = Vector2( 100, 100 )
own_world = true
handle_input_locally = false
hdr = false
disable_3d = true
usage = 0
render_target_v_flip = true
render_target_update_mode = 3
[node name="TextureRect" type="TextureRect" parent="OffscreenViewport"]
material = ExtResource( 3 )
margin_right = 40.0
margin_bottom = 40.0
texture = ExtResource( 2 )
[node name="Camera2D" type="Camera2D" parent="OffscreenViewport"]