Пример #1
0
        public void UpdateVoxelTextures(MyMwcVoxelMaterialsEnum material)
        {
            m_multimaterial = false;

            //  Get with lazy-load
            MyVoxelMaterial         voxelMaterial = MyVoxelMaterials.Get(material);
            MyVoxelMaterialTextures voxelTexture  = voxelMaterial.GetTextures();

            if (MyRender.DebugDiffuseTexture)
            {
                m_D3DEffect.SetTexture(m_textureDiffuseForAxisXZ, (Texture)MyRender.GetDebugTexture());
                m_D3DEffect.SetTexture(m_textureDiffuseForAxisY, (Texture)MyRender.GetDebugTexture());
            }
            else
            {
                m_D3DEffect.SetTexture(m_textureDiffuseForAxisXZ, (Texture)voxelTexture.TextureDiffuseForAxisXZ);
                m_D3DEffect.SetTexture(m_textureDiffuseForAxisY, (Texture)voxelTexture.TextureDiffuseForAxisY);
            }

            if (MyRender.DebugNormalTexture)
            {
                m_D3DEffect.SetTexture(m_textureNormalMapForAxisXZ, (Texture)MyRender.GetDebugNormalTexture());
                m_D3DEffect.SetTexture(m_textureNormalMapForAxisY, (Texture)MyRender.GetDebugNormalTexture());
            }
            else
            {
                m_D3DEffect.SetTexture(m_textureNormalMapForAxisXZ, (Texture)voxelTexture.TextureNormalMapForAxisXZ);
                m_D3DEffect.SetTexture(m_textureNormalMapForAxisY, (Texture)voxelTexture.TextureNormalMapForAxisY);
            }

            m_D3DEffect.SetValue(m_specularIntensity, voxelMaterial.SpecularIntensity);
            m_D3DEffect.SetValue(m_specularPower, voxelMaterial.SpecularPower);
        }