mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-13 06:20:01 -05:00
コミット漏れと mipmapCount
This commit is contained in:
@@ -26,7 +26,7 @@ namespace UniGLTF
|
||||
|
||||
public static glFilter ExportMinFilter(Texture2D texture)
|
||||
{
|
||||
if (texture.mipmapCount > 0)
|
||||
if (texture.mipmapCount > 1)
|
||||
{
|
||||
switch (texture.filterMode)
|
||||
{
|
||||
|
||||
@@ -38,6 +38,14 @@ namespace VRMShaders
|
||||
textureImporter.SaveAndReimport();
|
||||
}
|
||||
|
||||
public static void ConfigureSampler(TextureImportParam param, TextureImporter textureImporter)
|
||||
{
|
||||
textureImporter.mipmapEnabled = param.Sampler.EnableMipMap;
|
||||
textureImporter.filterMode = param.Sampler.FilterMode;
|
||||
textureImporter.wrapModeU = param.Sampler.WrapModesU;
|
||||
textureImporter.wrapModeV = param.Sampler.WrapModesV;
|
||||
}
|
||||
|
||||
class ImporterGetter : IDisposable
|
||||
{
|
||||
public TextureImporter Importer;
|
||||
@@ -110,6 +118,8 @@ namespace VRMShaders
|
||||
default:
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
ConfigureSampler(textureInfo, importer);
|
||||
}
|
||||
|
||||
public static void Configure(TextureImportParam textureInfo, IDictionary<string, Texture2D> ExternalMap)
|
||||
|
||||
23
Assets/VRMShaders/GLTF/IO/Runtime/TextureExtensions.cs
Normal file
23
Assets/VRMShaders/GLTF/IO/Runtime/TextureExtensions.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace VRMShaders
|
||||
{
|
||||
public static class TextureExtensions
|
||||
{
|
||||
public static bool HasMipMap(this Texture texture)
|
||||
{
|
||||
if (texture is Texture2D t2)
|
||||
{
|
||||
return t2.mipmapCount > 1;
|
||||
}
|
||||
else if (texture is RenderTexture rt)
|
||||
{
|
||||
return rt.useMipMap;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/VRMShaders/GLTF/IO/Runtime/TextureExtensions.cs.meta
Normal file
11
Assets/VRMShaders/GLTF/IO/Runtime/TextureExtensions.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 48a12f7410d9670439e5aef512fe0a6c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user