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

fix parchment tearing #1867

Merged
merged 2 commits into from Jul 19, 2020
Merged

Conversation

petchema
Copy link
Collaborator

Simplest fix: fix parchment tearing by rounding coordinates where textures must meet

Pierre Etchemaite added 2 commits July 17, 2020 20:21
Simplest fix:
Fix parchment tearing by rounding coordinates where textures meet
For example, while restoring vitals, sometimes some pixels of the bottom
of the bar get colored with highlight/gain color
@petchema
Copy link
Collaborator Author

For skybox, I assume a patch like

--- a/Assets/Scripts/Internal/DaggerfallSky.cs
+++ b/Assets/Scripts/Internal/DaggerfallSky.cs
@@ -240,8 +240,8 @@ namespace DaggerfallWorkshop
             float yShear = (Mathf.Tan(angleXRadians) * zoom) * 0.50f;
             float scrollY = Mathf.Clamp(baseScrollY - (yShear * Screen.height), -height, 0f);
 
-            westRect = new Rect(westOffset + scrollX, scrollY, width, height);
-            eastRect = new Rect(eastOffset + scrollX, scrollY, width, height);
+            westRect = new Rect(Mathf.Round(westOffset + scrollX), Mathf.Round(scrollY), width, height);
+            eastRect = new Rect(Mathf.Round(eastOffset + scrollX), Mathf.Round(scrollY), width, height);
         }
 
         private void DrawSky()

could help, however I don't like adding code for a problem I've been unable to reproduce...

@Interkarma
Copy link
Owner

This is very good and certainly helps fix the problem almost completely. I was able to still create a small tear using this, but it's very uncommon now and I had to work really hard to find just the right spot. :)

image

Happy for a PR for sky if you have time. Thank you again!

@Interkarma Interkarma merged commit 1ba43d8 into Interkarma:master Jul 19, 2020
@petchema
Copy link
Collaborator Author

petchema commented Aug 7, 2020

Yes, I can still create the issue in 1440x960
1440x960 seam
Not sure why it still happens in that case...

@Interkarma
Copy link
Owner

Would be interesting to step back through Unity versions to see exactly where this started. The change notes for that release might offer some clue.

I suppose it's possible this will be fixed by a Unity point release later. Other than a few minor tweaks like this PR, I'm not keen to overhaul UI layout just yet to work around problem. I have a sense this one will be a fix that finds us rather than the other way around.

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

Successfully merging this pull request may close these issues.

None yet

2 participants