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

Z-fighting/moire patterns when rendering thin blocks used for coloring #26

Open
assertivist opened this issue Mar 3, 2019 · 3 comments · Fixed by #74
Open

Z-fighting/moire patterns when rendering thin blocks used for coloring #26

assertivist opened this issue Mar 3, 2019 · 3 comments · Fixed by #74
Labels
bug Something isn't working graphics Problems with OpenGL or generally rendering related

Comments

@assertivist
Copy link
Member

The easiest way to see this happening is to load Treble from AA Tre and look at the columnar blocks in the center. The decorations on top show z-fighting artifacts on Windows.

This may be distance related since they look fine when you're playing/up close, but I've also seen it on the corner blocks in Symbiosis at pretty close range.

It may also be platform related, but you can definitely see this in both Windows and Linux.

@assertivist assertivist added bug Something isn't working graphics Problems with OpenGL or generally rendering related labels Mar 3, 2019
@assertivist
Copy link
Member Author

After hearing from users on other platforms (thanks @ScarletSwordfish) I can pretty much safely say it isn't a platform issue. We probably need to adjust the way our object shader treats thin objects.

@assertivist
Copy link
Member Author

There's an attempt to deal with this issue in the shader labelled "decal". this uniform becomes .9999 when the object in question has a bounding box with a dimension smaller than some value (.001 I think it is right now). Then the z-buffer value is multiplied by that to bring those objects a little closer to the 'camera'.

This successfully gets rid of z-fighting in some situations but not all, and it also applies to thickness=0 ramps and other objects that we don't want to adjust the z-buffer of. So this is still in progress.

@assertivist
Copy link
Member Author

assertivist commented Jun 11, 2020

#74 didn't fix this, but it did make it better...

Instead of messing with the z-buffer directly, I discovered glPolygonOffset and used that to fix a lot of the instances of z-fighting, mostly of flat panels on the surface of larger blocks.

But we still have some, especially in places where the geometry that is coplanar with the decal geometry is also considered a decal (which means they both get shifted and the effect doesn't work).

It may be possible to utilize Juri's original algorithms for whether or not an object is obscured to assist with these adjustments in the depth buffer...

@assertivist assertivist reopened this Jun 11, 2020
assertivist referenced this issue Jun 17, 2020
* Calculate aspect ratio from window size, store current FOV, extend skybox to accomodate for widescreen, increase default FOV to 60

* Make FOV a preference, backface culling on hull shapes, BSPViewer, add opcodes to converter

Set near plane to .1
Add support in converter for more opcodes
Catch more exceptions in bsp parser
Fix a couple shape faces for backside culling (light hull, med hull,
scout)
Hack for backside culling on head and scout shapes
Fix BSPViewer
Make FOV a preference with default 50
Fix for entering an L thingy in game chat
Remove branches from sky shader
Safety checks in roster window

* Take out some unused fields

* Try to fix transparency issue on macos

* Try to fix sky weirdness on macos

* fix backface switch on bspviewer, fix crash from uncaught utf8 exception when reading length of a utf8 sequence of bytes in the middle of it being modified
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working graphics Problems with OpenGL or generally rendering related
Projects
Status: Open Bugs
Development

Successfully merging a pull request may close this issue.

1 participant