Skip to content

Commit

Permalink
Manual Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaimi committed Jan 30, 2020
1 parent e8ed44f commit c4a0dc1
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ protected override IEnumerator workerMethod()
yield return null;
}


for (int atlasIndex = umaData.generatedMaterials.materials.Count - 1; atlasIndex >= 0; atlasIndex--)
{
var atlas = umaData.generatedMaterials.materials[atlasIndex];
Expand Down Expand Up @@ -104,8 +103,8 @@ protected override IEnumerator workerMethod()
{
continue;
}
destinationTexture = new RenderTexture(Mathf.FloorToInt(atlas.cropResolution.x * umaData.atlasResolutionScale), Mathf.FloorToInt(atlas.cropResolution.y * umaData.atlasResolutionScale), 0, slotData.asset.material.channels[textureType].textureFormat, RenderTextureReadWrite.Linear);

destinationTexture = new RenderTexture(Mathf.FloorToInt(atlas.cropResolution.x * umaData.atlasResolutionScale), Mathf.FloorToInt(atlas.cropResolution.y * umaData.atlasResolutionScale), 0, slotData.asset.material.channels[textureType].textureFormat, RenderTextureReadWrite.Linear);
destinationTexture.filterMode = FilterMode.Point;
destinationTexture.useMipMap = umaGenerator.convertMipMaps && !umaGenerator.convertRenderTexture;
//Draw all the Rects here
Expand All @@ -127,7 +126,7 @@ protected override IEnumerator workerMethod()

//PostProcess
textureMerge.PostProcess(destinationTexture, slotData.asset.material.channels[textureType].channelType);

int DownSample = slotData.asset.material.channels[textureType].DownSample;
if (DownSample != 0)
{
Expand Down Expand Up @@ -205,7 +204,10 @@ protected override IEnumerator workerMethod()
tempTexture.Compress(slotData.asset.material.channels[textureType].Compression == UMAMaterial.CompressionSettings.HighQuality);
}
resultingTextures[textureType] = tempTexture;
atlas.material.SetTexture(slotData.asset.material.channels[textureType].materialPropertyName, tempTexture);
if (!slotData.asset.material.channels[textureType].NonShaderTexture)
{
atlas.material.SetTexture(slotData.asset.material.channels[textureType].materialPropertyName, tempTexture);
}
#endregion
}
else
Expand All @@ -215,7 +217,10 @@ protected override IEnumerator workerMethod()
destinationTexture.filterMode = slotData.asset.material.MatFilterMode;
destinationTexture.wrapMode = TextureWrapMode.Repeat;
resultingTextures[textureType] = destinationTexture;
atlas.material.SetTexture(slotData.asset.material.channels[textureType].materialPropertyName, destinationTexture);
if (!slotData.asset.material.channels[textureType].NonShaderTexture)
{
atlas.material.SetTexture(slotData.asset.material.channels[textureType].materialPropertyName, destinationTexture);
}
}

break;
Expand All @@ -224,6 +229,7 @@ protected override IEnumerator workerMethod()
resultingTextures[textureType] = tempTexture;
if (!slotData.asset.material.channels[textureType].NonShaderTexture)
{
<<<<<<< Updated upstream
atlas.material.SetTexture(slotData.asset.material.channels[textureType].materialPropertyName, tempTexture);
}
#endregion
Expand Down Expand Up @@ -268,6 +274,11 @@ protected override IEnumerator workerMethod()
atlas.material.color = fragment.baseColor;
}
}
=======
if (slotData.asset.material.channels[textureType].NonShaderTexture) break;
atlas.material.SetColor(slotData.asset.material.channels[textureType].materialPropertyName, atlas.materialFragments[0].baseColor);
break;
>>>>>>> Stashed changes
}
case UMAMaterial.ChannelType.TintedTexture:
{
Expand All @@ -279,7 +290,10 @@ protected override IEnumerator workerMethod()
{
if (fragment.baseOverlay.textureList[j] != null)
{
atlas.material.SetTexture(slotData.asset.material.channels[j].materialPropertyName, fragment.baseOverlay.textureList[j]);
if (!slotData.asset.material.channels[textureType].NonShaderTexture)
{
atlas.material.SetTexture(slotData.asset.material.channels[j].materialPropertyName, fragment.baseOverlay.textureList[j]);
}
if (j == 0)
{
atlas.material.color = fragment.baseColor;
Expand All @@ -291,11 +305,19 @@ protected override IEnumerator workerMethod()
for (int j = 0; j < overlay.textureList.Length; j++)
{
if (overlay.textureList[j] != null)
<<<<<<< Updated upstream
{
if (!slotData.asset.material.channels[textureType].NonShaderTexture)
{
atlas.material.SetTexture(slotData.asset.material.channels[j].materialPropertyName, overlay.textureList[j]);
}
=======
{
if (!slotData.asset.material.channels[textureType].NonShaderTexture)
{
atlas.material.SetTexture(slotData.asset.material.channels[j].materialPropertyName, overlay.textureList[j]);
}
>>>>>>> Stashed changes
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,4 @@ public bool Equals(UMAMaterial material)
}

}
}
}

0 comments on commit c4a0dc1

Please sign in to comment.