Views: 22,894,903 |
Home
| Forums
| Uploader
| Wiki
| Object databases
| IRC
Rules/FAQ | Memberlist | Calendar | Stats | Online users | Last posts | Search |
10-06-24 01:20 PM |
Guest: |
0 users reading Model File Format (General Usage)! | 1 bot |
Main - Computers and technology - Model File Format (General Usage)! | Hide post layouts | New reply |
Yoshimaster96 |
| ||
Member Normal user Level: 39 Posts: 226/345 EXP: 385804 Next: 18967 Since: 11-03-14 Last post: 2111 days ago Last view: 1053 days ago |
Since there appears to be no such thing as a shaded model format, I did the honors of making one! Following is the specifications for the SMF and CTF files that make up a model:
SMF (Shaded Model File) Format Specification V1.0 TEXDEF struct: Each TEXDEF struct contains texture and shader info, and points to the primitives that use the texture. Bytes|Field Name|Desc. -----+----------+----- 0004 | NUM_TEXS | Contains the number of textures in the file. -----+----------+----- For each texture... -----+----------+----- 0002 | TEX0_ID | ID of first texture to use in condensed shader. 0002 | TEX1_ID | ID of second texture. 0004 | SHDR_LEN | Length of shader. -----+----------+----- Shader data of specified length padded with F nibbles... -----+----------+----- 0004 | PTR_MDL | Pointer to model data. MODEL struct: Stores the model data (duh). Bytes|Field Name|Desc. -----+----------+----- 0004 | NUM_TRIS | Number of triangles. -----+----------+----- For each triangle... -----+----------+----- 000C | VTX_POS | Vertex positions. 000C | VTX_NRM | Vertex normals. 0008 | VTX_UVS | Vertex UVs. 000C | VTX_TAN | Vertex tangents. 000C | VTX_BIT | Vertex bitangents. Note that a texture ID of 0xFFFF indicates a default noise texture. Shader Commands ~~~~~~~~~~~~~~~~ 0 ZERO 1 ONE 2 HALF 3 FRESNEL 4 TEXZERO 5 TEXONE 6 MULT 7 MIX 8 REFLECT 9 REFRACT A LAMBERT B NORMAL C RADVIS D IRRADVIS E ~ F ~ -=[EXAMPLES]=- 4F //EMISSIVE 66A4DF //DIFFUSE 766AD468C3 //DIELECTRIC 6684CF //METAL 6678934C //GLASS ~~~~~~~~~~~~~~~~ CTF (Compiled Texture File) Format Specification V1.0 TEXINFO struct: Stores the information of each textures, including width, height, and color format. Bytes|Field Name|Desc. -----+----------+----- 0004 | NUM_TEXS | Number of textures in the file. -----+----------+----- For each texture... -----+----------+----- 0004 | WIDTH | Width. 0004 | HEIGHT | Height. 0004 | CLR_FMT | Color format (0 is I, 1 is IA, 2 is RGB, 3 is RGBA). 0004 | PTR_IMG | Points to raw, uncompressed image data. |
Jesse |
| ||
Member Normal user Level: 53 Posts: 660/688 EXP: 1148341 Next: 8778 Since: 09-05-13 Last post: 2542 days ago Last view: 2103 days ago |
cool but you forgot the most basic thing for a model. Also .obj covers every aspect of models pretty nicely, plus its in ascii |
Arisotura |
| ||
Star Mario in this room you have a pile of apple pies Level: 164 Posts: 5009/9039 EXP: 57510812 Next: 191578 Since: 07-03-12 From: in a box Last post: 5 days ago Last view: 1 day ago |
Spacey |
| ||
Ninji Normal user Level: 34 Posts: 156/244 EXP: 235774 Next: 17877 Since: 04-15-14 Last post: 2289 days ago Last view: 1463 days ago |
Valves smd format is pretty good, it has a lot of community supported tools for blender, and some tools for 3dsmax, it's an ascii format, though its fairly extensive. IIRC (I haven't worked with it in a while) it has support for some shaders as well as lighting, the official docs are here, though you may want to look at the texture mapping part as vtf/vmt files (whats used for materials) are what handle all of that.
EDIT: Slight correction. |
Yoshimaster96 |
| ||
Member Normal user Level: 39 Posts: 227/345 EXP: 385804 Next: 18967 Since: 11-03-14 Last post: 2111 days ago Last view: 1053 days ago |
Thanks for all the feedback, will make some changes for V1.1:
Add some things I forgot to write down Add cubemap support, as well as compilation of scenes with several objects, and basic animations |
Baby Luigi |
| ||
Baby Luigi Level: 53 Posts: 1/749 EXP: 1146587 Next: 10532 Since: 03-13-16 From: Lost in Time Last post: 1890 days ago Last view: 1884 days ago |
Posted by Spacey .smds also save the skin, something I consider pretty valuable for all models. the only thing I don't really like about the .smd model format is that whenever I import the model, all parts get lumped under one object, so if I want to make an object modification, i have to painstakingly detach an object and edit it and reskin it. |
Yoshimaster96 |
| ||
Member Normal user Level: 39 Posts: 228/345 EXP: 385804 Next: 18967 Since: 11-03-14 Last post: 2111 days ago Last view: 1053 days ago |
Update! (Animation will come in a later version.)
SMF (Shaded Model File) Format Specification V1.01 TEXDEF struct: Each TEXDEF struct contains texture and shader info, and points to the primitives that use the texture. Bytes|Field Name|Desc. -----+----------+----- 0004 | NUM_TEXS | Contains the number of textures in the file. -----+----------+----- For each texture... -----+----------+----- 0002 | TEXC_ID | ID of main texture. 0002 | TEXN_ID | ID of normal map texture. 0004 | SHDR_LEN | Length of shader. -----+----------+----- Shader data of specified length padded with F nibbles... -----+----------+----- 0004 | PTR_MDL | Pointer to model data. MODEL struct: Stores the model data (duh). Bytes|Field Name|Desc. -----+----------+----- 0004 | NUM_TRIS | Number of triangles. -----+----------+----- For each triangle... -----+----------+----- 000C | VTX_POS | Vertex positions. 000C | VTX_NRM | Vertex normals. 0008 | VTX_UVS | Vertex UVs. 000C | VTX_TAN | Vertex tangents. 000C | VTX_BIT | Vertex bitangents. 0004 | VTX_VIS | Vertex visibility. Shader Commands ~~~~~~~~~~~~~~~~ 0 ZERO 1 ONE 2 FRESNEL 3 TEXTURE 4 RADVIS 5 IRRADVIS 6 MULT 7 MIX 8 REFLECT 9 REFRACT A LAMBERT B NORMAL C ~ D ~ E ~ F ~ -=[EXAMPLES]=- 3F //EMISSIVE 66A35F //DIFFUSE 766A356842 //DIELECTRIC 66834F //METAL 66789234 //GLASS ~~~~~~~~~~~~~~~~ CTF (Compiled Texture File) Format Specification V1.0 TEXINFO struct: Stores the information of each textures, including width, height, and color format. Bytes|Field Name|Desc. -----+----------+----- 0004 | NUM_TEXS | Number of textures in the file. -----+----------+----- For each texture... -----+----------+----- 0004 | WIDTH | Width. 0004 | HEIGHT | Height. 0004 | CLR_FMT | Color format (0 is I, 1 is IA, 2 is RGB, 3 is RGBA). 0004 | PTR_IMG | Points to raw, uncompressed image data. |
Yoshimaster96 |
|
Baby Luigi |
| ||
Baby Luigi Level: 53 Posts: 6/749 EXP: 1146587 Next: 10532 Since: 03-13-16 From: Lost in Time Last post: 1890 days ago Last view: 1884 days ago |
yeah, would help if this model format also saves the rig
|
Yoshimaster96 |
| ||
Member Normal user Level: 39 Posts: 230/345 EXP: 385804 Next: 18967 Since: 11-03-14 Last post: 2111 days ago Last view: 1053 days ago |
Posted by Baby Luigi Will be added fairly soon. |
Jesse |
| ||
Member Normal user Level: 53 Posts: 661/688 EXP: 1148341 Next: 8778 Since: 09-05-13 Last post: 2542 days ago Last view: 2103 days ago |
you still forgot that important thing, this model wouldn't even work. |
Yoshimaster96 |
| ||
Member Normal user Level: 39 Posts: 231/345 EXP: 385804 Next: 18967 Since: 11-03-14 Last post: 2111 days ago Last view: 1053 days ago |
Posted by Jesse Work how? |
LeftyGreenMario |
| ||
Don't like politics? Too bad, it's-a Mario time. Level: 83 Posts: 25/2062 EXP: 5236646 Next: 195575 Since: 03-14-16 From: Stabbing Wario Last post: 581 days ago Last view: 580 days ago |
Maybe he means by modeling software not being able to recognize it!? I don't know either.
|
Yoshimaster96 |
| ||
Member Normal user Level: 39 Posts: 233/345 EXP: 385804 Next: 18967 Since: 11-03-14 Last post: 2111 days ago Last view: 1053 days ago |
Posted by LeftyGreenMario Yeah, that's it I'm guessing, which makes sense. I'm just hoping that, with the advent of shaders in consoles, this might make modding a bit easier. Consider it being proactive. |
Main - Computers and technology - Model File Format (General Usage)! | Hide post layouts | New reply |
Page rendered in 0.040 seconds. (2048KB of memory used) MySQL - queries: 29, rows: 223/223, time: 0.009 seconds. Acmlmboard 2.064 (2018-07-20) © 2005-2008 Acmlm, Xkeeper, blackhole89 et al. |