Skip to content
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

Adding ability to turn off mipmap generation. #507

Merged
merged 1 commit into from Oct 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion UnityGLTF/Assets/UnityGLTF/Scripts/GLTFSceneImporter.cs
Expand Up @@ -167,6 +167,11 @@ public bool IsMultithreaded
/// </remaks>
public bool KeepCPUCopyOfTexture = true;

/// <summary>
/// Specifies whether the MipMap chain should be generated for model textures
/// </summary>
public bool GenerateMipMapsForTextures = true;

/// <summary>
/// When screen coverage is above threashold and no LOD mesh cull the object
/// </summary>
Expand Down Expand Up @@ -734,7 +739,7 @@ protected async Task ConstructImage(GLTFImage image, int imageCacheIndex, bool m

protected virtual async Task ConstructUnityTexture(Stream stream, bool markGpuOnly, bool isLinear, GLTFImage image, int imageCacheIndex)
{
Texture2D texture = new Texture2D(0, 0, TextureFormat.RGBA32, true, isLinear);
Texture2D texture = new Texture2D(0, 0, TextureFormat.RGBA32, GenerateMipMapsForTextures, isLinear);
texture.name = nameof(GLTFSceneImporter) + (image.Name != null ? ("." + image.Name) : "");

if (stream is MemoryStream)
Expand Down