Zylann / godot_heightmap_plugin

HeightMap terrain for Godot implemented in GDScript
Other
1.74k stars 159 forks source link

Possible solution for heightmap and HDR on GLES2 #334

Open atirut-w opened 2 years ago

atirut-w commented 2 years ago

Is your feature request related to a problem? Please describe. As listed in the readme, one of the reasons this plugin won't work on GLES2 was HDR heightmap.

Describe the solution you'd like Assuming this extension use textures as heightmap input to the terrain shader, this might be very easy to fix.

The idea is that since you only need a single value instead of three for heightmaps, you could combine RGB into a single 24 integer and feed the shader some more additional data(max height, etc.)

Describe alternatives you've considered This idea just popped into my sleep-deprived brain randomly so none at the moment.

Additional context N/A

Zylann commented 2 years ago

I know this solution exist. The problem is, it's not the only issue. Some GLSL features won't work. Some editor tools won't work either, like the generator and some painting shaders (since the editor has to run with GLES2 as well if your project is configured as such). It would also requires to support two radically different heightmap formats, which means creating and maintaining extra versions of all shaders that use it. Eventually the plugin could fully switch to using RG8 or RGB8 instead of RH and that would work relatively fine, but that's compatibility-breaking (it will also require conversion when the collider is generated, which makes loading slower).