make key material local to scene

This commit is contained in:
Teatov 2025-08-08 15:34:09 +10:00
parent d328836ec5
commit a2e2e0f18c
4 changed files with 143 additions and 150 deletions

BIN
assets/models/key.bin (Stored with Git LFS)

Binary file not shown.

View File

@ -8,12 +8,21 @@
{ {
"name":"Collection", "name":"Collection",
"nodes":[ "nodes":[
5, 0,
6 6
] ]
} }
], ],
"nodes":[ "nodes":[
{
"mesh":0,
"name":"NubMesh",
"translation":[
0,
0.25,
0.42500001192092896
]
},
{ {
"name":"TopLeft", "name":"TopLeft",
"translation":[ "translation":[
@ -47,86 +56,59 @@
] ]
}, },
{ {
"mesh":0, "mesh":1,
"name":"KeyMesh", "name":"KeyMesh",
"skin":0 "skin":0
}, },
{ {
"children":[ "children":[
4, 5,
0,
1, 1,
2, 2,
3 3,
4
], ],
"name":"KeyArmature" "name":"KeyArmature"
},
{
"mesh":1,
"name":"NubMesh",
"translation":[
0,
0.25,
0.42500001192092896
]
}
],
"materials":[
{
"doubleSided":true,
"name":"key_mat",
"pbrMetallicRoughness":{
"baseColorFactor":[
0.800000011920929,
0.800000011920929,
0.800000011920929,
1
],
"metallicFactor":0,
"roughnessFactor":0.5
}
} }
], ],
"meshes":[ "meshes":[
{ {
"name":"KeyMesh", "name":"NubMesh",
"primitives":[ "primitives":[
{ {
"attributes":{ "attributes":{
"POSITION":0, "POSITION":0,
"NORMAL":1, "NORMAL":1,
"TEXCOORD_0":2, "TEXCOORD_0":2
"JOINTS_0":3,
"WEIGHTS_0":4
}, },
"indices":5, "indices":3
"material":0
} }
] ]
}, },
{ {
"name":"NubMesh", "name":"KeyMesh",
"primitives":[ "primitives":[
{ {
"attributes":{ "attributes":{
"POSITION":7, "POSITION":4,
"NORMAL":8, "NORMAL":5,
"TEXCOORD_0":9 "TEXCOORD_0":6,
"JOINTS_0":7,
"WEIGHTS_0":8
}, },
"indices":10, "indices":9
"material":0
} }
] ]
} }
], ],
"skins":[ "skins":[
{ {
"inverseBindMatrices":6, "inverseBindMatrices":10,
"joints":[ "joints":[
0,
1, 1,
2, 2,
3 3,
4
], ],
"name":"KeyArmature" "name":"KeyArmature"
} }
@ -135,58 +117,6 @@
{ {
"bufferView":0, "bufferView":0,
"componentType":5126, "componentType":5126,
"count":115,
"max":[
0.5,
0.2500000596046448,
0.5
],
"min":[
-0.5,
-0.25000008940696716,
-0.5
],
"type":"VEC3"
},
{
"bufferView":1,
"componentType":5126,
"count":115,
"type":"VEC3"
},
{
"bufferView":2,
"componentType":5126,
"count":115,
"type":"VEC2"
},
{
"bufferView":3,
"componentType":5121,
"count":115,
"type":"VEC4"
},
{
"bufferView":4,
"componentType":5126,
"count":115,
"type":"VEC4"
},
{
"bufferView":5,
"componentType":5123,
"count":564,
"type":"SCALAR"
},
{
"bufferView":6,
"componentType":5126,
"count":4,
"type":"MAT4"
},
{
"bufferView":7,
"componentType":5126,
"count":25, "count":25,
"max":[ "max":[
0.15000000596046448, 0.15000000596046448,
@ -201,89 +131,141 @@
"type":"VEC3" "type":"VEC3"
}, },
{ {
"bufferView":8, "bufferView":1,
"componentType":5126, "componentType":5126,
"count":25, "count":25,
"type":"VEC3" "type":"VEC3"
}, },
{ {
"bufferView":9, "bufferView":2,
"componentType":5126, "componentType":5126,
"count":25, "count":25,
"type":"VEC2" "type":"VEC2"
}, },
{ {
"bufferView":10, "bufferView":3,
"componentType":5123, "componentType":5123,
"count":90, "count":90,
"type":"SCALAR" "type":"SCALAR"
},
{
"bufferView":4,
"componentType":5126,
"count":115,
"max":[
0.5,
0.2500000596046448,
0.5
],
"min":[
-0.5,
-0.25000008940696716,
-0.5
],
"type":"VEC3"
},
{
"bufferView":5,
"componentType":5126,
"count":115,
"type":"VEC3"
},
{
"bufferView":6,
"componentType":5126,
"count":115,
"type":"VEC2"
},
{
"bufferView":7,
"componentType":5121,
"count":115,
"type":"VEC4"
},
{
"bufferView":8,
"componentType":5126,
"count":115,
"type":"VEC4"
},
{
"bufferView":9,
"componentType":5123,
"count":564,
"type":"SCALAR"
},
{
"bufferView":10,
"componentType":5126,
"count":4,
"type":"MAT4"
} }
], ],
"bufferViews":[ "bufferViews":[
{ {
"buffer":0, "buffer":0,
"byteLength":1380, "byteLength":300,
"byteOffset":0, "byteOffset":0,
"target":34962 "target":34962
}, },
{
"buffer":0,
"byteLength":1380,
"byteOffset":1380,
"target":34962
},
{
"buffer":0,
"byteLength":920,
"byteOffset":2760,
"target":34962
},
{
"buffer":0,
"byteLength":460,
"byteOffset":3680,
"target":34962
},
{
"buffer":0,
"byteLength":1840,
"byteOffset":4140,
"target":34962
},
{
"buffer":0,
"byteLength":1128,
"byteOffset":5980,
"target":34963
},
{
"buffer":0,
"byteLength":256,
"byteOffset":7108
},
{ {
"buffer":0, "buffer":0,
"byteLength":300, "byteLength":300,
"byteOffset":7364, "byteOffset":300,
"target":34962
},
{
"buffer":0,
"byteLength":300,
"byteOffset":7664,
"target":34962 "target":34962
}, },
{ {
"buffer":0, "buffer":0,
"byteLength":200, "byteLength":200,
"byteOffset":7964, "byteOffset":600,
"target":34962 "target":34962
}, },
{ {
"buffer":0, "buffer":0,
"byteLength":180, "byteLength":180,
"byteOffset":8164, "byteOffset":800,
"target":34963 "target":34963
},
{
"buffer":0,
"byteLength":1380,
"byteOffset":980,
"target":34962
},
{
"buffer":0,
"byteLength":1380,
"byteOffset":2360,
"target":34962
},
{
"buffer":0,
"byteLength":920,
"byteOffset":3740,
"target":34962
},
{
"buffer":0,
"byteLength":460,
"byteOffset":4660,
"target":34962
},
{
"buffer":0,
"byteLength":1840,
"byteOffset":5120,
"target":34962
},
{
"buffer":0,
"byteLength":1128,
"byteOffset":6960,
"target":34963
},
{
"buffer":0,
"byteLength":256,
"byteOffset":8088
} }
], ],
"buffers":[ "buffers":[

View File

@ -1,5 +1,6 @@
[gd_resource type="StandardMaterial3D" format=3 uid="uid://dkydluksv2ry0"] [gd_resource type="StandardMaterial3D" format=3 uid="uid://dkydluksv2ry0"]
[resource] [resource]
resource_local_to_scene = true
albedo_color = Color(0.125911, 0.125911, 0.125911, 1) albedo_color = Color(0.125911, 0.125911, 0.125911, 1)
roughness = 0.6 roughness = 0.6

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=20 format=3 uid="uid://bryima34hc3yp"] [gd_scene load_steps=21 format=3 uid="uid://bryima34hc3yp"]
[ext_resource type="Script" uid="uid://cl0asbgqd3anu" path="res://scripts/game_key.gd" id="1_sypr4"] [ext_resource type="Script" uid="uid://cl0asbgqd3anu" path="res://scripts/game_key.gd" id="1_sypr4"]
[ext_resource type="AudioStream" uid="uid://bq0ikue882kg6" path="res://assets/sfx/keyboard/typing/press_01.wav" id="2_cqjrw"] [ext_resource type="AudioStream" uid="uid://bq0ikue882kg6" path="res://assets/sfx/keyboard/typing/press_01.wav" id="2_cqjrw"]
@ -16,6 +16,7 @@
[ext_resource type="AudioStream" uid="uid://41d8y11au44e" path="res://assets/sfx/keyboard/typing/release_06.wav" id="14_kt0yx"] [ext_resource type="AudioStream" uid="uid://41d8y11au44e" path="res://assets/sfx/keyboard/typing/release_06.wav" id="14_kt0yx"]
[ext_resource type="AudioStream" uid="uid://8rgf5ic4w1r3" path="res://assets/sfx/keyboard/typing/release_07.wav" id="15_w7o33"] [ext_resource type="AudioStream" uid="uid://8rgf5ic4w1r3" path="res://assets/sfx/keyboard/typing/release_07.wav" id="15_w7o33"]
[ext_resource type="PackedScene" uid="uid://d4ffyk6iou3ns" path="res://assets/models/key.gltf" id="16_cqjrw"] [ext_resource type="PackedScene" uid="uid://d4ffyk6iou3ns" path="res://assets/models/key.gltf" id="16_cqjrw"]
[ext_resource type="Material" uid="uid://dkydluksv2ry0" path="res://resources/materials/key_mat.tres" id="17_p6qfn"]
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_agrko"] [sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_agrko"]
random_pitch = 1.1 random_pitch = 1.1
@ -60,13 +61,23 @@ _release_sfx = SubResource("AudioStreamRandomizer_ch32x")
[node name="Model" parent="." instance=ExtResource("16_cqjrw")] [node name="Model" parent="." instance=ExtResource("16_cqjrw")]
[node name="NubMesh" parent="Model" index="0"]
surface_material_override/0 = ExtResource("17_p6qfn")
[node name="KeyMesh" parent="Model/KeyArmature/Skeleton3D" index="0"]
surface_material_override/0 = ExtResource("17_p6qfn")
[node name="ModelSecondary" parent="." instance=ExtResource("16_cqjrw")] [node name="ModelSecondary" parent="." instance=ExtResource("16_cqjrw")]
[node name="NubMesh" parent="ModelSecondary" index="0"]
visible = false
surface_material_override/0 = ExtResource("17_p6qfn")
[node name="Skeleton3D" parent="ModelSecondary/KeyArmature" index="0"] [node name="Skeleton3D" parent="ModelSecondary/KeyArmature" index="0"]
visible = false visible = false
[node name="NubMesh" parent="ModelSecondary" index="1"] [node name="KeyMesh" parent="ModelSecondary/KeyArmature/Skeleton3D" index="0"]
visible = false surface_material_override/0 = ExtResource("17_p6qfn")
[node name="Labels" type="Node3D" parent="."] [node name="Labels" type="Node3D" parent="."]
@ -161,7 +172,6 @@ outline_size = 0
[node name="Effects" type="Node3D" parent="."] [node name="Effects" type="Node3D" parent="."]
[node name="PressLight" type="OmniLight3D" parent="Effects"] [node name="PressLight" type="OmniLight3D" parent="Effects"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.6, 0)
visible = false visible = false
light_color = Color(1, 0.687333, 0.33, 1) light_color = Color(1, 0.687333, 0.33, 1)
light_energy = 6.0 light_energy = 6.0