con gli sprite o le mesh, quando carico una texture creo le mipmap e le assegno alla texture.
Come faccio con spine ad usare le mipmap con xna? non ho accesso alle texture
saluti
Cristian
Page 1 of 1
eprime
-
Cristian Zerbinati - Eprime - Spine 2D Pro
Cristian Zerbinati - Eprime - Spine 2D Pro
2 years ago
-
eprime - Posts: 141
Mario
Non lo esponiamo direttamente a quanto pare. Non sono sicuro di come generare mips in fase di esecuzione in XNA. Puoi provare a modificare il codice di caricamento della trama qui per generare anche i livelli della mappa mip:
spine-runtimes/Util.cs at 3.8
We don't expose that directly it seems. I'm unsure how to generate mips at runtime in XNA. You could try modifying the texture loading code here to also generate mip map levels:
spine-runtimes/Util.cs at 3.8
spine-runtimes/Util.cs at 3.8
We don't expose that directly it seems. I'm unsure how to generate mips at runtime in XNA. You could try modifying the texture loading code here to also generate mip map levels:
spine-runtimes/Util.cs at 3.8
2 years ago
-
Mario - Posts: 3277
eprime
grazie Mario, verifico
---
ok it's not very important, if I see the need I will implement the code and publish it
---
ok after 2 year I'm using mipmap
it easy, after create a texture with mipmap I substiture in the Atlas
atlas.Pages(0).rendererObject(0)=texture_with_mipmap
for create mipmap I use this code
---
update
---
I have spend time to test, but although the filter name is read from atlas file, then it is not applied anywhere. May be because I use FNA/Monogame.Mario wrote:We don't expose that directly it seems. I'm unsure how to generate mips at runtime in XNA. You could try modifying the texture loading code here to also generate mip map levels:
https://github.com/EsotericSoftware/spine-runtimes/blob/3.8/spine-xna/src/Util.cs#L76
ok it's not very important, if I see the need I will implement the code and publish it
---
ok after 2 year I'm using mipmap

it easy, after create a texture with mipmap I substiture in the Atlas
atlas.Pages(0).rendererObject(0)=texture_with_mipmap
for create mipmap I use this code
Function CreateMipMap( texture As Texture2D) as Texture2D
Dim newTexture As Texture2D = New Texture2D(Game1.graphics.GraphicsDevice, texture.Width, texture.Height, True, SurfaceFormat.Color)
For i As Integer = 0 To newTexture.LevelCount - 1
Dim temptext As Texture2D
Using fileIn As IO.Stream = TitleContainer.OpenStream(texture.Name)
temptext = Texture2D.FromStream(graphics.GraphicsDevice, fileIn, texture.Width / CInt(Math.Pow(2, i)), texture.Height / CInt(Math.Pow(2, i)), False)
Dim size As Integer = (texture.Width / CInt(Math.Pow(2, i))) * (texture.Height / CInt(Math.Pow(2, i)))
Dim data As Color()
data = New Color(size - 1) {}
temptext.GetData(data, 0, size)
newTexture.SetData(i, Nothing, data, 0, size)
End Using
Next
return newTexture
End Sub
Dim newTexture As Texture2D = New Texture2D(Game1.graphics.GraphicsDevice, texture.Width, texture.Height, True, SurfaceFormat.Color)
For i As Integer = 0 To newTexture.LevelCount - 1
Dim temptext As Texture2D
Using fileIn As IO.Stream = TitleContainer.OpenStream(texture.Name)
temptext = Texture2D.FromStream(graphics.GraphicsDevice, fileIn, texture.Width / CInt(Math.Pow(2, i)), texture.Height / CInt(Math.Pow(2, i)), False)
Dim size As Integer = (texture.Width / CInt(Math.Pow(2, i))) * (texture.Height / CInt(Math.Pow(2, i)))
Dim data As Color()
data = New Color(size - 1) {}
temptext.GetData(data, 0, size)
newTexture.SetData(i, Nothing, data, 0, size)
End Using
Next
return newTexture
End Sub
---
update
Function CreateMipMap( texture As Texture2D,texturepath as string) as Texture2D
Dim newTexture As Texture2D = New Texture2D(Game1.graphics.GraphicsDevice, texture.Width, texture.Height, True, SurfaceFormat.Color)
For i As Integer = 0 To newTexture.LevelCount - 1
fileIn.Position = 0
Dim temptext As Texture2D
Using fileIn As IO.Stream = TitleContainer.OpenStream(texturepath)
temptext = Texture2D.FromStream(graphics.GraphicsDevice, fileIn, texture.Width / CInt(Math.Pow(2, i)), texture.Height / CInt(Math.Pow(2, i)), False)
Dim size As Integer = (texture.Width / CInt(Math.Pow(2, i))) * (texture.Height / CInt(Math.Pow(2, i)))
Dim data As Color()
data = New Color(size - 1) {}
temptext.GetData(data, 0, size)
newTexture.SetData(i, Nothing, data, 0, size)
End Using
Next
return newTexture
End Sub
Dim newTexture As Texture2D = New Texture2D(Game1.graphics.GraphicsDevice, texture.Width, texture.Height, True, SurfaceFormat.Color)
For i As Integer = 0 To newTexture.LevelCount - 1
fileIn.Position = 0
Dim temptext As Texture2D
Using fileIn As IO.Stream = TitleContainer.OpenStream(texturepath)
temptext = Texture2D.FromStream(graphics.GraphicsDevice, fileIn, texture.Width / CInt(Math.Pow(2, i)), texture.Height / CInt(Math.Pow(2, i)), False)
Dim size As Integer = (texture.Width / CInt(Math.Pow(2, i))) * (texture.Height / CInt(Math.Pow(2, i)))
Dim data As Color()
data = New Color(size - 1) {}
temptext.GetData(data, 0, size)
newTexture.SetData(i, Nothing, data, 0, size)
End Using
Next
return newTexture
End Sub
-
Cristian Zerbinati - Eprime - Spine 2D Pro
Cristian Zerbinati - Eprime - Spine 2D Pro
1 month ago
-
eprime - Posts: 141
Mark topic unread
• Page 1 of 1
Return to Utenti di Spine italiani
- All times are UTC