Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
196 changes: 98 additions & 98 deletions .vscode/launch.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ This file describes project goals, rules, and upstream credits for anyone workin
- Treat x64 as the baseline architecture for active support while staging additional modern architectures incrementally.
- Keep credits accurate and add new attributions when incorporating upstream work.
- Localize all user-facing UI text: never introduce hardcoded display strings in GUIs/UI code when a `#str_*` lookup is possible; add/update language-table entries whenever new text is needed.
- Follow `docs/dev/ui-visual-design.md` for any menu, panel, or in-game GUI work: build from the shipped Quake 4 interface art, keep the 45-degree frame and button motif, and do not author new interface images.
- Avoid adding engine-side content files (e.g., custom material scripts) unless absolutely required for compatibility; the goal is to run with the original game assets and only openQ4 binaries (engine + game modules, plus minimal external libs).
- Any existing custom `q4base/` content is treated as an expedient bootstrap, not a long-term solution. The goal is to remove this reliance by fixing engine compatibility issues rather than shipping replacement assets.
- For investigations, reference the log file written by `logFileName` (VS Code launch uses `logs/openq4.log`), located under `fs_savepath\<gameDir>\` (e.g. `${workspaceFolder}\\.home\\baseoq4\\logs\\openq4.log`).
- For runtime validation, use mode-specific launch tasks: use the SP launch task for single-player testing and the MP launch task for multiplayer testing.
- Keep `ui_autoJoin 1` enabled for multiplayer testing so clients enter gameplay automatically. Use an explicit `+set ui_autoJoin 0` only when the test specifically targets the join menu or initial spectator/join flow; do not rely on omission because the setting is archived.
- Automated multiplayer profiles (`renderer_gameplay_benchmark.py`, `stock_asset_baseline.py`, the dedicated smokes) keep an explicit `+set ui_autoJoin 1` so clients enter gameplay without menu input. The interactive VS Code MP launch configurations instead pass `+set ui_autoJoin 0`, which is the shipped default and starts at the join screen. Always set the value explicitly; never rely on omission, because the CVar is archived.
- Do not treat main-menu startup as sufficient validation; enter in-game/map gameplay relevant to the change before concluding tests.
- For macOS testing/debugging, use the compliant Apple-hardware VM/host workflow in `docs/dev/macos-vm-testing-workflow.md` and `tools/macos/Invoke-openQ4MacOSWorkflow.ps1`. Keep macOS installer/restore-image inventory under `E:\ISO\macos\`. Do not use Windows VMware macOS unlocker/Hackintosh-style setup guides for openQ4 automation.
- Use `.tmp/` directory in repository for any temporary files required for tasks.
Expand Down
34 changes: 26 additions & 8 deletions content/baseoq4/pak0/glprogs/rvspecial_medlabs.fs
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
// Composite half of the Raven special-effect blur controller
// (SPECIAL_EFFECT_BLUR). Its parameter contract is shared with the native
// Vulkan pass in src/renderer/Vulkan/shaders/material_depth_aware_blur.frag,
// so the two backends have to read the controller the same way:
//
// parm 0-3 approachColor; rgb is the colour the blurred scene tints
// towards and a is how much of it to apply
// parm 4 effect range - the distance past the focus point over which the
// image reaches full blur, in the controller's own units
// parm 5 focus, normalized 0..1 against parm 7
// parm 6 effect strength; 0 means the controller is off, not "blur at
// some fixed default"
// parm 7 distance scale, already consumed when Depth was written
//
// Depth here is linear view distance normalized by parm 7, so the range is
// converted the same way the Vulkan pass converts it (parm 4 * 0.125) and both
// ends measure the circle of confusion against the same normalized distance.

uniform sampler2D Depth;
uniform sampler2D Blur1;
uniform float effectRange;
Expand All @@ -11,14 +29,14 @@ void main() {
float depth = texture2D( Depth, uv ).r;
vec3 blurredScene = texture2D( Blur1, uv ).rgb;

float safeRange = max( effectRange, 0.01 );
float clearBand = max( 0.015, 1.0 / ( safeRange * 6.0 ) );
float blurFactor = smoothstep( clearBand, clearBand * ( 1.5 + safeRange * 0.5 ), abs( depth - focus ) );
float tintAmount = clamp( approachPercent, 0.0, 1.0 );
float strength = clamp( approachPercent, 0.0, 1.0 );
float blurRange = max( effectRange * 0.125, 0.002 );
float circleOfConfusion = smoothstep( 0.0, 1.0,
clamp( abs( depth - clamp( focus, 0.0, 1.0 ) ) / blurRange, 0.0, 1.0 ) );
float blurAmount = circleOfConfusion * strength;

float variance = sin( ( uv.x + uv.y + scroll ) * 6.28318531 ) * 0.5 + 0.5;
vec3 overlayColor = mix( blurredScene, approachColor.rgb, tintAmount * variance );
float alpha = blurFactor * clamp( 0.6 + tintAmount * 0.4, 0.0, 1.0 );
float tintAmount = blurAmount * clamp( approachColor.a, 0.0, 1.0 ) * 0.04;
vec3 overlayColor = mix( blurredScene, approachColor.rgb, tintAmount );

gl_FragColor = vec4( overlayColor, alpha );
gl_FragColor = vec4( overlayColor, blurAmount );
}
Loading
Loading