Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • stCky: Palidinho is your OpenGL (was it OpenGL?) stuff open source anywhere?
      August 16, 2017, 09:07:22 PM
    • Travas:BUILD THE WALL
      August 15, 2017, 09:28:49 PM
    • Travas: i have ass cancer
      August 15, 2017, 09:23:29 PM
    • stCky: what are the fudge are you tryna ask?
      August 15, 2017, 08:21:35 PM
    • bader: what are the rsps community alive ?
      August 15, 2017, 05:46:16 PM
    • bader: yo guys
      August 15, 2017, 05:46:08 PM
    • Spacehost:[link] Updated our thread :)
      August 15, 2017, 09:40:34 AM
    • Adaro: The client is in Download section at Homepage
      August 15, 2017, 01:09:20 AM
    • FaTe_Of_GoDs: where do i get the client?????????????
      August 14, 2017, 05:23:14 PM
    • stCky: can anyone help me? I cant login to the shoutbox
      August 13, 2017, 05:45:15 PM
    • drubrkletern: appeal denied
      August 13, 2017, 02:35:27 PM
    • King_Trout:[link]
      August 13, 2017, 11:17:12 AM
    • Cole1497: no sorry
      August 13, 2017, 10:27:14 AM
    • ayz: yo can anyone explain something to me
      August 13, 2017, 08:08:51 AM
    • coolking12: Hi
      August 13, 2017, 04:16:06 AM
    • stCky: n+1
      August 11, 2017, 06:09:24 PM
    • PalidinoDH: How many more pages are going to show errors before this dude gets on and fixes shit
      August 11, 2017, 04:57:00 PM
    • stCky: it is made by the wonderful people at jetbrains
      August 10, 2017, 10:00:06 PM
    • Zoravon: what's the difference between that and eclipse?
      August 10, 2017, 05:59:52 PM
    • stCky: use an IDE like IntelliJ or shitclipse
      August 10, 2017, 05:33:01 PM

    Author Topic: Texturing Models! (How-to)  (Read 5977 times)

    0 Members and 1 Guest are viewing this topic.

    OfflineMeeE59

    • Member
    • **
    • Posts: 39
    • Thanks: +0/-0
      • View Profile
    Texturing Models! (How-to)
    « on: October 30, 2013, 12:28:33 AM »
    So, thanks to a few different people and resources, I finally figured out how to texture models. (amy_webb, thanks for your suggestion in my previous help thread regarding this, it came in handy; Dragonking, you supplied me with a hint as to where I should look, and I thank you for that, even though you said you forgot how to do it)

    This guide has only been tested for 317 clients. It may work for higher revisions, but any errors or bugs you receive as a result of this guide are not my fault.

    To begin, you will need a model to texture (in .dat format), RSMV with texture support, and a Hex editor (Sublime Text 3 has a Hex Viewer package). I recommend also using a client to test the model, and a hexadecimal - to decimal converter (Windows 7 Calculator has one; View -> Programmer)

    To start off, open the model .dat in your Hex Editor. (I prefer Sublime Text because it allows me to enter lines and spaces between numbers, and does not affect the actual output) You should see a series of lines ranging from 0 to f (hexadecimal notation). Each two digits is a byte, and each two bytes is a word. 32 and f0 are bytes, 32f0 is a word.

    This is how my Sublime Text looks at the moment (and no, it is not a final product):



    Alright, so you see this mess of numbers and letters, what do you do with it? I suggest scrolling to the very bottom, and counting 9 words out. This is the footer of the model. (In Sublime Text, it would be a whole line + a word) The first word is how many vertices your model has; keep that in mind if you're going to do vskins and such with it. The second word is how many triangles or faces your model has. This is extremely important, as it shows you how many bytes you need to copy and edit.

    The third word is made up of two bytes (in most models, it would look like 0000). This is the texture "boolean", I've been calling it. Depending on the model, the first byte can range from 01 to 04, and you would find this out by looking at the second block of code. (in my model, the second block is the one immediately after the last 7 in the top 3 rows) If the numbers range from 0 - 3 (e.g. 0101030102020103), make the first byte in the texture boolean 03. The second byte in the texture boolean, if you want textures enabled, is 01. In my example, I have the texture boolean set to 0101.

    On to the harder part. Now that you've gotten the model to recognize textures, you have to actually give its triangles texture flags. For every triangle or face in the model (refer to the second word of the footer for this number), you need to type 02. The tricky part is getting the location right. I seem to get it to work properly when I put it immediately after the second block of code, the 010102010203 part.

    The next big thing you need to do is the UV Projection Flag, which comes immediately after the color data. To find the color data, you would need to know the value of one of the model's colors. The series that includes it (usually several times) is the color data chunk. If you can find the end of that chunk, you're in luck, because now you need to type out this section of code:
    [0020 0021 0022] [0023 0024 0025] [0025 0026 0020]. I used brackets because you need to use the proper amount of words as the textured triangle number allows (the first byte in the texture boolean, usually 03). If you have a 01 in the texture boolean's textured triangle number, then use only the first bracket. If 2, use the 2 brackets, etc., but DO NOT INCLUDE THE BRACKETS.

    The last step is to actually make the model have texture. Go into the color data chunk and change any of the values you want to be a value of one of the textures. (REMEMBER: THIS IS HEXADECIMAL! Putting in a 40 will not get lava, it will get a grayish color. Lava is 28 in Hex)

    I believe I have covered everything there is so far, if I think of any, I will revise this, as it is extremely late and I wrote this while half-asleep.

    Planned updates to this guide:
    • More pictures of successful texturized models
    • Video guide
    • Convert to a .dat editing guide
    • (MAYBE) Open this thread for requests for textured models
    « Last Edit: October 30, 2013, 08:36:23 PM by MeeE59 »


    OfflinePker DX

    • Member
    • ***
    • Posts: 220
    • Thanks: +0/-0
      • View Profile
    Re: Texturing Models! (How-to)
    « Reply #1 on: October 30, 2013, 09:18:05 AM »
    Hex = Hexadecimal up to 31
    DENARY  HEXADECIMAL
    0-9        0-9
    10         A
    11         B
    12         C
    13         D
    14         E
    15         F
    16-31    10-25
    32        1A
    33        1B
    34        1C
    35        1D
    36        1E
    37        1F
    38-53   26-41
    And so on.
    Ching Chong Chaaaaaaaaaaaaaanggggg

    Offlinehadlich4

    • Member
    • ****
    • *
    • Posts: 587
    • Thanks: +0/-0
      • View Profile
    Re: Texturing Models! (How-to)
    « Reply #2 on: October 30, 2013, 01:32:31 PM »
    have you gotten a finished/textured model into the client yet? if so pictures would be awesome! I've always wanted to be able to texture my models.

    OfflineMeeE59

    • Member
    • **
    • Posts: 39
    • Thanks: +0/-0
      • View Profile
    Re: Texturing Models! (How-to)
    « Reply #3 on: October 30, 2013, 05:13:57 PM »
    have you gotten a finished/textured model into the client yet? if so pictures would be awesome! I've always wanted to be able to texture my models.
    I actually have. I made a sleeping cap (just a random model I grabbed) use the flowing water and lava textures.
    The only problem I see is that the spaces for the texture are a little too small, so it's hard to tell there's a texture there.

    Offlinepoopler40

    • Member
    • ****
    • Posts: 609
    • Thanks: +0/-0
      • View Profile
    Re: Texturing Models! (How-to)
    « Reply #4 on: October 30, 2013, 06:04:31 PM »
    have you gotten a finished/textured model into the client yet? if so pictures would be awesome! I've always wanted to be able to texture my models.
    I actually have. I made a sleeping cap (just a random model I grabbed) use the flowing water and lava textures.
    The only problem I see is that the spaces for the texture are a little too small, so it's hard to tell there's a texture there.


    thats pretty cool if you have time could you make a video tut of the hex editor and implementing it ingame

    OfflineAmbokile

    • Member
    • ****
    • Posts: 3,009
    • Thanks: +0/-0
      • View Profile
    Re: Texturing Models! (How-to)
    « Reply #5 on: October 30, 2013, 07:40:05 PM »
    Hex = Hexadecimal up to 31
    DENARY  HEXADECIMAL
    0-9        0-9
    10         A
    11         B
    12         C
    13         D
    14         E
    15         F
    16-31    10-25
    32        1A
    33        1B
    34        1C
    35        1D
    36        1E
    37        1F
    38-53   26-41
    And so on.

    32 is not 1A. 32 in hexadecimal is 20.


    0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
    10   11   12   13   14   15   16   17   18   19   1A   1B   1C   1D   1E   1F
    20   21   22   23   24   25   26   27   28   29   2A   2B   2C   2D   2E   2F

    OfflineThe Wanderer

    • Member
    • ****
    • Posts: 4,493
    • Thanks: +0/-0
      • View Profile
    Re: Texturing Models! (How-to)
    « Reply #6 on: October 31, 2013, 07:38:37 AM »
    This is practically the same tut made by mrpotatohead for dragonking a long time ago that is no longer available, but it is very well written. Very nice job although this doesn't allow for custom textures. Perhaps if you could create a tool that can pack custom textures into the cache then that would be cool. At least now the information isn't lost, thanks for writing this.

    OfflineMeeE59

    • Member
    • **
    • Posts: 39
    • Thanks: +0/-0
      • View Profile
    Re: Texturing Models! (How-to)
    « Reply #7 on: October 31, 2013, 07:48:31 AM »
    This is practically the same tut made by mrpotatohead for dragonking a long time ago that is no longer available, but it is very well written. Very nice job although this doesn't allow for custom textures. Perhaps if you could create a tool that can pack custom textures into the cache then that would be cool. At least now the information isn't lost, thanks for writing this.
    Custom textures can be packed into the cache with Tom's Cache Suite.
    I tried to be as clear as possible, but I feel some information could be hard to understand if you've never worked with things like this before. (I was even unsure as to what I was doing when I first started)

    OfflineThe Wanderer

    • Member
    • ****
    • Posts: 4,493
    • Thanks: +0/-0
      • View Profile
    Re: Texturing Models! (How-to)
    « Reply #8 on: October 31, 2013, 04:44:05 PM »
    This is practically the same tut made by mrpotatohead for dragonking a long time ago that is no longer available, but it is very well written. Very nice job although this doesn't allow for custom textures. Perhaps if you could create a tool that can pack custom textures into the cache then that would be cool. At least now the information isn't lost, thanks for writing this.
    Custom textures can be packed into the cache with Tom's Cache Suite.
    I tried to be as clear as possible, but I feel some information could be hard to understand if you've never worked with things like this before. (I was even unsure as to what I was doing when I first started)
    Does toms suite allow this? What is the max res for textures? I know the largest are extremely tiny with today's standards haha but not sure if it is the max.
    Someone should use your tutorial with this:#msg3789539
    And create something cool. Also what rsmv has texture support? If you are referring to that one on r-s you can hardly call that texture support. He did the pnm vectors wrong and he somehow managed to apply the texture to the grid lol.

    Offlinethe elve age

    • the elve age
    • Member
    • ****
    • *
    • Posts: 5,738
    • Thanks: +0/-0
      • View Profile
    Re: Texturing Models! (How-to)
    « Reply #9 on: October 31, 2013, 07:03:28 PM »
    You can add new textures to the client, but I think you need to find a way to actually use them. I believe when I was working on stuff like this, it wasn't as simple as adding a texture and using it.

    You could replace an old texture though.
    Quote
    "The secret to getting things done is to act" -Dante Alighieri

    OfflineMeeE59

    • Member
    • **
    • Posts: 39
    • Thanks: +0/-0
      • View Profile
    Re: Texturing Models! (How-to)
    « Reply #10 on: October 31, 2013, 07:48:32 PM »
    You can add new textures to the client, but I think you need to find a way to actually use them. I believe when I was working on stuff like this, it wasn't as simple as adding a texture and using it.

    You could replace an old texture though.
    Well, with the client I have (Project Rainbow), I simply added the textures to the cache using Tom's Cache Suite, and changed all the values in Class30_Sub2_Sub1_Sub3 (or Textures, if it's renamed) that were 50 to 50 + t, where t is the number of new textures (in my case, I added 3). Then I loaded up the client, even tested the textures on a fire cape (since I had no idea how textures worked back when I was adding textures).

    OfflinexX4m4zingXx

    • Member
    • ****
    • *
    • Posts: 486
    • Thanks: +0/-0
      • View Profile
    Re: Texturing Models! (How-to)
    « Reply #11 on: November 17, 2013, 03:57:13 AM »
    Well, with the client I have (Project Rainbow), I simply added the textures to the cache using Tom's Cache Suite, and changed all the values in Class30_Sub2_Sub1_Sub3 (or Textures, if it's renamed) that were 50 to 50 + t, where t is the number of new textures (in my case, I added 3). Then I loaded up the client, even tested the textures on a fire cape (since I had no idea how textures worked back when I was adding textures).
    how did you get the client from Project Rainbow with the java files?
    i am searching for that like 2 years now
    This part of the godsword looks like a alien :Phttp://i.imgur.com/NgsztcR.png
    I'm not sure if that's a compliment.
    ~Message me if you need help with RSPS~

    OfflineMeeE59

    • Member
    • **
    • Posts: 39
    • Thanks: +0/-0
      • View Profile
    Re: Texturing Models! (How-to)
    « Reply #12 on: November 17, 2013, 03:25:18 PM »
    Well, with the client I have (Project Rainbow), I simply added the textures to the cache using Tom's Cache Suite, and changed all the values in Class30_Sub2_Sub1_Sub3 (or Textures, if it's renamed) that were 50 to 50 + t, where t is the number of new textures (in my case, I added 3). Then I loaded up the client, even tested the textures on a fire cape (since I had no idea how textures worked back when I was adding textures).
    how did you get the client from Project Rainbow with the java files?
    i am searching for that like 2 years now
    I'm their current client developer.

    OfflinexX4m4zingXx

    • Member
    • ****
    • *
    • Posts: 486
    • Thanks: +0/-0
      • View Profile
    Re: Texturing Models! (How-to)
    « Reply #13 on: December 06, 2013, 11:06:26 AM »
    omfg i am jealous
    This part of the godsword looks like a alien :Phttp://i.imgur.com/NgsztcR.png
    I'm not sure if that's a compliment.
    ~Message me if you need help with RSPS~

    OfflineMeeE59

    • Member
    • **
    • Posts: 39
    • Thanks: +0/-0
      • View Profile
    Re: Texturing Models! (How-to)
    « Reply #14 on: March 08, 2014, 08:30:43 PM »
    Alright, here's an update: only a few parts of the tutorial are correct. However, I can't seem to find the Modify button to change the post, so I'm going to have to post here.

    Starting off, you'll probably want a good understanding of how models are made as .DAT:

    (click to show/hide)

    Now, to see it in action, here's a model with textures (2142, an object, "Crate"):
    Code: [Select]
    0701 0201 0601 0201 0705 0205 0705 0205
    0102 0202 0203 0201 0303 0102 0202 0203
    0201 0303 0202 0a12 1206 060a 0e0e 1616
    1e26 261a 1a1e 2222 4041 4141 4141 3c45
    3c41 443d 4141 4241 4141 4141 3c45 3c41
    443d 4141 0016 0016 0016 0016 0016 0016
    0016 0016 0016 0016 0016 0016 0016 0016
    0016 0016 0016 0016 0016 0016 0000 0001
    0003 0001 0005 0002 0003 0007 0000 0007
    0006 0004 0000 0004 0001 0008 0009 000b
    0009 000d 000a 000b 000f 0008 000f 000e
    000c 0008 000c 0009 10c0 60bf a0c0 60bf
    a037 532d c05e 532d bfb0 c050 bfb0 c050
    bf60 c050 bfb0 c050 70bf a04a c05e bfa2
    2dc0 5ebf a200 1000 140a 0100 0000 0000
    1000 1000 0d00 1c

    Here it is again, separated into the different parts, with labels:
    Code: [Select]
    0701 0201 0601 0201 0705 0205 0705 0205
    (Vertex Direction chunk)

    0102 0202 0203 0201 0303 0102 0202 0203
    0201 0303 (Triangle Type chunk)

    0202 0a12 1206 060a 0e0e 1616 1e26 261a
    1a1e 2222 (Texture Pointer chunk)

    4041 4141 4141 3c45 3c41 443d 4141 4241
    4141 4141 3c45 3c41 443d 4141 (Triangle Data chunk)

    0016 0016 0016 0016 0016 0016 0016 0016
    0016 0016 0016 0016 0016 0016 0016 0016
    0016 0016 0016 0016 (Model Color chunk)

    0000 0001
    0003 0001 0005 0002 0003 0007 0000 0007
    0006 0004 0000 0004 0001 0008 0009 000b
    0009 000d 000a 000b 000f 0008 000f 000e
    000c 0008 000c 0009 (UV Map Triangle chunk)

    10c0 60bf a0c0 60bf
    a037 532d c05e 532d bfb0 c050 bfb0 c050
    bf60 c050 bfb0 c050 70bf a04a c05e bfa2
    2dc0 5ebf a2 (X, Y and Z Data chunk)

    0010 0014 0a01 0000 0000 0010 0010 000d 001c (The footer)

    What I still have yet to figure out is the meaning of the different Texture Pointer types. This model happens to have 10 different ones, starting at 2 and increasing by 4:
    Hex:
    Code: [Select]
    02 06 0a 0e 12 16 1a 1e 22 26which translates to decimal:
    Code: [Select]
    02 06 10 14 18 22 26 30 34 38
    However, in the process of writing this post, I managed to create an NPC for my client (my client has a couple extra textures) that has textured wings. The way I did this is relatively simple:
    I added a triangle in Metasequoia parallel to, and above, the section of the model I wanted to have texture. Once I save it as a .MQO, I opened it in DatMaker.
    Made it into a .DAT.
    Opened the .DAT in Sublime Text 3 and went to the footer.
    Changed the texture triangle amount to 1 (since that's how many triangles I used) and added the uses textures flag. (0101 after the number of vertices and faces).
    Removed the last value from any place triangles are used (TSKIN, Priorities, Color data, etc.), and subtracted 1 from the number of faces in the footer.
    Added the Texture Pointer chunk, which is simply 00 for all faces that don't use the texture and 02 for the ones that do (I assume it goes up by 4 every time you add a new triangle to UV Map Data, will experiment). To get this, I copied the Color Data chunk to a new tab in ST3, and changed every color not a texture (textures usually range from 0001 - 0030) to a 00 and every color that IS a texture to 02.
    After that, I looked at the MQO model in DatMaker and turned on Vert Nums. The UV Map Triangles are the vertices that the extra triangle I added have at the corners. Convert those Vert Num values to Hex, and depending on which way you want the texture to be drawn (or flowing in some cases), the three values can be arranged. (It also depends on how you draw the triangle.)

    I saved the .DAT in ST3, opened it again in DatMaker to check to see if everything looked alright (the added triangle was invisible, and the model looked normal), and then put it in my client's models folder, added the ints for the NPC (it was an NPC model), compiled and ran. This is the outcome:

    OfflineZiva

    • Member
    • **
    • Posts: 39
    • Thanks: +0/-0
      • View Profile
    Re: Texturing Models! (How-to)
    « Reply #15 on: March 09, 2014, 08:22:34 AM »
    nice done only problem is if you have to do this all time you are spending a lot of time for 1 piece of the model so to get a server done with textures you are months busy with just adding texture to like 30 models? idk how much time you spend on 1 of course if you do it all the time u get used to it but still takes lot of time, i have been busy the same way as u did and came to the conclusion that it takes some serious time :P

    Offlinesamkin

    • First Time Poster
    • *
    • Posts: 2
    • Thanks: +0/-0
      • View Profile
    Re: Texturing Models! (How-to)
    « Reply #16 on: March 19, 2014, 08:19:44 PM »
    (click to show/hide)

    Just in case, I would really like to learn a little more about this if you have time to run me through it.
    « Last Edit: March 21, 2014, 10:47:17 PM by samkin »

    OfflineMeeE59

    • Member
    • **
    • Posts: 39
    • Thanks: +0/-0
      • View Profile
    Re: Texturing Models! (How-to)
    « Reply #17 on: March 21, 2014, 11:20:16 AM »
    Just in case, I would really like to learn a little more about this if you have time to run me through it.
    Just saying, the first post has some incorrect information, but I don't see an Edit button to change it. The last post I made before yours on this thread is the most updated, and I believe it all to be correct. I have textured a couple models at this point and I think I have a good grip on it. I might even texture a few models for people.

    Offlinethe elve age

    • the elve age
    • Member
    • ****
    • *
    • Posts: 5,738
    • Thanks: +0/-0
      • View Profile
    Re: Texturing Models! (How-to)
    « Reply #18 on: March 26, 2014, 12:00:47 PM »
    Good post. If we had this info 3 years ago it would be revolutionary :P
    Quote
    "The secret to getting things done is to act" -Dante Alighieri

    Offlinedragmagic

    • Member
    • ***
    • Posts: 206
    • Thanks: +0/-0
      • View Profile
    Re: Texturing Models! (How-to)
    « Reply #19 on: April 14, 2014, 06:56:12 PM »
    Good post. If we had this info 3 years ago it would be revolutionary :P

    We did have it three years ago ;)

    DatMaker need help? wna learn more? maybe you want to learn how to model go to the site 100% about the DatMaker
    http://datmaker.dragonscape.info

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal