- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Meshing >
- Glass
- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Meshing >
- Glass
Posts: 404
Thanks: 71308 in 215 Posts
and can make a glass chair?
Posts: 683
Thanks: 59413 in 42 Posts
There's 2 kinds, transparent and translucent. I didn't manage to change the color of the glass, and also couldn't add glass to any object that didn't have it before. |
Does that mean you can replace one type of glass with another? For the longest time now I have wanted frosted glass windows and doors.
I've started looking into meshing etc but I'm at the very beginning of one massive learning curve so it will be a looooong time before I'm able to do anything like that (if it's even possible).
Posts: 683
Thanks: 59413 in 42 Posts
Posts: 2,832
Thanks: 6613 in 20 Posts
; decompiled with S3ModlD V1.00 - by Wesley Howe MATD 0103 MtlName 0x920790DF ShaderName GlassForObjects MTNF 9 EdgeDarkening 1 1 0.000000000000 SpecularUVScale 1 2 1.000000000000 1.000000000000 Shininess 1 1 20.000000000000 DiffuseUVScale 1 2 1.000000000000 1.000000000000 Specular 1 3 0.495049506426 0.495049506426 0.495049506426 Transparency 1 1 1.000000000000 Diffuse 1 4 0.000000000000 0.000000000000 0.000000000000 0.750000000000 FresnelOffset 1 1 0.250000000000 UVScales 1 3 0.000030518509 0.000000000000 0.000000000000
I have attached the result below. A tinted-glass stereo, what every sim wants for their party needs.
If you like to say what you think, be sure you know which to do first.
Posts: 683
Thanks: 59413 in 42 Posts
I experimented with a door that was solid material, I regrouped the middle parts and changed the .mtlsrc of that group, to one taken (all just copy-pasted) from another door, glassy one. (it was "GlassForPortals") It didn't work, perhaps because of my regrouping.
Posts: 2,832
Thanks: 6613 in 20 Posts
I know that I have about worn that poor stereo out, but I have a project folder setup with a .bat file that copies everything, packages it and places a copy in the mods folder. I would bet that technique would work well for your knick-knacks.
I left everything else in the stereo stock (except for the description and price). It would appear the glass color is coming from the texture map in the object itself. While it is a designable object, the design tool had no discernable effect on the stereo, so that shader must not be tied to the recolor code.
Anyway, it is easy and lots of fun. I know I posted the wiki page with the MATD definition, there is a list of the shaders there. You will have to hunt through different objects for examples.
If you like to say what you think, be sure you know which to do first.
Posts: 683
Thanks: 59413 in 42 Posts
I have a project folder setup with a .bat file that copies everything, packages it and places a copy in the mods folder. I would bet that technique would work well for your knick-knacks. |
Do you mean I should write a .bat for automating my cluttermaking process? That would be awesome! but unfortunately I know nothing about coding :P
You have no idea how many times I clicketyclick through the export-import-compile-save-etc-etc a day
Posts: 2,832
Thanks: 6613 in 20 Posts
"C:\Program Files\WesApps\s3pack.exe" WesHowe_StereoCheapContemporary WesHowe_StereoCheapContemporary.package copy WesHowe_StereoCheapContemporary.package "C:\Program Files (x86)\Electronic Arts\The Sims 3\Mods\Test"
I also use commandline versions of the ObjTool decompiler and recompiler... while I quit distributing them when I made the GUI version, they still get made when I make the project. It is the same code, but without the shell. However, I continue to use those with file association from the Windows Explorer. Old dogs and all that.
If you like to say what you think, be sure you know which to do first.
Posts: 683
Thanks: 59413 in 42 Posts
Posts: 2,932
Thanks: 15575 in 28 Posts
If we wanted to make something that has two recolorable parts have one of those parts be glass and the other still recolorable how do we go about doing this? That is, how can we make an object like EA's dining table with glass top and recolorable bottom but instead have that object cloned on a deco item, chair, or what-have-you?
When you say, "I opened the (previously decompiled) .mtlsrc from the CarPolice windows group, and pasted it into the main shader for the Cheap Stereo, recompiled, packaged and placed in game."...how do we know which is the main shader for the object in question? If the item has two recolorable parts is there a main shader for each or a single main shader for both?
Sorry if these are stupid questions or answered already elsewhere. And thank you for any help with them.
OM
Posts: 211
Thanks: 3247 in 26 Posts
Posts: 2,932
Thanks: 15575 in 28 Posts
OM
Posts: 211
Thanks: 3247 in 26 Posts
Posts: 2,832
Thanks: 6613 in 20 Posts
how do we know which is the main shader for the object in question? If the item has two recolorable parts is there a main shader for each or a single main shader for both? |
Recolorable parts are defined by the colored map. Groups are defined in the mesh itself.
All the parts of one group share the same material. The recolorable business is a way to apply more than one pattern on the same group.
I added the whole "Info" button on the ObjTool to help figure out what materials are tied to what groups. Here is the Info dump for the CheapStereo:
Group Count = 2 Group 0: Faces = 18, Vertices = 16, Matl_block = 1 Group 1: Faces = 354, Vertices = 489, Matl_block = 6 MTST: tag 0xF3A3C236, block 13 block 14, tag 0xC3867C32 block 13, tag 0x2EA8FB98 Total faces = 372, Total Vertices = 505 |
If you opened the mesh up in MilkShape, group00 is the dropshadow mesh. Looking at the Face count of 18 would suggest it is a simple mesh, and looking in the ~~~block01.mtlsrc file you will find that it is a Dropshadow material.
The rest of the mesh is in group01, as you can see, it has 354 faces. Here the "Matl_block" is 6, but the line underneath shows it is an MTST, which is a multi-state block. It points to two or more materials (the states can be tied to such things as dirty/clean and other changeable conditions). So then the Info shows the main material group is 13, and underneath that the total list is 2 (in this case) materials, 14 and 13.
So the ~~~block13.mtlsrc file is where I put the shader changes in this mod. I am not sure what the alternate state is on this object, perhaps broken, but I didn't change block14. That would be problematic if I was creating and sharing the object and it changed states during game play, however for a test it was fine, akin to just changing MLOD "00000000" (which is all I did) for a test before finalizing your package.
This is not a beginner level mod, although once you understand how the materials relate to the groups, it is easier than changing a mesh is. There are many objects that have multiple groups, and many have glass as one of the groups, while some have wood or stone or metal parts. By substituting the material definitions you want for the ones build into the object, you change the material type just as readily as the texture changes when you alter a DDS file.
If you like to say what you think, be sure you know which to do first.
Posts: 2,932
Thanks: 15575 in 28 Posts
Why is the MATL block number for the second group 6? I would expect it to be two...counting 13 and 14. I can see why the MATL block number for the dropshadow is one...but 6 for the other is confusing.
OM
Posts: 2,832
Thanks: 6613 in 20 Posts
In this instance, the second group references block06. Block06, though, is a special material that references more than one MATL (so the object can have different materials based on a state, like dirty or clean or broken). It is called an MTST and it is mostly just a list of MATL blocks, in this instance 13 and 14.
If it didn't have the multistate, then the MATL would have been in block06, and 13 and 14 wouldn't be there. But I have little hope of making a tool that can be used without extensive training which can change the basic structuring of the object. Inserting and deleting requires more changes than just including or removing a block, or a group. Thus the restriction on keeping the same number of groups (and materials) in the recompiled files as in the original.
You don't need to know all of that, although it is no secret. Just complicated. So I made the Info button, which tells you which material blocks go with which group. If you do a dump on one of the rabbitholes that have 32 groups (or so) you will see many dozens of materials, but the same general structure is there, just a lot more of it.
If you like to say what you think, be sure you know which to do first.
I was about quarter way through analyzing the dumped info and how it matches the files created at decompilation, and my head is already spinning...
Your explanation makes things so much clearer!
I've always liked this site for its users who are never stingy with knowledge and promotes the "open-source and knowledge-sharing philosophy will benefit the whole community" thing.
I'm sure, with this info, it won't be long before we see custom glass objects.
Might transparent floor tiles and walls be the next hurdle to be overcomed?
Posts: 2,932
Thanks: 15575 in 28 Posts
I then used the info dump and found basically the same information that you showed above...same blocks involved.
I changed both block 13 and 14 and I did so in both MODL and MLOD with shadow. I simply copied and pasted the information you provided above that you used to make a glass stereo.
I got a weird sort of glass triangle in the game.
Any ideas on what I did incorrectly?
OM
Posts: 2,832
Thanks: 6613 in 20 Posts
But maybe you meant the corresponding two on the MODL file.
What is that triangle? Is it the top of the table, or a surplus piece? I see legs nearby, but maybe they belong to another item.
If you like to say what you think, be sure you know which to do first.
Posts: 2,932
Thanks: 15575 in 28 Posts
I'm not sure what the triangle is...some valiant attempt by the Sims 3 engine to deal with my amateur coding job I'm sure. The legs you're seeing belong to some other item.
Anyway, I'll try again and this time I won't use the information from the MLOD to guide the changes I make to the MODL.
OM
Edited to add:
Ok, I tried this. Created new clone and used my own 6 sided box mapped onto the EA grey IMG. Changed the entire red/green IMG to all red. Changed 13 only for the MLOD with shadow and 7 only for the MODL. Made no changes to the other two MLODs.
This time the object is completely invisible except for its shadow.
Sigh...this isn't going well
OM
Posts: 2,832
Thanks: 6613 in 20 Posts
And make sure you leave the filenames the same, just open them in NotePad and paste the lines overtop of (replacing) the original contents, then save.
Note that I didn't make very many changes at all. I didn't change the mesh, or the texture, or the color map, just the material. You won't find what is wrong if you change more than one thing at a time. Work like a turtle, not a hare.
If you like to say what you think, be sure you know which to do first.
Posts: 2,932
Thanks: 15575 in 28 Posts
I cloned EA's pedestal cube thing and all I changed was the material definition code.
Now I plan to work on changing the shape of the cube along with the material. Thanks for your help Wes.
OM
Posts: 683
Thanks: 59413 in 42 Posts
I'm curious, is the color of the glass determined by the grayscale map image, or is it in some data in the .mtlsrc
Posts: 291
Thanks: 11531 in 41 Posts
I have the same question as Lemon concerning the color of the glass.
Turning my deco objects into glass ones would be interesting
Who Posted
|