lexpartizan / godot_sky_shader Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Maybe implementing them like the light cookies as used in Unity
Only decal implementation found:
Screen-Space-Decals: https://github.com/Mr-Slurpy/Screen-Space-Decals
In-Engine support for decals might come with Godot 4...
The shadows probably won't have to be 100% accurate, because that's difficult to tell, but they should match with the cloud coverage
After moving the moon and sun (as mentioned in #2) I noticed the stretching in the moon (a less noticable in the sun due to the glowing)
here some resources I found
You can use https://github.com/SIsilicon/Godot-God-Rays-Plugin for inspiration or collaborate with @SIsilicon?
On my build I see a vertical blurred line in the middle of the screen. Best visible when it's "night", but also visible during "day". I guess it is a screen tearing issue, because it cuts off the clouds... But VSync on or off makes no difference. I tested your settings of default_env.tres in my own project, but that does not look like the root cause...
Sounds like this issue, but here is no fast movement necessary and it's only in the build:
https://www.nvidia.com/en-us/geforce/forums/discover/177143/screen-tearing-blurred-line-in-middle-of-screen/
I have a NVIDIA GeForce GTX 970.
I`m using sky with fog to show better view. So on the end of set_time() function script:
var fogColor = Color(light_color.r,light_color.g,light_color.b,0.1)
env.set_fog_color(fogColor)
This make a nice effect on fog! only problem is in night but i think this is a start.
Hey, i put simple color sky on scene, change cloud resolution and sky resolution then or sky go to grey completly or on run time clouds disappears.
It would be nice if all variables were exposed in the script on the root node for easier editor use. You could even use setget
to make it update in real time when values are changed. If the script has tool
at the beginning it will update in the editor as well.
Have you looked at using OpenSimplexNoise instead of a noise texture to make it easier to edit in the editor?
And finally, would it be possible to move the scene, script, and shaders into an addons
folder so it can be uploaded to the asset store? The project currently takes a little bit to set up, but it's such a great asset that I feel like it really belongs in the asset store.
I can make the sun rise and set in a semi-circle (or sine wave) across the sky, for example:
sun_pos = Vector3(-0.5,-1.0,0.0).normalized().rotated(Vector3(-1.0,-0.25,0.0).normalized(),phi)
But when I try to do that with the moon it turns out the rotated vectors:
moon_pos = Vector3(0.0,1.0,0.0).normalized().rotated(Vector3(1.0,0.0,0.0).normalized(),phi)
do not affect the moon in the same manner as the sun.
Adjusting the rotated value seems to affect the "moon phase" (full moon, half moon, etc) dynamically as it moves across the sky. Only it's not the real moon phase, though, it only resembles it somewhat. It just makes the moon become thin and disappear gradually.
Is it a bug or am I misunderstanding something? How can I fix it?
As a side note - I did delete the camera that was in the Sky scene as I could not think of a reason for it being in there. I hope it was not needed.
I opened the project in version 3.1.2.stable.mono on Ubuntu 18.04, but Player.tscn is corrupted: "unexpected end of file".
This is probably due to version mismatch of Godot...
Hello @Lexpartizan
First of all, thank you for your time and for your script. It's very good ! Second, i'm french so sorry in advance if my english is not perfect :p
I tried to make it work in Godot 4.0 for two days but couldn't. I don't have any error, but just nothing happen. The CloudlessSky shader and the Clouds shader doesn't seem to do anything for the Sprite2D inside the viewport.
Here what happened when i tried to support the scripts to Godot 4.0 :
First for the Sky.gd :
extends Spatial
now is extends Node3D
, it seems simple but seems to have consequences since there's methods which are not accessible anymore.hours
, minutes
and seconds
variables) because you have a infinite loop. Doesn't seems to bother Godot 3.4 but 4.0 crash instantaneously.lerp
method in 3.4 can lerp from a Color to another Color, not anymore. It's from a float to a float. So i found on internet how to create a lerp_color
, not sure if it works perfectly (i'm sure it doesn't).Viewport
doesn't exist anymore, now it's SubViewport
. It seems to work differently ? Maybe that's why my viewport preview seems empty and the whole sky system doesn't workDirectionalLight
is now DirectionalLight3D
and doesn't seems to extends the Spatial node. So when we change the time of day, it seems the methods look_at_from_position
does nothing. No rotation of the sun...Here the GIST :
https://gist.github.com/RemyCampanals/044fe42ed5c336780d21bc77ca67c0ac
Thanks to have taken the time to read my issue and hope we can find a solution :)
If you prefer to work on a project in the Godot 4.0 environment rather than just the file, i maybe can prepare that for you :)
This is great but after exporting android 10, there are visible problems, especially setting the variables not constantly, for instance changing the day and night by _process(delta) function
I think this is addon amazing. But only thing i will like to change is the night sky stars for me seens unnatural (aspect). There`s a easy way to change size? in some points on sky stars showing more retangular ( - ) than a dot ( . ).
Another thing what i like its a mask for color variation to show something like aurora borealis for example.
This is what i`ll try to acomplishy
Hi there!
So I've been working on putting together a small 2.5d renderer on Godot, and I've been trying to get this to work in an orthographic projection without any luck (clouds render as weird white stripes). Thing is, I'm not really that great with shader code (as I'm still learning), and if anyone here has any idea of how to fix this, I'd be pretty grateful.
Here's a comparison of how it renders in a perspective scene vs an orthographic scene:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.