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

Bug: Sidewalls not constructed as expected when Sample count is 255 #1666

Closed
pampas93 opened this issue Aug 17, 2020 · 3 comments · May be fixed by #1682
Closed

Bug: Sidewalls not constructed as expected when Sample count is 255 #1666

pampas93 opened this issue Aug 17, 2020 · 3 comments · May be fixed by #1682

Comments

@pampas93
Copy link

Bug description

While I have the sample count on the Abstract map set to max (255), the sidewalls show up as bars.

image

Steps to recreate the bug:

With sample abstract map component, with ElevationLayer type as "Terrain with elevation", and sample count = 255. If I enable "Show sidewalls", the walls show up as bars below the map. As attached below,

  • Unity version: 2019.3.15
    • Scripting Runtime Version: .NET 4.x
    • Scripting Backend: IL2CPP
  • Mapbox SDK version: 2.0.1
  • The platform you're building to: Editor for now
@pampas93
Copy link
Author

image

@brnkhy
Copy link
Contributor

brnkhy commented Aug 20, 2020

Hey Pampas!
Nice catch. It's an annoying issue but luckily very simple fix.
What happens is, when you set it to 255 it needs (255 * 255) + (255*8) vertices (first part is top vertices, second part is side walls). That equals to 67065 which is above 65536 limit of 16bit indexing for mesh triangles.
Fix is simply setting mesh indexing setting to 32 bit like this;
ElevatedTerrainWithSidesStrategy.cs line 232
rider64_2020-08-20_21-48-00

I'll create a fix&PR soon as well.

That being said, do you really need full res terrain? Unless you really need that level of precision, I would highly suggest lowering that number as it's really not noticable at all above roughly 100-ish levels.

Anyway, hope this helps!

@pampas93
Copy link
Author

@brnkhy That was perfect. I was just playing around with the sample count and jumped into this bug. Learnt it just by experimenting that i don;t require anything above 80. But thanks for looking into it

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 a pull request may close this issue.

2 participants