-
-
Notifications
You must be signed in to change notification settings - Fork 478
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
Sporadic gaps / precision errors in tiles. #1136
Comments
I have seen this happens a couple more times while doing unrelated things. It doesn't seem like tiles being misplaced or culled or even the position. It looks like for a fraction of a second that a tiny chunk of tile is gone, like a Tetris piece, I don't know how else to describe it, but its very noticeable, its like everyone now and then some sort of random rectangular polygon disappears. Its not clear to me whether this is caused by occlusions or culling of some kind, all I know currently is that it did not happen in previous versions. I will continue to make an effort to record it, but I'm not sure how that would help if you can't reproduce it, which the only way seems to be to stare at the screen while doing other things for extended periods (i.e. playing a game) Gonna try updating my drivers, maybe it will go away. 😵💫 |
Pretty sure this is something different and not the problem. |
Still occurs after driver updates. |
Thanks for reporting. It is definitely a precision issue so drivers will unlikely fix it. I don't have the time to look at it right now. Having the camera transform and Ocean Renderer settings when it occurs would certainly help although I understand it may be hard to obtain the former. |
I have seen this happen at least once in the BoatWakes scene so the settings there should work to reproduce. Should not require any changes to reproduce, the problem is it seems to be some sort of random timing issue that is difficult to capture. |
@daleeidd I am very excited because while trying to narrow this down I was able to capture this illusive bug on video. Here is a screencap of the original problem. Its looks like the tiles are physically separated. Here is a clip of the bug. This occurred roughly 5 minutes into me playing with various inspector settings trying to find the problem. You can also see the tiny tile artifacts just prior, though that may be unrelated. The FPS in this video dips several times due to messing with the inspector. TileBug.mp4 |
I am looking into causes based on this : #1135 (comment) Definitely more than a subpixel. The only maybe related changes I see are here: I see various commits that look like they might have changed the behavior for what would have been included with my update from 4.15.2 to 4.17. Without a complete understanding, this was seems like its around the time frame. I am a bit confused looking at the history for the precision fixes, some of the changes seem to disappear from 2020 to 2023, maybe here: |
Shadows can look strange due to vertex interpolation but that video looks a bit more strange than usual. On the material there is a "Debug Visualise With Colours" dropdown. It has a shadow option which may be easier to see what is happening. As for the gaps, I wonder if it is triggered by a scale change. If you could set both the Min Scale and Max Scale on the Ocean Renderer to the same value to prevent scale changes and see if it comes up again. The water won't look correct with this setting but if you hit the problem frequently it should be quick to confirm. |
The resolution needs to be at certain intervals (I believe 128 is a safe number) otherwise issues will appear. The goal was to see if they wouldn't appear like they have been which would make me think that scale is a factor. If scale is at play then will make it much harder to reproduce. |
I will keep an eye out for it occurring again, but I am not sure what else I can do. There is definitely a bug(s) somewhere. I did a clean install and reintegrated and have not seen the issue occur all week doing other things. It seems like there are a handful issues at play. |
That's okay. Thank you for your help so far. |
I saw this happen again while above the ocean and entire section (large slice) of the ocean disappeared in the same manner. I do not believe this is due to any inspector settings given the clean state with latest and it occurring in examples scenes, seems like it is most likely a problem with timing / execution order / code somewhere. Something that was not in earlier versions or something that was added that changed the timing of other functions. I would bet these momentary disappearances are related to a number of similar tile gaps that appear while doing various things in the editor (changing scenes, entering/exiting playmode, Window key behavior). There are times in the editor where it no longer draws the ocean, if those problems are fixed I think this problem may become more apparent or disappear entirely as it may be a symptom of a larger drawing problem. |
@daleeidd Could this be caused by inaccuracy with high far clipping on the camera such as: This is something I changed / allowed around the same time I updated the crest version. Can be anywhere from 2000-500000 with in game camera settings and code. I added some dynamic setting of the far clip plane to reduce other issues underwater and limit it unless at very high altitudes roughly 2000 - 10000 meters, somewhere in this range the far clipping needs to go up to prevent things from not looking great. There is an obvious need to see very far in some cases when in an infinite ocean though. It occurred to me that this may be the same cause since it is similar to other culling issues I was having underwater. I was able to changed my LOD back to 7 without issue, I still saw the problem once or twice (maybe less frequent, idk), I will have to wait a bit and see if it still shows up keeping view distance below 100000 unless at a view high altitude. |
I see. Curious to see if that is related. I tried 500k but didn't experience any problems. |
I still see it occur occasionally at 100k. Not sure if less frequent or even related. Not something that is immediately apparent. Takes hours or days to see it. |
@daleeidd After doing another deep dive, I am fairly confident this is being caused by I focused on the grid size this time, its difficult to debug this stuff with shaders so I don't have info on the values in the helper: Hoping this solves the issue. I will let you know if I see it again, but it has been a while. |
Thanks for letting me know. That should help narrow down a solution. And good to hear you have a workaround. |
Just an update on the workaround and for your info, it does appear to have a positive affect. I have not seen any close up tile gaps anymore. I do occasionally when flying through the air see very quick gaps in further away tiles but it is no longer critical / very obvious. It also seems to be far less frequent. I do think there is still a precision issue going on that may not be fixed by settings alone. |
Has nothing to do with any scripts I have moving the ocean renderer (unless it is Y / tide), I eliminated those and it occurred almost immediately when I tried to return the LOD data resolutions back to 384 from 512. If I leave the OceanRenderer with min scale and max scale at 32 what drawbacks will occur? |
@daleeidd Here is a video of reproducing this in the Gap.mp4Loop (seems to occur for only 1 frame before correcting itself) gap_loop.mp4I included some camera info in the video, but I don't think it is related. I had a Scale by factor wave input at the origin in an attempt to simulate my scene with the drydock, but I also don't think that is related. I attempted to do this multiple times and was unable to see it again or capture it with the root scale displaying. I also have the far clipping set very high because I thought maybe that would exaggerate the issue and make it easier to reproduce, it does not seem to. In my scene the far clipping was 100000 when I last saw it. I was trying to reproduce this under the theory that this is in fact caused by scaling somehow so I was performing sort of a cosine wave / zig zag on the surface of the water to force the scale to bounce between 2-16 ish. I have been developing with:
and have not seen the issue since. But it may take more time before it pops up again. |
I was poking around trying to figure out where the problem is coming from and I ended up in the same place as last time #1136 (comment) I played around with the value going in there to see if I could force it to create similar errors. Does the root of the tile need to be at the exact position of the camera minus the Example:
(Update: Does not appear to be)Is it possible the |
I did just confirm that this can still happen even when the |
Nothing comes to mind. |
Here is some more video / info on this: Gap.1.Compressed.mp4I have been looking into maybe it being caused by some sort of execution order problem, but that does not seem to be the case. It is almost like something is incorrect in LateUpdate and then corrects itself on the next frame, but as far as I can tell there is no way to aggravate the issue or cause it to happen. The only thing that has an affect is the |
I saw this happen 3 times yesterday over the course of 12 hours or so. They were all different tiles at different distances. It happened 1 time normally as described previously, 1 time looking up from underwater, and one time while the camera was idle and mostly not moving (so really had nothing to do with anything that was happening in the scene). They seemed evenly spaced, which is weird. Makes me think it is related to timing or a delta somewhere that is rolling over or resetting to 0 after 4 hours. I was looking for anything that jumped out at me like that but did not find anything obvious that caused similar gaps when intentionally changing. I did however notice something else. I was once again looking at
the important part being the comment Presumable the result of So this produces gaps everywhere for obvious reasons So then my question would be what can cause this to be negative? The documentation I found did not seem to indicate sign. The answer I guess is not important if it fixes the problem, which I will not know until hours or days from now. Assuming that this somehow returns a negative value occasionally: I tested this with: and it seems to work normally, but idk yet. It is interesting and makes a bit more sense to me than some of the other things I looked into so I am hopeful. |
#1136 (comment) does not seem to completely fix the problem. Gaps seem different (maybe smaller) and close but are still there. Seems likely there is something wrong with |
Does it seem like an improvement? Did you abs both of the fracs? |
No it does not seem to have an effect, at least not one I can measure. I believe so. I went through several iterations of frac/abs combo none seem to work. I had to wait several hours between attempts while doing other things, but I usually see it when it happens. I was referencing this: I don't think I can tell that even if it was returning a negative value that the value it would have returned was correct. However I made some changes based on the reference implementation and tried I did notice something today though, it seems like it can be aggravated to occur more frequently. Though I am not sure how, I have just observed that when running multiple instances of Unity (for multiplayer testing) that as the game is loading on one instance the already loaded instance is far more likely to have gaps appear. Seems like a 50/50 if I see it on the other instance while loading. They are the same gaps, just more frequent. So maybe the problem is more apparent when there is more strain on the cpu/gpu while loading scenes. (I normally see this at 60fps though). I tried limiting the fps in the demo scene and creating a script that does a bunch of cpu work but that did not generate any gaps. This behavior may explain why I was able to capture it so easily here: #1136 (comment) you can see right when it occurs it dips from 60 to 6-7 fps. I think at the time this was occurring because I had lots of vegetation loading in the background and I had the OceanRenderer selected in the inspector which caused a heavy performance impact. It is definitely some sort of timing issue maybe based on the execution order and Unity changing something or something changing for a single frame and altering the outcome of a single snap in some way. Based on the frac results and the logic in there is must be somehow nudging in the wrong direction for a single side of a tile. Very perplexing. |
Side note which may be related. I do see this sometimes in the editor when compiling code after disabling these: #1124 (comment) The gaps seems related, but disappear when unity finishes whatever it was doing reloading code. These are also the gaps that appear if the frac is negative. It is more similar to the frac offset not being applied at all: Though I cannot be sure it is related, these issues did appear at the same time after I updated crest. |
@daleeidd Here is an info dump of what I have been investigating. I just ruled out camera distance (far clipping) as a cause. I am hoping this may help lead to a solution to this. Knowns
Guesses
Not sure what else to look at. If it is in fact some sort of rounding error that results in the loss of 0.01 in any direction the results for that frame will be wrong and I am not sure there is any way to correct that without changing the way that tile grid snapping happens or how vert offsets are done. It seems to move them pretty far, very frequently. At any moment the position could be just right to produce a rounding error that Here is a video of 2 gaps occurring at once which I had not seen before, but it is interesting they both happened at the same time. 2gaps.mp4 |
Is there an existing issue for this?
Have you checked the documentation to resolve your problem?
Current Behavior
Occasionally (maybe over the course of hours) a single frame will create a gap in the tiles or parts of the ocean will be missing and then reappear the next frame. It seems unrelated to settings, it is possible its tied to camera movement.
Expected Behavior
Nothing should happen and no ocean tiles should disappear
Steps To Reproduce
Unity Version
2021.3.26f1
Crest Version
4.19
Render Pipeline
Built-In
Editor or Standalone
Editor (Edit Mode), Editor (Play Mode)
Environment
Anything else?
I want to say that this happens most often right after you start the editor / exe and move around low to the ocean, but its hard to see. I have seen it happen long into a session so the cause is not known.
The text was updated successfully, but these errors were encountered: