Skip to content

Implement Smooth Shadow and improvement - #1405

Merged
leezer3 merged 16 commits into
leezer3:masterfrom
adfriz:smooth-shadow
Sep 27, 2026
Merged

leezer3 merged 16 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...

@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

@adfriz
adfriz force-pushed the smooth-shadow branch 3 times, most recently from f020b09 to 70f7945 Compare September 14, 2026 09:22
@adfriz

adfriz commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Another fix and improvement after googling plenty of places.

@adfriz adfriz changed the title Implement Smooth Shadow Implement Smooth Shadow and imporovement Sep 16, 2026
@adfriz adfriz changed the title Implement Smooth Shadow and imporovement Implement Smooth Shadow and improvement Sep 17, 2026
@leezer3

leezer3 commented Sep 26, 2026

Copy link
Copy Markdown
Owner

Getting confusing as to what's been finished and ready for inclusion, you've got quite a few experimental branches on the go :)
Please tag me if there's something finished I've missed.

I've merged the preview PR; if you update this one with those options can get this merged.

- 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 Sep 27, 2026

Copy link
Copy Markdown
Contributor Author

@leezer3 i think this one done too.

Ready to merge

@leezer3
leezer3 merged commit ad98369 into leezer3:master Sep 27, 2026
5 checks passed
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