Skip to content

Commit

Permalink
fix export of UV offset/tiling for non-main textures
Browse files Browse the repository at this point in the history
  • Loading branch information
hybridherbst committed Mar 12, 2021
1 parent 43a4603 commit d49a58b
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,14 @@ private void ExportTextureTransform(TextureInfo def, Material mat, string texNam
Vector2 offset = mat.GetTextureOffset(texName);
Vector2 scale = mat.GetTextureScale(texName);

if (offset == Vector2.zero && scale == Vector2.one) return;
if (offset == Vector2.zero && scale == Vector2.one)
{
// difficult choice here: some shaders might support texture transform per-texture, others use the main transform.
offset = mat.mainTextureOffset;
scale = mat.mainTextureScale;
// offset.x = 1 - offset.x;
// return;
}

if (_root.ExtensionsUsed == null)
{
Expand Down

0 comments on commit d49a58b

Please sign in to comment.