187 lines
5.7 KiB
Text
187 lines
5.7 KiB
Text
[gd_scene load_steps=9 format=2]
|
|
|
|
[ext_resource path="res://game_scene/Game/Character/Character.gd" type="Script" id=1]
|
|
[ext_resource path="res://game_scene/Game/Character/infos_spatial.gd" type="Script" id=2]
|
|
[ext_resource path="res://game_scene/character_infos_billboard.tscn" type="PackedScene" id=3]
|
|
[ext_resource path="res://game_scene/suzanne/suzanne_shape_keys.escn" type="PackedScene" id=4]
|
|
[ext_resource path="res://game_scene/suzanne/suzanne.obj" type="ArrayMesh" id=5]
|
|
|
|
|
|
[sub_resource type="Shader" id=1]
|
|
|
|
code = "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;
|
|
uniform float specular;
|
|
uniform float metallic;
|
|
uniform float roughness : hint_range(0,1);
|
|
uniform float point_size : hint_range(0,128);
|
|
uniform sampler2D texture_metallic : hint_white;
|
|
uniform vec4 metallic_texture_channel;
|
|
uniform sampler2D texture_roughness : hint_white;
|
|
uniform vec4 roughness_texture_channel;
|
|
uniform vec3 uv1_scale;
|
|
uniform vec3 uv1_offset;
|
|
uniform vec3 uv2_scale;
|
|
uniform vec3 uv2_offset;
|
|
|
|
|
|
void vertex() {
|
|
UV=UV*uv1_scale.xy+uv1_offset.xy;
|
|
}
|
|
|
|
|
|
|
|
|
|
void fragment() {
|
|
vec2 base_uv = UV;
|
|
vec4 albedo_tex = texture(texture_albedo,base_uv);
|
|
ALBEDO = albedo.rgb * albedo_tex.rgb;
|
|
float metallic_tex = dot(texture(texture_metallic,base_uv),metallic_texture_channel);
|
|
METALLIC = metallic_tex * metallic;
|
|
float roughness_tex = dot(texture(texture_roughness,base_uv),roughness_texture_channel);
|
|
ROUGHNESS = roughness_tex * roughness;
|
|
SPECULAR = specular;
|
|
}
|
|
"
|
|
|
|
[sub_resource type="ShaderMaterial" id=2]
|
|
|
|
render_priority = 0
|
|
shader = SubResource( 1 )
|
|
shader_param/albedo = Color( 1, 1, 1, 1 )
|
|
shader_param/specular = 0.5
|
|
shader_param/metallic = 0.0
|
|
shader_param/roughness = 0.0
|
|
shader_param/point_size = 1.0
|
|
shader_param/metallic_texture_channel = Plane( 1, 0, 0, 0 )
|
|
shader_param/roughness_texture_channel = Plane( 1, 0, 0, 0 )
|
|
shader_param/uv1_scale = Vector3( 1, 1, 1 )
|
|
shader_param/uv1_offset = Vector3( 0, 0, 0 )
|
|
shader_param/uv2_scale = Vector3( 1, 1, 1 )
|
|
shader_param/uv2_offset = Vector3( 0, 0, 0 )
|
|
|
|
[sub_resource type="SphereShape" id=3]
|
|
|
|
radius = 0.520354
|
|
|
|
[node name="character" type="KinematicBody" index="0"]
|
|
|
|
transform = Transform( 0.371345, 0, 0, 0, 0.218854, 0, 0, 0, 0.371345, -0.00167466, 0.0124722, 6.02408 )
|
|
input_ray_pickable = false
|
|
input_capture_on_drag = false
|
|
collision_layer = 1
|
|
collision_mask = 1
|
|
axis_lock_linear_x = false
|
|
axis_lock_linear_y = false
|
|
axis_lock_linear_z = false
|
|
axis_lock_angular_x = false
|
|
axis_lock_angular_y = false
|
|
axis_lock_angular_z = false
|
|
collision/safe_margin = 0.001
|
|
script = ExtResource( 1 )
|
|
_sections_unfolded = [ "Axis Lock", "Transform", "collision" ]
|
|
|
|
[node name="infos_spatial" type="Spatial" parent="." index="0"]
|
|
|
|
transform = Transform( 1, 0, 0, 0, 1, 0, -9.56715e-015, 0, 1, -4.65661e-010, 2.47932, -0.0688725 )
|
|
script = ExtResource( 2 )
|
|
|
|
[node name="character_infos_billboard" parent="infos_spatial" index="0" instance=ExtResource( 3 )]
|
|
|
|
visible = false
|
|
mouse_filter = 2
|
|
mouse_default_cursor_shape = 2
|
|
_sections_unfolded = [ "Mouse", "Rect", "Size Flags", "Visibility" ]
|
|
|
|
[node name="camera_rotation_helper" type="Spatial" parent="." index="1"]
|
|
|
|
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.0730682, 0 )
|
|
|
|
[node name="camera" type="Camera" parent="camera_rotation_helper" index="0"]
|
|
|
|
transform = Transform( 1, 0, 0, 0, 0.972209, 0.397244, 0, -0.137979, 0.972208, 0, 2.71489, 0.896517 )
|
|
keep_aspect = 1
|
|
cull_mask = 1048575
|
|
environment = null
|
|
h_offset = 0.0
|
|
v_offset = 0.0
|
|
doppler_tracking = 0
|
|
projection = 0
|
|
current = false
|
|
fov = 70.0
|
|
size = 1.0
|
|
near = 0.05
|
|
far = 10000.0
|
|
_sections_unfolded = [ "Transform" ]
|
|
|
|
[node name="face_camera" type="Camera" parent="camera_rotation_helper" index="1"]
|
|
|
|
transform = Transform( -1, 0, -8.74228e-008, 0, 1, 0, 8.74228e-008, 0, -1, 0, 1.91278, -2.96733 )
|
|
keep_aspect = 1
|
|
cull_mask = 1048575
|
|
environment = null
|
|
h_offset = 0.0
|
|
v_offset = 0.0
|
|
doppler_tracking = 0
|
|
projection = 0
|
|
current = false
|
|
fov = 70.0
|
|
size = 2.0
|
|
near = 0.05
|
|
far = 10000.0
|
|
_sections_unfolded = [ "Transform" ]
|
|
|
|
[node name="suzanne" type="Spatial" parent="." index="2" instance=ExtResource( 4 )]
|
|
|
|
transform = Transform( -0.281766, 0, -2.3459e-008, 0, 0.491282, 0, 2.46328e-008, 0, -0.26834, 8975.45, 1800.77, -6275.94 )
|
|
|
|
[node name="flashlight" type="SpotLight" parent="suzanne" index="1"]
|
|
|
|
transform = Transform( -2.54929, -1.60184e-009, 3.70147e-007, 0, 2.42833, 0.0302507, -2.34015e-007, 0.0192396, -4.44583, 31854.2, -3661.36, -23387.1 )
|
|
layers = 1
|
|
light_color = Color( 1, 1, 1, 1 )
|
|
light_energy = 2.0
|
|
light_indirect_energy = 2.0
|
|
light_negative = false
|
|
light_specular = 0.5
|
|
light_bake_mode = 1
|
|
light_cull_mask = -1
|
|
shadow_enabled = true
|
|
shadow_color = Color( 0, 0, 0, 1 )
|
|
shadow_bias = 0.15
|
|
shadow_contact = 0.0
|
|
shadow_reverse_cull_face = true
|
|
editor_only = false
|
|
spot_range = 9.90764
|
|
spot_attenuation = 1.0
|
|
spot_angle = 22.2473
|
|
spot_angle_attenuation = 1.0
|
|
_sections_unfolded = [ "Light", "Shadow" ]
|
|
|
|
[node name="mesh_instance" type="MeshInstance" parent="." index="3"]
|
|
|
|
transform = Transform( -0.281766, 0, -2.3459e-008, 0, 0.491282, 0, 2.46328e-008, 0, -0.26834, 0.00342001, 1.72051, -0.0753574 )
|
|
visible = false
|
|
layers = 1
|
|
material_override = null
|
|
cast_shadow = 1
|
|
extra_cull_margin = 0.0
|
|
use_in_baked_light = false
|
|
lod_min_distance = 0.0
|
|
lod_min_hysteresis = 0.0
|
|
lod_max_distance = 0.0
|
|
lod_max_hysteresis = 0.0
|
|
mesh = ExtResource( 5 )
|
|
skeleton = NodePath("..")
|
|
material/0 = SubResource( 2 )
|
|
_sections_unfolded = [ "Transform", "material" ]
|
|
|
|
[node name="collision_shape" type="CollisionShape" parent="." index="4"]
|
|
|
|
transform = Transform( 0.426611, 0, -2.39179e-015, 0, 0.524356, 0, -2.39179e-015, 0, 0.305713, 0.0063323, 1.96086, -0.0823917 )
|
|
shape = SubResource( 3 )
|
|
disabled = false
|
|
|
|
|