Shadow Blur setting

Discussion in 'General Discussion' started by MikeyRud, Aug 4, 2012.

  1. MikeyRud

    MikeyRud Registered

    Joined:
    Apr 11, 2011
    Messages:
    33
    Likes Received:
    1
    I usually have it off..

    Anyone notice a difference with the Shadow Blur graphics setting on?
     
  2. LorenzoPR

    LorenzoPR Registered

    Joined:
    Jun 17, 2012
    Messages:
    16
    Likes Received:
    0
    I would like to see some pictures with Shadow blur off and on, to better compare! :)
     
  3. MaXyM

    MaXyM Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,774
    Likes Received:
    29
    You are free to do it ;)
     
  4. Yarach

    Yarach Registered

    Joined:
    Jan 13, 2012
    Messages:
    151
    Likes Received:
    3
    I think it has to do something with the way the shadow is rendered. Normally, real time shadows are simply squares, the higher the quality, the higher the shadow's "resolution" is. Blurring is used to smooth outh those "squares".
     
  5. blakboks

    blakboks Registered

    Joined:
    Oct 20, 2010
    Messages:
    843
    Likes Received:
    30
    I'd wondered this for some time, myself. I'd always thought it was a feature that hadn't been hooked up yet. So, I did some tests:

    First of all calling it "Shadow Blur" is severely misleading. It leads me to think it's this sort of effect:
    [​IMG]
    (Shadow blurring based on distance)

    When in fact it's MUCH less significant. All it does is smooth the edges of the shadows a little bit. The differences are almost imperceptible. I can really only notice it when flipping back and forth between static images. I imagine if I made a videos with it turned off/on, it would be almost entirely imperceptible--even if run side-by-side. So, if anyone from ISI is reading this, please rename it from "Shadow Blur" to "Shadow Smoothing"--the latter seems much more appropriate and accurate--and let's get some proper blurring.

    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]

    View attachment 3434 View attachment 3435 View attachment 3436 View attachment 3437
     
  6. MaXyM

    MaXyM Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,774
    Likes Received:
    29
    Since shadow blur was a feature available in rF1, I'm curious any one has problems to identify it.
    But with cascade shadow map used in rf2, we get a lot better quality for blurs near camera. So blurring/smoothing is not as well noticeable as in rf1.
     
  7. Gearjammer

    Gearjammer Registered

    Joined:
    Jun 11, 2012
    Messages:
    1,823
    Likes Received:
    24
    I think the most appropriate term to use would be soft shadows where the shadows are less defined with hard lines when turned on. This is the way that it is termed in graphics programs that I use and it seems appropriate. The process sets an area at the edge of the shadow that would be "smoothed" or more accurately blurred to allow a smoother transition from dark to light. The light source would be what defines how far from the edge the smoothing takes place. The sun would have more blur and a headlight would have fairly hard shadow borders.
     
  8. MaXyM

    MaXyM Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,774
    Likes Received:
    29
    yep, but it is not the reason why this feature exists. Soft shadows is completely different cup of tea.
     
  9. Gearjammer

    Gearjammer Registered

    Joined:
    Jun 11, 2012
    Messages:
    1,823
    Likes Received:
    24
    Then I misunderstand the purpose of the shadow blur. What is shadow blur trying to accomplish?
     
  10. MikeyRud

    MikeyRud Registered

    Joined:
    Apr 11, 2011
    Messages:
    33
    Likes Received:
    1
    That is kind of what I thought all it was.

    Thanks so much for the replies all!

    Blakboks; wow great pics showing the diferrence :)
     
  11. K Szczech

    K Szczech Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,720
    Likes Received:
    45
    Shadows are generated using shadowmaps - these are basically textures and textures have pixels :)

    To make these pixels less apparent, shadow blur is used. Screens posted by blakbox can't show the difference, because they were made from a distance.

    Here's a comparison on Croft circuit, which has pretty precise shadow settings (I'll explain that later).

    [​IMG]

    Shadow blur is enabled on the right side. As you can see it acts like antialiasing for shadow texture's pixels. The price you pay for it is precision, because if it's blurry, it's less accurate.

    While in most cases high precision is not needed, thin surfaces like car's rear wing may require accurate shadows.
    Look at top images - unblurred shadow, despite being made of pixels is capable of squeezing it's edge inside car's rear wing edge. That's because shadow pixels size is more less the same as wing's thickness. There's still some light bleeding on the upper part of rear wing, but less than with blurred shadows.

    When you blur that edge it will become less accurate - some light will be visible on one side, and some shadow will pop on the other side.
    While light bleeding will only occur near thin objects, shadow bleeding will occur on all lit surfaces and is therefore a bigger issue. To solve it, blurred shadows need to be "pushed" a bit more down light's path. This will increase light bleeding, but prevent shadow bleeding.
    Here's and example from Brianza (note that shadows were pushed a lot more than needed) :

    [​IMG]

    This kind of gap prevents any shadow bleeding, but of course is excessive in this example.

    I've noticed ISI tracks use this excessive shadow offset and therefore you're safe to use shadow blur there. You may expect these gaps to decrease in future updates of these tracks, but I don't think ISI will release full update of a track just for this reason, so we need to wait.

    Croft's shadow settings are on the edge of what's safe with unblurred shadows, giving us best precision we can get. With blurred shadow, these precise settings are a bit too much and Croft suffers slight artifacts on lit surfaces.


    One more interesting thing is that while on smooth surfaces you will see the difference clearily, more rough textures make shadow pixels less apparent:

    [​IMG]

    You can clearily see the difference on car, but much less on the road texture.


    Personally I have shadow blur disabled (the only option I have disabled, actually). The only place where I'm ever close enough to object to see these pixels is my cockpit. Doesn't make enought difference to be worth eating up cycles on my GPU :)


    In general - disabling shadow blur allows for better precision, which some tracks may use (in this case - Croft).
    Enabling it will soften shadow edges, but at cost of some precision. It will not cause any problems on most tracks, except for those configured for maximum precision.
    ISI's tracks are currently configured well below possible precision, so enabling shadow blur will cause no problems on these.

    I guess ISI wanted to stay on the safe side with their tracks if future builds wll bring changes to shadows. Otherwise they would have to release updates to all their tracks with new build in such case.
     
    Last edited by a moderator: Aug 9, 2012
    2 people like this.
  12. Gearjammer

    Gearjammer Registered

    Joined:
    Jun 11, 2012
    Messages:
    1,823
    Likes Received:
    24
    Thank you for that explanation, I understand now. I had thought that ISI was using real time shadows rather than a texture, but I guess I was wrong. See my background coming into this conversation is from 3ds Max and Photoshop so my perception of what was being done was completely wrong, lol.

    BTW, awesome response, I have not seen anyone be so thorough with an explanation in the past on forums. Good job :)

    Thinking more on this I just want to make sure I have things right in my head. The shadow is basically a mask that gets shifted to simulate the suns movement, correct?
     
  13. K Szczech

    K Szczech Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,720
    Likes Received:
    45
    No, that texture is just a buffer - it's being updated in realtime.

    Technique used in rF2 is the most common used in nowadays games for open environments.

    Imagine a texture, covering let's say 5x5 meters of space. This texture travels with camera and game engine is rendering "a view from the Sun" into this texture. So we have information about what Sun can see and what it can't see at given moment. This information is then used when lighting is performed on actual scene.
    Then there's another texture - the same resolution but it covers 10x10 meters of space around camera. So, bigger area but less precision. Next texture covers 25x25 meters, next one 70x70 meters, then 200x200 meters, 600x600 and finally 2000x2000.
    Of course these distances are just an example. On maximum shadow detail settings rF2 wil use 7 such textures covering larger areas each.

    Here's an example of one shadowmap texture:



    So as you can see it's realtime - as scene is being animated shadowmap changes in realtime.

    Shadowmaps are not attached to objects - they follow camera and are being constantly updated with camera's surroundings.
     
    Last edited by a moderator: Aug 9, 2012

Share This Page