Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental GL backend: Do not use larger-than-screen textures for blur buffers #674

Merged
merged 1 commit into from
Aug 24, 2021

Conversation

tryone144
Copy link
Collaborator

Blur-texture sampling has been changed to CLAMP_TO_EDGE in commit 4b0ff37 and to using the buffer textures at screen position instead of texture origin in commit 89c18af.

When using the above approach, expanding the buffer textures by the same amount as the damage region is not needed anymore, as we cannot render more than the screen region anyways. Having larger-than-screen buffer textures might lead to a slight darkening at the upper and right edges since we don't necessarily trigger the CLAMP_TO_EDGE condition in the intermediate steps. This becomes apparent when using dual-kawase at large blur-strengths with light backgrounds.

These changes do not affect the general approach of rendering a larger-than-window region with the blur to accommodate the necessary increase in damage region.

Fixes #673

Blur-texture sampling has been changed to `CLAMP_TO_EDGE` in commit
4b0ff37 and to using the buffer
textures at screen position instead of texture origin in commit
89c18af.

When using the above approach, expanding the buffer textures by the same
amount as the damage region is not needed anymore, as we cannot render
more than the screen region anyways. Having larger-than-screen buffer
textures might lead to a slight darkening at the upper and right edges
since we don't necessarily trigger the `CLAMP_TO_EDGE` condition in the
intermediate steps. This becomes apparent when using dual-kawase at large
blur-strengths with light backgrounds.

These changes do not affect the general approach of rendering a
larger-than-window region with the blur to accommodate the necessary
increase in damage region.

Related: 6d646b5
@codecov
Copy link

codecov bot commented Aug 16, 2021

Codecov Report

Merging #674 (1dbffec) into next (78e8666) will increase coverage by 0.07%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             next     #674      +/-   ##
==========================================
+ Coverage   39.39%   39.47%   +0.07%     
==========================================
  Files          46       46              
  Lines        9613     9586      -27     
==========================================
- Hits         3787     3784       -3     
+ Misses       5826     5802      -24     
Impacted Files Coverage Δ
src/backend/gl/gl_common.c 14.95% <0.00%> (+0.10%) ⬆️
src/backend/gl/gl_common.h 23.07% <ø> (ø)

@tryone144
Copy link
Collaborator Author

@yshui can you please take a look and confirm this does indeed not break the expanded blur-region logic to prevent black borders (6d646b5)?

@yshui
Copy link
Owner

yshui commented Aug 24, 2021

@yshui can you please take a look and confirm this does indeed not break the expanded blur-region logic to prevent black borders (6d646b5)?

@tryone144 I think since we are clamping to edge this will be fine?

@tryone144
Copy link
Collaborator Author

We should be fine. We are clamping to the edge of the textures, we copy a larger-than-window region as the base for blurring, and we only copy the blurred window region to the screen buffer.

I just wanted to make sure I didn't have a fundamental flaw in my understanding on how we blur and what the mentioned commit tried to achieve.

@yshui
Copy link
Owner

yshui commented Aug 24, 2021

@tryone144 Yes, your understanding is the same as mine.

@yshui
Copy link
Owner

yshui commented Aug 24, 2021

Thanks!

@yshui yshui merged commit ee7d961 into yshui:next Aug 24, 2021
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.

Unexpected inner shadow
2 participants