Implement Smooth Shadow - #1405
Open
adfriz wants to merge 11 commits into
Open
Conversation
- 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
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. |
Contributor
Author
|
@ginga81 do you want to try this on linux? try with low resolution 512 or 1024 + far shadow 800m |
Contributor
Contributor
|
I also tried running it in OpenBVE, and I think it's absolutely fantastic and beautiful! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


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:

after:

need more test...