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:
		
							parent
							
								
									6ada3566ac
								
							
						
					
					
						commit
						89451226de
					
				| @ -669,7 +669,7 @@ fn load_material(material: &Material, load_context: &mut LoadContext) -> Handle< | |||||||
|     load_context.set_labeled_asset( |     load_context.set_labeled_asset( | ||||||
|         &material_label, |         &material_label, | ||||||
|         LoadedAsset::new(StandardMaterial { |         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, |             base_color_texture, | ||||||
|             perceptual_roughness: pbr.roughness_factor(), |             perceptual_roughness: pbr.roughness_factor(), | ||||||
|             metallic: pbr.metallic_factor(), |             metallic: pbr.metallic_factor(), | ||||||
| @ -682,7 +682,7 @@ fn load_material(material: &Material, load_context: &mut LoadContext) -> Handle< | |||||||
|                 Some(Face::Back) |                 Some(Face::Back) | ||||||
|             }, |             }, | ||||||
|             occlusion_texture, |             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, |             emissive_texture, | ||||||
|             unlit: material.unlit(), |             unlit: material.unlit(), | ||||||
|             alpha_mode: alpha_mode(material), |             alpha_mode: alpha_mode(material), | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Pixelstorm
						Pixelstorm