Skip to content

Commit e224c48

Browse files
committed
Fix fog and transparent surfaces with MSAA
1 parent c25992f commit e224c48

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/engine/renderer/GLUtils.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ struct GLConfig
7878
int max3DTextureSize;
7979
int maxCubeMapTextureSize;
8080
int maxTextureUnits;
81+
int maxColorTextureSamples;
82+
int maxDepthTextureSamples;
8183

8284
char shadingLanguageVersionString[MAX_STRING_CHARS];
8385
int shadingLanguageVersion;
@@ -153,6 +155,7 @@ struct GLConfig
153155
bool reflectionMappingAvailable;
154156
bool reflectionMapping;
155157
bool bloom;
158+
int MSAA; // 0 == disabled, otherwise used as sample count
156159
bool ssao;
157160
bool motionBlur;
158161
};

src/engine/renderer/tr_backend.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,7 @@ void RB_RenderSSAO()
16231623

16241624
RB_PrepareForSamplingDepthMap();
16251625

1626-
TransitionMSAAToMain( GL_DEPTH_BUFFER_BIT );
1626+
TransitionMSAAToMain( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
16271627

16281628
GL_State( GLS_DEPTHTEST_DISABLE | GLS_SRCBLEND_DST_COLOR | GLS_DSTBLEND_ZERO );
16291629
GL_Cull( cullType_t::CT_TWO_SIDED );
@@ -1656,6 +1656,8 @@ void RB_RenderSSAO()
16561656

16571657
Tess_InstantScreenSpaceQuad();
16581658

1659+
TransitionMainToMSAA( GL_COLOR_BUFFER_BIT );
1660+
16591661
GL_CheckErrors();
16601662
}
16611663

0 commit comments

Comments
 (0)