Skip to content

Conversation

@bobtista
Copy link

@bobtista bobtista commented Nov 3, 2025

Implements GenTool-style brightness adjustment using post-processing filters instead of hardware gamma ramps. This fixes brightness control in windowed mode while maintaining fullscreen support.

Note: When testing, I was able to change brightness settings (Full screen), but screenshots look identical. I know my screen was brighter, I'm not sure how the screenshots don't show it...

Addresses #1554

Changes

Architecture

  • Replaced hardware gamma ramp approach with shader-based post-processing
  • Implemented ScreenBrightnessFilter (Pixel Shader 1.1) and ScreenBrightnessFilterFixedFunction (fallback)
  • Integrated with existing W3DShaderManager filter system

Features

  • Supports GenTool's extended range (-128 to +256)
  • Range -128 to 0: Darken
  • Range 1-128: Lift black level linearly
  • Range 129-256: Lift brightness while preserving black level (gamma adjustment)

Technical Details

  • Created W3DBrightnessFilter.h/cpp with filter implementations
  • Added brightness.pso pixel shader (Pixel Shader 1.1 assembly)
  • Wired options menu brightness slider to filter
  • Removed windowed mode restriction in W3DDisplay::setGamma()
  • Filter automatically enabled on display initialization

Testing

  • [] Brightness adjustment in windowed mode
  • Brightness adjustment in fullscreen mode
  • Various brightness values (-128, 0, +128, +256)

Backward Compatibility

  • Option.ini "Gamma" key unchanged
  • Slider range unchanged (0-100)
  • Existing settings respected
  • Old gamma ramp code preserved

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.

1 participant