feat(shader): Expand Gaussian blur to 13-tap wide distribution
- Update horizontal and vertical blur shaders from 9-tap to 13-tap kernel - Use Gaussian weights with sigma=3.5 for creamier 'milky' blur effect - Add test_blur_pipeline_wide_tap_distribution to verify >= 11 texture samples - Weights: [0.0152, 0.0300, 0.0525, 0.0812, 0.1110, 0.1342, 0.1432] (symmetric) Task: Phase 1, Task 3 of frosted_glass_20260313 track
This commit is contained in:
@@ -43,6 +43,23 @@ def test_blur_pipeline_compile_shaders():
|
||||
assert pipeline.h_blur_program is not None
|
||||
assert pipeline.v_blur_program is not None
|
||||
|
||||
def test_blur_pipeline_wide_tap_distribution():
|
||||
with patch("src.shader_manager.gl") as mock_gl:
|
||||
mock_gl.glCreateProgram.return_value = 100
|
||||
mock_gl.glCreateShader.return_value = 200
|
||||
mock_gl.glGetShaderiv.return_value = mock_gl.GL_TRUE
|
||||
mock_gl.glGetProgramiv.return_value = mock_gl.GL_TRUE
|
||||
from src.shader_manager import BlurPipeline
|
||||
pipeline = BlurPipeline()
|
||||
pipeline.compile_blur_shaders()
|
||||
assert mock_gl.glShaderSource.called
|
||||
shader_sources = [call.args[1] for call in mock_gl.glShaderSource.call_args_list]
|
||||
frag_sources = [s for s in shader_sources if 'texture(' in s and 'offset' in s]
|
||||
assert len(frag_sources) >= 2
|
||||
for src in frag_sources:
|
||||
texture_calls = src.count('texture(u_texture')
|
||||
assert texture_calls >= 11, f"Expected at least 11 texture samples for wide tap distribution, got {texture_calls}"
|
||||
|
||||
def test_blur_pipeline_render_deepsea_to_fbo():
|
||||
with patch("src.shader_manager.gl") as mock_gl:
|
||||
tex_counter = iter([10, 20, 30])
|
||||
|
||||
Reference in New Issue
Block a user