If you are using ReShade 4.6 and above, RESHADE_DEPTH_INPUT_IS_REVERSED has been defaulted back to 0 again.
This means if you are using 4.6+ you do not need to change it in order for depth effects to work in The Sims 4 anymore.
[In case you’re not sure what I’m talking about: ReShade uses the game’s depth buffer to know how far or close things are in the scene, so it can judge what should be blurred (if using DoF), what should be shadowed/occluded (if using MXAO), how far back fog should start (if using Adaptive Fog), and so on. Different games calculate the depth buffer in different ways, with some of them being upside-down, and some of them being reversed. The depth buffer in TS4 is neither of these things (it’s right way up and not reversed). In ReShade 3.1.1 the default setting in ReShade was changed to automatically expect a reversed depth buffer. This meant that if you tried to use depth effects in TS4 without changing it DoF and MXAO etc wouldn’t work as intended. I wrote a tutorial at the time explaining how to change this setting back again. If you are using ReShade 4.6, it has been set back to normal by default now, so you will no longer need to complete this step.]
Due to the popularity of this post, I decided to write a simple tutorial for whoever wants to try the same thing with their favorite game. This method will work with every title that supports ReShade and Depth Buffer (and pretty much every static image you want to animate).
What is ReShade?
It’s more or less a mod that alters the original graphics, adding in more effects (like lens flare), different tones and fixing bad looking edges.
What is the 2.5D/Parallax effect?
2.5D is a method used by many editors to animate a completely still picture, from simple sceneries to characters. This creates a sort of 3D depth on your pictures, used a few times by many professionals to bring famous paintings and advertisements to life.
Note: This tutorial is mostly about scenery animation faking a camera movement and adding in a 3D space between layers. For the Parallax animation on characters I’ll write a separate guide.
What you need:
• The game (duh) (in this case I’ll use Assassin’s Creed Syndicate as example)
• ReShade (I find myself more comfortable with a previous version, because I somehow cannot achieve the same results with ReShade 3+ at the moment. This should easily work with the latest version too, but for any problem or if you want to follow the guide better, grab ReShade 2.0.4f from here)
• An editing program like Adobe Photoshop, anything that allows you to separate parts on layers and fill empty areas.
• Adobe After Effects
A basic editing knowledge is required, along with a good understanding regarding Adobe programs in general. If you make graphics and gifs you’re already a step ahead, but you actually don’t need to be familiar with AE to do the animation.
1) If you are using ReShade 3+ you can follow this tutorial regarding its installation, otherwise copy the ReShade folder, ReShade.fx and ReShade64.dll (or ReShade32.dll if the game is 32bit) into the main game path (where the exe is, so to speak), then rename ReShade64/32.dll as dxgi.dll.
2) With ReShade 2 go to ReShade directory > Presets > Default and drag Shaders_by_CeeJay.cfg into Notepad, then scroll down to the very last line where you see a shader called DisplayDepth. Next to #define USE_DisplayDepth change the value from 0 to 1. With ReShade 3 press Shift+F2 and look for the same name, if you properly downloaded it along with the other shaders of choice it will most likely be already activated. It is highly recommended to set a hotkey for this effect so that you can easily turn it on and off in game (for example, #define Depth_ToggleKey VK_F12).
3) Open Pipeline.cfg and look for the line #include EFFECT(CeeJay, DisplayDepth). Select it, cut it away and then paste it to the very top before any other shader listed. This will allow you to obtain smooth shapes instead of jagged edges (you should also play around with AA options, specifically SMAA and/or FXAA, both included in CeeJay.cfg). Sadly I’m not sure how the setup works in ReShade 3+.
4) Now that your options are properly set you can start the game. Find an area you like and want to shoot, then press F12 (or any other key you chose for it). If the game has a photo mode or custom made free camera tools, you should totally use those for the best results. You can check this post for a few listed titles and all their respective links.
ReShade allows you to automatically store your screenshots directly into the game’s folder by simply pressing the print screen key. This is how the scene looks normally, without UI and with the free camera activated.
This is what happens when you turn DepthBuffer on.
Note: If all you get with Depth is a fully white or black screen, chances are you need to “reset” by simply entering the fullscreen mode (and switch back to borderless/windowed if that is what you usually like playing with). ReShade usually reloads whenever you apply a modification to the settings, but if even after this the effect doesn’t show up it probably means the game has no DepthBuffer support (or there is some incompatibility somewhere, which may be related to other shaders).
Part 2: Editing
1) Grab your depth screenshot and open it with your editing program of choice, I use Photoshop. In order to animate this, you have to create different layers (renaming them for an easier use in AE, but that is up to you) being sure each hole is covered, or else the empty part will definitely show up in your animation.
2) Make a selection around the areas you want to separate, I’m starting with what is close to the “camera”. Try to be as precise as possible to keep most of the details, especially around the character. Once you’re satisfied with your selection press CTRL+X to cut it out and then paste it into the same position, a new layer for it will be automatically created.
3) If you hide the layer you’ve just made, you will obviously notice an empty shape on the background right where you cut it. The easiest way to fill that properly is by selecting the layer (CTRL+LMB on it), inverting selection and going to Modify > Fill > Content-Aware.
As you can see the empty area has been filled completely, but a few fixes are required. You can use the clone stamp tool or the healing brush, in this case I choose the latter because it makes the process quicker.
It can be a bit tedious in some places... especially if there are a lot of buildings or trees, depending on your scene. Photoshop covered the outline using the existing content to generate the missing parts as I dragged the brush over it, but you may want to use the clone tool as well and even draw here and there where the brush failed.
Repeat the process for all the other layers you want to separate and then rename everything to know what you’re gonna edit in AE (again, this is optional). You can also make the back layer bigger to hide imperfections behind the other layers, which won’t be too visible while animating. Further edits will be done in AE later anyway.
Part 3: Compositing
1) Save the PSD file and load Afer Effects. I’m currently using the CC 2015 one, but even if you have an older version this method will work without problems.
Go to File > Import > File and select your PSD.
Be sure the importer is set on Composition and Editable Layer Styles is checked, this is essential if you want to work on each layer.
2) Double-click on the left to preview the PSD and convert every single layer into 3D. To do so simply check the third square on the right, under the cube icon:
Now we need to add a Camera. Go to Layer > New > Camera and leave the options untouched (the default configuration should be okay for this).
3) Right under your preview you should see a button called Active Camera. Switch to Custom View 1 to move the layers and create depth between them.
All you have to do is select each layer in the lower panel and move it using the blue arrow (z direction) to push it backward or forward. Use the order you’ve got as reference for the best result, then change the view to Active Camera again when you’re done.
4) Now that you have changed the original positions you need to fix their size to fit the composition. Select all layers at once, press S and activate the little watch icon that appears followed by the effect name (Scale). You will see three values then; place your mouse over the 100,0% one and drag it to the right or left in order to resize the layer(s). Use the directional arrows to also move them up or down eventually.
The stopwatch is absolutely fundamental, because it tells where to place each frame in the timeline. Whenever you apply an effect or any modification you need to be sure it’s recorded at the very start, this way it will affect the entire sequence and you won’t risk to only see it taking action in a few frames later instead.
5) You can move the upper bars in your timeline to change the final time. A few seconds for this kind of animations will suffice, I always set it around 4s.
Part 4: Animating
1) Now we can finally animate, woo!!
It is highly recommended to make all the planes bigger than the composition, so that you can move them around without risking to get empty spaces. In this case we want to fake a camera movement with a sort of 3D perspective, like the gifs I’ve posted in that photoset.
Let’s start from the first layer. Click on it and press P (position) to store the current location on the first frame, then move the time indicator at the end of your sequence. I want the main layer to slide horizontally, thus I will move the red arrow on X axes.
As soon as your first animation is stored, another frame will be generated at the end of the timeline. After Effects automatically creates all the frames between the first and the last one, if you are happy with it select the second layer and do the same, then the third and repeat.
You can also use the R (rotation) key to add more realism. Remember to ALWAYS check the stopwatch on frame 1 before doing anything else.
You can preview the animation with space bar, the rendering times change according to the amount of virtual memory installed on your PC.
For a nice camera shake you can follow this tutorial.
2) Once you’re happy with your animation you’re ready to export it. You can pick a simple video option, but that usually requires a second rendering in Sony Vegas or any other program for video editing to fix the bad-looking fps drop. I suggest you to export in frames instead, especially if you plan to make gifs. Go to Composition > Add to Render Queue, a new panel will appear on the bottom. Click on Lossless and pick PNG Sequence next to Format, then on Not yet specified (output to) and select a destination on your computer. Press Render, wait and it’s done!
Again, the rendering times will highly depend on your RAM and composition size. The bigger, the slower; if you play in 4k you should reduce the screenshot size to a common 1920x1080 at least, even smaller after that for the final gif (tumblr has a 3MB limit).
I was recently contacted by someone who had been experiencing issues in TS4 since the stairs update, where MXAO was disappearing when they moved their camera up, and reappearing when they moved their camera down.
I’ve updated my game and started a new save with no mods and checked myself (because I haven’t played since before the stairs update). I can confirm I’m seeing the same behaviour.
If any of you have used MXAO with the Indirect Lighting (IL) option in the past you’ll be familiar with how the IL effect can change rapidly when moving the camera. This is because ReShade and MXAO make hundreds of calculations constantly, working out where solid objects are, where in the distance they sit, how far they are away from other objects, and the angle from which we are viewing them. With this information MXAO renders Ambient Occlusion (AO) and IL to create semi-realistic shadows and light reflections based on how objects interact with each other to block light or reflect it. With IL, it works to bounce light off one object onto another, and as we move the camera, even just changing the angle, how light will bounce and reflect changes -- and so we sometimes see rapid changes in the strength and colour of the reflected IL.
It seems that the same is happening with the AO part of MXAO now too. It may well have always done this (it’s been a while since I’ve played so I don’t remember), but perhaps a recent update has done something to the game’s depth buffer (which is what ReShade hooks into in order to let us use depth effects like MXAO) making those calculations more sensitive. I can’t give a solid reason why it’s happening, and I don’t know if it’s affecting everyone and every version of ReShade (I use 3.4.1), but I can understand why it would be annoying.
I had some relief from it by editing my graphicsruls.sgr file to turn off ssao and dof, but it was still happening. One thing I noticed was that it seemed to affect shadows in the distance more than in the foreground, and between objects that have a wide distance between them. Now, in reality if I hold a cup in front of me I would not expect it to cast a shadow on a hill in the distance, but the limitations of ReShade mean that sometimes that can happen with MXAO if the settings aren’t tweaked to avoid it (look for the tool tips that talk about viewing angle and self-shadowing). What this new behaviour seems to be doing when it weakens MXAO when moving the camera up is actually applying a more realistic MXAO, so that cup in front of my face isn’t shadowing the hill in the distance any more. With the camera moved up, I still saw nearby foliage shadows but distance shadows disappeared or became weaker.
I know of no solution at the moment that will give a consistent MXAO at all camera angles. Some things I suggest, however:
edit graphicsrules.sgr to turn off ssao and dof
play around with the MXAO settings that relate to viewing angle and self-shadowing
get used to editing your MXAO settings regularly as you set up shots -- I’ve always done this, and it’s a necessity if you use exaggerated AO and IL settings anyway, but it may be a necessity with more subtle settings now too
I’m sorry if this is affecting some people’s enjoyment when using ReShade. If I find another solution, or at least a way to mitigate the worst of it, I’ll let you know. In the meantime, I hope you have a bit better understanding of how MXAO works, and why it may be doing this, so you can try to work with the shader yourself and get the best out of it in difficult circumstances.
If you’re not experiencing this behaviour, it would be useful to know the version of ReShade you’re using, and also your MXAO settings. Perhaps we will be able to narrow down what’s going on in that way.
hi hello sorry if you've already answered this before (even though i checked through your faq tag and i thiiink my question hasn't been asked yet??) but for some reason mxao & dof stopped working for me?? it worked before but then for some reason now it doesn't show up?? i checked and even with the box checked nothing shows up. i'm not sure if i did something wrong or what but i don't think i've changed anything from when i first started using reshade so idk what happened
Hi anon, I’m sorry you’re having problems.
First thing to do is check whether Edge Smoothing has accidentally been re-enabled in the game’s graphics options. I don’t think this can happen automatically via a patch, but it’s not outside the realm of possibility. It will also be reset if you ever change the overall graphics quality (the main drop-down above the individual graphics options). It’s easy done, without realising, and if Edge Smoothing is on it will stop any depth effects in ReShade (like dof, mxao, adaptive fog etc) from working.
The next thing to check are your preprocessor definitions. Depending on your version of ReShade you’ll either find them in the Settings tab (for v. 3.x) or via a button at the top of the bottom pane in the main Home tab (v. 4.x). Check that the entries for depth being ‘reversed’, ‘upside-down’, and ‘logarithmic’ are all set to 0. If any of them are set to 1, change them to 0 and press Reload at the bottom.
If all of that is in order, the next thing you can check is a little more advanced, but easy to do.
Depth effects like mxao and dof require ReShade to hook itself into the game’s own depth buffer at the right time. There are lots of different things all happening at roughly the same time when the game uses its own post-processing and rendering, and it will order them so each happens at the correct time, one after another, so they work together properly. Think of it like a series of layers in Photoshop, where the finished image will look different depending on how you order those layers. The developers have arranged all those ‘layers’ so that they all work together optimally, both for performance and for aesthetics.
ReShade has to inject itself into the game at the correct time for it to look right. Usually this is at the end, so it layers its effects over the top of the game’s own effects. For depth effects, however, in order to get access to the depth buffer it has to inject itself in earlier, at just the right time. It doesn’t always get this right, because it’s fighting against the game. You can manually override this though, which can help solve some issues.
In the ReShade menu at the top the very last tab will say dx9 (or dx11 if you’re playing a dx11 game – this is the same process for all games). Click on that tab and you’ll see a few boxes with long strings of numbers and weird incomprehensible stuff, and some of them may have numbers that are rapidly calculating and changing. These are the depth buffers. While you’ve got one of your depth effects enabled, tick one of these boxes in the dx9 tab, and see what happens. If nothing happens, move down to the next one, and so on. Eventually, hopefully, you’ll find the correct one that hooks into the depth buffer properly. You may have to go into this tab and do it every time you load the game or if you use SRWE for hotsampling after every time you render a new resolution. Sometimes the box you need to tick may change depending on the map you’re loaded into, so be prepared for some trial and error.
This is what I’m having to do in The Outer Worlds. It forgets the depth buffer and keeps rendering it in the wrong part of the rendering pipeline, meaning in this case it blurs the whole image rather than using the depth. So I have to go into the dx11 tab and click one of the boxes to get it to work again. And because I hotsample, I have to bring up the menu while I’m hotsampled and do it there too, which is really painful because I use big resolutions that knock me down to 1fps. But it gets the job done.
If none of these things are working, I’d go and check all the usual sorts of things like turning off Origin In-Game, running the game (and Origin) as administrator, making sure you don’t have any other programs running (even as background processes) that use any kind of overlay, make sure you are up-to-date with your graphics drivers and Windows updates, etc. And then, when all else fails, uninstall ReShade and reinstall it from scratch (make a backup of your current installation so you can paste it back in if you need to). And if that doesn’t work, try a different version of ReShade.
Hopefully, somewhere in all of that, is a solution for you. I tested the game a week or so ago, having not picked it up since before Moschino came out, because someone else was noticing weird behaviour with mxao. I got that same weird behaviour, so I think a recent patch to the game has altered the behaviour of the game’s depth buffer in some way. It’s entirely possible this is causing other problems (our problem was mxao fading or disappearing when you move the camera up). There is, unfortunately, only so much we can do our end if Maxis have changed something to how they render the game. ReShade is a nifty little tool that tries to take into consideration all the weird ways developers set up their games, but they can’t account for everything. But hopefully this isn’t the case here and it is something we can fix for you. Please let me know if any of the steps above helped.
hello there! i recently downloaded reshade 3.0.8 and dof effects do not work at all, i changed reshade with other versions (with the correct shaders) and same thing, it does not work. i don't have edge smoothing on and in the preprocessor definitions everything is 0 .... i really don't know what's going on! could you help me?
Hi there. The only thing I know of that will stop dof working completely is having edge smoothing on, so if you say it’s off that’s very strange.
Turn on the Display Depth shader and tell me what you see. Try to do it while you’re outside, because it works better than inside. What you should see is the screen turn flat and grey scale, where things in the front are black and things in the distance are white, and everything in between slowly goes through the grey spectrum, getting lighter the further it goes back.
If you just see a completely black or white screen then we can say for certain the depth buffer isn’t working, and none of the depth effect shaders will work. If you do see it going from black to white as intended then the depth buffer is working and we know to look elsewhere for the problem.
Versions of ReShade from 3.1.1 onwards have reversed the depth buffer by default.
The depth buffer is responsible for all the depth-based effects you might use, like dof, adaptive fog, mxao, etc.
If you are installing ReShade 3.1.1+ from scratch without any old settings carrying over you will likely find none of these depth-based effects look as you expect. For example, with dof the foreground will be blurred and the background will be clear.
Thankfully there’s a really easy way to change it back to how it needs to be for TS4 (and any other game that doesn’t have a reversed depth buffer).
Here is an album of pictures with step-by-step instructions.
For those who don’t need the pictures (it is a simple fix after all):
Open the ReShade gui (usually shift+f2)
Navigate to the ‘Settings’ tab
In the ‘Preprocessor Definitions’ box find the line: RESHADE_DEPTH_INPUT_IS_REVERSED
If it is set to 1 it means the depth buffer is reversed. Change the 1 to 0
Navigate back to the ‘Home’ tab
Click ‘Reload’ at the bottom and wait for the shaders to recompile
And that’s it! Now your depth-based effects should be working as intended.
Note 1: If you’re not experiencing any problems with the depth buffer you don’t need to do this. When I upgraded to 3.1.1 I didn’t need to, because my settings carried over from my previous ini files. You’ll probably only need to do this if you’re installing everything from a clean Bin folder, with no old ReShade ini files present.
Note 2: With each new ReShade installation, when you download the shaders from the github repository there’s a chance some of them will be different from how they were when you or other preset creators made the presets you use. If something looks odd you may have to reconfigure the shader settings in the Home tab yourself to get them how you want. I just had to do this with the new mxao shader. Additionally, sometimes creators will give you modified versions of shaders with a preset, and downloading from the github repository will overwrite those modifications. Always keep backups of the files you download in case you need to swap them back in.
Note 3: Don’t forget, for depth-based effects to work you must have Edge Smoothing turned off in the game settings. You do not need to turn off post-processing as well, but it is recommended to edit your graphicsrules.sgr file (found in your Bin folder) to change the ssao entries from ‘true’ to ‘false’ to avoid conflicts with the mxao shader and any other little quirks. (Turning off ssao in graphicsrules.sgr gets rid of the game’s own ambient occlusion (which is what you add back in with mxao), and also the game’s own dof (distance blur), so you don’t need to use a mod to remove blur at the same time.)
My reshade issue has thus far led me to notice that my Global Prepositon Definitions were completely gone. This might've been connected to the weird "reset" of my reshade this morning - and why I am constantly getting the tutorial when restarting.
The issue with the G.P. Def. made me read about Depth Buffers, led me to look here which might've solved one part of my problem.
But the main problem is that I don't seem to be able to run reshade as an administrator. I can't edit the .ini-file, all my reshades have weirdly resetted and even when I try to uninstall/install reshade again it just... won't let me do what I need to. And I think this is why my depth buffer access isn't working either, but I can't for the life of me figure out why.
I have spent 12hrs trying to figure this all out and I am nowhere near understanding the issue.
i thought the depth buffer just affected performance, not visuals? like doesn't it just prevent/minimize overdraw?
Okay so
A depth buffer does indeed help prevent overdraw. You can technically¹ draw the ground, a rock, and a tree behind that rock in any order and it'll basically Just Work.
Without a depth buffer, the program code itself must take care to pre-sort the ground, rock, and tree into the correct order. And that means if the viewpoint were to circle around, at some point the tree should be sorted in front of the rock instead.
You know that flickering effect when a character would almost bounce in place as an idle animation, arms in an "L" shape ready for action? You know how these characters would have completely separate meshes for each part of their body instead of using vertex deformation like they do nowadays?
Combine those two paragraphs and you'll understand why in the crook of their elbows, the forearm and upper arm would so often show Z-fighting.
If I remember correctly, the PS1 had a buffer with a depth of only one bit that merely indicated "something has been drawn here". Without any depth information. Sounds rather useless.
Of course, all the above is off the top of my head and it's 23:16 as I finish writing so take all of this with as much salt as you feel it needs.
¹: This is ignoring things like anti-aliasing and translucency. I should know from a little experiment I recently did in Project Special K.