Announcement

Collapse
No announcement yet.

Aerial image levels

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Aerial image levels

    Hey I am writing a plugin to display images taken from a UAV and I wanted to be able to change the resolution of the images as you zoom out. Obviously, I could store a couple different copies of the image at different resolutions in memory and simply load each of them in when needed, but I was looking for a way using DirectX.

    I noticed that the Texture object can generate multiple levels of an image each with different resolutions (mipmaps). When the Texture is constructed it generates the levels and when you want a specific level, you just tell it and it displays it. It seems like this should work, but I have only been able to get it to work with one level. When I request more that one level, the image is just not displayed on WorldWind and the LevelCount stays at one instead of the number of levels I requested.

    For those who know what I'm talking about here is the code I am using to construct the Texture.
    Code:
    _ImageTexture = TextureLoader.FromFile(DrawArgs.Device, _ImageFile.FullName, 0, 0, 1, Usage.AutoGenerateMipMap
                    , World.Settings.TextureFormat, Pool.Managed, Filter.Box, Filter.Box, 0);
    _ImageTexture.AutoGenerateFilterType = TextureFilter.Linear;
    _ImageTexture.GenerateMipSubLevels();
    I've tried changing the width, height, and the level number and nothing changes.

    Has anyone else tried doing it this way?
    Is this even possible with WorldWind? Is there something within the WorldWind.DrawArgs which prevents me from doing this?

    Thanks
    Austin

  • #2
    So does everyone just load different versions of the same image depending on the height of the camera?
    Austin

    Comment


    • #3
      Hmm, why wouldn't you be using dstile?
      Machine. Unexpectedly, I’d invented a time
      - Alan Moore

      Comment


      • #4
        Originally posted by Bubbajobob View Post
        So does everyone just load different versions of the same image depending on the height of the camera?
        Yes.

        Comment


        • #5
          Chade,

          Well I'm writting a plugin which assumes the images are taken from an aircraft, so the only information I have is the position and orientation of the aircraft. I did look at dstile once and it seemed like it was more of an application than a tool for plug-ins. However I could be wrong!

          I will have to take a second look at dstile and fwtools to see if there is something I could use from there.

          Thanks
          Austin

          Comment


          • #6
            There should be a dstile plugin in SVN.
            Hot stuff: FAQ, forum search, DirectX, .NET, Video Card Compatibility list

            Comment


            • #7
              Hmm, thinking about be employing dstile?
              NoorAlamShahzad

              Comment

              Working...
              X