View Full Version : Slight Texture Problem
CaptainCox
05-25-07, 01:33 PM
Hi guys!
I am trying to do this officer hat model for SH4 and had a lot of help from DivingDuck and Privateer so far. But I have a slight texture problem, and as i thought there is maybe more peeps around here that are familiar with 3D texturing I post my question in this section...hope you don't mind.
Ok so far got this.
http://i10.photobucket.com/albums/a138/CaptainCox/hatside.jpg
http://i10.photobucket.com/albums/a138/CaptainCox/hatfront.jpg
Now for the problem area.
http://i10.photobucket.com/albums/a138/CaptainCox/hattop.jpg
As you see the texture does not extend to the edges.
The texture
http://i10.photobucket.com/albums/a138/CaptainCox/texture.jpg
Now do I have to separate the flat bit on top and do that as another TGA/DDS or is there a trick in MAX that you guys know of to fix this?
If I have to do it separately, does that mean I have to hex it directly in to the .dat or?
Mind you, i just started with 3D modeling so it could well be that I missed something simple.
PS:The texture is not yet 100% as its WIP...
Cheers!
DivingDuck
05-25-07, 01:44 PM
Hi CC,
gotcha here too. Reworking of texture coordinates is needed within max. After reworking them you could paste them the same way as the vertex coords by hex.
If needed Iīll give you some advice about this issue the next days.
But thatīs definitely my last post for today.
Regards,
DD
CaptainCox
05-25-07, 01:46 PM
DAM! I thought U where at WORK!...ppl will be in peril for real GO GO GO! :p
Again cheers MAN! Will give it my best!
AHHH! the SIG is back...;)
CaptainCox
05-25-07, 03:41 PM
I am not 100% but does the "Edit Seams" have something to do with it?
http://i10.photobucket.com/albums/a138/CaptainCox/max.jpg
Been at it for 1h or so, but I can't find the function to move it to the edge...I guess i am doing something wrong :yep:
GuillermoZS
05-25-07, 07:02 PM
Hi, What I think you have to do is move some points in the UV map to fit the texture better (donīt know if this has a HEX editing effect...). In your base object use the "UV Unwrap" modifier, press the Edit buton and move the points you need, in the UV map window, to fit the texture. If you want I can make a more in deep explanation for you but itīs very intuitive :up:
Again, this is the standard procedure form common objects, I donīt know if moving the points of the UV causes the need of tweaking the hex file or something like that...
DivingDuck
05-25-07, 11:31 PM
Hi CC,
LOL, Iīm at work now. Youīll never understand the pattern, neither do I. ;)
Hereīs what I can recall from memory:
select your hat
apply the respective texture(s)
(right click it and CONVERT TO EDITABLE MESH)
press "4" or select sub-object level "faces mode"
select the faces you need or press STRG+A to select all faces
apply UNWRAP UVW modifier
press the EDIT UVW MAP button
a new window opens
go to the drop down in the upper right and PICK TEXTURE
now itīs like cutting decals
move the vertices where you want to have them
vertex movements in this UVW map modifier window donīt effect the 3d geometry
if youīve selected all faces you might encounter some overlapping faces, donīt worry, thatīs no problem at all
when done, close the window and right click your hat again
select CONVERT TO EDITABLE MESH to apply the changes
export to *.obj
first step done
now import to dummy.dat again
open dummy.dat with pack3d
search for the 3d objectīs node and get the starting position
open dummy.dat with hex editor
go to this position
itīs counting time again
8 bytes data block type 1/101
4 bytes for nodeīs size indicator
8 bytes for node ID
1 byte type of object identifier
4 bytes for number of vertices
1380 bytes (12x115 (number of vertices))
4 bytes for number of triangles
XXX bytes (13xnumber of triangles)
4 bytes for number of vertex coords
XXX bytes (8xnumber of vertex coords); you should end by TMAP or the nodeīs end, if no TMAP is present
copy these data and paste them as you did with the vertex data
your hopefully doneRegards,
DD
CaptainCox
05-26-07, 12:15 AM
:o Amazing man! just woke up here to find this! This is like 3D school online!
Gonna have some Bfast and dig in to this.
Again thanks a lot! I guess I have to start looking in to how to get you a rebate on that Pajero soon ;)
Gonna have a go at what GuillermoZS said as well. This reminds so much of my ol game hacking days...there is always a solution, but the way there is the fun part :)
CaptainCox
05-26-07, 01:14 AM
Just had a stab at this between toast and tee...
http://i10.photobucket.com/albums/a138/CaptainCox/inwork.jpg
I am doing this wrong i guess as the changes are confined within that "seam" line. So sure I can move the texture around and stuff, but its still inside that "green line" area. Don't I have to set that up first?
DivingDuck
05-26-07, 02:51 AM
So, you like to have that red marked area cover the whole top of the hat to the rim? Did I get you right there?
If so,
select all the hatīs top faces
apply the UVW map modifier
youīll see the inner part as it is on your screenies right
and there will be additional faces
that are the hatīs top faces not highlighted on your screen
if you select a vertex now (in UVW map modifier window) all vertices that are connected will be highlighted
drag the vertices to where they belong
overlay the correspondinging vertices on your "old green seam line" and the ones from the new faces accordingly
when done select them both by dragging a box around
press STRG+W to weld them (STRG+B will break them)
thus you create the "additional" rim
when done, downscale the whole thing to fit the texture in sizeKind of strange to explain without any screens. If you give me some time, I could do a little pictured tut. Got some time on monday night. Or you send me the max scene and I adjust the vertex coords for you. You could "reverse" engineer the issue then.
Regards,
DD
CaptainCox
05-26-07, 03:16 AM
Again many thanks man! As I like to fiddle with this kind of stuff I will give it my best shot before sending it to you. Got to do some shopping here as the whole place is closed on Monday. I be at it after that but. I am also reading up on some rudimentary tuts online as i am still missing the basics for MAX.
If you have the time...I think you would be "the" man to write some tuts on 3D modeling/mapping based on the needs for modding SH3/4.
Cheers CC
CaptainCox
05-26-07, 04:50 AM
Had a quick go at it after coming back here :up: I used the UVW map and stretched it until it fitted and...
http://i10.photobucket.com/albums/a138/CaptainCox/gatseem.jpg
Now for the part the I sort a...well, "dislike" (not gonna use bad words here) Hexing :p
Cheers again man!
PS: As i will most likely run it to more trouble here, I guess i will hit the 1K mark today :p
GuillermoZS
05-26-07, 05:34 AM
Gonna have a go at what GuillermoZS said as well. This reminds so much of my ol game hacking days...there is always a solution, but the way there is the fun part :)
Hi, what I told you is just the same DD explained you :D
Here you have a good tutorial for UV mapping for games:
http://www.oman3d.com/tutorials/3ds/unwrap_uvw_mapping/
Cheers!
CaptainCox
05-26-07, 06:00 AM
Ok here we go again...
You said start counting at the 3D objects node...sorry for being a N00b here :oops:
But is it
http://i10.photobucket.com/albums/a138/CaptainCox/case1.jpg
Or is it
http://i10.photobucket.com/albums/a138/CaptainCox/case2.jpg
Will try further but Hexing is also one of these things :p
EDIT: Cheers GuillermoZS, I did not see you posting between, yea I realize that now :)
Thanks for that link, goes in my fav's in explorer. Dam, a lot to read up on here.:up:
DivingDuck
05-26-07, 06:20 AM
Hi CC,
sure you gonna break the 1K now.
First of all two suggestions for HexWorkshop.
I prefer 1 byte per column. That makes it easier to track.
your offset is shown in hex. Iīd switch to dec, easier to count.Thatīs why your highlighted position is not 82dec, as given by p3d. Offset 82dec is exactly 3 rows higher (0100).
You may:
copy the position in p3d
go to HexWorkshop, press STRG+G
paste your copied value there, make sure to check DEC, press ENTER.Regards,
DD
CaptainCox
05-26-07, 06:34 AM
Got ya!.
Just to confirm. This code block
8 bytes data block type 1/101
4 bytes for nodeīs size indicator
8 bytes for node ID
1 byte type of object identifier
4 bytes for number of vertices
1380 bytes (12x115 (number of vertices))
4 bytes for number of triangles
XXX bytes (13xnumber of triangles)
4 bytes for number of vertex coords
XXX bytes (8xnumber of vertex coords)
Its one continous block from that start addy?
I guess you are bussy/tired or both, but you are really helping me out x10 here!
http://i10.photobucket.com/albums/a138/CaptainCox/firewrk3.gif
1K
DivingDuck
05-26-07, 06:40 AM
not tired! Congratz on your 1k. :rock:
Its one continous block from that start addy?
Yes it is. You should end counitng right at the vertex coord number indicating bytes.
EDIT last post: Itīs 1byte per column, of course.
Regards,
DD
CaptainCox
05-26-07, 06:48 AM
Ok...I think its time to wrap this up...(I always think that) and then :damn: :p
But I think I have enough info to finalize it now. Will try to release an updated version of the "Ranks/Insignia" mod by tonight CE time.
Cheers DD :up:
...now time for a late lunch :)
CaptainCox
05-26-07, 12:31 PM
Hm, like I said, something will pop up :damn:
I import the "new, modified Sapca_o02" into "barrel_01" so far so good.
I start counting...
From HEXEDIT:
MARINE.mtl..o MARINE..g sapca_o02...# 115 vertices, 226 triangles, 344 textures coords
8 bytes data block type 1/101
4 bytes for nodeīs size indicator
8 bytes for node ID
1 byte type of object identifier
4 bytes for number of vertices
1380 bytes (12x115 (number of vertices))
4 bytes for number of triangles
2938 (13x226)bytes (13xnumber of triangles)
4 bytes for number of vertex coords
2672 (8x344) bytes (8xnumber of vertex coords) (I guess you mean textures coords ?)
Totals= 7023 bytes
But when I am halfway down I start hitting your code from "cfg#TXR_DD_Barrel......" etc etc
So I guess i am doing something totally wrong again :doh:. Dam and double dam!
Cheers CC
EDIT:might add that I tried with...I think every version of Pack3D
EDIT,EDIT: Actually the size of that block shows up as only 5707 in Pack3D
which is actually unchanged from your DD_Barrel...its like it don't get imported or something.
http://i10.photobucket.com/albums/a138/CaptainCox/pack3D.jpg
DivingDuck
05-26-07, 02:48 PM
Hi,
2672 (8x344) bytes (8xnumber of vertex coords) (I guess you mean textures coords ?) My fault, youīre right.
Totals= 7023 bytes
But when I am halfway down I start hitting your code from "cfg#TXR_DD_Barrel......" etc etc
So I guess i am doing something totally wrong again :doh:. Dam and double dam!
Remote seems to be limited at this point. Can you send me your dummy.dat and the *.obj file? Iīll have a look at them.
Regards,
DD
CaptainCox
05-26-07, 02:51 PM
Thanks a bunch man...on its way in 2 min!
DivingDuck
05-26-07, 03:47 PM
Iīve checked barrel.dat.
offset 103 - 73 00 00 00 / 115 vertices
115 x 12 = 1380bytes
offset 1487 - E2 00 00 00 / 226 triangles
226 x 13 = 2938bytes
offset 4429 - AB 00 00 00 / 171 texture coords
171 x 8 = 1368bytesThe sapca_o02 says 171 texture coords too.
Regards,
DD
DivingDuck
05-26-07, 03:48 PM
Iīve checked barrel.dat.
offset 103 - 73 00 00 00 / 115 vertices
115 x 12 = 1380bytes
offset 1487 - E2 00 00 00 / 226 triangles
226 x 13 = 2938bytes
offset 4429 - AB 00 00 00 / 171 texture coords
171 x 8 = 1368bytesYouīll end up right before the cfg#TXR node.
BTW, the sapca_o02 says 171 texture coords too.
Regards,
DD
CaptainCox
05-26-07, 03:53 PM
Again thanks man!...back to work on this then.
One of these days you will have to write a tut on this stuff...please!
I think I will have to back engineer your thinking a bit here. I really want to understand how this works. But I think you have given me enough hints to last me a couple of days if not more.
Edit: I see that 171 texture coord in the orig file now! Doh!
EDIT EDIT: Just clicked on your "open hatch vid" :o MAN, you should try that for SH4!!!!
Cheers!
CaptainCox
05-27-07, 08:15 AM
WOW:o...this is a never ending story. I just been at it for like 5h...and no frigging go on this. I just deleted ALL! files on my DT (there where probably like 25-30, all different versions of .dat's, .obj's and what have you. Gonna start clean in about 30 min...never give up and never surrender...:stare:
Ok so far I have some serious problem with hex (this is what I suspect)
As i am not at all fluent with hex i am using all the hints from DD and privateer here.
The original sapca_o01 has sapca_o01...# 115 vertices, 226 triangles, 344 textures coords after tweaking the model in MAX I import the data in to the dummy.dat then...sapca_o01..# 115 vertices, 226 triangles, 172 textures coords I am not sure why this is, as i actually redid the model this morning without using the UVW AT ALL!, I simply tweaked the verts to fit etc, so no texture tweaks what so ever. (this change in tex coords is true for all the others as well _o02, _o03 etc
I tried to only port the vertices, which i already did yesterday but no go, CTD or CTD when going back to main menu after starting a mission (no hats visible)
I ported all the code, vert's, triangles and coords...same thing.
I also filled the rest of the code (as its smaller then the orig) with zeros, no go.
Or is this a Model problem coming from the parameters in MAX?.
Sometimes I am not sure that P3D works properly as I never see any change in terms of size of the node after importing a new .obj
Anyhow, many problems and I am sure the solution is right there in front of me...always is sorta.
Ok, gonna give this another thrashing in a min.
Cheers!
CaptainCox
05-27-07, 09:23 AM
Just did some double checking...as this is driving me nuts.
I checked the original sapca_o01.obj, it 100% holds
sapca_o01...# 115 vertices, 226 triangles, 344 textures coords
Now I just opened the same file (orig) in MAX and exported it (no changes only opened and exported with a new name)
1..# 115 vertices, 226 triangles, 172 textures coords
It for some reason or another HALFS! the nr of texture coords
Why does it do this?...must be some setting in MAX, or is it P3D that does this?
Cheers!
DivingDuck
05-27-07, 10:28 AM
Hi CC,
guess where I am now! ;) Tomorrow Iīm here again.
Iīll give it a try and check the texture coord issue on tuesday morning/night.
Just clicked on your "open hatch vid" :o MAN, you should try that for SH4!!!!
Never thought about this so far. Do you think anyone would be interested?
Cheers,
DD
CaptainCox
05-27-07, 10:42 AM
WOW...anybody interested! EVERY FREAKIN body man! I am sure. There has been a lot of talk about cam's this and cam's that. But if one could just go there!!!. There is of course a slight prob...there is no forrad compartment like in SH3...but there is the conning tower of course.
I actually guessed as much...work hey ;)
Well I will try some different approaches here...I think I might be doing some big mistakes at the start addy in the orig sapca_oxx. I will start with checking the exact addy in P3D and also the ID...been to sloppy I think.
Anyho...have fun man, and take em home safe now ;)
DivingDuck
05-28-07, 06:16 AM
Moin CC,
spending one eve not having contact with any kind of computer is like stepping backwards from the chalkboard. Hereīs my idea, Iīll check this out myself tomorrow. But you probably donīt have the patience to wait.
You say the number of texture coords is cut into halves. May it be that they contain all texture coords data needed for TWO maps. First one Normal map, second one Occlusion map. To check this out:
import the original sapca_xx.obj to max
export it without any changes
import it to dummy.dat
check whether the first or the second half of the original vertex coords match the vertex coords of your CC_sapca_xx object nodeIf one of them matches we could create own occlusion maps by exporting the object twice, first with normal map as diffuse color map, second with occlusion map set as diffuse color map. Then cut the texture coords from both and bake them together as one texture coords block. Lots of hex work to do. And this might be nuts, but itīs worth a try, I think. Maybe UBoat used a similar or even the same approach already. I donīt remember. Many lines have been written since, and Iīm getting old ;)
Regards,
DD
CaptainCox
05-28-07, 06:33 AM
AHHHH! good thinking!...Well waiting is not an option :p Naaa, I just like to understand and fix stuff that don't work, that's what makes this fun and keeps me going. You pick up a piece here and there, get a lot of tips from you and others, and suddenly you see the picture...that's the reward, understanding the problem and finding the solution and learn from it...love it!
Very similar process to game hacking this...very similar, same stuff that drives you ahead!
Will try that out later today, will finish the "vert way" 1st and I hope release a beta of the Hat mod later today.
Cheers!
CaptainCox
05-28-07, 04:26 PM
:p Friggin MADE IT!...I am proud! :oops: :know:
http://www.subsim.com/radioroom/showthread.php?t=115623
DivingDuck
05-29-07, 04:59 AM
Congratz CC. Thatīs damn good news. And what about the number of vertex coords?
Regards,
DD
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.