bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
35.75k stars 3.53k forks source link

Missing shader wsgl file doesn't lead to panic #6267

Open gilescope opened 2 years ago

gilescope commented 2 years ago

Bevy version

0.8

What you did

Copy shader instancing example code but didn't put the instancing.wgsl file in asset/shaders.

What went wrong

I'm sure I won't be the last idiot to not copy the shader file, would be great to have ideally a better error message or to point out at the top of the example file the additional asset files that the example depends on (or both).

Pietrek14 commented 2 years ago

I think I can fix that.

Pietrek14 commented 2 years ago

Doesn't it raise a warning? In my case it prints WARN bevy_asset::asset_server: encountered an error while reading an asset: path not found.

gilescope commented 2 years ago

Will try and configure warnings to display. Shouldn't it be an error rather than a warning? Temporary disk read errors are rare. Personally I'd be happy if it was include_str! and a compile error. Though I do appreciate that that precludes hot reloading and twiddling with the shader on the fly.

gilescope commented 2 years ago

Having one of the shader examples showing how to include_str the shader and embed it would be cool.