Browse Source

Tweak settings in various 3D demos

- Enable 4× MSAA in all 3D demos.
- Enable filmic tonemapping with a whitepoint of 6 in GLES3 3D demos.
- Add subtle fog to the Truck Town demo.
- Use the `2d` stretch mode and `expand` stretch aspect to support
  multiple resolutions and aspect ratios.
Hugo Locurcio 5 years ago
parent
commit
c6163b3d20

+ 2 - 0
3d/ik/default_env.tres

@@ -7,6 +7,8 @@ background_mode = 2
 background_sky = SubResource( 1 )
 background_sky = SubResource( 1 )
 ambient_light_color = Color( 1, 1, 1, 1 )
 ambient_light_color = Color( 1, 1, 1, 1 )
 ambient_light_sky_contribution = 0.8
 ambient_light_sky_contribution = 0.8
+tonemap_mode = 2
+tonemap_white = 6.0
 glow_enabled = true
 glow_enabled = true
 glow_levels/1 = true
 glow_levels/1 = true
 glow_levels/2 = true
 glow_levels/2 = true

+ 31 - 0
3d/ik/look_at_ik.tscn

@@ -49,7 +49,17 @@ __meta__ = {
 }
 }
 skeleton_path = NodePath("../../../GodotBattleBot/Armature/Skeleton")
 skeleton_path = NodePath("../../../GodotBattleBot/Armature/Skeleton")
 bone_name = "Head"
 bone_name = "Head"
+update_mode = 0
+look_at_axis = 1
+use_our_rotation_x = false
+use_our_rotation_y = false
+use_our_rotation_z = false
+use_negative_our_rot = false
 additional_rotation = Vector3( 90, 0, 0 )
 additional_rotation = Vector3( 90, 0, 0 )
+position_using_additional_bone = false
+additional_bone_name = ""
+additional_bone_length = 1.0
+debug_messages = false
 
 
 [node name="IK_LookAt_LeftArm" type="Spatial" parent="Camera/Targets"]
 [node name="IK_LookAt_LeftArm" type="Spatial" parent="Camera/Targets"]
 script = ExtResource( 6 )
 script = ExtResource( 6 )
@@ -58,6 +68,17 @@ __meta__ = {
 }
 }
 skeleton_path = NodePath("../../../GodotBattleBot/Armature/Skeleton")
 skeleton_path = NodePath("../../../GodotBattleBot/Armature/Skeleton")
 bone_name = "Left_UpperArm"
 bone_name = "Left_UpperArm"
+update_mode = 0
+look_at_axis = 1
+use_our_rotation_x = false
+use_our_rotation_y = false
+use_our_rotation_z = false
+use_negative_our_rot = false
+additional_rotation = Vector3( 0, 0, 0 )
+position_using_additional_bone = false
+additional_bone_name = ""
+additional_bone_length = 1.0
+debug_messages = false
 
 
 [node name="IK_LookAt_RightArm" type="Spatial" parent="Camera/Targets"]
 [node name="IK_LookAt_RightArm" type="Spatial" parent="Camera/Targets"]
 script = ExtResource( 6 )
 script = ExtResource( 6 )
@@ -66,7 +87,17 @@ __meta__ = {
 }
 }
 skeleton_path = NodePath("../../../GodotBattleBot/Armature/Skeleton")
 skeleton_path = NodePath("../../../GodotBattleBot/Armature/Skeleton")
 bone_name = "Right_UpperArm"
 bone_name = "Right_UpperArm"
+update_mode = 0
+look_at_axis = 1
+use_our_rotation_x = false
+use_our_rotation_y = false
+use_our_rotation_z = false
+use_negative_our_rot = false
 additional_rotation = Vector3( 0, 0, 180 )
 additional_rotation = Vector3( 0, 0, 180 )
+position_using_additional_bone = false
+additional_bone_name = ""
+additional_bone_length = 1.0
+debug_messages = false
 
 
 [node name="Control" type="Control" parent="."]
 [node name="Control" type="Control" parent="."]
 anchor_right = 1.0
 anchor_right = 1.0

+ 6 - 0
3d/ik/project.godot

@@ -22,10 +22,16 @@ different ways they can be used, including via SkeletonIK."
 run/main_scene="res://look_at_ik.tscn"
 run/main_scene="res://look_at_ik.tscn"
 config/icon="res://icon.png"
 config/icon="res://icon.png"
 
 
+[display]
+
+window/stretch/mode="2d"
+window/stretch/aspect="expand"
+
 [editor_plugins]
 [editor_plugins]
 
 
 enabled=PoolStringArray( "sade" )
 enabled=PoolStringArray( "sade" )
 
 
 [rendering]
 [rendering]
 
 
+quality/filters/msaa=2
 environment/default_environment="res://default_env.tres"
 environment/default_environment="res://default_env.tres"

+ 3 - 3
3d/kinematic_character/cubio.gd

@@ -14,17 +14,17 @@ func _physics_process(delta):
 		get_tree().quit()
 		get_tree().quit()
 	if Input.is_action_just_pressed("reset_position"):
 	if Input.is_action_just_pressed("reset_position"):
 		translation = Vector3(-3, 4, 8)
 		translation = Vector3(-3, 4, 8)
-	
+
 	var dir = Vector3()
 	var dir = Vector3()
 	dir.x = Input.get_action_strength("move_right") - Input.get_action_strength("move_left")
 	dir.x = Input.get_action_strength("move_right") - Input.get_action_strength("move_left")
 	dir.z = Input.get_action_strength("move_back") - Input.get_action_strength("move_forward")
 	dir.z = Input.get_action_strength("move_back") - Input.get_action_strength("move_forward")
-	
+
 	# Get the camera's transform basis, but remove the X rotation such
 	# Get the camera's transform basis, but remove the X rotation such
 	# that the Y axis is up and Z is horizontal.
 	# that the Y axis is up and Z is horizontal.
 	var cam_basis = $Target/Camera.global_transform.basis
 	var cam_basis = $Target/Camera.global_transform.basis
 	var basis = cam_basis.rotated(cam_basis.x, -cam_basis.get_euler().x)
 	var basis = cam_basis.rotated(cam_basis.x, -cam_basis.get_euler().x)
 	dir = basis.xform(dir)
 	dir = basis.xform(dir)
-	
+
 	# Limit the input to a length of 1. length_squared is faster to check.
 	# Limit the input to a length of 1. length_squared is faster to check.
 	if dir.length_squared() > 1:
 	if dir.length_squared() > 1:
 		dir /= dir.length()
 		dir /= dir.length()

+ 2 - 0
3d/kinematic_character/default_env.tres

@@ -15,6 +15,8 @@ texture_size = 0
 [resource]
 [resource]
 background_mode = 2
 background_mode = 2
 background_sky = SubResource( 1 )
 background_sky = SubResource( 1 )
+tonemap_mode = 2
+tonemap_white = 6.0
 ssao_blur = 1
 ssao_blur = 1
 glow_levels/7 = true
 glow_levels/7 = true
 glow_strength = 0.79
 glow_strength = 0.79

File diff suppressed because it is too large
+ 3 - 4
3d/kinematic_character/level.tscn


+ 2 - 0
3d/material_testers/default_env.tres

@@ -9,6 +9,8 @@ panorama = ExtResource( 1 )
 background_mode = 2
 background_mode = 2
 background_sky = SubResource( 1 )
 background_sky = SubResource( 1 )
 tonemap_mode = 2
 tonemap_mode = 2
+tonemap_exposure = 1.2
+tonemap_white = 6.0
 ssao_enabled = true
 ssao_enabled = true
 ssao_light_affect = 0.78
 ssao_light_affect = 0.78
 ssao_quality = 2
 ssao_quality = 2

+ 1 - 1
3d/material_testers/tester.gd

@@ -40,7 +40,7 @@ func _unhandled_input(ev):
 			zoom += ZOOM_SPEED
 			zoom += ZOOM_SPEED
 		zoom = clamp(zoom, 2, 8)
 		zoom = clamp(zoom, 2, 8)
 		camera.translation.z = zoom
 		camera.translation.z = zoom
-	
+
 	if ev is InputEventMouseMotion and ev.button_mask & MAIN_BUTTONS:
 	if ev is InputEventMouseMotion and ev.button_mask & MAIN_BUTTONS:
 		# Compensate motion speed to be resolution-independent (based on the window height).
 		# Compensate motion speed to be resolution-independent (based on the window height).
 		var relative_motion = ev.relative * get_viewport().size.y / base_height
 		var relative_motion = ev.relative * get_viewport().size.y / base_height

+ 6 - 6
3d/navmesh/navmesh.gd

@@ -33,16 +33,16 @@ func _process(delta):
 			else:
 			else:
 				path[path.size() - 1] = pfrom.linear_interpolate(pto, to_walk / d)
 				path[path.size() - 1] = pfrom.linear_interpolate(pto, to_walk / d)
 				to_walk = 0
 				to_walk = 0
-		
+
 		var atpos = path[path.size() - 1]
 		var atpos = path[path.size() - 1]
 		var atdir = to_watch
 		var atdir = to_watch
 		atdir.y = 0
 		atdir.y = 0
-		
+
 		var t = Transform()
 		var t = Transform()
 		t.origin = atpos
 		t.origin = atpos
 		t = t.looking_at(atpos + atdir, Vector3.UP)
 		t = t.looking_at(atpos + atdir, Vector3.UP)
 		get_node("RobotBase").set_transform(t)
 		get_node("RobotBase").set_transform(t)
-		
+
 		if path.size() < 2:
 		if path.size() < 2:
 			path = []
 			path = []
 			set_process(false)
 			set_process(false)
@@ -55,11 +55,11 @@ func _unhandled_input(event):
 		var from = get_node("CameraBase/Camera").project_ray_origin(event.position)
 		var from = get_node("CameraBase/Camera").project_ray_origin(event.position)
 		var to = from + get_node("CameraBase/Camera").project_ray_normal(event.position) * 100
 		var to = from + get_node("CameraBase/Camera").project_ray_normal(event.position) * 100
 		var p = get_closest_point_to_segment(from, to)
 		var p = get_closest_point_to_segment(from, to)
-		
+
 		begin = get_closest_point(get_node("RobotBase").get_translation())
 		begin = get_closest_point(get_node("RobotBase").get_translation())
 		end = p
 		end = p
 		_update_path()
 		_update_path()
-	
+
 	if event is InputEventMouseMotion:
 	if event is InputEventMouseMotion:
 		if event.button_mask & (BUTTON_MASK_MIDDLE + BUTTON_MASK_RIGHT):
 		if event.button_mask & (BUTTON_MASK_MIDDLE + BUTTON_MASK_RIGHT):
 			camrot += event.relative.x * 0.005
 			camrot += event.relative.x * 0.005
@@ -72,7 +72,7 @@ func _update_path():
 	path = Array(p) # Vector3 array too complex to use, convert to regular array.
 	path = Array(p) # Vector3 array too complex to use, convert to regular array.
 	path.invert()
 	path.invert()
 	set_process(true)
 	set_process(true)
-	
+
 	if draw_path:
 	if draw_path:
 		var im = get_node("Draw")
 		var im = get_node("Draw")
 		im.set_material_override(m)
 		im.set_material_override(m)

+ 1 - 0
3d/navmesh/project.godot

@@ -30,3 +30,4 @@ singletons=[  ]
 [rendering]
 [rendering]
 
 
 quality/driver/driver_name="GLES2"
 quality/driver/driver_name="GLES2"
+quality/filters/msaa=2

+ 7 - 0
3d/physics_tests/project.godot

@@ -39,6 +39,11 @@ System="*res://utils/system.gd"
 
 
 gdscript/warnings/return_value_discarded=false
 gdscript/warnings/return_value_discarded=false
 
 
+[display]
+
+window/stretch/mode="2d"
+window/stretch/aspect="expand"
+
 [input]
 [input]
 
 
 toggle_full_screen={
 toggle_full_screen={
@@ -65,3 +70,5 @@ restart_test={
 [rendering]
 [rendering]
 
 
 quality/driver/driver_name="GLES2"
 quality/driver/driver_name="GLES2"
+environment/default_clear_color=Color( 0, 0, 0, 1 )
+quality/filters/msaa=2

+ 1 - 0
3d/platformer/default_env.tres

@@ -10,3 +10,4 @@ panorama = ExtResource( 1 )
 background_mode = 2
 background_mode = 2
 background_sky = SubResource( 1 )
 background_sky = SubResource( 1 )
 tonemap_mode = 2
 tonemap_mode = 2
+tonemap_white = 6.0

File diff suppressed because it is too large
+ 0 - 0
3d/platformer/stage/stage.tscn


+ 4 - 0
3d/truck_town/default_env.tres

@@ -9,3 +9,7 @@ background_mode = 2
 background_sky = SubResource( 1 )
 background_sky = SubResource( 1 )
 ambient_light_color = Color( 0.347656, 0.347656, 0.347656, 1 )
 ambient_light_color = Color( 0.347656, 0.347656, 0.347656, 1 )
 ambient_light_sky_contribution = 0.2
 ambient_light_sky_contribution = 0.2
+fog_enabled = true
+fog_color = Color( 0.686275, 0.772549, 0.815686, 1 )
+fog_sun_amount = 1.0
+fog_depth_end = 200.0

+ 1 - 0
3d/truck_town/project.godot

@@ -76,4 +76,5 @@ shadow_filter=3
 [rendering]
 [rendering]
 
 
 quality/driver/driver_name="GLES2"
 quality/driver/driver_name="GLES2"
+quality/filters/msaa=2
 environment/default_environment="res://default_env.tres"
 environment/default_environment="res://default_env.tres"

+ 3 - 0
3d/voxel/project.godot

@@ -39,6 +39,8 @@ Settings="*res://settings.gd"
 
 
 window/size/width=1600
 window/size/width=1600
 window/size/height=900
 window/size/height=900
+window/stretch/mode="2d"
+window/stretch/aspect="expand"
 
 
 [input]
 [input]
 
 
@@ -157,5 +159,6 @@ common/physics_fps=120
 quality/driver/driver_name="GLES2"
 quality/driver/driver_name="GLES2"
 vram_compression/import_etc=true
 vram_compression/import_etc=true
 vram_compression/import_etc2=false
 vram_compression/import_etc2=false
+quality/filters/msaa=2
 environment/default_environment="res://default_env.tres"
 environment/default_environment="res://default_env.tres"
 gles2/debug/disable_half_float=true
 gles2/debug/disable_half_float=true

Some files were not shown because too many files changed in this diff