mirror of https://github.com/AxioDL/metaforce.git
Implement MP2 shader extraction presets
This commit is contained in:
parent
0c3d6c7f27
commit
5b0a4b5f60
|
@ -58,6 +58,8 @@ def make_retro_shader():
|
|||
lightmap_input.default_value = (0.0, 0.0, 0.0, 0.0)
|
||||
diffuse_input = new_grp.inputs.new('NodeSocketColor', 'Diffuse')
|
||||
diffuse_input.default_value = (0.0, 0.0, 0.0, 0.0)
|
||||
diffuse_mod_input = new_grp.inputs.new('NodeSocketColor', 'DiffuseMod')
|
||||
diffuse_mod_input.default_value = (1.0, 1.0, 1.0, 1.0)
|
||||
emissive_input = new_grp.inputs.new('NodeSocketColor', 'Emissive')
|
||||
emissive_input.default_value = (0.0, 0.0, 0.0, 0.0)
|
||||
specular_input = new_grp.inputs.new('NodeSocketColor', 'Specular')
|
||||
|
@ -72,6 +74,10 @@ def make_retro_shader():
|
|||
alpha_input.default_value = 1.0
|
||||
alpha_input.min_value = 0.0
|
||||
alpha_input.max_value = 1.0
|
||||
alpha_mod_input = new_grp.inputs.new('NodeSocketFloatFactor', 'AlphaMod')
|
||||
alpha_mod_input.default_value = 1.0
|
||||
alpha_mod_input.min_value = 0.0
|
||||
alpha_mod_input.max_value = 1.0
|
||||
new_grp.use_fake_user = True
|
||||
|
||||
# Group inputs
|
||||
|
@ -108,6 +114,17 @@ def make_retro_shader():
|
|||
new_shader_model_mix1 = new_grp.nodes.new('ShaderNodeMixShader')
|
||||
new_shader_model_mix1.location = (-760, 340)
|
||||
|
||||
# Multiply (Multiples diffuse with diffusemod)
|
||||
diffuse_mult = new_grp.nodes.new('ShaderNodeMixRGB')
|
||||
diffuse_mult.location = (-1094, 122)
|
||||
diffuse_mult.blend_type = 'MULTIPLY'
|
||||
diffuse_mult.inputs['Fac'].default_value = 1.0
|
||||
|
||||
# Multiply (Multiples alpha with alphamod)
|
||||
alpha_mult = new_grp.nodes.new('ShaderNodeMath')
|
||||
alpha_mult.location = (-1094, -178)
|
||||
alpha_mult.operation = 'MULTIPLY'
|
||||
|
||||
# Multiply (Multiplies static lightmap with diffuse)
|
||||
lightmap_mult = new_grp.nodes.new('ShaderNodeMixRGB')
|
||||
lightmap_mult.location = (-944, 122)
|
||||
|
@ -164,17 +181,21 @@ def make_retro_shader():
|
|||
mat_out.location = (150, -88)
|
||||
|
||||
# Links
|
||||
new_grp.links.new(grp_in.outputs['Diffuse'], diffuse_mult.inputs['Color1'])
|
||||
new_grp.links.new(grp_in.outputs['DiffuseMod'], diffuse_mult.inputs['Color2'])
|
||||
new_grp.links.new(grp_in.outputs['Alpha'], alpha_mult.inputs[0])
|
||||
new_grp.links.new(grp_in.outputs['AlphaMod'], alpha_mult.inputs[1])
|
||||
new_grp.links.new(grp_in.outputs['Lightmap'], lightmap_mult.inputs['Color1'])
|
||||
new_grp.links.new(grp_in.outputs['Diffuse'], lightmap_mult.inputs['Color2'])
|
||||
new_grp.links.new(grp_in.outputs['Diffuse'], diffuse_bdsf.inputs['Color'])
|
||||
new_grp.links.new(grp_in.outputs['Diffuse'], principled_bsdf.inputs['Base Color'])
|
||||
new_grp.links.new(diffuse_mult.outputs['Color'], lightmap_mult.inputs['Color2'])
|
||||
new_grp.links.new(diffuse_mult.outputs['Color'], diffuse_bdsf.inputs['Color'])
|
||||
new_grp.links.new(diffuse_mult.outputs['Color'], principled_bsdf.inputs['Base Color'])
|
||||
new_grp.links.new(grp_in.outputs['Emissive'], emissive_add_shader.inputs[0])
|
||||
new_grp.links.new(grp_in.outputs['Specular'], specular_mult.inputs['Color1'])
|
||||
new_grp.links.new(grp_in.outputs['Specular'], principled_bsdf.inputs['Specular'])
|
||||
new_grp.links.new(grp_in.outputs['ExtendedSpecular'], extended_specular_mult.inputs['Color1'])
|
||||
new_grp.links.new(grp_in.outputs['Reflection'], specular_mult.inputs['Color2'])
|
||||
new_grp.links.new(grp_in.outputs['Reflection'], extended_specular_mult.inputs['Color2'])
|
||||
new_grp.links.new(grp_in.outputs['Alpha'], alpha_mix.inputs['Fac'])
|
||||
new_grp.links.new(alpha_mult.outputs[0], alpha_mix.inputs['Fac'])
|
||||
new_grp.links.new(new_shader_model.outputs['Value'], new_shader_model_mix1.inputs[0])
|
||||
new_grp.links.new(diffuse_bdsf.outputs['BSDF'], new_shader_model_mix1.inputs[1])
|
||||
new_grp.links.new(grp_in.outputs['Specular'], invert.inputs['Color'])
|
||||
|
|
|
@ -524,6 +524,9 @@ static void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupI
|
|||
/* Select appropriate root shader and link textures */
|
||||
uint32_t hash = _HashTextureConfig(material);
|
||||
switch (hash) {
|
||||
case 0x03FEE002: /* RetroShader: Diffuse, Emissive, Reflection, Alpha=1.0 */
|
||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex, "Reflection"_tex);
|
||||
break;
|
||||
case 0x0473AE40: /* RetroShader: Lightmap, Diffuse, Emissive, Alpha=1.0 */
|
||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Emissive"_tex);
|
||||
break;
|
||||
|
@ -531,6 +534,9 @@ static void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupI
|
|||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex, WhiteColorLink("Specular"),
|
||||
"Reflection"_tex);
|
||||
break;
|
||||
case 0x07AA75D7: /* RetroShader: Diffuse, Emissive, Alpha=DiffuseAlpha */
|
||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex, TexLink("Alpha", 0, true));
|
||||
break;
|
||||
case 0x0879D346: /* RetroShader: KColorDiffuse, Alpha=Texture */
|
||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_kcol, "Alpha"_tex);
|
||||
break;
|
||||
|
@ -549,6 +555,10 @@ static void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupI
|
|||
case 0x129B8578: /* RetroShader: KColorDiffuse, Emissive, Alpha=KAlpha */
|
||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_kcol, "Emissive"_tex, "Alpha"_kcola);
|
||||
break;
|
||||
case 0x15A00948: /* RetroShader: Diffuse, Emissive, Specular, ExtendedSpecular, Reflection, Alpha=1.0 */
|
||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex, "Specular"_tex, "ExtendedSpecular"_tex,
|
||||
"Reflection"_tex);
|
||||
break;
|
||||
case 0x15A3E6E5: /* RetroShader: Diffuse, Alpha=KAlpha */
|
||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Alpha"_kcola);
|
||||
break;
|
||||
|
@ -568,12 +578,6 @@ static void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupI
|
|||
case 0x2523A379: /* RetroDynamicShader: Emissive*Dynamic, Specular, Reflection, Alpha=1.0 */
|
||||
_GenerateRootShader(out, "RetroDynamicShader", "Emissive"_tex, "Specular"_tex, "Reflection"_tex);
|
||||
break;
|
||||
case 0x07AA75D7:
|
||||
_GenerateRootShader(out, "RetroDynamicShader", "Diffuse"_tex, "Emissive"_tex);
|
||||
break;
|
||||
case 0x03FEE002:
|
||||
_GenerateRootShader(out, "RetroDynamicShader", "Diffuse"_tex, "Emissive"_tex, "Specular"_tex);
|
||||
break;
|
||||
case 0x25E85017: /* RetroShader: Lightmap, KColorDiffuse, Alpha=KAlpha */
|
||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_kcol, "Alpha"_kcola);
|
||||
break;
|
||||
|
@ -603,6 +607,9 @@ static void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupI
|
|||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Specular"_tex, "Reflection"_tex,
|
||||
"IndirectTex"_tex, "Alpha"_kcola);
|
||||
break;
|
||||
case 0x4184FBCA: /* RetroShader: Lightmap, Diffuse, Emissive, DiffuseAlpha */
|
||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Emissive"_tex, TexLink("Alpha", 1, true));
|
||||
break;
|
||||
case 0x47ECF3ED: /* RetroShader: Diffuse, Specular, Reflection, Emissive, Alpha=1.0 */
|
||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Specular"_tex, "Reflection"_tex, "Emissive"_tex);
|
||||
break;
|
||||
|
@ -616,112 +623,10 @@ static void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupI
|
|||
case 0x54A92F25: /* RetroShader: ObjLightmap, KColorDiffuse, Alpha=KAlpha */
|
||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_kcol, "Alpha"_kcola);
|
||||
break;
|
||||
case 0x72BEDDAC:
|
||||
/* TODO: Properly implement TEV configuration:
|
||||
A:CC_ZERO B:CC_RASC C:CC_TEXC D:CC_ZERO -> TEVREG0 | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVREG0
|
||||
A:CC_ZERO B:CC_C0 C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_TEXA -> TEVPREV
|
||||
A:CC_ZERO B:CC_TEXC C:CC_ONE D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVPREV
|
||||
A:CC_ZERO B:CC_ZERO C:CC_ZERO D:CC_TEXC -> TEVREG2 | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVREG2
|
||||
A:CC_ZERO B:CC_C2 C:CC_TEXC D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_APREV -> TEVPREV
|
||||
HasIndirect: false HasLightmap: true
|
||||
*/
|
||||
case 0xF4DA0A86:
|
||||
/* TODO: Properly implement TEV configuration:
|
||||
A:CC_ZERO B:CC_RASC C:CC_KONST D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVPREV
|
||||
A:CC_ZERO B:CC_ONE C:CC_TEXC D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_APREV -> TEVPREV
|
||||
HasIndirect: false HasLightmap: false
|
||||
*/
|
||||
case 0xF345C16E:
|
||||
/* TODO: Properly implement TEV configuration:
|
||||
A:CC_ZERO B:CC_ONE C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVPREV
|
||||
A:CC_ZERO B:CC_ONE C:CC_TEXC D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_APREV -> TEVPREV
|
||||
HasIndirect: false HasLightmap: false
|
||||
*/
|
||||
case 0x8C562AB1:
|
||||
/* TODO: Properly implement TEV configuration:
|
||||
A:CC_ZERO B:CC_RASC C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVPREV
|
||||
A:CC_ZERO B:CC_ONE C:CC_TEXC D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_APREV -> TEVPREV
|
||||
HasIndirect: false HasLightmap: false
|
||||
*/
|
||||
case 0xE92F1340:
|
||||
/* TODO: Properly implement TEV configuration:
|
||||
A:CC_ZERO B:CC_RASC C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_TEXA -> TEVPREV
|
||||
A:CC_ZERO B:CC_ZERO C:CC_ZERO D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_TEXA C:CA_APREV D:CA_ZERO -> TEVPREV
|
||||
HasIndirect: false HasLightmap: false
|
||||
*/
|
||||
case 0xCE06F3F2:
|
||||
/* TODO: Properly implement TEV configuration:
|
||||
A:CC_ZERO B:CC_ONE C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVPREV
|
||||
A:CC_ZERO B:CC_ZERO C:CC_ZERO D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_TEXA C:CA_APREV D:CA_ZERO -> TEVPREV
|
||||
HasIndirect: false HasLightmap: false
|
||||
*/
|
||||
case 0xC0E3FF1F:
|
||||
/* TODO: Properly implement TEV configuration:
|
||||
A:CC_ZERO B:CC_RASC C:CC_KONST D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVPREV
|
||||
A:CC_ZERO B:CC_ZERO C:CC_ZERO D:CC_TEXC -> TEVREG2 | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVREG2
|
||||
A:CC_ZERO B:CC_C2 C:CC_TEXC D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_APREV -> TEVPREV
|
||||
HasIndirect: false HasLightmap: false
|
||||
*/
|
||||
case 0xFC2761B8:
|
||||
/* TODO: Properly implement TEV configuration:
|
||||
A:CC_ZERO B:CC_C1 C:CC_TEXC D:CC_RASC -> TEVREG0 | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVREG0
|
||||
A:CC_ZERO B:CC_C0 C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_TEXA -> TEVPREV
|
||||
A:CC_ZERO B:CC_ZERO C:CC_ZERO D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_TEXA C:CA_APREV D:CA_ZERO -> TEVPREV
|
||||
HasIndirect: false HasLightmap: true
|
||||
*/
|
||||
case 0xE64D1085:
|
||||
/* TODO: Properly implement TEV configuration:
|
||||
A:CC_ZERO B:CC_C1 C:CC_TEXC D:CC_RASC -> TEVREG0 | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVREG0
|
||||
A:CC_ZERO B:CC_C0 C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_TEXA -> TEVPREV
|
||||
A:CC_ZERO B:CC_TEXC C:CC_ONE D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVPREV
|
||||
A:CC_ZERO B:CC_ONE C:CC_TEXC D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_APREV -> TEVPREV
|
||||
HasIndirect: false HasLightmap: true
|
||||
*/
|
||||
case 0xB26E9E2E:
|
||||
/* TODO: Properly implement TEV configuration:
|
||||
A:CC_ZERO B:CC_RASC C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_TEXA -> TEVPREV
|
||||
A:CC_ZERO B:CC_TEXC C:CC_ONE D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVPREV
|
||||
A:CC_ZERO B:CC_ZERO C:CC_ZERO D:CC_TEXC -> TEVREG2 | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVREG2
|
||||
A:CC_ZERO B:CC_RASC C:CC_TEXC D:CC_C2 -> TEVREG2 | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVREG2
|
||||
HasIndirect: false HasLightmap: false
|
||||
*/
|
||||
case 0x4184FBCA:
|
||||
/* TODO: Properly implement TEV configuration:
|
||||
A:CC_ZERO B:CC_C1 C:CC_TEXC D:CC_RASC -> TEVREG0 | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVREG0
|
||||
A:CC_ZERO B:CC_C0 C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_TEXA -> TEVPREV
|
||||
A:CC_ZERO B:CC_ONE C:CC_TEXC D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_APREV -> TEVPREV
|
||||
HasIndirect: false HasLightmap: true
|
||||
*/
|
||||
case 0x81106196:
|
||||
/* TODO: Properly implement TEV configuration:
|
||||
A:CC_ZERO B:CC_C1 C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVPREV
|
||||
HasIndirect: false HasLightmap: false
|
||||
*/
|
||||
case 0x15A00948:
|
||||
/* TODO: Properly implement TEV configuration:
|
||||
A:CC_ZERO B:CC_RASC C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_TEXA -> TEVPREV
|
||||
A:CC_ZERO B:CC_TEXC C:CC_ONE D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVPREV
|
||||
A:CC_ZERO B:CC_ZERO C:CC_ZERO D:CC_TEXC -> TEVREG2 | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVREG2
|
||||
A:CC_ZERO B:CC_RASC C:CC_TEXC D:CC_C2 -> TEVREG2 | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVREG2
|
||||
A:CC_ZERO B:CC_C2 C:CC_TEXC D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_APREV -> TEVPREV
|
||||
HasIndirect: false HasLightmap: false
|
||||
*/
|
||||
case 0xFFF3CEBB:
|
||||
/* TODO: Properly implement TEV configuration:
|
||||
A:CC_ZERO B:CC_C1 C:CC_TEXC D:CC_RASC -> TEVREG0 | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVREG0
|
||||
A:CC_ZERO B:CC_C0 C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_TEXA -> TEVPREV
|
||||
A:CC_ZERO B:CC_TEXC C:CC_ONE D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVPREV
|
||||
A:CC_ZERO B:CC_ZERO C:CC_ZERO D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_TEXA C:CA_APREV D:CA_ZERO -> TEVPREV
|
||||
HasIndirect: false HasLightmap: true
|
||||
*/
|
||||
case 0x58BAA415:
|
||||
/* TODO: Properly implement TEV configuration:
|
||||
A:CC_ZERO B:CC_C1 C:CC_TEXC D:CC_RASC -> TEVREG0 | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVREG0
|
||||
A:CC_ZERO B:CC_C0 C:CC_TEXC D:CC_ZERO -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_TEXA -> TEVPREV
|
||||
A:CC_ZERO B:CC_TEXC C:CC_ONE D:CC_CPREV -> TEVPREV | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVPREV
|
||||
A:CC_ZERO B:CC_ZERO C:CC_ZERO D:CC_TEXC -> TEVREG2 | A:CA_ZERO B:CA_ZERO C:CA_ZERO D:CA_KONST -> TEVREG2
|
||||
HasIndirect: false HasLightmap: true
|
||||
*/
|
||||
case 0x58BAA415: /* RetroShader: Lightmap, Diffuse, Emissive, Alpha=1.0 */
|
||||
// TODO: Last stage assigns into unused reg2, perhaps for runtime material mod?
|
||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Emissive"_tex);
|
||||
break;
|
||||
case 0x54C6204C:
|
||||
_GenerateRootShader(out, "RetroShader");
|
||||
break;
|
||||
|
@ -756,6 +661,10 @@ static void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupI
|
|||
case 0x7252CB90: /* RetroShader: Lightmap, Diffuse, Alpha=KAlpha */
|
||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Alpha"_kcola);
|
||||
break;
|
||||
case 0x72BEDDAC: /* RetroShader: DiffuseMod, Diffuse, Emissive, Specular, Reflection Alpha=1.0 */
|
||||
_GenerateRootShader(out, "RetroShader", "DiffuseMod"_tex, "Diffuse"_tex, "Emissive"_tex, "Specular"_tex,
|
||||
"Reflection"_tex);
|
||||
break;
|
||||
case 0x76BEA57E: /* RetroShader: Lightmap, Diffuse, Emissive, Specular, Reflection, Alpha=1.0, IndirectTex */
|
||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Emissive"_tex, "Specular"_tex,
|
||||
"Reflection"_tex, "IndirectTex"_tex);
|
||||
|
@ -763,6 +672,9 @@ static void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupI
|
|||
case 0x7D6A4487: /* RetroShader: Diffuse, Specular, Reflection, Alpha=DiffuseAlpha */
|
||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Specular"_tex, "Reflection"_tex, TexLink("Alpha", 0, true));
|
||||
break;
|
||||
case 0x81106196: /* RetroDynamicShader: Emissive, Alpha=1.0 */
|
||||
_GenerateRootShader(out, "RetroDynamicShader", "Emissive"_tex);
|
||||
break;
|
||||
case 0x84319328: /* RetroShader: Reflection, UnusedSpecular?, Alpha=1.0 */
|
||||
_GenerateRootShader(out, "RetroShader", WhiteColorLink("Specular"), "Reflection"_tex);
|
||||
break;
|
||||
|
@ -770,6 +682,9 @@ static void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupI
|
|||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Specular"_tex, "Reflection"_tex, "IndirectTex"_tex,
|
||||
TexLink("Alpha", 0, true));
|
||||
break;
|
||||
case 0x8C562AB1: /* RetroShader: Diffuse, Emissive, Alpha=1.0 */
|
||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex);
|
||||
break;
|
||||
case 0x8E916C01: /* RetroShader: NULL, all inputs 0 */
|
||||
_GenerateRootShader(out, "RetroShader");
|
||||
break;
|
||||
|
@ -788,6 +703,13 @@ static void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupI
|
|||
case 0xA187C630: /* RetroShader: Diffuse, Emissive, UnusedReflection?, Alpha=1.0 */
|
||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex);
|
||||
break;
|
||||
case 0xB26E9E2E: /* RetroShader: Diffuse, Emissive, Alpha=1.0 */
|
||||
// TODO: Last two stages assign into unused reg2, perhaps for runtime material mod?
|
||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex);
|
||||
break;
|
||||
case 0xC0E3FF1F: /* RetroShader: KColorDiffuse, Specular, Reflection, Alpha=KAlpha */
|
||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_kcol, "Specular"_tex, "Reflection"_tex, "Alpha"_kcola);
|
||||
break;
|
||||
case 0xC138DCFA: /* RetroShader: Diffuse, Emissive, Alpha=1.0 */
|
||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex);
|
||||
break;
|
||||
|
@ -804,12 +726,19 @@ static void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupI
|
|||
case 0xCD92D4C5: /* RetroShader: Diffuse, Reflection, Alpha=KAlpha */
|
||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, WhiteColorLink("Specular"), "Reflection"_tex, "Alpha"_kcola);
|
||||
break;
|
||||
case 0xCE06F3F2: /* RetroShader: Diffuse, Alpha */
|
||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, TexLink("Alpha", 1, true));
|
||||
break;
|
||||
case 0xD73E7728: /* RetroShader: ObjLightmap, Diffuse, Alpha=DiffuseAlpha */
|
||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, TexLink("Alpha", 1, true));
|
||||
break;
|
||||
case 0xDB8F01AD: /* RetroDynamicShader: Diffuse*Dynamic, Emissive*Dynamic, UnusedSpecular?, Alpha=1.0 */
|
||||
_GenerateRootShader(out, "RetroDynamicShader", "Diffuse"_tex, "Emissive"_tex);
|
||||
break;
|
||||
case 0xE64D1085: /* RetroShader: Lightmap, Diffuse, Emissive, Reflection, Alpha=DiffuseAlpha */
|
||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Emissive"_tex, "Reflection"_tex,
|
||||
TexLink("Alpha", 1, true));
|
||||
break;
|
||||
case 0xE6784B10: /* RetroShader: Lightmap, Diffuse, Specular, Reflection, Alpha=DiffuseAlpha, IndirectTex */
|
||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Specular"_tex, "Reflection"_tex,
|
||||
"IndirectTex"_tex, TexLink("Alpha", 1, true));
|
||||
|
@ -817,6 +746,9 @@ static void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupI
|
|||
case 0xE68FF182: /* RetroShader: Diffuse, Emissive, Specular, Reflection, Alpha=1.0 */
|
||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Emissive"_tex, "Specular"_tex, "Reflection"_tex);
|
||||
break;
|
||||
case 0xE92F1340: /* RetroShader: Diffuse, Alpha=DiffuseAlpha*AlphaMod */
|
||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, TexLink("Alpha", 0, true), TexLink("AlphaMod", 1, true));
|
||||
break;
|
||||
case 0xEB4645CF: /* RetroDynamicAlphaShader: Diffuse*Dynamic, Alpha=DiffuseAlpha*Dynamic */
|
||||
_GenerateRootShader(out, "RetroDynamicAlphaShader", "Diffuse"_tex, TexLink("Alpha", 0, true));
|
||||
break;
|
||||
|
@ -827,6 +759,12 @@ static void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupI
|
|||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Specular"_tex, "ExtendedSpecular"_tex,
|
||||
"Reflection"_tex, TexLink("Alpha", 1, true));
|
||||
break;
|
||||
case 0xF345C16E: /* RetroShader: Emissive, Reflection, Alpha=1.0 */
|
||||
_GenerateRootShader(out, "RetroShader", "Emissive"_tex, "Reflection"_tex);
|
||||
break;
|
||||
case 0xF4DA0A86: /* RetroShader: KColorDiffuse, Emissive, Alpha=KAlpha */
|
||||
_GenerateRootShader(out, "RetroShader", "Diffuse"_kcol, "Emissive"_tex, "Alpha"_kcola); break;
|
||||
break;
|
||||
case 0xF559DB08: /* RetroShader: Lightmap, Diffuse, Emissive, Specular, Reflection, Alpha=1.0 */
|
||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Emissive"_tex, "Specular"_tex,
|
||||
"Reflection"_tex);
|
||||
|
@ -834,9 +772,16 @@ static void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupI
|
|||
case 0xF9324367: /* RetroShader: Lightmap, Diffuse, Emissive, Alpha=1.0 */
|
||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Emissive"_tex);
|
||||
break;
|
||||
case 0xFC2761B8: /* RetroShader: Lightmap, Diffuse, Alpha=DiffuseAlpha*AlphaMod */
|
||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, TexLink("Alpha", 1, true),
|
||||
TexLink("AlphaMod", 2, true));
|
||||
break;
|
||||
case 0xFD95D7FD: /* RetroShader: ObjLightmap, Diffuse, Alpha=DiffuseAlpha */
|
||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, TexLink("Alpha", 1, true));
|
||||
break;
|
||||
case 0xFFF3CEBB: /* RetroShader: Lightmap, Diffuse, Emissive, Alpha */
|
||||
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Emissive"_tex, TexLink("Alpha", 3, true));
|
||||
break;
|
||||
default:
|
||||
_DescribeTEV(material);
|
||||
Log.report(logvisor::Fatal, fmt("Unable to resolve shader hash {:08X}\n"), hash);
|
||||
|
|
2
hecl
2
hecl
|
@ -1 +1 @@
|
|||
Subproject commit db10f0c2ca2ea4ab4b779798b041b3bae0d79937
|
||||
Subproject commit 138328b8f617071cbe9457f04e9cbb31cef1975e
|
Loading…
Reference in New Issue