Jump to content

Photo

Fix for flickering shadows. Also how to change the way shadow timesca


  • Please log in to reply
25 replies to this topic

#1
SlayingMellow

SlayingMellow

    Stranger

  • Members
  • Pip
  • 7 posts
First off I apologize if this has already been covered elsewhere on the forums but I couldn't turn up anything with quite a few search attempts. I have been really been trying to find a fix for changing the way skyrim updates shadows. Finally I came across two settings that have allowed me to fix the flickering shadow problem that is associated with the way Skyrim draws shadows. In addition the settings give you more definitive control over the intervals of time over which shadows move. These settings only work in skyrim.ini not in skyrim preferences.ini and please save a copy of your .ini before you make changes in case you want to revert back. I have not tested these settings to see how changing the games timescale effects them so ymmv if you have changed the default timescale to something else.

From the testing I have done two settings affect two variables the first variable is how often the sun's position is updated in the sky. That setting is:

fSunUpdateThreshold=

the lower this variable is the more often the sun will update its position in the sky.

The second setting is probably the most important for eliminating "flicker" and that variable seems to be responsible for the span of time over which the shadows update. That variable is:

fSunShadowUpdateTime=

the lower this setting is the quicker shadow position will update. Which means less flicker but the movement of the sun is more sudden.

for instance if you set both values to .01 shadows would appear to be generated almost real time as the suns position in the sky would by updating faster and the changes would occur almost instantly. In practice I don't feel as though this setting looks very good personally. It also is probably hard on the framerate with the shadows being constantly redrawn. By contrast higher values of both variables would result in the sun moving far less often and the movements would be drawn out over extended periods of time.


What looks good to one person is probably going to look like crap to another. So I would encourage people to play with both settings to see what they like. For me personally I prefer the shadows to remain relatively stationary for a longer period of time as constantly moving shadows seems quite odd to me. When the shadows do move I like them to update quickly but not split second as that seems jarring to me. To accomplish this I am using the following settings. Increasing the sun update threshold will give you longer spans of time between when the sun moves however the distance the sun moves per movement will be larger. This can be somewhat combated by upping the sunshadowupdate time however higher values seem to lead to flicker.

fSunShadowUpdateTime=.25
fSunUpdateThreshold=1.5

With these settings the sun moves position about once every 16 minutes of in game time. And the position updates pretty quickly with minimal flicker. You may hate my settings but please feel free to experiment to find out what works best for you. I hope this helps!

#2
ahseph

ahseph

    Journeyman

  • Members
  • Pip
  • 33 posts
Thank you SlayingMellow,

I tried several other figures that is floating around the net and found yours to be the best.

Kudos :)

#3
jim_uk

jim_uk

    There's someone watching me, I can tell.

  • Premium Member
  • 24,431 posts
Thank you, I shall give these a try.

#4
adytum

adytum

    Journeyman

  • Members
  • Pip
  • 35 posts
Just to be clear, this doesn't have anything to do with the pixelated shadows issue, right?

#5
Pixelfrog1

Pixelfrog1

    Regular

  • Members
  • PipPip
  • 56 posts

Just to be clear, this doesn't have anything to do with the pixelated shadows issue, right?


Nope that is a whole different ball game and has a lot to do with using shadowmaps and lots of dynamic lighting sources.

4 lighting sources = 4 sets of shadow maps being drawn all at the same time = lots of ugly pixelation as the shadows all fight for Z space in the buffer, you can see this effect most clearly in the Breezehome house.
The amount of lighting and shadowmap Z fighting in there just makes everything look ugly as hell. Flickering lights also produce this pixelated shadow effect . .stand near a fire indoors to see it.

Lots of dynamic/volumetric lighting sources and per pixel light and shadows works brilliantly drop per pixel lighting and per pixel shadows and use shadowmaps intead = horrible shadows.

The only advantage of shadowmaps is that they are easy on the rendering engine and programmers, personally I think that the amount of disadvantages shadowmaps have eaisly outweighs
any advantages they might get from using them.

Shadowmaps just look horrible and Skyrim clearly shows how bad they can be.

My hope is that there is a DX10 rendering system coming in a later patch that will include a per pixel shadow and lighting system, perhaps and expansion might include it.

Edited by Pixelfrog1, 27 November 2011 - 12:37 PM.


#6
adytum

adytum

    Journeyman

  • Members
  • Pip
  • 35 posts
Yeah, they look horrible. Really hoping for some kind of patch fix. I've never been too concerned about graphics, but the shadows in skyrim really bugs me.

#7
Martian1

Martian1

    Enthusiast

  • Members
  • PipPip
  • 116 posts
After some testing with fSunUpdateThreshold and fSunShadowUpdateTime I have found that a good ratio for smooth shadow updates is 20-1. Or 20 drawn shadow increments to 1 sun position update.

fSunShadowUpdateTime=20
fSunUpdateThreshold=1

I have read on other forums that the default setting for sunupdate is 0.500, so I have tested with...
fSunShadowUpdateTime=10
fSunUpdateThreshold=.5
but could see no difference in shadow movement speed or any difference in movement of the sun itself than using whole numbers like 20-1
Also I did not encounter any framerate change between default or 20-1 or the value recommended on the steampower forums which is 0-0. 0-0 is jerky.

From my estimation during testing, the position of the sun in the sky will stay matched to your in game timescale, so anyone using the timescale mod should not have any problem with the sun falling out of sync with the clock. I use timescale 5 and everything looked fine to me, shadows moved the same distance in the same timeframe no matter if I used 10-0.5, 20-1 or even 60-3.

#8
Talonvore

Talonvore

    Regular

  • Supporter
  • PipPip
  • 86 posts
I cant find either of these entries in any of my skyrim.ini files

fSunShadowUpdateTime=
fSunUpdateThreshold=

I've even used the search bar in the startup window and it cant find those lines anywhere

#9
SlayingMellow

SlayingMellow

    Stranger

  • Members
  • Pip
  • 7 posts
In case anyone else is having issues figuring out where the values need to go they should be added to the skyrim.ini file under the display section. They will not be there by default so you need to add them.

#10
Thoth42

Thoth42

    Newbie

  • Members
  • Pip
  • 16 posts
Thank you this shadow flicker didn't pop up until after I started using the 12.1 catalyst preview and the LAA 4G and reverted back to V Sync on(12.1 and it being off combined for a strange flicker all over the screen around fire) turning the v sync back on seems to have solved that without costing me any performance so :D but then I encountered this shadow flicker and maybe it was always there(doubt it) but once you see it you just can't unsee it. This fix seems to have worked for me on the High Setting of the game so thank you so much :D




Page loaded in: 1.239 seconds