PDA

View Full Version : How to add/reference bump and spec maps to walls/floors (s4pe)


plasticbox
13th Nov 2014, 7:11 PM
This is assuming you already have your images ready and the wall package done (I was using WallEz which only generates flat walls, but I needed bumps/specs too).

Edit: Works along the same lines for floors btw, hence why I edited the title.

I'm using s4pe0.2c for this with the wrappers from 0.2d plus Inge's wrappers from here (http://www.modthesims.info/showthread.php?t=537196)/here (http://modthesims.info/showthread.php?t=541447) (not all of these are relevant, but can't hurt to have them).


1. Open your package in s4pe

2. To add resources, you need to give them proper instances: you can use e.g. Hasher (http://www.den.simlogical.com/denforum/index.php?topic=3279) (recommended since it automatically sets the high bit) to generate them, or the built-in FNV tool in s4pe (Top menu > Tools) -- always include your creator tag to avoid conflicts! Copy the FNV64;



Top menu > Resource > Add:


Type: _IMG (can type that into the box, you don't need to use the fiddly drop-scroll)
Group: 0x80000000
Instance: paste your FNV64 here

Note that you need to untick "Use resource name", this seems to be currently broken. Press "OK".


Right-click on the newly added resource (it'll show an "Error reading resource" text in the preview since there is no img yet for it to read) and select "Replace"; load your actual bump/spec


Rinse and repeat for all the resources you want to add (usually one bump+spec per wall height)



3. To add the references, we first need to see which MATD is which:



Sort your resource list by type and scroll to the first MATD: in the preview you will see an entry "DiffuseMap" with a TGI:
http://thumbs2.modthesims2.com/img/1/7/8/2/8/2/MTS_plasticbox-1480365-s4pe_wallbumps_03_matd.jpg

You can click on the _IMG with that instance number to see which wall height we're dealing with (in this example, we see it's a short wall):
http://thumbs2.modthesims2.com/img/1/7/8/2/8/2/MTS_plasticbox-1480366-s4pe_wallbumps_03_img.jpg



4. Now open the MATD in Grid view ("Grid" buttom at bottom of window), and open Chunk Entries > [0] > RCOL Block > Mtrl > SData by clicking on the three dots:
http://thumbs2.modthesims2.com/img/1/7/8/2/8/2/MTS_plasticbox-1480364-s4pe_wallbumps_04_sdata.jpg

Add the following in this list ("Add" button at bottom):
http://thumbs2.modthesims2.com/img/1/7/8/2/8/2/MTS_plasticbox-1480704-s4pe_wallbumps_05_sdata.jpg



ElementImageMapKey — Field: 0x19D7A3C0 (433562560) | Data: 0x00B2D882-0x00000000-0xCEB31003C33D903C
ElementImageMapKey — Field: 0xAD528A60 (SpecularMap) | Data: <TGI of your spec map for this wall height>
ElementImageMapKey — Field: 0x6E56548A (NormalMap) | Data: <TGI of your bump map for this wall height>
ElementFloat3 — Field: 0xB63546AC (SpecularUVSelector) | Data0: 0, Data1: 0, Data2: 0
ElementFloat3 — Field: 0x415368B4 (NormalMapUVSelector) | Data0: 0, Data1: 0, Data2: 0


"Normal Map" is mislabeled, this is actually the bump map. 0xCEB31003C33D903C is this thing (http://modthesims.info/showthread.php?t=539541) (it always needs to be referenced otherwise boom). It does not matter which order the elements in this list have.

ETA, I meanwhile noticed that only the Maxis medium walls seem to have the latter two entries -- can probably skip those for tall and short walls.


Press "OK" and in Grid, "Commit". Rinse and repeat for all the MATDs. Save, test, done.

--

Instead of adding resources like in step 2, you could also name your dds files according to s4pe convention to begin with (0x00B2D882-0x00000000-0x586E958613402F90.dds etc), and then just import them all in one go (that sets the TGI automatically) instead of adding one by one. But that kind of file name makes things a little complicated when editing stuff since it's not exactly self-explaining for humans =P

If your wall has the same "shape" (molding, rails, panelling and other potruding bits) as an EA one, you can skip the importing part and reference the in-game textures directly instead. For finding them see this post (http://modthesims.info/showthread.php?p=4596638#post4596638) (is about objects, but the same search tactics also apply). You should probably also do this when you already have redundant copies of EA bump/specs in your wall (i.e. delete the duplicate resources and link to them instead) to avoid unnecessarily bloated files.

plasticbox
15th Nov 2014, 5:28 PM
In addition to the above post: when you have a wall that you want to use existing bump/spec maps for, it is probably simpler to copy the MATDs from that and replace your custom ones with them (changing only their instance and one reference each to your custom texture), rather than adding in the references as above.


1. Find the CWAL of an in-game wall with the bump/spec maps you want – i.e. get the hash of the in-game name (look it up e.g. here (http://sims-4-files.wikia.com/wiki/Strings_ENG_US) and search FullBuild0 for the key (Tools > Search, filter for CWAL); s4pe searching is also described here (http://modthesims.info/showthread.php?p=4596638#post4596638))

2. In the preview under "WallMATDEntryList" it will list the MATD for each wall height; find the instance of the first one in FullBuild0 (paste instance into filter box at the bottom, "Set", "Filter Active")

3. Copy and paste that MATD into your custom package (right-click > Copy)

4. Change its TGI to the one of your equivalent custom MATD (make sure you don't get the wall heights confused here, they're not always listed in the same order!): right-click > Copy ResourceKey on old MATD, doubleclick and paste on new one, then open it in Grid > ChunkEntries > [0] > TGIBlock and paste it in there too

5. Copy the TGI of your custom texture for this wall height

6. Open the new MATD in Grid again; in ChunkEntries > [0] > Mtrl > SData paste the TGI into the ElementTextureRef field. "OK", "Commit".


Same for the other two (or however many) MATDs.

kiwisims_4
21st Nov 2014, 7:51 AM
I've found I have to greyscale my normal maps to work correctly on external walls . Otherwise the shadows etc are incorrect .

plasticbox
21st Nov 2014, 10:58 AM
How did you add normal maps to walls in the first place? :blink: None of the Maxis walls seem to have any?

kiwisims_4
21st Nov 2014, 7:27 PM
I edit the matd create an instance and choose elementtextureref when adding elements . Choose normal map and add the RK from the instance I created . That's what I do with the floors I've uploaded on here . It's the same process

plasticbox
22nd Nov 2014, 10:58 AM
You mean this?

http://thumbs2.modthesims2.com/img/1/7/8/2/8/2/MTS_plasticbox-1482699-kiwifloor.jpg

If this works the same in walls and floors (which I can't tell for sure, as I haven't done any floors yet), that is not the normal map, it's the bump map. It is only labelled wrong in s4pe.

(Actually your remark that they need to be grayscale is further evidence of that -- bumpmaps are grey scale, normal maps are disco coloured (https://www.google.com/search?q=normal+map&tbm=isch).)

3Sierra3
10th Dec 2014, 1:24 AM
Thank you for the tutorial. It was helpful but I found an even easier way to do this that I think you will love since you make a lot of walls and it's so much faster. I learned about it from a tutorial at sims 4 Studio today. Here is the link http://sims-studio.proboards.com/thread/244/mini-tutorial-wall-speculars-painless.

plasticbox
10th Dec 2014, 1:49 AM
This is a thread on how to do stuff in s4pe -- if you want to advertise other tools, please make your own thread. Also, I posted this way before S4S was able to deal with bump/spec maps; they've only added that recently for all I know. (Last I've seen they are plunking redundant copies of the original bump/spec maps into every wall btw .. instead of referencing it. How to do that, see above.)

Edit: also, I believe you are talking about the version that is currently in closed beta. The public one doesn't have that feature anyway, or does it?

3Sierra3
10th Dec 2014, 2:14 AM
Oh I just thought you would want to know an easier way since you make a lot of walls. I made a wall with it and there is only one bump and spec for each wall height so it doesn't look like that's a problem. I guess it's pretty new but still it's a good thing that things are easier now right?

I don't know what you mean by closed beta. I just clicked the Preview section and downloaded the latest version. Just like it is here you have to log in to download. Maybe you forgot to log in?

plasticbox
10th Dec 2014, 2:36 AM
Closed beta means members only. Not the general public. Same concept as with closed source, you know? ;)

Again, if you want to continue talking about S4S please make your own thread now.

Yecats131
14th Dec 2014, 12:10 AM
Just to clarify, the Sims 4 Studio does not do a closed beta. The second that we have a new feature (or features) that are in a decently stable state we release it for the community to test. I just want to make sure you have your facts straight for the future.

plasticbox
14th Dec 2014, 12:31 AM
When I went to check (above), the feature Sierra mentioned was not in the public/stable version. So I can only conclude it must be in the preview one, which was not public at that point (not even the download post was accessible).

I'd appreciate if we could get back on topic of walls and floors and bumpmaps now .. ...... ... . ..... like I said about five times now, if you want to promote your tool please make/use your own threads and don't barge into everybody else's.