Change the matrix interface on RenderState so the backend doesn't have to try detect changes on each Apply
Include the texture matrix in the mesh builder
This commit is contained in:
parent
96ac7ba3f0
commit
eba0bee9f6
17 changed files with 126 additions and 136 deletions
|
|
@ -73,14 +73,15 @@ void FHWModelRenderer::BeginDrawModel(FRenderStyle style, FSpriteModelFrame *smf
|
|||
state.SetCulling((mirrored ^ portalState.isMirrored()) ? Cull_CCW : Cull_CW);
|
||||
}
|
||||
|
||||
state.mModelMatrix = objectToWorldMatrix;
|
||||
state.EnableModelMatrix(true);
|
||||
VSMatrix normalModelMatrix;
|
||||
normalModelMatrix.computeNormalMatrix(objectToWorldMatrix);
|
||||
state.SetModelMatrix(objectToWorldMatrix, normalModelMatrix);
|
||||
}
|
||||
|
||||
void FHWModelRenderer::EndDrawModel(FRenderStyle style, FSpriteModelFrame *smf)
|
||||
{
|
||||
state.SetBoneIndexBase(-1);
|
||||
state.EnableModelMatrix(false);
|
||||
state.SetModelMatrix(VSMatrix::identity(), VSMatrix::identity());
|
||||
state.SetDepthFunc(DF_Less);
|
||||
if (!(style == DefaultRenderStyle()) && !(smf->flags & MDL_DONTCULLBACKFACES))
|
||||
state.SetCulling(Cull_None);
|
||||
|
|
@ -106,14 +107,15 @@ void FHWModelRenderer::BeginDrawHUDModel(FRenderStyle style, const VSMatrix &obj
|
|||
state.SetCulling((mirrored ^ portalState.isMirrored()) ? Cull_CW : Cull_CCW);
|
||||
}
|
||||
|
||||
state.mModelMatrix = objectToWorldMatrix;
|
||||
state.EnableModelMatrix(true);
|
||||
VSMatrix normalModelMatrix;
|
||||
normalModelMatrix.computeNormalMatrix(objectToWorldMatrix);
|
||||
state.SetModelMatrix(objectToWorldMatrix, normalModelMatrix);
|
||||
}
|
||||
|
||||
void FHWModelRenderer::EndDrawHUDModel(FRenderStyle style)
|
||||
{
|
||||
state.SetBoneIndexBase(-1);
|
||||
state.EnableModelMatrix(false);
|
||||
state.SetModelMatrix(VSMatrix::identity(), VSMatrix::identity());
|
||||
|
||||
state.SetDepthFunc(DF_Less);
|
||||
if (!(style == DefaultRenderStyle()))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue