-
Notifications
You must be signed in to change notification settings - Fork 430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. #963
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
275ac63
Check export texture in editor
Santarh 22f4c5c
comment
Santarh 1d6f58f
define interface
Santarh 7963c4f
make enum private
Santarh ef929de
rename & use interface
Santarh 21bcd14
たとえ同じ Texture インスタンスであっても、glTF のプロパティが要求する色空間が違えば別のテクスチャとして出力する
Santarh 82106f6
Rename, Comment
Santarh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
インタフェース化。glTF 拡張を実装する際にテクスチャの用途が増えたとしても、容易に拡張できる。