Skip to content

glTF scene loader uses wrong color space #6827

@BigWingBeat

Description

@BigWingBeat

Bevy version

0.9.1

What you did

Loaded a glTF scene

use bevy::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_startup_system(load_scene)
        .run()
}

fn load_scene(mut commands: Commands, assets: Res<AssetServer>) {
    commands.spawn(SceneBundle {
        scene: assets.load("repro.gltf#Scene0"),
        ..Default::default()
    });
}

What went wrong

The colors of all of the models were different than they were in Blender:

Blender:
cyan-blender
Bevy:
cyan-bevy
Blender:
grey-blender
Bevy:
grey-bevy
Blender:
lime-blender
Bevy:
lime-bevy

Additional information

Bevy's glTF loader interprets colors in the sRGB color space, which is incorrect - glTF mandates that colors be specified in linear color space.

Initially I assumed that Bevy was correct and Blender was at fault, but this was disproved shortly after I reported it as a bug in Blender.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-AssetsLoad files from disk to use for things like images, models, and soundsA-RenderingDrawing game state to the screenC-BugAn unexpected or incorrect behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions