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

Gaps from tiles when downloading from Google #430

Open
Nerosetsfire opened this issue Dec 10, 2023 · 17 comments
Open

Gaps from tiles when downloading from Google #430

Nerosetsfire opened this issue Dec 10, 2023 · 17 comments

Comments

@Nerosetsfire
Copy link

I love your add-on but when I try and download anything from Google there are basically gaps and some kind of grit that you can see through. I really don't know what to do about this because anyone have any advice? https://youtu.be/mGXrTx0BXog

@vvoovv
Copy link
Owner

vvoovv commented Dec 11, 2023

Hi @Nerosetsfire

This a well known problem. I'll try to carry out some experiments later this week. I'll report the results in this issue.

@Nerosetsfire
Copy link
Author

Thank you for letting me know aside from this I really love the add-ons I really hope that I can figure out how to fix this problem

@vvoovv
Copy link
Owner

vvoovv commented Dec 12, 2023

@Nerosetsfire

May I know the coordinates of your area of interest? That's needed for testing.

@Nerosetsfire
Copy link
Author

-73.57432,45.52248,-73.56306,45.53030

Thnk_u-)

@vvoovv
Copy link
Owner

vvoovv commented Dec 14, 2023

The problem is seemingly caused by floating point errors. Internally Blender uses single precision 32 bits format for floating point variables, while Python use double precision 64 bits one.

As a test I tried to replace Blender floating point structures with Python ones. It seems it helped to decrease the width of gaps by two.

The gap in your area of interest used for comparison is marked with the red color:

image


Gap in the current release of the Blosm addon;

image


Gap after replacing Blender floating point structures with Python ones:

image

@vvoovv
Copy link
Owner

vvoovv commented Dec 14, 2023

As a test I tried to replace Blender floating point structures with Python ones. It seems it helped to decrease the width of gaps by two.

I also made changes in Blender's built-in glTF importer, on which the Blosm addon relies to import Google 3D Tiles. So it will be required to change the glTF add-on as well.

@WarnerV
Copy link

WarnerV commented Dec 15, 2023

Great to see that you're managing this improvement vvoovv!

Can you drop a note when there's a release out that has these changes included (including an updated glTF importer, I guess)?

@Nerosetsfire
Copy link
Author

wow...thank you for figuring this out. I'm amazed actually. So I guess I will just need to wait for everything to get an update for it to work properly? Or is there something I can do in the mean time to make it work? Thank you either way for your help.

@vvoovv
Copy link
Owner

vvoovv commented Dec 15, 2023

Making changes in a Blender's built-in addon and having them a future Blender release will take time.

I'll figure out how to override glTF stuff from the Blosm addon.

@cyberlecs
Copy link

As a test I tried to replace Blender floating point structures with Python ones. It seems it helped to decrease the width of gaps by two.

I also made changes in Blender's built-in glTF importer, on which the Blosm addon relies to import Google 3D Tiles. So it will be required to change the glTF add-on as well.

Hi @vvoovv, thanks for your great work!
Any chance to release a experimental build with your solution, please? =)

@vvoovv
Copy link
Owner

vvoovv commented Jan 4, 2024

Hi @cyberlecs

I hope to release it by the end of January.

@vvoovv
Copy link
Owner

vvoovv commented Feb 7, 2024

The feature is finally out. The gap size was reduced up to 3 times. The feature will work in Blender 3.6, 4.0, 4.1.

To test the feature, install the latest version of the Blosm addon (currently 2.7.5).

image

@cyberlecs
Copy link

Thanks! Just tested here, the result is much better!

@vvoovv
Copy link
Owner

vvoovv commented Feb 7, 2024

Some technical details.

Internally Blender uses single precision 32 bits format for floating point variables, while Python uses double precision 64 bits one. The more the magnitude of a variable is, the more the precision loss is, when converting from a Python structure to a Blender one. That can be seen in the example below. Enter the first two lines below in Blender's Python console to reproduce the example.

from mathutils import Vector
Vector((1266116.7, -4293231.2, 4528524.9))
Output: Vector((1266116.75, -4293231.0, 4528525.0))

Each Google 3D Tile is positioned on the Earth surface in the system of reference with the center in the Earth's center. A typical coordinate has millions of meters. The precision is lost significantly after the conversion to Blender's structure.

To decrease the precision loss an offset can be applied to the coordinates of each Google 3D Tile. The addon temporarily replaces a function in Blender's built-in glTF addon with a patched one, which does that. After the import the addon restores the original function of the glTF addon.

@Nerosetsfire
Copy link
Author

Nerosetsfire commented Feb 8, 2024 via email

@Nerosetsfire
Copy link
Author

Nerosetsfire commented Feb 9, 2024 via email

@vvoovv
Copy link
Owner

vvoovv commented Feb 9, 2024

How do I get the latest version?

Through the download link in your purchase confirmation email.

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

No branches or pull requests

4 participants