Skip to content

fix: use textureSize instead of u_resolution for texel size in blur/sharpen shaders#13347

Open
jtydhr88 wants to merge 3 commits intomasterfrom
fix/glsl-blur-texel-size
Open

fix: use textureSize instead of u_resolution for texel size in blur/sharpen shaders#13347
jtydhr88 wants to merge 3 commits intomasterfrom
fix/glsl-blur-texel-size

Conversation

@jtydhr88
Copy link
Copy Markdown
Contributor

Preview renders at a clamped resolution (max 1024px), so u_resolution holds the preview dimensions, not the actual image dimensions. This caused blur radius and sharpen kernel offsets to scale incorrectly, producing visibly different results between preview and backend output.

Switch to textureSize(u_image0, 0) which reflects the actual input texture dimensions regardless of render target size, consistent with how Edge-Preserving Blur already handles this correctly.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1b008f21-d9e8-4d9f-b02e-0741e51bef52

📥 Commits

Reviewing files that changed from the base of the PR and between cf44161 and eccd7c1.

📒 Files selected for processing (8)
  • blueprints/.glsl/Glow_30.frag
  • blueprints/.glsl/Image_Blur_1.frag
  • blueprints/.glsl/Sharpen_23.frag
  • blueprints/.glsl/Unsharp_Mask_26.frag
  • blueprints/Glow.json
  • blueprints/Image Blur.json
  • blueprints/Sharpen.json
  • blueprints/Unsharp Mask.json
✅ Files skipped from review due to trivial changes (1)
  • blueprints/.glsl/Unsharp_Mask_26.frag
🚧 Files skipped from review as they are similar to previous changes (5)
  • blueprints/.glsl/Sharpen_23.frag
  • blueprints/.glsl/Image_Blur_1.frag
  • blueprints/Sharpen.json
  • blueprints/Image Blur.json
  • blueprints/Unsharp Mask.json

📝 Walkthrough

Walkthrough

This PR updates several fragment shaders (GLSL files and embedded shader strings in JSON blueprints) for Image Blur, Sharpen, Unsharp Mask, and Glow. Each change removes the u_resolution uniform and replaces 1.0 / u_resolution with 1.0 / vec2(textureSize(u_image0, 0)) to compute per-texel sampling offsets from the bound input texture.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: replacing u_resolution with textureSize for texel size calculations in blur/sharpen shaders.
Description check ✅ Passed The description is directly related to the changeset, explaining the motivation (preview resolution vs actual image dimensions) and the solution (switching to textureSize).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Member

@pythongosssss pythongosssss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the Glow frag also has the same issue on line 78

Comment thread blueprints/.glsl/Image_Blur_1.frag
Comment thread blueprints/.glsl/Sharpen_23.frag
Comment thread blueprints/.glsl/Unsharp_Mask_26.frag
Copy link
Copy Markdown
Member

@pythongosssss pythongosssss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

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.

3 participants