Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Ms. Byte (Deceased)
Original Poster
#1 Old 7th Jul 2011 at 4:50 AM Last edited by CmarNYC : 2nd Aug 2011 at 12:39 PM. Reason: Addition of recoloring details
Default Tutorial: Transparent clothing meshes
We've known for some time how to make a clothing texture transparent or semi-transparent. The obstacle to more variety of see-through clothing is how to make a mesh that's transparent - that lets whatever's behind it show through instead of showing the skin texture under the clothing texture. While trying to solve another problem I stumbled across a method that works (isn't that always the way?) and that's what this is about. This is an overview for modders familiar with working with textures and meshes - it's not a good place for beginners to start.

What you'll need: CTU, SimGeomEditor from Delphy's Small Tools collection (http://www.modthesims.info/download.php?t=372169), s3pe, the graphics editor of your choice, MorphMaker. If you chop up a mesh, you may find the beta of MorphMatcher useful: http://www.modthesims.info/showthread.php?t=442393. If you do a complete job including lod 3, you'll need to know the BloomsBase method of adding a mesh to a CAS part using s3pe: http://www.modthesims.info/showthread.php?t=445332.

I'll use the sheer top with bra I completed a couple of days ago as an example. Start with the usual steps: extract the meshes and textures either using CTU or directly from Fullbuild0.package. For clothing with a transparent outer layer and a body visible underneath, you'll need two meshes, one of which is a nude or underwear mesh.

Run SimGeomEditor and open the mesh for your transparent outer layer. Set the Shader Type to CasSimHairSimple, click 'Set', and save. This setting prevents the skin texture from showing under transparent areas of the texture for this mesh, while still allowing morphing. This is the only really new part of this process - the rest of the tutorial just deals with setting up the texturing and how to deal with the problems you're likely to run into.



For the top, I used the afTopSleevelessOverhangShort mesh and edited it in Milkshape to remove the arms and neck. This was really not necessary since the unneeded parts of the mesh can be made completely transparent and invisible, but it simplified UV mapping the mesh. For the body underneath I used the afTopBra_Strapless mesh which did not need any modification. I took the two base textures and combined them by selecting and copying the shirt texture, rotating and scaling it, and fitting it into the unused space for the top on the bra base texture. You can tell where the unused space is by overlaying a skin texture on the clothing template, or applying the template as a material on a mesh and taking a look at the UV mapping. (Thanks to Bloom who supplied the template.) Then, in the alpha channel, I filled the white area for the shirt texture with a light gray. As you probably know, in the alpha white = opaque, black = fully transparent, and shades of gray are somewhere in-between.



I also modified the recolor mask. The bra top uses the red and green channels so I painted the area of the transparent part blue.

Going back to editing the shirt mesh in Milkshape, I applied the base texture to the mesh, went into the UV mapping window, and rotated and sized the mesh to fit the new location of the shirt texture.



I used MorphMatcher to generate new morphs for the chopped shirt mesh using the modified base mesh and the original game morph meshes; and to renumber the base and morph meshes starting with the next vertex number after the last number in the bra mesh for each lod. (The vertex ID numbers must run sequentially through each mesh part for each lod. Different lods can safely have overlapping vertex numbers.) I built a new clothing package with CTU using both meshes: the lod 1 bra top as lod 1, lod 1 transparent shirt as lod 1_1, lod 2 bra as lod 2, lod 2 shirt as lod 2_1, and just the lod 3 of the shirt as lod 3. In CTU there's only one slot for lod 3, but you can use Bloom's method linked above to manually add the second mesh as lod 3_1. Then I used MorphMaker to make new morphs using the same lod1, lod1_1, etc. assignments as in CTU for the morph meshes.

That's the basic process. Morphing and recoloring should work the same as with any other clothing.

Notes:

Check the morphs. Your see-through clothing may look awesome at average thin/fat, but body sliders are likely to make the inner mesh start coming out of the outer one. With the sheer top with bra, it was hell on wheels trying to keep her boobs from popping out of the transparent top. (And not in a good way. :D) For tops you have to check not only fat/fit/thin but also the breast slider, and every combination of morphs. For bottoms, again check every combination of fat/fit/thin plus walking, bending, sitting, etc. Chances are the sim's hips or thighs or butt will poke out at some point. Fixing this requires a lot of fiddling with morph meshes and bone weights. To make the transparent parts and the body move the exact same way in animations and the breast slider the bone weights should be as identical as you can make them. In lods 2 and 3 especially the vertices may not be in the same places and there's not going to be much you can do about it except make the outer layer a little bigger.

In some cases you can save yourself a lot of effort by using the same mesh for both layers. Reshaping the mesh for the outer layer would most likely be less work than fiddling with bones, and you'll have all the same vertices and faces to work with.

Because of the limitations of mapping the meshes to the textures you have to scale the outer mesh down, which 'stretches' the texture on the mesh in-game, which means the image quality won't be as good. This probably won't be visible with semi-transparent solid colors, but you may notice it with patterns, especially at lower quality game settings. Adjusting the tiling in the patterns may help, and can prevent distortion due to squishing the UV map more in one direction than the other.

I've had preliminary success with using this method on accessories, and that may be the way to go for many items.



I hope some of you find this useful!

*Edited to add some details.
Screenshots
12 users say thanks for this. (Who?)
Advertisement
Sockpuppet
#2 Old 7th Jul 2011 at 7:47 AM
Can not remember how many times i tried this but never succeeded.....
Are you sure you dont need to update bonehashes if you choose another top?(i noticed that particular top has alot of them and might be the only one that can be used to achieve this??)
But nevertheless Thank you Cmar!!!
Ms. Byte (Deceased)
Original Poster
#3 Old 7th Jul 2011 at 8:34 AM Last edited by CmarNYC : 7th Jul 2011 at 9:08 AM.
Hi, Bloom - I've seen you post about this many times and know you've worked on it. I did not change anything in the meshes or mesh comments except the shader. (EmbeddedType in comments.) And I also made see-thru harem pants, and experimented with the stacked bracelet, so it's not something unique to that top. Of course, we may find limitations and problems as we go along. Glad you like it!
Screenshots
Née whiterider
retired moderator
#4 Old 7th Jul 2011 at 10:52 AM
Ohh, this is fantastic, CMar! It's not affected by the issue Bloom had, with the transparency being lost when zooming out in-game?

Goddamnit, why on earth did I pack up my desktop to move the day before you posted this? I'll have to hurry up so I have time to try this on my heterochromia disaster before I go on holiday .

What I lack in decorum, I make up for with an absence of tact.
Ms. Byte (Deceased)
Original Poster
#5 Old 7th Jul 2011 at 2:03 PM
I hope you get time to at least try!

I had no problems with losing transparency at lod 2, just with the popping out issue since the inner and outer meshes don't have verts and faces at the same places. I haven't done transparency for lod 3 since you only see it well enough to tell when zoomed out at Low Sim Detail, and it's a pain to use two meshes for lod 3 with CTU. Since the game seems not to do the morphs (for all clothing) at lod 3, it may not render transparency either - it's worth trying at some point.

Hope your move goes well!
Sockpuppet
#6 Old 7th Jul 2011 at 8:18 PM
lod3 is prolly not suported, i hope i am wrong tho but it
wasn't with the edits on the alpha skirt i once made.
http://www.modthesims.info/showthread.php?t=411123
post 7, one of the reasons i never uploaded the skirt
Ms. Byte (Deceased)
Original Poster
#7 Old 7th Jul 2011 at 8:48 PM
You're probably right - I'll check the lod 3 in the next couple days. If it doesn't support the transparency, in a way that makes things easier since lod 3 is hard to work with anyway and using the outer mesh and texture without transparency seems like a good compromise. For me it's not a dealbreaker because it's only a noticable problem when using Low Sim Detail and since the morphs don't work at that distance it's kind of hard to consider it terribly important. (Makes me a little mad when I think of the time I spent on lod 3 pregnant morphs.) I'm not as much of a perfectionist as you!
Sockpuppet
#8 Old 8th Jul 2011 at 2:13 AM
You did see the tutorial i wrote for adding the 2nd lod3_1?
http://www.modthesims.info/showthread.php?t=445332

Are you sure the morphs dont work when zooming out, never noticed that....
Ms. Byte (Deceased)
Original Poster
#9 Old 8th Jul 2011 at 3:21 AM Last edited by CmarNYC : 8th Jul 2011 at 11:42 AM.
Yes - in fact I was looking for it the other day and couldn't find it. Thanks for the link!

I checked with several EA base game outfits, female and male, in case the lod 3 not morphing was a problem with my meshes, but they lost their morphs too. Either that's the way the game works or something's wrong with my computer!

Edit: Transparency DOES work with lod 3. I'll redo my top and bottom and replace them when/if they pass the mod queue.
Née whiterider
retired moderator
#10 Old 11th Jul 2011 at 12:30 PM
Have you done any further experimentation with accessories, using full/no transparency rather than partial? And which DXT level did you use for your translucent bracelet?

I've been able to get fully transparent areas working on an accessory. However, for some reason completely unknown to me, the other areas - which should be fully opaque - are appearing as pure black. It's most frustrating. I also have one version of this file in which the game seems to be misinterpreting the RGB channels as being an alpha channel, and creates the transparency based on the RGB... most odd.

What I lack in decorum, I make up for with an absence of tact.
Ms. Byte (Deceased)
Original Poster
#11 Old 11th Jul 2011 at 1:24 PM
I used DXT5. The default (for the bracelet) DXT 1 will only give you invisible or fully opaque.

I'll do some experimenting tonight and get back to you!
Test Subject
#12 Old 12th Jul 2011 at 1:12 AM
Hmm... is it affect the texture? i mean, will the texture become bigger? because the uv map is so small.
Scholar
#13 Old 12th Jul 2011 at 1:19 AM
Oh Cmar, how long I was waiting for this!

For some reason, CTU doesn't work in my pc after I changed the operating system to Windows 7 (everybody says that it must work fine, but for me, it doesn't...).
So, can I use this method with TSRW? If yes, what kind of programs more I'll need?
Ms. Byte (Deceased)
Original Poster
#14 Old 12th Jul 2011 at 1:43 AM
Hi, Monca. I don't use TSRW so I can't say for sure whether it works with this, but I don't see why not. As far as I know all you would have to do is export your base mesh and use SimGeomEditor to change the shader setting, then import it again. If that doesn't work, you could make your clothing package, use S3PE to export the mesh, make the change and import it again with s3pe. We need a TSRW user to give it a try!

Re: CTU - I found on Win7 I had to put it in a folder that's not in the Program Files folders. It's got some kind of permissions issue and wouldn't run in a protected location even with an admin account. Just in case that's your problem.
Scholar
#15 Old 12th Jul 2011 at 2:23 AM
Thank you very very much!

I'll try your tip about CTU.
Ms. Byte (Deceased)
Original Poster
#16 Old 12th Jul 2011 at 2:28 AM
Quote: Originally posted by Tsany saadi
Hmm... is it affect the texture? i mean, will the texture become bigger? because the uv map is so small.


The texture gets stretched on the mesh. You can correct this to some extent at least by increasing the tiling numbers for the patterns so the pattern gets mapped into a smaller block when it's applied to the mesh.
Ms. Byte (Deceased)
Original Poster
#17 Old 12th Jul 2011 at 2:32 AM
Quote: Originally posted by whiterider
Have you done any further experimentation with accessories, using full/no transparency rather than partial? And which DXT level did you use for your translucent bracelet?

I've been able to get fully transparent areas working on an accessory. However, for some reason completely unknown to me, the other areas - which should be fully opaque - are appearing as pure black. It's most frustrating. I also have one version of this file in which the game seems to be misinterpreting the RGB channels as being an alpha channel, and creates the transparency based on the RGB... most odd.


I poked at it a little more, still with the stacked bracelet, and got an interesting glass-like effect by using an alpha striped with black, white, and gray and an RGB of solid light gray. I'm not seeing a problem with opaque areas turning black. Which accessory did you clone?

I've attached the bracelet package if you want to have a look.
Screenshots
Attached files:
File Type: zip  cmar_testBraceletsTrans.zip (41.7 KB, 68 downloads) - View custom content
Née whiterider
retired moderator
#18 Old 12th Jul 2011 at 10:54 AM Last edited by whiterider : 12th Jul 2011 at 12:17 PM.
Thankyou, Cmar. I cloned the same bracelet, as your pics showed it working; I'm wondering if perhaps the problem is with my mesh comments, since the mesh is a mangled piece of the face mesh. Problem is, I have so many versions now that I can't remember what I've tried! I'll have to start making spreadsheets soon...

ETA: It looks like this problem may be a reincarnation of an earlier one (seen using Bloom's transparency map method), whereby the mapping of accessories causes alpha accessories to display bits of other accessories in their invisible sections - your bracelet is affected too, see attached pics for the bracelet as part of various different combinations of accessories. It's not surprising, but definitely frustrating, especially as it has been fixed before but no-one knows how any more. >.< I guess I'm back to poring over emh's files to see how she did it!
Screenshots

What I lack in decorum, I make up for with an absence of tact.
Ms. Byte (Deceased)
Original Poster
#19 Old 12th Jul 2011 at 1:50 PM
Hm. Perhaps there's some kind of layering of accessories going on, or there's a mapping of accessories into areas of the texture like with clothing. I see some of them like the gloves and socks have part masks like the clothing. What does the part mask do exactly?
Née whiterider
retired moderator
#20 Old 12th Jul 2011 at 2:10 PM
I would assume - and I may be wrong - that those accessories have part masks because they use the body mesh, although they don't actually include or link to the nude mesh themselves, and are instead applied onto the clothing mesh. Perhaps the part mask serves to ensure that gloves and socks are layered underneath the multipliers of clothing?

Accessories are indeed layered somehow. It seems that a composite texture is created containing the textures of all the sim's accessories; however, I don't know how that composite texture is then actually applied to the meshes.
Ordinary EA accessories - those which have meshes (so excluding gloves and socks) and those which, well, aren't that one WA necklace - don't use transparency or alphas at all. The whole of the mesh is textured, and any "invisible" areas are simple gaps in the mesh. There, my knowledge stalls a little because I don't know how compositors work. I tend to imagine the composite textures as being rather like layered PSDs, with each accessory mesh being "keyed" to use a particular layer of the texture: that would explain how having transparency in one "layer" can cause other textures to appear to show through. However, I have no way of confirming or disproving that suspicion... and if I did manage to confirm it, I'm not sure how I'd use that information in any meaningful way.

This is all a side point, really, since transparent accessories can be achieved by cloning the WA necklace which uses a transparency map - I only ask because I have a project for which that, otherwise much easier, method isn't viable, and I refuse to give up on it.

What I lack in decorum, I make up for with an absence of tact.
Test Subject
#21 Old 1st Aug 2011 at 2:21 PM
I can not find: SimGeomEditor from Delphy's Small Tool, can someone give me a link to that program.
Ms. Byte (Deceased)
Original Poster
#22 Old 2nd Aug 2011 at 12:40 PM Last edited by CmarNYC : 2nd Aug 2011 at 12:53 PM.
Quote: Originally posted by Hackenberg
I can not find: SimGeomEditor from Delphy's Small Tool, can someone give me a link to that program.


Here you go: http://www.modthesims.info/download.php?t=372169 It's the "SimGeom MTNF and TGI Editor".
Sockpuppet
#23 Old 19th Sep 2011 at 11:52 AM
You might want to mention you need a 4 color outfit to start with?(if so?)

I am trying to update a default GEOM and its texture.
But the multiplier(base)texture has no alpha by default(it uses DXT1noalpha since its a 3recolor outfit)
I did update both the GEOM and texture(DXT5 now) file.
but no luck sofar.....
Ms. Byte (Deceased)
Original Poster
#24 Old 19th Sep 2011 at 1:05 PM
Don't all the clothing base textures have alpha channels to control transparency?? The fourth color should only affect the mask since the mask alpha is the fourth recolorable channel.
Sockpuppet
#25 Old 19th Sep 2011 at 2:12 PM
You are right, normally they have.(i am wrong about the recolor story, that only aplies to the mask texture)

The outfit im working on however uses DXT1 as muliplier
Why do i always run in these issues when creating lol
Page 1 of 5
Back to top