EmiOnGit / warbler_grass

A bevy plugin for creating 3d grass in your game
Apache License 2.0
120 stars 11 forks source link

The wind texture is sometimes never loaded #25

Closed janhohenheim closed 1 year ago

janhohenheim commented 1 year ago

Describe the bug

In prepare_uniform_buffers, we exit early if RegionConfiguration did not change. However, we might have set FallbackImage before as the wind texture if the correct one didn't load yet! This means that if in the first frame we set the fallback image, we never change it.

To Reproduce

Open an example a bunch of times. Sometimes the wind does not trigger.

Expected behavior

Wind should always work once the texture was loaded

Additional context

A simple mut loaded: Local<bool> could be used as a hacky way to fix this.

EmiOnGit commented 1 year ago

Interesting! Never considered this. Yeah ultimately I think your fix is fine. I've also heard about conditional systems in the release that is coming the next days we could also use this but in the end it doesn't matter