protected void ApplySharedData(Material m)
    {
        if (propData != null)
        {
            m.SetTexture("_PerTexProps", propData.GetTexture());
        }
#if __MICROSPLAT_GLOBALTEXTURE__
        if (m.HasProperty("_GeoCurve") && propData != null)
        {
            m.SetTexture("_GeoCurve", propData.GetGeoCurve());
        }
        if (m.HasProperty("_GeoSlopeTex") && propData != null)
        {
            m.SetTexture("_GeoSlopeTex", propData.GetGeoSlopeFilter());
        }
        if (m.HasProperty("_GlobalSlopeTex") && propData != null)
        {
            m.SetTexture("_GlobalSlopeTex", propData.GetGlobalSlopeFilter());
        }
#endif


#if __MICROSPLAT_PROCTEX__
        if (procTexCfg != null)
        {
            if (m.HasProperty("_ProcTexCurves"))
            {
                m.SetTexture("_ProcTexCurves", procTexCfg.GetCurveTexture());
                m.SetTexture("_ProcTexParams", procTexCfg.GetParamTexture());
                m.SetInt("_PCLayerCount", procTexCfg.layers.Count);
            }
            if (m.HasProperty("_PCHeightGradients"))
            {
                m.SetTexture("_PCHeightGradients", procTexCfg.GetHeightGradientTexture());
            }
            if (m.HasProperty("_PCHeightHSV"))
            {
                m.SetTexture("_PCHeightHSV", procTexCfg.GetHeightHSVTexture());
            }

            if (m.HasProperty("_PCSlopeGradients"))
            {
                m.SetTexture("_PCSlopeGradients", procTexCfg.GetSlopeGradientTexture());
            }
            if (m.HasProperty("_PCSlopeHSV"))
            {
                m.SetTexture("_PCSlopeHSV", procTexCfg.GetSlopeHSVTexture());
            }
        }
#endif
    }
예제 #2
0
    protected void ApplyMaps(Material m)
    {
        SetMap(m, "_PerPixelNormal", perPixelNormal);
        SetMap(m, "_StreamControl", streamTexture);

#if __MICROSPLAT_ALPHAHOLE__
        SetMap(m, "_AlphaHoleTexture", clipMap);
#endif

#if __MICROSPLAT_GLOBALTEXTURE__
        SetMap(m, "_GeoTex", geoTextureOverride);
        SetMap(m, "_GlobalTintTex", tintMapOverride);
        SetMap(m, "_GlobalNormalTex", globalNormalOverride);
        SetMap(m, "_GlobalSAOMTex", globalSAOMOverride);
        SetMap(m, "_GlobalEmisTex", globalEmisOverride);
        if (m.HasProperty("_GeoCurve") && propData != null)
        {
            m.SetTexture("_GeoCurve", propData.GetGeoCurve());
        }
        if (m.HasProperty("_GeoSlopeTex") && propData != null)
        {
            m.SetTexture("_GeoSlopeTex", propData.GetGeoSlopeFilter());
        }
        if (m.HasProperty("_GlobalSlopeTex") && propData != null)
        {
            m.SetTexture("_GlobalSlopeTex", propData.GetGlobalSlopeFilter());
        }
#endif

#if __MICROSPLAT_SCATTER__
        SetMap(m, "_ScatterControl", scatterMapOverride);
#endif

#if __MICROSPLAT_SNOW__
        SetMap(m, "_SnowMask", snowMaskOverride);
#endif

#if (VEGETATION_STUDIO || VEGETATION_STUDIO_PRO)
        SetMap(m, "_VSGrassMap", vsGrassMap);
        SetMap(m, "_VSShadowMap", vsShadowMap);
#endif

#if __MICROSPLAT_ADVANCED_DETAIL__
        SetMap(m, "_AdvDetailControl", advDetailControl);
#endif


        if (propData != null)
        {
            m.SetTexture("_PerTexProps", propData.GetTexture());
        }

#if __MICROSPLAT_PROCTEX__
        if (procTexCfg != null)
        {
            if (m.HasProperty("_ProcTexCurves"))
            {
                m.SetTexture("_ProcTexCurves", procTexCfg.GetCurveTexture());
                m.SetTexture("_ProcTexParams", procTexCfg.GetParamTexture());
                m.SetInt("_PCLayerCount", procTexCfg.layers.Count);
                if (procBiomeMask != null && m.HasProperty("_ProcTexBiomeMask"))
                {
                    m.SetTexture("_ProcTexBiomeMask", procBiomeMask);
                }
            }
            if (m.HasProperty("_PCHeightGradients"))
            {
                m.SetTexture("_PCHeightGradients", procTexCfg.GetHeightGradientTexture());
            }
            if (m.HasProperty("_PCHeightHSV"))
            {
                m.SetTexture("_PCHeightHSV", procTexCfg.GetHeightHSVTexture());
            }
            if (m.HasProperty("_CavityMap"))
            {
                m.SetTexture("_CavityMap", cavityMap);
            }

            if (m.HasProperty("_PCSlopeGradients"))
            {
                m.SetTexture("_PCSlopeGradients", procTexCfg.GetSlopeGradientTexture());
            }
            if (m.HasProperty("_PCSlopeHSV"))
            {
                m.SetTexture("_PCSlopeHSV", procTexCfg.GetSlopeHSVTexture());
            }
        }
#endif
    }