Shadow Fix

Discuss almost anything about RailWorks.

Shadow Fix

Unread postby wacampbell » Fri Sep 09, 2016 2:30 pm

Here's a little graphics improvement for TS2016. Its a very unofficial replacement for the sunlight shader provided in the Railworks\dev\Shaders folder. Here's what it does:

1. Fixes a shadow bias problem that was causing light to leak through overhanging eves when you pull back a certain distance from the building:

Image


2. Enables blending on cascaded shadow maps to prevent sharp cutoffs of shadows at distance:

Image


3. Enables screen-space ambient occlusion to improve the looks of models on their shadowed side:

Image

See the readme for installation instructions. Its just one file to copy into your shaders folder.

Also, this worked OK for me, but these features must have been disabled for a reason. So your mileage may vary. Be prepared to revert back to the original shader if things don't look right.


Wayne

Download here http://www3.telus.net/wacampbell/downloads/RailworksShadowFix.zip
Wayne Campbell
wacampbell
 
Posts: 511
Joined: Tue Sep 27, 2011 12:45 pm
Location: BC, Canada

Re: Shadow Fix

Unread postby august1929 » Fri Sep 09, 2016 4:18 pm

Thanks for sharing Wayne - will try it in a few minutes. Only recently noticed (or been irritated) by the effect on buildings. Couldn't remember if it had always been like that though.

Rod
xxxx
Image
xNon partisan rail simmer
august1929
 
Posts: 319
Joined: Fri Feb 13, 2009 1:42 pm
Location: Wiltshire, UK

Re: Shadow Fix

Unread postby Bananarama » Fri Sep 09, 2016 6:41 pm

Many thanks for this, Wayne. The above issues have always bothered me.
Cheers!
Marc - 3DTrains

Image
User avatar
Bananarama
 
Posts: 2749
Joined: Sat Feb 14, 2009 1:17 am
Location: Another Planet

Re: Shadow Fix

Unread postby NStrains » Fri Sep 09, 2016 6:47 pm

Do either of you have Alpen's weather mod installed and notice that it still does this? I never paid much attention to the shadows before I did the mod but them seem to be darker and crisper than before so I'm just wondering if this is worth the download as well.
User avatar
NStrains
 
Posts: 1367
Joined: Sun Nov 15, 2015 1:31 pm
Location: VA near the "B-Line"

Re: Shadow Fix

Unread postby DrewG » Fri Sep 09, 2016 7:07 pm

You always continue to impress me Wayne. I would have no clue where to begin with doing this. Thanks a lot, this is a much welcome change!

!*cheers*!
DrewG
 
Posts: 910
Joined: Wed Jan 22, 2014 7:00 pm
Location: Ontario, Canada

Re: Shadow Fix

Unread postby Bananarama » Fri Sep 09, 2016 8:14 pm

Hi Wayne,

I discovered an issue with the shader:

Screenshot_0 Tehachapi Pass_35.20158--118.82376_12-01-03.jpg

Notice the various dark lines radiating along the surface of the crates? As you move around the scene, there's also a z-buffer issue on the surface of objects. This isn't as noticeable on darker and more complex textures (wood siding, etc.), but is still nevertheless present, even on shiny surfaces. Within a 100m radius, the scene becomes a subtle battle with moire effect coupled with z-fighting. *!sad!*
You do not have the required permissions to view the files attached to this post.
Cheers!
Marc - 3DTrains

Image
User avatar
Bananarama
 
Posts: 2749
Joined: Sat Feb 14, 2009 1:17 am
Location: Another Planet

Re: Shadow Fix

Unread postby wacampbell » Fri Sep 09, 2016 9:03 pm

Hack wrote:Notice the various dark lines radiating along the surface of the crates? As you move around the scene, there's also a z-buffer issue on the surface of objects.


I am not seeing that at all. I might see a light stripe pattern when my nose is within 1/2 a meter of a smooth wall but thats it. Beyond half a meter everything looks normal and I don't see any z-buffer issues. I guess success depends on how your PC is set up. I expected the fix might work for some and not for others. Its probably why they had all these features disabled.

For reference, I am running a GTX970, Driver Version 10.18.13.6869 on Windows 10. 4K Resolution - 3840 x 2160
Wayne Campbell
wacampbell
 
Posts: 511
Joined: Tue Sep 27, 2011 12:45 pm
Location: BC, Canada

Re: Shadow Fix

Unread postby Bananarama » Fri Sep 09, 2016 9:22 pm

No worries, I'll just have to live without it.

My specs are: Windows XP, GTX 750Ti @ 1920 x 1200. All sliders maxed, with bloom and flare disabled.
Cheers!
Marc - 3DTrains

Image
User avatar
Bananarama
 
Posts: 2749
Joined: Sat Feb 14, 2009 1:17 am
Location: Another Planet

Re: Shadow Fix

Unread postby _o_OOOO_oo-Kanawha » Sat Sep 10, 2016 1:55 pm

Interesting shader.

The scenario creation gizmo's now have shadows/lighting effects too, or am I mistaken?
Does your shader work globally?
Edwin "Kanawha"
Image
The Chessie, the train that never was ... (6000 hp Baldwin-Westinghouse steam turbine electric)
User avatar
_o_OOOO_oo-Kanawha
 
Posts: 3231
Joined: Mon Nov 14, 2011 2:12 pm

Re: Shadow Fix

Unread postby Bananarama » Sat Sep 10, 2016 1:57 pm

_o_OOOO_oo-Kanawha wrote:The scenario creation gizmo's now have shadows/lighting effects too, or am I mistaken?

The gizmos on my copy have always displayed shadows - at least most do that I'm aware.
Cheers!
Marc - 3DTrains

Image
User avatar
Bananarama
 
Posts: 2749
Joined: Sat Feb 14, 2009 1:17 am
Location: Another Planet

Re: Shadow Fix

Unread postby wacampbell » Sun Sep 11, 2016 9:18 am

For those who are experiencing the banding problem described above,here is a version of the shader that enables screen space ambient occlusion, but reverts out the shadow bias and cascade blending fixes. Its too bad we can't make those shadow fixes work for everybody, but SSAO on its own is a nice improvement if your PC has the grunt to run it.

http://www3.telus.net/wacampbell/downloads/RailworksSSAO.zip


Wayne
Wayne Campbell
wacampbell
 
Posts: 511
Joined: Tue Sep 27, 2011 12:45 pm
Location: BC, Canada


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 5 guests

cron