Skip to content

Commit

Permalink
stash everything
Browse files Browse the repository at this point in the history
  • Loading branch information
RevoluPowered committed Jun 25, 2024
1 parent 0276df2 commit e527ebf
Show file tree
Hide file tree
Showing 21 changed files with 467 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ map_builder=true
suicide_keybinding=true
enable_space_listing_pages=true
the-mirror-tutorials=true
always_spin_up_local_server=true
check_version_on_start=false
always_spin_up_local_server=false
check_version_on_start=true

[debug_flags]
show_web_socket_debug=false
Expand Down
2 changes: 1 addition & 1 deletion mirror-godot-app/android/.build_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/Users/gordon/Projects/the-mirror/godot-engine/bin/android_source.zip [661a885ab35bb1ba0985e45d2fb86e8d]
C:/Users/Gordon/Desktop/android-template-20-06-24/android-template/bin/android_source.zip [f6dc71e4f9f0f7ae8c59c26606db1d5d]
6 changes: 0 additions & 6 deletions mirror-godot-app/art/environments/physical_sky.tres
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,17 @@ sky_material = ExtResource("1_qa330")
[resource]
background_mode = 2
sky = SubResource("Sky_d7khk")
tonemap_mode = 3
tonemap_exposure = 1.2
tonemap_white = 0.8
ssao_enabled = true
ssao_intensity = 3.0
ssao_power = 2.0
ssao_light_affect = 0.2
glow_enabled = true
glow_hdr_threshold = 1.7
fog_density = 0.02
fog_aerial_perspective = 0.3
fog_sky_affect = 0.5
volumetric_fog_enabled = true
volumetric_fog_density = 0.0003
volumetric_fog_albedo = Color(0.117647, 0.356863, 0.67451, 1)
volumetric_fog_emission_energy = 0.0
volumetric_fog_length = 1024.0
volumetric_fog_ambient_inject = 1.0
volumetric_fog_temporal_reprojection_amount = 0.95
adjustment_enabled = true
2 changes: 1 addition & 1 deletion mirror-godot-app/package.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "6.1.72"
"version": "6.1.110"
}
380 changes: 380 additions & 0 deletions mirror-godot-app/player/animations/animation_controller.tscn

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions mirror-godot-app/player/cameras/camera_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func _process(delta: float) -> void:
var size := Vector2i(_viewport_container.size)
if _viewport.size != size:
_viewport.size = size
# _viewport.scaling_3d_scale = 1.5
var cam_attr = _main_viewport.world_3d.camera_attributes
if cam_attr is CameraAttributesPractical:
cam_attr.dof_blur_amount = size.y * _viewport.scaling_3d_scale * 0.00001
Expand Down Expand Up @@ -134,9 +135,7 @@ func set_camera_zoom_scale(camera_zoom_scale: float) -> void:


func set_camera_3d_scale(new_3d_scale: float) -> void:
assert(new_3d_scale >= 0.249 and new_3d_scale <= 1.001, "3D resolution scale is out of asssumed range,
if we need we can change it (for example to support oversampling)")
_viewport.scaling_3d_scale = new_3d_scale
return


func add_camera_punch(camera_punch: float) -> void:
Expand Down
2 changes: 2 additions & 0 deletions mirror-godot-app/player/vr/main_menu_set_layer_viewport.gd
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ func _intersect_to_viewport_pos(intersect : Vector2) -> Vector2i:

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta):
if not visible:
return
# Hide our pointer, we'll make it visible if we're interacting with the viewport.
pointer.visible = false

Expand Down
5 changes: 5 additions & 0 deletions mirror-godot-app/player/vr/vr_controller.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ stretch = true
[node name="SubViewportVR" type="SubViewport" parent="SubViewportContainerVR"]
use_xr = true
handle_input_locally = false
msaa_2d = 1
msaa_3d = 1
scaling_3d_mode = 1
scaling_3d_scale = 0.75
vrs_mode = 3
size = Vector2i(0, 0)
render_target_update_mode = 4

Expand Down
8 changes: 8 additions & 0 deletions mirror-godot-app/player/vr/vr_controller_menu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ func get_camera() -> XRCamera3D:
return _camera


func get_root() -> Node3D:
return $Root


func get_open_xr_quad() -> OpenXRCompositionLayerQuad:
return $Root/XROrigin3D/OpenXRCompositionLayerQuad


func camera_get_look_target() -> Vector3:
var head = _camera.get_global_transform()
return head.origin + head.basis.z * 10
Expand Down
12 changes: 8 additions & 4 deletions mirror-godot-app/prefabs/space/templates/space_environment.gd
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ func _setup_world_environment() -> void:
environment.ssil_enabled = false
environment.sdfgi_enabled = false
environment.ssr_enabled = false
environment.glow_enabled = false
environment.fog_enabled = false
environment.glow_bloom = false
camera_attributes.dof_blur_far_enabled = false


Expand All @@ -106,16 +109,17 @@ func get_shadow_preset_index() -> int:

func _update_shadows_settings(preset: String, suns_children: Array[Node] = []) -> void:
if not _SHADOWS_SETTING_MAPPINGS.has(preset):
preset = "medium"
preset = "low"
var shadow = _SHADOWS_SETTING_MAPPINGS[preset]
if suns_children.is_empty():
for child in get_children():
if child is DirectionalLight3D:
suns_children.append(child)
for sun in suns_children:
sun.directional_shadow_max_distance = shadow["max_distance"]
sun.shadow_enabled = shadow["enabled"]
sun.shadow_blur = shadow["blur"]
if Util.is_vr_enabled():
sun.directional_shadow_max_distance = 1
sun.shadow_enabled = false
sun.shadow_blur = 1


func _update_environment_settings(data: Dictionary) -> void:
Expand Down
14 changes: 3 additions & 11 deletions mirror-godot-app/prefabs/space/templates/space_template.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,14 @@
[ext_resource type="Script" path="res://prefabs/space/templates/space_environment.gd" id="5_05rgg"]
[ext_resource type="Script" path="res://prefabs/space/templates/space_global_scripts.gd" id="5_p4kuv"]

[sub_resource type="CameraAttributesPractical" id="CameraAttributesPractical_022ca"]
dof_blur_far_enabled = true
dof_blur_far_distance = 150.0
dof_blur_amount = 0.01
[sub_resource type="CameraAttributesPractical" id="CameraAttributesPractical_52xkg"]

[node name="SpaceTemplate" type="Node3D"]
script = ExtResource("1_q53s5")
terrain_seed = 124
terrain_height_start = -10
terrain_height_range = 5
terrain_material_name = "grass"
terrain_generator_name = "rolling_hills_generator01"

[node name="Space Environment" type="WorldEnvironment" parent="."]
environment = ExtResource("2_e25ph")
camera_attributes = SubResource("CameraAttributesPractical_022ca")
camera_attributes = SubResource("CameraAttributesPractical_52xkg")
script = ExtResource("5_05rgg")

[node name="_Hidden" type="Node3D" parent="Space Environment"]
Expand All @@ -34,7 +26,7 @@ material = ExtResource("4_qucd1")

[node name="Sun1" type="DirectionalLight3D" parent="Space Environment"]
transform = Transform3D(0.5, -0.433013, 0.75, 0, 0.866026, 0.5, -0.866025, -0.25, 0.433013, 0, 0, 0)
shadow_enabled = true
directional_shadow_mode = 0
directional_shadow_max_distance = 250.0

[node name="Space Global Scripts" type="Node" parent="."]
Expand Down
26 changes: 19 additions & 7 deletions mirror-godot-app/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -559,27 +559,37 @@ common/enable_pause_aware_picking=true

[rendering]

renderer/rendering_method="mobile"
textures/vram_compression/import_s3tc_bptc=true
textures/vram_compression/import_etc2_astc=true
lights_and_shadows/directional_shadow/size.mobile=256
lights_and_shadows/directional_shadow/soft_shadow_filter_quality=0
lights_and_shadows/positional_shadow/soft_shadow_filter_quality=0
shader_compiler/shader_cache/strip_debug=true
driver/depth_prepass/enable=false
driver/depth_prepass/disable_for_vendors=""
camera/depth_of_field/depth_of_field_bokeh_quality=2
scaling_3d/mode=1
environment/ssao/quality=0
environment/ssil/quality=0
environment/glow/upscale_mode=0
global_illumination/sdfgi/frames_to_converge=0
environment/volumetric_fog/volume_size=128
environment/volumetric_fog/volume_depth=128
environment/volumetric_fog/use_filter=0
environment/defaults/default_clear_color=Color(0.0235294, 0.00392157, 0.121569, 1)
anti_aliasing/quality/screen_space_aa=1
shadows/directional_shadow/size=8192
anti_aliasing/quality/msaa=1
shadows/directional_shadow/soft_shadow_quality=3
shadows/shadows/soft_shadow_quality=3
shadows/shadow_atlas/size=8192
anti_aliasing/quality/msaa_2d=1
anti_aliasing/quality/msaa_3d=1
shadows/directional_shadow/soft_shadow_quality=1
environment/default_clear_color=Color(0.0235294, 0.00392157, 0.121569, 1)
quality/filters/msaa=3
quality/filters/use_fxaa=true
environment/default_environment="res://art/default_env.tres"
quality/godrays/sample_number=50
quality/godrays/use_pcf5=false
quality/godrays/dither_amount=1.0
shadows/directional_shadow/size=4096
shadows/shadow_atlas/size=4096
shadows/shadows/soft_shadow_quality=1

[shader_globals]

Expand Down Expand Up @@ -611,5 +621,7 @@ world_map_max_height_offset_01={
[xr]

openxr/enabled=true
openxr/foveation_level=3
openxr/foveation_dynamic=true
openxr/startup_alert=false
shaders/enabled=true
5 changes: 3 additions & 2 deletions mirror-godot-app/scripts/autoload/util_funcs.gd
Original file line number Diff line number Diff line change
Expand Up @@ -724,5 +724,6 @@ static func compare_with_schema(in_dict_to_compare: Dictionary, in_schema: Dicti


static func is_vr_enabled() -> bool:
var interface = XRServer.find_interface("OpenXR")
return interface and interface.is_initialized()
return true
#var interface = XRServer.find_interface("OpenXR")
#return interface and interface.is_initialized()
3 changes: 0 additions & 3 deletions mirror-godot-app/ui/common/shaders/dark_blue_blur.mat.tres
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@

[resource]
shader = ExtResource("1_5syw1")
shader_parameter/blur = 2.417
shader_parameter/color = Color(0.072, 0.0882, 0.18, 1)
shader_parameter/strength = 0.7
3 changes: 0 additions & 3 deletions mirror-godot-app/ui/common/shaders/grey_blur.mat.tres
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@

[resource]
shader = ExtResource("1_jxj6o")
shader_parameter/blur = 0.7
shader_parameter/color = Color(1, 1, 1, 1)
shader_parameter/strength = 0.05
17 changes: 9 additions & 8 deletions mirror-godot-app/ui/common/shaders/ui_blurr.gdshader
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
shader_type canvas_item;

uniform float blur: hint_range(0.0, 8.0);
uniform vec4 color: source_color;
uniform float strength: hint_range(0.0, 1.0, 0.05);
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;
//uniform float blur: hint_range(0.0, 8.0);
//uniform vec4 color: source_color;
//uniform float strength: hint_range(0.0, 1.0, 0.05);
//uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;

void fragment() {
COLOR = textureLod(SCREEN_TEXTURE, SCREEN_UV, blur);
COLOR = mix(COLOR, color, strength);
}
//void fragment() {
//
//COLOR = textureLod(SCREEN_TEXTURE, SCREEN_UV, blur);
//COLOR = mix(COLOR, color, strength);
//}
4 changes: 3 additions & 1 deletion mirror-godot-app/ui/game/game_ui_instance.gd
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@ func is_any_full_screen_or_modal_ui_visible(ignored_contexts: Array = []) -> boo


func is_mouse_needed_for_ui() -> bool:
return is_any_full_screen_or_modal_ui_visible() \
var state = is_any_full_screen_or_modal_ui_visible() \
or creator_ui.is_mouse_needed_for_ui()
GameUI.set_game_ui_visibility(state)
return state


func is_keyboard_needed_for_ui() -> bool:
Expand Down
22 changes: 18 additions & 4 deletions mirror-godot-app/ui/game/game_ui_static.gd
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ static var _internal_instance = null # this is the actual data
static var _root_node = null
static var _vr_decided = false
static var _sub_viewport: SubViewport = null
static var _vr_controller_menu: VRControllerMenu = null
static var instance:
get:
await ui_ready()
Expand All @@ -44,6 +45,16 @@ static func ui_ready() -> void:
await VRManager.vr_decision_made


static var _last_state: bool = false
static func set_game_ui_visibility(state: bool) -> void:
if _sub_viewport == null or state == _last_state:
return # this is non VR mode and is okay to ignore this setting then
print("VR GameUI status changed: ", state)
_last_state = state
_vr_controller_menu.get_root().visible = state
await _root_node.get_tree().process_frame
_sub_viewport.render_target_update_mode = SubViewport.UPDATE_DISABLED if state else SubViewport.UPDATE_WHEN_VISIBLE

## Called when booting the app when we know if the app is VR or non-VR
static func setup_game_ui(root_node: Node, is_vr: bool):
_root_node = root_node
Expand All @@ -56,19 +67,22 @@ static func setup_game_ui(root_node: Node, is_vr: bool):
## Read here on why we're doing this: https://docs.godotengine.org/en/latest/tutorials/xr/openxr_composition_layers.html#setting-up-the-subviewport
if is_vr:
## Add the player controller for the menu
var vr_player_for_menu = _readonly_vr_menu.instantiate()
var vr_player_for_menu: VRControllerMenu = _readonly_vr_menu.instantiate()
root_node.add_child.call_deferred(vr_player_for_menu)
## Add the subviewport for the VR Headset's UI
_sub_viewport = SubViewport.new()
_sub_viewport.render_target_update_mode = SubViewport.UPDATE_ALWAYS
_sub_viewport.render_target_update_mode = SubViewport.UPDATE_WHEN_VISIBLE
_sub_viewport.disable_3d = true
_sub_viewport.transparent_bg = true
_sub_viewport.transparent_bg = false
_sub_viewport.size = Vector2i(1920, 1050)
# _sub_viewport.use_xr = true
Zone.get_viewport().use_xr = true
var viewport: Viewport = Zone.get_viewport()
viewport.use_xr = true
viewport.vrs_mode = Viewport.VRS_XR
_sub_viewport.set_name("VRSubViewport")
_sub_viewport.add_child.call_deferred(_internal_instance)
root_node.add_child.call_deferred(_sub_viewport)
_vr_controller_menu = vr_player_for_menu
else:
root_node.add_child.call_deferred(_internal_instance)
while _internal_instance.get_parent() == null:
Expand Down
6 changes: 3 additions & 3 deletions mirror-godot-app/ui/login/login_ui.gd
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ var busy: bool = false
## Server is booted.
func start_login_ui() -> void:
assert(not Zone.is_host())
_email_field.grab_focus()
_email_field.text = ""
_password_field.text = ""
#_email_field.grab_focus()
#_email_field.text = ""
#_password_field.text = ""
_remember_me_checkbox.button_pressed = GameplaySettings.login_remember_me
_populate_dev_options_button()
Analytics.track_event_client(AnalyticsEvent.TYPE.LOGIN_UI_READY)
Expand Down
6 changes: 0 additions & 6 deletions mirror-godot-app/ui/login/login_ui.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@

[sub_resource type="ShaderMaterial" id="ShaderMaterial_tm8vm"]
shader = ExtResource("8_uraan")
shader_parameter/blur = 3.0
shader_parameter/color = Color(1, 1, 1, 0)
shader_parameter/strength = 0.15

[sub_resource type="Theme" id="Theme_ij11x"]

Expand All @@ -48,9 +45,6 @@ base_font = ExtResource("13_k150r")

[sub_resource type="ShaderMaterial" id="ShaderMaterial_a3r7x"]
shader = ExtResource("8_uraan")
shader_parameter/blur = 3.0
shader_parameter/color = Color(0, 0, 0, 1)
shader_parameter/strength = 0.0

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_7twde"]
bg_color = Color(0, 0, 0, 0)
Expand Down
6 changes: 0 additions & 6 deletions mirror-godot-app/ui/main_menu/main_menu_ui.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,9 @@ load_path = "res://.godot/imported/blue_bg.jpg-9388e80f4f099bfea8a9c2c05cb56a97.

[sub_resource type="ShaderMaterial" id="ShaderMaterial_0aacv"]
shader = ExtResource("8_w8ibq")
shader_parameter/blur = 1.5
shader_parameter/color = null
shader_parameter/strength = null

[sub_resource type="ShaderMaterial" id="ShaderMaterial_4coir"]
shader = ExtResource("8_w8ibq")
shader_parameter/blur = 3.0
shader_parameter/color = Color(1, 1, 1, 1)
shader_parameter/strength = 0.15

[sub_resource type="Theme" id="Theme_yjf73"]

Expand Down

0 comments on commit e527ebf

Please sign in to comment.