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

Add the double datatype to the Godot shader language #11278

Open
Schkimansky opened this issue Dec 2, 2024 · 2 comments
Open

Add the double datatype to the Godot shader language #11278

Schkimansky opened this issue Dec 2, 2024 · 2 comments

Comments

@Schkimansky
Copy link

Schkimansky commented Dec 2, 2024

Describe the project you are working on

A realtime fractal zoomer (runs on the GPU).

Describe the problem or limitation you are having in your project

Floats arent precise enough for fractals.

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

Add the double datatype to godot's shading language. Maybe dvec too.

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

We could either go the normal way, To just add the double datatype to godot's shading language.
Or, We could emulate double precision instead. This would be faster, And it would have better compatibility.

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

Nope, Unless you emulate double precision yourself. But implementing double precision is a difficult and it cannot be worked around easily with a few lines of script.

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

N/A

@Schkimansky Schkimansky changed the title Add doubles to godot shading languages Add the double datatype to godot's shading language Dec 2, 2024
@Calinou Calinou changed the title Add the double datatype to godot's shading language Add the double datatype to the Godot shader language Dec 2, 2024
@Calinou
Copy link
Member

Calinou commented Dec 2, 2024

Double-precision types cause the GPU to go into a slow mode (easily 4-8× as slow), which means it's generally a bad idea to use for real-time use cases. This is the reason why rendering in precision=double builds relies on emulating double precision, and not using actual double datatypes.

@Schkimansky
Copy link
Author

Schkimansky commented Dec 2, 2024

Then maybe we could emulate double precision instead, Since doubles are slow and they dont work on some of apple devices.

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

3 participants