IC Forum Archive
Full text search
Textures (nsfw-ish)
   IC Forum Archive Index -> King of Development XI: Eyes of Burning Indie Go to page: 1
Author Message
aderack



Posts: 5018

PostPosted: Sat Aug 26, 2006 8:42 pm    Post subject: Textures (nsfw-ish)

Now, I thought I generally understood how textures work: you've got a bunch of image files containing... textures, that are applied to polygonal models. Like, say, you've a drawing of a bunch of bricks. That's tiled and turned into a brick wall. You've a distorted face, that's mapped around the geometry of a nose and chin and whatnot, to give a character a non-distorted face. All simple enough.

I guess I'm behind, though. Because... uh... how exactly do these work?



Okay, I basically get this -- it's just wrapped around in a strange way, then probably blurred over and mirrored toward the center. Why, though, does it seem to be drawn with perspective? Look at the ass. I keep seeing things like this, apparently drawn from a particular POV rather than flat, and it puzzles me. I'm also puzzled how the interpreter knows what part of an image to use, and what part to ignore. I'm used to textures filling a whole rectangle.

To wit:



Nguh? What... exactly is going on here?
Back to top
Hot Stott Bot



Posts: 2097

PostPosted: Sat Aug 26, 2006 9:15 pm    Post subject:

The way it works, is that each vertex on your model aside from having a coordinates in it's own object- or world-space, also has coordinates in the texture-space!

So, basically, a vertex has coordinates like {0.1, 0.2, 0.3} telling it where to put the point in space, but also has a coordinate like {0.5, 0.6} telling it where that point would map to in the texture.

Then, each vertex has one of these, and so when you draw a polygon of some sort, you just interpolate for each pixel and then map it to the texture for selecting the appropriate color. (The actual process is much more complicated than that with modern techniques, but you get the idea.)

So the way something like a big texture for a complex surface (such as a body) is generated, is by basically starting with a closed 3D surface, cutting a hole in it, then unfolding it into something flat.

The sense of "perspective" you see is from angled surfaces being unfolded into something flat.
Back to top
Mr. Business



Posts: 1530

PostPosted: Sat Aug 26, 2006 9:20 pm    Post subject:

An easier way to say that is that they create a "texture map" on the model, telling it which bits to take from the bitmap and where to slap them on the model. It's a bit like paint by numbers, except that it involves a lot more math.
Back to top
Mister Toups



Posts: 4943

PostPosted: Sat Aug 26, 2006 9:23 pm    Post subject:

So there's basically an extra map that goes over this that has points on the texture map telling the game engine where they should bend and wrap around the model? Like a sort of stretched out wireframe or something?
Back to top
Hot Stott Bot



Posts: 2097

PostPosted: Sat Aug 26, 2006 9:26 pm    Post subject:

Yep!

And the same basic idea extends to lots of other things too! For example, another very basic example is that each point can have a normal vector to show the general direction of that surface at the point, for lighting and shading purposes.

In a sophisticated system, the simplest way to think of things is that a "vertex" isn't a point in space, so much as it is just... a point... that holds a bunch of coordinates in different spaces.
Back to top
Mr. Business



Posts: 1530

PostPosted: Sat Aug 26, 2006 10:28 pm    Post subject:

Mister Toups wrote:
So there's basically an extra map that goes over this that has points on the texture map telling the game engine where they should bend and wrap around the model?


You're imagining this as something more physical than it is.

It's more like this: You have a triangular section of bits taken from your bitmap by the texture map and that section corresponds to the size of the vertex onto which you want to overlay those bits. There is no wrapping. EAch vertex takes the bits that it wants and leaves the others for the other vertexes. The "wrapping" is more or less an illusion.

However, the creation process does basically involve something similar to a stretched out wireframe. Most of the texture maps that I have seen usually overlay a wireframe on top of the texture, but most of that is only for use as a convenient reference for the artist. The really complicated shit that the computer does is much less elegant, as described above.

However, this is mostly just my crude understanding. They may not even do texture mapping that way anymore, for all I know, especially with all this UV mapping and parallax mapping business.
Back to top
vision



Posts: 472

PostPosted: Sat Aug 26, 2006 10:34 pm    Post subject:

You can also arrange your bitmap in a less logical manner as in the (TOOBIN!) example below to reduce the overall size of the file.

Back to top
Persona-sama



Posts: 1145

PostPosted: Sat Aug 26, 2006 11:54 pm    Post subject:

THREAD HIJACK:
I've always been interested in learning how to make polygon models. Does anyone have any simple tutorials on how to give it a go using 3d Studio Max or any other program?

Conversely, anyone have some un-textured models that we could use to take a stab at making textures for? Let's turn this into a workshop thread!
Back to top
Mr. Business



Posts: 1530

PostPosted: Sun Aug 27, 2006 1:25 am    Post subject:

Persona, I recommend Maya because you can get a non-commerical-exploitation version of it free of charge - no cracking involved - from the people who make the program (or so I hear).

As for tutorials, I hear that nothing beats a good book, but I'll check some sources.
Back to top
ORC



Posts: 46

PostPosted: Sun Aug 27, 2006 4:15 am    Post subject:

Those would be called UV maps.

...its one of those things thats near impossible to explain but forehead-slap easy once you see it in action.
Back to top
Mr. Business



Posts: 1530

PostPosted: Sun Aug 27, 2006 10:41 am    Post subject:

ORC wrote:
Those would be called UV maps.


Oh, that's what they call that now, eh? Hm, I wonder if the process has changed any since the Half-Life 1 days.
Back to top
ORC



Posts: 46

PostPosted: Sun Aug 27, 2006 9:55 pm    Post subject:

depends on the prog. They all vary slightly. Some need plug-ins to do it, some you have to save the material all wierd, etc...

Its a pain in the ass to unwrap and sort all the polygons, but really worth it in the end.
Back to top
Sawtooth



Posts: 2350

PostPosted: Mon Aug 28, 2006 12:57 pm    Post subject:

there was a program called meshwork for mac that makes it really easy to do simple stuff in this vein. I heard that the pc equivalent is nendo, but I've never tried it out. I made some sweet low-poly models with meshwork back in the day.
Back to top
Harveyjames



Posts: 196

PostPosted: Tue Aug 29, 2006 5:31 am    Post subject:

You can get tutorial DVDs for Maya quite easily, which are pretty comprehensive. Tutorial movies are a good way of learning software. I think the one I've got is called 'Maya Essential Training'.
Back to top
Hot Stott Bot



Posts: 2097

PostPosted: Thu Aug 31, 2006 10:00 pm    Post subject:

vision wrote:
You can also arrange your bitmap in a less logical manner as in the (TOOBIN!) example below to reduce the overall size of the file.



Known as a "Texture Atlas". Basically, it's just a performance optimization, and usually done automatically these days.
Back to top
Hot Stott Bot



Posts: 2097

PostPosted: Thu Aug 31, 2006 10:10 pm    Post subject:

various wrote:
3D Modeling Programs


The philosophy of sort of chopping up and pulling on basic shapes to do the meshes for 3D models is one of the most widely accepted modern methods!

Nendo sort of started the craze back in the day...

ZBrush is pretty much the end-all be-all of this. Amazing tool... but expensive.

Wings 3D is probably the best free tool similar to Nendo...

Those tools are all great ways of getting the right shape and feel of your basic model.

For very precise and detailed modeling work, like taking a basic mesh and cutting triangles here and there, pulling thigns together, making minor changes, and tightening the whole thing up... 3DS Max is pretty much where it's at.

For organizing models together, doing animation and skinning work, lighting work, running scripts on models, etc. etc.... Maya is pretty much where it's at.

So!!

Modern systems are usually a three-step process:

1. Start with one program to make the basic shape.
2. Use a more detailed program to clean up and fine tune your basic shape.
3. Use a finishing program to tie everything together and work with your finished model.

Never modeled before? Got no cash?

I'd start with something like Wings 3D and google around for some tutorials. Start by learning how to create shapes and stick to that for a while.
Back to top
ReroRero



Posts: 2148

PostPosted: Thu Aug 31, 2006 10:15 pm    Post subject:

MilkShape 3D is good to start with.
Back to top
Sushi D



Posts: 88

PostPosted: Thu Sep 07, 2006 10:39 am    Post subject:

metasequoia is kind of easy and fun to start with. you have to get both the freeware and shareware versions though.
Back to top
KonamiCode



Posts: 88

PostPosted: Fri Sep 15, 2006 12:38 pm    Post subject:

I would probably go with Milkshape or the Maya PLE. I myself started way back in the Quake days with something called the Quake Model Editor; but went to 3ds max. Initially looking at Max or Maya can be a bit overwhelming, because there is just so much *stuff* everywhere: menus, widgets, icons, bars, sliders, etc. It can make going through tutorials a bit tricky until you start to learn what is what.

Right now I'm mainly working with Maya; mainly because that seems to be the more popular choice now than max, but I'm sure they'll end up getting smashed together eventually since Autodesk bought Alias. XSI I hate, but it seems to be getting popular since Valve and Epic support them for HL2 and UT2007 modding.

Last month I got a model into UT2004; I had always wanted to model Priss from Bubblegum Crisis, the original. At this point there are a few revisions I want to make, and the texture is pretty weak, but you can see it here: http://stevenrynders.blogspot.com/2006/08/ingame-rev1.html
and here:
http://stevenrynders.blogspot.com/2006/08/priss-update.html

The second link has a grid mapped to it; if you guys want I can pull the unwrapped UVs off the other computer and post them to see what it's like initially unwrapping something. It's a pain in the ass.
Back to top
   IC Forum Archive Index -> King of Development XI: Eyes of Burning Indie All times are GMT
Page 1 of 1