Don't let TAA mess with masked culling

This commit is contained in:
Robert Beckebans 2024-08-22 00:24:17 +02:00
parent 1fda97ec25
commit dba7404eff
2 changed files with 8 additions and 6 deletions

View file

@ -529,6 +529,7 @@ void R_AddSingleModel( viewEntity_t* vEntity )
idRenderMatrix viewMat;
idRenderMatrix::Transpose( *( idRenderMatrix* )vEntity->modelViewMatrix, viewMat );
idRenderMatrix::Multiply( viewDef->projectionRenderMatrix, viewMat, vEntity->mvp );
idRenderMatrix::Multiply( viewDef->unjitteredProjectionRenderMatrix, viewMat, vEntity->unjitteredMVP );
if( renderEntity->weaponDepthHack )
{
idRenderMatrix::ApplyDepthHack( vEntity->mvp );
@ -714,9 +715,9 @@ void R_AddSingleModel( viewEntity_t* vEntity )
const idDrawVert& v2 = tri->verts[tri->indexes[i + 2]];
// transform to clip space
vEntity->mvp.TransformPoint( idVec4( v0.xyz.x, v0.xyz.y, v0.xyz.z, 1 ), triVerts[0] );
vEntity->mvp.TransformPoint( idVec4( v1.xyz.x, v1.xyz.y, v1.xyz.z, 1 ), triVerts[1] );
vEntity->mvp.TransformPoint( idVec4( v2.xyz.x, v2.xyz.y, v2.xyz.z, 1 ), triVerts[2] );
vEntity->unjitteredMVP.TransformPoint( idVec4( v0.xyz.x, v0.xyz.y, v0.xyz.z, 1 ), triVerts[0] );
vEntity->unjitteredMVP.TransformPoint( idVec4( v1.xyz.x, v1.xyz.y, v1.xyz.z, 1 ), triVerts[1] );
vEntity->unjitteredMVP.TransformPoint( idVec4( v2.xyz.x, v2.xyz.y, v2.xyz.z, 1 ), triVerts[2] );
MaskedOcclusionCulling::CullingResult result = tr.maskedOcclusionCulling->TestTriangles( ( float* )triVerts, triIndices, 1, NULL, MaskedOcclusionCulling::BACKFACE_CCW );
if( result == MaskedOcclusionCulling::VISIBLE )

View file

@ -266,6 +266,7 @@ void R_RenderSingleModel( viewEntity_t* vEntity )
idRenderMatrix viewMat;
idRenderMatrix::Transpose( *( idRenderMatrix* )vEntity->modelViewMatrix, viewMat );
idRenderMatrix::Multiply( viewDef->projectionRenderMatrix, viewMat, vEntity->mvp );
idRenderMatrix::Multiply( viewDef->unjitteredProjectionRenderMatrix, viewMat, vEntity->unjitteredMVP );
if( renderEntity->weaponDepthHack )
{
idRenderMatrix::ApplyDepthHack( vEntity->mvp );
@ -436,9 +437,9 @@ void R_RenderSingleModel( viewEntity_t* vEntity )
const idDrawVert& v2 = tri->verts[tri->indexes[i + 2]];
// transform to clip space
vEntity->mvp.TransformPoint( idVec4( v0.xyz.x, v0.xyz.y, v0.xyz.z, 1 ), triVerts[0] );
vEntity->mvp.TransformPoint( idVec4( v1.xyz.x, v1.xyz.y, v1.xyz.z, 1 ), triVerts[1] );
vEntity->mvp.TransformPoint( idVec4( v2.xyz.x, v2.xyz.y, v2.xyz.z, 1 ), triVerts[2] );
vEntity->unjitteredMVP.TransformPoint( idVec4( v0.xyz.x, v0.xyz.y, v0.xyz.z, 1 ), triVerts[0] );
vEntity->unjitteredMVP.TransformPoint( idVec4( v1.xyz.x, v1.xyz.y, v1.xyz.z, 1 ), triVerts[1] );
vEntity->unjitteredMVP.TransformPoint( idVec4( v2.xyz.x, v2.xyz.y, v2.xyz.z, 1 ), triVerts[2] );
// tri->indexes is unsigned short instead of uint
//triIndices[0] = tri->indexes[i + 0];