Replies: 23 (Who?), Viewed: 5875 times.
Alchemist
Original Poster
#1 Old 10th Feb 2019 at 8:17 AM Last edited by jje1000 : 11th Feb 2019 at 4:52 AM.
Cracking Open Shaders_Win32.precomp? (for better shaders!)
Just throwing this out there, if anyone knows:

Me and a couple of other simmers were talking about the Shaders_Win32.precomp file (located in the Installation folder, under Game/Bin/), which apparently contains the shaders for TS3.

From this post onwards: http://modthesims.info/showthread.p...118#post5496118

Apparently there is a continuity of the precomp file between TS3, TSM and TS4: https://forums.thesims.com/en_US/discus ... ecomp-info

Any idea of how this file might be opened?

If a way is figured out of opening the file, the door might be opened up to better shaders for TS3, much like what has happened to TS2 with its assortment of shader enhancements.
Advertisement
Mad Poster
#2 Old 10th Feb 2019 at 9:07 AM
Main goals for shader enhancement project:

Restoring inter-floor shading
Improving FOV for shadow rendering
Fixing graphical anomalies (e.g. Sim hair becoming partially invisible over glass)

Stretch goals:

Modifying existing shader parameters (e.g. changing ambient color of unlit rooms from blue to grey, increasing hair shine and self shading on Sim character models)
Implementing new shader functionality (e.g. porting subsurface scattering from The Sims Medieval, integrating post-processing effects into game engine)

The first and fourth, as well as porting shaders from The Sims Medieval, should realistically be quite easy. Changing a few values and rewriting a few lines of could would likely do the trick. The second and third should be more complicated, but likely achievable to a certain degree. Implementing extra FX may prove a lot harder, since entirely new code would have to be written for it. Of course this should consist mostly of translating Reshade source code to a language TS3 will understand.

Look out for BRIDGEPORT'88 - it's the hottest new show on YT this season!
Already renewed for '89!

(Oh, and join my dumb Discord server for more on that or if you like dead things, my Tumblr.)
Puffin McMuffin
staff: administrator
#3 Old 10th Feb 2019 at 11:03 AM
There were a few other threads on here that also discussed the same matter actually, and they never got to an answer on to how to crack it. Personally the best way to change specific shaders (and WesHowe's ghost radio is a really good start for this: https://modthesims.info/d/367086/gh...eap-stereo.html

Now, there are 2 shaders obviously. One that you can easily call onto the mesh: http://simswiki.info/wiki.php?title=Sims_3:Shaders
Then obviously that file. but the list of shaders can only indeed be fully edited by opening that file. however, it's just super compressed... which means... reading and binary code is probably the only thing you could do to really edit it. Still have to check that out myself though!

So yeah that would really only be your shot into "cracking it" which really is just looking through the peeks and just edit stuff around. However, what CAN happen is that once you edit it, the game just crashes, or just simply dies on you. So make sure to make a backup if you're trying this!

I'll take a look at this later and see what we can do with it
Alchemist
Original Poster
#4 Old 10th Feb 2019 at 1:33 PM
Very useful information!

@Lyralei, would you happen to also know if the shader file is also where the game's lighting system is stored?
Puffin McMuffin
staff: administrator
#5 Old 10th Feb 2019 at 2:01 PM
hrm... Light in-game is actually displayed differently in 3 different ways in-game.

1. object lights. Which basically is the LITE resource in a package, which every single object has due to needing some data to know how it's being cast... although this is more about the "shadows" it casts. However lamps also use it in a different way, basically inverted. Now this tutorial is more of a "fix" tutorial but it basically tells you (except for the blue lights) what I mean: http://poccisims3.blogspot.com/2013...-lightings.html

2. World lights. And this is basically how we know about lighting mods

3. The engine's lighting. Now if you've worked with a 3D modeling program and rendered things then you might understand what I mean with that. But see it as a "kitchen lamp" cast onto a table. Now there might have been some tweakings done in the shaders file regarding the contrast but it will never necessarily fully edit all the lights completely.

With contrast in this case I mean making things darker/lighter which is probably the answer you were looking for Although I'm not entire certain if this is actually the case
Alchemist
Original Poster
#6 Old 10th Feb 2019 at 2:35 PM Last edited by jje1000 : 11th Feb 2019 at 3:53 AM.
I'm interested in 3, as it probably controls the light spillover between levels as well as darkness levels in rooms. 1 and 2 are already editable to an extent via TSRW and weather files. It probably won't be found in the shader file, but the search goes on I suppose!

Also of note is the SimSkin shader category, would be interesting if cracked open, there might be comparisons made between TS3's shaders and TSM's. Would love to see it it's possible to transplant some things, the same way some TS2 modder did between Castaway and TS2 for water shaders.

Edit: SimHair might also be an interesting one too look at- if specular settings could be improved, we might be able to get hair sheen for all hairs without any roundabout methods.
Alchemist
Original Poster
#7 Old 11th Feb 2019 at 4:24 AM Last edited by jje1000 : 11th Feb 2019 at 2:12 PM.
Interesting possible routes:
http://modthesims.info/t/460275
Quote:
Originally Posted by AGuyCalledPi
BINGO! Someone on the Officials sent me a bunch of links to MATY, which I hadn't even considered consulting, and referred me to an After Effects plugin that can apparently read and edit precomp files. Haven't had the time to look into it much further but MATY seems to be doing a bit of problem diagnosis here, at least as far as the shadow situation goes. Would be nice to unfuckulate that, which would be possible with the shader file. Then again, there's probably a good reason it broke in the first place and EA might've broken it to make something else work. Might be worth raising the issue at MATY and seeing if they know more about it. There might yet be someone alive over there with a bit of engine knowledge to dispense.

http://modthesims.info/showthread.p...143#post5496143

@AGuyCalledPi , do you have the original message they sent you? It might have a bit more information in it. Regardless, I've managed to grab the file here .

Old TSM discussion:
http://modthesims.info/t/579943

Sims 4 Forum discussion:
https://forums.thesims.com/en_US/di...32-precomp-info
It might be worth contacting @Inge Jones and asking about the sort of general programs used. Maybe @CmarNYC might know something as well?

Other discussion here:
https://www.steakunderwater.com/wes...topic.php?t=521

Link to the original NoMosaic mod: http://www.modthesims.info/download.php?t=343951)
Found the creator on their still-active Twitter account (https://twitter.com/gibbed), might try to contact them and ask about what program was used to create the original no-mosaic mod.

Anyways, according to the sources above, the precomp file might possibly be openable via:
- After Effects
- Maya
- Some Autodesk Creative Suite program
Alchemist
Original Poster
#8 Old 11th Feb 2019 at 12:20 PM Last edited by jje1000 : 11th Feb 2019 at 2:57 PM.
Ok, another line of thought- precomp files are associated with compositing programs for modelling software (i.e 3dsmax, Maya). It was mentioned in the TSM thread that it makes sense that these files are associated with modelling software, and in this case, material modelling.

http://download.autodesk.com/us/may...umber=d28e16321
http://download.autodesk.com/us/sup..._user_guide.pdf

Maybe the .precomp fil format may be related to the 2010 Maya Toxik suite of software, or software from around that time?

Edit: Mspoodle tested it out and the 2010 Maya Toxik suite does not open the original .precomp file. I still think there must be some modelling software material editor that's related to it.
Puffin McMuffin
staff: administrator
#9 Old 12th Feb 2019 at 9:55 PM
yeah basically looking at the sims 4 compiled file it did give me more answers as to why all the shaders are at the 'bottom' for ts3's code, when looking at the binary code there. It also explains pretty well why there were random "PASS" and "TECH" in the code as well, good thing ts4 and ts3 are incredibly similair!

So all that needs doing is just a script that de-compresses everything which with that ts4 should be easy peasy Will let you know how that goes!
Alchemist
Original Poster
#10 Old 13th Feb 2019 at 3:20 AM
Quote:
Originally Posted by Lyralei
yeah basically looking at the sims 4 compiled file it did give me more answers as to why all the shaders are at the 'bottom' for ts3's code, when looking at the binary code there. It also explains pretty well why there were random "PASS" and "TECH" in the code as well, good thing ts4 and ts3 are incredibly similair!

So all that needs doing is just a script that de-compresses everything which with that ts4 should be easy peasy Will let you know how that goes!


Some good information there! Were you able to talk to anyone in that TS4 main forum thread? I think they might have some information about how TS4's precomp file might work, along with the SimGuru in that thread.
Puffin McMuffin
staff: administrator
#11 Old 13th Feb 2019 at 10:19 AM
Okay so discussing this with Tashiketh as well (since he's the king of hex code really :P) and both taking a look at it, we came to the conclusion that the file is just useless for the intended reason of changing shader setting because it's just a bunch of "headers" and setups for the shaders to be imported so to speak. (aka, 'does this render method exist, then display that render method. if not, don't display anything. Most of this is pixel rendering and calculating vertices.) It doesn't hold any values to edit the exact shaders. Because the code, in a nutshell, is basically:

- Define the headers (this is an SPKG file and that is an SHDB, etc)
- Load in this and that rendering method
- Bunch of flags that are useless (except for the game obviously :P)
- Samples and passes methods (Which really narrows it down to, crunchy look and non-crunchy look. If you know all about blender rendering or just 3D modeling programs and rendering you know so well what I mean... the pain!)
- Mentions of what shaders exist. which really is just an Enum in a way. (Enum is like a coding shopping list, at least that's how I like to look at it)

Resources maybe that are interesting
So you can't actually edit the way the game reflects the lightings and stuff since that's in the actual engine. Every time you place a lamp, that's basically that lighting. There is this INI file I looked at though less than a week before that might be cool editing, although it only changes the AO of the roof as well as the walls. It's in the FullBuild0 package. Just search for the 'ini' tag and tada

Second thing, but that's more because I'm personally looking into that is just figuring out the code on how when fullmoon is triggered, why the world changes lightings, which I just think is a change of the world's lightings settings (The one i talked before, basically the file that makes a lighting mod ) But I'll just dig into the in-game's code and see what triggers that
Alchemist
Original Poster
#12 Old 13th Feb 2019 at 12:18 PM
Interesting! So the Sims 3's precomp file really does differ from the Sims 4's precomp file?

In the official forum thread (https://forums.thesims.com/en_US/di...2-precomp-info), SimGuruModSquad said that TS4's precomp file contained the game's shaders in a binary format. A shame if TS3's file was that useless though.
Mad Poster
#13 Old 14th Feb 2019 at 3:30 AM
Hm, that's kind of a let-down. Still, would be interesting to be able to redefine the loading of these render methods. And figuring out what SPKGs and SHDBs are. And getting a look at those flags. The actual shader code, I assume would be located in the game EXE? Then how come the precomp file is 90 megabytes? That's a hell of a lot of plain text.

Look out for BRIDGEPORT'88 - it's the hottest new show on YT this season!
Already renewed for '89!

(Oh, and join my dumb Discord server for more on that or if you like dead things, my Tumblr.)
Puffin McMuffin
staff: administrator
#14 Old 14th Feb 2019 at 11:04 AM Last edited by Lyralei : 17th Mar 2019 at 2:57 PM. Reason: ... why did I write TSRW. exe instead of TS3W.exe? :P
To be really honest, the precomp for ts4 is just equally useless, because it's basically the same file just made ts4 compatible so to speak. TS3's one is a few bytes off but the code must be almost identical to the sims 4 version, given how every single method and bytes references are all approximately at the same lines. I mean if you're doing it well you can easily even convert ts4 packages to ts3 by deleting a few things because the inner system is so much of a rip off of the Sims 3 that it's that easy. So seeing ts3's precomp being pretty much identical to the ts4's one does not surprise me.

Quote:
Hm, that's kind of a let-down. Still, would be interesting to be able to redefine the loading of these render methods. And figuring out what SPKGs and SHDBs are. And getting a look at those flags. The actual shader code, I assume would be located in the game EXE? Then how come the precomp file is 90 megabytes? That's a hell of a lot of plain text.


It is! But with good reasons. So when you're compiling your code for the game, you obviously want the game to be able to call its textures, shaders, rendering settings, etc. Now I'm not sure if that's common practise perse but in the TS3W.exe as well as the TSLHost.dll, it holds pretty much all the 'directions' of where the game should get its details. They're actually listed like a map structure, which was obviously needed before the game was actually being compiled for release.

So the best way to change the game's lighting settings would be changing the world's toon. (See: http://modthesims.info/showthread.php?t=459198)
For shader tweaking, the best practise for that would be editing the object directly. EVERYTHING in the game is an object that can be found, although the most interesting one to edit for you would be the skybox as well as the world's terrain textures Checking out that AO ini file would also be worth it. Maybe you can even check the TSM's AO ini, toon ramp, skybox and what not?
Puffin McMuffin
staff: administrator
#15 Old 14th Feb 2019 at 4:24 PM
I actually just stumbled upon this, maybe that could help a little with the shadings and stuff? http://www.modthesims.info/showthre...478#post3998478
Mad Poster
#16 Old 14th Feb 2019 at 10:25 PM
True, those are a few values that haven't yet been exploited to their fullest extent but overall, it's nothing we didn't know about. Real shame that's what it comes down to because the sea/sky/light parameters have already been modded to death and back and I've already experimented with the AO settings somewhat. I recently had the idea to try to add specular and normal maps to the terrain textures but I was told the terrain shader doesn't support it natively.

If the actual shader code can't be accessed, it would at least be worthwhile to look into using the existing features of the lighting engine to enhance the game. Matter of the fact is, terrains are just plain old diffuse textures mapped onto the terrain geometry. It looks lifeless. Having bumpy asphalt or shiny sidewalks could be a major improvement, if at all possible. And yes, the skyboxes could do with some work. The way TS3 does it, you get a completely blank color gradient with a layer of 3d clouds scrolling over the top of the world. TS4 doesn't have the 3d cloud layer, it only has a backdrop texture. Adding a skybox object to each world, in addition to the distant terrain, could enhance the look of the world edges significantly.

Look out for BRIDGEPORT'88 - it's the hottest new show on YT this season!
Already renewed for '89!

(Oh, and join my dumb Discord server for more on that or if you like dead things, my Tumblr.)
Alchemist
Original Poster
#17 Old 15th Feb 2019 at 4:03 AM
I've tried experimenting with the roof AO settings ages ago but they didn't have much of an effect IMO.

But yeah, beyond that, everything seems more or less tapped out in terms of game modding- anything else has to come out of that second layer of modding, CC creation.
Mad Poster
#18 Old 15th Feb 2019 at 4:47 AM
Filling in the gaps EA left....adding hair shine, adding normal mapping where there is none, increasing LODs and particle counts, exploring underutilized shaders and figuring out what the hell the AO texture maps are for.

Look out for BRIDGEPORT'88 - it's the hottest new show on YT this season!
Already renewed for '89!

(Oh, and join my dumb Discord server for more on that or if you like dead things, my Tumblr.)
Field Researcher
#19 Old 16th Feb 2019 at 3:36 AM Last edited by MeowMixPls : 16th Feb 2019 at 5:43 AM.
Have I understood correctly, so the logic how the game renders e.g. fog and sky transitions are in the game engine that cannot be accessed?



That line there doesn't need to have any weird angles, it should be a smooth circle that gradually blends into the darker blue sky, just like in real life: https://images.fineartamerica.com/i...a-elisseeva.jpg

edit: I forgot to tell you! When switching between different weather types using timeshifter in-game, you must return to desktop and then go back to full screen if you want to observe the true differences. The first 3 bars in the colour ramps bleed into each other which makes observing the differences impossible. This doesn't matter if you're not trying to change the top 3 bars e.g you're just changing cloud colours. Also, checking these differences in CAW are useless. I only recommend checking sky and cloud colours in CAW and even then, clouds will look significantly different in-game than in CAW.

Also, if you do not have this ugly blue sheen, the game is not correctly reading your color ramps http://www.modthesims.info/showthre...stpost&t=608782

I lost weeks worth of research and had over a thousand of flawed screenshots because I didn't realise this earlier.

@Lyralei modifying those values you can easily make your game look like TS2 :D
Mad Poster
#20 Old 16th Feb 2019 at 5:42 AM Last edited by AGuyCalledPi : 16th Feb 2019 at 5:56 AM.
Well, not necessarily - you're still talking about sky and light parameters. That isn't what I'm looking for, personally, so I'm also not particularly knowledgeable about the limitations of these things......I don't know why your sky is cutting off like that, though, but I'd take another look at your ramps to be honest.

Look out for BRIDGEPORT'88 - it's the hottest new show on YT this season!
Already renewed for '89!

(Oh, and join my dumb Discord server for more on that or if you like dead things, my Tumblr.)
Puffin McMuffin
staff: administrator
#21 Old 16th Feb 2019 at 9:26 PM
hrm, the sky cutting off is most likely that is actually the world mesh so to speak. At least, if EA made the skybox as a mesh and not a scene that would explain it which for 2009 and earlier was very much a normal thing, especially since the development of the sims 3 started somewhere in 2007/8 ish the sims 2 definitely uses skyboxes though, still got to see if TS3 is the same as TS4: https://forums.thesims.com/en_US/di...urce-0x71a449c9

Anyways I'll have a better look at the sky bit, if it's a mesh it's not that hard to edit it! If it isn't... then it might be worth seeing if editing the ramps and stuff could be worth it?
Field Researcher
#22 Old 17th Feb 2019 at 5:01 AM
@AGuyCalledPi That not my weather mod, It is the Uranesia one. The reason why it does that because there is a too big of a difference between the lower and top sky color ramp. They do not blend together. But if you make the colors similar like in EA worlds, well, then you get EA sky.

@Lyralei Very Interesting. Could clouds be meshes too? They seem naturally blend, but the color ramps that control the color of the top & lower part of the sky do not.
Puffin McMuffin
staff: administrator
#23 Old 17th Mar 2019 at 2:44 PM
Hi @Giga !

Super late reply, and I remember looking at it at some point but they're basically 'animated' clouds. There have actually been some replacements made for it as well if you want to take a look at that, and believe me, the original file is not pretty So this one should fix that: http://nilxis.tumblr.com/post/14627...ready-made-some
Field Researcher
#24 Old 17th Mar 2019 at 3:09 PM
Ah yes, that file. Those clouds look very pretty when partly cloudy but if you want stormy or overcast with dramatic dark clouds, not so much. I did make my own but went back to EA's one because I do not only want sunny and partly cloudy weather.
Back to top