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
renderer: fix infuriating grey line #287
Conversation
@DolceTriade the bug was almost 15 years old: https://sourceforge.net/p/xreal/svn/462
|
Ha! Nice find! |
How can this be so important? The max error of a float is 30 parts per billion. It's hard to see how this could make a difference. |
@slipher, the big difference I see is that when this float is set as a In this case the bug was probably hidden until 2008, when those floats were converted from uniforms to defines: https://sourceforge.net/p/xreal/svn/1963
Also, And in any way, the shortest |
0b237d2
to
65768df
Compare
This also fixed the fog offset issue I talked about in Unvanquished/Unvanquished#799 (comment) . |
Dang, big impact fix! |
Maybe I'm a wizard, then.
I've noticed that if the bug is not in SSAO neither FXAA code, using both makes worst artifacts than only one of those. I also noticed that ticking FXAA on and off (the later not requiring an engine restart), I was seeing the screen being more streched with on than off, in real time.
Here is with and without fxaa (while ssao is enabled):
Those screenshots can also be seen there with a nice slider.
So, I've noticed that the only common code in both shaders was something like that:
Which is the computation for the pixel size.
I then thought: “maybe those floats in
r_FBufScale
(avec2
) have rounding errors”, I then modified them in shader the arbitrary way and I was able to produce garbage based on vertical and horizontal lines the same way:I then thought: “wait, those floats are passed from c++ to glsl, those floats are just the quotient of 1 by ints, we can pass them as int instead and translate multiplication by division”, I tried, it seems to work.
So, this is expected to fix Unvanquished/Unvanquished#858
On my side it does: