Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetRenderState(D3DRS_DEPTHBIAS, g_depth_bias) causing depth buffer issues #118

Open
nukeulater opened this issue Apr 7, 2018 · 7 comments

Comments

@nukeulater
Copy link
Collaborator

nukeulater commented Apr 7, 2018

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.

@korpser32
Copy link

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.

@nukeulater
Copy link
Collaborator Author

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.

@General-101
Copy link
Contributor

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

@nukeulater
Copy link
Collaborator Author

nukeulater commented Aug 19, 2018

Fixed if 62e8d80 is merged.

@iSupersniper
Copy link
Collaborator

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

capture 1

@iSupersniper iSupersniper reopened this Aug 19, 2018
@nukeulater
Copy link
Collaborator Author

nukeulater commented Aug 19, 2018

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.

@General-101
Copy link
Contributor

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.

@nukeulater nukeulater changed the title Game renderer issue. SetRenderState(D3D_DEPTH_BIAS, g_depth_bias) causing issues. Aug 19, 2018
@nukeulater nukeulater changed the title SetRenderState(D3D_DEPTH_BIAS, g_depth_bias) causing issues. SetRenderState(D3DRS_DEPTHBIAS, g_depth_bias) causing issues. Aug 19, 2018
iSupersniper added a commit that referenced this issue Aug 24, 2018
@nukeulater nukeulater changed the title SetRenderState(D3DRS_DEPTHBIAS, g_depth_bias) causing issues. SetRenderState(D3DRS_DEPTHBIAS, g_depth_bias) causing depth buffer issues Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants