mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-06-10 09:50:37 -05:00
fixMagFiler
This commit is contained in:
parent
c4ef86c7e8
commit
87e13d9bb0
|
|
@ -8,7 +8,24 @@ namespace UniGLTF
|
|||
public static class TextureSamplerUtil
|
||||
{
|
||||
#region Export
|
||||
public static glFilter ExportFilterMode(Texture texture)
|
||||
// MagFilter は 2種類だけ
|
||||
public static glFilter ExportMagFilter(Texture texture)
|
||||
{
|
||||
switch (texture.filterMode)
|
||||
{
|
||||
case FilterMode.Point:
|
||||
return glFilter.NEAREST;
|
||||
|
||||
case FilterMode.Bilinear:
|
||||
case FilterMode.Trilinear:
|
||||
return glFilter.LINEAR;
|
||||
|
||||
default:
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public static glFilter ExportMinFilter(Texture texture)
|
||||
{
|
||||
switch (texture.filterMode)
|
||||
{
|
||||
|
|
@ -68,13 +85,14 @@ namespace UniGLTF
|
|||
|
||||
public static glTFTextureSampler Export(Texture texture)
|
||||
{
|
||||
var filter = ExportFilterMode(texture);
|
||||
var magFilter = ExportMagFilter(texture);
|
||||
var minFilter = ExportMinFilter(texture);
|
||||
var wrapS = ExportWrapMode(GetWrapS(texture));
|
||||
var wrapT = ExportWrapMode(GetWrapT(texture));
|
||||
return new glTFTextureSampler
|
||||
{
|
||||
magFilter = filter,
|
||||
minFilter = filter,
|
||||
magFilter = magFilter,
|
||||
minFilter = minFilter,
|
||||
wrapS = wrapS,
|
||||
wrapT = wrapT,
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user