Пример #1
0
        private void SetupMaterial(ref TextureMergeRect textureMergeRect, UMAData.MaterialFragment source, int i2, ref Rect overlayRect, int textureType)
        {
            textureMergeRect.rect = overlayRect;
            textureMergeRect.tex  = source.overlays[i2].textureList[textureType];
            if (source.overlays[i2].overlayType == OverlayDataAsset.OverlayType.Normal)
            {
                switch (source.slotData.asset.material.channels[textureType].channelType)
                {
                case UMAMaterial.ChannelType.NormalMap:
                    textureMergeRect.mat.shader = normalShader;
                    break;

                case UMAMaterial.ChannelType.Texture:
                    textureMergeRect.mat.shader = dataShader;
                    break;

                case UMAMaterial.ChannelType.DiffuseTexture:
                    textureMergeRect.mat.shader = diffuseShader;
                    break;
                }
                textureMergeRect.mat.SetTexture("_MainTex", source.overlays[i2].textureList[textureType]);
                textureMergeRect.mat.SetTexture("_ExtraTex", source.overlays[i2].alphaTexture);
                textureMergeRect.mat.SetColor("_Color", source.GetMultiplier(i2 + 1, textureType));
                textureMergeRect.mat.SetColor("_AdditiveColor", source.GetAdditive(i2 + 1, textureType));
            }
            else
            {
                textureMergeRect.mat.shader = cutoutShader;
            }
        }
Пример #2
0
        private void SetupMaterial(ref TextureMergeRect textureMergeRect, UMAData.MaterialFragment source, int textureType)
        {
            textureMergeRect.tex = source.baseOverlay.textureList[textureType];

            switch (source.slotData.asset.material.channels[textureType].channelType)
            {
            case UMAMaterial.ChannelType.NormalMap:
                textureMergeRect.mat.shader = normalShader;
                foreach (UMAPostProcess process in normalPostProcesses)
                {
                    process.enabled = true;
                }
                break;

            case UMAMaterial.ChannelType.Texture:
                textureMergeRect.mat.shader = dataShader;
                foreach (UMAPostProcess process in dataPostProcesses)
                {
                    process.enabled = true;
                }
                break;

            case UMAMaterial.ChannelType.DiffuseTexture:
                textureMergeRect.mat.shader = diffuseShader;
                foreach (UMAPostProcess process in diffusePostProcesses)
                {
                    process.enabled = true;
                }
                break;
            }
            textureMergeRect.mat.SetTexture("_MainTex", source.baseOverlay.textureList[textureType]);
            textureMergeRect.mat.SetTexture("_ExtraTex", source.baseOverlay.alphaTexture);
            textureMergeRect.mat.SetColor("_Color", source.GetMultiplier(0, textureType));
            textureMergeRect.mat.SetColor("_AdditiveColor", source.GetAdditive(0, textureType));
        }
        private void SetupMaterial(ref TextureMergeRect textureMergeRect, UMAData.MaterialFragment source, int textureType)
        {
            camBackgroundColor   = source.GetMultiplier(0, textureType);
            camBackgroundColor.a = 0.0f;

            textureMergeRect.tex = source.baseOverlay.textureList[textureType];

            switch (source.slotData.asset.material.channels[textureType].channelType)
            {
            case UMAMaterial.ChannelType.NormalMap:
                textureMergeRect.mat.shader = normalShader;
                break;

            case UMAMaterial.ChannelType.Texture:
                textureMergeRect.mat.shader = dataShader;
                break;

            case UMAMaterial.ChannelType.DiffuseTexture:
                textureMergeRect.mat.shader = diffuseShader;
                break;

            case UMAMaterial.ChannelType.DetailNormalMap:
                textureMergeRect.mat.shader = detailNormalShader;
                break;
            }
            textureMergeRect.mat.SetTexture("_MainTex", source.baseOverlay.textureList[textureType]);
            textureMergeRect.mat.SetTexture("_ExtraTex", source.baseOverlay.alphaTexture);
            textureMergeRect.mat.SetColor("_Color", source.GetMultiplier(0, textureType));
            textureMergeRect.mat.SetColor("_AdditiveColor", source.GetAdditive(0, textureType));
        }
Пример #4
0
 private void SetupMaterial(ref TextureMergeRect textureMergeRect, UMAData.MaterialFragment source, int textureType)
 {
     textureMergeRect.tex        = source.baseTexture[textureType];
     textureMergeRect.mat.shader = (textureType == 1)? normalShader : diffuseShader;
     textureMergeRect.mat.SetTexture("_MainTex", source.baseTexture[textureType]);
     textureMergeRect.mat.SetTexture("_ExtraTex", source.baseTexture[0]);
     textureMergeRect.mat.SetColor("_Color", source.GetMultiplier(0, textureType));
     textureMergeRect.mat.SetColor("_AdditiveColor", source.GetAdditive(0, textureType));
 }
Пример #5
0
 private void SetupMaterial(ref TextureMergeRect textureMergeRect, UMAData.MaterialFragment source, int i2, ref Rect overlayRect, int textureType)
 {
     textureMergeRect.rect       = overlayRect;
     textureMergeRect.tex        = source.overlays[i2].textureList[textureType];
     textureMergeRect.mat.shader = (source.slotData.asset.material.channels[textureType].channelType == UMAMaterial.ChannelType.NormalMap) ? normalShader : diffuseShader;
     textureMergeRect.mat.SetTexture("_MainTex", source.overlays[i2].textureList[textureType]);
     textureMergeRect.mat.SetTexture("_ExtraTex", source.overlays[i2].textureList[0]);
     textureMergeRect.mat.SetColor("_Color", source.GetMultiplier(i2 + 1, textureType));
     textureMergeRect.mat.SetColor("_AdditiveColor", source.GetAdditive(i2 + 1, textureType));
 }