#Skybox panicking

11 messages · Page 1 of 1 (latest)

sterile heart
#

I'm trying to make a skybox:

pub fn init_camera(mut commands: Commands, mut asset_server: Res<AssetServer>) {
    commands.spawn(Camera3dBundle::default())
        .insert(MainCamera)
        .insert(CameraTransform::Absolute(Vec3::new(0., 10., 10.), Quat::from_rotation_x(90.)))
        .insert(Skybox {
            image: asset_server.load("skybox.png"),
            brightness: 1000.0,
        });
}

with "./assets/skybox.png" being the attatched cube map. Running it leads to the attached error

merry urchin
#

Have you looked at this example?
https://github.com/bevyengine/bevy/blob/main/examples/3d/skybox.rs
As far as I know, in case of PNG image has to be vertically stacked
(right, left, top, bottom, front, back)
And at the same time you still need to reinterpret this image, a lot of fuss 🙂
I prefer using ktx2.
By the way, it looks like if in your code you replace png file with ktx2 file everything will work

GitHub

A refreshingly simple data-driven game engine built in Rust - bevyengine/bevy

sterile heart
#

I couldn't find any other way of downloading/converting to ktx2's

merry urchin
#

something wrong with your file , cаn you try this one ?

merry urchin
#

I made it like this
ktx.exe create --cubemap --format R8G8B8A8_UNORM --zstd 18 --assign-oetf srgb --assign-primaries bt709 --convert-oetf linear --generate-mipmap right.jpg left.jpg top.jpg bottom.jpg front.jpg back.jpg cubemap.ktx2

sterile heart
merry urchin
#

just remember
was made from png , not jpg
so
ktx.exe create --cubemap --format R8G8B8A8_UNORM --zstd 18 --assign-oetf srgb --assign-primaries bt709 --convert-oetf linear --generate-mipmap right.png left.png top.png bottom.png front.png back.png cubemap.ktx2

sterile heart
merry urchin