Skip to content

Commit

Permalink
Add docs for floating window shadow configuration and remove under sp…
Browse files Browse the repository at this point in the history
…ecified variables
  • Loading branch information
Kethku committed Nov 7, 2023
1 parent 74cc5c2 commit 62974e5
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
4 changes: 0 additions & 4 deletions src/renderer/mod.rs
Expand Up @@ -49,8 +49,6 @@ pub struct RendererSettings {
floating_z_height: f32,
light_angle_degrees: f32,
light_radius: f32,
shadow_ambient: f32,
shadow_spot: f32,
debug_renderer: bool,
profiler: bool,
underline_automatic_scaling: bool,
Expand All @@ -69,8 +67,6 @@ impl Default for RendererSettings {
floating_z_height: 10.,
light_angle_degrees: 45.,
light_radius: 5.,
shadow_ambient: 0.03,
shadow_spot: 0.35,
debug_renderer: false,
profiler: false,
underline_automatic_scaling: false,
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/rendered_window.rs
Expand Up @@ -305,8 +305,8 @@ impl RenderedWindow {
Point3::new(0., -light_angle_radians.sin(), light_angle_radians.cos()),
// This is roughly equal to the apparent radius of the light .
5.,
Color::from_argb((settings.shadow_ambient * 255.) as u8, 0, 0, 0),
Color::from_argb((settings.shadow_spot * 255.) as u8, 0, 0, 0),
Color::from_argb((0.03 * 255.) as u8, 0, 0, 0),
Color::from_argb((0.35 * 255.) as u8, 0, 0, 0),
// Directional Light flag is necessary to make the shadow render consistently
// across varius sizes of floating windows. It effects how the light direction is
// processed.
Expand Down
28 changes: 28 additions & 0 deletions website/docs/configuration.md
Expand Up @@ -199,6 +199,34 @@ vim.g.neovide_floating_blur_amount_y = 2.0
Setting `g:neovide_floating_blur_amount_x` and `g:neovide_floating_blur_amount_y` controls the blur
radius on the respective axis for floating windows.

#### Floating Shadow

VimScript:

```vim
let g:neovide_floating_shadow = v:true
let g:neovide_floating_z_height = 10
let g:neovide_light_angle_degrees = 45
let g:neovide_light_radius = 5
```

Lua:

```lua
vim.g.neovide_floating_shadow = v:true
vim.g.neovide_floating_z_height = 10
vim.g.neovide_light_angle_degrees = 45
vim.g.neovide_light_radius = 5
```

**Available since 0.12.**

Setting `g:neovide_floating_shadow` to false will disable the shadow borders for floating windows.
The other variables configure the shadow in various ways:
- `g:neovide_floating_z_height` sets the virtual height of the floating window from the ground plane

Check failure on line 226 in website/docs/configuration.md

View workflow job for this annotation

GitHub Actions / Lint website

Lists should be surrounded by blank lines [Context: "- `g:neovide_floating_z_height..."]

Check failure on line 226 in website/docs/configuration.md

View workflow job for this annotation

GitHub Actions / Lint website

Lists should be surrounded by blank lines [Context: "- `g:neovide_floating_z_height..."]
- `g:neovide_light_angle_degrees` sets the angle from the screen normal of the casting light
- `g:neovide_light_radius` sets the radius of the casting light

#### Transparency

VimScript:
Expand Down

0 comments on commit 62974e5

Please sign in to comment.