Aller au contenu

Photo

Applying Textures to Model


  • Veuillez vous connecter pour répondre
19 réponses à ce sujet

#1
Jedijax

Jedijax
  • Members
  • 396 messages
Can anybody give me a short lowdown on how to apply new textures to a model? I don't mean just overriding  already present textures, but actually applying tga's in any way I want to a model's surface.

I figure it is done through a model editor, so, is there a 3DS Max tutorial on this particular?

#2
_six

_six
  • Members
  • 919 messages
My method in 3dsMax or gmax is to simply drag and drop the texture file itself from a folder in Windows onto the object in the 3ds/gmax window. There are more complex ways of going about it, but for the purposes of NWN that's fine.

Alternatively, if you open up a .mdl file in Notepad or another text editor and look for lines saying, for example, bitmap thisoldtexture, you can set that to another texture name by changing the second part of the line (ie bitmap mynewtexture. Don't include file extensions like .tga in the texture name. The bitmap property appears once for every 3d object in the model file, and these may use the same texture repeatedly or many different texture names. If an object hasn't been given a texture, its texture name will appear to as NULL.

Modifié par _six, 10 avril 2011 - 03:36 .


#3
Bannor Bloodfist

Bannor Bloodfist
  • Members
  • 938 messages
Do a google search and you will find hundreds of them.

"3ds max uvw unwrap tutorials"

This is the first one, which is a BASIC version, done via youtube.

#4
Jedijax

Jedijax
  • Members
  • 396 messages
Ok, I knew about the text editor texture replacement method, and Six's input on dropping texture files from explorer directly into 3DS Max was a good tip, but I was wondering how you actually turn and move the texture to fit the model in any way you want?

#5
Bannor Bloodfist

Bannor Bloodfist
  • Members
  • 938 messages
That is exactly what UVW Unwrapping is. You place the texture on the object, then uvw unwrap and click the edit button.

That opens a new window where you can manually move the verts/faces of the object to exactly where you want them on the actual texture.

I am not trying to make it hard on you, but that is the only way to really do what you are asking. I highly suggest watching a few of the videos that come up with that uvw unwrap search.

Using the unwrap/edit mode you can have a texture, say of a dragons skull that has been sliced down the middle and flattened out. With the unwrap edit mode you can actually grabe the verts around the eye section of your skull object and move them (inside the edit window NOT on the actual object) and place them directly over the eye in the texture.

No one can tell you in a single or a couple steps how to do this, your best bet is to watch a few of those vids or grab a couple tutorials from the net.

#6
Jedijax

Jedijax
  • Members
  • 396 messages
Dude, why is it everything I ask in the forums turns out to be the most complicated thing? I mean, I consider myself a retard when it comes to NWN custom content, and mods, and ·$%!, so every time I post a thread, I'm expecting someone to tell me: -Hey, man, doing that's a piece of cake!- but I always get a -Huh? Are you mad? That's like... a highly complicated, difficult, insane thing!-

I mean, we get guys asking how to use the override folder all the time, or how to re-skin a tileset, and here I'm guessing my questions are just as simple as those, but every single time: Bam! You need a degree in neverwintian art and science to make this &%$· work!

Thanks for the tips and links bannor!

Modifié par Jedijax, 13 avril 2011 - 08:15 .


#7
Bannor Bloodfist

Bannor Bloodfist
  • Members
  • 938 messages
Sorry dude, it really is not all that hard to do, but you must already be familiar with 3ds/gmax to be able to do it. If not, the learning curve is VERY steep.

I wish it was as simple as a 1-2 click.

#8
Zwerkules

Zwerkules
  • Members
  • 1 322 messages
It is simple or else I couldn't do it :P

#9
Frith5

Frith5
  • Members
  • 381 messages
It's not all that bad. Just get gMax going, make a simple cube. Play around with getting a texture mapped to the sides of that cube. When you can do that, you are well on your way. Like anything else, it's open ended. One can certainly get started without too much trouble. But there is really no end to what can be done, so that means more and more learning is always on the horizon. I don't think it's a bad thing though. Just get started as simply as possible. You will naturally absorb things and grow from there.

JFK

#10
Jedijax

Jedijax
  • Members
  • 396 messages
What the %$$··"??!! This %$·" is the most %$·"!· up $%&"! I've ever tried for NWN!
2DA works? Pfa!... Texture editing and shading in PAINT.NET? Meh... Model tweaking? childsplay! But this?! This is the &%$·!"·$% Pope!!

Just so people as ignorant on this matter as I was up till today know what I mean, you can't "move" a texture over the &%$·"! model, no, cause that would be too humane, no... the software creators, in their infinite wisdom, decided it was best for you to "unwrap" a 3d model as a &%$·"! cardboard figure and lay it all in a unspeakably weird form so you can add an equally %$·"! up texture over it, and then pray everything got in place the way you expected!!

sniff sniff... I can't take this anymore... I mean, when did NWN become so difficult... I'm sorry, I'm just too emotional today...

Modifié par Jedijax, 14 avril 2011 - 05:33 .


#11
_six

_six
  • Members
  • 919 messages
What exactly are you working with?

'cos if you're just putting on a plain material texture, rather than a detailed laid out one, you might want to investigate the UVW Mapping modifier. It's got a bunch of half-arsed cheating methods in it that I used to use almost exclusively. They won't work nearly as well as manually mapping, but they're an excellent way to get something that looks halfway decent without any manual manipulation - and a good starting place for manually mapping something.

Modifié par _six, 14 avril 2011 - 10:32 .


#12
Jedijax

Jedijax
  • Members
  • 396 messages
Well, I'm actually talking about the UVW Mapping modifier. I just wanted to "adjust" an already existing texture on the model, no fancy shmancy work, I guess, but a simple "aligning" of said texture.

You see how the 1.69 TNO buildings have a "bricked" ended texture in the corners (which is actually dubbed "corner")? Well, I wanted to use such in the ever-growing re-skin I have been doing for TTR, but, as usual, the texture needs to be aligned so the bricked-corner is actually in the corner of the buildings, and not placed in the middle or some such. Your drag and drop method is fine for placing and quick checking new textures over a model, you know, to see immediately if a texture is smeared or flipped, or whatever, something that is very slow and hard to check when modifying via text editors, so I can't fathom why you can't simply "grab" the already placed texture as you would a model, in order to adjust it over the model's face; it just would seem so obvious...

#13
Zwerkules

Zwerkules
  • Members
  • 1 322 messages
Those corners typically are textures with an alpha layer so they can be applied to all kinds of walls. If they are 'mixed' with the wall texture you can just replace the name of the texture and move the t-verts so the corner is really at the corner of the building, but I advice against it. It would be better to use a texture with an alpha layer for the corner, use gmax to make some boxes in the corners of the building to which you apply the texture and then remove the sides of the boxes you don't need. The boxes have to be placed so that if the corner of a wall is at, let's say 300, 100, 0, the corner of the box has to be at 301, 101, 0, so you don't get any flickers.
With this method you only need one corner texture for all kinds of walls and you only have to apply the texture of the corner once. Once you got the first corner right you can clone and turn and move it to use it for the other corners.
As for moving the texture around, you can do that either by using the uvw xform modifier. It has an u and v offset which will move the texture in the u or v direction, or you can apply an unwrap uvw modifier, select all vertices and then move all of them. If you just need to change one side of a box for example, you can select all the faces of that side of the box and then apply the unwrap modifier and it will only affect those faces. It really isn't very hard to do.
Also if you got a texture right and need it for another object with the same geometry, you can save the uvw map and then apply an unwrap uvw modifierer to the second object and load the uvw map.

#14
Bannor Bloodfist

Bannor Bloodfist
  • Members
  • 938 messages
Using the unwrap edit mode, in the upper section is a selection box, that defaults to a checkerboard pattern, but if you open that selection box, you get the actual texture assigned. Image IPB

So, do that, select the real texture so it displays in the selection box.
Now your texture will display in the edit window. Image IPB

There is another option to setup in the edit window, under options. Image IPB


The default edit window works with verts.  Regardless, do a ctrl-a to select all verts, and you can then drag them all.  Drag them until the corner is where you want it.  Image IPB

Depending on your screen size, and if the edit window is not overlapping your main display of the object, you can "see" the texture move on the object in the main display.  Image IPB

Modifié par Bannor Bloodfist, 16 avril 2011 - 01:47 .


#15
_six

_six
  • Members
  • 919 messages

Well, I'm actually talking about the UVW Mapping modifier. I just wanted to "adjust" an already existing texture on the model, no fancy shmancy work, I guess, but a simple "aligning" of said texture.


Actually, if you just want to scroll a texture along, there's a UVW Xform modifier that has some very simple scrolling and scaling tools without having to mess with the UVW geometry yourself.

I'd reccomend Bannor's method though once you've got used to how it works. The UVW Xform is pretty much trial and error, where via the UVW Unwrap method you can drag the texture to where it needs to be at a glance.

Modifié par _six, 15 avril 2011 - 01:58 .


#16
Jedijax

Jedijax
  • Members
  • 396 messages
Ok, first off, Bannor... you're my hero. I mean, you went through the trouble of taking screen caps and adding written instructions, and also uploading those here as a visual tutorial? Man... it brings tears to my eyes...

I did everything that has been suggested here, and the method you and Six advised is actually quite useful and relatively easy to perform. However, I have hit another snag (as if the previous dilemma wasn't enough!). You see, the texture is a square with the "bricked corner" over a "brick wall" texture that is supposed to be what the rest of the model should be covered in. So, as I open the texture in the UVW window as mentioned, it appears cropped, you know, as several copied instances over which you move the "ctrl-a'd" verts. Thing is, both the model and the verts group are not a square or cube, but a rectangle, so the texture appears repeated over and over again. This means the "bricked" corner cannot be placed solely at the corners, as intended, but all over the wall as well, repeated at intervals. I figure there are two solutions to this: One is to be able to apply more than one texture to the same model, so as to "paste" the bricked corners at each corner without using a single texture over all the model, and second, to actually be able to texture, not the entire model, but it's faces separately.

I'm embarrassed to say this, but, could you guys give me just a little more insight on this?

#17
Zwerkules

Zwerkules
  • Members
  • 1 322 messages
If the whole wall consists of just two faces, even applying the texture to only some faces will not help you. You'd have to change the wall itself so it would have two faces just for the corner and two faces for the rest of the wall, or even more faces if that wall has two corners.
I think you should really try to make a corner texture with an alpha layer which only has the corner on it and not the wall texture. This is less time consuming than having to split up all the walls and you can also use those corners for many different type of walls.

I'll give you a few screenshots to show you how to make a corner for a building. I assume that you have
a corner texture with an alpha layer.

Lets assume that this box is your house (yeah, I know, it isn't much of a house, but it has four corners
and that is all we need at the moment):

Image IPB

Now you create a box which has the same height as the building (300) and the length and width are the same (60x60). The corner of the house is at -250, -140, 0. Since your corner box is 60x60, its center is 30cm from the sides. You could move the box to the right position, but to place it exactly at the right coordinates you can enter those coordinates at the bottom were there are fields for X, Y and Z.
-250 plus the 30cm is -220 and -140 plus 30cm is -110. Now you have to make sure the corner doesn't take up the same space as the wall of the house so it has to be 1cm away from the corner of the house at both sides. So what you enter at the bottom of the gmax window is X: -221, Y: -111, Z: 0,0.

Image IPB

Now you got your corner in the right position. Drag and drop the corner texture on that box and apply an uvw map modifier.

Image IPB

Use the cylindrical with cap option and flip the texture if necessary. In this example it was necessary to flip it (Flip is activated for U Tile), otherwise the corner would have been on the right side of the box and we need it to be on the left side.
Now go and remove the faces of the box you don't need (the two sides that are inside the building and the top and bottom).

Image IPB

The corner texture is not exactly where it has to be, so you apply an unwrap uvw modifier.

Image IPB

You will see some isolated t-verts. Those are left-overs from the removed faces. You can select them and
hit the del key to remove them. Now select all the remaining verts as Bannor described and move them to
the right position.

Image IPB

The 'tool' for moving the vertices (in the top left corner) has a drop down menu from which you can select that you only want to move the vertices to the left or the right, so you don't accidentally also move them up or down. Now move them so that the vertices in the middle are at the middle of the corner.

Image IPB

Now the corner looks right.
From the modifier menu select 'Aurora Trimesh' and from the options there select 'Over-ride Mat Values'.
If you don't do that your corner will appear a lot darker than it should be.

Image IPB

If you actually want it to be darker you can adjust the Ambient and Diffuse settings here.
Link the corner to the model base or since it has an alpha layer it is even better to link it to the
animation node if there is one. You can also use Veltools to create an animation node if the tile doesn't have one.
Now export the model and have a look at it with NWNExplorer which will show the transparency of the corner correctly.

Image IPB

Modifié par Zwerkules, 16 avril 2011 - 04:30 .


#18
Bannor Bloodfist

Bannor Bloodfist
  • Members
  • 938 messages

Jedijax wrote...

Ok, first off, Bannor... you're my hero. I mean, you went through the trouble of taking screen caps and adding written instructions, and also uploading those here as a visual tutorial? Man... it brings tears to my eyes...

You are welcome, there is a whole heck of a lot more capabilities in that unwrap/edit window that I did not cover.  Play around with it, see what happens.  You may just be surprised at what you can accomplish just by trying.  Don't let the frustration get to you though, we have all been through it.  You "think" that some of this should be 1, 2, 3 type of things, that logically work in such-and-such a fashion.  That, unfortunately is not always the case.

I did everything that has been suggested here, and the method you and Six advised is actually quite useful and relatively easy to perform. However, I have hit another snag (as if the previous dilemma wasn't enough!). You see, the texture is a square with the "bricked corner" over a "brick wall" texture that is supposed to be what the rest of the model should be covered in. So, as I open the texture in the UVW window as mentioned, it appears cropped, you know, as several copied instances over which you move the "ctrl-a'd" verts. Thing is, both the model and the verts group are not a square or cube, but a rectangle, so the texture appears repeated over and over again. This means the "bricked" corner cannot be placed solely at the corners, as intended, but all over the wall as well, repeated at intervals.

  This can be handled in different ways depending on the textures AND objects involved.  Zwerkles post is a great example of using Alpha or even a Non-alpha texture on a seperate object.  More on this further down.

I figure there are two solutions to this: One is to be able to apply more than one texture to the same model, so as to "paste" the bricked corners at each corner without using a single texture over all the model, and second, to actually be able to texture, not the entire model, but it's faces separately.


Nope, an object can only have ONE texture applied.  Period.  IE, you can not assign a seperate texture to different faces. 

You CAN assign different bits of textures to different faces though.  You can select specifc faces (either by selecting the vertices OR the faces) and move them to different locations on the main texture.

Image IPB

They would have to be "detached" via the uvw unwrap edit window tools/options to do this. 
Image IPB

Now you could rotate them if you choose, or move them to a different section of the main texture.
Image IPB


I'm embarrassed to say this, but, could you guys give me just a little more insight on this?


No worries.  You WILL get there, if you stick with it.  :P

Oops. I forgot to show you the other bits you can do... but I can just tell you, you can take those individual verts (not selected by face, but selected by vertic) and move them closer together so that they don't cross the repeats of the texture in the edit window.  There is also a way to change the number of repeats in the edit window, but I forgot to make a screen capture of that.


P.S. Zwerkules did a pretty damned good tutorial set above, I HIGHLY recomend that folks boomark this thread to capture that, and poke him to create some tutorials elsewhere, like the vault or even over on the HarvestMoonConsortium cc threads located in my sig.

Modifié par Bannor Bloodfist, 16 avril 2011 - 01:52 .


#19
Zwerkules

Zwerkules
  • Members
  • 1 322 messages
Something I forgot to mention in my previous post is that if you just applied a new uvw map to an object it will have a gizmo which you can move around and even rotate to affect how the texture is applied to the object.
Lets say you just added an uvw mapping modifier to an object and chose the 'box' option. Now you don't like the position of the texture on the object. You go to the modify tab and look for the uvw mapping modifier. It has a small + in front of it that will sort of open a sub menu when you click on it. There you will find the 'gizmo'. If you select that, in this case a yellow box will appear because the 'box' option was used for the uvw mapping. It could also be a plane, etc.

Image IPB

Now you can move the mouse pointer over an edge of that yellow box and it will change to the 'drag' mouse pointer. You can now move the gizmo and see how it affects the texture on the object.
When you have finished, make sure the uvw mapping modifierer is below the Aurora Trimesh modifier. If not, drag it there. Then right click on it and from the menu select 'collapse to'.
You have to use 'collapse to' whenever you move a gizmo or a pivot point, but also if use a 'reset Xform' from the tools menu which you have to do after you scaled or mirrored an object.

Modifié par Zwerkules, 16 avril 2011 - 08:31 .


#20
Jedijax

Jedijax
  • Members
  • 396 messages
Oh, my! Sorry for not checking earlier! The visual tutorials are invaluable! Thank you Zwerkules and Bannor! Though I think this will require a little more time and effort than the previously tried functions, so I'll be back in a somewhat longer period, while I try and get all of this in!

And here I thought I could just drag and drop textures wherever I liked... grumble... grumble...