cartographer icon indicating copy to clipboard operation
cartographer copied to clipboard

SetRenderState(D3DRS_DEPTHBIAS, g_depth_bias) causing depth buffer issues

Open nukeulater opened this issue 7 years ago • 7 comments

capture

unknown1

unknown

If you look closely you can see lights / transparent planes shine through geometry. Update 2022: ~~Happens on MCC too.~~ H2MCC patched in 2021 by 343i 👍🏻 (link)

Lights emitted by enemies in Campaign no longer show through some solid objects briefly when the enemy moves out of view.

They start to behave as expected if you get closer to the light / transparent plane source.

nukeulater avatar Apr 07 '18 07:04 nukeulater

Yes this happens on my PC as well as on my Xbone with MCC on classic Halo 2 mode. I believe this is a result of the modded engine to allow 60 fps, as it was originally intended and all physics coded to be tied to the framerate. The same thing happens on PC again because the game has been modified to allow a higher than planned framerate and could mess up the calculations for when to draw lighting on your screen, because as you mentioned when you get closer it gets fixed and you can no longer see the light through the wall. I wouldn't worry too much about it, I get it's immersion breaking because I've noticed and felt that way too but I just take it as the one little downside to a great game.

korpser32 avatar Apr 22 '18 16:04 korpser32

The "tickrate" change has nothing to do with this. I personally tested that by setting the game engine back to xbox values (possible on PC) and the issue still occurred. Most likely a ZBuffer issue.

nukeulater avatar Apr 28 '18 08:04 nukeulater

Depth bias offset might be the cause or somehow related to this. Setting it to zero hides the issue.

General-101 avatar Aug 17 '18 22:08 General-101

Fixed if 62e8d80f2b4057c5bfd6c40fddb9b0964be7f114 is merged.

nukeulater avatar Aug 19 '18 17:08 nukeulater

This change causes zflighting issues with all bitmaps that are modified when looked at from a distance.

capture 1

iSupersniper avatar Aug 19 '18 17:08 iSupersniper

Z-figthing happens because that light is coplanar with the wall behind/it has similar or identical values inside the Z-buffer w/ the wall. Unless you can find a way to move that light a bit or determine from which shader the depth bias value is taken from (and I suspect most of the plane lights use the same shader), it cannot be fixed.

nukeulater avatar Aug 19 '18 17:08 nukeulater

Just to be clear for anyone reading. The zfighting only happens if the shader used for that particular mesh had a depth bias offset value defined. This basically means that the only zfighting you should see is on mesh pieces that showed through geometry in the first place.

General-101 avatar Aug 19 '18 18:08 General-101