Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline elasto  
#1 Posted : Monday, October 10, 2011 5:52:17 AM(UTC)
elasto

Joined: 8/23/2011(UTC)
Posts: 245

Thanks: 6 times
Was thanked: 12 time(s) in 11 post(s)
Can anyone tell me how much mipmaps are currently supported, in general?

I see that in Graphics.BaseTexture (and Graphics.OpenTK.OpenTKTexture) there is support for populating a texture with mipmap data. eg:

Quote:
protected abstract bool FillTextureData(Size fullImageSize, byte[] imageData, int dataLengthPerTexture, int minimumMipmapByteSize, int numberOfMipmaps, bool isDxt1, bool isDxt3, bool isDxt5, bool isAtc, bool isAtcA, bool isAtcI, bool isRgba4Texture, bool isPvrTexture, bool isRgb5a1Texture);

Delta.Graphics.Basics.Texture doesn't seem to offer any helper wrapper though.

I note that the ContentManager doesn't currenly allow dds files to be uploaded, so can anyone summarise how I go about either generating or uploading a mipmapped texture into my game?

(I've run a conversion tool to convert my dds files into png files, but I can't work out if it's transferred all the mipmaps across or not (or, if png even supports mipmaps) - nor whether DE will use the mipmaps if it did.)

Or is this something to wait until v0.9.2 for?

Edited by user Monday, October 10, 2011 5:57:19 AM(UTC)  | Reason: Not specified

Wanna join the discussion?! Login to your forum accountregister a new account. Or Connect via Facebook Twitter Google

Offline Benjamin  
#2 Posted : Tuesday, October 11, 2011 3:38:27 PM(UTC)
Benjamin

Medals: Admin

Joined: 8/20/2011(UTC)
Posts: 1,421
Location: Hannover

Thanks: 18 times
Was thanked: 97 time(s) in 92 post(s)
Originally Posted by: PG Go to Quoted Post
Can anyone tell me how much mipmaps are currently supported, in general?


By default they will always be on. Once the Content Properties in the ContentManager work (planed for the next update at v0.9.1), you can customize everything here (mipmap on, off, filtering mode, blend mode, etc.)

Originally Posted by: PG Go to Quoted Post
... FillTextureData(Size fullImageSize, byte[] imageData, int dataLengthPerTexture, int minimumMipmapByteSize, int numberOfMipmaps, bool isDxt1, bool isDxt3, bool isDxt5, bool isAtc, bool isAtcA, bool isAtcI, bool isRgba4Texture, bool isPvrTexture, bool isRgb5a1Texture);


This is exactly what is getting used when filling the texture data, so this are your options (you can do the same in code but of course we highly recommend using the Content System for all that automatically).

Originally Posted by: PG Go to Quoted Post
I note that the ContentManager doesn't currenly allow dds files to be uploaded, so can anyone summarise how I go about either generating or uploading a mipmapped texture into my game?


Don't worry, we will allow all other image formats in the next few days once we update our services. We are currently testing Windows Phone 7 and Silverlight and need dds support for that anyway. On your client it will just work with v0.9.0.

Originally Posted by: PG Go to Quoted Post
(I've run a conversion tool to convert my dds files into png files, but I can't work out if it's transferred all the mipmaps across or not (or, if png even supports mipmaps) - nor whether DE will use the mipmaps if it did.)

Or is this something to wait until v0.9.2 for?


No, you don't have to wait for v0.9.2. Just write posts like these to keep us on track and enable features again quickly (most features were just disabled because we had no time to test them for v0.9.0, but they already work). Hopefully you won't need to convert any image formats in the future, we try to support everything out of the box.
Offline elasto  
#3 Posted : Tuesday, October 11, 2011 3:50:58 PM(UTC)
elasto

Joined: 8/23/2011(UTC)
Posts: 245

Thanks: 6 times
Was thanked: 12 time(s) in 11 post(s)
Cool, thanks for the reply. I didn't think I'd have to wait too long for the full functionality to arise.

I actually do have a need to create mipmapped textures procedurally at run-time, so I presumably will be making use of the FillTextureData low-level call, so I'll probably write some form of wrapper around it if one doesn't turn up.

(And, yes, I realise it will be pretty slow - forming the ImageData in particular - I'm not going to be doing it every frame or anything!)


Thanks again for the reply!

Edited by user Tuesday, October 11, 2011 3:53:07 PM(UTC)  | Reason: Not specified

Offline Benjamin  
#4 Posted : Tuesday, October 11, 2011 4:03:59 PM(UTC)
Benjamin

Medals: Admin

Joined: 8/20/2011(UTC)
Posts: 1,421
Location: Hannover

Thanks: 18 times
Was thanked: 97 time(s) in 92 post(s)
Originally Posted by: PG Go to Quoted Post
I actually do have a need to create mipmapped textures procedurally at run-time, so I presumably will be making use of the FillTextureData low-level call, so I'll probably write some form of wrapper around it if one doesn't turn up.


Actually it is not too slow (still bad if you create and render a new texture often, but in that case just use RenderToTexture targets). I think the functionality should already be in there in you just use the Texture.Create methods (you can dynamically create rgb or rgba textures). This is used by our ArenaWars 2 team to generate the minimap and it works just fine for them, there are also several tests that make use of this (creating a material and passing in such a generated texture). Check out:

  • MaterialTests.CreateTextureDynamically
  • MaterialTests.CreateTextureDynamicallyWithAlpha
  • MaterialTests.DrawLineOnTexture

Edited by user Tuesday, October 11, 2011 4:04:39 PM(UTC)  | Reason: Not specified

Offline elasto  
#5 Posted : Tuesday, October 11, 2011 4:36:12 PM(UTC)
elasto

Joined: 8/23/2011(UTC)
Posts: 245

Thanks: 6 times
Was thanked: 12 time(s) in 11 post(s)
Originally Posted by: Benjamin Nitschke (DeltaEngine) Go to Quoted Post
Originally Posted by: PG Go to Quoted Post
I actually do have a need to create mipmapped textures procedurally at run-time, so I presumably will be making use of the FillTextureData low-level call, so I'll probably write some form of wrapper around it if one doesn't turn up.


Actually it is not too slow (still bad if you create and render a new texture often, but in that case just use RenderToTexture targets). I think the functionality should already be in there in you just use the Texture.Create methods (you can dynamically create rgb or rgba textures). This is used by our ArenaWars 2 team to generate the minimap and it works just fine for them, there are also several tests that make use of this (creating a material and passing in such a generated texture). Check out:

  • MaterialTests.CreateTextureDynamically
  • MaterialTests.CreateTextureDynamicallyWithAlpha
  • MaterialTests.DrawLineOnTexture
Yep. I spotted from Texture.Create that it's pretty straightforward - though it doesn't give any examples with mipmaps. Edit: Or are you saying that it will automatically add in all the mipmap levels if not provided?

I'd love to use RenderToTexture but for that I'll have to get to the bottom of what we were talking about in that thread about bespoke shaders a month ago*: http://forum.deltaengine...st50_Shader-support.aspx

It's all still a bit murky for me for now... It'll be easier once I've got my game partially coded and I can debug through some of all this code I think!

(*I realised that I don't need to do texture splatting every frame but that I can bake it into an intermediate texture and just use that until a change is required, at which point I can reform it on a secondary thread.)

Edited by user Tuesday, October 11, 2011 4:45:10 PM(UTC)  | Reason: Not specified

Offline Benjamin  
#6 Posted : Tuesday, October 11, 2011 4:50:48 PM(UTC)
Benjamin

Medals: Admin

Joined: 8/20/2011(UTC)
Posts: 1,421
Location: Hannover

Thanks: 18 times
Was thanked: 97 time(s) in 92 post(s)
Not sure if we need additional customization regarding mipmaps, currently all 2D content (UI, 2D games, etc.) is without mipmaps, all 3D content uses mipmaps (textures for models, levels, effects, etc.) or generates them if missing. Since this is decided on the content server side, we can easily add an option to customize this (force it on or off) and give this back to the client, so the Texture.Create methods get an extra parameter for code-only customization as well .. written down in our planing system!
Offline Amer  
#7 Posted : Tuesday, October 11, 2011 4:56:34 PM(UTC)
Amer

Joined: 8/21/2011(UTC)
Posts: 28

Thanks: 1 times
Originally Posted by: Benjamin Nitschke (DeltaEngine) Go to Quoted Post
Not sure if we need additional customization regarding mipmaps, currently all 2D content (UI, 2D games, etc.) is without mipmaps, all 3D content uses mipmaps (textures for models, levels, effects, etc.) or generates them if missing. Since this is decided on the content server side, we can easily add an option to customize this (force it on or off) and give this back to the client, so the Texture.Create methods get an extra parameter for code-only customization as well .. written down in our planing system!


Basically OpenGL does not support hardware mipmap generation, but DX9, Xna and DX11 support them and if i remember well we already support them when we generate textures on Graphic side (not only server).
Rss Feed  Atom Feed
Users browsing this topic
OceanSpiders 2.0
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2023, Yet Another Forum.NET
This page was generated in 0.148 seconds.