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

Allow to set viewport internal format #4378

Closed
dan1338 opened this issue Apr 10, 2022 · 3 comments
Closed

Allow to set viewport internal format #4378

dan1338 opened this issue Apr 10, 2022 · 3 comments

Comments

@dan1338
Copy link

dan1338 commented Apr 10, 2022

Describe the project you are working on

Multipass rendering

Describe the problem or limitation you are having in your project

The values are clipped by limited [0,255] pixel range of ViewportTexture

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Allow the user to select the internal format to be used by the viewport, afaik from reading the code ImageTexture is the only one that even takes format into account, but all I really want is for godot to create the texture with GL_FLOAT as the internal format.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Have a list of formats on a viewport object in the editor.

If this enhancement will not be used often, can it be worked around with a few lines of script?

It cannot

Is there a reason why this should be core and not an add-on in the asset library?

Becuase "It cannot"

@Calinou
Copy link
Member

Calinou commented Apr 10, 2022

Which Godot version and rendering backend are you using?

In Godot 3.x's GLES3 backend, HDR viewports are used by default (with 16 bpc precision). This affects both 2D and 3D rendering. If you need full 32 bpc precision, there's already a proposal tracking this: #2935

In Godot 4.0's Vulkan backend, 2D rendering is performed in LDR to save on resources, but 3D rendering is performed in HDR.

@dan1338
Copy link
Author

dan1338 commented Apr 10, 2022

Using 3.4.2.stable/GLES3

I'm making that assumption because I noticed that when decreasing a scaling variable in the shader by half, at some point instead of taking twice as long, the output texture just doesn't change.

My assumption is that I'm hitting a limit when the floating point numbers get quantized into integers and two adjacent passes map to the same integer therefore get stuck at that timestep.

Having the ability to use a native floating point ViewportTexture would circumvent the need to do the floating to integer conversion.

@Calinou
Copy link
Member

Calinou commented Apr 10, 2022

Duplicate of #2935.

This is now implemented in 3.x by godotengine/godot#51708 (try 3.5beta3).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants