We started discussing procedural Sky Shader for Godot on IRC.
Idea is to create at least basic one for starters.
Some refs:
https://threejs.org/examples/webgl_shaders_sky.html
https://docs.blender.org/manual/en/dev/render/cycles/nodes/types/textures/sky.html
http://blog.camposanto.com/post/112703721804/this-blog-post-is-an-in-detail-explanation-of-part
https://blenderartists.org/forum/showthread.php?245954-preethams-sky-impementation-HDR
Papers:
http://www.cs.utah.edu/~shirley/papers/sunsky/sunsky.pdf
http://cgg.mff.cuni.cz/projects/SkylightModelling/HosekWilkie_SkylightModel_SIGGRAPH2012_Preprint_lowres.pdf
http://cgg.mff.cuni.cz/projects/SkylightModelling/
Fire watch talk from GDC - useful insights how procedural skies and gradient fog was used:
https://youtu.be/ZYnS3kKTcGg?t=452
This topic is also related to - #8060
I think there is an asset-driven part (because where are the clouds? where is the sun? where is the moon and stars and planets?), so we should look at what the engine itself lacks for them to be created easily.
@Zylann
This is one of many pieces you refer too :) It's first step.
Sun will be part of SkyShader (at least visual part) you will be able to control it's inclination and azimuth with Uniform shader params, so you then can connect it by script with DirectionalLamp.
Although I plan to make SunLamp node which will have DirectionalLamp node that will be easy to connect with SkyShader. This is sooo common task, that this type of node will be good to have as part of the engine. Something similar for fog might be needed, not sure.
Clouds, stars, moon/planets will be added also but later :P
here's another one, for reference: https://github.com/Tw1ddle/Sky-Particles-Shader
You have custom particle code and asset lib anybody should be able to
contribute
On May 6, 2017 4:46 PM, "Nuno Donato" notifications@github.com wrote:
here's another one, for reference: https://github.com/Tw1ddle/
Sky-Particles-Shader—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/godotengine/godot/issues/8668#issuecomment-299648151,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AF-Z2-1-KVz1mVX0sR6emVP36Kbi180Xks5r3JXsgaJpZM4NStJG
.
@reduz
Yup.
Initially I plan it as Asset Lib. When I will have something, we can discuss if or what we should or shouldn't move as default Godot toolset.
I'm open for discussion :)
I'm not sure what's the status of this issue. We have procedural shader for the skybox in 3.0, is it solved then?
I think the sky isn't a procedural shader though. Isn't it entirely generated on CPU? There is no way to make our own as well (using a shader as generation process).
For skies with moving objects like sun and clouds while not affected by fog etc it's a bit wider issue though.
Isn't this obsoleted by #17510?
The procedural sky just calculates the skytexture on the CPU. The thing to keep in mind is that it's not enough to just render the background with a shader like many engines do. You need to calculate the full 360 degree map from which Godot generates radiance maps to be able to do all the PBR lighting and such. That is a lot of overhead to do real time for each frame. You can get away with it when just rendering the sky color and sun as the sun generally doesn't move so you can recalculate once a minute or something like that, but if you want to add clouds that are animated you need to do add the clouds later on with some other technique.
@bojidar-bg is correct, the issues for making it work are fixed though there were more fixes, the last ones are in #19029, I don't know if that made it into the latest 3.0.3 RC yet but it has been cherry picked.
With that PR in place you can see it in action with with this project: https://github.com/BastiaanOlij/godot-sky-asset/tree/use_proxy_fix
(I'll be merging that branch once 3.0.3 is released and submitting a new version to the asset library)
The shader itself could use a few improvements, it's getting the horizon wrong, but it shows how to do this all on the GPU
Owh and note that this: #19030 would be a worthwhile improvement so things work more automatic.
Closing as per the above comment, since it is already possible to make procedural skies.
Most helpful comment
I think the sky isn't a procedural shader though. Isn't it entirely generated on CPU? There is no way to make our own as well (using a shader as generation process).
For skies with moving objects like sun and clouds while not affected by fog etc it's a bit wider issue though.