0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【エラー解消】BevyEngineでブラウザ向けに出力する際に画像が表示されない

Posted at

前提

環境
OS Mac(Intel)
Language Rust
Framework BevyEngine 0.17.2
IDE Zed 0.212.3

事象

BevyEngineでブラウザ向けにwasm出力した際、npx http-serverでは正常にキャラクターや背景が表示されたが、Cloudflareにデプロイすると画面が真っ暗になってしまう事象が発生。

解消できた方法

DefaultPluginsAssetPlugin.meta_checkAssetMetaCheck::Neverを設定する。
wasmビルドで.metaファイルを要求しないようにするもの(これが不足していて画像が表示されなかったようです)。

App::new()
  .add_plugins(
      DefaultPlugins.set(AssetPlugin {
          meta_check: bevy::asset::AssetMetaCheck::Never, // これが必要
          ..default()
      })
  )
  .run();

issueprで話は挙がっていたようですが、Unofficial Bevy Cheat Bookに記載がなかったので、なかなか手こずりました。

議題にも挙がっている通り、将来的にはデフォルトでNeverになるかもですが、ひとまず現時点のバージョン(0.17.2)では明示的な設定が必要なようです。
ブラウザ向けにビルドしたい場合はご注意ください。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?