Render skyboxes with rotation-only view matrix, a few new CDrawUtil overloads, other rendering tweaks

This commit is contained in:
parax0
2015-08-23 21:03:36 -04:00
parent 614f73487e
commit db970c6c51
8 changed files with 34 additions and 13 deletions

View File

@@ -218,8 +218,8 @@ bool CShaderGenerator::CreateVertexShader(const CMaterial& Mat)
ShaderCode << "// Main\n"
<< "void main()\n"
<< "{\n"
<< " mat4 MVP = ModelMtx * ViewMtx * ProjMtx;\n"
<< " mat4 MV = ModelMtx * ViewMtx;\n";
<< " mat4 MV = ModelMtx * ViewMtx;\n"
<< " mat4 MVP = MV * ProjMtx;\n";
if (VtxDesc & ePosition) ShaderCode << " gl_Position = vec4(RawPosition, 1) * MVP;\n";
if (VtxDesc & eNormal) ShaderCode << " Normal = normalize(RawNormal.xyz * inverse(transpose(mat3(MV))));\n";