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

Handling of LOD bias is silently unimplemented #767

Open
abaire opened this issue Mar 13, 2022 · 1 comment
Open

Handling of LOD bias is silently unimplemented #767

abaire opened this issue Mar 13, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@abaire
Copy link
Contributor

abaire commented Mar 13, 2022

Bug Description

While investigating the shimmer effect in #270 I noticed that Ninja Gaiden Black sets the NV_PGRAPH_TEXFILTER0_MIPMAP_LOD_BIAS portion of NV_PGRAPH_TEXFILTER0 to a non-zero value in the bugged render pass. At the moment I'm not sure how much this is actually contributing to the corruption, but presumably it at least has some effect that will make the rendering incorrect.

Expected Behavior

Handling should be implemented to match hardware behavior.

I'm not sure if it's safe to assume that the nv2a LOD bias range matches the OpenGL range, but if it does maybe we can just use GL_TEXTURE_LOD_BIAS in pgraph_bind_textures?

GL_TEXTURE_LOD_BIAS
params specifies a fixed bias value that is to be added to the level-of-detail parameter for the texture before texture sampling. The specified value is added to the shader-supplied bias value (if any) and subsequently clamped into the implementation-defined range [−biasmax,biasmax], where biasmax is the value of the implementation defined constant GL_MAX_TEXTURE_LOD_BIAS. The initial value is 0.0.

xemu Version

My near head development version (I'm confident that I have made no changes that would've removed handling of LOD bias)

Version: 0.6.2-109-ghttps://github.com/mborgerson/xemu/commit/a16eea7d86a1cbe5f6c9cfb6b076839abd64ea7dd86
Branch: work
Commit: a16eea7
Date: Sat Mar 12 06:38:59 AM UTC 2022

System Information

"cpu": "Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz",
"gl_renderer": "NVIDIA GeForce GTX 1070/PCIe/SSE2",
"gl_shading_language_version": "4.00 NVIDIA via Cg compiler",
"gl_vendor": "NVIDIA Corporation",
"gl_version": "4.0.0 NVIDIA 470.103.01",
"os_platform": "Linux",
"os_version": "Ubuntu 21.10",

Additional Context

No response

@abaire abaire added the bug Something isn't working label Mar 13, 2022
@abaire
Copy link
Contributor Author

abaire commented Jul 1, 2022

Looking at a bunch of pgraph dumps I don't think the values can be used directly with GL_TEXTURE_LOD_BIAS:

LODBias: 0
LODBias: 7425
LODBias: 7502
LODBias: 7680
LODBias: 7681
LODBias: 7809
LODBias: 7900
LODBias: 7936
LODBias: 7937
LODBias: 8011
LODBias: 8014
LODBias: 8039
LODBias: 8065
LODBias: 8116
LODBias: 8142

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant