Skip to content

Commit

Permalink
Corrent normal encoding for runtime imported normals maps
Browse files Browse the repository at this point in the history
  • Loading branch information
pfcDorn committed Jan 16, 2024
1 parent c5bbd35 commit a7e335a
Show file tree
Hide file tree
Showing 5 changed files with 1,969 additions and 239 deletions.
7 changes: 7 additions & 0 deletions Runtime/Scripts/SceneImporter/ImporterMaterials.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ void CalculateYOffsetAndScale(TextureId textureId, ExtTextureTransformExtension
mapper.Material.SetFloat("_BUILTIN_QueueControl", -1);
mapper.Material.SetFloat("_QueueControl", -1);

#if !UNITY_EDITOR
mapper.Material.SetFloat("_RuntimeCreatedNormalMap", 1);
#else
if (Context.SourceImporter == null)
mapper.Material.SetFloat("_RuntimeCreatedNormalMap", 1);
#endif

void SetTransformKeyword()
{
MatHelper.SetKeyword(mapper.Material, "_TEXTURE_TRANSFORM", true);
Expand Down

0 comments on commit a7e335a

Please sign in to comment.