[pr-feature][rendering][shaders] SCREEN EFFECTS page: turn off vignette, aim vignette, dark edges, overlay, lens flare, depth of field #483

Manually merged
TrustNo1 merged 1 commit from theforgotten669/Darner:screenfx-toggles into main 2026-12-05 04:51:47 +00:00
Contributor

What it changes

  • The problem on main: none; a new opt-in feature (read from the code only).

Adds a SCREEN EFFECTS page to F1 with six rows, all ON (the game's own) by default, each backed by a switch that is off by default (ported from VIda):

  • DARNER_NO_VIGNETTE, DARNER_NO_SCREEN_GRADIENT, DARNER_NO_SCREEN_OVERLAY, DARNER_NO_DOF: patch the PostFX / depth of field programs before translation, only where a program has exactly the shape looked for (darner-shader emit/postfx.rs). Stripped programs get their own cache key; every other key stays the same.
  • DARNER_NO_AIM_VIGNETTE, DARNER_NO_LENS_FLARE: patch the 1.0.2.1 executable (darner-loader vi_patch.rs). The bytes are compared first, and any other build is left alone and logged.

Rows are restart-only and are the player's own settings (players_own). README and en/zh-CN strings updated.

Contributor role (optional)

  • Fluxer ID: 1576341026832908289

How it was tested

  • Tested revision: 4da8932
  • Commands and results: cargo clippy --workspace --all-targets --locked -- -D warnings passed; cargo clippy --workspace --all-targets --all-features --locked -- -D warnings passed.
  • Changes a default: no
  • A/B result: all switches are off by default; new unit tests cover the patch finders (hand-written programs), the cache key and the menu rows.
  • Gates run on that revision: clippy gates 1 and 2. cargo test --workspace not run.
  • Gameplay: not tested in game.
  • Coverage gaps: no in-game check of any of the six effects; the exe patches only match 1.0.2.1.

Checklist

  • I ran this change in the game (not yet).
  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md (exe bytes are site signatures at per-build offsets).
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: not searched yet
  • Replaces or overlaps: not searched yet
## What it changes - The problem on main: none; a new opt-in feature (read from the code only). Adds a SCREEN EFFECTS page to F1 with six rows, all ON (the game's own) by default, each backed by a switch that is off by default (ported from VIda): - `DARNER_NO_VIGNETTE`, `DARNER_NO_SCREEN_GRADIENT`, `DARNER_NO_SCREEN_OVERLAY`, `DARNER_NO_DOF`: patch the PostFX / depth of field programs before translation, only where a program has exactly the shape looked for (`darner-shader` `emit/postfx.rs`). Stripped programs get their own cache key; every other key stays the same. - `DARNER_NO_AIM_VIGNETTE`, `DARNER_NO_LENS_FLARE`: patch the 1.0.2.1 executable (`darner-loader` `vi_patch.rs`). The bytes are compared first, and any other build is left alone and logged. Rows are restart-only and are the player's own settings (`players_own`). README and en/zh-CN strings updated. ## Contributor role (optional) - Fluxer ID: 1576341026832908289 ## How it was tested - Tested revision: 4da8932 - Commands and results: `cargo clippy --workspace --all-targets --locked -- -D warnings` passed; `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` passed. - Changes a default: no - A/B result: all switches are off by default; new unit tests cover the patch finders (hand-written programs), the cache key and the menu rows. - Gates run on that revision: clippy gates 1 and 2. `cargo test --workspace` not run. - Gameplay: not tested in game. - Coverage gaps: no in-game check of any of the six effects; the exe patches only match 1.0.2.1. ## Checklist - [X] I ran this change in the game (not yet). - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md` (exe bytes are site signatures at per-build offsets). - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [X] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: not searched yet - Replaces or overlaps: not searched yet
Six switches, all off by default (DARNER_NO_VIGNETTE, DARNER_NO_AIM_VIGNETTE,
DARNER_NO_SCREEN_GRADIENT, DARNER_NO_SCREEN_OVERLAY, DARNER_NO_LENS_FLARE,
DARNER_NO_DOF), ported from VIda, each with a row on a new F1 page.
The shader ones patch the PostFX programs before translation and key the
stripped programs on their own; the other two patch the 1.0.2.1 executable
and leave any other build alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator

Thanks for the page. Your body says the overlap search was not done yet, so here is what I found. Three of my open PRs cover some of the same effects:

Effect Your switch My switch (PR)
Vignette DARNER_NO_VIGNETTE (and DARNER_NO_AIM_VIGNETTE for the aiming / fast-moving one) DARNER_VIGNETTE=0 (#12)
Depth of field DARNER_NO_DOF DARNER_DOF=0 (#9)
Lens flare DARNER_NO_LENS_FLARE DARNER_LENS_FLARE=0 (#16, depends on #12)

Dark edges (DARNER_NO_SCREEN_GRADIENT) and the overlay (DARNER_NO_SCREEN_OVERLAY) are only in your PR.

The method differs. Mine hook the title's own code at run time (darner-hle/src/viewhook.rs, darner-gpu/src/view_fx.rs). Yours patch shaders before translation (vignette, dark edges, overlay, depth of field) and the 1.0.2.1 exe (aim vignette, lens flare). For lens flare both go through the call at +0x494dcb, so both touch the same call site.

Shared files: README.md, apps/darner/src/play.rs, apps/darner/src/run.rs, crates/darner-gpu/src/host/menu.rs. If both land, each shared effect would have two switches and two F1 rows (yours on SCREEN EFFECTS, mine on PICTURE).

Would you like to align? For example, I could close mine for the effects your page covers, or your page could reuse my switch for those rows. I have not decided; I would like to hear what you prefer, and the maintainer may have a view too.

Written with AI assistance (Claude Code).

Thanks for the page. Your body says the overlap search was not done yet, so here is what I found. Three of my open PRs cover some of the same effects: | Effect | Your switch | My switch (PR) | |---|---|---| | Vignette | `DARNER_NO_VIGNETTE` (and `DARNER_NO_AIM_VIGNETTE` for the aiming / fast-moving one) | `DARNER_VIGNETTE=0` (#12) | | Depth of field | `DARNER_NO_DOF` | `DARNER_DOF=0` (#9) | | Lens flare | `DARNER_NO_LENS_FLARE` | `DARNER_LENS_FLARE=0` (#16, depends on #12) | Dark edges (`DARNER_NO_SCREEN_GRADIENT`) and the overlay (`DARNER_NO_SCREEN_OVERLAY`) are only in your PR. The method differs. Mine hook the title's own code at run time (`darner-hle/src/viewhook.rs`, `darner-gpu/src/view_fx.rs`). Yours patch shaders before translation (vignette, dark edges, overlay, depth of field) and the 1.0.2.1 exe (aim vignette, lens flare). For lens flare both go through the call at +0x494dcb, so both touch the same call site. Shared files: `README.md`, `apps/darner/src/play.rs`, `apps/darner/src/run.rs`, `crates/darner-gpu/src/host/menu.rs`. If both land, each shared effect would have two switches and two F1 rows (yours on SCREEN EFFECTS, mine on PICTURE). Would you like to align? For example, I could close mine for the effects your page covers, or your page could reuse my switch for those rows. I have not decided; I would like to hear what you prefer, and the maintainer may have a view too. Written with AI assistance (Claude Code).
Author
Contributor

Thanks for checking @Jesper-A ! I don't have a strong opinion tbh, reading it like this, your env makes more sense here than those in this PR.
As this PR seems to contain more effects, you could close yours and I'll reuse your mean of doing? Do you have others opinions on the new screen effects too?

Thanks for checking @Jesper-A ! I don't have a strong opinion tbh, reading it like this, your env makes more sense here than those in this PR. As this PR seems to contain more effects, you could close yours and I'll reuse your mean of doing? Do you have others opinions on the new screen effects too?
Collaborator

Thanks, that works for me.

Proposal: your PR keeps the page and the extra effects (dark edges, overlay, aim vignette). For the three effects we both cover, you reuse my method (the run-time hook in darner-hle/src/viewhook.rs and darner-gpu/src/view_fx.rs) and my switch names: DARNER_DOF=0, DARNER_VIGNETTE=0, DARNER_LENS_FLARE=0.

Once #483 carries those three, I will close my PRs #9 (depth of field), #12 (vignette) and #16 (lens flare) with a link to #483, so there is no gap.

You are welcome to take the code from those branches. Cherry-pick or copy, whichever is easier for you, and credit it as you see fit. Note that #16 depends on #12.

On the new effects (aim vignette, dark edges, overlay): thanks for adding them. I have not tested them, so I have no opinion on them yet.

Written with AI assistance (Claude Code).

Thanks, that works for me. Proposal: your PR keeps the page and the extra effects (dark edges, overlay, aim vignette). For the three effects we both cover, you reuse my method (the run-time hook in `darner-hle/src/viewhook.rs` and `darner-gpu/src/view_fx.rs`) and my switch names: `DARNER_DOF=0`, `DARNER_VIGNETTE=0`, `DARNER_LENS_FLARE=0`. Once #483 carries those three, I will close my PRs #9 (depth of field), #12 (vignette) and #16 (lens flare) with a link to #483, so there is no gap. You are welcome to take the code from those branches. Cherry-pick or copy, whichever is easier for you, and credit it as you see fit. Note that #16 depends on #12. On the new effects (aim vignette, dark edges, overlay): thanks for adding them. I have not tested them, so I have no opinion on them yet. Written with AI assistance (Claude Code).
Author
Contributor

Sounds like a good plan to me!
I'll do that early morning and tag you here once done - thanks as well for your feedback and collaboration it's refreshing :)

Sounds like a good plan to me! I'll do that early morning and tag you here once done - thanks as well for your feedback and collaboration it's refreshing :)
TrustNo1 manually merged commit 6860e9bfc2 into main 2026-12-05 04:51:47 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
TrustNo1/Darner!483
No description provided.