Open iuripugliero opened 1 year ago
While Godot 4's Compatibility rendering method supports sky shaders (which means it's feasible to implement with GLES3), I doubt anyone has time to backport such a large feature to 3.x.
Let me add my voice to this request: I have a project that can't be upgraded to 4 (it's completely unknown when the bugs around animation/IK will be fixed that cause the project to break entirely), and I need sky shaders because they perform better than a mesh dome solution.
I think a lot of the implementation in the compatibility renderer can be directly copied to the GLES3 rendering in 3.x. GLES2 will be a lot more challenging, but could also be feasible. If someone really needs this in 3.x, it should be possible for them to copy it and get something working.
It could likely be exposed with a new sky type, MaterialSky, to complement the existing ProceduralSky and PanoramicSky
Describe the project you are working on
I don't think this is a per-project feature.
Describe the problem or limitation you are having in your project
Godot 3 procedural sky is beautiful, but the fact the engine do not expose control over it, sky changes and atmospheric control like weather are limited to mesh domes. If we could use a material generated texture as background, it whould really bypass those limitations. Since I have little experience with the engine source I really don't know if the sky shader type can run on godot 3 rendering. I noticed in Godot 4 the sky receives a material on RS while Godot 3 receives only a texture on VS.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
So I decided to take the initial steps and created a new ShaderSky resource class which contains a spatial material (used spatial because of testing the get_texture function). It simply pick the albedo texture of material and throws on background. Using a noise generated texture: Using a panorama texture: Reflections (don't know if it's relevant):
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
If Godot 4 sky shader mode can be backported to 3, then the sky material whould simply output it on the background texture. It is already working like this (however for now it lacks the material changed signal to update the sky, but the update queue is already implemented), but I doubt it would be performance wise (readed somewhere that sky shader mode only updates some frames, not all of them).
If I get a green sign about the shader compatibility, then I will dig deeper into this, since it's really relevant to me.
If this enhancement will not be used often, can it be worked around with a few lines of script?
Unfortunately Godot 3 do not expose sky direct to user, so no.
Is there a reason why this should be core and not an add-on in the asset library?
Mesh domes are awful.