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

How to use gl_HalfPixel? #2291

Open
chyyran opened this issue Mar 7, 2024 · 1 comment
Open

How to use gl_HalfPixel? #2291

chyyran opened this issue Mar 7, 2024 · 1 comment

Comments

@chyyran
Copy link
Contributor

chyyran commented Mar 7, 2024

When compiling HLSL for ShaderModel 3.0, SPIRV-Cross inserts a gl_HalfPixel uniform that must be set. What value should this uniform be set to?

@HansKristian-Work
Copy link
Contributor

0.5 / ViewportSize, but technically it's a bit jank, especially for cases where W goes negative. If possible you should set it to 0 and either adjust for integer pixel center in D3D9 through a viewport or projection matrix fixup.

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

No branches or pull requests

2 participants