Skip to content

Implement Smooth Shadow - #1405

Open
adfriz wants to merge 11 commits into
leezer3:masterfrom
adfriz:smooth-shadow
Open

Implement Smooth Shadow#1405
adfriz wants to merge 11 commits into
leezer3:masterfrom
adfriz:smooth-shadow

Conversation

@adfriz

@adfriz adfriz commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Make the edge of the shadow smooth, more noticeable on low resolution shadow (512px) + far shadow range.

Using vogel disk and interleaved gradient noise.

before:
image

after:
image

need more test...

leezer3 and others added 7 commits August 28, 2026 20:52
- BaseOptions: ShadowSmooth (bool, default true) and ShadowFilterRadius (double, default 1.5) for Vogel disk soft filtering
- OptionsKey: add ShadowSmooth, ShadowFilterRadius keys
- default.frag: add uShadowSmooth/uShadowFilterRadius uniforms, SHADOW_GOLDEN_ANGLE/TWO_PI constants, interleavedGradientNoise/vogelDiskSample helpers; branch 5-tap Vogel+IGN (soft) vs 4-tap grid (sharp); auto-scaled radius
- Shader.cs: add uShadowSmooth/uShadowFilterRadius locations, SetShadowSmooth/SetShadowFilterRadius
- Shadows.cs: auto-scale effective radius by cascade count, shadow distance and resolution
- Options: save/load shadowsmooth/shadowfilterradius (clamped 0.5-3.0)
- UI: one-row Smooth shadow [x] Softness: [Low/Medium/High] (auto-disabled when shadows off or smooth off), auto-scaled radius presets 1.0/1.5/2.5
- Options: save/load shadowsmooth/shadowfilterradius/shadowfiltercascades to options_rv.cfg
- UI: tlpShadows row 6 Smooth shadow [x] [Low/Medium/High] + auto-enable logic, preset mapping, reload trigger
- Options: save/load shadowsmooth/shadowfilterradius/shadowfiltercascades to options_ov.cfg
- UI: tlpShadows row 6 Smooth shadow [x] [Low/Medium/High] + auto-enable logic, preset mapping
@adfriz

adfriz commented Aug 30, 2026

Copy link
Copy Markdown
Contributor Author

Because it use noise as the smoothness it can look a bit noticable on high radius.

This actually need some sort of denoiser to be smooth, but i think thats another time consuming task...

Temporal denoiser or TAA is what i can think of right now.

@adfriz

adfriz commented Aug 30, 2026

Copy link
Copy Markdown
Contributor Author

@ginga81 do you want to try this on linux?

try with low resolution 512 or 1024 + far shadow 800m

@ginga81

ginga81 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

I thought it was excellent!
What's more, when I set to the high resolution, I really love the way the shadow details are depicted here.
Screenshot from 2026-08-30 19-18-38
Screenshot from 2026-08-30 19-20-53

@ginga81

ginga81 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

I also tried running it in OpenBVE, and I think it's absolutely fantastic and beautiful!
I believe this issue will likely be resolved as well.
#1327
https://github.com/user-attachments/assets/81360655-22ad-402d-a299-a200a91475f7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants