mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-13 06:20:01 -05:00
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:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user