Skip to content

GL: Set backbuffer texture filter for screen reading shaders#110335

Open
KeyboardDanni wants to merge 1 commit into
godotengine:masterfrom
KeyboardDanni:gl_screen_texture_filter
Open

GL: Set backbuffer texture filter for screen reading shaders#110335
KeyboardDanni wants to merge 1 commit into
godotengine:masterfrom
KeyboardDanni:gl_screen_texture_filter

Conversation

@KeyboardDanni

@KeyboardDanni KeyboardDanni commented Sep 9, 2025

Copy link
Copy Markdown
Contributor

Fixes #106787

This PR allows texture filter and repeat hints to work on the screen and depth textures in Compatibility mode. Tested in both 2D and 3D shaders.

The old version of this PR was keeping the screen reading textures in the GeneratedCode's texture uniform list, but this led to multiple issues (wrong texture bindings, the screen texture slot appearing in the inspector). Now I'm just saving the screen texture filter to an enum stored in the GeneratedCode struct, which rendering backends are free to use how they wish.

Screen texture mipmaps seem to only work in the editor and not at runtime. As far as I'm aware this is an existing bug.

See the MRP for details.

@KeyboardDanni KeyboardDanni requested a review from a team as a code owner September 9, 2025 01:28
@KeyboardDanni KeyboardDanni marked this pull request as draft September 9, 2025 02:02
@KeyboardDanni KeyboardDanni force-pushed the gl_screen_texture_filter branch from 736a5ff to 870698c Compare September 9, 2025 17:11
@Calinou Calinou added bug topic:rendering topic:shaders cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release labels Sep 9, 2025
@Calinou Calinou added this to the 4.6 milestone Sep 9, 2025
@KeyboardDanni KeyboardDanni force-pushed the gl_screen_texture_filter branch from e1ca8b7 to a65fd8d Compare September 10, 2025 16:44
@KeyboardDanni KeyboardDanni force-pushed the gl_screen_texture_filter branch from a65fd8d to bb86772 Compare September 10, 2025 16:49
@KeyboardDanni KeyboardDanni marked this pull request as ready for review September 10, 2025 16:50
@KeyboardDanni

Copy link
Copy Markdown
Contributor Author

screentextureblur_modified.zip

Here's my hastily modified version of the MRP used to test texture repeat, viewports, and 3D shaders. Use left and right arrow keys to switch between normal and viewport scenes.

@sysl-dev

sysl-dev commented Oct 5, 2025

Copy link
Copy Markdown

Thank you for taking the time to look into this KeyboardDanni. I'm hoping your work is merged in soon!

@Repiteo Repiteo modified the milestones: 4.6, 4.x Jan 26, 2026
@Repiteo Repiteo removed the cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release label May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Screen Reading Textures ignore "nearest" filtering flag in compatibility render.

4 participants