Jump to content


Texture question


7 replies to this topic

#1 Ostapas

    New Member

  • Members
  • Pip
  • 3 posts

Posted 04 February 2008 - 04:35 AM

Good day,
let's say I have many 3d models which I would like to import to 3d engine. The problem is, their texture sizes are not power of 2(128*128, 256*256, ...) and the engine only accepts these. Anyone knows a method, tool or software how to batch-resize (or slice) and "restick" the textures without distortion?

#2 fireside

    Senior Member

  • Members
  • PipPipPipPip
  • 1272 posts

Posted 04 February 2008 - 05:30 AM

Gimp does batch processing, but you need a script. Take a look at this page. If you scroll down there is a link for window's binaries.

http://members.ozema...odsond/dbp.html

#3 Reedbeta

    DevMaster Staff

  • Administrators
  • 4979 posts
  • LocationBellevue, WA

Posted 04 February 2008 - 05:57 AM

You can also use the ImageMagick toolkit to do batch image processing. It's very powerful, but all command-line - no GUI.
reedbeta.com - developer blog, OpenGL demos, and other projects

#4 Ostapas

    New Member

  • Members
  • Pip
  • 3 posts

Posted 04 February 2008 - 06:38 AM

Thanks for your reply. However, simply resizing textures to standart sizes(256*256, 512*512,...) does not solve the problem, as they are mapped on 3d model, so when I view the model with resized textures, they look stretched, skewed, whirled, rotated, stripped, wrinkled and so on :) I hope you understand it, my modelling, texturing and English knowledge are not really strong.

#5 hovermonkey

    Member

  • Members
  • PipPip
  • 38 posts

Posted 04 February 2008 - 01:01 PM

You'd be better off padding out your textures to powers of 2, but then you need to change your texture coordinates in the model as well. Also you need to split triangles which wrap around the edge of the texture. I don't know of any tool that does this though, unfortunately. What 3D model format are you using as input to the engine? Which engine is it?

#6 Hawkwind

    Member

  • Members
  • PipPip
  • 92 posts

Posted 04 February 2008 - 01:11 PM

Can't you just remap the u,v's of the model to fit a resized texture ? I'm told
that both Max and Maya will do this (I'm not an artist)

#7 fireside

    Senior Member

  • Members
  • PipPipPipPip
  • 1272 posts

Posted 04 February 2008 - 01:21 PM

Quote

Thanks for your reply. However, simply resizing textures to standart sizes(256*256, 512*512,...) does not solve the problem, as they are mapped on 3d model, so when I view the model with resized textures, they look stretched, skewed, whirled, rotated, stripped, wrinkled and so on

I hope you learned your lesson. Use powers of two!!!!! They look different because they have been resized and there's nothing you can do about that. They still should fit because texture mapping works on a percentage of 1, so the size shouldn't technically change other than the fact that the image has been resized and somewhat distorted. It might be better to go larger rather than smaller, but nothing is going to work perfectly because they are pixels. Also, the better the image algorithm the better it will work. If your images weren't at least square, though, you're pretty much dead meat. You can resize to 256 * 512, too, they don't have to be square, just powers of two, but if it's not close to the right size it's going to look bad. You can probably find a directx engine where you can get away with it.

#8 Ostapas

    New Member

  • Members
  • Pip
  • 3 posts

Posted 04 February 2008 - 03:55 PM

OK,thanks a lot!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users