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

Invisible Meshlib/Tilemap Models #48790

Open
Dente222 opened this issue May 17, 2021 · 7 comments
Open

Invisible Meshlib/Tilemap Models #48790

Dente222 opened this issue May 17, 2021 · 7 comments

Comments

@Dente222
Copy link

Dente222 commented May 17, 2021

Godot version:
3.3 Stable "Latest"

OS/device including version:
GTX 1660
GLES3

Issue description:
While working on my game I have noticed that some random tiles like floor/walls/deco were missing from my map
then it has turned out that they were just invisible for some odd reasons and had to place something on them or next to them to update their visibility "Something like in Minecraft"

Example in link below
https://i.imgur.com/hckWSTn.gifv

Steps to reproduce:
This occurs randomly when loading project/map Idk which one exactly

Minimal reproduction project:
Any project will work with it as long as its using Tilemap

@Calinou
Copy link
Member

Calinou commented May 17, 2021

@Dente222 Please upload a minimal reproduction project to make this easier to troubleshoot.

This may be a regression related to the new BVH. Try disabling the rendering BVH in the Project Settings.
Edit: Even if disabling BVH fixes the issue, please upload a project that exhibits the issue with BVH enabled anyway 🙂

@lawnjelly
Copy link
Member

@Dente222 Please upload a minimal reproduction project to make this easier to troubleshoot.

This may be a regression related to the new BVH. Try disabling the rendering BVH in the Project Settings.

There's a slight danger here, there have been 3 reports of a BVH bug, but no reproduction projects, so I can't fix it. If users just switch off the BVH, they may consider it 'fixed', and not bother to make a reproduction project (understandable as it takes time).

So the upshot is it has no opportunity to get fixed. What we may need to do if we don't get any reproduction projects is make some of the betas without this option available (at least in the editor), so affected users have no choice but to address it. This is fairly important as we are rolling it out to physics and to Godot 4.

@Dente222
Copy link
Author

@Dente222 Please upload a minimal reproduction project to make this easier to troubleshoot.
This may be a regression related to the new BVH. Try disabling the rendering BVH in the Project Settings.

There's a slight danger here, there have been 3 reports of a BVH bug, but no reproduction projects, so I can't fix it. If users just switch off the BVH, they may consider it 'fixed', and not bother to make a reproduction project (understandable as it takes time).

So the upshot is it has no opportunity to get fixed. What we may need to do if we don't get any reproduction projects is make some of the betas without this option available (at least in the editor), so affected users have no choice but to address it. This is fairly important as we are rolling it out to physics and to Godot 4.

Will send you my project but keep in mind that its a bit big soo yeah...
also as I said this is pure random wich means that it can affect different tiles in different locations

The project as is, nothing has been changed in settings: https://drive.google.com/file/d/1QZIJLC-UxkorMUcyJArBf3RN-s8dgkiB/view?usp=sharing

@lawnjelly
Copy link
Member

lawnjelly commented May 18, 2021

Thank you for the project. 👍

No luck so far though I haven't been able to reproduce yet but I'll keep trying (but have no doubt it happens for you). What platform are you using, just in case it is platform dependent (I'm on linux)?

I'm slightly suspecting these are due to the BVH being accessed on multiple threads at the same time. What I'm thinking about is making sure as many of the functions are re-entrant as possible (there is a member variable for the current tree in particular, which could be passed in arguments), and seeing what the penalty is for putting a lock on the functions. If I could reproduce it, that would be the first thing I'd try, just using something like a mutex to test. But really I don't like making changes without confirming where the problem lies.

@Dente222
Copy link
Author

Thank you for the project. 👍

No luck so far though I haven't been able to reproduce yet but I'll keep trying (but have no doubt it happens for you). What platform are you using, just in case it is platform dependent (I'm on linux)?

I'm slightly suspecting these are due to the BVH being accessed on multiple threads at the same time. What I'm thinking about is making sure as many of the functions are re-entrant as possible (there is a member variable for the current tree in particular, which could be passed in arguments), and seeing what the penalty is for putting a lock on the functions. If I could reproduce it, that would be the first thing I'd try, just using something like a mutex to test. But really I don't like making changes without confirming where the problem lies.

I'm on Windows 10
But I have noticed that it's affecting all 3D objects, not only Tilemaps

@lawnjelly
Copy link
Member

I'm going to make a tentative PR to try and make the BVH a little more robust. After making the current_tree variable a function argument that is passed around instead of a member variable, I discovered one case I possibly missed when deactivating where the current_tree could have got out of sync. That could possibly be it.

Also I'm going to add an option to the BVH template to make it thread safe with a mutex or lock of some kind. If nothing else, this will enable us to quickly find identify whether problems are due to threading in future.

@lawnjelly
Copy link
Member

I have now got some test builds available in the linked PR #48892. Please if anyone gets these BVH visual bugs, try out the test builds following the instructions in the PR. This will hopefully enable us to pin down the problem and fix it.

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

No branches or pull requests

5 participants