mirror of https://github.com/xemu-project/xemu.git
Fix Texgen by doing skinning fixup later
This commit is contained in:
parent
58411243d1
commit
8c445b5c69
|
@ -2682,7 +2682,7 @@ static ShaderBinding* generate_shaders(const ShaderState state)
|
||||||
qstring_append_fmt(vertex_shader_code, "/* Skinning mode %d */\n",
|
qstring_append_fmt(vertex_shader_code, "/* Skinning mode %d */\n",
|
||||||
state.skinning);
|
state.skinning);
|
||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
qstring_append(vertex_shader_code, "vec4 tPosition = position;\n");
|
qstring_append(vertex_shader_code, "vec4 tPosition = position * modelViewMat0;\n");
|
||||||
/* FIXME: Is the normal still transformed? */
|
/* FIXME: Is the normal still transformed? */
|
||||||
qstring_append(vertex_shader_code, "vec3 tNormal = (vec4(normal, 0.0) * invModelViewMat0).xyz;\n");
|
qstring_append(vertex_shader_code, "vec3 tNormal = (vec4(normal, 0.0) * invModelViewMat0).xyz;\n");
|
||||||
} else {
|
} else {
|
||||||
|
@ -2771,6 +2771,11 @@ static ShaderBinding* generate_shaders(const ShaderState state)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If skinning is off the composite matrix already includes the MV matrix */
|
||||||
|
if (state.skinning == SKINNING_OFF) {
|
||||||
|
qstring_append(vertex_shader_code, "tPosition = position;\n");
|
||||||
|
}
|
||||||
|
|
||||||
qstring_append(vertex_shader_code,
|
qstring_append(vertex_shader_code,
|
||||||
" gl_Position = invViewport * (tPosition * compositeMat);\n"
|
" gl_Position = invViewport * (tPosition * compositeMat);\n"
|
||||||
/* temp hack: the composite matrix includes the view transform... */
|
/* temp hack: the composite matrix includes the view transform... */
|
||||||
|
|
Loading…
Reference in New Issue