#[Crash in WASM] Rgba16Unorm can't be used due to missing features

10 messages · Page 1 of 1 (latest)

gloomy girder
#

I'm unable to load a GLB/GLTF that uses a texture created in Blender(Using Simple Bake). The game crashes with the error shown in the image:

wgpu error: Validation Error

Caused by:
    In Device::create_texture
    Texture format Rgba16Unorm can't be used due to missing features
    Features Features(TEXTURE_FORMAT_16BIT_NORM) are required but not enabled on the device

This happens only in WASM (works in native). Upon removing this texture Web/WASM build works fine. Currently using Bevy 0.12.1. This used to work fine in Bevy 0.11.

The texture seems to be using 16 bit gamma integer precision as seen in GIMP. Also I'm running an M2 Mac.

I think this could be happening due to: https://github.com/bevyengine/bevy/pull/9611

GitHub

Objective
fix #8185, #6710
replace #7005 (closed)
rgb and rgba 16 bit textures currently default to Rgba16Uint, the more common use is Rgba16Unorm, which also matches the default type of rgb8 and ...

gloomy girder
rocky escarp
#

16bit unorm is 16bits of resolution from 0 to 1, I think WebGL2 doesn't support Rgba16Unorm

#

You could use Rgba16Float or Rgba8Unorm

gloomy girder
#

Hmm. Running the texture through kram makes it work using Rgba8.

kram encode -input assets/texture.png -output assets/texture_conv.ktx2 -zstd 0 -format rgba8 -encoder explicit

Was hoping to have basic baked textures from Blender GLB to work as is. Looks like I'll need to run the textures through kram for this.

rocky escarp
#

If your texture has much resolution at all, and you may be far away from the texture, generating mips can make rendering quite a lot faster too since it improves cache locality for the gpu texture fetches

gloomy girder
# rocky escarp if you use .gltf you can replace the file names in the gltf with the ktx2 and it...

Thanks! I've got a very similar setup inspired from your old jam games 😛 and klafsa.
But thought that would be necessary when textures are larger.

For simple scenes with low res textures, I was hoping to get away with just GLBs out of the box from Blender and Idk if there's an easy way to specify the output texture format. The expectation is that it works out of the box. But now I know that there's some gotchas.

rocky escarp
#

In SimpleBake you could try this: