|
Post by mauvemorn on Nov 17, 2023 10:27:46 GMT -5
How to make a shadow map
Shadow map imitates shadows the item casts on the body.
Study the original shadow map:
- It is of the same size as the diffuse map;
- The background behind shadows is white, everywhere else it is transparent;
- The white is not fading gradually, it ends abruptly;
- The gray exists where the hair casts shadows on the head only, not the rest of the body.
|
| Bake ambient occlusion:
- Open LOD 0;
- Expand the rig;
- Toggle the eye icon next to head and head_2 to see which one is the real head ( it differs sometimes );
- Make the real head, in my case head_2, visible and selectable. If you do not see the cursor icon, enable it in Filter first;
- Select the real head, switch to Render tab;
- Choose Cycles rendering engine;
- Change Samples under Render to at least 200 ( you do not need a good quality image in this case );
- Scroll down and expand Bake. Change Bake type to Ambient occlusion. Leave the rest as is;
- Click Bake. It will replace the skin texture, which is fine;
- Switch to Edit mode, Image - Save As, save as AO in .png;
- UV - Export UV layout, change Fill opacity to 1, save as UV layout in .png;
- Close the .blend file without saving.
| | Turn baked AO into a shadow map:
- Open exported UV layout in Photopea;
- File - Open and place, choose AO.png;
- RMB-click on AO layer and choose Clipping mask;
- Select AO. Image - Adjustments - Levels, change the value in the bottom-left corner to 228, click Ok.
Study the result and find issues:
- unwanted texture in the eyeball and eyelash area ( yellow );
- holes in the mouth and eye areas, where there were no UVs;
- unwanted shadows around eyes, nose, ears, etc, that are not cast by the hair ( green );
- the shadows on the neck end abruptly instead of slowly fading ( red );
- there may be some unwanted/dramatic changes of color ( cyan ).
Fix these issues manually with brushes:
- Select UV layout layer;
- Choose the Eraser tool and remove the texture of the eyeball and eyelashes in the top left corner;
- Choose the Brush tool and paint over the mouth until the hole disappears;
- Select AO layer. Once you start painting, it will ask you whether you want to rasterize the layer, agree to that;
- RMB-click on the image and choose a soft brush. Choose white color;
- Paint over shadows around eye, ears, mouth, etc;
- Make the brush bigger and the shadow on the neck smoother;
- If needed, choose a blur brush and smooth some areas;
- File - Export as - PNG, name it Shared_Shadow_1;
- File - Save as PSD, you may need to adjust the shadows along the hairline.
|
|
|
|
|
Post by mauvemorn on Nov 17, 2023 13:26:12 GMT -5
How to make LODs
When you zoom out in Live mode, the game engine has to render more objects. To speed up this process, each of them changes to a more simplified version. These versions are called LODs, which stands for Level of detail. For hair and most other items, there are four of them, hence 4 .blend files in the folder.
The main distinction between LODs is the polycount of 3D models inside them. Polycount is the number of units ( in this case, triangles ) the mesh is made of. LODs may also contain different number of meshgroups and be affected by different bones, but that generally does not happen with hair items, so you do not need to study them.
In CAS, you always see LOD 0, regardless of your graphics settings. To check them, you need to change graphics settings to the lowest, restart the game and go into Live mode.
|
| Make LOD 1 - 3:
- Open LOD 0 .blend. Select all hair meshgroups, add Decimate modifier;
- Copy it to selected to add to all meshgroups;
- Alt-click and drag the main value to change it for all meshgroups. Stop before the mesh changes its shape too much or the textures start distorting;
- You do not need to apply the modifier. Just File - Save as, replace LOD 1;
- While holding Alt, continue dragging the value down until the mesh more or less retains its shape;
- File - Save as, replace LOD 2. LOD 2 is done;
- Continue reducing the polycount, stop before it starts sinking into the scalp or distorting dramatically;
- File - Save as, replace LOD 3. LOD 3 is done.
Important: if your hair is split into opaque and transparent parts, you need that only in LOD 0 and LOD 1. Once the game switches to LOD2, you can barely see the hair, so no point in it being transparent. Do these additional steps:
- Open LOD 2;
- Join transparent parts with their respective opaque ones ( in this order! select the transparent one first, then the opaque one ). So if your .blend has 6 meshgroups, join 3 with 0, 4 with 1, 5 with 2. If it has only 2 meshgroups, join 1 with 0;
- Save, do the same in LOD 3.
|
|
|
|
|
Post by mauvemorn on Nov 19, 2023 9:33:06 GMT -5
How to replace and import resources back into .package
Replace resources:
- Open the folder with resources;
- In a different window, open your Downloads folder ( or any other place downloaded files are saved by default );
- Using Shift* and Ctrl**, select all .png files you made ( all 24 diffuse, two specular, normal, and shadow maps );
- Drag them into the folder with resources;
- It will ask if you would like to replace 28 files, say yes. If there's less, you may have named something the wrong way.
* Hold Shift to select all files from the first selected one to the last; ** Ctrl-click to add or remove a specific file to the selection;
|
| How to proceed depends on what you made and how.
Look through red and cursive text first to find your situation and follow along.
|
| If you made all LODs and hat chops:
3 meshgroups in each LOD: - In Sims 4 Studio main menu, click on My projects and open your original hair.package file ( the one with your reference );
- Ctrl Shift C to open the console, paste studio.importall to import everything in;
- Tools - Modding - Glass shader ( CAS );
- Change tags in Categories in a way that makes sense, not forgetting to apply them to all swatches.
6 meshgroups in each LOD: - Make sure all 6 meshgroups have right cut numbers (as explained here in step 25);
- Download this .package;
- Put it into C:\Users\(username)\Documents\Sims 4 Studio\Mods;
- Restart Sims 4 Studio if it was opened;
- Choose Create CAS Standalone, click on CAS, filter content by Custom, Shift-click on hair_with_6_meshgroups item, click Next, replace hair.package;
- If you didn't make some maps, make sure to embed them with Tools - Modding - Embed all externally referenced resources, otherwise you or people using your content will get question mark texture in CAS;
- Ctrl Shift C to open the console, paste studio.importall to import everything in;
- Change tags in Categories in a way that makes sense, not forgetting to apply them to all swatches.
|
| If you made no hat chops:
1 meshgroup in each LOD:
- In Sims 4 Studio main menu choose Create CAS Standalone, click on CAS, filter content by Hair and 1 meshgroup;
- The buzzcuts have no LODs, so not suitable in this case. Cottage living has two hairstyles with hats made of one meshgroup. If you will replace all textures and meshes, the file will become base game compatible. If you don't have this pack, choose any earrings instead. However, before cloning them, open hair.package with My projects, Tools - Color palette, Import color palette;
- It it is the hair, Shift-click on it to select all swatches. If earrings, select only one swatch;
- Click Next, replace hair.package;
- If it is earrings, Tools - Color palette, choose Apply palette to package;
- Ctrl Shift C to open the console, paste studio.importall to import everything in;
- Tools - Modding - Glass shader ( CAS );
- If it was earrings, recategorize to Hair;
- Change tags in Categories in a way that makes sense, not forgetting to apply them to all swatches.
2 meshgroups in each LOD:
- In Sims 4 Studio main menu choose Create CAS Standalone, click on CAS, filter content by Hair and 2 meshgroups;
- There is a hairstyle from My wedding stories that is made of two meshgroups. If you will replace all textures and meshes in it, it will become base game compatible. If you do not have this pack, you can use any glasses instead. However, before cloning them, open hair.package with My projects, Tools - Color palette, Import color palette;
- It it is the hair, Shift-click on it to select all swatches. If glasses, select only one swatch;
- Click Next, replace hair.package;
- If it is glasses, Tools - Color palette, choose Apply palette to package;
- Regardless of what it is, export LOD 0 blend, open, check what cut number belongs to the transparent part. Open your LOD 0 and assign this cut number to your transparent part. Do this to all LODs with your hair;
- Once done, save changes and close Blender;
- Back to Sims 4 Studio, Ctrl Shift C to open the console, paste studio.importall to import everything in;
- If used glasses, recategorize to Hair;
- Change tags in Categories in a way that makes sense, not forgetting to apply them to all swatches.
|
| If you made no hat chops and no LODs:
1 meshgroup in LOD 0:
- In Sims 4 Studio main menu choose Create CAS Standalone, click on CAS, paste ymHair_BuzzCutNatural into the search bar, find the one for the right frame, Shift-click on it to select all swatches, click Next, replace hair.package;
- Ctrl Shift C to open the console, paste studio.importall to import everything in;
- Tools - Modding - Glass shader ( CAS );
- Change tags in Categories in a way that makes sense, not forgetting to apply them to all swatches;
- By default, the hair will disappear when a sim wears a hat. If you want it to stay, edit Region Map.
2 meshgroups in LOD 0:
- Give the opaque part 0 cut number, 1 to the transparent part, save the .blend;
- Download this file;
- Put it into C:\Users\(username)\Documents\Sims 4 Studio\Mods;
- Restart Sims 4 Studio if it was opened;
- Choose Create CAS Standalone, click on CAS, filter content by Custom, Shift-click on hair_with_2_meshgroups_no_LODs item, click Next, replace hair.package;
- If you didn't make some maps, make sure to embed them with Tools - Modding - Embed all externally referenced resources, otherwise you or people using your content will get question mark texture in CAS;
- Ctrl Shift C to open the console, paste studio.importall to import everything in;
- Change tags in Categories in a way that makes sense, not forgetting to apply them to all swatches;
- By default, the hair will disappear when a sim wears a hat. If you want it to stay, edit Region Map.
|
|
|
|
|
Post by mauvemorn on Nov 19, 2023 13:01:43 GMT -5
Final testing
On the highest graphics settings, in CAS: - Check if you're happy with the intensity of the shine;
- Check the placement of the shadow on the face. If it looks odd on the neck or along the hairline, use a soft brush and white color to make it fade slower;
- If the hair and the head look darker than the rest of the sim, the normal map's transparency was not preserved ( this can happen with incorrectly saved .dds files, not .png, so if you made yours the way I explained, this should not happen );
- May as well look through all swatches to make sure all of them were replaced;
- Put a few different hats on the sim to see how it works with hat chops. If some clip, you can get them in .the blend file with your hair and adjust the right hat chop.
| On the lowest graphics settings, in Live mode:
- If you made LODs, zoom out to preview them. If the item distorts dramatically, it is affected by a bone that was not present in the original LOD. You need to either clone something that is affected by it or remove the bone;
- Check how a sim hold objects and interacts with other sims to be sure everything is perfect.
|
|
|
|
Post by mauvemorn on Nov 19, 2023 13:02:03 GMT -5
Copyrights and distribution
For personal use, you can do whatever you want with other people's intellectual property. The rules exist for the distribution.
If converting premade hair from other creators to The Sims 4, make sure to check if they allow it in their Terms of Use or the License agreement. If you will violate them and be discovered, whoever holds the rights to this item might send you or a file-sharing website a DMCA takedown ( basically, "remove this file or we will sue" ). Nobody will sue you, no matter what, because this costs a lot of money that they may not be able to get back from you. However, a hosting website has the money, so it makes sense for them to comply and remove your files or even your account.
If an item belongs to the company, they most likely wouldn't even care to send you a takedown. While it is against the rules, they loose nothing and can still benefit from a free promo.
If it belongs to a custom content creator, they most likely will discover the theft and make it known to your audience. While the majority of The Sims 4 players do not care about the effort creators put into making CC, it will still damage your reputation. Highly advise to never take anything made by CC creators without explicit permission. Do not want people to steal from you, do not steal from others. I would also advise to refrain from buying content from file sharing websites unless it is clear that the uploader made it ( for example, if they have a link to their Second life/IMVU/etc store ). Nobody makes dozens of game-ready hair meshes just in case someone might buy them on sketchfab, those are always made for a game with an audience of people ready to pay. No link, don't risk.
I used this hair from Resident Evil 6 for educational purposes and will not be sharing it. If you would like to follow along or have it in your game, look up "Ada Wong obj" on Deviantart.
|
|
|
Post by mauvemorn on Nov 19, 2023 13:05:19 GMT -5
How to follow this tutorial in Blender 2.7x
If your computer cannot run Blender 3+, you can still follow this tutorial in an older version of Blender.
Key differences:
- Instead of Blender 3.6, get 2.76b. You can also get 2.79, it seems to work fine with Sims 4 Studio Beta;
- Selection in the viewport is done with RMB;
- Textures are plugged in the Texture tab;
- Knife tool and Mesh - Merge - By distance ( called Remove doubles ) are in the Tools panel;
- X-ray is called Limit selection to visible;
- Generate data levels is at the bottom of the modifier;
- There is a bug that leads to stretched UVs, when you transfer vertex paint and uv_1 at once. This is not a problem with hair, but if you're going to make something else, transfer weights and uv_1 first, apply, then add Data transfer, and transfer vertex paint;
- You must always use Clean with All groups after transferring weights because of another bug.
If I missed anything, don't hesitate to ask.
|
|
|
|