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

Tile texture goes pitch black when y-axis scaling is an extremely low value #42

Closed
brnkhy opened this issue May 1, 2017 · 6 comments
Closed
Assignees
Labels

Comments

@brnkhy
Copy link
Contributor

brnkhy commented May 1, 2017

This especially happens if you load the world in low zoom levels like 1 to 5. Root world object y-axis scale goes extremely low and unless TileSize is increased proportionally (i.e. using default 100), Unity cannot render the tile texture.
It renders if world scale y-axis is set to 1 (breaks heights of features&terrain) or TileSize increased to a much bigger number (like 1000 or 100000 depending on zoom level).

@brnkhy brnkhy added the bug label May 1, 2017
@brnkhy brnkhy self-assigned this May 1, 2017
@david-rhodes
Copy link

Appears to be caused by internal floating point precision issues. As an alternative workaround, use an unlit material.

@david-rhodes
Copy link

@brnkhy Think we could just set a minimum y scale value?

@Spaxe
Copy link
Contributor

Spaxe commented Jun 26, 2017

I just bumped into potentially this issue ... but only on Windows 10, Unity 5.6.2f1. Pitch black.

On MacOS with Unity 5.6.1f1 this issue doesn't happen, although I did notice that at small tiles (say 0.5 TileSize), lighting doesn't quite work and I get a dim terrain.

Unlit is a workaround for now.

@wilhelmberg
Copy link
Contributor

wilhelmberg commented Jun 27, 2017

So far I've only come across that issue on one of my Android devices using Slippy demo.
Spent some hours fiddling with various settings and the combinations thereof.

Hope I haven't forgotten anything but these are the only changes needed for Slippy.unity (from develop) to consistently reproduce the issue on Samsung Tab S2 8".

Does not occur on OnePlus 3 or Windows native or Windows Store/UWP.

Camera position:
image

Map

  • at 47.04071, 12.83326
  • Zoom: 14

results in:

z14

If I change SlippyTerrain/Factories/Resource/TerrainMaterial -> Shader to Unlit/color everything is white.
If I change it to Unlit/Texture
If I change it to Unlit/Transparent
If I change it to Unlit/Transparent Cutout

If I change the shader back to Standard but set map zoom to 15 it also works:

z15

@david-rhodes
Copy link

This is almost certainly related to a floating point precision issue, specifically in how lighting is calculated when the tiles are scaled so far down.

Another workaround is to increase the tile size when using lower zoom levels (this results in less transform scaling).

@david-rhodes
Copy link

Fixed: 032466b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants