-
Notifications
You must be signed in to change notification settings - Fork 430
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #963 from Santarh/refactorTextureExporter
Even if the texture instance is the same, if the color space required by the glTF specification is different, it will be output as a different texture.
- Loading branch information
Showing
21 changed files
with
165 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
namespace VRMShaders | ||
{ | ||
/// <summary> | ||
/// Texture を用途別に変換の要不要を判断して gltf.textures の index に対応させる機能。 | ||
/// | ||
/// glTF 拡張で Texture の用途を増やす必要がある場合は、この interface を継承して実装すればよい。 | ||
/// </summary> | ||
public interface ITextureExporter | ||
{ | ||
/// <summary> | ||
/// Export する Texture2D のリスト。これが gltf.textures になる | ||
/// </summary> | ||
IReadOnlyList<(Texture2D, UniGLTF.ColorSpace)> Exported { get; } | ||
|
||
/// <summary> | ||
/// 指定の Texture を、 sRGB 色空間の値を持つ Texture に出力するように指示する。 | ||
/// </summary> | ||
int ExportAsSRgb(Texture src); | ||
|
||
/// <summary> | ||
/// 指定の Texture を、 Linear の値を持つ Texture に出力するように指示する。 | ||
/// </summary> | ||
int ExportAsLinear(Texture src); | ||
|
||
/// <summary> | ||
/// 指定の Metallic, Roughness, Occlusion 情報を、 glTF 仕様に準拠した 1 枚の合成テクスチャとして出力するように指示する。 | ||
/// </summary> | ||
int ExportAsGltfMetallicSmoothnessOcclusionCombined(Texture metallicSmoothTexture, float smoothness, Texture occlusionTexture); | ||
|
||
/// <summary> | ||
/// 指定の Texture を、glTF 仕様に準拠した Normal Texture に出力するように指示する。 | ||
/// </summary> | ||
int ExportAsNormal(Texture src); | ||
} | ||
} |
Oops, something went wrong.