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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Halo 2: Able to see other objects through objects close to you #55

Open
Alastair0100 opened this issue Oct 30, 2020 · 6 comments
Open
Labels

Comments

@Alastair0100
Copy link

Also can depend on viewing angle aswell as how close objects are to you from my testing

Title: 4d530064

image
image
image
image

@Shoegzer
Copy link

Confirmed in testing here too.

Relevant test specs:

  • OS: Linux Mint 20.3 / kernel 5.131
  • GPU: NVidia GTX 3070 / driver 470.86
  • Commit tested: 3fd1521

@Triticum0
Copy link

This also affects Wallace & Gromit in Project Zoo, Miami Vice, Tom Clancy's Splinter Cell and Serious Sam

@RageXbox
Copy link
Contributor

RageXbox commented Jan 19, 2022

Here’s a log for this.
Halo 2 seethrough.log

@abaire
Copy link
Contributor

abaire commented Jun 4, 2022

This looks like it may be a depth buffer precision issue, stepping through the draws in renderdoc I see depth buffer values for the more distant draws that are suspiciously close to but less than the nearby correct nearer geometry with odd discontinuities (e.g., if I follow the plane of a wall that is being cut out, I see values that follow a linear trend then jump to higher values where the earlier draw is peeking through, then resume within the expected interpolated range after the slice).

Halo2 uses a non-standard clip range:

nv2a_pgraph_method 0: NV20_KELVIN_PRIMITIVE<0x97> -> NV097_SET_CLIP_MIN<0x394> (0x437FFFFF => 255.999985)
nv2a_pgraph_method 0: NV20_KELVIN_PRIMITIVE<0x97> -> NV097_SET_CLIP_MAX<0x398> (0x4B7FFFFF => 16777215.000000)

though it at least uses the same range throughout all of the draws in the frame I traced.

I've previously found that the technique xemu employs to attempt to map screen coords produced by the nv2a shaders back into OpenGL-friendly NDC has some issues when dealing with unusual clip ranges (e.g., #843). This may be part of what is happening here.

@Shootfast
Copy link

Not sure if this is helpful at all, but in my naive attempt to debug this issue in Renderdoc, I found that commenting out this line of the vertex shader completely fixes the "see-through" issue (though also adds other problems).

Might that point away from it being a depth buffer precision issue, and perhaps point towards it being a problem converting the screen space to clip space?

@polymetal0
Copy link

Thanks to your comment, I accidentally got Skybox working!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants