fix (VRM1.0, MToon): Fix color space of emissiveFactor (2)

conversion should not be done throughout the entire UniVRM procedure
This commit is contained in:
0b5vr
2021-10-29 13:46:37 +09:00
parent acb9a25ce2
commit 21eaa5307e
3 changed files with 6 additions and 3 deletions

View File

@@ -84,7 +84,8 @@ namespace UniVRM10
mtoon.GiEqualizationFactor = context.GiEqualizationFactor;
// Emission
dst.emissiveFactor = context.EmissiveFactorLinear.ToFloat3(ColorSpace.sRGB, ColorSpace.Linear);
// Emissive factor is stored in Linear space
dst.emissiveFactor = context.EmissiveFactorLinear.ToFloat3(ColorSpace.Linear, ColorSpace.Linear);
var emissiveTextureIndex = textureExporter.RegisterExportingAsSRgb(context.EmissiveTexture, needsAlpha: false);
if (emissiveTextureIndex != -1)
{

View File

@@ -72,7 +72,8 @@ namespace UniVRM10
// GI
// Emission
var emissionColor = material?.emissiveFactor?.ToColor3(gltfColorSpace, ColorSpace.sRGB);
// Emissive factor should be stored in Linear space
var emissionColor = material?.emissiveFactor?.ToColor3(gltfColorSpace, ColorSpace.Linear);
if (emissionColor.HasValue)
{
yield return (MToon10Prop.EmissiveFactor.ToUnityShaderLabName(), emissionColor.Value);

View File

@@ -102,7 +102,8 @@ namespace VRMShaders.VRM10.MToon10.Runtime
// Emission
public Color EmissiveFactorLinear
{
get => _material.GetColor(MToon10Prop.EmissiveFactor).linear;
// Emissive factor is stored in Linear space
get => _material.GetColor(MToon10Prop.EmissiveFactor);
}
public Texture EmissiveTexture