Guide:Z-Fighting

From S.T.E.P. Project Wiki

A guide to reducing z-fighting (LOD flicker caused by competing planar textures) -- by torminater & S.T.E.P. Team

Updated: 18:30:29 28 April 2014 (UTC)

GUIDE FORUM THREAD



What is z-fighting?

Z-fighting describes a very complex problem which spreads across many games and many graphic cards including the two big companies nVidia and ATI. In game it shows as a very fast flickering texture. This is because the texture itself consists of different layers. If those layers cannot be strictly separated from another as it is with z-fighting you see the flickering. If your interested what it is exactly, have a look at this article: http://en.wikipedia.org/wiki/Z-fighting

Do you have z-fighting?

Before you follow the tweaks you should be sure, that your Skyrim actually has z-fighting. Before testing, copy your skyrim.ini and skyrimprefs.ini located in your Documents/My Games/skyrim folder to a separate folder and delete the originals. Now open your game via the Steam Skyrim Launcher. Choose Ultra settings. If your rig can't handle that use either the settings you used so far or pick the High/Medium/Low-setting. Preferably the maximum setting your rig can handle. Now click on Options>Advanced>View Distance>Distant Object Detail>Ultra. For testing purposes only increase Specularity Fade and Light Fade to max. Check that Object Detail Fade is unchecked. Now run Skyrim.

There are two spots where you will be able to see z-fighting definitely if it is there at all. One is when you come out of Helgen Keep (the dungeon you first go through when you start a new game. Straight ahead is a mountain range. If it is foggy or bad weather you might not recognize the z-fighting. The second spot is when you leave Dragonsreach through the main portal. Stop at the beginning of the stairs and look at the mountain side straigth ahead. It is very important that the weather condition is the following: daylight, clear, sunny. So in other words: no clouds, no fog, no precipitation. At both spots move your character and camera slowly and look out for a flicker in the mountains. If you see something like this http://www.youtube.com/watch?v=orcXIA3gnBg, you belong to the pretty large group of players who have the same problem.

You have NO z-fighting? PLEASE post your:

1: OS
2: Exact Video card model
3: Driver version
4: Video card control panel settings
5: In-game settings
6: ini tweaks
7: mods
8: dxdiag

to http://forums.bethsoft.com/topic/1336456...-fighting/ and/or http://forum.step-project.com/topic/124-black-circles-z-fighting-and-texture-shimmering The Skyrim community will thank you!

Why do you have z-fighting and others don't?

There are systems that have really big problems with z-fighting and others that have little to no problems. Why it is that way nobody can really say. There are certain hypotheses but nothing certain, which is in some way due to people who don't have z-fighting and don't reveal the details of their set-up, so others cannot find out why they have'nt got it but others have. Most certainly z-fighting has nothing to do with the power or performance of a system. The only reason why so many people with low-end rigs don't notice any z-fighting is because they have low-medium-high Distant Object Detail settings. This can eliminate z-fighting on distant objects. The down-side is that very distant mountains look very ugly. Especially for high-end rigs and players who want to improve their Skyrim experience to the absolute maximum of graphics quality that remains a big problem. If you don't belong to this group set your Distant Object Detail to whatever eliminates z-fighting at the spots mentioned above and be happy about it. If you want to minimize z-fighting and keep Skyrim's beautiful mountains you are welcome to read on.

How can I get rid of z-fighting?

Unfortunately there is no known solution which eliminates all of the z-fighting so far. It can only be reduced so much, that you barely notice it if at all. There are two ways of trying to get rid of z-fighting; the hard way and the easy way. The hard way would be figuring out what constellation of drivers, forceware options, general Skyrim settings, mods and ini-tweaks presents you with the the best result concerning your specific system. Please share your results in these threads http://forums.bethsoft.com/topic/1336456...-fighting/ and/or http://forum.step-project.com/topic/124-black-circles-z-fighting-and-texture-shimmering

The easy way: benefit from my work on this matter. I have done it the hard way, and it was indeed hard. Especially as I found out, that 99% of my work done so far was useless and luck eventually stumbled me on a very good fix.

First of all I did a complete reinstall of Skyrim 1.5.26 and didn't include a single mod in my testing. Not even the HD-DLC-pack from Bethesda itself. I will do this in the near future to find out, what else can help reduce z-fighting. Then I followed my own guideline to systematically reduce z-fighting with every step I took:

STEP 1: Driver Testing

No nVidia driver fixed z-fighting. There were some that had less z-fighting than others but even the "best" driver was still really bad. My general rule of thumb: use the newest driver available for your graphic card model. You can test the official and unofficial beta-drivers, too. If they present you with similar z-fighting, better performance and don't cause any glitches you didn't have before, stick to them. They are usually safe for use even if they aren't WHQL-certified.

STEP 2: Testing nVidia Settings

Certain settings in nVidia Control Panel and Inspector--like enable stereoscopic 3D and deactivating the effect when a game starts (Skyrim SLI Water Bug Fix)--seemed to worsen z-fighting, but since I was the only one evaluating about 40 videos which all had about the same amount of z-fighting, I cannot prove that any changes made there altered the amount or strength of z-fighting for me.

STEP 3: Checking Skyrim Launcher Profiles

I found out, that at High-setting I don't have any distant mountain flicker. Instead I had flickering on closer mountains. On Ultra settings only the distant mountains have flickering. I found the setting which caused this z-fighting and found out what it does in SkyrimPrefs.ini. The bad guy is "Distant Object Detail". Set on lower values moves the z-fighting closer to the player. On Ultra it is the furthest away. For obvious reasons I sticked to Ultra-settings.

STEP 4: Ini-Tweaking

I have tried out many many many ini-tweaks and have found a tweak combination that drastically reduced z-fighting for me. Here you can find the proof of this:

Before & After Video On YouTube:

I am very happy about my discovery and hope that many of you will be able to enjoy their skyrim a lot more.

The thing is, not everybody gets the same z-fighting or the same results when applying my fix. You can post your own rig, drivers, skyrim version and the results of my fix for you personally. I'll have a look at it and try to make an educated guess as to what you could still improve. Important for you will be, that this fix costs you some FPS. In wide-open locations like the plains of Whiterun you might experience a severe drop of FPS depending on what other mods or ini-tweaks you use. If you cannot live with that you have 3 choices:

-take the fix and cut down on other mods or tweaks
-forget the fix and live with z-fighting
-go to your skyrim Launcher - Options - Advanced - View Distance - Distant Object Detail and set it to Medium or High and live
with fugly mountains.

IMPORTANT: This fix is only approved for Skyrim Ultra-Settings from the original Skyrim Launcher. Whatever tweaks you made personally might cause problems. If you have a doubt copy your ini files to a separate folder. Then delete them from the Skyrim folder and open the Steam Skyrim Launcher. Pick Ultra-settings. Then start the game to create new .ini's. Now apply the fix(-es). After saving your ini-files make them "read-only" so your skyrim launcher cannot change any of the new values.

FIX Part 1:

Open your SkyrimPrefs.ini. Usually it should be found under %USERPROFILE%\Documents\My Games\Skyrim
Edit the indicated sections of the INI like so:

[Terrainmanager]
fBlockMaximumDistance=500000
fBlockLevel1Distance=140000
fBlockLevel0Distance=75000
fSplitDistanceMult=4.0
[MAIN]
fSkyCellRefFadeDistance=500000.0000

Save and exit

Info-Logo.png       Notice:I had a typo in my fix here before Gophers Video on Z-fighting. The value fBlockLevel1Distance was set to 1400000.0000. This actually should be 140000.0000, so divided by 10.
Warning-Logo.png       Warning:The following 'fix' can cause texture clipping on objects at certain oblique angles when right next to them (e.g., walls). The effect is clipping of all textures at right and left sides of the screen. More on this below.

Open Skyrim.ini. You can find it in the same folder you found your SkyrimPrefs.ini
Under [Display] add the following line:

fNearDistance=20.0000 ;-or 25.0000 with attention to clipping issue (see below)

Save and Exit

Info-Logo.png       Notice:The normal setting is 15.0000 (even though it's not there, the game calculates with this value). 25.0000 is the maximum approved value. To be precise: You'll get clipping and see through objects as if they were transparent if you move close to them. This CAN happen by increasing fNearDistance to ANYTHING above 15. So try out values between 15.0000 and 25.0000 to find your own sweet spot. It's up to you whether you want that issue to be sorted out or z-fighting, it's just a personal recommendation, as it helps a lot, doesn't cost performance and the side effects are negligible.
(Thanks to hlvr for this information. check out his thread here: http://forums.bethsoft.com/topic/1336456...-fighting/)

ALSO: The fNearDistance-Clipping effect is getting GREATLY increased if you use FOV(Field of View)-tweaks! Any FOV greater than 70 will increase clipping. For standard FOV fNearDistance=25.0000 works ok, you get clipping but in no problematic game ruining way, since you usually don't want to run into things. Using a bigger FOV makes the clipping effect far mor noticeable in game. The fix will still improve z-fighting-issues even though you keep fNearDistance=15.0000 or delete the line completely from your Skyrim.ini, just not as well.

(Thanks to Gopher for this information. Check out his video series here: http://www.youtube.com/playlist?list=PL8069C4B9B22A03CF&feature=plcp)

NOTE THAT: Even when using neither FOV tweaks nor fNearDistance-Tweaks there is clipping. For reference just watch a wooden bar of a roof as close as possible. The clipping IS there. BUT: the higher the values of these 2 parameters are set the worse the clipping gets. Even vanilla Sykrim has clipping. Don't blame the fix, blame the people responsible.

IMPORTANT NOTE: Unfortunately the fBlockDistance-tweaks can absolutely kill your performance if you use mods that add tons of LODs such as The Skyrim Distance Overhaul. You can still apply the fNearDistance-tweak for it doesn't cause any other problems known so far besides (of course) the "clipping" (see above). If your rig is pretty good you might actually be able to apply the fBlockDistance-settings, too. I'ld recommend you to try it out first and then decide whether your performance drop is too high or ok for you. Be aware, that your testing should be in wide open spaces like the plains of whiterun hold.

FIX Part 2 (optional and only for very good rigs):

Please do look at this thread to weigh the benefits against the problems of doing this tweak: http://forums.bethsoft.com/topic/1274926...ult-57911/

Open your Skyrim.ini. You can find it in the same folder you found your SkyrimPrefs.ini
under [General] add the following line:
uGridsToLoad=7
change uExterior Cell Buffer=36 to uExterior Cell Buffer=64
Save and exit.

You may try setting uGrids to 9 and uExterior Cell Buffer to 100, too. Test intensely before thinking about playing with those settings. It's just supposed to reduce the z-fighting whilst closing in on structures, e.g. running from Whiterun Watch tower (where your first dragon attacks) to Whiterun. The walls start flashing at some point. High uGrids help against that, but you should know what you're doing before you mess everything up.

Performance cost is too high! What else can I do?

First of all: do NOT apply the second part (uGridsToLoad) of the fix. Skip it entirely. You can try the fix on a clean Skyrim install without any mods and see if it's still too costly performance-wise. If you run a stable Skyrim config at Ultra-settings (>35 FPS recommended) you can try to change only the value of fSplitDistanceMult to something in between 2.0000 and 3.0000. You find this value in your SkyrimPrefs.ini. It makes the z-fighting less prominent. What you can try, too, is applying my fix in small steps. So instead of copy and paste, do some testing yourself.

If you find a good setup please post it here http://forum.step-project.com/topic/124-black-circles-z-fighting-and-texture-shimmering and if possible your:

1: OS
2: Exact Video card model
3: Driver version
4: Video card control panel settings
5: In-game settings
6: ini tweaks
7: mods
8: dxdiag

This would be very much appreciated by the Skyrim Community in general and the STEP community in particular!

Everybody who wants to help is welcome to do so. Try to build on the work already done on the topic of z-fighting and expand on it. Do your own research and post your interesting findings in this thread here please http://forum.step-project.com/topic/124-black-circles-z-fighting-and-texture-shimmering

Is this it? Will there be a continuation on this work?

As long as there is z-fighting in Skyrim and I am playing video games I'll work on this matter. Anything new will be added to this guide and mentioned in the Update-Section. Feel free to join the STEP community and contribute to our project!

Credits:

Thanks to Torminater for all the hard work in testing and compiling this guide.

Thanks to hlvr for his dedicated work on z-fighting (his own thread can be found here: http://forums.bethsoft.com/topic/1336456...-fighting/) and his own fNearDistance-tweak that helps a lot against z-fighting.

Thanks to the STEP community for testing a whole lot of different settings and thus providing us with a wider range of experiences.

Thanks to anybody who is working on the z-fighting issue.