0
$\begingroup$

Good day everyone. I took a 3D model from the game, and it's using a few textures. I opened them, and now I'm a little bit confused.

Textures

Why does each texture end with _d or _m?

_d - is diffuse, right?

_n - Normals.

_m - Weight paint

and what about others?

I did a sample render with "Diffuse" map:

Offline Diffuse Render

There's an actual game screenshot from MLBB. Archives has *.unity3d files:

Game Screenshot

After extracting games character archive, there was a file AdditiveBackface.txt

And inside it says:

Shader "<effect>/AdditiveBackface" {
Properties {
 _diffuse ("diffuse", 2D) = "white" {}
 _intensity ("intensity", Float) = 0
 _Color ("Color", Color) = (0.5,0.5,0.5,1)
}
SubShader { 
 Tags { "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "RenderType"="Transparent" }
 Pass {
  Name "FORWARD"
  Tags { "LIGHTMODE"="ForwardBase" "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "RenderType"="Transparent" }
  ZWrite Off
  Fog { Mode Off }
  Blend One One
Program "vp" {
SubProgram "gles " {
"!!GLES


#ifdef VERTEX

attribute vec4 _glesVertex;
attribute vec4 _glesColor;
attribute vec4 _glesMultiTexCoord0;
uniform highp mat4 glstate_matrix_mvp;
varying highp vec2 xlv_TEXCOORD0;
varying highp vec4 xlv_COLOR;
void main ()
{
  gl_Position = (glstate_matrix_mvp * _glesVertex);
  xlv_TEXCOORD0 = _glesMultiTexCoord0.xy;
  xlv_COLOR = _glesColor;
}



#endif
#ifdef FRAGMENT

uniform sampler2D _diffuse;
uniform highp vec4 _diffuse_ST;
uniform highp float _intensity;
uniform highp vec4 _Color;
varying highp vec2 xlv_TEXCOORD0;
varying highp vec4 xlv_COLOR;
void main ()
{
  highp vec4 _diffuse_var_1;
  lowp vec4 tmpvar_2;
  highp vec2 P_3;
  P_3 = ((xlv_TEXCOORD0 * _diffuse_ST.xy) + _diffuse_ST.zw);
  tmpvar_2 = texture2D (_diffuse, P_3);
  _diffuse_var_1 = tmpvar_2;
  highp vec4 tmpvar_4;
  tmpvar_4.w = 1.0;
  tmpvar_4.xyz = (((
    ((xlv_COLOR.xyz * _diffuse_var_1.xyz) * (_diffuse_var_1.w * xlv_COLOR.w))
   * _intensity) * _Color.xyz) * _Color.w);
  gl_FragData[0] = tmpvar_4;
}



#endif"
}
SubProgram "gles3 " {
"!!GLES3#version 300 es


#ifdef VERTEX


in vec4 _glesVertex;
in vec4 _glesColor;
in vec4 _glesMultiTexCoord0;
uniform highp mat4 glstate_matrix_mvp;
out highp vec2 xlv_TEXCOORD0;
out highp vec4 xlv_COLOR;
void main ()
{
  gl_Position = (glstate_matrix_mvp * _glesVertex);
  xlv_TEXCOORD0 = _glesMultiTexCoord0.xy;
  xlv_COLOR = _glesColor;
}



#endif
#ifdef FRAGMENT


layout(location=0) out mediump vec4 _glesFragData[4];
uniform sampler2D _diffuse;
uniform highp vec4 _diffuse_ST;
uniform highp float _intensity;
uniform highp vec4 _Color;
in highp vec2 xlv_TEXCOORD0;
in highp vec4 xlv_COLOR;
void main ()
{
  highp vec4 _diffuse_var_1;
  lowp vec4 tmpvar_2;
  highp vec2 P_3;
  P_3 = ((xlv_TEXCOORD0 * _diffuse_ST.xy) + _diffuse_ST.zw);
  tmpvar_2 = texture (_diffuse, P_3);
  _diffuse_var_1 = tmpvar_2;
  highp vec4 tmpvar_4;
  tmpvar_4.w = 1.0;
  tmpvar_4.xyz = (((
    ((xlv_COLOR.xyz * _diffuse_var_1.xyz) * (_diffuse_var_1.w * xlv_COLOR.w))
   * _intensity) * _Color.xyz) * _Color.w);
  _glesFragData[0] = tmpvar_4;
}



#endif"
}
}
Program "fp" {
SubProgram "gles " {
"!!GLES"
}
SubProgram "gles3 " {
"!!GLES3"
}
}
 }
}
}
$\endgroup$
  • $\begingroup$ Are you sure that the license of the game permits you to use assets from the game? You might be breaking copyright laws by doing so. $\endgroup$ – Martin Z Jan 7 at 12:01
  • $\begingroup$ @MartinZ, I was writing to them, and they replied that for personal use it's ok. I also understanding texture types, because I see those types almost everywhere. $\endgroup$ – Temirlan Tauzhanov Jan 7 at 12:23
  • $\begingroup$ That's great to hear then. $\endgroup$ – Martin Z Jan 7 at 12:27
0
$\begingroup$

d is diffuse color

n is normal

s is specular color

e is emission I guess

m is mask. It's used to separate into different parts ; ie here you can see the red color isolate metallic objects, wich will probably use a different shader ; same for green (hairs)

$\endgroup$
  • $\begingroup$ As only metallic materials have a specular color, I believe s is not specular. Looking at the map, I would suggest its more like s for selection? Its flood filled big shapes, a specular map would not look like this. Also e is definatly not emission! All metallic parts would start to glow. I think its more like environment. However, both are textures specific to the game engine, not offline rendering. $\endgroup$ – morph3us Jan 6 at 12:34
  • $\begingroup$ You're right, _e is of course environement! I'm not so sure for _s, you can use a colored specular to give a stylised effect ; look at the hairs in the diffuse map, theyr painted specular is pink, like the color in _s. A screenshot of the character ingame would help us to guess ! $\endgroup$ – thibsert Jan 6 at 12:51
  • $\begingroup$ I dont know... Then the specular of the gold would be a dull brown, doesnt make much sense, or does it? Its especially wierd that one can still see the diffuse in the background in some parts, so its not needed for the whole model? I still believe its some kind of masking texture. Sometimes those files contain extra channels besides the rgba ones, maybe the mystery lies there? $\endgroup$ – morph3us Jan 6 at 12:59
  • $\begingroup$ @thibsert, Ok, I will send rendered a character with diffuse map soon $\endgroup$ – Temirlan Tauzhanov Jan 6 at 17:05
  • $\begingroup$ The more I think of it, the more I doubt ; it's definitely weird to assume it's a spec map. That doesn't looks like a mask either, because the colors are really similar to the diffuse (not to mention, _m is already clearly a mask). As far as I know, a .dds can only contain RGBA ; so unless something useful is stored in the Alpha (hard to guess given the picture : either the alpha is not shown, or is not used at all)... $\endgroup$ – thibsert Jan 6 at 17:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.