godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.16k stars 97 forks source link

Expose the Filter flag and Linear Interpolation option in ViewportContainer #1467

Open vitorbalbio opened 4 years ago

vitorbalbio commented 4 years ago

Describe the project you are working on: Space Tactical RPG https://twitter.com/ZeroPointGame

Describe the problem or limitation you are having in your project: Currently ViewportContainers don't have a way to set the interpolation filter what makes it limited to 3D applications.

The usual workaround is to use TextureRects instead as a ViewportContainer but it's not a perfect replacement and there's no point in not expose this property.

On top of it pointing the TextureRect to the same Viewport that is set in the ViewportContainer you can setup their Filter flag what while not be considered a bug (They are the same texture at the end) only shows how much simpler it would be if only this property was exposed in the ViewportContainer directly.

godot windows tools 64_Pnvvcnc5gX godot windows tools 64_NJBlkXiQNs

Describe the feature / enhancement and how it helps to overcome the problem or limitation: Expose the Filter flag in the ViewportContainer would just fix this.

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams: Just a bool in the ViewportContainer inspector. ApplicationFrameHost_cgLBD1M3eH

If this enhancement will not be used often, can it be worked around with a few lines of script?: I can't be workarounded by code. It's not exposed in GDScript/C# either.

Is there a reason why this should be core and not an add-on in the asset library?: It's a Core Feature of the engine.

KoBeWi commented 4 years ago

This is likely already resolved in 4.0, because texture flags are set per each CanvasItem (so ViewportContainers too).

vitorbalbio commented 4 years ago

This is likely already resolved in 4.0, because texture flags are set per each CanvasItem (so ViewportContainers too).

That's great to know but see that every single project currently in development can't use it and many never will so a solution for the current problem is yet needed if feasible.

clayjohn commented 2 years ago

Implementation notes:

GLES3 Nearest is specified for the blit here: https://github.com/godotengine/godot/blob/677b63d7656fd0f11e224e0858fcf9479486595d/drivers/gles3/rasterizer_gles3.cpp#L302

Vulkan Sampler for blit is created here with default settings (defaults to nearest) https://github.com/godotengine/godot/blob/78193788d0e779e1471f632bae61adad4adbc078/servers/rendering/renderer_rd/renderer_compositor_rd.cpp#L148