Skip to content
Draft
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
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ src/3rd party/luajit-2/src/host/*.exe

# compressor runtime artifacts
compressor/engine.log

# local build logs
/build_*.log
compressor/mod/
compressor/mod.db0

# emacs temp file
\#*\#
*~
*~
16 changes: 16 additions & 0 deletions gamedata/configs/mod_system_pip_tonemap.ltx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
; PiP per-scope SVP tonemapper overrides. Optional per-optic exposure control for the
; second-viewport render, pushed by zzz_extra_scope_features on aim change. Both keys default
; to 0 = inherit the main tonemap, so an optic with no entry here behaves byte-identical to stock.
;
; s3ds_middle_grey target middle-grey for the scope's own adaptation (lower = darker scope image,
; the anti-blowout lever for bright-sky / NVG / thermal optics). ~0.05-0.5.
; s3ds_adapt_speed how fast the scope re-exposes (lower = slower, holds exposure through a muzzle
; flash or a sky pan instead of snapping bright). ~1-8.
;
; Authored game-feel, not spec-sheet data. Seed conservatively per optic and tune in-game with the
; live console cvars s3ds_middle_grey / s3ds_adapt_speed before committing values here.
; Example (commented out until tuned):
;
; ![some_nvg_scope_section]
; s3ds_middle_grey = 0.18
; s3ds_adapt_speed = 3
78 changes: 78 additions & 0 deletions gamedata/configs/pip_objective_mm.ltx
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
; PiP per-scope objective clear aperture (mm), from manufacturer spec sheets.
; Feeds the true exit pupil (objective / magnification) for twilight dimming and the
; eyebox, absolute mm so it is independent of the mesh-relative scope_objective_lens_offset.w.
; Read directly by zzz_extra_scope_features (plain sections, not a dltx merge target) and
; pushed on aim change, a section-authored s3ds_objective_mm still wins

[pn23]
s3ds_objective_mm = 50

[wpn_addon_scope_pu]
s3ds_objective_mm = 22

[marchf]
s3ds_objective_mm = 42

; leupold is the Mark 8 CQBSS 1.1-8x24, the earlier 40mm came from a mismatched Mark 4 LR/T
[leupold]
s3ds_objective_mm = 24

[mark8_rmr]
s3ds_objective_mm = 24

[razorhd]
s3ds_objective_mm = 24

[march_f_shorty]
s3ds_objective_mm = 24

[march_f_shorty_alt]
s3ds_objective_mm = 24

[wpn_l96a1]
s3ds_objective_mm = 50

[wpn_l96a1m]
s3ds_objective_mm = 50

[c79]
s3ds_objective_mm = 28

[acog]
s3ds_objective_mm = 32

[1p29]
s3ds_objective_mm = 26

[usp1]
s3ds_objective_mm = 26

[ps01]
s3ds_objective_mm = 24

[pso2]
s3ds_objective_mm = 24

[pso1m21]
s3ds_objective_mm = 24

[pritseldob]
s3ds_objective_mm = 24

[vulcan]
s3ds_objective_mm = 48

[wpn_fn2000]
s3ds_objective_mm = 15

[wpn_addon_scope_po4x34]
s3ds_objective_mm = 34

[chs]
s3ds_objective_mm = 20

[wpn_remington700]
s3ds_objective_mm = 40

[wpn_m98b]
s3ds_objective_mm = 40
50 changes: 50 additions & 0 deletions gamedata/configs/text/eng/ui_mm_modded_exes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,56 @@
<text>Fog Max Travel Distance (scope_fog_travel)</text>
</string>

<!-- Picture in Picture -->
<string id="ui_mm_menu_pip">
<text>Picture in Picture</text>
</string>
<string id="ui_mm_pip_modded_exes">
<text>Picture in Picture</text>
</string>
<string id="ui_mm_modded_exes_visual_pip_r__svpscope">
<text>Picture in Picture Mode (r__svpscope)</text>
</string>
<string id="ui_mm_modded_exes_visual_pip_r__svpscope_desc">
<text>True scope rendering, a real second render of the scene through the lens. Eyepiece places the scope camera at the ocular lens, Objective at the front lens</text>
</string>
<string id="ui_mm_modded_exes_visual_pip_g_zoom_smooth">
<text>Zoom Smoothing Rate (g_zoom_smooth)</text>
</string>
<string id="ui_mm_modded_exes_visual_pip_g_zoom_smooth_desc">
<text>Lerp speed of the dynamic zoom transition, higher is faster, 0 is instant stepped</text>
</string>
<string id="ui_mm_modded_exes_visual_pip_g_zoom_analog">
<text>Analog Zoom Steps (g_zoom_analog)</text>
</string>
<string id="ui_mm_modded_exes_visual_pip_g_zoom_analog_desc">
<text>0 uses the scope's configured zoom steps, higher gives finer continuous zoom across the range</text>
</string>
<string id="ui_mm_modded_exes_visual_pip_r__svp_render_scale">
<text>Scope Render Scale [DLSS only] (r__svp_render_scale)</text>
</string>
<string id="ui_mm_modded_exes_visual_pip_r__svp_render_scale_desc">
<text>Resolution scale of the scope render, inert until DLSS upscaling is enabled, applies on video restart</text>
</string>
<string id="ui_mm_modded_exes_visual_pip_r__svp_dlss">
<text>DLSS Scope Upscaling [experimental] (r__svp_dlss)</text>
</string>
<string id="ui_mm_modded_exes_visual_pip_r__svp_dlss_desc">
<text>Experimental DLSS-SR path for the scope render, currently a passthrough stub</text>
</string>
<string id="ui_mm_modded_exes_visual_pip_r__scope_debug">
<text>Scope Debug Overlay (r__scope_debug)</text>
</string>
<string id="ui_mm_modded_exes_visual_pip_r__scope_debug_desc">
<text>Developer overlay, draws the derived eyepiece, objective and camera lenses in the world</text>
</string>
<string id="ui_mm_lst_Eyepiece">
<text>Eyepiece</text>
</string>
<string id="ui_mm_lst_Objective">
<text>Objective</text>
</string>

<!-- Particles -->
<string id="ui_mm_particles_modded_exes">
<text>Particles</text>
Expand Down
2 changes: 1 addition & 1 deletion gamedata/scripts/_imgui_groups.script
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ ImGui.Groups.Add("MenuBar")

--- Unique, renders unconditionally
ImGui.Groups.Add("Unique")
AddUniqueCall(ImGui.Groups.Unique.Render)
-- Rendered by the engine every frame (ide::OnFrame), frame safe with mt_level_call

--- Debug, provides a shared menu for tooling (inspectors, editors, etc.)
ImGui.Groups.Add("Debug")
Expand Down
64 changes: 64 additions & 0 deletions gamedata/scripts/options_modded_exes_pip.script
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
--- Picture in Picture scope options tree

-- Import smart constructors
options_builder.import_into(this)

-- a matched PiP exe registers the PiP cvars; on a non-PiP engine the controls below would read cvars that
-- do not exist and crash the menu on open. probe one PiP cvar safely (get_variable_bounds returns an empty
-- table for a missing command) and only expose the controls when the engine actually supports them
local function pip_engine_present()
local ok, b = pcall(function() return get_console():get_variable_bounds("r__svpscope") end)
return ok and b ~= nil and b.max ~= nil
end

local _full = page {
{ id = "pip" },

list_enum {
id = "r__svpscope",
content = {
"OFF",
"Eyepiece",
"Objective"
},
},
track {
id = "g_zoom_smooth",
def = 12,
min = 0,
max = 60,
step = 1,
},
track {
id = "g_zoom_analog",
def = 0,
min = 0,
max = 200,
step = 5,
},

line {},

track {
id = "r__svp_render_scale",
def = 1.0,
min = 0.4,
max = 1.0,
step = 0.05,
},
list_bool { id = "r__svp_dlss" },

line {},

track {
id = "r__scope_debug",
def = 0,
min = 0,
max = 4,
step = 1,
},

}

-- expose the controls only on a matched PiP engine; otherwise an empty page so the menu never reads the missing cvars
PAGE = pip_engine_present() and _full or page { { id = "pip" }, line {} }
2 changes: 2 additions & 0 deletions gamedata/scripts/options_modded_exes_visual.script
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local page_ui_hud = options_modded_exes_ui_hud.PAGE
local page_crosshair = options_modded_exes_crosshair.PAGE
local page_hdr10 = options_modded_exes_hdr10.PAGE
local page_3d_scopes = options_modded_exes_3d_scopes.PAGE
local page_pip = options_modded_exes_pip.PAGE
local page_particles = options_modded_exes_particles.PAGE
local page_graphics = options_modded_exes_graphics.PAGE

Expand All @@ -17,6 +18,7 @@ GROUP = group {
page_ui_hud,
page_crosshair,
page_3d_scopes,
page_pip,
page_particles,
page_hdr10,
}
Loading