Author Topic: Texture: TGA-rotating, applying a texture, walkmesh...  (Read 1012 times)

Legacy_TheOneBlackRider

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Texture: TGA-rotating, applying a texture, walkmesh...
« on: April 17, 2012, 06:29:53 pm »


               Hello once again!

Ah, custom-stuff is a barrel without a bottom! '<img'>

I stumpled upon a new problem fiddeling with models:

I'm adding dirt roads to a desert-tileset, which does not have them (Zwerkules: Do not fear! I'm not fiddeling with your tileset!!).
I'm pretty much done except a texturing problem: The road models use the road texture of the NWN-desert set (ttd01_road01 + ttd01_road02). Strange enough, on 2 models, I need to rotate the TGAs, so they look right. But when I do this, the new texture is very blurred and thus does not connect nicely to the other original ones.

I believe, one reason may be a compression, my programs automatically do. I do not have Photoshop. I've tried with PSP and Gimp. In Gimp, you can even turn of the Compression, but still no success.

I checked, if ther might be a dds-version of those textures, but I couldn't find any... 'B)'

So, how can I simply rotate them without them getting blurry?

Any thoughts? Thanks in advance.
               
               

               


                     Modifié par TheOneBlackRider, 21 avril 2012 - 11:14 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Texture: TGA-rotating, applying a texture, walkmesh...
« Reply #1 on: April 17, 2012, 07:08:00 pm »


               did you actually need to rotate them? Or was this a TGA byte order issue? In otherwords was the image inverted/flipped? And now that you have rotated a flipped texture perhaps it is stretched because the UV map is all confused?

Dunno what is actually happening but it is 1 possibility that I'd lookout for.
               
               

               
            

Legacy_Zwerkules

  • Hero Member
  • *****
  • Posts: 1997
  • Karma: +0/-0
Texture: TGA-rotating, applying a texture, walkmesh...
« Reply #2 on: April 17, 2012, 08:57:52 pm »


               TGA flipper is a tool that can rotate tga images by 180°. It also fixes issues with TGA compression.
               
               

               
            

Legacy_TheOneBlackRider

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Texture: TGA-rotating, applying a texture, walkmesh...
« Reply #3 on: April 17, 2012, 09:10:33 pm »


               Hm... I pretty basic concerning my abilities with gmax and regarding texturing, I have only knowledge in replacing textures by changing the entry with in mdl-file manually - never got to the point to let gmax do the thing.
In other words, I cannot follow 100%. I've never worked with UV-map...

What I did in one case was to use the original desert road tile. They worked for straights and crossing with NP (of course), but also for the curves. The "T" connected in a wrong way, so I moved the position of the road-polys by 90° (in gmax), leaving the main terrain-poly as it was and all is well.

I have the problem with the endparts. If I rotate them 180°, they show up right, but since it is a resaved texture, it gets blurry. I'll try to fix that, also by moving the road-tile.

My main problem is with a "down the hill road" model I made. I copied the main terrain-part and made that the road part (reducing the width) and applied the NWN-straigt-road-texture to that one. If I use the orignal texture, the texture is "sharp" but the sides (which have the alpha-part to fade into the background) are at the top and bottom. So I need to rotate that by 90°.

But probably the key is to tell gmax from where to start to apply the texture. The model probably just has the wrong starting point. Probem is, I have no idea on how to do that.
(I thought, just rotating the texture would be the quickest way to do it without the non-knowledge of me...':whistle:'
               
               

               


                     Modifié par TheOneBlackRider, 17 avril 2012 - 08:20 .
                     
                  


            

Legacy_TheOneBlackRider

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Texture: TGA-rotating, applying a texture, walkmesh...
« Reply #4 on: April 17, 2012, 09:12:33 pm »


               Zwerkules! You just answered, while I was typing! I will right away test that and report. Thanks.
               
               

               
            

Legacy_TheOneBlackRider

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Texture: TGA-rotating, applying a texture, walkmesh...
« Reply #5 on: April 17, 2012, 09:30:53 pm »


               Just used the flipper and same result. It's blurred. So I bet, something else is wrong in what I'm doing.

Within the model-file, there is a rotation-option. I exported a model from gmax with that ticked and it now has the value 1, but it doesn't change aything.
               
               

               
            

Legacy_s e n

  • Hero Member
  • *****
  • Posts: 654
  • Karma: +0/-0
Texture: TGA-rotating, applying a texture, walkmesh...
« Reply #6 on: April 17, 2012, 10:15:39 pm »


               maybe you're extracting low res tga instead of the hi res 512 ones?
               
               

               
            

Legacy_TheOneBlackRider

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Texture: TGA-rotating, applying a texture, walkmesh...
« Reply #7 on: April 17, 2012, 10:42:04 pm »


               I used the NWN-explorer (1.69) to extract them from the SOU-part (I didn't find any other ttd01_road0x.tgas).

I gave that UVW-mistery a shot, chose UVW-Mapping (gmax) and checked flip U+V-tile and now the texture is layed in the right direction and SHARP! (It directly draws the original TGAs, so none added to the HAK.)
'<img'>

BUT now I found, that those wagon-tracks don't line up with the regular road tracks! They are a bit too wide!
I tried the Unwrap UVW-function to make it more slim, but until now, I didn't find the right way to do it (scale changes both directions, I only need one).
':crying:''<img'>
...
               
               

               


                     Modifié par TheOneBlackRider, 17 avril 2012 - 09:48 .
                     
                  


            

Legacy_Zwerkules

  • Hero Member
  • *****
  • Posts: 1997
  • Karma: +0/-0
Texture: TGA-rotating, applying a texture, walkmesh...
« Reply #8 on: April 18, 2012, 03:22:16 pm »


               You could use a trial and error method and move the t-verts in one direction until you get it right, or you could unwrap uvw the mesh with which you want your mesh's texture to match and click on a t-vert to see the uvw positions and the enter the same uvw positions for the t-verts of your mesh.

'Posted

Right click on the image and view it in its proper size. It is scaled down too much.

The upper t-vert positions of the unwrapped smeared texture have to match the lower t-vert positions of the properly applied texture.
First unwrap the correct mesh and look at the positions of the t-verts. Then unwrap the mesh with the smeared texture and enter the correct t-vert positions instead of the wrong ones.
That way the textures will match perfectly.

Also check if the vertices of your meshes are aligned properly. Maybe the edge of one mesh is broader than the edge of another.
               
               

               


                     Modifié par Zwerkules, 18 avril 2012 - 02:43 .
                     
                  


            

Legacy_TheOneBlackRider

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Texture: TGA-rotating, applying a texture, walkmesh...
« Reply #9 on: April 18, 2012, 03:51:58 pm »


               I'm walking unknown terrain! '<img'>
Thanks for the screen and the words and that you took time to do so!
I will try this evening. I'm not sure, if'll succeed, but I'll let you know!

Last night, I rotated the road plane, so I could use the original texture, cause it worked very well with the other tiles (which were squared) and instantly had new problems! That hill-road-plane is rectangular and I would have to resize it, meaning adding through stretching by an equal ammount for all  polys (if I move only the last line, I get a smeared texture) or adding polys to that plane, which I didn't manage to accomplish due to my lack of knowledge with gmax.
I planned to have this finished last weekend and this tile with the texture eat it all up + the last 2 evenings! So much to "too many kettles boiling"! '<img'>
               
               

               
            

Legacy_TheOneBlackRider

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Texture: TGA-rotating, applying a texture, walkmesh...
« Reply #10 on: April 18, 2012, 10:51:41 pm »


               ... Zwerkules, I tried! I tried really hard and failed! I'm just too unexperienced with applying textures via gmax. Sorry. I hopefully will, one day, work myself into that!

Stranded again, I took up your idea to check out the working staright roads and ended up with copying them into the model and now, they actually line up perfectly (except a tiny little gap/line between this and the next tile - barely noticable, so I won't bother with it).

As it is with my luck, this road-plane doesn't have enough faces! I adjusted the verts according to the structure of the ground and ended up missing 2 rows of faces. This leads to a smearing effect:
'Posted
(I know, it's not perfectly adopted to the terrain in the lower part, put that is something I actually manage to fix. '<img'>

Here, in red, the place, where I would need more faces:
'Posted

Again, Im lacking the experience to devide those faces (I did several attempts, but it wouldn't really work out).

So, my question is: Is there a simple way to add/devide those marked red faces, so they have in the end the same numbers of rows as the one in the background (which is the terrain-plane - ATM, I do have 8 rows and I need 10)?

... or if it's not that easy, maybe one of you experienced modellers can do it for me (I bet, it only takes a few minutes for you people...)?
':whistle:'
               
               

               


                     Modifié par TheOneBlackRider, 18 avril 2012 - 10:02 .
                     
                  


            

Legacy_TheOneBlackRider

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Texture: TGA-rotating, applying a texture, walkmesh...
« Reply #11 on: April 19, 2012, 03:49:39 pm »


               ... I'm getting a bit frustrated with this texture on this model...
':pinched:'

I kept on tinkering. I was able to add two rows of faces to the top (not deviding them as wanted in the previous post, cause I still didn't manage to do that). Sadly, the perfect texture ends on their original verts, which have been moved "downwards" to extend the plane towards the "top", ad the newly added faces have a smeared texture:

'Posted

So, I really need a hint/instructions on the following:
a) How do I get in 2 rows of faces as written out in the post before this (hoping, that this will stretch the texture in a correct way - if not, well, than this idea is a dead end).

OR
'B)' How do I get the texture applied to my (now) 10 rows-plane in a correct way? In what place is defined, where the texture starts to be drawn onto the plane (maybe it's editable right with the mdl-file as well, not only in gmax).

I've been scanning some tutorials, but I didn't manage to find the answers to my problem. As said: I'm totally unexperienced in applying textures within gmax. I've been toying with unwrap/edit, but nothing really changed.

Keeping my fingers crossed for getting some more help!
               
               

               


                     Modifié par TheOneBlackRider, 19 avril 2012 - 02:52 .
                     
                  


            

Legacy_Zwerkules

  • Hero Member
  • *****
  • Posts: 1997
  • Karma: +0/-0
Texture: TGA-rotating, applying a texture, walkmesh...
« Reply #12 on: April 19, 2012, 04:13:24 pm »


               You already have the texture on your mesh. If you don't have the texture on your mesh, the easiest way is to open the material navigator (icon with three coloured balls:P), click on file system, look for the texture you want and just drag and drop it onto the mesh you want it on.

If the mesh has not been textured before, it will turn white, otherwise you will see your texture on it, but it will probably not yet look the way you want it to look.

To apply a uvw map to the mesh, select the uvw map modifier (where you also found the uvw unwrap). Typically the roads use the complete width of the texture and twice its height.
So after applying the uvw map modifier enter 1 for U tile and 2 for V tile.

If the road is completely straight, the texture will already be okay, otherwise do an unwrap uvw and
select all the left t-verts and enter a 0 for the u position. Then select all the middle t-verts and enter 0.5 for the u position and finally select all the t-verts on the right side and enter 1 as their u position.
Now you could collapse the uvw unwrap and uvw map modifiers, but for those it isn't really necessary. For most others it is, so I usually do so, but I'm too lazy to explain the process now;).
Now you should have a road texture applied to your mesh with no smears.


It does look as if your road mesh doesn't match the hill mesh though. There's some white poking through your road.
               
               

               


                     Modifié par Zwerkules, 19 avril 2012 - 03:18 .
                     
                  


            

Legacy_TheOneBlackRider

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Texture: TGA-rotating, applying a texture, walkmesh...
« Reply #13 on: April 19, 2012, 09:49:20 pm »


               Thanks!
Will not make it today/night, but weekend is close! '<img'>

And yes, the hillmesh needs some more adjusting in the lower part. Will do it, when I get this road-texture in place! So I hpe, that I'm finally able to manage that following your last post!

(I'm still amazed, how much time this issue did already cost me! Well, this is a time consuming retro-HOBBY! '<img'> )

P.S.: Quote Zwerk:
"Now you could collapse the uvw unwrap and uvw map modifiers, but for those it isn't really necessary. For most others it is,"
What is that about - not the process, but what does that function do (I've noticed that button).
...If you find the time.
               
               

               


                     Modifié par TheOneBlackRider, 19 avril 2012 - 08:53 .
                     
                  


            

Legacy_TheOneBlackRider

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Texture: TGA-rotating, applying a texture, walkmesh...
« Reply #14 on: April 20, 2012, 10:40:30 pm »


               I finally got it a bit sortetd! Those smears were also due to some verts I must have accidently placed. After a bit of "cleaning up" and Zwerk's retexture-help, I got it kind of in place. But it's not a 100%, as you can see (ground-tile connects with the hill/slope-tile near the highth of the right knee of the PC). I even had to shift the road-plane to get it nearly lined up with the connected tile, which probably is not the 100%-way to do it.
This is my result:
'Posted
I think, I won't manage to do better than that with my knowledge ATM. So, I'd put it in as "final" unless one of you experienced people would like to do it completly right.


And here is a new issue:
When hovering with the mouse over this hill-road-tile, it shows me a "X" for "unwalkable", though it is walkable. This is definitely a WOK-issue. Since I (again) lack the experience with tiles within Gmax, I could not tell the WOK to be "dirt". So I used the WOK-Reader V8 to change it after the export from Gmax.
Any ideas (or a small tutorial on how to set the WOK to dirt in Gmax)?
               
               

               


                     Modifié par TheOneBlackRider, 20 avril 2012 - 09:59 .