diff options
author | Gone2Daly <71726742+Gone2Daly@users.noreply.github.com> | 2023-07-22 21:05:42 +0200 |
---|---|---|
committer | Gone2Daly <71726742+Gone2Daly@users.noreply.github.com> | 2023-07-22 21:05:42 +0200 |
commit | 71b3cd829f80de4c2cd3972d8bfd5ee470a5d180 (patch) | |
tree | b4280fde6eef2ae6987648bc7bf8e00e9011bb7f /game/testing/Buoyancy-in-Godot-4-master | |
parent | ce9022d0df74d6c33db3686622be2050d873ab0b (diff) |
init_testtest3d
Diffstat (limited to 'game/testing/Buoyancy-in-Godot-4-master')
-rw-r--r-- | game/testing/Buoyancy-in-Godot-4-master/.gitattributes | 2 | ||||
-rw-r--r-- | game/testing/Buoyancy-in-Godot-4-master/.gitignore | 2 | ||||
-rw-r--r-- | game/testing/Buoyancy-in-Godot-4-master/Cube.gd | 34 | ||||
-rw-r--r-- | game/testing/Buoyancy-in-Godot-4-master/README.md | 3 | ||||
-rw-r--r-- | game/testing/Buoyancy-in-Godot-4-master/Water.gd | 32 | ||||
-rw-r--r-- | game/testing/Buoyancy-in-Godot-4-master/assets/kloppenheim_06_puresky_4k.exr | bin | 0 -> 73949801 bytes | |||
-rw-r--r-- | game/testing/Buoyancy-in-Godot-4-master/assets/kloppenheim_06_puresky_4k.exr.import | 35 | ||||
-rw-r--r-- | game/testing/Buoyancy-in-Godot-4-master/assets/shaders/water.gdshader | 81 | ||||
-rw-r--r-- | game/testing/Buoyancy-in-Godot-4-master/icon.svg | 1 | ||||
-rw-r--r-- | game/testing/Buoyancy-in-Godot-4-master/icon.svg.import | 37 | ||||
-rw-r--r-- | game/testing/Buoyancy-in-Godot-4-master/main.tscn | 143 | ||||
-rw-r--r-- | game/testing/Buoyancy-in-Godot-4-master/project.godot | 25 | ||||
-rw-r--r-- | game/testing/Buoyancy-in-Godot-4-master/water.tscn | 69 |
13 files changed, 464 insertions, 0 deletions
diff --git a/game/testing/Buoyancy-in-Godot-4-master/.gitattributes b/game/testing/Buoyancy-in-Godot-4-master/.gitattributes new file mode 100644 index 0000000..8ad74f7 --- /dev/null +++ b/game/testing/Buoyancy-in-Godot-4-master/.gitattributes @@ -0,0 +1,2 @@ +# Normalize EOL for all files that Git considers text files. +* text=auto eol=lf diff --git a/game/testing/Buoyancy-in-Godot-4-master/.gitignore b/game/testing/Buoyancy-in-Godot-4-master/.gitignore new file mode 100644 index 0000000..4709183 --- /dev/null +++ b/game/testing/Buoyancy-in-Godot-4-master/.gitignore @@ -0,0 +1,2 @@ +# Godot 4+ specific ignores +.godot/ diff --git a/game/testing/Buoyancy-in-Godot-4-master/Cube.gd b/game/testing/Buoyancy-in-Godot-4-master/Cube.gd new file mode 100644 index 0000000..075e532 --- /dev/null +++ b/game/testing/Buoyancy-in-Godot-4-master/Cube.gd @@ -0,0 +1,34 @@ +extends RigidBody3D + +@export var float_force := 1.0 +@export var water_drag := 0.05 +@export var water_angular_drag := 0.05 + +@onready var gravity: float = ProjectSettings.get_setting("physics/3d/default_gravity") +@onready var water = get_node('/root/Main/Water') + +@onready var probes = $ProbeContainer.get_children() + +var submerged := false + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass + +func _physics_process(delta): + submerged = false + for p in probes: + var depth = water.get_height(p.global_position) - p.global_position.y + if depth > 0: + submerged = true + apply_force(Vector3.UP * float_force * gravity * depth, p.global_position - global_position) + +func _integrate_forces(state: PhysicsDirectBodyState3D): + if submerged: + state.linear_velocity *= 1 - water_drag + state.angular_velocity *= 1 - water_angular_drag diff --git a/game/testing/Buoyancy-in-Godot-4-master/README.md b/game/testing/Buoyancy-in-Godot-4-master/README.md new file mode 100644 index 0000000..9e0e449 --- /dev/null +++ b/game/testing/Buoyancy-in-Godot-4-master/README.md @@ -0,0 +1,3 @@ +# Simple Buoyancy implemented in Godot 4.0 RC + +Water shader from here: https://stayathomedev.com/?utm_source=youtube&utm_medium=desc&utm_content=watershader diff --git a/game/testing/Buoyancy-in-Godot-4-master/Water.gd b/game/testing/Buoyancy-in-Godot-4-master/Water.gd new file mode 100644 index 0000000..b5e2fe7 --- /dev/null +++ b/game/testing/Buoyancy-in-Godot-4-master/Water.gd @@ -0,0 +1,32 @@ +extends MeshInstance3D + +var material: ShaderMaterial +var noise: Image + +var noise_scale: float +var wave_speed: float +var height_scale: float + +var time: float + +# Called when the node enters the scene tree for the first time. +func _ready(): + material = mesh.surface_get_material(0) + noise = material.get_shader_parameter("wave").noise.get_seamless_image(512, 512) + noise_scale = material.get_shader_parameter("noise_scale") + wave_speed = material.get_shader_parameter("wave_speed") + height_scale = material.get_shader_parameter("height_scale") + + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + time += delta + material.set_shader_parameter("wave_time", time) + +func get_height(world_position: Vector3) -> float: + var uv_x = wrapf(world_position.x / noise_scale + time * wave_speed, 0, 1) + var uv_y = wrapf(world_position.z / noise_scale + time * wave_speed, 0, 1) + + var pixel_pos = Vector2(uv_x * noise.get_width(), uv_y * noise.get_height()) + return global_position.y + noise.get_pixelv(pixel_pos).r * height_scale; diff --git a/game/testing/Buoyancy-in-Godot-4-master/assets/kloppenheim_06_puresky_4k.exr b/game/testing/Buoyancy-in-Godot-4-master/assets/kloppenheim_06_puresky_4k.exr Binary files differnew file mode 100644 index 0000000..3343d2c --- /dev/null +++ b/game/testing/Buoyancy-in-Godot-4-master/assets/kloppenheim_06_puresky_4k.exr diff --git a/game/testing/Buoyancy-in-Godot-4-master/assets/kloppenheim_06_puresky_4k.exr.import b/game/testing/Buoyancy-in-Godot-4-master/assets/kloppenheim_06_puresky_4k.exr.import new file mode 100644 index 0000000..3f1eca0 --- /dev/null +++ b/game/testing/Buoyancy-in-Godot-4-master/assets/kloppenheim_06_puresky_4k.exr.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bay3ak8k8pevv" +path.bptc="res://.godot/imported/kloppenheim_06_puresky_4k.exr-b16989c6338774c04a5c25df6ac154bf.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/kloppenheim_06_puresky_4k.exr" +dest_files=["res://.godot/imported/kloppenheim_06_puresky_4k.exr-b16989c6338774c04a5c25df6ac154bf.bptc.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 diff --git a/game/testing/Buoyancy-in-Godot-4-master/assets/shaders/water.gdshader b/game/testing/Buoyancy-in-Godot-4-master/assets/shaders/water.gdshader new file mode 100644 index 0000000..5fba7f9 --- /dev/null +++ b/game/testing/Buoyancy-in-Godot-4-master/assets/shaders/water.gdshader @@ -0,0 +1,81 @@ +shader_type spatial; +render_mode depth_draw_always; + +uniform sampler2D SCREEN_TEXTURE: hint_screen_texture, filter_linear_mipmap; +uniform sampler2D DEPTH_TEXTURE: hint_depth_texture, filter_linear_mipmap; + +uniform vec3 albedo : source_color; +uniform vec3 albedo2 : source_color; +uniform vec4 color_deep : source_color; +uniform vec4 color_shallow : source_color; + +uniform float metallic : hint_range(0.0, 1.0) = 0; +uniform float roughness : hint_range(0.0, 1.0) = 0.02; + +uniform sampler2D texture_normal; +uniform sampler2D texture_normal2; +uniform sampler2D wave; + +uniform float wave_time = 0; +uniform vec2 wave_direction = vec2(2.0,0.0); +uniform vec2 wave_2_direction = vec2(0.0,1.0); +uniform float time_scale : hint_range(0.0, 0.2, 0.005) = 0.025; +uniform float wave_speed = 2.0; +uniform float noise_scale = 10.0; +uniform float height_scale = 0.15; +uniform float beers_law = 2.0; +uniform float depth_offset = -0.75; + +varying float height; +varying vec3 world_pos; + +uniform float edge_scale = 0.1; +uniform float near = 0.5; +uniform float far = 100.0; +uniform vec3 edge_color : source_color; + +float fresnel(float amount, vec3 normal, vec3 view) +{ + return pow((1.0 - clamp(dot(normalize(normal), normalize(view)), 0.0, 1.0 )), amount); +} + +float edge(float depth) { + return near * far / (far + depth * (near - far)); +} + +void vertex() { + world_pos = (MODEL_MATRIX * vec4(VERTEX, 1.0)).xyz; + height = texture(wave, world_pos.xz / noise_scale + wave_time * wave_speed).r; + VERTEX.y += height * height_scale; +} + +void fragment() { + float depth_texture = texture(DEPTH_TEXTURE, SCREEN_UV).r; + float depth = PROJECTION_MATRIX[3][2] / (depth_texture + PROJECTION_MATRIX[2][2]); + depth = depth + VERTEX.z; + float depth_blend = exp((depth + depth_offset) * -beers_law); + depth_blend = clamp(1.0 - depth_blend, 0.0, 1.0); + + vec3 screen_color = textureLod(SCREEN_TEXTURE, SCREEN_UV, depth_blend * 2.5).rgb; + vec3 depth_color = mix(color_shallow.rgb, color_deep.rgb, depth_blend); + vec3 color = mix(screen_color * depth_color, depth_color * 0.25, depth_blend * 0.5); + + float z_depth = edge(texture(DEPTH_TEXTURE, SCREEN_UV).x); + float z_pos = edge(FRAGCOORD.z); + float z_dif = z_depth - z_pos; + + vec2 time = (TIME * wave_direction) * time_scale; + vec2 time2 = (TIME * wave_2_direction) * time_scale; + + vec3 normal_blend = mix(texture(texture_normal, world_pos.xz / noise_scale + time).rgb, texture(texture_normal2, world_pos.xz / noise_scale + time2).rgb, 0.5); + + float fresnel = fresnel(5.0, NORMAL, VIEW); + vec3 surface_color = mix(albedo, albedo2, fresnel); + vec3 depth_color_adj = mix(edge_color, color, step(edge_scale, z_dif)); + + ALBEDO = clamp(surface_color + depth_color_adj,vec3(0),vec3(1.0)); + ALPHA = 1.0; + METALLIC = metallic; + ROUGHNESS = roughness; + NORMAL_MAP = normal_blend; +}
\ No newline at end of file diff --git a/game/testing/Buoyancy-in-Godot-4-master/icon.svg b/game/testing/Buoyancy-in-Godot-4-master/icon.svg new file mode 100644 index 0000000..adc26df --- /dev/null +++ b/game/testing/Buoyancy-in-Godot-4-master/icon.svg @@ -0,0 +1 @@ +<svg height="128" width="128" xmlns="http://www.w3.org/2000/svg"><g transform="translate(32 32)"><path d="m-16-32c-8.86 0-16 7.13-16 15.99v95.98c0 8.86 7.13 15.99 16 15.99h96c8.86 0 16-7.13 16-15.99v-95.98c0-8.85-7.14-15.99-16-15.99z" fill="#363d52"/><path d="m-16-32c-8.86 0-16 7.13-16 15.99v95.98c0 8.86 7.13 15.99 16 15.99h96c8.86 0 16-7.13 16-15.99v-95.98c0-8.85-7.14-15.99-16-15.99zm0 4h96c6.64 0 12 5.35 12 11.99v95.98c0 6.64-5.35 11.99-12 11.99h-96c-6.64 0-12-5.35-12-11.99v-95.98c0-6.64 5.36-11.99 12-11.99z" fill-opacity=".4"/></g><g stroke-width="9.92746" transform="matrix(.10073078 0 0 .10073078 12.425923 2.256365)"><path d="m0 0s-.325 1.994-.515 1.976l-36.182-3.491c-2.879-.278-5.115-2.574-5.317-5.459l-.994-14.247-27.992-1.997-1.904 12.912c-.424 2.872-2.932 5.037-5.835 5.037h-38.188c-2.902 0-5.41-2.165-5.834-5.037l-1.905-12.912-27.992 1.997-.994 14.247c-.202 2.886-2.438 5.182-5.317 5.46l-36.2 3.49c-.187.018-.324-1.978-.511-1.978l-.049-7.83 30.658-4.944 1.004-14.374c.203-2.91 2.551-5.263 5.463-5.472l38.551-2.75c.146-.01.29-.016.434-.016 2.897 0 5.401 2.166 5.825 5.038l1.959 13.286h28.005l1.959-13.286c.423-2.871 2.93-5.037 5.831-5.037.142 0 .284.005.423.015l38.556 2.75c2.911.209 5.26 2.562 5.463 5.472l1.003 14.374 30.645 4.966z" fill="#fff" transform="matrix(4.162611 0 0 -4.162611 919.24059 771.67186)"/><path d="m0 0v-47.514-6.035-5.492c.108-.001.216-.005.323-.015l36.196-3.49c1.896-.183 3.382-1.709 3.514-3.609l1.116-15.978 31.574-2.253 2.175 14.747c.282 1.912 1.922 3.329 3.856 3.329h38.188c1.933 0 3.573-1.417 3.855-3.329l2.175-14.747 31.575 2.253 1.115 15.978c.133 1.9 1.618 3.425 3.514 3.609l36.182 3.49c.107.01.214.014.322.015v4.711l.015.005v54.325c5.09692 6.4164715 9.92323 13.494208 13.621 19.449-5.651 9.62-12.575 18.217-19.976 26.182-6.864-3.455-13.531-7.369-19.828-11.534-3.151 3.132-6.7 5.694-10.186 8.372-3.425 2.751-7.285 4.768-10.946 7.118 1.09 8.117 1.629 16.108 1.846 24.448-9.446 4.754-19.519 7.906-29.708 10.17-4.068-6.837-7.788-14.241-11.028-21.479-3.842.642-7.702.88-11.567.926v.006c-.027 0-.052-.006-.075-.006-.024 0-.049.006-.073.006v-.006c-3.872-.046-7.729-.284-11.572-.926-3.238 7.238-6.956 14.642-11.03 21.479-10.184-2.264-20.258-5.416-29.703-10.17.216-8.34.755-16.331 1.848-24.448-3.668-2.35-7.523-4.367-10.949-7.118-3.481-2.678-7.036-5.24-10.188-8.372-6.297 4.165-12.962 8.079-19.828 11.534-7.401-7.965-14.321-16.562-19.974-26.182 4.4426579-6.973692 9.2079702-13.9828876 13.621-19.449z" fill="#478cbf" transform="matrix(4.162611 0 0 -4.162611 104.69892 525.90697)"/><path d="m0 0-1.121-16.063c-.135-1.936-1.675-3.477-3.611-3.616l-38.555-2.751c-.094-.007-.188-.01-.281-.01-1.916 0-3.569 1.406-3.852 3.33l-2.211 14.994h-31.459l-2.211-14.994c-.297-2.018-2.101-3.469-4.133-3.32l-38.555 2.751c-1.936.139-3.476 1.68-3.611 3.616l-1.121 16.063-32.547 3.138c.015-3.498.06-7.33.06-8.093 0-34.374 43.605-50.896 97.781-51.086h.066.067c54.176.19 97.766 16.712 97.766 51.086 0 .777.047 4.593.063 8.093z" fill="#478cbf" transform="matrix(4.162611 0 0 -4.162611 784.07144 817.24284)"/><path d="m0 0c0-12.052-9.765-21.815-21.813-21.815-12.042 0-21.81 9.763-21.81 21.815 0 12.044 9.768 21.802 21.81 21.802 12.048 0 21.813-9.758 21.813-21.802" fill="#fff" transform="matrix(4.162611 0 0 -4.162611 389.21484 625.67104)"/><path d="m0 0c0-7.994-6.479-14.473-14.479-14.473-7.996 0-14.479 6.479-14.479 14.473s6.483 14.479 14.479 14.479c8 0 14.479-6.485 14.479-14.479" fill="#414042" transform="matrix(4.162611 0 0 -4.162611 367.36686 631.05679)"/><path d="m0 0c-3.878 0-7.021 2.858-7.021 6.381v20.081c0 3.52 3.143 6.381 7.021 6.381s7.028-2.861 7.028-6.381v-20.081c0-3.523-3.15-6.381-7.028-6.381" fill="#fff" transform="matrix(4.162611 0 0 -4.162611 511.99336 724.73954)"/><path d="m0 0c0-12.052 9.765-21.815 21.815-21.815 12.041 0 21.808 9.763 21.808 21.815 0 12.044-9.767 21.802-21.808 21.802-12.05 0-21.815-9.758-21.815-21.802" fill="#fff" transform="matrix(4.162611 0 0 -4.162611 634.78706 625.67104)"/><path d="m0 0c0-7.994 6.477-14.473 14.471-14.473 8.002 0 14.479 6.479 14.479 14.473s-6.477 14.479-14.479 14.479c-7.994 0-14.471-6.485-14.471-14.479" fill="#414042" transform="matrix(4.162611 0 0 -4.162611 656.64056 631.05679)"/></g></svg> diff --git a/game/testing/Buoyancy-in-Godot-4-master/icon.svg.import b/game/testing/Buoyancy-in-Godot-4-master/icon.svg.import new file mode 100644 index 0000000..30883ef --- /dev/null +++ b/game/testing/Buoyancy-in-Godot-4-master/icon.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bin4yeou0ftcw" +path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.svg" +dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.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 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/game/testing/Buoyancy-in-Godot-4-master/main.tscn b/game/testing/Buoyancy-in-Godot-4-master/main.tscn new file mode 100644 index 0000000..bd54991 --- /dev/null +++ b/game/testing/Buoyancy-in-Godot-4-master/main.tscn @@ -0,0 +1,143 @@ +[gd_scene load_steps=18 format=3 uid="uid://b64rk3r14m5br"] + +[ext_resource type="Texture2D" uid="uid://bay3ak8k8pevv" path="res://assets/kloppenheim_06_puresky_4k.exr" id="1_cyo0m"] +[ext_resource type="Shader" path="res://assets/shaders/water.gdshader" id="2_twn8n"] +[ext_resource type="Script" path="res://Water.gd" id="3_t5r3v"] +[ext_resource type="Script" path="res://Cube.gd" id="3_wnrpb"] + +[sub_resource type="PanoramaSkyMaterial" id="PanoramaSkyMaterial_vcvt7"] +panorama = ExtResource("1_cyo0m") + +[sub_resource type="Sky" id="Sky_wc0b5"] +sky_material = SubResource("PanoramaSkyMaterial_vcvt7") + +[sub_resource type="Environment" id="Environment_w5hlc"] +background_mode = 2 +sky = SubResource("Sky_wc0b5") +tonemap_mode = 2 +glow_enabled = true + +[sub_resource type="FastNoiseLite" id="FastNoiseLite_hy6fq"] +fractal_type = 2 + +[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_brvoh"] +seamless = true +as_normal_map = true +bump_strength = 1.5 +noise = SubResource("FastNoiseLite_hy6fq") + +[sub_resource type="FastNoiseLite" id="FastNoiseLite_hs2gb"] +noise_type = 3 +fractal_type = 2 + +[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_u5h0n"] +seamless = true +as_normal_map = true +bump_strength = 1.5 +noise = SubResource("FastNoiseLite_hs2gb") + +[sub_resource type="FastNoiseLite" id="FastNoiseLite_jbi1g"] +noise_type = 3 +frequency = 0.001 +fractal_type = 2 +fractal_octaves = 3 + +[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_7k2l2"] +seamless = true +noise = SubResource("FastNoiseLite_jbi1g") + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_0n3y0"] +render_priority = 0 +shader = ExtResource("2_twn8n") +shader_parameter/albedo = Color(0, 0.321569, 0.431373, 1) +shader_parameter/albedo2 = Color(0, 0.47451, 0.764706, 1) +shader_parameter/color_deep = Color(0.105882, 0.294118, 0.329412, 1) +shader_parameter/color_shallow = Color(0, 0.552941, 0.65098, 1) +shader_parameter/metallic = 0.0 +shader_parameter/roughness = 0.02 +shader_parameter/wave_time = 0.0 +shader_parameter/wave_direction = Vector2(2, 0) +shader_parameter/wave_2_direction = Vector2(0, 1) +shader_parameter/time_scale = 0.025 +shader_parameter/wave_speed = 0.2 +shader_parameter/noise_scale = 10.0 +shader_parameter/height_scale = 2.0 +shader_parameter/beers_law = 0.089 +shader_parameter/depth_offset = -0.75 +shader_parameter/edge_scale = 0.362 +shader_parameter/near = 0.5 +shader_parameter/far = 100.0 +shader_parameter/edge_color = Color(1, 1, 1, 1) +shader_parameter/texture_normal = SubResource("NoiseTexture2D_brvoh") +shader_parameter/texture_normal2 = SubResource("NoiseTexture2D_u5h0n") +shader_parameter/wave = SubResource("NoiseTexture2D_7k2l2") + +[sub_resource type="PlaneMesh" id="PlaneMesh_0xwda"] +material = SubResource("ShaderMaterial_0n3y0") +size = Vector2(500, 500) +subdivide_width = 500 +subdivide_depth = 500 + +[sub_resource type="BoxMesh" id="BoxMesh_km0el"] +size = Vector3(5, 1, 10) + +[sub_resource type="BoxShape3D" id="BoxShape3D_lu3w5"] +size = Vector3(5, 1, 10) + +[node name="Main" type="Node3D"] + +[node name="WorldEnvironment" type="WorldEnvironment" parent="."] +environment = SubResource("Environment_w5hlc") + +[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."] +transform = Transform3D(-0.940098, 0.0859291, -0.329897, -0.23722, -0.859886, 0.452021, -0.244833, 0.503202, 0.828761, 0, 0, 0) +shadow_enabled = true + +[node name="Water" type="MeshInstance3D" parent="."] +mesh = SubResource("PlaneMesh_0xwda") +script = ExtResource("3_t5r3v") + +[node name="Camera3D" type="Camera3D" parent="."] +transform = Transform3D(0.0305324, 0.321287, -0.94649, 0, 0.946931, 0.321437, 0.999534, -0.00981422, 0.0289121, -11.6034, 4.14286, 1.45379) + +[node name="Cube" type="RigidBody3D" parent="."] +transform = Transform3D(-0.761663, 0, -0.647974, 0, 1, 0, 0.647974, 0, -0.761663, 0, 3.13922, 0) +mass = 10.0 +script = ExtResource("3_wnrpb") +float_force = 1.3 +water_angular_drag = 0.1 + +[node name="MeshInstance3D" type="MeshInstance3D" parent="Cube"] +mesh = SubResource("BoxMesh_km0el") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="Cube"] +shape = SubResource("BoxShape3D_lu3w5") + +[node name="ProbeContainer" type="Node3D" parent="Cube"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.590401, 0) + +[node name="Probe" type="Marker3D" parent="Cube/ProbeContainer"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.5, 0, 5) + +[node name="Probe2" type="Marker3D" parent="Cube/ProbeContainer"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.5, 0, 0) + +[node name="Probe3" type="Marker3D" parent="Cube/ProbeContainer"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.5, 0, -5) + +[node name="Probe4" type="Marker3D" parent="Cube/ProbeContainer"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 5) + +[node name="Probe5" type="Marker3D" parent="Cube/ProbeContainer"] + +[node name="Probe6" type="Marker3D" parent="Cube/ProbeContainer"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -5) + +[node name="Probe7" type="Marker3D" parent="Cube/ProbeContainer"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.5, 0, 5) + +[node name="Probe8" type="Marker3D" parent="Cube/ProbeContainer"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.5, 0, 0) + +[node name="Probe9" type="Marker3D" parent="Cube/ProbeContainer"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.5, 0, -5) diff --git a/game/testing/Buoyancy-in-Godot-4-master/project.godot b/game/testing/Buoyancy-in-Godot-4-master/project.godot new file mode 100644 index 0000000..b10c22f --- /dev/null +++ b/game/testing/Buoyancy-in-Godot-4-master/project.godot @@ -0,0 +1,25 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=5 + +[application] + +config/name="Buoyancy YT" +run/main_scene="res://main.tscn" +config/features=PackedStringArray("4.1", "Forward Plus") +config/icon="res://icon.svg" + +[display] + +window/size/viewport_width=1920 +window/size/viewport_height=1080 + +[rendering] + +anti_aliasing/quality/msaa_3d=3 diff --git a/game/testing/Buoyancy-in-Godot-4-master/water.tscn b/game/testing/Buoyancy-in-Godot-4-master/water.tscn new file mode 100644 index 0000000..c336ccc --- /dev/null +++ b/game/testing/Buoyancy-in-Godot-4-master/water.tscn @@ -0,0 +1,69 @@ +[gd_scene load_steps=11 format=3 uid="uid://cty2qgt0i5f4w"] + +[ext_resource type="Shader" path="res://assets/shaders/water.gdshader" id="1_oeaqx"] +[ext_resource type="Script" path="res://Water.gd" id="2_qv0cn"] + +[sub_resource type="FastNoiseLite" id="FastNoiseLite_hy6fq"] +fractal_type = 2 + +[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_brvoh"] +seamless = true +as_normal_map = true +bump_strength = 1.5 +noise = SubResource("FastNoiseLite_hy6fq") + +[sub_resource type="FastNoiseLite" id="FastNoiseLite_hs2gb"] +noise_type = 3 +fractal_type = 2 + +[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_u5h0n"] +seamless = true +as_normal_map = true +bump_strength = 1.5 +noise = SubResource("FastNoiseLite_hs2gb") + +[sub_resource type="FastNoiseLite" id="FastNoiseLite_jbi1g"] +noise_type = 3 +frequency = 0.001 +fractal_type = 2 +fractal_octaves = 3 + +[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_7k2l2"] +seamless = true +noise = SubResource("FastNoiseLite_jbi1g") + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_0n3y0"] +render_priority = 0 +shader = ExtResource("1_oeaqx") +shader_parameter/albedo = Color(0, 0.321569, 0.431373, 1) +shader_parameter/albedo2 = Color(0, 0.47451, 0.764706, 1) +shader_parameter/color_deep = Color(0.105882, 0.294118, 0.329412, 1) +shader_parameter/color_shallow = Color(0, 0.552941, 0.65098, 1) +shader_parameter/metallic = 0.0 +shader_parameter/roughness = 0.02 +shader_parameter/wave_time = 0.0 +shader_parameter/wave_direction = Vector2(2, 0) +shader_parameter/wave_2_direction = Vector2(0, 1) +shader_parameter/time_scale = 0.025 +shader_parameter/wave_speed = 0.2 +shader_parameter/noise_scale = 10.0 +shader_parameter/height_scale = 2.0 +shader_parameter/beers_law = 0.089 +shader_parameter/depth_offset = -0.75 +shader_parameter/edge_scale = 0.362 +shader_parameter/near = 0.5 +shader_parameter/far = 100.0 +shader_parameter/edge_color = Color(1, 1, 1, 1) +shader_parameter/texture_normal = SubResource("NoiseTexture2D_brvoh") +shader_parameter/texture_normal2 = SubResource("NoiseTexture2D_u5h0n") +shader_parameter/wave = SubResource("NoiseTexture2D_7k2l2") + +[sub_resource type="PlaneMesh" id="PlaneMesh_0xwda"] +material = SubResource("ShaderMaterial_0n3y0") +size = Vector2(500, 500) +subdivide_width = 500 +subdivide_depth = 500 + +[node name="Water" type="MeshInstance3D"] +mesh = SubResource("PlaneMesh_0xwda") +script = ExtResource("2_qv0cn") |