diff --git a/CMakeLists.txt b/CMakeLists.txt index d6a0a17..880528e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,18 @@ find_package (glm REQUIRED) find_package (Vulkan 1.4.335 REQUIRED) # Require Vulkan SDK version 1.4.335 or higher find_package (tinyobjloader REQUIRED) find_package (tinygltf REQUIRED) -find_package (KTX REQUIRED) +find_package (nlohmann_json REQUIRED) +find_library(KTX_LIBRARY NAMES ktx REQUIRED) +find_path(KTX_INCLUDE_DIR NAMES ktx.h REQUIRED) + +message(STATUS "KTX library found at: ${KTX_LIBRARY}") +message(STATUS "KTX include dir: ${KTX_INCLUDE_DIR}") + +add_library(KTX::ktx SHARED IMPORTED GLOBAL) +set_target_properties(KTX::ktx PROPERTIES + IMPORTED_LOCATION "${KTX_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${KTX_INCLUDE_DIR}" +) # set up Vulkan C++ module only if enabled if(ENABLE_CPP20_MODULE) @@ -177,20 +188,38 @@ function (add_chapter CHAPTER_NAME) target_link_libraries (${CHAPTER_NAME} ${CHAPTER_LIBS}) endif () if (DEFINED CHAPTER_MODELS) - list(TRANSFORM CHAPTER_MODELS PREPEND "${CMAKE_SOURCE_DIR}/models/") - file (COPY ${CHAPTER_MODELS} DESTINATION ${CMAKE_BINARY_DIR}/${CHAPTER_NAME}/models) + set(RESOLVED_MODELS "") + foreach(MODEL_PATTERN ${CHAPTER_MODELS}) + file(GLOB MATCHED_MODELS CONFIGURE_DEPENDS + "${CMAKE_SOURCE_DIR}/models/${MODEL_PATTERN}" + ) + list(APPEND RESOLVED_MODELS ${MATCHED_MODELS}) + endforeach() + + if (RESOLVED_MODELS) + file(COPY ${RESOLVED_MODELS} DESTINATION ${CMAKE_BINARY_DIR}/${CHAPTER_NAME}/models) + endif() endif () if (DEFINED CHAPTER_TEXTURES) - list(TRANSFORM CHAPTER_TEXTURES PREPEND "${CMAKE_SOURCE_DIR}/textures/") - file (COPY ${CHAPTER_TEXTURES} DESTINATION ${CMAKE_BINARY_DIR}/${CHAPTER_NAME}/textures) + set(RESOLVED_TEXTURES "") + foreach(TEX_PATTERN ${CHAPTER_TEXTURES}) + file(GLOB MATCHED_TEXTURES CONFIGURE_DEPENDS + "${CMAKE_SOURCE_DIR}/textures/${TEX_PATTERN}" + ) + list(APPEND RESOLVED_TEXTURES ${MATCHED_TEXTURES}) + endforeach() + + if (RESOLVED_TEXTURES) + file(COPY ${RESOLVED_TEXTURES} DESTINATION ${CMAKE_BINARY_DIR}/${CHAPTER_NAME}/textures) + endif() endif () endfunction () add_chapter (main SHADER shaders/main - TEXTURES texture.jpg - TEXTURES viking_room.png - MODELS viking_room.obj + TEXTURES * + MODELS * + LIBS nlohmann_json::nlohmann_json KTX::ktx ) #add_chapter (38_ray_tracing diff --git a/models/scene.bin b/models/scene.bin new file mode 100644 index 0000000..24c65ff Binary files /dev/null and b/models/scene.bin differ diff --git a/models/scene.gltf b/models/scene.gltf new file mode 100644 index 0000000..d78465c --- /dev/null +++ b/models/scene.gltf @@ -0,0 +1,4479 @@ +{ + "accessors": [ + { + "bufferView": 3, + "componentType": 5126, + "count": 8684, + "max": [ + 20.908796310424805, + 158.35089111328125, + 11.927002906799316 + ], + "min": [ + -20.90898895263672, + 112.4200439453125, + -21.847505569458008 + ], + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 104208, + "componentType": 5126, + "count": 8684, + "max": [ + 0.9993290305137634, + 0.9997117519378662, + 0.999987006187439 + ], + "min": [ + -0.999330997467041, + -0.999602735042572, + -0.9998565912246704 + ], + "type": "VEC3" + }, + { + "bufferView": 4, + "componentType": 5126, + "count": 8684, + "max": [ + 0.9993730783462524, + 0.9999678134918213, + 0.9999942779541016, + 1.0 + ], + "min": [ + -0.9997699856758118, + -0.9999919533729553, + -0.9999650716781616, + -1.0 + ], + "type": "VEC4" + }, + { + "bufferView": 2, + "componentType": 5126, + "count": 8684, + "max": [ + 0.9990230202674866, + 0.9958419799804688 + ], + "min": [ + 0.0009769999887794256, + 0.0009769999887794256 + ], + "type": "VEC2" + }, + { + "bufferView": 1, + "componentType": 5125, + "count": 39246, + "type": "SCALAR" + }, + { + "bufferView": 3, + "byteOffset": 208416, + "componentType": 5126, + "count": 2913, + "max": [ + 42.12493896484375, + 156.5982666015625, + 10.5322904586792 + ], + "min": [ + -42.12492370605469, + 99.56539154052734, + -21.513925552368164 + ], + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 243372, + "componentType": 5126, + "count": 2913, + "max": [ + 0.9999352097511292, + 0.9965310096740723, + 0.9998801946640015 + ], + "min": [ + -0.9999352097511292, + -0.9981768727302551, + -0.9999906420707703 + ], + "type": "VEC3" + }, + { + "bufferView": 4, + "byteOffset": 138944, + "componentType": 5126, + "count": 2913, + "max": [ + 0.9984918236732483, + 0.9997819662094116, + 0.9955288767814636, + 1.0 + ], + "min": [ + -1.0, + -0.9999949932098389, + -0.9992133378982544, + -1.0 + ], + "type": "VEC4" + }, + { + "bufferView": 2, + "byteOffset": 69472, + "componentType": 5126, + "count": 2913, + "max": [ + 0.998894989490509, + 0.9990230202674866 + ], + "min": [ + 0.0009769999887794256, + 0.0009769999887794256 + ], + "type": "VEC2" + }, + { + "bufferView": 1, + "byteOffset": 156984, + "componentType": 5125, + "count": 12762, + "type": "SCALAR" + }, + { + "bufferView": 3, + "byteOffset": 278328, + "componentType": 5126, + "count": 12674, + "max": [ + 76.84597778320313, + 188.9779815673828, + 12.256464004516602 + ], + "min": [ + -76.84595489501953, + 106.09683227539063, + -22.107622146606445 + ], + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 430416, + "componentType": 5126, + "count": 12674, + "max": [ + 1.0, + 0.9999914765357971, + 0.9998185038566589 + ], + "min": [ + -0.9996131658554077, + -0.9988362193107605, + -0.9999958872795105 + ], + "type": "VEC3" + }, + { + "bufferView": 4, + "byteOffset": 185552, + "componentType": 5126, + "count": 12674, + "max": [ + 1.0, + 0.9994061589241028, + 0.9999665021896362, + 1.0 + ], + "min": [ + -1.0, + -0.9998962879180908, + -0.9999914765357971, + -1.0 + ], + "type": "VEC4" + }, + { + "bufferView": 2, + "byteOffset": 92776, + "componentType": 5126, + "count": 12674, + "max": [ + 0.9990230202674866, + 0.997098982334137 + ], + "min": [ + 0.0009769999887794256, + 0.0009769999887794256 + ], + "type": "VEC2" + }, + { + "bufferView": 1, + "byteOffset": 208032, + "componentType": 5125, + "count": 53661, + "type": "SCALAR" + }, + { + "bufferView": 3, + "byteOffset": 582504, + "componentType": 5126, + "count": 4264, + "max": [ + 31.096824645996094, + 105.11083984375, + 12.773022651672363 + ], + "min": [ + -31.096834182739258, + -4.05101203918457, + -23.089712142944336 + ], + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 633672, + "componentType": 5126, + "count": 4264, + "max": [ + 0.9993263483047485, + 0.9988613128662109, + 0.9999997615814209 + ], + "min": [ + -0.9993258714675903, + -0.9999924898147583, + -0.999897301197052 + ], + "type": "VEC3" + }, + { + "bufferView": 4, + "byteOffset": 388336, + "componentType": 5126, + "count": 4264, + "max": [ + 0.9984023571014404, + 0.999937117099762, + 0.9989970326423645, + 1.0 + ], + "min": [ + -0.9994841814041138, + -0.9997346997261047, + -0.9995085000991821, + -1.0 + ], + "type": "VEC4" + }, + { + "bufferView": 2, + "byteOffset": 194168, + "componentType": 5126, + "count": 4264, + "max": [ + 0.9990230202674866, + 0.9483129978179932 + ], + "min": [ + 0.0009769999887794256, + 0.0009769999887794256 + ], + "type": "VEC2" + }, + { + "bufferView": 1, + "byteOffset": 422676, + "componentType": 5125, + "count": 21132, + "type": "SCALAR" + }, + { + "bufferView": 3, + "byteOffset": 684840, + "componentType": 5126, + "count": 16112, + "max": [ + 29.083032608032227, + 123.2801513671875, + 13.535385131835938 + ], + "min": [ + -29.083030700683594, + 62.21318054199219, + -22.733888626098633 + ], + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 878184, + "componentType": 5126, + "count": 16112, + "max": [ + 0.9999341368675232, + 0.9994175434112549, + 0.9999521970748901 + ], + "min": [ + -0.9997644424438477, + -0.9999394416809082, + -0.9998970031738281 + ], + "type": "VEC3" + }, + { + "bufferView": 4, + "byteOffset": 456560, + "componentType": 5126, + "count": 16112, + "max": [ + 0.9999523758888245, + 0.9999873638153076, + 0.9999064803123474, + 1.0 + ], + "min": [ + -0.9999641180038452, + -0.9999402165412903, + -0.9997622966766357, + -1.0 + ], + "type": "VEC4" + }, + { + "bufferView": 2, + "byteOffset": 228280, + "componentType": 5126, + "count": 16112, + "max": [ + 0.9927430152893066, + 0.9990230202674866 + ], + "min": [ + 0.0009769999887794256, + 0.0009769999887794256 + ], + "type": "VEC2" + }, + { + "bufferView": 1, + "byteOffset": 507204, + "componentType": 5125, + "count": 72114, + "type": "SCALAR" + }, + { + "bufferView": 3, + "byteOffset": 1071528, + "componentType": 5126, + "count": 3983, + "max": [ + 46.36795425415039, + 138.3351593017578, + 11.74431037902832 + ], + "min": [ + -46.367950439453125, + 52.23161697387695, + -65.2525405883789 + ], + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 1119324, + "componentType": 5126, + "count": 3983, + "max": [ + 0.9980156421661377, + 0.997845470905304, + 0.9998469352722168 + ], + "min": [ + -0.9972026348114014, + -0.997463047504425, + -0.9999306201934814 + ], + "type": "VEC3" + }, + { + "bufferView": 4, + "byteOffset": 714352, + "componentType": 5126, + "count": 3983, + "max": [ + 0.9999436140060425, + 0.9991414546966553, + 0.9999003410339355, + 1.0 + ], + "min": [ + -0.999870240688324, + -0.9998777508735657, + -0.99708092212677, + 1.0 + ], + "type": "VEC4" + }, + { + "bufferView": 2, + "byteOffset": 357176, + "componentType": 5126, + "count": 3983, + "max": [ + 0.9942409992218018, + 0.9990230202674866 + ], + "min": [ + 0.0009769999887794256, + 0.0009769999887794256 + ], + "type": "VEC2" + }, + { + "bufferView": 1, + "byteOffset": 795660, + "componentType": 5125, + "count": 19362, + "type": "SCALAR" + }, + { + "bufferView": 3, + "byteOffset": 1167120, + "componentType": 5126, + "count": 901, + "max": [ + 0.06275152415037155, + 0.051677849143743515, + 0.8205299377441406 + ], + "min": [ + -0.06275152415037155, + -0.051677849143743515, + -0.2852179706096649 + ], + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 1177932, + "componentType": 5126, + "count": 901, + "max": [ + 0.9998849034309387, + 0.9999817609786987, + 1.0 + ], + "min": [ + -0.9998849034309387, + -0.9998222589492798, + -1.0 + ], + "type": "VEC3" + }, + { + "bufferView": 4, + "byteOffset": 778080, + "componentType": 5126, + "count": 901, + "max": [ + 0.9999960064888, + 0.9980578422546387, + 0.999888002872467, + 1.0 + ], + "min": [ + -0.9999960064888, + -0.9998730421066284, + -0.9998880624771118, + 1.0 + ], + "type": "VEC4" + }, + { + "bufferView": 2, + "byteOffset": 389040, + "componentType": 5126, + "count": 901, + "max": [ + 0.9645252823829651, + 0.994860053062439 + ], + "min": [ + 0.0010195247596129775, + 0.0010006423108279705 + ], + "type": "VEC2" + }, + { + "bufferView": 2, + "byteOffset": 396248, + "componentType": 5126, + "count": 901, + "max": [ + 0.9645252823829651, + 0.994860053062439 + ], + "min": [ + 0.0010195247596129775, + 0.0010006423108279705 + ], + "type": "VEC2" + }, + { + "bufferView": 2, + "byteOffset": 403456, + "componentType": 5126, + "count": 901, + "max": [ + 0.9645252823829651, + 0.994860053062439 + ], + "min": [ + 0.0010195247596129775, + 0.0010006423108279705 + ], + "type": "VEC2" + }, + { + "bufferView": 2, + "byteOffset": 410664, + "componentType": 5126, + "count": 901, + "max": [ + 0.9645252823829651, + 0.994860053062439 + ], + "min": [ + 0.0010195247596129775, + 0.0010006423108279705 + ], + "type": "VEC2" + }, + { + "bufferView": 1, + "byteOffset": 873108, + "componentType": 5125, + "count": 3819, + "type": "SCALAR" + }, + { + "bufferView": 5, + "componentType": 5126, + "count": 147, + "max": [ + 1.0, + 0.8574939370155334, + 0.42456507682800293, + 0.0, + 0.8625972270965576, + 1.0, + 0.9990398287773132, + 0.0, + 0.22260364890098572, + 0.9985651969909668, + 1.0, + 0.0, + 136.7982635498047, + 97.77857208251953, + 33.25129699707031, + 1.0 + ], + "min": [ + -0.9992448687553406, + -0.8574950098991394, + -0.40784603357315063, + 0.0, + -0.8625961542129517, + -0.9959061741828918, + -0.15559202432632446, + 0.0, + -0.2315334677696228, + -0.370297908782959, + -0.995901882648468, + 0.0, + -136.7984161376953, + -162.5354461669922, + -110.01795196533203, + 1.0 + ], + "type": "MAT4" + }, + { + "bufferView": 0, + "componentType": 5123, + "count": 8684, + "type": "VEC4" + }, + { + "bufferView": 4, + "byteOffset": 792496, + "componentType": 5126, + "count": 8684, + "max": [ + 1.0, + 0.49740123748779297, + 0.2619078457355499, + 0.06399428844451904 + ], + "min": [ + 0.40261369943618774, + 0.0, + 0.0, + 0.0 + ], + "type": "VEC4" + }, + { + "bufferView": 0, + "byteOffset": 69472, + "componentType": 5123, + "count": 2913, + "type": "VEC4" + }, + { + "bufferView": 4, + "byteOffset": 931440, + "componentType": 5126, + "count": 2913, + "max": [ + 1.0, + 0.49111369252204895, + 0.27629658579826355, + 0.2153756022453308 + ], + "min": [ + 0.2927088737487793, + 0.0, + 0.0, + 0.0 + ], + "type": "VEC4" + }, + { + "bufferView": 0, + "byteOffset": 92776, + "componentType": 5123, + "count": 12674, + "type": "VEC4" + }, + { + "bufferView": 4, + "byteOffset": 978048, + "componentType": 5126, + "count": 12674, + "max": [ + 1.0, + 0.4996601641178131, + 0.2995956540107727, + 0.150925874710083 + ], + "min": [ + 0.3434202969074249, + 0.0, + 0.0, + 0.0 + ], + "type": "VEC4" + }, + { + "bufferView": 0, + "byteOffset": 194168, + "componentType": 5123, + "count": 4264, + "type": "VEC4" + }, + { + "bufferView": 4, + "byteOffset": 1180832, + "componentType": 5126, + "count": 4264, + "max": [ + 1.0, + 0.4998459815979004, + 0.3053995966911316, + 0.10884393751621246 + ], + "min": [ + 0.3643626570701599, + 0.0, + 0.0, + 0.0 + ], + "type": "VEC4" + }, + { + "bufferView": 0, + "byteOffset": 228280, + "componentType": 5123, + "count": 16112, + "type": "VEC4" + }, + { + "bufferView": 4, + "byteOffset": 1249056, + "componentType": 5126, + "count": 16112, + "max": [ + 1.0, + 0.4997861087322235, + 0.2513345777988434, + 0.09098305553197861 + ], + "min": [ + 0.4001159071922302, + 0.0, + 0.0, + 0.0 + ], + "type": "VEC4" + }, + { + "bufferView": 0, + "byteOffset": 357176, + "componentType": 5123, + "count": 3983, + "type": "VEC4" + }, + { + "bufferView": 4, + "byteOffset": 1506848, + "componentType": 5126, + "count": 3983, + "max": [ + 1.0, + 0.5, + 0.06764546781778336, + 0.02412438578903675 + ], + "min": [ + 0.5, + 0.0, + 0.0, + 0.0 + ], + "type": "VEC4" + } + ], + "asset": { + "extras": { + "author": "dark_igorek (https://sketchfab.com/dark_igorek)", + "license": "CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/)", + "source": "https://sketchfab.com/3d-models/shadowflame-samurai-03def921ed814b3a9de5c5962b86a45c", + "title": "Shadowflame Samurai" + }, + "generator": "Sketchfab-17.8.0", + "version": "2.0" + }, + "bufferViews": [ + { + "buffer": 0, + "byteLength": 389040, + "byteStride": 8, + "name": "shortBufferViews", + "target": 34962 + }, + { + "buffer": 0, + "byteLength": 888384, + "byteOffset": 389040, + "name": "floatBufferViews", + "target": 34963 + }, + { + "buffer": 0, + "byteLength": 417872, + "byteOffset": 1277424, + "byteStride": 8, + "name": "floatBufferViews", + "target": 34962 + }, + { + "buffer": 0, + "byteLength": 1188744, + "byteOffset": 1695296, + "byteStride": 12, + "name": "floatBufferViews", + "target": 34962 + }, + { + "buffer": 0, + "byteLength": 1570576, + "byteOffset": 2884040, + "byteStride": 16, + "name": "floatBufferViews", + "target": 34962 + }, + { + "buffer": 0, + "byteLength": 9408, + "byteOffset": 4454616, + "name": "floatBufferViews" + } + ], + "buffers": [ + { + "byteLength": 4464024, + "uri": "scene.bin" + } + ], + "extensionsUsed": [ + "KHR_materials_emissive_strength" + ], + "images": [ + { + "uri": "textures/armor_mat_baseColor.jpeg" + }, + { + "uri": "textures/armor_mat_metallicRoughness.png" + }, + { + "uri": "textures/armor_mat_normal.png" + }, + { + "uri": "textures/body_mat_baseColor.jpeg" + }, + { + "uri": "textures/body_mat_metallicRoughness.png" + }, + { + "uri": "textures/body_mat_normal.png" + }, + { + "uri": "textures/top_mat_baseColor.jpeg" + }, + { + "uri": "textures/top_mat_metallicRoughness.png" + }, + { + "uri": "textures/top_mat_emissive.jpeg" + }, + { + "uri": "textures/top_mat_normal.png" + }, + { + "uri": "textures/legs_mat_baseColor.jpeg" + }, + { + "uri": "textures/legs_mat_metallicRoughness.png" + }, + { + "uri": "textures/legs_mat_normal.png" + }, + { + "uri": "textures/details_mat_baseColor.jpeg" + }, + { + "uri": "textures/details_mat_metallicRoughness.png" + }, + { + "uri": "textures/details_mat_normal.png" + }, + { + "uri": "textures/weapon_mat_baseColor.png" + }, + { + "uri": "textures/weapon_mat_metallicRoughness.png" + }, + { + "uri": "textures/weapon_mat_emissive.jpeg" + }, + { + "uri": "textures/weapon_mat_normal.png" + } + ], + "materials": [ + { + "doubleSided": true, + "name": "armor_mat", + "normalTexture": { + "index": 2 + }, + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 0 + }, + "metallicRoughnessTexture": { + "index": 1 + } + } + }, + { + "doubleSided": true, + "name": "body_mat", + "normalTexture": { + "index": 5 + }, + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 3 + }, + "metallicRoughnessTexture": { + "index": 4 + } + } + }, + { + "doubleSided": true, + "emissiveFactor": [ + 1.0, + 1.0, + 1.0 + ], + "emissiveTexture": { + "index": 8 + }, + "extensions": { + "KHR_materials_emissive_strength": { + "emissiveStrength": 4.617156928478257 + } + }, + "name": "top_mat", + "normalTexture": { + "index": 9 + }, + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 6 + }, + "metallicRoughnessTexture": { + "index": 7 + } + } + }, + { + "doubleSided": true, + "name": "legs_mat", + "normalTexture": { + "index": 12 + }, + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 10 + }, + "metallicRoughnessTexture": { + "index": 11 + } + } + }, + { + "doubleSided": true, + "name": "details_mat", + "normalTexture": { + "index": 15 + }, + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 13 + }, + "metallicRoughnessTexture": { + "index": 14 + } + } + }, + { + "alphaMode": "BLEND", + "doubleSided": true, + "emissiveFactor": [ + 1.0, + 1.0, + 1.0 + ], + "emissiveTexture": { + "index": 18 + }, + "extensions": { + "KHR_materials_emissive_strength": { + "emissiveStrength": 1.7523862929867975 + } + }, + "name": "weapon_mat", + "normalTexture": { + "index": 19 + }, + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 16 + }, + "metallicRoughnessTexture": { + "index": 17 + } + } + } + ], + "meshes": [ + { + "name": "Samurai_armor_mat_0", + "primitives": [ + { + "attributes": { + "JOINTS_0": 39, + "NORMAL": 1, + "POSITION": 0, + "TANGENT": 2, + "TEXCOORD_0": 3, + "TEXCOORD_1": 3, + "TEXCOORD_2": 3, + "WEIGHTS_0": 40 + }, + "indices": 4, + "material": 0, + "mode": 4 + } + ] + }, + { + "name": "Samurai_body_mat_0", + "primitives": [ + { + "attributes": { + "JOINTS_0": 41, + "NORMAL": 6, + "POSITION": 5, + "TANGENT": 7, + "TEXCOORD_0": 8, + "TEXCOORD_1": 8, + "TEXCOORD_2": 8, + "WEIGHTS_0": 42 + }, + "indices": 9, + "material": 1, + "mode": 4 + } + ] + }, + { + "name": "Samurai_top_mat_0", + "primitives": [ + { + "attributes": { + "JOINTS_0": 43, + "NORMAL": 11, + "POSITION": 10, + "TANGENT": 12, + "TEXCOORD_0": 13, + "TEXCOORD_1": 13, + "TEXCOORD_2": 13, + "TEXCOORD_3": 13, + "WEIGHTS_0": 44 + }, + "indices": 14, + "material": 2, + "mode": 4 + } + ] + }, + { + "name": "Samurai_legs_mat_0", + "primitives": [ + { + "attributes": { + "JOINTS_0": 45, + "NORMAL": 16, + "POSITION": 15, + "TANGENT": 17, + "TEXCOORD_0": 18, + "TEXCOORD_1": 18, + "TEXCOORD_2": 18, + "WEIGHTS_0": 46 + }, + "indices": 19, + "material": 3, + "mode": 4 + } + ] + }, + { + "name": "Samurai_details_mat_0", + "primitives": [ + { + "attributes": { + "JOINTS_0": 47, + "NORMAL": 21, + "POSITION": 20, + "TANGENT": 22, + "TEXCOORD_0": 23, + "TEXCOORD_1": 23, + "TEXCOORD_2": 23, + "WEIGHTS_0": 48 + }, + "indices": 24, + "material": 4, + "mode": 4 + } + ] + }, + { + "name": "Samurai_weapon_mat_0", + "primitives": [ + { + "attributes": { + "JOINTS_0": 49, + "NORMAL": 26, + "POSITION": 25, + "TANGENT": 27, + "TEXCOORD_0": 28, + "TEXCOORD_1": 28, + "TEXCOORD_2": 28, + "TEXCOORD_3": 28, + "WEIGHTS_0": 50 + }, + "indices": 29, + "material": 5, + "mode": 4 + } + ] + }, + { + "name": "katana_weapon_mat_0", + "primitives": [ + { + "attributes": { + "NORMAL": 31, + "POSITION": 30, + "TANGENT": 32, + "TEXCOORD_0": 33, + "TEXCOORD_1": 34, + "TEXCOORD_2": 35, + "TEXCOORD_3": 36 + }, + "indices": 37, + "material": 5, + "mode": 4 + } + ] + } + ], + "nodes": [ + { + "children": [ + 1 + ], + "matrix": [ + 1.0, + 0.0, + 0.0, + 0.0, + 0.0, + 2.220446049250313e-16, + -1.0, + 0.0, + 0.0, + 1.0, + 2.220446049250313e-16, + 0.0, + 0.0, + 0.0, + 0.0, + 1.0 + ], + "name": "Sketchfab_model" + }, + { + "children": [ + 2 + ], + "matrix": [ + 0.009999999776482582, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.009999999776482582, + 0.0, + 0.0, + -0.009999999776482582, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 1.0 + ], + "name": "d5f025c742e14ce58bc1eca6be952323.fbx" + }, + { + "children": [ + 3, + 159 + ], + "name": "RootNode" + }, + { + "children": [ + 4 + ], + "matrix": [ + 1.0, + 0.0, + 0.0, + 0.0, + 0.0, + -1.6292067939183141e-07, + -0.9999999999999868, + 0.0, + 0.0, + 0.9999999999999868, + -1.6292067939183141e-07, + 0.0, + 0.0, + -4.050979137420654, + 0.0, + 1.0 + ], + "name": "Armature" + }, + { + "children": [ + 5, + 153, + 154, + 155, + 156, + 157, + 158, + 152 + ], + "name": "Object_4" + }, + { + "children": [ + 6 + ], + "name": "_rootJoint" + }, + { + "children": [ + 7 + ], + "name": "RL_BoneRoot_02", + "rotation": [ + -1.3234889800848443e-23, + -0.0, + 0.0, + 1.0 + ] + }, + { + "children": [ + 8, + 61 + ], + "name": "CC_Base_Hip_03", + "rotation": [ + 0.6415525078773499, + -1.931467295435141e-06, + -3.5878890685125953e-06, + 0.7670791149139404 + ], + "translation": [ + -2.4585689387124354e-11, + 4.57763671875e-05, + 109.68134307861328 + ] + }, + { + "children": [ + 9, + 33, + 57, + 59 + ], + "name": "CC_Base_Pelvis_04", + "rotation": [ + 0.13126008212566376, + -5.542770864508384e-08, + 4.6273140696939663e-07, + 0.9913479685783386 + ], + "translation": [ + 2.1027395102901636e-11, + 2.4608212356724835e-08, + 3.171662683598697e-06 + ] + }, + { + "children": [ + 10, + 30 + ], + "name": "CC_Base_L_Thigh_05", + "rotation": [ + 0.015512226149439812, + 0.18029730021953583, + 0.9696013331413269, + -0.16469836235046387 + ], + "scale": [ + 0.9999963045120239, + 0.9999995231628418, + 0.9999958276748657 + ], + "translation": [ + 7.359305381774902, + -7.639970779418945, + -2.3917548656463623 + ] + }, + { + "children": [ + 11, + 25, + 28 + ], + "name": "CC_Base_L_Calf_06", + "rotation": [ + -0.25147876143455505, + -0.00911958422511816, + -0.015682322904467583, + 0.9676927924156189 + ], + "scale": [ + 0.9999998807907104, + 0.9999998211860657, + 0.9999998211860657 + ], + "translation": [ + 0.16840237379074097, + 48.29213333129883, + -0.29872089624404907 + ] + }, + { + "children": [ + 12, + 14 + ], + "name": "CC_Base_L_Foot_07", + "rotation": [ + 0.6322475671768188, + -0.19612522423267365, + -0.057120081037282944, + 0.747352123260498 + ], + "scale": [ + 1.0000001192092896, + 1.0, + 0.9999999403953552 + ], + "translation": [ + 0.047054409980773926, + 48.957855224609375, + -0.6529521346092224 + ] + }, + { + "children": [ + 13 + ], + "name": "CC_Base_L_ToeBaseShareBone_08", + "rotation": [ + 0.17638175189495087, + 0.025486674159765244, + -0.019678371027112007, + 0.9837950468063354 + ], + "scale": [ + 0.9999998807907104, + 1.0, + 1.000000238418579 + ], + "translation": [ + -2.0762905478477478e-05, + 15.241240501403809, + -0.007178783416748047 + ] + }, + { + "name": "CC_Base_L_ToeBaseShareBone_end_0105", + "rotation": [ + -1.734723475976807e-18, + -6.7220534694101275e-18, + -5.551115123125783e-17, + 1.0 + ], + "translation": [ + 1.4210854715202004e-14, + 15.24118423461914, + -2.220446049250313e-16 + ] + }, + { + "children": [ + 15, + 17, + 19, + 21, + 23 + ], + "name": "CC_Base_L_ToeBase_09", + "rotation": [ + 0.17639191448688507, + 0.025297492742538452, + -0.019679563120007515, + 0.983798086643219 + ], + "scale": [ + 1.0, + 1.0000001192092896, + 1.0000001192092896 + ], + "translation": [ + -0.0005839914083480835, + 15.241226196289063, + -0.007010459899902344 + ] + }, + { + "children": [ + 16 + ], + "name": "CC_Base_L_PinkyToe1_010", + "rotation": [ + -0.2411620169878006, + 0.1155453622341156, + -0.04507525637745857, + 0.9625270962715149 + ], + "scale": [ + 1.0000001192092896, + 0.9999999403953552, + 0.9999999403953552 + ], + "translation": [ + -2.840470790863037, + 0.32737553119659424, + -0.5229070782661438 + ] + }, + { + "name": "CC_Base_L_PinkyToe1_end_00", + "rotation": [ + 2.7755575615628914e-17, + 2.7755575615628914e-17, + 2.7755575615628914e-17, + 1.0 + ], + "translation": [ + 0.0, + 2.881824493408203, + 0.0 + ] + }, + { + "children": [ + 18 + ], + "name": "CC_Base_L_RingToe1_011", + "rotation": [ + -0.2831089496612549, + 0.13298727571964264, + -0.019029071554541588, + 0.9496323466300964 + ], + "scale": [ + 1.000000238418579, + 1.0, + 0.9999999403953552 + ], + "translation": [ + -1.4511126279830933, + 1.3307816982269287, + -0.10909153521060944 + ] + }, + { + "name": "CC_Base_L_RingToe1_end_01", + "rotation": [ + -2.7755575615628914e-17, + 2.0816681711721685e-17, + -1.3877787807814457e-17, + 1.0 + ], + "translation": [ + 0.0, + 2.881823778152466, + -1.7763568394002505e-15 + ] + }, + { + "children": [ + 20 + ], + "name": "CC_Base_L_MidToe1_012", + "rotation": [ + -0.2173706591129303, + 0.12048958986997604, + -0.010579291731119156, + 0.9685662388801575 + ], + "scale": [ + 0.9999996423721313, + 0.9999998211860657, + 0.9999998211860657 + ], + "translation": [ + -2.5272369384765625e-05, + 2.276813268661499, + 4.087388515472412e-05 + ] + }, + { + "name": "CC_Base_L_MidToe1_end_0106", + "rotation": [ + -2.7755575615628914e-17, + -6.938893903907228e-18, + -2.7755575615628914e-17, + 1.0 + ], + "translation": [ + 0.0, + 2.881824016571045, + -1.3322676295501878e-15 + ] + }, + { + "children": [ + 22 + ], + "name": "CC_Base_L_IndexToe1_013", + "rotation": [ + -0.23008567094802856, + 0.1273707002401352, + 0.0021129162050783634, + 0.9647969007492065 + ], + "scale": [ + 0.9999998807907104, + 1.0, + 1.0 + ], + "translation": [ + 1.6346876621246338, + 2.384906053543091, + 0.29787346720695496 + ] + }, + { + "name": "CC_Base_L_IndexToe1_end_0107", + "rotation": [ + -1.5407439555097887e-33, + -2.7755575615628914e-17, + -5.551115123125783e-17, + 1.0 + ], + "translation": [ + -7.105427357601002e-15, + 2.8818247318267822, + -8.881784197001252e-16 + ] + }, + { + "children": [ + 24 + ], + "name": "CC_Base_L_BigToe1_014", + "rotation": [ + -0.06777341663837433, + 0.08044818043708801, + -0.010009046643972397, + 0.9944016933441162 + ], + "scale": [ + 1.0000001192092896, + 1.000000238418579, + 0.9999998807907104 + ], + "translation": [ + 3.7874157428741455, + 2.1335713863372803, + 0.018243707716464996 + ] + }, + { + "name": "CC_Base_L_BigToe1_end_0108", + "rotation": [ + 0.0, + 2.42861286636753e-17, + 0.0, + 1.0 + ], + "translation": [ + 0.0, + 2.8818254470825195, + 4.440892098500626e-16 + ] + }, + { + "children": [ + 26 + ], + "name": "CC_Base_L_CalfTwist01_015", + "rotation": [ + 1.2535602991192718e-06, + -8.028000024751236e-07, + -2.0628797869903792e-07, + 1.0 + ], + "scale": [ + 1.0, + 0.9999998211860657, + 1.0000001192092896 + ], + "translation": [ + -9.238719940185547e-06, + -5.0067901611328125e-06, + -1.6093254089355469e-06 + ] + }, + { + "children": [ + 27 + ], + "name": "CC_Base_L_CalfTwist02_016", + "rotation": [ + -3.6982817164243897e-06, + 0.0005130227655172348, + 4.5634806156158447e-07, + 0.9999998807907104 + ], + "scale": [ + 1.000000238418579, + 1.0000001192092896, + 1.000000238418579 + ], + "translation": [ + -0.0006149113178253174, + 24.21915626525879, + -0.003560304641723633 + ] + }, + { + "name": "CC_Base_L_CalfTwist02_end_0109", + "rotation": [ + 2.1666711874356403e-34, + -2.0816681711721685e-17, + 1.0408340855860843e-17, + 1.0 + ], + "translation": [ + 1.4210854715202004e-14, + 24.219144821166992, + 0.0 + ] + }, + { + "children": [ + 29 + ], + "name": "CC_Base_L_KneeShareBone_017", + "rotation": [ + 0.037430208176374435, + -0.004186198581010103, + 0.0025697394739836454, + 0.9992871880531311 + ], + "scale": [ + 0.9999999403953552, + 1.0000001192092896, + 0.9999998807907104 + ], + "translation": [ + -9.238719940185547e-06, + -5.0067901611328125e-06, + -1.6093254089355469e-06 + ] + }, + { + "name": "CC_Base_L_KneeShareBone_end_0110", + "rotation": [ + -8.425943506694157e-34, + 1.3877787807814457e-17, + 6.071532165918825e-17, + 1.0 + ], + "translation": [ + 0.0, + 16.14611053466797, + 0.0 + ] + }, + { + "children": [ + 31 + ], + "name": "CC_Base_L_ThighTwist01_018", + "rotation": [ + -8.559554771636613e-06, + 8.041970431804657e-07, + -6.333412602543831e-05, + 1.0 + ], + "scale": [ + 1.0000001192092896, + 0.9999997615814209, + 0.9999999403953552 + ], + "translation": [ + -1.4007091522216797e-06, + -1.0788440704345703e-05, + -8.493661880493164e-07 + ] + }, + { + "children": [ + 32 + ], + "name": "CC_Base_L_ThighTwist02_019", + "rotation": [ + -6.414251402020454e-06, + -4.214700311422348e-06, + 5.467422670335509e-05, + 1.0 + ], + "scale": [ + 0.9999999403953552, + 1.0, + 1.0 + ], + "translation": [ + -0.0021280795335769653, + 23.53455924987793, + -0.0002581477165222168 + ] + }, + { + "name": "CC_Base_L_ThighTwist02_end_0111", + "rotation": [ + -2.7755575615628914e-17, + 6.938893903907228e-18, + -2.42861286636753e-17, + 1.0 + ], + "translation": [ + -7.105427357601002e-15, + 23.53455352783203, + 0.0 + ] + }, + { + "children": [ + 34, + 37 + ], + "name": "CC_Base_R_Thigh_020", + "rotation": [ + -0.058750882744789124, + 0.06784062087535858, + 0.9820292592048645, + 0.1660258024930954 + ], + "scale": [ + 1.0000020265579224, + 1.0000004768371582, + 1.000002145767212 + ], + "translation": [ + -7.359345436096191, + -7.639978408813477, + -2.391634941101074 + ] + }, + { + "children": [ + 35 + ], + "name": "CC_Base_R_ThighTwist01_021", + "rotation": [ + -1.5209896446322091e-05, + -2.1415767150756437e-06, + 8.413277100771666e-06, + 1.0 + ], + "scale": [ + 0.9999998807907104, + 1.0, + 0.9999998211860657 + ], + "translation": [ + -2.4139881134033203e-06, + 1.4580786228179932e-05, + -3.159046173095703e-06 + ] + }, + { + "children": [ + 36 + ], + "name": "CC_Base_R_ThighTwist02_022", + "rotation": [ + -2.2817405920250167e-07, + 5.2568502724170685e-06, + -3.1921081244945526e-07, + 1.0 + ], + "scale": [ + 1.0000001192092896, + 0.9999999403953552, + 0.9999999403953552 + ], + "translation": [ + -0.00047728419303894043, + 23.53132438659668, + 5.459785461425781e-05 + ] + }, + { + "name": "CC_Base_R_ThighTwist02_end_0112", + "rotation": [ + 1.0408340855860843e-17, + 6.319457630020618e-35, + 6.071532165918825e-18, + 1.0 + ], + "translation": [ + -7.105427357601002e-15, + 23.53132438659668, + 0.0 + ] + }, + { + "children": [ + 38, + 52, + 54 + ], + "name": "CC_Base_R_Calf_023", + "rotation": [ + -0.15197497606277466, + -0.029671624302864075, + 0.029819486662745476, + 0.9874887466430664 + ], + "scale": [ + 0.9999997615814209, + 0.9999997615814209, + 0.9999998211860657 + ], + "translation": [ + -0.0017350614070892334, + 47.066062927246094, + -0.001664280891418457 + ] + }, + { + "children": [ + 39, + 50 + ], + "name": "CC_Base_R_Foot_024", + "rotation": [ + 0.6534899473190308, + 0.16710154712200165, + 0.048930563032627106, + 0.7366368770599365 + ], + "scale": [ + 1.000000238418579, + 0.9999998211860657, + 0.9999999403953552 + ], + "translation": [ + 0.0011145472526550293, + 48.43826675415039, + -0.0075876712799072266 + ] + }, + { + "children": [ + 40, + 42, + 44, + 46, + 48 + ], + "name": "CC_Base_R_ToeBase_025", + "rotation": [ + 0.1765982061624527, + -0.02530023828148842, + 0.01969918981194496, + 0.9837607145309448 + ], + "scale": [ + 1.0, + 1.000000238418579, + 1.0000001192092896 + ], + "translation": [ + 4.330277442932129e-05, + 15.24113941192627, + 1.77919864654541e-05 + ] + }, + { + "children": [ + 41 + ], + "name": "CC_Base_R_PinkyToe1_026", + "rotation": [ + -0.2411668598651886, + -0.11550774425268173, + 0.04507093504071236, + 0.9625305533409119 + ], + "scale": [ + 0.9999999403953552, + 0.9999998211860657, + 0.9999997615814209 + ], + "translation": [ + 2.839521884918213, + 0.32728391885757446, + -0.5228173136711121 + ] + }, + { + "name": "CC_Base_R_PinkyToe1_end_0113", + "rotation": [ + -2.7755575615628914e-17, + 1.0408340855860843e-17, + 2.7755575615628914e-17, + 1.0 + ], + "translation": [ + -7.105427357601002e-15, + 2.8808515071868896, + 0.0 + ] + }, + { + "children": [ + 43 + ], + "name": "CC_Base_R_BigToe1_027", + "rotation": [ + -0.06776296347379684, + -0.08041181415319443, + 0.009996254928410053, + 0.9944054484367371 + ], + "scale": [ + 1.000000238418579, + 1.000000238418579, + 0.9999999403953552 + ], + "translation": [ + -3.786129951477051, + 2.132798194885254, + 0.01822807639837265 + ] + }, + { + "name": "CC_Base_R_BigToe1_end_0114", + "rotation": [ + -1.3877787807814457e-17, + -1.734723475976807e-17, + 2.7755575615628914e-17, + 1.0 + ], + "translation": [ + 0.0, + 2.8808515071868896, + 4.440892098500626e-16 + ] + }, + { + "children": [ + 45 + ], + "name": "CC_Base_R_IndexToe1_028", + "rotation": [ + -0.23008184134960175, + -0.12733200192451477, + -0.0021187609527260065, + 0.9648028016090393 + ], + "scale": [ + 1.0, + 0.9999999403953552, + 1.0 + ], + "translation": [ + -1.6341516971588135, + 2.384035587310791, + 0.29770779609680176 + ] + }, + { + "name": "CC_Base_R_IndexToe1_end_0115", + "rotation": [ + -2.7755575615628914e-17, + 3.469446951953614e-17, + -1.3877787807814457e-17, + 1.0 + ], + "translation": [ + 0.0, + 2.880852222442627, + 8.881784197001252e-16 + ] + }, + { + "children": [ + 47 + ], + "name": "CC_Base_R_MidToe1_029", + "rotation": [ + -0.21759408712387085, + -0.12046834826469421, + 0.010526920668780804, + 0.9685192704200745 + ], + "scale": [ + 0.9999998211860657, + 0.9999996423721313, + 0.9999997615814209 + ], + "translation": [ + 1.3381242752075195e-05, + 2.2759952545166016, + -5.693268030881882e-05 + ] + }, + { + "name": "CC_Base_R_MidToe1_end_0116", + "rotation": [ + -1.7333369499485123e-33, + 4.163336342344337e-17, + 4.163336342344337e-17, + 1.0 + ], + "translation": [ + -7.105427357601002e-15, + 2.8808510303497314, + 4.440892098500626e-16 + ] + }, + { + "children": [ + 49 + ], + "name": "CC_Base_R_RingToe1_030", + "rotation": [ + -0.283096581697464, + -0.1329476535320282, + 0.019028780981898308, + 0.9496415853500366 + ], + "scale": [ + 1.0000001192092896, + 1.0, + 1.0 + ], + "translation": [ + 1.4506206512451172, + 1.3303142786026, + -0.10914911329746246 + ] + }, + { + "name": "CC_Base_R_RingToe1_end_0117", + "rotation": [ + 4.81482486096809e-34, + -1.3877787807814457e-17, + 3.469446951953614e-17, + 1.0 + ], + "translation": [ + 0.0, + 2.8808515071868896, + 1.3322676295501878e-15 + ] + }, + { + "children": [ + 51 + ], + "name": "CC_Base_R_ToeBaseShareBone_031", + "rotation": [ + 0.17659756541252136, + -0.025490254163742065, + 0.019669407978653908, + 0.983756422996521 + ], + "scale": [ + 1.0000001192092896, + 1.0000003576278687, + 0.9999998807907104 + ], + "translation": [ + -0.00014382600784301758, + 15.241150856018066, + 0.0001992732286453247 + ] + }, + { + "name": "CC_Base_R_ToeBaseShareBone_end_0118", + "rotation": [ + 2.168404344971009e-18, + -1.6263032587282567e-18, + 2.7755575615628914e-17, + 1.0 + ], + "translation": [ + 0.0, + 15.241174697875977, + -4.440892098500626e-16 + ] + }, + { + "children": [ + 53 + ], + "name": "CC_Base_R_KneeShareBone_032", + "rotation": [ + 0.03743020072579384, + 0.004227282013744116, + -0.002569293836131692, + 0.9992870092391968 + ], + "scale": [ + 1.0000004768371582, + 0.9999997615814209, + 1.0 + ], + "translation": [ + 1.2293457984924316e-06, + -3.865361213684082e-05, + -2.2649765014648438e-06 + ] + }, + { + "name": "CC_Base_R_KneeShareBone_end_0119", + "rotation": [ + -2.7755575615628914e-17, + 1.3877787807814457e-17, + 2.3418766925686896e-17, + 1.0 + ], + "translation": [ + 0.0, + 16.146121978759766, + 8.881784197001252e-16 + ] + }, + { + "children": [ + 55 + ], + "name": "CC_Base_R_CalfTwist01_033", + "rotation": [ + -6.953626871109009e-05, + -1.0819171620823909e-05, + -1.184665597975254e-05, + 1.0 + ], + "scale": [ + 1.000000238418579, + 0.9999999403953552, + 1.000000238418579 + ], + "translation": [ + 1.2293457984924316e-06, + -3.865361213684082e-05, + -2.2649765014648438e-06 + ] + }, + { + "children": [ + 56 + ], + "name": "CC_Base_R_CalfTwist02_034", + "rotation": [ + 6.696813943563029e-05, + -0.00047141872346401215, + 1.1539083971001673e-05, + 0.9999998807907104 + ], + "scale": [ + 1.0000001192092896, + 1.0000003576278687, + 1.0000001192092896 + ], + "translation": [ + 2.2858381271362305e-05, + 24.21915626525879, + -0.00011444091796875 + ] + }, + { + "name": "CC_Base_R_CalfTwist02_end_0120", + "rotation": [ + 2.7755575615628914e-17, + -3.6111186457260672e-34, + -1.3010426069826053e-17, + 1.0 + ], + "translation": [ + 0.0, + 24.219167709350586, + 0.0 + ] + }, + { + "children": [ + 58 + ], + "name": "CC_Base_Pelvis.001_035", + "rotation": [ + 0.9689785242080688, + 9.171768033411354e-05, + 9.383000724483281e-05, + 0.2471449375152588 + ], + "scale": [ + 0.9999999403953552, + 1.0000007152557373, + 1.0000040531158447 + ], + "translation": [ + 9.157598833553493e-05, + -4.6897478103637695, + 11.318860054016113 + ] + }, + { + "name": "CC_Base_Pelvis.001_end_0121", + "rotation": [ + 0.0, + 0.0, + 1.3552527156068805e-20, + 1.0 + ], + "translation": [ + 0.0, + 16.964933395385742, + 0.0 + ] + }, + { + "children": [ + 60 + ], + "name": "CC_Base_Pelvis.002_036", + "rotation": [ + 0.9987065196037292, + -3.6592944070434896e-06, + 6.232711166376248e-05, + -0.05084605515003204 + ], + "scale": [ + 1.0, + 1.0, + 1.0000264644622803 + ], + "translation": [ + -0.00012253772001713514, + -7.930231094360352, + -15.212656021118164 + ] + }, + { + "name": "CC_Base_Pelvis.002_end_0122", + "rotation": [ + 2.2958874039497803e-41, + 1.3552527156068805e-20, + -1.6940658945086007e-21, + 1.0 + ], + "translation": [ + 0.0, + 22.992578506469727, + 0.0 + ] + }, + { + "children": [ + 62 + ], + "name": "CC_Base_Waist_037", + "rotation": [ + 0.11435434967279434, + -0.002577538602054119, + -0.00022045224613975734, + 0.9934366345405579 + ], + "scale": [ + 1.0, + 0.9999999403953552, + 0.9999999403953552 + ], + "translation": [ + -1.447865452064434e-05, + 9.337752342224121, + 1.8211209774017334 + ] + }, + { + "children": [ + 63 + ], + "name": "CC_Base_Spine01_038", + "rotation": [ + -0.00035239546559751034, + 4.071563353136298e-07, + 2.228692892458639e-06, + 0.9999999403953552 + ], + "scale": [ + 1.0, + 1.0000003576278687, + 1.0000003576278687 + ], + "translation": [ + -2.0824489183723927e-05, + 4.6904988288879395, + -8.946538582677022e-05 + ] + }, + { + "children": [ + 64, + 82, + 114, + 146, + 149 + ], + "name": "CC_Base_Spine02_039", + "rotation": [ + -0.15388788282871246, + -3.77808009943692e-06, + -7.244926081284575e-08, + 0.9880884289741516 + ], + "scale": [ + 0.9999999403953552, + 1.000000238418579, + 1.000000238418579 + ], + "translation": [ + 2.2188760340213776e-07, + 11.726263046264648, + 0.0005576711846515536 + ] + }, + { + "children": [ + 65 + ], + "name": "CC_Base_NeckTwist01_040", + "rotation": [ + 0.2882317006587982, + 0.09446430206298828, + -0.00690800417214632, + 0.9528647661209106 + ], + "scale": [ + 1.0, + 0.9999997615814209, + 0.9999997615814209 + ], + "translation": [ + -4.233792424201965e-06, + 24.61618423461914, + -0.002244330709800124 + ] + }, + { + "children": [ + 66 + ], + "name": "CC_Base_NeckTwist02_041", + "rotation": [ + 9.054550901055336e-06, + -1.4365825336426497e-05, + -4.548346339561249e-07, + 1.0 + ], + "scale": [ + 1.0, + 1.0000001192092896, + 1.0 + ], + "translation": [ + -5.364418029785156e-07, + 4.082286357879639, + -6.561353802680969e-05 + ] + }, + { + "children": [ + 67 + ], + "name": "CC_Base_Head_042", + "rotation": [ + -0.11762042343616486, + 3.70278830814641e-05, + 4.418366756908654e-07, + 0.9930587410926819 + ], + "scale": [ + 1.0, + 1.0000001192092896, + 1.0000001192092896 + ], + "translation": [ + -3.7103891372680664e-06, + 4.08234167098999, + -0.00014006346464157104 + ] + }, + { + "children": [ + 68, + 75, + 77, + 79 + ], + "name": "CC_Base_FacialBone_043", + "rotation": [ + 0.5324305295944214, + 0.46529966592788696, + 0.5324496626853943, + 0.4653078019618988 + ], + "scale": [ + 0.9999999403953552, + 0.9999998211860657, + 1.0 + ], + "translation": [ + -8.940696716308594e-08, + -3.101583570241928e-05, + -2.7865171432495117e-06 + ] + }, + { + "children": [ + 69, + 73 + ], + "name": "CC_Base_JawRoot_044", + "rotation": [ + -5.048927414463833e-05, + -5.0933536840602756e-05, + 0.7070910334587097, + 0.7071225047111511 + ], + "scale": [ + 0.9999998807907104, + 1.0000001192092896, + 1.0 + ], + "translation": [ + 1.474984884262085, + 2.62320613861084, + 4.283152520656586e-05 + ] + }, + { + "children": [ + 70 + ], + "name": "CC_Base_Tongue01_045", + "rotation": [ + 7.779534030305513e-07, + -1.4709241440868936e-05, + 0.05348924547433853, + 0.9985685348510742 + ], + "scale": [ + 0.9999998211860657, + 0.9999997019767761, + 1.0 + ], + "translation": [ + 3.4389047622680664, + 1.0660067796707153, + 0.00019963085651397705 + ] + }, + { + "children": [ + 71 + ], + "name": "CC_Base_Tongue02_046", + "rotation": [ + 6.467682283073373e-07, + -1.0197020856139716e-05, + 0.07746660709381104, + 0.9969949722290039 + ], + "scale": [ + 0.9999998211860657, + 1.0, + 0.9999998211860657 + ], + "translation": [ + 1.2102530002593994, + -7.590651512145996e-05, + 3.129243850708008e-07 + ] + }, + { + "children": [ + 72 + ], + "name": "CC_Base_Tongue03_047", + "rotation": [ + -1.3335377389012137e-06, + -9.611251243768493e-07, + 0.00012087009235983714, + 1.0 + ], + "scale": [ + 0.9999997615814209, + 0.9999999403953552, + 0.9999998211860657 + ], + "translation": [ + 1.6922029256820679, + 4.138052463531494e-05, + -1.1102230246251565e-16 + ] + }, + { + "name": "CC_Base_Tongue03_end_0123", + "rotation": [ + -6.938893903907228e-18, + -0.0, + 0.0, + 1.0 + ], + "translation": [ + 1.4210854715202004e-14, + 1.692201018333435, + -1.1102230246251565e-16 + ] + }, + { + "children": [ + 74 + ], + "name": "CC_Base_Teeth02_048", + "rotation": [ + 1.0, + -4.688046374212718e-06, + 9.734866762300953e-05, + -0.00015981549222487956 + ], + "scale": [ + 0.9999998211860657, + 0.9999997019767761, + 0.9999997615814209 + ], + "translation": [ + 3.4695775508880615, + 1.0135586261749268, + 0.0007435232400894165 + ] + }, + { + "name": "CC_Base_Teeth02_end_0124", + "rotation": [ + 3.469446951953614e-18, + 1.3877787807814457e-17, + 1.3877787807814457e-17, + 1.0 + ], + "translation": [ + 0.0, + 3.60745906829834, + 2.220446049250313e-16 + ] + }, + { + "children": [ + 76 + ], + "name": "CC_Base_R_Eye_049", + "rotation": [ + 0.7071108222007751, + -3.593700512283249e-06, + 0.7071028351783752, + 3.5937409847974777e-06 + ], + "scale": [ + 0.9999999403953552, + 0.9999998211860657, + 0.9999999403953552 + ], + "translation": [ + 7.698877334594727, + 8.143675804138184, + -3.480882167816162 + ] + }, + { + "name": "CC_Base_R_Eye_end_0125", + "rotation": [ + 0.0, + -0.0, + -2.7755575615628914e-17, + 1.0 + ], + "translation": [ + 0.0, + 8.525575637817383, + 0.0 + ] + }, + { + "children": [ + 78 + ], + "name": "CC_Base_L_Eye_050", + "rotation": [ + 0.7071072459220886, + 8.120278494061495e-07, + 0.707106351852417, + -8.12028872587689e-07 + ], + "scale": [ + 0.9999999403953552, + 0.9999998807907104, + 0.9999999403953552 + ], + "translation": [ + 7.698816299438477, + 8.143527030944824, + 3.482116460800171 + ] + }, + { + "name": "CC_Base_L_Eye_end_0126", + "rotation": [ + 1.3877787807814457e-17, + 3.469446951953614e-18, + 1.3877787807814457e-17, + 1.0 + ], + "translation": [ + 8.881784197001252e-16, + 8.525575637817383, + 2.842170943040401e-14 + ] + }, + { + "children": [ + 80 + ], + "name": "CC_Base_UpperJaw_051", + "rotation": [ + 3.665486292447895e-05, + -3.944287891499698e-05, + 0.7071095108985901, + 0.7071040868759155 + ], + "scale": [ + 1.0, + 0.9999999403953552, + 1.0 + ], + "translation": [ + 2.9744253158569336, + 7.0184502601623535, + 9.916722774505615e-05 + ] + }, + { + "children": [ + 81 + ], + "name": "CC_Base_Teeth01_052", + "rotation": [ + 1.0, + -1.6982208762783557e-05, + -3.392832149984315e-05, + 2.189022234233562e-05 + ], + "scale": [ + 0.9999997615814209, + 0.9999995231628418, + 0.9999997019767761 + ], + "translation": [ + 0.03631499409675598, + 0.030144408345222473, + 0.00022368133068084717 + ] + }, + { + "name": "CC_Base_Teeth01_end_0127", + "rotation": [ + 3.469446951953614e-18, + 1.3877787807814457e-17, + -1.3877787807814457e-17, + 1.0 + ], + "translation": [ + -7.105427357601002e-15, + 0.04718999192118645, + 0.0 + ] + }, + { + "children": [ + 83 + ], + "name": "CC_Base_L_Clavicle_053", + "rotation": [ + -0.03174496069550514, + -0.18009565770626068, + 0.8918160200119019, + -0.4137897789478302 + ], + "scale": [ + 0.9999997019767761, + 0.9999998211860657, + 0.9999998807907104 + ], + "translation": [ + 12.55957317352295, + 22.41932487487793, + -0.5847246050834656 + ] + }, + { + "children": [ + 84, + 111 + ], + "name": "CC_Base_L_Upperarm_054", + "rotation": [ + -0.0021361045073717833, + -0.015670405700802803, + -0.2016914337873459, + 0.9793214201927185 + ], + "scale": [ + 1.0000004768371582, + 0.9999999403953552, + 1.0000003576278687 + ], + "translation": [ + -0.6097552180290222, + 8.776991844177246, + 0.430436372756958 + ] + }, + { + "children": [ + 85, + 88, + 90 + ], + "name": "CC_Base_L_Forearm_055", + "rotation": [ + 0.38542279601097107, + -0.00713105546310544, + -0.07426376640796661, + 0.9197191596031189 + ], + "scale": [ + 0.9999996423721313, + 1.0000001192092896, + 0.9999998807907104 + ], + "translation": [ + -0.24757367372512817, + 27.72170639038086, + 0.7432799339294434 + ] + }, + { + "children": [ + 86 + ], + "name": "CC_Base_L_ForearmTwist01_056", + "rotation": [ + -0.08576897531747818, + 0.006954834796488285, + 0.013742463663220406, + 0.9961960911750793 + ], + "scale": [ + 1.0, + 1.000000238418579, + 0.9999999403953552 + ], + "translation": [ + 4.4018030166625977e-05, + -6.198883056640625e-06, + -7.152557373046875e-06 + ] + }, + { + "children": [ + 87 + ], + "name": "CC_Base_L_ForearmTwist02_057", + "rotation": [ + -0.04517074301838875, + -0.014386278577148914, + 0.0009302262333221734, + 0.9988752603530884 + ], + "scale": [ + 1.000000238418579, + 1.0000003576278687, + 1.000000238418579 + ], + "translation": [ + -0.00011309981346130371, + 9.323843955993652, + 0.00041103363037109375 + ] + }, + { + "name": "CC_Base_L_ForearmTwist02_end_0128", + "rotation": [ + -2.7755575615628914e-17, + 6.938893903907228e-18, + 6.765421556309548e-17, + 1.0 + ], + "translation": [ + 1.4210854715202004e-14, + 17.742328643798828, + 0.0 + ] + }, + { + "children": [ + 89 + ], + "name": "CC_Base_L_ElbowShareBone_058", + "rotation": [ + -0.510430097579956, + -0.01187866646796465, + 0.0015869223279878497, + 0.8598357439041138 + ], + "scale": [ + 1.0000001192092896, + 0.9999998807907104, + 0.9999998807907104 + ], + "translation": [ + 4.4018030166625977e-05, + -6.198883056640625e-06, + -7.152557373046875e-06 + ] + }, + { + "name": "CC_Base_L_ElbowShareBone_end_0129", + "rotation": [ + 1.925929944387236e-34, + -6.938893903907228e-18, + 2.7755575615628914e-17, + 1.0 + ], + "translation": [ + 0.0, + 4.424139022827148, + 0.0 + ] + }, + { + "children": [ + 91, + 95, + 99, + 103, + 107 + ], + "name": "CC_Base_L_Hand_059", + "rotation": [ + -0.22693033516407013, + 0.001569191343151033, + 0.12143712490797043, + 0.9663090705871582 + ], + "scale": [ + 1.000000238418579, + 1.0000001192092896, + 1.0000001192092896 + ], + "translation": [ + -0.6834084391593933, + 26.671518325805664, + -6.199403762817383 + ] + }, + { + "children": [ + 92 + ], + "name": "CC_Base_L_Mid1_060", + "rotation": [ + 0.12766140699386597, + 0.001866990001872182, + -0.10540677607059479, + 0.9861990213394165 + ], + "scale": [ + 0.9999999403953552, + 0.9999999403953552, + 0.9999999403953552 + ], + "translation": [ + -0.3184530735015869, + 8.434123039245605, + 3.051168441772461 + ] + }, + { + "children": [ + 93 + ], + "name": "CC_Base_L_Mid2_061", + "rotation": [ + -0.020814307034015656, + -0.010288281366229057, + -0.19590876996517181, + 0.980347216129303 + ], + "scale": [ + 1.0, + 0.9999999403953552, + 1.0 + ], + "translation": [ + -6.9141387939453125e-06, + 4.4326910972595215, + -1.0967254638671875e-05 + ] + }, + { + "children": [ + 94 + ], + "name": "CC_Base_L_Mid3_062", + "rotation": [ + 0.01567956991493702, + -0.00013457395834848285, + -0.001651052967645228, + 0.9998757243156433 + ], + "scale": [ + 1.000000238418579, + 1.0000001192092896, + 1.0000001192092896 + ], + "translation": [ + 5.960464477539063e-07, + 2.8740878105163574, + -5.4836273193359375e-06 + ] + }, + { + "name": "CC_Base_L_Mid3_end_0130", + "rotation": [ + -8.326672684688674e-17, + -6.938893903907228e-18, + -5.7777898331617076e-34, + 1.0 + ], + "translation": [ + -7.105427357601002e-15, + 2.8740885257720947, + 1.4210854715202004e-14 + ] + }, + { + "children": [ + 96 + ], + "name": "CC_Base_L_Index1_063", + "rotation": [ + 0.16344495117664337, + -0.005550294183194637, + -0.09037940204143524, + 0.9823882579803467 + ], + "scale": [ + 0.9999997615814209, + 0.9999998807907104, + 0.9999997615814209 + ], + "translation": [ + 0.3715876340866089, + 7.897217273712158, + 5.916953086853027 + ] + }, + { + "children": [ + 97 + ], + "name": "CC_Base_L_Index2_064", + "rotation": [ + -0.013424240052700043, + -0.017507808282971382, + -0.10806526243686676, + 0.9938989877700806 + ], + "scale": [ + 1.0000005960464478, + 1.0000003576278687, + 1.0000004768371582 + ], + "translation": [ + 8.225440979003906e-06, + 3.514439582824707, + 1.9073486328125e-06 + ] + }, + { + "children": [ + 98 + ], + "name": "CC_Base_L_Index3_065", + "rotation": [ + 0.028432805091142654, + -0.003957400098443031, + -0.0974571481347084, + 0.9948257207870483 + ], + "scale": [ + 1.0000001192092896, + 1.000000238418579, + 1.0 + ], + "translation": [ + -2.644956111907959e-06, + 3.1824116706848145, + 1.430511474609375e-06 + ] + }, + { + "name": "CC_Base_L_Index3_end_0131", + "rotation": [ + -4.81482486096809e-35, + -6.938893903907228e-18, + -6.938893903907228e-18, + 1.0 + ], + "translation": [ + 0.0, + 3.18241548538208, + 7.105427357601002e-15 + ] + }, + { + "children": [ + 100 + ], + "name": "CC_Base_L_Ring1_066", + "rotation": [ + 0.10408224910497665, + -0.010069037787616253, + -0.22793403267860413, + 0.9680453538894653 + ], + "scale": [ + 1.0, + 1.0000001192092896, + 1.0 + ], + "translation": [ + -0.004624664783477783, + 8.854449272155762, + 0.3199732303619385 + ] + }, + { + "children": [ + 101 + ], + "name": "CC_Base_L_Ring2_067", + "rotation": [ + -0.032624922692775726, + 0.002838012296706438, + -0.2570822834968567, + 0.9658344984054565 + ], + "scale": [ + 1.0, + 0.9999997615814209, + 0.9999998211860657 + ], + "translation": [ + -1.3932585716247559e-05, + 3.8653085231781006, + 6.794929504394531e-06 + ] + }, + { + "children": [ + 102 + ], + "name": "CC_Base_L_Ring3_068", + "rotation": [ + 0.008118962869048119, + -0.0016080787172541022, + 0.020150944590568542, + 0.9997627139091492 + ], + "scale": [ + 1.0000003576278687, + 1.0000003576278687, + 1.0000001192092896 + ], + "translation": [ + -2.5391578674316406e-05, + 2.6603639125823975, + -3.0994415283203125e-06 + ] + }, + { + "name": "CC_Base_L_Ring3_end_0132", + "rotation": [ + 2.7755575615628914e-17, + -1.3877787807814457e-17, + 1.3877787807814457e-17, + 1.0 + ], + "translation": [ + 5.3290705182007514e-15, + 2.6603665351867676, + 0.0 + ] + }, + { + "children": [ + 104 + ], + "name": "CC_Base_L_Pinky1_069", + "rotation": [ + 0.07073045521974564, + -0.008312026038765907, + -0.2905854284763336, + 0.9541950821876526 + ], + "scale": [ + 1.0000001192092896, + 1.0000001192092896, + 0.9999997615814209 + ], + "translation": [ + 0.27084359526634216, + 9.190208435058594, + -2.6346588134765625 + ] + }, + { + "children": [ + 105 + ], + "name": "CC_Base_L_Pinky2_070", + "rotation": [ + -0.004679448902606964, + 0.007878338918089867, + -0.28974348306655884, + 0.9570605754852295 + ], + "scale": [ + 1.0, + 1.0, + 0.9999998807907104 + ], + "translation": [ + 6.082653999328613e-05, + 2.9735865592956543, + 5.675479769706726e-06 + ] + }, + { + "children": [ + 106 + ], + "name": "CC_Base_L_Pinky3_071", + "rotation": [ + -0.023878110572695732, + -0.0006002781447023153, + 0.004747862461954355, + 0.9997035264968872 + ], + "scale": [ + 1.000000238418579, + 1.000000238418579, + 1.0000001192092896 + ], + "translation": [ + 2.0265579223632813e-06, + 1.9515843391418457, + 1.3113021850585938e-06 + ] + }, + { + "name": "CC_Base_L_Pinky3_end_0133", + "rotation": [ + 4.163336342344337e-17, + 1.3877787807814457e-17, + 1.734723475976807e-17, + 1.0 + ], + "translation": [ + 7.105427357601002e-15, + 1.9515916109085083, + -3.552713678800501e-15 + ] + }, + { + "children": [ + 108 + ], + "name": "CC_Base_L_Thumb1_072", + "rotation": [ + 0.3944500684738159, + -0.23008331656455994, + -0.2614637315273285, + 0.8503572940826416 + ], + "scale": [ + 1.0000001192092896, + 1.0000001192092896, + 1.0000003576278687 + ], + "translation": [ + 1.7135796546936035, + -0.5627119541168213, + 2.203418493270874 + ] + }, + { + "children": [ + 109 + ], + "name": "CC_Base_L_Thumb2_073", + "rotation": [ + -0.25815844535827637, + 0.036537814885377884, + -0.12967947125434875, + 0.9566622376441956 + ], + "scale": [ + 1.0000003576278687, + 1.0, + 0.9999999403953552 + ], + "translation": [ + 1.2278556823730469e-05, + 5.361125946044922, + -3.266334533691406e-05 + ] + }, + { + "children": [ + 110 + ], + "name": "CC_Base_L_Thumb3_074", + "rotation": [ + 0.15506863594055176, + -0.002491739811375737, + 0.0757022351026535, + 0.9849957823753357 + ], + "scale": [ + 1.000000238418579, + 1.0, + 1.0000001192092896 + ], + "translation": [ + -3.0040740966796875e-05, + 4.324830055236816, + 3.2901763916015625e-05 + ] + }, + { + "name": "CC_Base_L_Thumb3_end_0134", + "rotation": [ + 8.326672684688674e-17, + 1.734723475976807e-18, + 5.204170427930421e-18, + 1.0 + ], + "translation": [ + -3.552713678800501e-15, + 4.324832439422607, + -1.4210854715202004e-14 + ] + }, + { + "children": [ + 112 + ], + "name": "CC_Base_L_UpperarmTwist01_075", + "rotation": [ + 7.295394084394502e-07, + 0.07294917851686478, + -1.0260242788717733e-06, + 0.99733567237854 + ], + "scale": [ + 1.0, + 1.0000003576278687, + 1.0 + ], + "translation": [ + 1.7374753952026367e-05, + 2.86102294921875e-06, + -1.430511474609375e-06 + ] + }, + { + "children": [ + 113 + ], + "name": "CC_Base_L_UpperarmTwist02_076", + "rotation": [ + 0.021988460794091225, + -0.07295012474060059, + 0.009155466221272945, + 0.9970511198043823 + ], + "scale": [ + 1.0, + 0.9999999403953552, + 1.0000001192092896 + ], + "translation": [ + -9.018182754516602e-05, + 11.29280948638916, + -7.432699203491211e-05 + ] + }, + { + "name": "CC_Base_L_UpperarmTwist02_end_0135", + "rotation": [ + -6.938893903907228e-18, + -6.938893903907228e-18, + 4.7704895589362195e-18, + 1.0 + ], + "translation": [ + 0.0, + 16.447498321533203, + 0.0 + ] + }, + { + "children": [ + 115 + ], + "name": "CC_Base_R_Clavicle_077", + "rotation": [ + 0.03212287276983261, + -0.1831015795469284, + 0.8458945751190186, + 0.4999043047428131 + ], + "scale": [ + 0.999999463558197, + 0.9999997615814209, + 0.9999997019767761 + ], + "translation": [ + -11.507807731628418, + 21.40015983581543, + -0.8956856727600098 + ] + }, + { + "children": [ + 116, + 119 + ], + "name": "CC_Base_R_Upperarm_078", + "rotation": [ + -0.043173111975193024, + 0.019872630015015602, + 0.2466156780719757, + 0.967947244644165 + ], + "scale": [ + 1.0000005960464478, + 1.0000004768371582, + 1.0000004768371582 + ], + "translation": [ + 0.08705278486013412, + 10.242515563964844, + 2.0728390216827393 + ] + }, + { + "children": [ + 117 + ], + "name": "CC_Base_R_UpperarmTwist01_079", + "rotation": [ + 4.370233170902793e-07, + -0.07294680178165436, + 1.5629653660198528e-07, + 0.9973358511924744 + ], + "scale": [ + 1.000000238418579, + 1.0000001192092896, + 1.0000001192092896 + ], + "translation": [ + -1.7285346984863281e-06, + -1.6450881958007813e-05, + 1.430511474609375e-06 + ] + }, + { + "children": [ + 118 + ], + "name": "CC_Base_R_UpperarmTwist02_080", + "rotation": [ + 0.02094067819416523, + 0.07322894036769867, + -0.0075409007258713245, + 0.9970667958259583 + ], + "scale": [ + 1.0000003576278687, + 1.0, + 1.0000001192092896 + ], + "translation": [ + 2.4244189262390137e-05, + 11.292789459228516, + -2.9802322387695313e-05 + ] + }, + { + "name": "CC_Base_R_UpperarmTwist02_end_0136", + "rotation": [ + 1.3877787807814457e-17, + -2.0816681711721685e-17, + 1.214306433183765e-17, + 1.0 + ], + "translation": [ + -1.4210854715202004e-14, + 16.15148162841797, + 0.0 + ] + }, + { + "children": [ + 120, + 123, + 125 + ], + "name": "CC_Base_R_Forearm_081", + "rotation": [ + 0.2657851576805115, + -0.04466181993484497, + 0.046226866543293, + 0.961887001991272 + ], + "scale": [ + 1.0, + 1.000000238418579, + 0.9999999403953552 + ], + "translation": [ + 0.1940082311630249, + 27.428327560424805, + 0.6921553611755371 + ] + }, + { + "children": [ + 121 + ], + "name": "CC_Base_R_ForearmTwist01_082", + "rotation": [ + -0.07521620392799377, + -0.004738198593258858, + -0.009704971686005592, + 0.9971087574958801 + ], + "scale": [ + 0.9999998807907104, + 0.9999999403953552, + 1.0 + ], + "translation": [ + -3.9011240005493164e-05, + -1.5974044799804688e-05, + -1.430511474609375e-06 + ] + }, + { + "children": [ + 122 + ], + "name": "CC_Base_R_ForearmTwist02_083", + "rotation": [ + -0.07095394283533096, + 0.015190773643553257, + -0.008848902769386768, + 0.9973247647285461 + ], + "scale": [ + 1.0000001192092896, + 1.0000004768371582, + 1.0 + ], + "translation": [ + 0.00015448033809661865, + 9.589838981628418, + 0.00021219253540039063 + ] + }, + { + "name": "CC_Base_R_ForearmTwist02_end_0137", + "rotation": [ + -1.734723475976807e-18, + -3.469446951953614e-18, + 3.003240017784847e-17, + 1.0 + ], + "translation": [ + 0.0, + 17.534521102905273, + -8.881784197001252e-16 + ] + }, + { + "children": [ + 124 + ], + "name": "CC_Base_R_ElbowShareBone_084", + "rotation": [ + -0.5765365362167358, + -0.01896207220852375, + -0.013523944653570652, + 0.8167393207550049 + ], + "scale": [ + 1.0, + 0.9999998807907104, + 1.0000001192092896 + ], + "translation": [ + -3.9011240005493164e-05, + -1.5974044799804688e-05, + -1.430511474609375e-06 + ] + }, + { + "name": "CC_Base_R_ElbowShareBone_end_0138", + "rotation": [ + -8.326672684688674e-17, + -1.3877787807814457e-17, + 7.806255641895632e-18, + 1.0 + ], + "translation": [ + 0.0, + 4.692605972290039, + 0.0 + ] + }, + { + "children": [ + 126, + 130, + 134, + 138, + 142 + ], + "name": "CC_Base_R_Hand_085", + "rotation": [ + -0.16069935262203217, + 0.14831461012363434, + -0.007750548887997866, + 0.975765585899353 + ], + "scale": [ + 1.0000003576278687, + 1.0000001192092896, + 1.0 + ], + "translation": [ + 0.8322582244873047, + 26.256797790527344, + -6.494178295135498 + ] + }, + { + "children": [ + 127 + ], + "name": "CC_Base_R_Mid1_086", + "rotation": [ + 0.05301354080438614, + -0.015768319368362427, + 0.4741077721118927, + 0.878727912902832 + ], + "scale": [ + 0.9999998211860657, + 0.9999999403953552, + 0.9999998807907104 + ], + "translation": [ + 0.7399986982345581, + 8.592744827270508, + 3.0300488471984863 + ] + }, + { + "children": [ + 128 + ], + "name": "CC_Base_R_Mid2_087", + "rotation": [ + -0.019847318530082703, + 0.012049351818859577, + 0.27992403507232666, + 0.9597413539886475 + ], + "scale": [ + 0.9999999403953552, + 0.9999998211860657, + 0.9999999403953552 + ], + "translation": [ + 6.407499313354492e-06, + 4.432699203491211, + 1.1682510375976563e-05 + ] + }, + { + "children": [ + 129 + ], + "name": "CC_Base_R_Mid3_088", + "rotation": [ + 0.014206938445568085, + -0.006634735502302647, + 0.43210965394973755, + 0.9016847610473633 + ], + "scale": [ + 1.000000238418579, + 1.0000003576278687, + 1.0 + ], + "translation": [ + 2.3797154426574707e-05, + 2.8740696907043457, + 1.3113021850585938e-05 + ] + }, + { + "name": "CC_Base_R_Mid3_end_0139", + "rotation": [ + -1.3877787807814457e-17, + -3.3703774026776627e-34, + 2.42861286636753e-17, + 1.0 + ], + "translation": [ + 0.0, + 2.874074935913086, + 0.0 + ] + }, + { + "children": [ + 131 + ], + "name": "CC_Base_R_Ring1_089", + "rotation": [ + 0.10948888212442398, + -0.015413529239594936, + 0.6176273226737976, + 0.7786598205566406 + ], + "scale": [ + 0.9999996423721313, + 0.9999996423721313, + 0.9999997615814209 + ], + "translation": [ + 0.05917978286743164, + 8.93188190460205, + 0.04069662094116211 + ] + }, + { + "children": [ + 132 + ], + "name": "CC_Base_R_Ring2_090", + "rotation": [ + -0.03272632509469986, + -0.0011917934753000736, + 0.30537134408950806, + 0.9516701698303223 + ], + "scale": [ + 1.0000003576278687, + 1.0000003576278687, + 1.0000003576278687 + ], + "translation": [ + -9.238719940185547e-07, + 3.8652992248535156, + 1.0967254638671875e-05 + ] + }, + { + "children": [ + 133 + ], + "name": "CC_Base_R_Ring3_091", + "rotation": [ + 0.008209481835365295, + 0.0010548190912231803, + 0.04751267284154892, + 0.99883633852005 + ], + "scale": [ + 1.0000001192092896, + 0.9999999403953552, + 0.9999997615814209 + ], + "translation": [ + -3.123283386230469e-05, + 2.660412311553955, + -7.152557373046875e-06 + ] + }, + { + "name": "CC_Base_R_Ring3_end_0140", + "rotation": [ + -2.7755575615628914e-17, + 2.7755575615628914e-17, + -6.938893903907228e-18, + 1.0 + ], + "translation": [ + 0.0, + 2.660402536392212, + 7.105427357601002e-15 + ] + }, + { + "children": [ + 135 + ], + "name": "CC_Base_R_Thumb1_092", + "rotation": [ + 0.2561528980731964, + 0.25932320952415466, + 0.18974997103214264, + 0.911664605140686 + ], + "scale": [ + 0.9999998807907104, + 0.9999997019767761, + 0.9999995827674866 + ], + "translation": [ + -2.091470241546631, + 0.029509782791137695, + 3.4348502159118652 + ] + }, + { + "children": [ + 136 + ], + "name": "CC_Base_R_Thumb2_093", + "rotation": [ + -0.2877480387687683, + 0.032674871385097504, + 0.12033305317163467, + 0.9495543241500854 + ], + "scale": [ + 0.9999997615814209, + 0.9999998807907104, + 1.0000003576278687 + ], + "translation": [ + 5.960464477539063e-08, + 5.361143589019775, + -5.364418029785156e-07 + ] + }, + { + "children": [ + 137 + ], + "name": "CC_Base_R_Thumb3_094", + "rotation": [ + 0.09411900490522385, + 0.0071709658950567245, + -0.07539763301610947, + 0.9926759004592896 + ], + "scale": [ + 1.0000001192092896, + 0.9999995231628418, + 0.9999999403953552 + ], + "translation": [ + 3.606081008911133e-06, + 4.324857711791992, + 3.635883331298828e-06 + ] + }, + { + "name": "CC_Base_R_Thumb3_end_0141", + "rotation": [ + -5.551115123125783e-17, + 7.703719777548943e-34, + -1.3877787807814457e-17, + 1.0 + ], + "translation": [ + -1.7763568394002505e-15, + 4.324836254119873, + -7.105427357601002e-15 + ] + }, + { + "children": [ + 139 + ], + "name": "CC_Base_R_Index1_095", + "rotation": [ + 0.0915796160697937, + -0.0060451882891356945, + 0.26134565472602844, + 0.9608720541000366 + ], + "scale": [ + 0.9999993443489075, + 0.9999993443489075, + 0.9999997615814209 + ], + "translation": [ + 0.30497419834136963, + 8.2451810836792, + 6.047415733337402 + ] + }, + { + "children": [ + 140 + ], + "name": "CC_Base_R_Index2_096", + "rotation": [ + -0.010846035555005074, + 0.019203877076506615, + 0.24592161178588867, + 0.9690387845039368 + ], + "scale": [ + 1.0000003576278687, + 1.0000007152557373, + 1.0000001192092896 + ], + "translation": [ + 2.0116567611694336e-05, + 3.5144543647766113, + 1.4066696166992188e-05 + ] + }, + { + "children": [ + 141 + ], + "name": "CC_Base_R_Index3_097", + "rotation": [ + 0.028495457023382187, + 0.0034991982392966747, + 0.11405918002128601, + 0.9930590391159058 + ], + "scale": [ + 1.000000238418579, + 1.0000001192092896, + 1.0000001192092896 + ], + "translation": [ + 5.587935447692871e-07, + 3.182427167892456, + 3.6656856536865234e-06 + ] + }, + { + "name": "CC_Base_R_Index3_end_0142", + "rotation": [ + 2.7755575615628914e-17, + -1.474514954580286e-17, + -5.984795992119984e-17, + 1.0 + ], + "translation": [ + -7.105427357601002e-15, + 3.182417154312134, + 0.0 + ] + }, + { + "children": [ + 143 + ], + "name": "CC_Base_R_Pinky1_098", + "rotation": [ + -0.04215848073363304, + 0.02414836548268795, + 0.7062756419181824, + 0.7062678337097168 + ], + "scale": [ + 0.9999997615814209, + 0.9999995231628418, + 0.9999997615814209 + ], + "translation": [ + -0.9767727851867676, + 8.198661804199219, + -2.838791847229004 + ] + }, + { + "children": [ + 144 + ], + "name": "CC_Base_R_Pinky2_099", + "rotation": [ + -0.005100731737911701, + -0.007609831169247627, + 0.3414241671562195, + 0.9398646950721741 + ], + "scale": [ + 0.9999997615814209, + 1.0000001192092896, + 0.9999996423721313 + ], + "translation": [ + -8.165836334228516e-06, + 2.9736273288726807, + 4.76837158203125e-07 + ] + }, + { + "children": [ + 145 + ], + "name": "CC_Base_R_Pinky3_0100", + "rotation": [ + -0.02359827607870102, + 0.0037017602007836103, + 0.1245521754026413, + 0.9919254779815674 + ], + "scale": [ + 1.000000238418579, + 1.0000005960464478, + 1.0000003576278687 + ], + "translation": [ + -3.2186508178710938e-06, + 1.9515714645385742, + -4.76837158203125e-07 + ] + }, + { + "name": "CC_Base_R_Pinky3_end_0143", + "rotation": [ + 0.0, + 0.0, + 5.551115123125783e-17, + 1.0 + ], + "translation": [ + 0.0, + 1.9515793323516846, + -1.7763568394002505e-15 + ] + }, + { + "children": [ + 147 + ], + "name": "CC_Base_R_RibsTwist_0101", + "rotation": [ + -2.9636464660143247e-07, + 0.6366287469863892, + 0.771170437335968, + -8.81901360116899e-06 + ], + "scale": [ + 0.9999998807907104, + 0.9999998807907104, + 0.9999998807907104 + ], + "translation": [ + -8.5949068069458, + 5.802481174468994, + 7.755682468414307 + ] + }, + { + "children": [ + 148 + ], + "name": "CC_Base_R_Breast_0102", + "rotation": [ + 7.329110474074696e-08, + 4.5523114522438846e-07, + -1.935808313646703e-07, + 1.0 + ], + "scale": [ + 0.9999998807907104, + 1.0000001192092896, + 1.0000003576278687 + ], + "translation": [ + 1.1730007827281952e-05, + 1.8057496547698975, + 3.190850839018822e-05 + ] + }, + { + "name": "CC_Base_R_Breast_end_0144", + "rotation": [ + -6.938893903907228e-18, + -0.0, + 0.0, + 1.0 + ], + "translation": [ + 1.7763568394002505e-15, + 1.8057491779327393, + 0.0 + ] + }, + { + "children": [ + 150 + ], + "name": "CC_Base_L_RibsTwist_0103", + "rotation": [ + 9.511803000350483e-06, + 0.6366291642189026, + 0.7711700797080994, + 1.675082557994756e-06 + ], + "scale": [ + 0.9999999403953552, + 0.9999998807907104, + 0.9999998807907104 + ], + "translation": [ + 8.602237701416016, + 5.796634197235107, + 7.7591047286987305 + ] + }, + { + "children": [ + 151 + ], + "name": "CC_Base_L_Breast_0104", + "rotation": [ + -4.273061193771355e-08, + -3.583044616561892e-08, + 7.086669029376935e-08, + 1.0 + ], + "scale": [ + 0.9999998807907104, + 1.0000001192092896, + 1.0000003576278687 + ], + "translation": [ + 1.0076910257339478e-05, + 1.805739164352417, + 3.416091203689575e-06 + ] + }, + { + "name": "CC_Base_L_Breast_end_0145", + "rotation": [ + -2.350988701644575e-38, + -5.421010862427522e-20, + -4.336808689942018e-19, + 1.0 + ], + "translation": [ + 0.0, + 1.805740237236023, + 0.0 + ] + }, + { + "matrix": [ + 0.9999998807907104, + 4.547473508864641e-13, + 4.547473508864641e-13, + 0.0, + 4.547474118531031e-13, + -1.4857751634397077e-08, + -0.9999999999999999, + 0.0, + -4.547473983400551e-13, + 0.9999999999999999, + -1.4857751634397077e-08, + 0.0, + 6.694317562505603e-07, + -4.050971508026123, + -1.8234386516269296e-06, + 1.0 + ], + "name": "Object_152" + }, + { + "mesh": 0, + "name": "Object_153", + "skin": 0 + }, + { + "mesh": 1, + "name": "Object_154", + "skin": 0 + }, + { + "mesh": 2, + "name": "Object_155", + "skin": 0 + }, + { + "mesh": 3, + "name": "Object_156", + "skin": 0 + }, + { + "mesh": 4, + "name": "Object_157", + "skin": 0 + }, + { + "mesh": 5, + "name": "Object_158", + "skin": 0 + }, + { + "children": [ + 160 + ], + "matrix": [ + 15.049733495771978, + -95.9384193621829, + -23.86053670796549, + 0.0, + 90.9085914926442, + 3.9459510250217766, + 41.47357548285016, + 0.0, + -38.847567678424596, + -27.932940425133534, + 87.81012085560617, + 0.0, + -52.78205871582031, + 89.54025268554688, + 4.563872337341309, + 1.0 + ], + "name": "katana" + }, + { + "mesh": 6, + "name": "katana_weapon_mat_0" + } + ], + "samplers": [ + { + "magFilter": 9729, + "minFilter": 9987, + "wrapS": 10497, + "wrapT": 10497 + } + ], + "scene": 0, + "scenes": [ + { + "name": "Sketchfab_Scene", + "nodes": [ + 0 + ] + } + ], + "skins": [ + { + "inverseBindMatrices": 38, + "joints": [ + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97, + 98, + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135, + 136, + 137, + 138, + 139, + 140, + 141, + 142, + 143, + 144, + 145, + 146, + 147, + 148, + 149, + 150, + 151 + ], + "skeleton": 5 + } + ], + "textures": [ + { + "sampler": 0, + "source": 0 + }, + { + "sampler": 0, + "source": 1 + }, + { + "sampler": 0, + "source": 2 + }, + { + "sampler": 0, + "source": 3 + }, + { + "sampler": 0, + "source": 4 + }, + { + "sampler": 0, + "source": 5 + }, + { + "sampler": 0, + "source": 6 + }, + { + "sampler": 0, + "source": 7 + }, + { + "sampler": 0, + "source": 8 + }, + { + "sampler": 0, + "source": 9 + }, + { + "sampler": 0, + "source": 10 + }, + { + "sampler": 0, + "source": 11 + }, + { + "sampler": 0, + "source": 12 + }, + { + "sampler": 0, + "source": 13 + }, + { + "sampler": 0, + "source": 14 + }, + { + "sampler": 0, + "source": 15 + }, + { + "sampler": 0, + "source": 16 + }, + { + "sampler": 0, + "source": 17 + }, + { + "sampler": 0, + "source": 18 + }, + { + "sampler": 0, + "source": 19 + } + ] +} diff --git a/src/main.cpp b/src/main.cpp index 19ea37e..027c243 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -11,14 +11,12 @@ #include #include // std::numeric_limits #include // to load shaders -#include #include #include #include #include #include #include -#include // Vulkan Includes #include "vulkan/vulkan.hpp" #include @@ -40,17 +38,25 @@ import vulkan_hpp; #include // Images #define STB_IMAGE_IMPLEMENTATION +#define STB_IMAGE_WRITE_IMPLEMENTATION +#include #include -// OBJ loader -#define TINYOBJLOADER_IMPLEMENTATION -#include +#include +// Model loader +#include +#define TINYGLTF_IMPLEMENTATION +#define TINYGLTF_NO_INCLUDE_JSON +#define TINYGLTF_NO_INCLUDE_STB_IMAGE +#define TINYGLTF_NO_INCLUDE_STB_IMAGE_WRITE +#define TINYGLTF_USE_CPP14 +#include // Consts constexpr uint32_t WIDTH = 800; constexpr uint32_t HEIGHT = 600; constexpr int MAX_FRAMES_IN_FLIGHT = 2; -const std::string MODEL_PATH = "models/viking_room.obj"; -const std::string TEXTURE_PATH = "textures/viking_room.png"; +const std::string MODEL_PATH = "models/scene.gltf"; +const std::string TEXTURE_PATH = "textures/texture.ktx2"; const std::vector validationLayers = { "VK_LAYER_KHRONOS_validation" @@ -711,15 +717,30 @@ class HelloTriangleApplication { #ifndef NDEBUG std::cout << "Creating a texture image...\n"; #endif - int texWidth, texHeight, texChannels; - stbi_uc* pixels = stbi_load(TEXTURE_PATH.c_str(), &texWidth, &texHeight, &texChannels, STBI_rgb_alpha); - vk::DeviceSize imageSize = texWidth * texHeight * 4; + ktxTexture* kTexture; + KTX_error_code result = ktxTexture_CreateFromNamedFile( + TEXTURE_PATH.c_str(), + KTX_TEXTURE_CREATE_LOAD_IMAGE_DATA_BIT, + &kTexture + ); - mipLevels = static_cast (std::floor(std::log2(std::max(texWidth, texHeight)))) + 1; - - if (!pixels) { + if (result != KTX_SUCCESS) { throw std::runtime_error("Failed to load texture image!\nAborting..."); } + + mipLevels = kTexture->numLevels; + //mipLevels = static_cast (std::floor(std::log2(std::max(texWidth, texHeight)))) + 1; + uint32_t texWidth = kTexture->baseWidth; + uint32_t texHeight = kTexture->baseHeight; + ktx_size_t imageSize = ktxTexture_GetImageSize(kTexture, 0); + ktx_uint8_t* ktxTextureData = ktxTexture_GetData(kTexture); + + if (mipLevels == 1) { + // Handles the case the texture has no mipMaps + mipLevels = static_cast (std::floor(std::log2(std::max(texWidth, texHeight)))) + 1; + } + + // Temporary buffers vk::raii::Buffer stagingBuffer( {} ); vk::raii::DeviceMemory stagingBufferMemory( {} ); @@ -732,15 +753,16 @@ class HelloTriangleApplication { ); void* data = stagingBufferMemory.mapMemory(0, imageSize); - memcpy(data, pixels, imageSize); + memcpy(data, ktxTextureData, imageSize); stagingBufferMemory.unmapMemory(); - stbi_image_free(pixels); + + vk::Format textureFormat = vk::Format::eR8G8B8A8Srgb; // Default format, should be determined from KTX metadata createImage( texWidth, texHeight, mipLevels, - vk::Format::eR8G8B8A8Srgb, + textureFormat, vk::ImageTiling::eOptimal, vk::ImageUsageFlagBits::eTransferSrc | vk::ImageUsageFlagBits::eTransferDst | vk::ImageUsageFlagBits::eSampled, vk::MemoryPropertyFlagBits::eDeviceLocal, @@ -760,12 +782,6 @@ class HelloTriangleApplication { static_cast(texWidth), static_cast(texHeight) ); - transitionImageLayout( - textureImage, - vk::ImageLayout::eTransferDstOptimal, - vk::ImageLayout::eShaderReadOnlyOptimal, - mipLevels - ); generateMipmaps( textureImage, @@ -775,6 +791,8 @@ class HelloTriangleApplication { mipLevels ); + ktxTexture_Destroy(kTexture); + #ifndef NDEBUG std::cout << "Texture image created !\n"; #endif @@ -805,7 +823,7 @@ class HelloTriangleApplication { vk::MemoryPropertyFlags properties, vk::raii::Image &image, vk::raii::DeviceMemory &imageMemory - ) { + ) { #ifndef NDEBUG std::cout << "Creating an image with usage " << vk::to_string(usage) << '\n'; #endif @@ -871,40 +889,103 @@ class HelloTriangleApplication { std::cout << "Loading the 3D model...\n"; #endif - tinyobj::attrib_t attrib; - std::vector shapes; - std::vector materials; + tinygltf::Model model; + tinygltf::TinyGLTF loader; std::string warn, err; - if (!tinyobj::LoadObj(&attrib, &shapes, &materials, &warn, &err, MODEL_PATH.c_str())) { - throw std::runtime_error(warn + err); + bool ret = (MODEL_PATH.ends_with(".glb")) + ? loader.LoadBinaryFromFile(&model, &err, &warn, MODEL_PATH) + : loader.LoadASCIIFromFile(&model, &err, &warn, MODEL_PATH); + + if (!warn.empty()) { + #ifndef NDEBUG + std::cout << "glTF warning: " << warn << std::endl; + #endif } - std::unordered_map uniqueVertices{}; + if (!err.empty()) { + std::cout << "Error while loading the model: " << err << std::endl; + } - for (const auto& shape : shapes) { - for (const auto& index : shape.mesh.indices) { - Vertex vertex{}; + if (!ret) { + throw std::runtime_error("Failed to load the glTF model"); + } - vertex.pos = { - attrib.vertices[3 * index.vertex_index + 0], - attrib.vertices[3 * index.vertex_index + 1], - attrib.vertices[3 * index.vertex_index + 2] - }; + for ( const auto &mesh : model.meshes ) { + for ( const auto &primitive : mesh.primitives ) { + // Get indices + const tinygltf::Accessor &indexAccessor = model.accessors[primitive.indices]; + const tinygltf::BufferView &indexBufferView = model.bufferViews[indexAccessor.bufferView]; + const tinygltf::Buffer &indexBuffer = model.buffers[indexBufferView.buffer]; - vertex.texCoord = { - attrib.texcoords[2 * index.texcoord_index + 0], - 1.0f - attrib.texcoords[2 * index.texcoord_index + 1] - }; + // Get vertex positions + const tinygltf::Accessor &posAccessor = model.accessors[primitive.attributes.at("POSITION")]; + const tinygltf::BufferView &posBufferView = model.bufferViews[posAccessor.bufferView]; + const tinygltf::Buffer &posBuffer = model.buffers[posBufferView.buffer]; - vertex.color = {1.0f, 1.0f, 1.0f}; + // Get texture coordinates if available + bool hasTexCoords = primitive.attributes.find("TEXCOORD_0") != primitive.attributes.end(); + const tinygltf::Accessor *texCoordAccessor = nullptr; + const tinygltf::BufferView *texCoordBufferView = nullptr; + const tinygltf::Buffer *texCoordBuffer = nullptr; + + if (hasTexCoords) { + texCoordAccessor = &model.accessors[primitive.attributes.at("TEXCOORD_0")]; + texCoordBufferView = &model.bufferViews[texCoordAccessor->bufferView]; + texCoordBuffer = &model.buffers[texCoordBufferView->buffer]; + } + + uint32_t baseVertex = static_cast(vertices.size()); + + for (size_t i = 0; i < posAccessor.count; i++) { + Vertex vertex{}; + + const float *pos = reinterpret_cast(&posBuffer.data[posBufferView.byteOffset + posAccessor.byteOffset + i * 12]); + // Flip the Y coordinate for glTF <-> Vulkan compatibility + vertex.pos = {pos[0], -pos[1], pos[2]}; + + if (hasTexCoords) { + const float *texCoord = reinterpret_cast(&texCoordBuffer->data[texCoordBufferView->byteOffset + texCoordAccessor->byteOffset + i * 8]); + vertex.texCoord = {texCoord[0], texCoord[1]}; + } else { + vertex.texCoord = {0.0f, 0.0f}; + } + + vertex.color = {1.0f, 1.0f, 1.0f}; - if (uniqueVertices.count(vertex) == 0) { - uniqueVertices[vertex] = static_cast(vertices.size()); vertices.push_back(vertex); } - indices.push_back(uniqueVertices[vertex]); + const unsigned char *indexData = &indexBuffer.data[indexBufferView.byteOffset + indexAccessor.byteOffset]; + size_t indexCount = indexAccessor.count; + size_t indexStride = 0; + + // Determine index stride based on component type + if (indexAccessor.componentType == TINYGLTF_COMPONENT_TYPE_UNSIGNED_SHORT) { + indexStride = sizeof(uint16_t); + } else if (indexAccessor.componentType == TINYGLTF_COMPONENT_TYPE_UNSIGNED_INT) { + indexStride = sizeof(uint32_t); + } else if (indexAccessor.componentType == TINYGLTF_COMPONENT_TYPE_UNSIGNED_BYTE) { + indexStride = sizeof(uint8_t); + } else { + throw std::runtime_error("Unsupported index component type"); + } + + indices.reserve(indices.size() + indexCount); + + for (size_t i = 0; i < indexCount; i++) { + uint32_t index = 0; + + if (indexAccessor.componentType == TINYGLTF_COMPONENT_TYPE_UNSIGNED_SHORT) { + index = *reinterpret_cast(indexData + i * indexStride); + } else if (indexAccessor.componentType == TINYGLTF_COMPONENT_TYPE_UNSIGNED_INT) { + index = *reinterpret_cast(indexData + i * indexStride); + } else if (indexAccessor.componentType == TINYGLTF_COMPONENT_TYPE_UNSIGNED_BYTE) { + index = *reinterpret_cast(indexData + i * indexStride); + } + + indices.push_back(baseVertex + index); + } } } @@ -1232,7 +1313,7 @@ class HelloTriangleApplication { .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .image = image, - .subresourceRange = { + .subresourceRange = vk::ImageSubresourceRange { .aspectMask = image_aspect_flags, .baseMipLevel = 0, .levelCount = 1, @@ -1268,12 +1349,12 @@ class HelloTriangleApplication { .oldLayout = oldLayout, .newLayout = newLayout, .image = image, - .subresourceRange = { - vk::ImageAspectFlagBits::eColor, - 0, - mipLevels, - 0, - 1 + .subresourceRange = vk::ImageSubresourceRange{ + .aspectMask = vk::ImageAspectFlagBits::eColor, + .baseMipLevel = 0, + .levelCount = mipLevels, + .baseArrayLayer = 0, + .layerCount = 1 } }; @@ -1645,12 +1726,12 @@ class HelloTriangleApplication { .image = image, .viewType = vk::ImageViewType::e2D, .format = format, - .subresourceRange = { - aspectFlags, - 0, - mipLevels, - 0, - 1 + .subresourceRange = vk::ImageSubresourceRange{ + .aspectMask = aspectFlags, + .baseMipLevel = 0, + .levelCount = mipLevels, + .baseArrayLayer = 0, + .layerCount = 1 } }; diff --git a/textures/armor_mat_baseColor.jpeg b/textures/armor_mat_baseColor.jpeg new file mode 100644 index 0000000..0f7e9aa Binary files /dev/null and b/textures/armor_mat_baseColor.jpeg differ diff --git a/textures/armor_mat_metallicRoughness.png b/textures/armor_mat_metallicRoughness.png new file mode 100644 index 0000000..533fd6a Binary files /dev/null and b/textures/armor_mat_metallicRoughness.png differ diff --git a/textures/armor_mat_normal.png b/textures/armor_mat_normal.png new file mode 100644 index 0000000..46b4c4a Binary files /dev/null and b/textures/armor_mat_normal.png differ diff --git a/textures/body_mat_baseColor.jpeg b/textures/body_mat_baseColor.jpeg new file mode 100644 index 0000000..5b7c760 Binary files /dev/null and b/textures/body_mat_baseColor.jpeg differ diff --git a/textures/body_mat_metallicRoughness.png b/textures/body_mat_metallicRoughness.png new file mode 100644 index 0000000..0bd4aeb Binary files /dev/null and b/textures/body_mat_metallicRoughness.png differ diff --git a/textures/body_mat_normal.png b/textures/body_mat_normal.png new file mode 100644 index 0000000..7b9c5c4 Binary files /dev/null and b/textures/body_mat_normal.png differ diff --git a/textures/details_mat_baseColor.jpeg b/textures/details_mat_baseColor.jpeg new file mode 100644 index 0000000..07eb9a0 Binary files /dev/null and b/textures/details_mat_baseColor.jpeg differ diff --git a/textures/details_mat_metallicRoughness.png b/textures/details_mat_metallicRoughness.png new file mode 100644 index 0000000..15844e1 Binary files /dev/null and b/textures/details_mat_metallicRoughness.png differ diff --git a/textures/details_mat_normal.png b/textures/details_mat_normal.png new file mode 100644 index 0000000..dac53ad Binary files /dev/null and b/textures/details_mat_normal.png differ diff --git a/textures/legs_mat_baseColor.jpeg b/textures/legs_mat_baseColor.jpeg new file mode 100644 index 0000000..47bc90b Binary files /dev/null and b/textures/legs_mat_baseColor.jpeg differ diff --git a/textures/legs_mat_metallicRoughness.png b/textures/legs_mat_metallicRoughness.png new file mode 100644 index 0000000..e2ab5e9 Binary files /dev/null and b/textures/legs_mat_metallicRoughness.png differ diff --git a/textures/legs_mat_normal.png b/textures/legs_mat_normal.png new file mode 100644 index 0000000..f06a1ae Binary files /dev/null and b/textures/legs_mat_normal.png differ diff --git a/textures/texture.ktx2 b/textures/texture.ktx2 new file mode 100644 index 0000000..71f4e5b Binary files /dev/null and b/textures/texture.ktx2 differ diff --git a/textures/top_mat_baseColor.jpeg b/textures/top_mat_baseColor.jpeg new file mode 100644 index 0000000..2c12e5b Binary files /dev/null and b/textures/top_mat_baseColor.jpeg differ diff --git a/textures/top_mat_emissive.jpeg b/textures/top_mat_emissive.jpeg new file mode 100644 index 0000000..1578b9b Binary files /dev/null and b/textures/top_mat_emissive.jpeg differ diff --git a/textures/top_mat_metallicRoughness.png b/textures/top_mat_metallicRoughness.png new file mode 100644 index 0000000..cd2863e Binary files /dev/null and b/textures/top_mat_metallicRoughness.png differ diff --git a/textures/top_mat_normal.png b/textures/top_mat_normal.png new file mode 100644 index 0000000..02dcca9 Binary files /dev/null and b/textures/top_mat_normal.png differ diff --git a/textures/weapon_mat_baseColor.png b/textures/weapon_mat_baseColor.png new file mode 100644 index 0000000..685aa34 Binary files /dev/null and b/textures/weapon_mat_baseColor.png differ diff --git a/textures/weapon_mat_emissive.jpeg b/textures/weapon_mat_emissive.jpeg new file mode 100644 index 0000000..2866396 Binary files /dev/null and b/textures/weapon_mat_emissive.jpeg differ diff --git a/textures/weapon_mat_metallicRoughness.png b/textures/weapon_mat_metallicRoughness.png new file mode 100644 index 0000000..869fc39 Binary files /dev/null and b/textures/weapon_mat_metallicRoughness.png differ diff --git a/textures/weapon_mat_normal.png b/textures/weapon_mat_normal.png new file mode 100644 index 0000000..d42c067 Binary files /dev/null and b/textures/weapon_mat_normal.png differ