Files
youtube-generator/src/config/graphics-settings.ts
T
poli0981andClaude Opus 5.5 cefbbd13ee feat(editor): add DLSS 5 neural rendering, more frame generation modes and a custom LUT
Video settings:
- NVIDIA frame generation gains x6 (the multiplier was already in the list
  but offered by no vendor) and Dynamic Multi Frame Generation (DLSS 4.5).
- "Custom…" for every vendor reveals a text field (`frameGenCustom`); the
  description prints what was typed, like a custom graphics preset, and
  nothing for an empty box.
- A "DLSS 5 Neural Rendering" switch (`dlssNeuralRendering`), shown for
  NVIDIA only and printed after the DLSS mode:
  "Ultra - NVIDIA DLSS Quality + NVIDIA DLSS 5 Neural Rendering + NVIDIA
  Dynamic Multi Frame Generation". Another vendor turns it off
  (`coerceDlssNeuralRendering`: the vendor switch, applied profiles and
  templates, backup import).
- Editor store v21 -> v22 back-fills both fields.
- composeGraphicsPart's vendor half moves into small helpers.

My Rig: "Custom" is the LUT field's first suggestion (typing it works too,
any case). The rig block then prints just "LUT applied" in the output
language ("Có áp dụng LUT") instead of "LUT: Custom" — a field's
`customNoteKey`. No migration: the rig is a string map.

i18n: the new editor and description keys in all 8 locales and
_schema.json; brand names stay English. tests/engine/graphics-vendor.test.ts
also holds every vendor's options to their labels in the schema.

Docs: FEATURES (upscaler / frame-gen table, LUT Custom), TECH-SPEC (input
fields, store v22, rig block), CLAUDE.md (how to add an option).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 10:46:35 +07:00

131 lines
4.7 KiB
TypeScript

import type { GenreId } from "./genres";
/**
* The video's resolution — the uploaded file's, which is what the title badge,
* the quality tags and the description's "Video:" line name. Lowest first, so
* an index comparison tells which of two is higher.
*/
export const VIDEO_RESOLUTIONS = ["720p", "1080p", "1440p", "4K"] as const;
/**
* v1.5.0: the resolution the footage was recorded at when it was upscaled to
* {@link VIDEO_RESOLUTIONS} in the video editor (e.g. 1440p → 4K). `""` = not
* upscaled. Only a value below the video's resolution counts — the engine
* ignores any other pair (see `@engine/upscale`).
*/
export const UPSCALED_FROM_OPTIONS = ["", "720p", "1080p", "1440p"] as const;
export type UpscaledFrom = (typeof UPSCALED_FROM_OPTIONS)[number];
/** Type guard so the migration and patches can drop values from elsewhere. */
export function isUpscaledFrom(value: unknown): value is UpscaledFrom {
return typeof value === "string" && (UPSCALED_FROM_OPTIONS as readonly string[]).includes(value);
}
/**
* Graphics-quality preset ladder. Mirrors the most common in-game preset
* names across Unreal/Unity/proprietary engines. `"custom"` reveals a
* free-form text field for games whose preset names don't fit the ladder
* (e.g. "Epic", "Maximum", "Insane") — same escape-hatch pattern as the
* v0.7 difficulty `"custom"` option.
*
* Default: `"medium"` (a sensible neutral starting point for new drafts).
*/
export const GRAPHICS_PRESETS = [
"low",
"medium",
"high",
"very_high",
"cinematic",
"ultra",
"extreme",
"custom",
] as const;
export type GraphicsPreset = (typeof GRAPHICS_PRESETS)[number];
/**
* Ray-tracing modes. Multi-select — modern AAA games can ship with several
* of these layered (e.g. Path Tracing + Ray Reconstruction + Frame
* Generation). Empty array → no RT clause in the description.
*/
export const RT_MODES = ["ray_tracing", "full_rt", "path_tracing", "ray_reconstruction"] as const;
export type RTMode = (typeof RT_MODES)[number];
/**
* GPU vendor whose upscaling / frame-gen tech the creator used. Single
* vendor field on purpose — most builds run a single vendor's stack
* (NVIDIA → DLSS, AMD → FSR, Intel → XeSS). `"none"` skips the modifier
* entirely.
*/
export const FRAMEGEN_VENDORS = ["none", "nvidia", "amd", "intel"] as const;
export type FrameGenVendor = (typeof FRAMEGEN_VENDORS)[number];
/**
* Frame-generation multiplier — DLSS 4 supports up to x4 and DLSS 4.5 adds
* x6 and Dynamic Multi Frame Generation (`"dynamic"`, which picks the
* multiplier itself), FSR 3 goes up to x3, Intel XeFG is ramping up.
* `"none"` means upscaling is in use but frame generation isn't; useful for
* builds where DLSS Quality is enabled but FG was left off.
*
* v1.6.0: `"custom"` reveals a free-form text field (`frameGenCustom`),
* printed as typed — the same escape hatch as the graphics preset's, for
* modes the list doesn't name (a driver-level or third-party frame
* generator, a newer multiplier).
*/
export const FRAMEGEN_MULTIPLIERS = ["none", "x2", "x3", "x4", "x6", "dynamic", "custom"] as const;
export type FrameGenMultiplier = (typeof FRAMEGEN_MULTIPLIERS)[number];
/**
* Upscaling-quality preset across DLSS Super Resolution / FSR / XeSS.
* The actual brand name is rendered from {@link FRAMEGEN_VENDORS}; this
* enum carries the quality dimension only.
*
* v0.11 expansion: `dlaa` (NVIDIA's anti-aliasing-only mode, distinct from
* the brand-agnostic `native_aa`) and `ultra_quality` (XeSS's highest
* quality tier) joined the ladder. Vendor-aware filtering happens in the
* UI / engine via {@link getValidUpscaleQualities} — this enum stays flat.
*/
export const UPSCALE_QUALITIES = [
"none",
"native_aa",
"dlaa",
"ultra_quality",
"quality",
"balanced",
"performance",
"ultra_performance",
] as const;
export type UpscaleQuality = (typeof UPSCALE_QUALITIES)[number];
/**
* High-level visual style of the game. Optional context for viewers
* scanning the description — particularly useful for indie titles where
* "Pixel Art" or "Hand-drawn" is part of the appeal. `"none"` skips the
* art-style line.
*/
export const ART_STYLES = [
"none",
"realistic",
"stylized",
"anime",
"cel_shaded",
"low_poly",
"voxel",
"pixel_art",
"hand_drawn",
"comic",
"photorealistic",
] as const;
export type ArtStyle = (typeof ART_STYLES)[number];
/**
* Genres where in-game graphics settings are typically absent — used by
* the editor to surface a one-time "Hide graphics settings?" suggestion
* chip. The user always has the final say via the manual `skipGraphicsSettings`
* toggle; this list only seeds the hint.
*/
export const GENRES_WITHOUT_GRAPHICS_SETTINGS: readonly GenreId[] = [
"visual_novel",
"fmv",
"rhythm",
] as const;