Skip to content

Screenshot Service Enhancements#112

Closed
PatrickJnr wants to merge 6 commits intoFacepunch:masterfrom
PatrickJnr:feature/screenshot-enhancements
Closed

Screenshot Service Enhancements#112
PatrickJnr wants to merge 6 commits intoFacepunch:masterfrom
PatrickJnr:feature/screenshot-enhancements

Conversation

@PatrickJnr
Copy link
Copy Markdown
Contributor

Screenshot Service Enhancements

This PR introduces new features to the screenshot system, enhancing format flexibility and adding UI-free capture modes.

New Commands

Command Description
screenshot_clean Take a screenshot without UI overlay
screenshot_highres_clean <w> <h> Take a high-res screenshot without UI

New ConVars

ConVar Default Description
screenshot_format PNG Output format: PNG, JPEG, or WebP
screenshot_quality 90 Quality for lossy formats (1-100)
screenshot_cursor false Include mouse cursor (Windows only)
screenshot_steam true Add screenshots to Steam library
screenshot_highres_msaa 16 MSAA level for high-res (1, 2, 4, 8, 16)

New Events

  • ScreenshotService.OnScreenshotCaptured - Static event fired after any screenshot is saved
  • ScreenshotCapturedEventArgs - Provides FilePath, Width, Height, Format, FileSize, IsHighRes

Usage Examples

Clean screenshots (no UI):

  • screenshot_clean
  • screenshot_highres_clean 3840 2160

WebP for smaller files:

  • screenshot_format WebP
  • screenshot_quality 95
  • screenshot

Custom MSAA for high-res:

  • screenshot_highres_msaa 8
  • screenshot_highres 6880 2880

Files Changed

  • ScreenshotService.cs - Core implementation with format/quality/clean capture support
  • Game.cs - Added screenshot_clean and screenshot_highres_clean commands
  • Graphics.Hooks.cs - Added SuppressUI flag for clean screenshots
  • CameraComponent.cs - Added SuppressUI check in OnCameraRenderUI

Screenshots

With and without UI

With UI Without UI
With UI Without UI

WebP 90% Quality vs 1% Quality

90% Quality 1% Quality
90% Quality 1% Quality

MSAA 1 vs 16

MSAA x1 MSAA x16
MSAA x1 MSAA x16

…apture mode

- Add multiple output formats: PNG, JPEG, WebP with quality settings
- Add screenshot_clean and screenshot_highres_clean commands for UI-free capture
- Add configurable MSAA for high-res screenshots (1-16x)
- Add Steam screenshot library integration toggle
- Add ScreenshotCapturedEventArgs and OnScreenshotCaptured event
…apture mode

- Add multiple output formats: PNG, JPEG, WebP with quality settings
- Add screenshot_clean and screenshot_highres_clean commands for UI-free capture
- Add configurable MSAA for high-res screenshots (1-16x)
- Add Steam screenshot library integration toggle
- Add ScreenshotCapturedEventArgs and OnScreenshotCaptured event
@PatrickJnr PatrickJnr force-pushed the feature/screenshot-enhancements branch from 1affd90 to 463046b Compare December 11, 2025 11:14
@handsomematt handsomematt requested a review from lolleko December 11, 2025 17:27
@handsomematt
Copy link
Copy Markdown
Member

Up to you @lolleko this is your stuff

@lolleko
Copy link
Copy Markdown
Contributor

lolleko commented Dec 12, 2025

Thanks for the PR, but I think those are too many options.
Could you please explain why you need each of them? I would prefer not to add 600 lines of code unless they provide significant value.

  • screenshot_format i think just PNG is fine, it's lossless, you can convert it to whatever you want.
  • screenshot_quality we had this before, but no one used it. I don't see why you would ever want a low quality jpeg. For the 1% that do need a low qual jpeg, they are able to take the PNG and convert it.
  • screenshot_highres_msaa again why would you ever want a lower quality image?
  • screenshot_steam makes sense
  • screenshot_clean hard no for this one. In editor you can just disable the UI via inspector. For in-game I would prefer a separate command that disables the UI layer (this should be a another PR though).
  • screenshot_cursor This seems completely unnecessary, why do you need this?

TL;DR you sold me on screenshot_steam, for the rest I would like to hear what value they add.

@xezno
Copy link
Copy Markdown
Member

xezno commented Dec 12, 2025

It would have been nice if these weren't just commands at this point, but had a place in the editor somewhere

@PatrickJnr
Copy link
Copy Markdown
Contributor Author

PatrickJnr commented Dec 12, 2025

  • screenshot_steam makes sense
  • screenshot_clean hard no for this one. In editor you can just disable the UI via inspector. For in-game I would prefer a separate command that disables the UI layer (this should be a another PR though).

I could remove the other commands and have it just screenshot_steam and I could do a PR for screenshot_clean or a keybind to turn off the UI briefly and takes the shot.

@PatrickJnr
Copy link
Copy Markdown
Contributor Author

I messed up with some stuff, I'm going to close this pr and create a new one

@PatrickJnr PatrickJnr closed this Dec 12, 2025
@PatrickJnr PatrickJnr deleted the feature/screenshot-enhancements branch December 12, 2025 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants