Пример #1
0
        internal static void AddVoxelMaterial(int id, 
            string colorMetal_XZ_nY_Texture,
            string colorMetal_pY_Texture,
            string normalGloss_XZ_nY_Texture,
            string normalGloss_pY_Texture,
            string lowFreqColorMetal_XZ_nY_Texture,
            string lowFreqColorMetal_pY_Texture,
            string lowFreqNormalGloss_XZ_nY_Texture,
            string lowFreqNormalGloss_pY_Texture,
            string ext_XZ_nY_Texture,
            string ext_pY_Texture,
            string lowFreqExt_XZ_nY_Texture,
            string lowFreqExt_pY_Texture,
            float highFreqTextureScale,
            float lowFreqTextureScale,

            string foliageTextureArray1,
            string foliageTextureArray2,
            float foliageDensity,
            Vector2 foliageScale,
            float foliageRandomRescaleMult
            )
        {
            var material = new MyVoxelMaterial();

            material.Id = id;
            
            material.ColorMetal_XZ_nY_Texture           = colorMetal_XZ_nY_Texture;
            material.ColorMetal_pY_Texture              = colorMetal_pY_Texture;
            material.NormalGloss_XZ_nY_Texture          = normalGloss_XZ_nY_Texture;
            material.NormalGloss_pY_Texture             = normalGloss_pY_Texture;
                                                          
            material.LowFreqColorMetal_XZ_nY_Texture    = lowFreqColorMetal_XZ_nY_Texture;
            material.LowFreqColorMetal_pY_Texture       = lowFreqColorMetal_pY_Texture;
            material.LowFreqNormalGloss_XZ_nY_Texture   = lowFreqNormalGloss_XZ_nY_Texture;
            material.LowFreqNormalGloss_pY_Texture      = lowFreqNormalGloss_pY_Texture;

            material.Ext_XZ_nY_Texture        = ext_XZ_nY_Texture;
            material.Ext_pY_Texture           = ext_pY_Texture;
            material.LowFreqExt_XZ_nY_Texture = lowFreqExt_XZ_nY_Texture;
            material.LowFreqExt_pY_Texture    = lowFreqExt_pY_Texture;

            material.HighFreqScale = highFreqTextureScale;
            material.LowFreqScale = lowFreqTextureScale;
            material.TransitionRange = 100;

            material.FoliageTextureArray1_Filename = foliageTextureArray1;
            material.FoliageTextureArray2_Filename = foliageTextureArray2;

            material.FoliageDensity = foliageDensity;
            material.FoliageScale = foliageScale;
            material.FoliageRandomRescaleMult = foliageRandomRescaleMult;

            material.BuildTextureArrays();

            if(m_materials.ContainsKey(id))
            {
                m_materials[id].Dispose();
            }

            m_materials[id] = material;    
        }
Пример #2
0
        internal static void AddVoxelMaterial(int id,
                                              string colorMetal_XZ_nY_Texture,
                                              string colorMetal_pY_Texture,
                                              string normalGloss_XZ_nY_Texture,
                                              string normalGloss_pY_Texture,
                                              string lowFreqColorMetal_XZ_nY_Texture,
                                              string lowFreqColorMetal_pY_Texture,
                                              string lowFreqNormalGloss_XZ_nY_Texture,
                                              string lowFreqNormalGloss_pY_Texture,
                                              string ext_XZ_nY_Texture,
                                              string ext_pY_Texture,
                                              string lowFreqExt_XZ_nY_Texture,
                                              string lowFreqExt_pY_Texture,
                                              float highFreqTextureScale,
                                              float lowFreqTextureScale,

                                              string foliageTextureArray1,
                                              string foliageTextureArray2,
                                              float foliageDensity,
                                              Vector2 foliageScale,
                                              float foliageRandomRescaleMult
                                              )
        {
            var material = new MyVoxelMaterial();

            material.Id = id;

            material.ColorMetal_XZ_nY_Texture  = colorMetal_XZ_nY_Texture;
            material.ColorMetal_pY_Texture     = colorMetal_pY_Texture;
            material.NormalGloss_XZ_nY_Texture = normalGloss_XZ_nY_Texture;
            material.NormalGloss_pY_Texture    = normalGloss_pY_Texture;

            material.LowFreqColorMetal_XZ_nY_Texture  = lowFreqColorMetal_XZ_nY_Texture;
            material.LowFreqColorMetal_pY_Texture     = lowFreqColorMetal_pY_Texture;
            material.LowFreqNormalGloss_XZ_nY_Texture = lowFreqNormalGloss_XZ_nY_Texture;
            material.LowFreqNormalGloss_pY_Texture    = lowFreqNormalGloss_pY_Texture;

            material.Ext_XZ_nY_Texture        = ext_XZ_nY_Texture;
            material.Ext_pY_Texture           = ext_pY_Texture;
            material.LowFreqExt_XZ_nY_Texture = lowFreqExt_XZ_nY_Texture;
            material.LowFreqExt_pY_Texture    = lowFreqExt_pY_Texture;

            material.HighFreqScale   = highFreqTextureScale;
            material.LowFreqScale    = lowFreqTextureScale;
            material.TransitionRange = 100;

            material.FoliageTextureArray1_Filename = foliageTextureArray1;
            material.FoliageTextureArray2_Filename = foliageTextureArray2;

            material.FoliageDensity           = foliageDensity;
            material.FoliageScale             = foliageScale;
            material.FoliageRandomRescaleMult = foliageRandomRescaleMult;

            material.BuildTextureArrays();

            if (m_materials.ContainsKey(id))
            {
                m_materials[id].Dispose();
            }

            m_materials[id] = material;
        }