Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
Merge pull request #47 from hiroj/normalMap_webgl_fix
Browse files Browse the repository at this point in the history
webgl normalmap fix
  • Loading branch information
ousttrue authored Oct 5, 2018
2 parents 06e7636 + 43afe78 commit b302838
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Core/Scripts/IO/TextureConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ private Material GetEncoder()

public Texture2D GetImportTexture(Texture2D texture)
{
#if UNITY_WEBGL && !UNITY_EDITOR
return texture;
#endif
var mat = GetEncoder();
var converted = TextureConverter.Convert(texture, glTFTextureTypes.Normal, null, mat);
TextureConverter.AppendTextureExtension(converted, m_extension);
Expand All @@ -121,6 +124,9 @@ public Texture2D GetImportTexture(Texture2D texture)

public Texture2D GetExportTexture(Texture2D texture)
{
#if UNITY_WEBGL && !UNITY_EDITOR
return texture;
#endif
var mat = GetDecoder();
var converted = TextureConverter.Convert(texture, glTFTextureTypes.Normal, null, mat);
TextureConverter.RemoveTextureExtension(converted, m_extension);
Expand Down

0 comments on commit b302838

Please sign in to comment.