Search code examples
doubleshaderprecisiongodot

Is there a double floating point data type in Godot shaders?


I'm trying to use shaders in Godot and I need a really precise calculation (more than float). Is it possible to have a double in Godot shaders? I searched the documentation but I found nothing...

Edit: I've made a Mandelbrot set explorer and with floats after some zooming the image gets all pixelated because the precision limit is reached, I think that with doubles I would be able to zoom further without losing quality. You can check out my code here btw


Solution

  • Godot doesn't support FP64 in shaders, since OpenGL 3.3/OpenGL ES 3.0 doesn't mandate support for them on GPUs. Doubles on the GPU are expensive and often crippled on consumer GPUs anyway, making them a bad fit for most real-time applications (especially games that need to run at high framerates).