diff --git a/maps/basic_setup.tscn b/maps/basic_setup.tscn index 18ad6cb..175d2c2 100644 --- a/maps/basic_setup.tscn +++ b/maps/basic_setup.tscn @@ -1,9 +1,9 @@ [gd_scene load_steps=17 format=3 uid="uid://cvdmfc2hi172g"] -[ext_resource type="Material" uid="uid://cdijyqa881tvv" path="res://maps/materials/simple_grid_world.material" id="1_h84bv"] +[ext_resource type="Material" uid="uid://dpegsmygxcfmv" path="res://maps/materials/basic_ground.material" id="1_lodye"] [ext_resource type="PackedScene" uid="uid://cveshwnu272vf" path="res://maps/ramp-complex.tscn" id="2_4eueh"] [ext_resource type="PackedScene" uid="uid://omess6wwwwcq" path="res://maps/ramp-moving.tscn" id="3_bvbgo"] -[ext_resource type="PackedScene" path="res://maps/moutain.tscn" id="3_rbp35"] +[ext_resource type="PackedScene" uid="uid://dvsl8x3lb1h4e" path="res://maps/moutain.tscn" id="3_rbp35"] [ext_resource type="PackedScene" path="res://maps/cave.tscn" id="4_pc85h"] [ext_resource type="PackedScene" uid="uid://b61edh0bre65c" path="res://maps/ramp.tscn" id="5_dfm8h"] [ext_resource type="PackedScene" uid="uid://bl1widitqdugs" path="res://maps/obstacles.tscn" id="5_mi3we"] @@ -26,7 +26,7 @@ volumetric_fog_emission = Color(0.407843, 0.415686, 0.439216, 1) volumetric_fog_detail_spread = 1.60766 [sub_resource type="BoxMesh" id="BoxMesh_k23th"] -material = ExtResource( "1_h84bv" ) +material = ExtResource( "1_lodye" ) [sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_lld3w"] data = PackedVector3Array(-0.5, 0.5, 0.5, 0.5, 0.5, 0.5, -0.5, -0.5, 0.5, 0.5, 0.5, 0.5, 0.5, -0.5, 0.5, -0.5, -0.5, 0.5, 0.5, 0.5, -0.5, -0.5, 0.5, -0.5, 0.5, -0.5, -0.5, -0.5, 0.5, -0.5, -0.5, -0.5, -0.5, 0.5, -0.5, -0.5, 0.5, 0.5, 0.5, 0.5, 0.5, -0.5, 0.5, -0.5, 0.5, 0.5, 0.5, -0.5, 0.5, -0.5, -0.5, 0.5, -0.5, 0.5, -0.5, 0.5, -0.5, -0.5, 0.5, 0.5, -0.5, -0.5, -0.5, -0.5, 0.5, 0.5, -0.5, -0.5, 0.5, -0.5, -0.5, -0.5, 0.5, 0.5, 0.5, -0.5, 0.5, 0.5, 0.5, 0.5, -0.5, -0.5, 0.5, 0.5, -0.5, 0.5, -0.5, 0.5, 0.5, -0.5, -0.5, -0.5, 0.5, 0.5, -0.5, 0.5, -0.5, -0.5, -0.5, 0.5, -0.5, 0.5, 0.5, -0.5, -0.5, -0.5, -0.5, -0.5) diff --git a/maps/materials/basic_ground.material b/maps/materials/basic_ground.material new file mode 100644 index 0000000..b7da22b Binary files /dev/null and b/maps/materials/basic_ground.material differ diff --git a/maps/materials/basic_ground_mountain.material b/maps/materials/basic_ground_mountain.material new file mode 100644 index 0000000..3d6ae47 Binary files /dev/null and b/maps/materials/basic_ground_mountain.material differ diff --git a/maps/moutain.tscn b/maps/moutain.tscn index 5b38fa3..5ea8eb4 100644 --- a/maps/moutain.tscn +++ b/maps/moutain.tscn @@ -1,9 +1,8 @@ -[gd_scene load_steps=3 format=3] +[gd_scene load_steps=2 format=3 uid="uid://dvsl8x3lb1h4e"] [ext_resource type="PackedScene" uid="uid://bas4wwnjq76wm" path="res://maps/imports/moutain.gltf" id="1_afq06"] -[ext_resource type="Material" path="res://maps/materials/simple_grid_world.material" id="2_pll6h"] [node name="moutain" instance=ExtResource( "1_afq06" )] -[node name="moutain2" parent="." index="0"] -material_override = ExtResource( "2_pll6h" ) +[node name="moutain" parent="moutain2" index="0"] +visible = false diff --git a/maps/shaders/base_ground.gdshader b/maps/shaders/base_ground.gdshader new file mode 100644 index 0000000..7754513 --- /dev/null +++ b/maps/shaders/base_ground.gdshader @@ -0,0 +1,89 @@ +// NOTE: Shader automatically converted from Godot Engine 4.0.alpha2's StandardMaterial3D. + +shader_type spatial; +render_mode blend_mix,depth_draw_opaque,cull_back,diffuse_burley,specular_schlick_ggx; +uniform vec4 albedo : hint_color; +uniform sampler2D texture_albedo : hint_albedo,filter_linear_mipmap,repeat_enable; +uniform float point_size : hint_range(0,128); +uniform float roughness : hint_range(0,1); +uniform sampler2D texture_metallic : hint_white,filter_linear_mipmap,repeat_enable; +uniform vec4 metallic_texture_channel; +uniform sampler2D texture_roughness : hint_roughness_gray,filter_linear_mipmap,repeat_enable; +uniform float specular; +uniform float metallic; +uniform sampler2D texture_normal : hint_roughness_normal,filter_linear_mipmap,repeat_enable; +uniform float normal_scale : hint_range(-16,16); +uniform sampler2D texture_heightmap : hint_black,filter_linear_mipmap,repeat_enable; +uniform float heightmap_scale; +uniform int heightmap_min_layers; +uniform int heightmap_max_layers; +uniform vec2 heightmap_flip; +uniform vec3 uv1_scale; +uniform vec3 uv1_offset; +uniform vec3 uv2_scale; +uniform vec3 uv2_offset; + +vec4 hash4( vec2 p ) { return fract(sin(vec4( 1.0+dot(p,vec2(37.0,17.0)), + 2.0+dot(p,vec2(11.0,47.0)), + 3.0+dot(p,vec2(41.0,29.0)), + 4.0+dot(p,vec2(23.0,31.0))))*103.0); } + +vec4 reduce_tiling( sampler2D samp, in vec2 uv ) +{ + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + + // generate per-tile transform + vec4 ofa = hash4( iuv + vec2(0.0,0.0) ); + vec4 ofb = hash4( iuv + vec2(1.0,0.0) ); + vec4 ofc = hash4( iuv + vec2(0.0,1.0) ); + vec4 ofd = hash4( iuv + vec2(1.0,1.0) ); + + vec2 ddx = dFdx( uv ); + vec2 ddy = dFdy( uv ); + + // transform per-tile uvs + ofa.zw = sign(ofa.zw-0.5); + ofb.zw = sign(ofb.zw-0.5); + ofc.zw = sign(ofc.zw-0.5); + ofd.zw = sign(ofd.zw-0.5); + + // uv's, and derivarives (for correct mipmapping) + vec2 uva = uv*ofa.zw + ofa.xy; vec2 ddxa = ddx*ofa.zw; vec2 ddya = ddy*ofa.zw; + vec2 uvb = uv*ofb.zw + ofb.xy; vec2 ddxb = ddx*ofb.zw; vec2 ddyb = ddy*ofb.zw; + vec2 uvc = uv*ofc.zw + ofc.xy; vec2 ddxc = ddx*ofc.zw; vec2 ddyc = ddy*ofc.zw; + vec2 uvd = uv*ofd.zw + ofd.xy; vec2 ddxd = ddx*ofd.zw; vec2 ddyd = ddy*ofd.zw; + + // fetch and blend + vec2 b = smoothstep(0.25,0.75,fuv); + + return mix( mix( textureGrad( samp, uva, ddxa, ddya ), + textureGrad( samp, uvb, ddxb, ddyb ), b.x ), + mix( textureGrad( samp, uvc, ddxc, ddyc ), + textureGrad( samp, uvd, ddxd, ddyd ), b.x), b.y ); +} + +void vertex() { + UV=UV*uv1_scale.xy+uv1_offset.xy; +} + + +void fragment() { + vec2 base_uv = UV; + { + vec3 view_dir = normalize(normalize(-VERTEX)*mat3(TANGENT*heightmap_flip.x,-BINORMAL*heightmap_flip.y,NORMAL)); + float depth = 1.0 - reduce_tiling(texture_heightmap, base_uv).r; + vec2 ofs = base_uv - view_dir.xy * depth * heightmap_scale; + base_uv=ofs; + } + vec4 albedo_tex = reduce_tiling(texture_albedo,base_uv); + ALBEDO = albedo.rgb * albedo_tex.rgb; + float metallic_tex = dot(reduce_tiling(texture_metallic,base_uv),metallic_texture_channel); + METALLIC = metallic_tex * metallic; + vec4 roughness_texture_channel = vec4(0.333333,0.333333,0.333333,0.0); + float roughness_tex = dot(reduce_tiling(texture_roughness,base_uv),roughness_texture_channel); + ROUGHNESS = roughness_tex * roughness; + SPECULAR = specular; + NORMAL_MAP = reduce_tiling(texture_normal,base_uv).rgb; + NORMAL_MAP_DEPTH = normal_scale; +} diff --git a/maps/textures/base_ground_aa_01/base_ground_aa_01_basecolor.png b/maps/textures/base_ground_aa_01/base_ground_aa_01_basecolor.png new file mode 100644 index 0000000..8458870 Binary files /dev/null and b/maps/textures/base_ground_aa_01/base_ground_aa_01_basecolor.png differ diff --git a/maps/textures/base_ground_aa_01/base_ground_aa_01_basecolor.png.import b/maps/textures/base_ground_aa_01/base_ground_aa_01_basecolor.png.import new file mode 100644 index 0000000..1ba2b37 --- /dev/null +++ b/maps/textures/base_ground_aa_01/base_ground_aa_01_basecolor.png.import @@ -0,0 +1,36 @@ +[remap] + +importer="texture" +type="StreamTexture2D" +uid="uid://dktq7grvqd28t" +path.s3tc="res://.godot/imported/base_ground_aa_01_basecolor.png-700262e05c3d1d33f43a3abf3320a3a6.s3tc.stex" +path.etc2="res://.godot/imported/base_ground_aa_01_basecolor.png-700262e05c3d1d33f43a3abf3320a3a6.etc2.stex" +metadata={ +"imported_formats": ["s3tc", "etc2"], +"vram_texture": true +} + +[deps] + +source_file="res://maps/textures/base_ground_aa_01/base_ground_aa_01_basecolor.png" +dest_files=["res://.godot/imported/base_ground_aa_01_basecolor.png-700262e05c3d1d33f43a3abf3320a3a6.s3tc.stex", "res://.godot/imported/base_ground_aa_01_basecolor.png-700262e05c3d1d33f43a3abf3320a3a6.etc2.stex"] + +[params] + +compress/mode=2 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +compress/normal_map=0 +compress/channel_pack=0 +compress/streamed=false +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/size_limit=0 +detect_3d/compress_to=0 diff --git a/maps/textures/base_ground_aa_01/base_ground_aa_01_height.png b/maps/textures/base_ground_aa_01/base_ground_aa_01_height.png new file mode 100644 index 0000000..f9ec56c Binary files /dev/null and b/maps/textures/base_ground_aa_01/base_ground_aa_01_height.png differ diff --git a/maps/textures/base_ground_aa_01/base_ground_aa_01_height.png.import b/maps/textures/base_ground_aa_01/base_ground_aa_01_height.png.import new file mode 100644 index 0000000..fa387a5 --- /dev/null +++ b/maps/textures/base_ground_aa_01/base_ground_aa_01_height.png.import @@ -0,0 +1,36 @@ +[remap] + +importer="texture" +type="StreamTexture2D" +uid="uid://bepui0ewq3y3g" +path.s3tc="res://.godot/imported/base_ground_aa_01_height.png-eace249d3bdc366ea146f8e88448da4e.s3tc.stex" +path.etc2="res://.godot/imported/base_ground_aa_01_height.png-eace249d3bdc366ea146f8e88448da4e.etc2.stex" +metadata={ +"imported_formats": ["s3tc", "etc2"], +"vram_texture": true +} + +[deps] + +source_file="res://maps/textures/base_ground_aa_01/base_ground_aa_01_height.png" +dest_files=["res://.godot/imported/base_ground_aa_01_height.png-eace249d3bdc366ea146f8e88448da4e.s3tc.stex", "res://.godot/imported/base_ground_aa_01_height.png-eace249d3bdc366ea146f8e88448da4e.etc2.stex"] + +[params] + +compress/mode=2 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +compress/normal_map=0 +compress/channel_pack=0 +compress/streamed=false +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=7 +roughness/src_normal="res://maps/textures/base_ground_aa_01/base_ground_aa_01_normal.png" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/HDR_as_SRGB=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/maps/textures/base_ground_aa_01/base_ground_aa_01_normal.png b/maps/textures/base_ground_aa_01/base_ground_aa_01_normal.png new file mode 100644 index 0000000..fc8d0e0 Binary files /dev/null and b/maps/textures/base_ground_aa_01/base_ground_aa_01_normal.png differ diff --git a/maps/textures/base_ground_aa_01/base_ground_aa_01_normal.png.import b/maps/textures/base_ground_aa_01/base_ground_aa_01_normal.png.import new file mode 100644 index 0000000..6b56291 --- /dev/null +++ b/maps/textures/base_ground_aa_01/base_ground_aa_01_normal.png.import @@ -0,0 +1,36 @@ +[remap] + +importer="texture" +type="StreamTexture2D" +uid="uid://cr8lfe63y14j5" +path.s3tc="res://.godot/imported/base_ground_aa_01_normal.png-e110b0f1da08b52053b5a642b218118e.s3tc.stex" +path.etc2="res://.godot/imported/base_ground_aa_01_normal.png-e110b0f1da08b52053b5a642b218118e.etc2.stex" +metadata={ +"imported_formats": ["s3tc", "etc2"], +"vram_texture": true +} + +[deps] + +source_file="res://maps/textures/base_ground_aa_01/base_ground_aa_01_normal.png" +dest_files=["res://.godot/imported/base_ground_aa_01_normal.png-e110b0f1da08b52053b5a642b218118e.s3tc.stex", "res://.godot/imported/base_ground_aa_01_normal.png-e110b0f1da08b52053b5a642b218118e.etc2.stex"] + +[params] + +compress/mode=2 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +compress/normal_map=1 +compress/channel_pack=0 +compress/streamed=false +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=1 +roughness/src_normal="res://maps/textures/base_ground_aa_01/base_ground_aa_01_normal.png" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/HDR_as_SRGB=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/maps/textures/base_ground_aa_01/base_ground_aa_01_roughness.png b/maps/textures/base_ground_aa_01/base_ground_aa_01_roughness.png new file mode 100644 index 0000000..877e723 Binary files /dev/null and b/maps/textures/base_ground_aa_01/base_ground_aa_01_roughness.png differ diff --git a/maps/textures/base_ground_aa_01/base_ground_aa_01_roughness.png.import b/maps/textures/base_ground_aa_01/base_ground_aa_01_roughness.png.import new file mode 100644 index 0000000..268b325 --- /dev/null +++ b/maps/textures/base_ground_aa_01/base_ground_aa_01_roughness.png.import @@ -0,0 +1,36 @@ +[remap] + +importer="texture" +type="StreamTexture2D" +uid="uid://cp7yn3820dfkl" +path.s3tc="res://.godot/imported/base_ground_aa_01_roughness.png-16acb5789d8e4b63beb68501d1ac4560.s3tc.stex" +path.etc2="res://.godot/imported/base_ground_aa_01_roughness.png-16acb5789d8e4b63beb68501d1ac4560.etc2.stex" +metadata={ +"imported_formats": ["s3tc", "etc2"], +"vram_texture": true +} + +[deps] + +source_file="res://maps/textures/base_ground_aa_01/base_ground_aa_01_roughness.png" +dest_files=["res://.godot/imported/base_ground_aa_01_roughness.png-16acb5789d8e4b63beb68501d1ac4560.s3tc.stex", "res://.godot/imported/base_ground_aa_01_roughness.png-16acb5789d8e4b63beb68501d1ac4560.etc2.stex"] + +[params] + +compress/mode=2 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +compress/normal_map=0 +compress/channel_pack=0 +compress/streamed=false +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/size_limit=0 +detect_3d/compress_to=0 diff --git a/maps/water_space.tscn b/maps/water_space.tscn index 3cccfe4..8684c14 100644 --- a/maps/water_space.tscn +++ b/maps/water_space.tscn @@ -1,12 +1,8 @@ -[gd_scene load_steps=3 format=3 uid="uid://ip4lkyho0gry"] +[gd_scene load_steps=2 format=3 uid="uid://ip4lkyho0gry"] [ext_resource type="PackedScene" uid="uid://crseicp4voddt" path="res://maps/imports/water-space.gltf" id="1_htkji"] -[ext_resource type="Material" uid="uid://cdijyqa881tvv" path="res://maps/materials/simple_grid_world.material" id="2_asppa"] [node name="water-space" instance=ExtResource( "1_htkji" )] -[node name="water_space" parent="." index="0"] -material_override = ExtResource( "2_asppa" ) - [node name="StaticBody3D" parent="water_space/water_space" index="0"] input_ray_pickable = false