Prevent super tall pillars from appearing on oceans where there is no elevation data#63
Merged
david-rhodes merged 3 commits intomapbox:developfrom May 15, 2017
Merged
Conversation
commit attempts to decipher the 'no-data' region and return 0 height as appropriate.
david-rhodes
suggested changes
May 11, 2017
| Assuming this is in meters? The tallest point on earth is ~8,500m. | ||
| Therefore this number should be pretty safe. | ||
| */ | ||
| if (height > 100000 * tile.RelativeScale * heightMultiplier) { |
There was a problem hiding this comment.
This will likely work. However, we have determined the missing data is because of bad rendering on our side. Textures with missing data will have width less than 256 (usually 8?). Therefore, it is likely more correct to set heightMultiplier to zero in CreateTerrainHeight():
var texture = new Texture2D(256, 256);
texture.wrapMode = TextureWrapMode.Clamp;
texture.LoadImage(pngRasterTile.Data);
if (texture.width < 256)
{
heightMultiplier = 0f;
}
tile.HeightData = texture;
tile.HeightDataState = TilePropertyState.Loaded;
GenerateTerrainMesh(tile, heightMultiplier);
Author
|
Thanks @david-rhodes, this method seems to work. |
Author
|
When I log into Travis CI, I can't see mapbox/mapbox-unity-sdk, so I don't know what build is failing or how. (It works on my machine! ;) |
|
@Spaxe Thanks for your patience. Travis is being strange, but I don't see anything in this PR that is risky. Merging. |
david-rhodes
approved these changes
May 15, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If @david-rhodes could review this, that would be awesome.