Aller au contenu

Photo

Texture: TGA-rotating, applying a texture, walkmesh...


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

#1
TheOneBlackRider

TheOneBlackRider
  • Members
  • 382 messages
Hello once again!

Ah, custom-stuff is a barrel without a bottom! :P

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 .


#2
henesua

henesua
  • Members
  • 3 883 messages
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.

#3
Zwerkules

Zwerkules
  • Members
  • 1 324 messages
TGA flipper is a tool that can rotate tga images by 180°. It also fixes issues with TGA compression.

#4
TheOneBlackRider

TheOneBlackRider
  • Members
  • 382 messages
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 .


#5
TheOneBlackRider

TheOneBlackRider
  • Members
  • 382 messages
Zwerkules! You just answered, while I was typing! I will right away test that and report. Thanks.

#6
TheOneBlackRider

TheOneBlackRider
  • Members
  • 382 messages
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.

#7
s e n

s e n
  • Members
  • 408 messages
maybe you're extracting low res tga instead of the hi res 512 ones?

#8
TheOneBlackRider

TheOneBlackRider
  • Members
  • 382 messages
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.)
:D

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::(
...

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


#9
Zwerkules

Zwerkules
  • Members
  • 1 324 messages
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 Image

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 .


#10
TheOneBlackRider

TheOneBlackRider
  • Members
  • 382 messages
I'm walking unknown terrain! :)
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"! :)

#11
TheOneBlackRider

TheOneBlackRider
  • Members
  • 382 messages
... 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 Image
(I know, it's not perfectly adopted to the terrain in the lower part, put that is something I actually manage to fix. :)

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

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 .


#12
TheOneBlackRider

TheOneBlackRider
  • Members
  • 382 messages
... 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 Image

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 .


#13
Zwerkules

Zwerkules
  • Members
  • 1 324 messages
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 .


#14
TheOneBlackRider

TheOneBlackRider
  • Members
  • 382 messages
Thanks!
Will not make it today/night, but weekend is close! :)

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! :D )

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 .


#15
TheOneBlackRider

TheOneBlackRider
  • Members
  • 382 messages
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 Image
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 .


#16
Zwerkules

Zwerkules
  • Members
  • 1 324 messages
The wok reader has some bugs and one of those can make the game crash. NWN doesn't like it if the material ID of one of the faces on a walkmesh is set to -1. The wok reader also sets the material ID to 65536 sometimes, which doesn't make the game crash, but makes parts of the walkmesh unwalkable.
To change the walkmesh in gmax find the walkmesh which hopefully is named walkmesh, wok, colormesh or CM. It has no texture, so it should be easy to spot.
Now on that mesh select the faces you want to change. At the right side of your window is a scroll bar. Scroll down until you see 'Surface properties'. There you will find a field where you can enter the material ID for the selected faces.
1 is for dirt
2 is for obscuring (not walkable and also blocks line of sight and ranged attacks)
3 is for grass
4 is for stone/rock
5 is for wood
6 is for walkable water (shallow rivers and brooks)
7 is not walkable
8 transparent (not walkable, but doesn't block line of sight)
9 carpet
10 metal
11 puddles - the same as 6 only with different footstep sounds
12-13 swamp, mud - the same as 6, but could possibly be changed to add different visual effects than the water splashes and different footstep sounds
14 leaves
15 lava
16 bottomless pit (not walkable)
17 deep water (not walkable)
18 door (no idea what this does, seems to be walkable, but blocks line of sight)
19 snow
20 sand
21 barebones (doesn't add any footstep sounds or visual effects)
22 stone bridge (same as stone, but also adds the visual effect of falling rocks)

Modifié par Zwerkules, 21 avril 2012 - 11:05 .


#17
TheOneBlackRider

TheOneBlackRider
  • Members
  • 382 messages
Alright! Thanks!
I'll give it a shot and will hopefully fix it.

AND: I would be glad, if one of you experienced people out there would offer to create the perfect road-tesxture/aligning, so there would be a good model of that hill/slope-road-tile available (even if I already put so much time into this - well, it was for learning ;) - I would send the stuff out to you, then). As said, I won't get it any better ATM = with my abilities and would put it in, but more so gladly a perfect tile - with all the credits to the creator :)
Anyone with too much sparetime? :D
:whistle:

Modifié par TheOneBlackRider, 21 avril 2012 - 08:50 .


#18
TheOneBlackRider

TheOneBlackRider
  • Members
  • 382 messages
Yep, that walkmesh-change worked! Thanks for the little tutorial.

The tile is walkable, BUT: I still get that "X" for "non walkable" of the cursor IG, when pointing onto that slope-tile.

Any ideas?

#19
Bannor Bloodfist

Bannor Bloodfist
  • Members
  • 946 messages

TheOneBlackRider wrote...

The tile is walkable, BUT: I still get that "X" for "non walkable" of the cursor IG, when pointing onto that slope-tile.

Any ideas?


Likely that is due to having some other missing tiles for that configuration.

Since you are painting a road over a rising piece of ground, you would also need to have the road dead end on the upper section as one tile, and the road dead end on the lower section as one tile.

The toolset MUST see all three types in the tileset.set file or it gives you that red x.  

You could easily duplicate the current tile, entirely, and just rename it and put it into the .set file.

The only change really needed to make that x disappear is for the toolset to see a tile listed correctly.  You can edit that via notepade by changing the 4 sides to properly match up.  IE, top would be set to road, with bottom set to sand.  Next tile would need top set to sand, with bottom set to road.  Then the toolset will behave correctly.

Of course, it means when you go to paint the road, you will end up with very sharp ends of the road since it doesn't have the fade out texture applied to the proper location.

IE, a road end painted on flat sand, sorta fades into the sand. 

Normally, when working on tilesets, it is the little extras that are the pain.

This particular tile you mention has been created and recreated mutliple times over the years by various authors.

CTP has done it in Babylon, but you are not allowed to strip it out, and even if you did, you would have other adjustments to make as well, since CTP raised the tileset in general, and reskinned it with a different sand texture I think.

I know I have this same set of 3 tiles in another Tropical set that was never released, but it also has the base of the entire tileset raised so that nothing drops below zero z, to make shadows work correctly.  Bioware designed their engine to NOT cast shadows below zero z, and this means anything that should cast a shadow down into a pit etc, the shadow gets cut at the zero z level.


Anyway, if you take the texture that is already applied to a standard road end tile, you could paint that texture on top of, or bottom of, the respective NEW tile you duplicated.  Just adjust the tiles entry in the .set file to point to correct setting for the crosser.  Either Top OR Bottom, pointing to Road, with Left and RIght both being empty.

Modifié par Bannor Bloodfist, 22 avril 2012 - 01:06 .


#20
_six

_six
  • Members
  • 919 messages
Click & drag the road up the hill, and see what happens.

...it could always be nothing, but there's dozens of tiles even in the standard NWN assets that can only be created via the click & drag method and it amazes me how many people don't even know they exist. A stream going through a wall in the rural winter, for instnace.

#21
TheOneBlackRider

TheOneBlackRider
  • Members
  • 382 messages
Thanks!
1. Dissappearing shadow: OK, that z-level explains it. Something new I learned! ;) And I won't change anything there. Raising every tile would eat up too mucht time for me ATM.

2. The "x"-issue: Maybe I was not clear: Within the toolset, everything works correctly! When going over the teritory with the road crosser, it gives me green. So all is well here in the toolset.
What I described happenes InGame! As written: The tile works and is also walkabe InGame with your toon. Minimap do show.
BUT: You know, when you use the mouse to walk your toon, you get an arrow-cursor for the direction. If the cursor points upon something, which is not accessable/walkable, it turns into a "X".
Here, in my case, I do have a working walkable slope with the cursor showing the "X" (and here it doesn't even make that "you cannot walk here-sound" when clicking upon the slope. The toon continus walking to the location clicked by the mouse cursor). As soon, as the toon gets of the tile, the cursor turns back into an arrow.
In the end, it's no biggy, since the tile is working and walkable. I was just wondering, what the reason to this may be. (Sorry, I cannot screenshot it, cause the cursor is not captured.)

(P.S. And I won't strip any CTP-contents. :)

Modifié par TheOneBlackRider, 22 avril 2012 - 12:42 .


#22
Zwerkules

Zwerkules
  • Members
  • 1 324 messages

TheOneBlackRider wrote...

Here, in my case, I do have a working walkable slope with the cursor showing the "X" (and here it doesn't even make that "you cannot walk here-sound" when clicking upon the slope. The toon continus walking to the location clicked by the mouse cursor). As soon, as the toon gets of the tile, the cursor turns back into an arrow.


My guess is that you can walk across that tile if you use the aswd keys, but you can't walk onto that tile  from another tile by clicking on it. That is because you probably have a wrong pathnode set for your tile.
That tile should have an A as pathnode and that is a capitalized A because the lower case 'a' pathnode is a different one.

#23
TheOneBlackRider

TheOneBlackRider
  • Members
  • 382 messages
I can walk onto it using the keyboard OR by clicking onto the tile (starting from another tile). The slope tile behaves allright, except that the cursor changes into that "X" instead of keeping its arrow shape.
And the pathnode is set to (capital) A (within the .set-file).
...

#24
Bannor Bloodfist

Bannor Bloodfist
  • Members
  • 946 messages
Well, I would have to take a look at the tile and the .set file to see then. It "sounds" like you have everything set correctly, but without checking it myself, I am likely missing something.

One thing you could also try, is if the terrain "hill" you are attempting to add the road to, is available in a grass version, you could simply duplicate it and then re-skin it to sand.

P.S. You can strip anything you wish out of all the CTP releases EXCEPT Babylon, and the CTP Generic Doors. I don't have the required permissions from some of the artists involved with those that would allow me to grant rights to Babylon and the Generic Doors, but everything else is fair game.

#25
TheOneBlackRider

TheOneBlackRider
  • Members
  • 382 messages
This is not a NWN-tileset. It's still a part of the "seperating Worm's and Sen's awesome Seasonal Forest"-"project" of mine (to reduce the loading time of an area).
Those sand floors/tiles are missing roads and I wanted them to have some roads (to have an alternative to the NWN-desert). So I did take a Worm grass slope tile as a base (adjusting the shape) and added that road plane (with all those troubles I had, which is readable above ;). Somewhere during this process I must have done something to the model, which causes this "X"-issue, because the original grass slope does not have it (of course ;).

Addon: If you start walking towards/onto this slope-tile using the mouse / the arrow cursor and just keep walking on the slope-tile, the cursor stays an arrow. Only if you just point on that tile, it becomes a "X". Clicking, while in X-shape makes the toon walk towards the clicked location (and does NOT give you this "invalid-sound" together with no reaction of the toon).

So, Bannor: Is that an offer?
I mean, I've clearly reached my limits here. The tile is working - not crashing the toolset or game, but something ist not 100% right and I won't be able to fix it with my knowledge.

I'm not out for any credits on this. I just want to have these roads available in that set including a way up to widen the use for these sand-tiles for me (and others). So, if you want to go for it, I would be VERY GLAD, if you would do so (if you have the time and energy). If not, it's ok. It will be as it is, I guess.

Modifié par TheOneBlackRider, 24 avril 2012 - 12:54 .