tile-based texture mapping

Discussion in 'Rendering Technology and APIs' started by Xmas, Sep 8, 2005.

  1. Xmas

    Xmas Porous
    Veteran Subscriber

    Joined:
    Feb 6, 2002
    Messages:
    3,298
    Likes Received:
    137
    Location:
    On the path to wisdom
    This is a bit of research I did as part of my diploma thesis which I finished recently. Li-Yi Wei has done some interesting work with tile-based texturing on GPUs using Wang Tiles to avoid texture repetition (http://graphics.stanford.edu/papers/tile_mapping_gh2004/ and a chapter in GPU Gems 2). I developed some extensions to that kind of method, mostly to allow tiles to be laid out in non-regular grids. The diploma thesis is written in German, but I thought someone on these boards might be interested in the methods I tried for tile-based texturing, so here's a short summary. Maybe I'll do a translation of the interesting parts.

    The first thing I did was an alternating indentation of tile rows, with some random jitter. This is useful in conjunction with "real" tiles, as can be seen here. Tiles are used mirrored and rotated as well, and vary in brightness.

    Then I tried to implement a decal layer with tiles, which might be useful for mass decals. The decals can be positioned freely, but there's kind of a border around them so they can't be close to each other, or even overlap. Here's an example image that shows flowers as a decal layer on top of a repeating grass texture. As you can see, the flowers are not arranged in a grid. I'm not an artist, so excuse the poor choice of textures ;)

    Maybe the most useful technique I developed is using tiles of different widths. This allows textures with proportional font text to be created on-the-fly, with very high resolution. If you want to have readable book or newspaper pages, labels, etc., this can save a lot of memory. Here's an example with text, but this technique is also useful for other kinds of surfaces, like a brick wall. The placement of the bricks isn't perfect here, but that can be improved easily (just a content question). I think it still shows very well what kind of irregular textures you can achieve with only 15 small tiles/bricks.
     
  2. corysama

    Newcomer

    Joined:
    Jul 10, 2004
    Messages:
    175
    Likes Received:
    122
    Very cool work!

    Where this could be very useful is in conjunction with texture-heavy techniques such as "bidirectional texture function" rendering. Small patches of BTF data require large amounts of storage. But if you could irregularly tile it, it becomes feasible in a lot more situations.
     
  3. Humus

    Humus Crazy coder
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    3,217
    Likes Received:
    77
    Location:
    Stockholm, Sweden
    Very interesting. I looked at Li-Yi Wei's slides though, and it says that it doesn't work with mipmapping, which would reduce the usefulness of this technique quite a bit.
     
  4. 3dcgi

    Veteran Subscriber

    Joined:
    Feb 7, 2002
    Messages:
    2,435
    Likes Received:
    263
    Nice work. The scalable text sounds useful.
     
  5. Xmas

    Xmas Porous
    Veteran Subscriber

    Joined:
    Feb 6, 2002
    Messages:
    3,298
    Likes Received:
    137
    Location:
    On the path to wisdom
    It does work with mipmapping, though there are a few problems with higher levels of (edit: ) minification. There are a few things you can do to alleviate this, and it can be fully solved if you precalculate a smaller version of the virtual texture (say, 256x256) and use it for the lower mipmap levels. If you set alpha to 0 in the base level of this texture, and to 1 in all subsequent mip levels, you can use trilinear filtering to smoothly fade in this texture. And if you set MagFilter to linear or point, the cost of this additional texture is a single cycle as long as you don't need it.

    But it depends a lot on texture content. Often you don't even need this because the artifacts aren't visible.
     
    #5 Xmas, Sep 9, 2005
    Last edited by a moderator: Sep 9, 2005
  6. Rys

    Rys PowerVR
    Moderator Veteran Alpha

    Joined:
    Oct 9, 2003
    Messages:
    4,156
    Likes Received:
    1,433
    Location:
    Beyond3D HQ
    This reminded me of aths' work with his own tile renderer. Nice to see you solved problems with tile repetition and arbitrary placement.

    If you're running up on issue with texture projection and filtering tile boundaries because the tiles are small, aths' method of rendering a noise surface on top seemed to help.

    I need to resurrect my Wang benchmark that I gave up on (was sort of using it to measure texture caches). A translation of your thesis would be cool to see :grin: Nice work!
     
  7. Xmas

    Xmas Porous
    Veteran Subscriber

    Joined:
    Feb 6, 2002
    Messages:
    3,298
    Likes Received:
    137
    Location:
    On the path to wisdom
    What aths did is offline generation of tile textures, which of course hits the texture size limit of the hardware quite fast. I'm not aware of having solved any problem with tile repetition, except by using more tiles and way larger virtual textures. ;)

    I don't see how high-frequency noise could help with artifacts that only appear with heavy minification (not magnification as I wrote before).
     
  8. Rys

    Rys PowerVR
    Moderator Veteran Alpha

    Joined:
    Oct 9, 2003
    Messages:
    4,156
    Likes Received:
    1,433
    Location:
    Beyond3D HQ
    Ah, I thought he was stitching small tiles in realtime in that app, not generating them offline :oops: And you solve repetition quite well in my eyes by varying tile edge and tile brightness :razz:

    Your screenshots look good, anyway.
     
  9. Mate Kovacs

    Newcomer

    Joined:
    Dec 12, 2004
    Messages:
    163
    Likes Received:
    3
    Location:
    Mountain View, CA
    Have you seen this? There are some interesting ideas about tiled textures (boundary constraints, etc).
     
  10. Xmas

    Xmas Porous
    Veteran Subscriber

    Joined:
    Feb 6, 2002
    Messages:
    3,298
    Likes Received:
    137
    Location:
    On the path to wisdom
    Interesting read. Seems like they're doing a fixed mapping of tiles to geometry, something I specifically tried to avoid. Boundary constraints are already a part of the Wang Tile approach.

    http://www-viz.tamu.edu/faculty/ergun/research/textures/tiledtextures/talk/
    :lol:
     
  11. Richard

    Richard Mord's imaginary friend
    Veteran

    Joined:
    Jan 22, 2004
    Messages:
    3,508
    Likes Received:
    40
    Location:
    PT, EU
    This is very interesting, although a tad disappointing it requires quads. How efficient do you guys rate this for less arbitrary structures (like, say terrain)?
     
  12. Xmas

    Xmas Porous
    Veteran Subscriber

    Joined:
    Feb 6, 2002
    Messages:
    3,298
    Likes Received:
    137
    Location:
    On the path to wisdom
    Which technique, and what kind of efficiency do you mean exactly?
     
  13. Richard

    Richard Mord's imaginary friend
    Veteran

    Joined:
    Jan 22, 2004
    Messages:
    3,508
    Likes Received:
    40
    Location:
    PT, EU
    This later one: http://www-viz.tamu.edu/faculty/ergun/research/textures/tiledtextures/

    My question relates to how useful would this be for terrain or other fairly predictable surfaces. Specifically, I can see the worthiness of this technique for arbitrary structures shown in the paper since distortion is an issue and the synthethic factor could possibly help cut down development time (efficiency).

    With terrain you have e.g. vertex texturing and other techniques to reduce distortion and generate randomness. The poly mesh for terrains is also much less prone to distortion since surfaces are more predictable. Would "Tiled Textures" be just as useful for terrains?
     
  14. Xmas

    Xmas Porous
    Veteran Subscriber

    Joined:
    Feb 6, 2002
    Messages:
    3,298
    Likes Received:
    137
    Location:
    On the path to wisdom
    Most Certainly yes. The goal of tiled textures is usually to avoid repetition artifacts. Terrain needs to be both vast and detailed, and that requires either a massive amount of unique texture data, or clever reuse of a smaller set of textures to look good.

    There are some problems with applying that geometry-based approach to terrain, though. You can't trivially apply a geometry LOD technique to the terrain, because that could break the quad-to-tile relation. And for distant terrain you need a precalculated tiled texture to avoid aliasing anyway. IMO the shader-based approach is much easier to use because it's completely independent of the underlying geometry and works just like an ordinary texture. Additionally, you don't need to replicate vertices for it, like you have to do for the geometry-based approach. OTOH, the shader-based approach is most likely slower, at least on current hardware.
     
  15. Simon F

    Simon F Tea maker
    Moderator Veteran

    Joined:
    Feb 8, 2002
    Messages:
    4,560
    Likes Received:
    157
    Location:
    In the Island of Sodor, where the steam trains lie
    Some of the examples don't look very seemless, e.g. "rusted iron" on page 6 - the regular boundaries look quite obvious.
     
  16. KimB

    Legend

    Joined:
    May 28, 2002
    Messages:
    12,902
    Likes Received:
    218
    Location:
    Seattle, WA
    True, but that is just a content issue. It looks to me like that paper is mostly concerned with digitizing photographs for use as textures, whereas Xmas is more concerned in his paper about getting tiled textures to not look tiled, if you already have the textures.
     
  17. Simon F

    Simon F Tea maker
    Moderator Veteran

    Joined:
    Feb 8, 2002
    Messages:
    4,560
    Likes Received:
    157
    Location:
    In the Island of Sodor, where the steam trains lie
    That's my point. [​IMG] This sort of thing, surely, is meant to be seemless yet the junctions are visible. Previous work, e.g. http://www.cc.gatech.edu/cpl/projects/graphcuttextures/, doesn't seem to display these artefacts.
     
  18. Xmas

    Xmas Porous
    Veteran Subscriber

    Joined:
    Feb 6, 2002
    Messages:
    3,298
    Likes Received:
    137
    Location:
    On the path to wisdom
    I guess the complexity of their example models does a good job at hiding that.


    I did look into the generation of seamless tiles, too. I basically took the tile generation method from this well-known paper by Cohen et al., dropped the overlap area in the middle, and got away with huge memory savings by removing redundant tile parts where possible.
     
Loading...

Share This Page

  • About Us

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...