From ed8030d697329b6eb13ea10e9aaf66ee85dce307 Mon Sep 17 00:00:00 2001 From: Daan Vanden Bosch Date: Fri, 3 Jan 2020 11:14:15 +0100 Subject: [PATCH] Added textures to more character class models in model viewer. --- src/viewer/model/CharacterClassModel.ts | 6 ++--- src/viewer/rendering/Model3DRenderer.ts | 1 + src/viewer/stores/Model3DStore.ts | 34 ++++++++++++++++++++----- 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/src/viewer/model/CharacterClassModel.ts b/src/viewer/model/CharacterClassModel.ts index 31df6024..a1d84951 100644 --- a/src/viewer/model/CharacterClassModel.ts +++ b/src/viewer/model/CharacterClassModel.ts @@ -9,9 +9,9 @@ export class CharacterClassModel { /** * Can be indexed with {@link SectionId} */ - readonly section_id_tex_ids: number[]; + readonly section_id_tex_ids: readonly number[]; readonly body_tex_ids: readonly number[]; - readonly head_tex_ids: readonly number[]; + readonly head_tex_ids: readonly (number | undefined)[]; readonly hair_tex_ids: readonly (number | undefined)[]; readonly accessory_tex_ids: readonly (number | undefined)[]; @@ -22,7 +22,7 @@ export class CharacterClassModel { hair_styles_with_accessory: Set; section_id_tex_id: number; body_tex_ids: number[]; - head_tex_ids?: number[]; + head_tex_ids?: (number | undefined)[]; hair_tex_ids?: (number | undefined)[]; accessory_tex_ids?: (number | undefined)[]; }) { diff --git a/src/viewer/rendering/Model3DRenderer.ts b/src/viewer/rendering/Model3DRenderer.ts index af284f47..2418b959 100644 --- a/src/viewer/rendering/Model3DRenderer.ts +++ b/src/viewer/rendering/Model3DRenderer.ts @@ -1,4 +1,5 @@ import { + AdditiveBlending, AnimationClip, AnimationMixer, Clock, diff --git a/src/viewer/stores/Model3DStore.ts b/src/viewer/stores/Model3DStore.ts index 13bafb06..1028b6d5 100644 --- a/src/viewer/stores/Model3DStore.ts +++ b/src/viewer/stores/Model3DStore.ts @@ -57,7 +57,9 @@ export class Model3DStore extends Store { hair_style_count: 10, hair_styles_with_accessory: new Set(), section_id_tex_id: 299, - body_tex_ids: [], + body_tex_ids: [13, 0, 1, 2, 3, 277, 281], + head_tex_ids: [235, 239], + hair_tex_ids: [260, 259], }), new CharacterClassModel({ name: "HUcast", @@ -65,7 +67,10 @@ export class Model3DStore extends Store { hair_style_count: 0, hair_styles_with_accessory: new Set(), section_id_tex_id: 275, - body_tex_ids: [], + body_tex_ids: [0, 1, 2, 250], + // Eyes don't look correct because NJCM material chunks (which contain alpha blending + // details) aren't parsed yet. Material.blending should be AdditiveBlending. + head_tex_ids: [3, 4], }), new CharacterClassModel({ name: "HUcaseal", @@ -82,7 +87,10 @@ export class Model3DStore extends Store { hair_style_count: 10, hair_styles_with_accessory: new Set([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]), section_id_tex_id: 197, - body_tex_ids: [], + body_tex_ids: [4, 5, 6, 179], + head_tex_ids: [126, 127], + hair_tex_ids: [166, 167], + accessory_tex_ids: [undefined, undefined, 2], }), new CharacterClassModel({ name: "RAmarl", @@ -110,7 +118,9 @@ export class Model3DStore extends Store { hair_style_count: 0, hair_styles_with_accessory: new Set(), section_id_tex_id: 375, - body_tex_ids: [], + body_tex_ids: [350, 0, 1, 2], + head_tex_ids: [3], + hair_tex_ids: [4], }), new CharacterClassModel({ name: "FOmar", @@ -129,7 +139,10 @@ export class Model3DStore extends Store { hair_style_count: 10, hair_styles_with_accessory: new Set([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]), section_id_tex_id: 326, - body_tex_ids: [], + body_tex_ids: [0, 2, 1, 322], + head_tex_ids: [288], + hair_tex_ids: [undefined, undefined, 308], + accessory_tex_ids: [3, 4], }), new CharacterClassModel({ name: "FOnewm", @@ -137,7 +150,11 @@ export class Model3DStore extends Store { hair_style_count: 10, hair_styles_with_accessory: new Set([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]), section_id_tex_id: 344, - body_tex_ids: [], + body_tex_ids: [4, 340, 0, 5], + head_tex_ids: [306, 310], + hair_tex_ids: [undefined, undefined, 330], + // ID 16 for glasses is incorrect but looks decent. + accessory_tex_ids: [6, 16, 330], }), new CharacterClassModel({ name: "FOnewearl", @@ -145,7 +162,10 @@ export class Model3DStore extends Store { hair_style_count: 10, hair_styles_with_accessory: new Set([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]), section_id_tex_id: 505, - body_tex_ids: [], + body_tex_ids: [1, 0, 2, 501], + head_tex_ids: [472, 468], + hair_tex_ids: [undefined, undefined, 492], + accessory_tex_ids: [12, 13], }), ];