Home Technical Talk

Curious. square vs rectangular texture

Sage
polycounter lvl 19
Offline / Send Message
Sage polycounter lvl 19
Hi I was wondering what are the benefits of using a 512 x 256, vs 256 x 256 for example. I thought they used the same amount of memory and from what I seen 3d apps prefer the layout to be square. I'm just wondering what are the benefits of using a rectangular texture page. Thanks.

Alex

Replies

  • Eric Chadwick
    I've heard non-squares can fit into memory better on certain hardware. They can also work well for meshes with longer UV elements.

    Though we use all squares here.
  • Ryno
    Offline / Send Message
    Ryno polycounter lvl 18
    If you've got a long stretch of wall or road, tiling will be a lot more obvious if you use square textures. Longer textures means that the player will have to travel farther before seeing the texture repeat, and they'll tend to notice the tiling less.
  • malcolm
    Offline / Send Message
    malcolm polycount sponsor
    I've never heard of a rectangle being more efficient than a square? Although I think there was some magic texture size that the ps2 really liked, 128x128 I think? Apparently the xbox360 prefers 256x256? Also if you map some mega texture 2048x2048 square you could scale the texture into a rectangle and save some big bucks on texture ram without losing too much detail in game.
  • Daz
    Offline / Send Message
    Daz polycounter lvl 18
    [ QUOTE ]
    Also if you map some mega texture 2048x2048 square you could scale the texture into a rectangle and save some big bucks on texture ram without losing too much detail in game.

    [/ QUOTE ]

    Too true. I actually used to use this trick quite a lot when we were down to the wire trying to squeeze everything into the PS2 close to ship, even on much smaller textures. It always amazed me how neglibile the difference was.
  • Eric Chadwick
    Ah so I guess scaling by half in one dimension basically gives you half the resolution, instead of scaling by half in both which gives you 1/4 the rez. Interesting.

    I've heard some hardware can only use squares, but I'm not sure which those are, they might just be older PC cards.
  • JKMakowka
    Offline / Send Message
    JKMakowka polycounter lvl 18
    I think older 3DFX cards can only handle square textures, but don't quote me on that.

    Oh and the XBOX360 is still optimised for 256x256??? That seems awefully little given it's HD output.
  • Jay Evans
    Offline / Send Message
    Jay Evans polycounter lvl 18
    In BF we use tons of textures on objects which are 256x2048, or 512x2048, but they are basically just a collection of smaller square textures. We do it to save draw calls. Each polygon mapped with an individual texture or shader costs you a draw call. Video card can only do so many. So a building with one of our texture strips only would be one draw call, instead of being 5 or whatever if they were all individual textures.
  • Eric Chadwick
    Why pack them rectangular instead of square?
  • Jay Evans
    Offline / Send Message
    Jay Evans polycounter lvl 18
    If they are packed in a rectangle they still can tile in one direction.
  • malcolm
    Offline / Send Message
    malcolm polycount sponsor
    Eric, I've worked with render engines that only allow square textures, as well as engines that only allow rectangles in the horizontal. For environment junk I usually map buildings into a square and if we run out of space I scale to a rectangle. This saved huge texture ram on street3 and no one could tell the difference in game. You can start out with square or rectangle source art it works both ways. Looks like half life 2 heads started out rectangles and then were squished into a square?
  • danr
    Offline / Send Message
    danr interpolator
    on psp, landscape aspect rectangles are better than portrait aspect. Fits into the texture cache better.

    Also, the trick of halving your hi-res square textures down to rectangles rather than quatering them to a smaller square is a beauty
  • Eric Chadwick
    This is good intel guys, thanks.
  • Sage
    Offline / Send Message
    Sage polycounter lvl 19
    Thanks for the feedback, very nice read. smile.gif

    Alex
  • Joshua Stubbles
    Offline / Send Message
    Joshua Stubbles polycounter lvl 19
    The PS2's texture preference depended on what bit depth you used. If you used 8bit, the optimal size would be 128x64. If you used 4bit, it was 128x128. This was due to the fact that for each bit depth, the vram cache was differant.
    At 8bit, the PS2 vram has perfect space for a 128x64 texture. And it draws one page at a time. So if you used a 64x64x8bit texture, you'd be wasting half of your memory for that page.
    I can't quite remember what it was for the original xbox, but I believe it liked it's 8bit textures at 128x128. Most of the textures I did for the Xbox version of STACKED were at that res, I believe.
  • Downsizer
    Offline / Send Message
    Downsizer polycounter lvl 18
    could ratio scale also be a factor for widescreen display and such? I understand from a 2d perspective you would get stretching when displaying an image in different ratios, is the the case in 3d or is it scaled virtually?

    god forbid we have 1:1 tv's, though i suppose the design is in our eyes periferial(sp) vision being horizontal biased.
  • KDR_11k
    Offline / Send Message
    KDR_11k polycounter lvl 18
    The reason for widescreen is that some people were duped into buying widescreen TVs (that have an aspect ratio that matches none of the movies or TV shows...) so they want widescreen games.
Sign In or Register to comment.