Answered
Texture from PixImage

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?

Votes Newest

Answers 2


Yes this is the only way atm. Not exactly convenient but we never came up with anything better :-)

  
Posted 1 years ago

|> Sg.diffuseTexture texture ( i |> Mod.map ( fun img -> (PixTexture2d(PixImageMipMap [| img |], TextureParams.mipmapped)) :> ITexture))
  
Posted 6 months ago
Edited 6 months ago