feat(postfx): afegir push constants i efectes chromatic aberration + scanlines
- PostFXUniforms struct (vignette_strength, chroma_strength, scanline_strength, time) - Shader MSL actualitzat: aberració cromàtica RGB + scanlines sin-wave + vinyeta paramètrica - Pipeline postfx declara num_uniform_buffers=1 (buffer(0) en MSL) - Engine acumula temps i fa SDL_PushGPUFragmentUniformData cada frame - Valors per defecte: vignette=1.5, chroma=0, scanlines=0 (comportament idèntic a l'anterior) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -417,6 +417,9 @@ void Engine::calculateDeltaTime() {
|
||||
}
|
||||
|
||||
void Engine::update() {
|
||||
// Accumulate time for PostFX uniforms
|
||||
postfx_uniforms_.time += delta_time_;
|
||||
|
||||
// Actualizar visibilidad del cursor (auto-ocultar tras inactividad)
|
||||
Mouse::updateCursorVisibility();
|
||||
|
||||
@@ -824,6 +827,7 @@ void Engine::render() {
|
||||
SDL_BindGPUGraphicsPipeline(pass2, gpu_pipeline_->postfxPipeline());
|
||||
SDL_GPUTextureSamplerBinding scene_tsb = {offscreen_tex_->texture(), offscreen_tex_->sampler()};
|
||||
SDL_BindGPUFragmentSamplers(pass2, 0, &scene_tsb, 1);
|
||||
SDL_PushGPUFragmentUniformData(cmd, 0, &postfx_uniforms_, sizeof(PostFXUniforms));
|
||||
SDL_DrawGPUPrimitives(pass2, 3, 1, 0, 0);
|
||||
|
||||
// UI overlay (alpha-blended, uses sprite pipeline)
|
||||
|
||||
Reference in New Issue
Block a user