postfx: scanlines analítiques amb smoothstep a l'estil crtpi, exposant forma per preset YAML
This commit is contained in:
1 parent
4dc2654a66
commit
c9e6261cf1
8 files changed
+1287
-901
No files matched your search
@@ -204,6 +204,12 @@ namespace Rendering {
|
||||
const SDL_GPUViewport VP = computeViewport(scaling_mode_, sw, sh, game_width_, game_height_);
|
||||
SDL_SetGPUViewport(pass, &VP);
|
||||
|
||||
// pixel_scale = píxels físics per fila lògica al viewport. El shader l'usa
|
||||
// per ajustar l'ample del smoothstep de scanlines a 1 píxel físic (estil crtpi).
|
||||
uniforms_.pixel_scale = (game_height_ > 0)
|
||||
? VP.h / static_cast<float>(game_height_)
|
||||
: 1.0F;
|
||||
|
||||
SDL_BindGPUGraphicsPipeline(pass, pipeline_);
|
||||
|
||||
SDL_GPUTextureSamplerBinding binding{};
|
||||
@@ -234,6 +240,9 @@ namespace Rendering {
|
||||
uniforms_.curvature = params.curvature;
|
||||
uniforms_.bleeding = params.bleeding;
|
||||
uniforms_.flicker = params.flicker;
|
||||
uniforms_.scan_dark_ratio = params.scan_dark_ratio;
|
||||
uniforms_.scan_dark_floor = params.scan_dark_floor;
|
||||
uniforms_.scan_edge_soft = params.scan_edge_soft;
|
||||
}
|
||||
|
||||
void SDL3GPUShader::setVSync(bool vsync) {
|
||||
|
||||
Reference in new issue
Block a user