예제 #1
0
 private static void DoneDevice()
 {
     if (m_textureArray != null)
         m_textureArray.Dispose();
     m_textureArray = null;
     m_textureArrayDirty = false;
 }
예제 #2
0
 private static void DoneDevice()
 {
     if (m_textureArray != null)
     {
         m_textureArray.Dispose();
     }
     m_textureArray      = null;
     m_textureArrayDirty = false;
 }
예제 #3
0
        private static void UpdateTextureArray()
        {
            if (m_textureArrayDirty)
            {
                if (m_textureArray != null)
                {
                    m_textureArray.Dispose();
                }

                Resources.TexId[] textIds = new Resources.TexId[m_textureArrayIndices.Count];
                foreach (var item in m_textureArrayIndices)
                {
                    textIds[item.Value.Index] = item.Key;
                }
                m_textureArray = new Resources.MyTextureArray(textIds, "gpuParticles");

                m_textureArrayDirty = false;
            }
        }
예제 #4
0
 internal void Dispose()
 {
     if (ColorMetalArray != null)
     {
         ColorMetalArray.Dispose();
         ColorMetalArray = null;
     }
     if (NormalGlossArray != null)
     {
         NormalGlossArray.Dispose();
         NormalGlossArray = null;
     }
     if (ExtArray != null)
     {
         ExtArray.Dispose();
         ExtArray = null;
     }
 }
예제 #5
0
        internal void BuildTextureArrays()
        {
            Dispose();

            ColorMetalArray = new MyTextureArray(new[] { 
                MyTextureManager.GetColorMetalTexture(ColorMetal_XZ_nY_Texture),
                MyTextureManager.GetColorMetalTexture(ColorMetal_pY_Texture),
                MyTextureManager.GetColorMetalTexture(LowFreqColorMetal_XZ_nY_Texture),
                MyTextureManager.GetColorMetalTexture(LowFreqColorMetal_pY_Texture),
            });
            ColorMetalArray.SetDebugName(String.Format("voxel material {0} ColorMetal array", Id));

            NormalGlossArray = new MyTextureArray(new[] { 
                MyTextureManager.GetNormalGlossTexture(NormalGloss_XZ_nY_Texture),
                MyTextureManager.GetNormalGlossTexture(NormalGloss_pY_Texture),
                MyTextureManager.GetNormalGlossTexture(LowFreqNormalGloss_XZ_nY_Texture),
                MyTextureManager.GetNormalGlossTexture(LowFreqNormalGloss_pY_Texture),
            });
            NormalGlossArray.SetDebugName(String.Format("voxel material {0} NormalGloss array", Id));

            ExtArray = new MyTextureArray(new[] { 
                MyTextureManager.GetExtensionsTexture(Ext_XZ_nY_Texture),
                MyTextureManager.GetExtensionsTexture(Ext_pY_Texture),
                MyTextureManager.GetExtensionsTexture(LowFreqExt_XZ_nY_Texture),
                MyTextureManager.GetExtensionsTexture(LowFreqExt_pY_Texture),
            });
            ExtArray.SetDebugName(String.Format("voxel material {0} Ex6 array", Id));

            if (FoliageTextureArray1_Filename != null)
            { 
                FoliageTextureArray1 = MyTextureManager.GetTexture(FoliageTextureArray1_Filename);
                FoliageArraySize = (uint)((Texture2D)FoliageTextureArray1.Resource).Description.ArraySize;
            }
            if (FoliageTextureArray2_Filename != null)
            { 
                FoliageTextureArray2 = MyTextureManager.GetTexture(FoliageTextureArray2_Filename);
            }
        }
예제 #6
0
        private static void UpdateTextureArray()
        {
            if (m_textureArrayDirty)
            {
                if (m_textureArray != null)
                    m_textureArray.Dispose();
                m_textureArray = null;

                Resources.TexId[] textIds = new Resources.TexId[m_textureArrayIndices.Count];
                foreach (var item in m_textureArrayIndices)
                    textIds[item.Value.Index] = item.Key;
                if (textIds.Length > 0)
                    m_textureArray = new Resources.MyTextureArray(textIds, "gpuParticles");

                m_textureArrayDirty = false;
            }
        }