Projection mapping : Initialize z as 1.0f

This commit is contained in:
raven02 2013-10-01 08:32:33 +08:00
parent 80ae3f247f
commit 7f3a3ccd6c
2 changed files with 3 additions and 3 deletions

View File

@ -469,7 +469,7 @@ void TransformDrawEngine::SoftwareTransformAndDraw(
float v[3] = {0, 0, 0};
float c0[4] = {1, 1, 1, 1};
float c1[4] = {0, 0, 0, 0};
float uv[3] = {0, 0, 0};
float uv[3] = {0, 0, 1};
float fogCoef = 1.0f;
if (throughmode) {
@ -658,7 +658,7 @@ void TransformDrawEngine::SoftwareTransformAndDraw(
}
uv[0] = uv[0] * widthFactor;
uv[1] = uv[1] * heightFactor;
// Transform the coord by the view matrix.
Vec3ByMatrix43(v, out, gstate.viewMatrix);
fogCoef = (v[2] + fog_end) * fog_slope;

View File

@ -557,9 +557,9 @@ void GenerateVertexShader(int prim, u32 vertType, char *buffer, bool useHWTransf
temp_tc = "vec4(0.0, 0.0, 1.0, 1.0)";
break;
}
// Transform by texture matrix. XYZ as we are doing projection mapping.
WRITE(p, " v_texcoord = (u_texmtx * %s).xyz * vec3(u_uvscaleoffset.xy, 1.0);\n", temp_tc.c_str());
}
// Transform by texture matrix. XYZ as we are doing projection mapping.
break;
case GE_TEXMAP_ENVIRONMENT_MAP: // Shade mapping - use dots from light sources.