-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix MSAA stripes #9247
Fix MSAA stripes #9247
Conversation
P.S. MSAA (multisample anti-aliasing) is a kind of FSAA (full-scene anti-aliasing) used in Minetest. |
It does nothing when shaders are disabled. varying centroid is explained in the glsl 1.2 (which is related to opengl 2.1) specification. The centroid keyword is simply ignored when MSAA is disabled.
There should not be any penalty if MSAA is disabled.
I've only changed the nodes shader; maybe the wield shader should be changed, too.
Something similar to the derivation is only required for parallax occlusion I think. Anyways, the wrong-border-colour artifacts are probably much more disturbing than artifacts caused by the centroid offset.
According to Wikipedia, FSAA is the same as SSAA: https://en.wikipedia.org/wiki/Spatial_anti-aliasing#Super_sampling_/_full-scene_anti-aliasing |
e15436f
to
499be79
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No objection except for maybe the unnecessary _bounded suffix, that's just noise and redundant with the centroid keyword. Maybe a comment could explain why it's centroid instead.
499be79
to
9bae61b
Compare
Done. I hope the comment is not too long. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as describedNevermind.
Sure, but that doesn't mean it should look worse than before. |
In my opinion it is negligible in comparison to the visible MSAA stripes, |
This only works when shaders are enabled. The centroid varying avoids that the textures (which repeat themselves out of bounds) are sampled out of bounds in MSAA. If MSAA (called FSAA in minetest) is disabled, the centroid keyword does nothing.
9bae61b
to
4044f77
Compare
rebased. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with OpenGL 4.6.0. Looks good, although I can barely find any difference.
This breaks GLES (with shaders enabled): 2020-12-15 22:29:24: ERROR[Main]: Irrlicht: GLSL shader failed to compile 2020-12-15 22:29:24: ERROR[Main]: Irrlicht: 0:56(1): error: syntax error, unexpected NEW_IDENTIFIER, expecting end of file [...] 2020-12-15 22:29:24: WARNING[Main]: 55: varying lowp vec4 varColor; 2020-12-15 22:29:24: WARNING[Main]: 56: centroid varying mediump vec2 varTexCoord; 2020-12-15 22:29:24: WARNING[Main]: 57: 2020-12-15 22:29:24: WARNING[Main]: 58: varying vec3 eyeVec; [...] |
This only works when shaders are enabled. The centroid varying avoids that the textures (which repeat themselves out of bounds) are sampled out of bounds in MSAA. If MSAA (called FSAA in minetest) is disabled, the centroid keyword does nothing.
@sfan5 I see 3 possible fixes:
|
My preference order is 2 1 3 here. |
This only works when shaders are enabled.
The centroid varying avoids that the textures (which repeat themselves out of bounds) are sampled out of bounds in MSAA.
If MSAA (called FSAA in minetest) is disabled, the centroid keyword does nothing.
Related issue: #6860
An older related PR: #8123