New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation on the web layer of model data #422

Open
lowlines opened this Issue Feb 23, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@lowlines
Copy link

lowlines commented Feb 23, 2018

Would it be possible to track down any documentation made for parsing the web layer of model data?

One issue is specifically mentioned in another issue I made a few months back to do with how the web layer determines which stage parts to render. The original Spasm source code I looked at basically had a hack implementation, so I'm guessing this part would require more information about how the game renders stage parts in order to implement it properly.
#297

The other areas lacking in documentation is the renderMeshPart data, notably what all the bit flags mean in the "flags" property, the purpose of each "lod_category" as well as the "shader.type" property. I've had varying success getting specific effects to render correctly, however it's all guesswork.

{
	changeColorIndex: 2
	externalIdentifier: 0
	flags: 37
	gearDyeSlot: 1
	indexCount: 77
	indexMax: 36
	indexMin: 0
	indexStart: 1
	lodCategory: {value: 8, name: "_lod_category_23"}
	lodRun: 1
	primitiveType: 5
	shader: {
		staticTextures: ["3156953489_vfx_vex_evileye_illum"]
		type: 8
	}
	useInvestmentDecal: false
	usePrimaryColor: true
	variantShaderIndex: -1
}

The last area lies with the gear dyes. This section changed between Destiny 1 and Destiny 2 (notable with the change over to physically based rendering), so there are likely two versions of this to get dyes properly rendering. The "material_properties" has a lot of values that just aren't clear from their names as to what they do and I suspect some of the 4x1 arrays are actually packed values.

// Destiny 1 Dye
{
	blend_mode: 0
	cloth: false
	hash: 3258883206
	investment_hash: 3338626694
	material_properties: {
		decal_alpha_map_transform:  [1, 1, 0, 0]
		decal_blend_option: 1
		detail_normal_contribution_strength: [0.5, 0.5, 0.5, 0.5]
		detail_transform: [3.5, 3.5, 0, 0]
		primary_color: [0.009667, 0.009667, 0.011503, 1]
		secondary_color: [0.037901, 0.037901, 0.037901, 1]
		specular_properties: [0.546078, 139, 1, 0]
		subsurface_scattering_strength: [32.3, 1, 1, 1]
	}
	slot_type_index: 1
	textures: {
		decal: {name: ""}
		diffuse: {name: "2164797681_128_grey_128_alpha_linear_dif", reference_id: "dfa5a1a0313319f22ca0ce376416d1bf"}
		normal: {name: "2164797681_default_normal", reference_id: "b55c062f45e1082ea2f493e9f8181690"}
		primary_diffuse: {name: "_222FF_2164797681_128_grey_128_alpha_linear_dif", reference_id: "482ff84bbfd00bfcb13f1caf36b2dab4"}
		secondary_diffuse: {name: "_999FF_2164797681_128_grey_128_alpha_linear_dif", reference_id: "f72dc1c4951151c08c2ba3ca840e1a0f"}
	}
	variant:0
}
// Destiny 2 Dye
{
	cloth: false
	hash: 617740665
	investment_hash: 2351485817
	material_properties: {
		detail_diffuse_transform: [1, 1, 0, 0]
		detail_normal_transform: [1, 1, 0, 0]
		emissive_pbr_params: [0, 0, 0, 0]
		emissive_tint_color_and_intensity_bias: [0.014085, 1, 1, 0.906853]
		lobe_pbr_params: [0.55, 0.3, 0.921954, 0]
		primary_albedo_tint: [0.059138, 0.059138, 0.059138, 1]
		primary_material_params: [1, 1, 1, 0]
		primary_roughness_remap: [0.5, 0.4, 0, 1]
		secondary_albedo_tint: [0.728814, 0.728814, 0.728814, 1]
		secondary_material_params: [1, 1, 1, 0]
		secondary_roughness_remap: [0.4, 0.6, 0, 1]
		spec_aa_xform: [1.992188, -1, 0.4, 0]
		specular_properties: [0.00098, 0, 1, 0]
		subsurface_scattering_strength_and_emissive: [32.3, 1, 27.6528473, 0]
		tint_pbr_params: [0.187256, 0, 0, 1.2304]
		wear_remap: [-1, 2, 0, 1]
		worn_albedo_tint: [0.198106, 0.198106, 0.198106, 1]
		worn_material_parameters: [1, 1, 1, 0]
		worn_roughness_remap: [1, 1, 1, 1]
	}
	slot_type_index: 0
	textures: {
		diffuse: {name: "2690020957_128_grey_128_alpha_linear_dif", reference_id: "dfa5a1a0313319f22ca0ce376416d1bf"}
		normal: {name: "2690020957_default_normal", reference_id: "8449751fdc08e4e1abb50696b1300fb0"}
		primary_diffuse: {name: "_FFFFFFFF_2690020957_128_grey_128_alpha_linear_dif", reference_id: "dfa5a1a0313319f22ca0ce376416d1bf"}
		secondary_diffuse: {name: "_FFFFFFFF_2690020957_128_grey_128_alpha_linear_dif", reference_id: "dfa5a1a0313319f22ca0ce376416d1bf"}
	}
}

If I can get any documentation on this it'll help greatly with improving the three.js plugin I've been working on for use in 3rd party projects.
https://github.com/lowlines/three-tgx-loader

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment