Bevy's HttpWasmAssetReader fetches asset paths over HTTP at runtime, requesting 'assets/shaders/*.wgsl' (matching AssetPlugin's default file_path of "assets"). Trunk only emits what index.html references, so without an explicit copy-dir link the shaders were absent from dist/ and every material hit a 404 → grey screen. Add the copy-dir link so trunk mirrors assets/ into dist/.
28 lines
902 B
HTML
28 lines
902 B
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<title>singularity-rs</title>
|
|
<style>
|
|
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; background: #000; }
|
|
canvas { width: 100vw; height: 100vh; display: block; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<link
|
|
data-trunk rel="rust"
|
|
href="../Cargo.toml"
|
|
data-bin="singularity-rs"
|
|
data-type="main"
|
|
data-cargo-features="bevy/webgpu"
|
|
data-wasm-opt="z"
|
|
/>
|
|
<!-- Ship the WGSL shaders so Bevy's WasmAssetReader can fetch them at
|
|
runtime (it requests `assets/shaders/*.wgsl` over HTTP, matching the
|
|
default AssetPlugin file_path of "assets"). Without this the shaders
|
|
are absent from dist/ and every material loads a 404 fallback → grey
|
|
screen. -->
|
|
<link data-trunk rel="copy-dir" href="../assets" />
|
|
</body>
|
|
</html>
|