Atlas Textures (20 posts)

Topic tags: atlas textures
  • Profile picture of moonkey moonkey12p said 1 year, 2 months ago:

    I’d like jme to have support for atlas textures.

    As GPUs continue to follow Moore’s Law squared [Wloka2003] and get
    comparatively faster than CPUs, it is important for game developers to aggressively
    reduce batches. The fewer batches a game uses the higher its frame-rate, or rather
    the more eye-candy, physics, or AI computations are available to the game. Texture
    atlases promise to be one tool that allows reduced batch-counts.

    http://http.download.nvidia.com/developer/NVTextureSuite/Atlas_Tools/Texture_Atlas_Whitepaper.pdf

    While texture atlases have a perceived stigma of producing lower image quality, the
    Atlas Comparison Viewer demonstrates this to be a misconception. This paper
    explains how to use texture atlases and how to avoid common pitfalls. Since the
    Atlas Comparison Viewer and the Atlas Creation Tool come with source code, we
    hope that game developers take a second look at texture atlases as a technique to be
    integrated into their tool chains.

  • Profile picture of erlend_sh erlend_sh132p said 1 year, 2 months ago:

    http://jmonkeyengine.org/gsoc-2011/ideas-page/#Texture-Atlas-Auto-Generation
    :)

    Thanks for the extra info, I’ve linked to it in the idea entry.

  • Profile picture of normen normen1271p said 1 year, 2 months ago:

    moonkey said:
    I’d like jme to have support for atlas textures.

    Us too! :)

  • Profile picture of moonkey moonkey12p said 1 year, 2 months ago:

    but don’t you guys have the know-how on how to do this, I mean you are the gurus :) or perhaps atlast textures ain’t that easy to implement?

  • Profile picture of erlend_sh erlend_sh132p said 1 year, 2 months ago:

    @moonkey In spite of their godlike qualities, even the jME developers are held captive by the cruel laws of time.

    Every new feature comes with preliminary research, several iterations and post-stable maintenance and support. Whenever there’s a chance we might spark the interest of a new developer, that’s usually our best bet.

  • Profile picture of codeviking codeviking said 1 year, 1 month ago:

    Having an easy to use texture atlas would be great. Unfortunately, doing it right is not exactly easy. If I recall correctly, there are two big issues:
    1) mipmapping – copies of your texture rendered at a lower resolution. You have to make sure that you don’t combine adjacent textures when the mipmaps are calculated.
    2) Clamping the texture at the edges of your triangles. You can get some ugly artifacts at the edges of your triangles from neighboring textures. To prevent this, you have to clamp the texture at the edges. I’m pretty sure this needs to be done in the shader.

    So, on the surface, a texture atlas seems easy to implement. But there are (at least) the above two issues to deal with. I don’t think these problems are enough to make it hard, but it does mean that whoever implements them needs to know some pretty low-level opengl stuff. That restricts the number of people that can tackle the problem. I wish I knew a bit more about this, because even though I know what the issues are (at least, I think I do), I don’t know how to address them. I’d definitely take a stab at implementing texture atlases if I wasn’t so mystified by glsl. Maybe I’ll get brave and dive into it someday. If any experts have some advice on where to start, I’d appreciate a few pointers.

  • Profile picture of moonkey moonkey12p said 1 year, 1 month ago:

    hi codeviking

    you can start here, investigate if texturepacker is something we can use and perhaps incorporate in jME

    http://code.google.com/p/libgdx/wiki/TexturePacker

    http://code.google.com/p/libgdx/source/browse/wiki/TexturePacker.wiki

    continue with learning glsl by following these great tutorials at swiftless:

    http://www.swiftless.com/glsltuts.html

    suprise us in month or two! :) )

  • Profile picture of mulova mulova30p said 1 year, 1 month ago:

    Ardor3D has the TextureAtlas.
    I was porting it to jme3.
    It is discontinued because I don’t know how to handle sub images to make one big atlas.
    If you want, I’ll share it.

  • Profile picture of moonkey moonkey12p said 1 year, 1 month ago:

    can you explain the problem about sub-images that you run into?

    is this working tool or is it not working because of this problem?

  • Profile picture of mulova mulova30p said 1 year, 1 month ago:

    The packing algorithm works well.
    The problem I have is creating one Big Texture Atlas by reading subimages. Image IO.

  • Profile picture of Empire Phoenix Empire Phoenix156p said 1 year, 1 month ago:

    Actually I’m currently In the progress of writing a Texture Atlas tool for Jme3 as a resarch project for my University (Mainly as a tool to optimize the use of Batching for Objects that share the same relative coordiante space) Using a few ideas I got while looking at MegaTexture techniques. Also planned is the support for repeating Textures.

    Internally it is in fact using the already mentiond texturepacker for the atlascreation. However that is only a small part.

    Basic idea is:
    Drop in a folder with models and the materials+ textures (Glow,Specular,Normal,Depth,Diffuse,Detail supportet)
    get out a folder with j3o modelfiles a few dds textures and j3m materialdescriptions.

    Planed schedule is to finish a working project around easter.

  • Profile picture of mulova mulova30p said 1 year, 1 month ago:

    Good news!
    Then I’ll just wait for it. :)

  • Profile picture of moonkey moonkey12p said 1 year, 1 month ago:

    What if you just have folder with textures and not models, I hope models are not required to get something out?

  • Profile picture of Momoko_Fan Momoko_Fan366p said 1 year, 1 month ago:

    You can’t just point the tool at textures. You need to adjust the texture coordinates of all models effected so they point to the coordinates in the new texture.

    You could however create some kind of intermediate format that describes new mappings for textures, e.g.

    <atlas path="result_0.png">
    <texture path="tex123.png" x="10" y="50" width="123" height="321"/>
    <texture path="..."/>
    
    <!-- ... etc ... -->
    
    </atlas>

    Then you can use this data to apply the new coordinates by matching the material’s texture path to the atlas its referenced at.

  • Profile picture of Empire Phoenix Empire Phoenix156p said 1 year, 1 month ago:

    Something very similar is the result of the TexturePacker. However there are only few needs for textureatlases if you don’t apply the changed texturecoordinates to models.