|> Sg.diffuseTexture texture ( i |> Mod.map ( fun img -> (PixTexture2d(PixImageMipMap [| img |], TextureParams.mipmapped)) :> ITexture))
Yes this is the only way atm. Not exactly convenient but we never came up with anything better :-)
How do I create a Texture : ITexture
from a PixImage
?
I actually want to create a Texture from a Stream
, this is how far I got:
let s = GetStream( ... )
let p = (PixImage.Create s)
let t = PixTexture2d(PixImageMipMap [| p |], true) :> ITexture
Is this correct?
|> Sg.diffuseTexture texture ( i |> Mod.map ( fun img -> (PixTexture2d(PixImageMipMap [| img |], TextureParams.mipmapped)) :> ITexture))
Yes this is the only way atm. Not exactly convenient but we never came up with anything better :-)