Welcome to
Mod The Sims
Online: 1954
News:
Have an account? Sign in:
pass:
If you don't have an account, why not sign up now? It's free!
Other sites: SimsWiki
Reply  Replies: 110 (Who?), Viewed: 72663 times.
Search this Thread
Old 7th Jul 2011, 4:50 AM DefaultTutorial: Transparent clothing meshes #1
CmarNYC
Original Poster

Ms. Byte



Join Date: Jul 2009
Posts: 5,538
Thanks: 44533 in 88 Posts
25 Achievements

View My Journal


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
Click image for larger version

Name:  GeomEditor.jpg
Views: 0
Size:  124.2 KB   Click image for larger version

Name:  BaseTexture.jpg
Views: 0
Size:  34.2 KB   Click image for larger version

Name:  UVWindow.jpg
Views: 0
Size:  26.6 KB   Click image for larger version

Name:  Bracelet.jpg
Views: 0
Size:  10.2 KB   Click image for larger version

Name:  UV clothing template.jpg
Views: 0
Size:  39.5 KB   Click image for larger version

Name:  Views.jpg
Views: 0
Size:  71.4 KB  
Last edited by CmarNYC : 2nd Aug 2011 at 12:39 PM. Reason: Addition of recoloring details
12 users say thanks for this.
[ Click here to view a longer list ]
Old 7th Jul 2011, 7:47 AM #2
BloomsBase
Sockpuppet

Join Date: Sep 2009
Posts: 4,400
Thanks: 2342 in 19 Posts
12 Achievements


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!!!
Old 7th Jul 2011, 8:34 AM #3
CmarNYC
Original Poster

Ms. Byte



Join Date: Jul 2009
Posts: 5,538
Thanks: 44533 in 88 Posts
25 Achievements

View My Journal


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
Click image for larger version

Name:  OutfitViews.jpg
Views: 0
Size:  63.4 KB  
Last edited by CmarNYC : 7th Jul 2011 at 9:08 AM.
Old 7th Jul 2011, 10:52 AM #4
Nysha
Née whiterider



Join Date: Jul 2005
Posts: 19,775
Thanks: 44167 in 94 Posts
36 Achievements

View My Journal


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.
Old 7th Jul 2011, 2:03 PM #5
CmarNYC
Original Poster

Ms. Byte



Join Date: Jul 2009
Posts: 5,538
Thanks: 44533 in 88 Posts
25 Achievements

View My Journal


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!
Old 7th Jul 2011, 8:18 PM #6
BloomsBase
Sockpuppet

Join Date: Sep 2009
Posts: 4,400
Thanks: 2342 in 19 Posts
12 Achievements


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
Old 7th Jul 2011, 8:48 PM #7
CmarNYC
Original Poster

Ms. Byte



Join Date: Jul 2009
Posts: 5,538
Thanks: 44533 in 88 Posts
25 Achievements

View My Journal


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!
Old 8th Jul 2011, 2:13 AM #8
BloomsBase
Sockpuppet

Join Date: Sep 2009
Posts: 4,400
Thanks: 2342 in 19 Posts
12 Achievements


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....
Old 8th Jul 2011, 3:21 AM #9
CmarNYC
Original Poster

Ms. Byte



Join Date: Jul 2009
Posts: 5,538
Thanks: 44533 in 88 Posts
25 Achievements

View My Journal


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.
Last edited by CmarNYC : 8th Jul 2011 at 11:42 AM.
Old 11th Jul 2011, 12:30 PM #10
Nysha
Née whiterider



Join Date: Jul 2005
Posts: 19,775
Thanks: 44167 in 94 Posts
36 Achievements

View My Journal


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.
Old 11th Jul 2011, 1:24 PM #11
CmarNYC
Original Poster

Ms. Byte



Join Date: Jul 2009
Posts: 5,538
Thanks: 44533 in 88 Posts
25 Achievements

View My Journal


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!
Old 12th Jul 2011, 1:12 AM #12
Tsany saadi
Test Subject

Join Date: Mar 2010
Posts: 6
1 Achievements


Hmm... is it affect the texture? i mean, will the texture become bigger? because the uv map is so small.
Old 12th Jul 2011, 1:19 AM #13
monca533
Scholar

Join Date: Apr 2009
Posts: 1,030
Thanks: 27503 in 82 Posts
22 Achievements


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?
Old 12th Jul 2011, 1:43 AM #14
CmarNYC
Original Poster

Ms. Byte



Join Date: Jul 2009
Posts: 5,538
Thanks: 44533 in 88 Posts
25 Achievements

View My Journal


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.
Old 12th Jul 2011, 2:23 AM #15
monca533
Scholar

Join Date: Apr 2009
Posts: 1,030
Thanks: 27503 in 82 Posts
22 Achievements


Thank you very very much!

I'll try your tip about CTU.
Old 12th Jul 2011, 2:28 AM #16
CmarNYC
Original Poster

Ms. Byte



Join Date: Jul 2009
Posts: 5,538
Thanks: 44533 in 88 Posts
25 Achievements

View My Journal


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.
Old 12th Jul 2011, 2:32 AM #17
CmarNYC
Original Poster

Ms. Byte



Join Date: Jul 2009
Posts: 5,538
Thanks: 44533 in 88 Posts
25 Achievements

View My Journal


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
Click image for larger version

Name:  GlassBracelet.jpg
Views: 0
Size:  22.1 KB  
Download - please read all instructions before downloading any files!
File Type: zip cmar_testBraceletsTrans.zip (41.7 KB, 60 downloads) - View custom content
Old 12th Jul 2011, 10:54 AM #18
Nysha
Née whiterider



Join Date: Jul 2005
Posts: 19,775
Thanks: 44167 in 94 Posts
36 Achievements

View My Journal


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
Click image for larger version

Name:  cmar bracelet.jpg
Views: 0
Size:  172.8 KB  

What I lack in decorum, I make up for with an absence of tact.
Last edited by whiterider : 12th Jul 2011 at 12:17 PM.
Old 12th Jul 2011, 1:50 PM #19
CmarNYC
Original Poster

Ms. Byte



Join Date: Jul 2009
Posts: 5,538
Thanks: 44533 in 88 Posts
25 Achievements

View My Journal


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?
Old 12th Jul 2011, 2:10 PM #20
Nysha
Née whiterider



Join Date: Jul 2005
Posts: 19,775
Thanks: 44167 in 94 Posts
36 Achievements

View My Journal


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.
Old 1st Aug 2011, 2:21 PM #21
Hackenberg
Test Subject

Join Date: Jul 2011
Posts: 1


I can not find: SimGeomEditor from Delphy's Small Tool, can someone give me a link to that program.
Old 2nd Aug 2011, 12:40 PM #22
CmarNYC
Original Poster

Ms. Byte



Join Date: Jul 2009
Posts: 5,538
Thanks: 44533 in 88 Posts
25 Achievements

View My Journal


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".
Last edited by CmarNYC : 2nd Aug 2011 at 12:53 PM.
Old 19th Sep 2011, 11:52 AM #23
BloomsBase
Sockpuppet

Join Date: Sep 2009
Posts: 4,400
Thanks: 2342 in 19 Posts
12 Achievements


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.....
Old 19th Sep 2011, 1:05 PM #24
CmarNYC
Original Poster

Ms. Byte



Join Date: Jul 2009
Posts: 5,538
Thanks: 44533 in 88 Posts
25 Achievements

View My Journal


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.
Old 19th Sep 2011, 2:12 PM #25
BloomsBase
Sockpuppet

Join Date: Sep 2009
Posts: 4,400
Thanks: 2342 in 19 Posts
12 Achievements


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
Reply


Section jump:


Powered by MariaDB Some icons by http://dryicons.com.