/// <summary> /// Loads asset /// </summary> private void LoadAsset() { _internalMesh = _storage[GraphicsConstant.MeshFolderName].Load<Mesh>(Name, MeshParameters.NewInstance); if (!_storage[GraphicsConstant.MaterialFolderName].IsLoaded(AabbMaterial)) { TextureParameters textureParameters = new TextureParameters { Height = 1, Width = 1 }; Texture texture = _storage[GraphicsConstant.TextureFolderName].Load<Texture>(AabbTexture, textureParameters); texture.SetData(new[]{ new Color(255, 255, 255, 255) }); Material = _storage[GraphicsConstant.MaterialFolderName].Load<Material>(AabbMaterial, MaterialParameters.NewInstance); Material.DiffuseMap = texture; } else Material = _storage[GraphicsConstant.MaterialFolderName].Load<Material>(AabbMaterial); }
/// <summary> /// Creates parameters to load a 3D texture from a file /// </summary> /// <param name="filename">Name of the file</param> /// <returns>Returns a TextureParameters instance</returns> public static TextureParameters FromTexture3DFile(string filename) { TextureParameters texParams = new TextureParameters { Filename = filename, Level = TextureLevel.Texture3D }; return texParams; }