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!
Quick Reply
Search this Thread
Lab Assistant
Original Poster
#1 Old 29th Dec 2022 at 9:28 PM
Default Need Help Fixing Hair Transparency
The hair I'm working on has transparency issues as you can see in my screenshots here:



So I went on to layering the strands from outer parts to inner parts in Blender as suggested here: https://at.tumblr.com/redsimmer-blo...to/03icemxaq5mw
(Same logic shown here on Milkshape: https://modthesims.info/showthread.php?t=414488 )

But I just can't wrap my head around this whole 3D layering concept. If I can make it look fine from one direction, it has to look bad from the opposite direction; cuz if I tell that a strand is in front of the other, it's only true from a certain perspective. So how am I supposed to make this hair look right?

Screenshots
Advertisement
Mad Poster
#2 Old 29th Dec 2022 at 11:24 PM
If you're using Milkshape, it's top (hair) to bottom (highest alpha/opacity) in the list. Make sure to also use the opacity settings in the "comments" (hair = -1, then 1, 3, 5, 7, 9, etc.) - there's a "comments" button under Groups.

For Blender just follow whatever directions in the tutorial/link. It follows the same logic for how you should build the layers, but I don't know how it imports to SimPE (I'm mostly used to OBJ and those import alphabetically by name - not sure about the SMD? format).

Make sure the head is layered in such a way it makes sense. Take into account that the head is there, too. If two items layer on top of each other, they should be in separate layers/groups, and whichever is closest to the head should be the "inner" layer of the two.

If you see a lot of transparency issues like in the pictures, it's very likely you've switched around the order of the layers/groups.

I tend to find the layering easiest in Milkshape, because you can see the result you'll get ingame (if slightly roughly) directly on the screen, and test out how things change when you move the layers around.
Lab Assistant
Original Poster
#3 Old 30th Dec 2022 at 4:16 AM
@simmer22 I've checked the hair in Milkshape and the result looks similar to the in-game render. So it seems like I've failed to setup a proper shading in Blender. The tutorial is using an older version of Blender while I use 2.93 which doesn't seem to have that GLSL shading option. Instead of installing a fourth Blender, I will export it to Milkshape and try to fix it there. I was trying to avoid Milkshape cuz it seems to mess up my bone assignments but I'll deal with it later.

I use DjAlex88's addon which exports as gmdc.

Hair(scalp) is set to -1 and hairalpha5 is set to 5. Those are all the groups in the original hair.

I still don't understand the logic behind how the layering works in 3 dimensions but somehow it just does work in Milkshape so I'll go with it.
Mad Poster
#4 Old 30th Dec 2022 at 2:08 PM
If Milkshape messes up your bone assignments, make sure you've set the Comments properly for all the layers, because that's usually where the issue is.

ModelName: (name of the group)
Opacity: (this one should be -1 for the inner layer/head, and go up in sequential order, usually odd numbers starting with 1 or 3)
HasTangentArray: (empty, but make sure it's there, or you get the bright CAS bug and light issues on-lot.
NumSkinWgts: 3 (I always use 3, because lower numbers causes Milkshape to go one or two steps down in how many bones it reads, and it disperses the weights of the unused bone between the used ones, or just dials the ones with the highest count or the first read up to 100, which can have some strange effects. 3 is the highest setting, then it reads 4 bones. You can use 1 or 2 if it's connected to fewer bones than 4, but the effects can be a bit iffy and it's easy to forget if you make changes).

Examples

ModelName: hair
Opacity: -1
HasTangentArray:
NumSkinWgts: 3


ModelName: hair_alpha3
Opacity: 3
HasTangentArray:
NumSkinWgts: 3
Lab Assistant
Original Poster
#5 Old 31st Dec 2022 at 9:12 AM
@simmer22 Thanks for your help. It looks fine now both on-lot and in CAS. I've separated each hair strand and exported as obj. Reorganized them as instructed in Anubis' tutorial. Added the comments and reimported in Blender to transfer the weights. Weights now look better in Milkshape but some parts of it still looked suspicious so I decided it was best to do the final export from Blender.

A question for future reference: Does "NumSkinWgts: 3" mean I can assign max 4 bones per vertex or 3?
Mad Poster
#6 Old 31st Dec 2022 at 1:43 PM
"3" allows 4 bones per vertex. It seems to be the max number for this setting (never seen anything higher - Body meshes have "3", and they have 4 bones active for some vertices).

(I'm not sure about the "2" setting, but it does seem to allow 2 bones, since hair scalps sometimes tend to have this one. The "1" setting does deactivate bones for sure).
Lab Assistant
Original Poster
#7 Old 31st Dec 2022 at 3:13 PM
@simmer22 I see thanks. I was unsure because I've read tutorials that said to assign max 3 bones per vertex for hairs. I will limit to 4 from now on.
Mad Poster
#8 Old 31st Dec 2022 at 4:33 PM Last edited by simmer22 : 31st Dec 2022 at 5:23 PM.
Normally you don't need much more than 3 bones, though. It's not like 4 bones automatically gives you a better result for hairs, it has to do with the weighting, which bones you're weighting it to, and how much to each.

For bodies there's often more bones that intersect in certain areas than there normally are for hairs, since there's bones in all directions to count in.

How complicated it needs to be for hairs would depend on the shape and hair length. Shorter hairs (neck length or shorter) don't need to be too complicated, while down the back or across the chest might be more complicated if you want it to have a smooth transition.
Back to top