Intepret glTF colors as linear instead of sRGB (#6828)

# Objective

Fixes #6827

## Solution

Use the `Color::rgba_linear` function instead of the `Color::rgba` function to correctly interpret colors from glTF files in the linear color space rather than the incorrect sRGB color space
This commit is contained in:
Pixelstorm 2022-12-04 19:35:13 +00:00
parent 6ada3566ac
commit 89451226de

View file

@ -669,7 +669,7 @@ fn load_material(material: &Material, load_context: &mut LoadContext) -> Handle<
load_context.set_labeled_asset(
&material_label,
LoadedAsset::new(StandardMaterial {
base_color: Color::rgba(color[0], color[1], color[2], color[3]),
base_color: Color::rgba_linear(color[0], color[1], color[2], color[3]),
base_color_texture,
perceptual_roughness: pbr.roughness_factor(),
metallic: pbr.metallic_factor(),
@ -682,7 +682,7 @@ fn load_material(material: &Material, load_context: &mut LoadContext) -> Handle<
Some(Face::Back)
},
occlusion_texture,
emissive: Color::rgba(emissive[0], emissive[1], emissive[2], 1.0),
emissive: Color::rgb_linear(emissive[0], emissive[1], emissive[2]),
emissive_texture,
unlit: material.unlit(),
alpha_mode: alpha_mode(material),