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

Render chunks with tilemap Entity generation > 0 are not visible #450

Closed
rparrett opened this issue Jul 24, 2023 · 4 comments · Fixed by #451
Closed

Render chunks with tilemap Entity generation > 0 are not visible #450

rparrett opened this issue Jul 24, 2023 · 4 comments · Fixed by #451
Labels
bug Something isn't working

Comments

@rparrett
Copy link
Collaborator

rparrett commented Jul 24, 2023

AdapterInfo { name: "Apple M1 Max", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }
SystemInfo { os: "MacOS 13.4.1 ", kernel: "22.5.0", cpu: "Apple M1 Max", core_count: "10", memory: "64.0 GiB" }

bisected to 7f5113a

I remember noticing this here: #428 (comment) but can't recall if there was a fix that maybe didn't survive a merge or something.

Repro

cargo run --example chunking

Hold thew key. Newly spawned chunks after the initial setup mostly do not display.

chunking

@rparrett
Copy link
Collaborator Author

rparrett commented Jul 24, 2023

Still not sure what's going on here, but I have a few observations:

  • New chunks seem to be spawned, and old chunks despawned, but new chunks do not render (most of the time)
  • Same issue is present with the atlas feature.
  • Same issue is present after adding FrustumCulling(false).
  • The example "works" (all tilemaps are displayed) if you remove the despawning of far-away chunks.
  • Same issue is present when using MyMaterial from the custom_shader example with its handle stored in a resource.
  • Same issue is present when storing the texture handle in a resource.

@StarArawn StarArawn added the bug Something isn't working label Jul 25, 2023
@brandon-reinhart
Copy link

Not sure if related, but I noticed that my layer 0 in a multi-layer Tiled map won't render if I have some combinations of totally unrelated despawn_recursive's happen prior and when I examine the map the texture handle on that first layer seems borked. I will try and produce a minimal example. It's kind of in that territory of "might be related, but might be something my particular game's code is doing differently." Without any other changes, it worked fine prior to 0.11.

@rparrett
Copy link
Collaborator Author

rparrett commented Jul 25, 2023

Another bizarre observation:

Only tilemap entities with a generation of 0 show up. This is reliably reproducible.

image

@rparrett
Copy link
Collaborator Author

rparrett commented Jul 25, 2023

The tilemap entity generation is being dropped and the entity is later reconstructed without it.

I haven't fully untangled this, but this seems very likely to be the problem. Tilemaps that work as expected are the ones that coincidentally have a generation of the default 0.

We can likely use to_bits and from_bits for this sort of thing at the cost of 32 bits.

image

@rparrett rparrett changed the title chunking example not working Render chunks with Entity generation > 0 are not visible Jul 25, 2023
@rparrett rparrett changed the title Render chunks with Entity generation > 0 are not visible Render chunks with tilemap Entity generation > 0 are not visible Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants