Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Godot 4.0 support ? #18

Open
RemyCampanals opened this issue Aug 11, 2022 · 22 comments
Open

Godot 4.0 support ? #18

RemyCampanals opened this issue Aug 11, 2022 · 22 comments

Comments

@RemyCampanals
Copy link

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 :

  1. The extends Spatial now is extends Node3D, it seems simple but seems to have consequences since there's methods which are not accessible anymore.
  2. The new setget syntax has been reworked. Do know why but i had to change how you change the time of day setup (and how you change the hours, minutes and seconds variables) because you have a infinite loop. Doesn't seems to bother Godot 3.4 but 4.0 crash instantaneously.
  3. The 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).
  4. The node 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 work
  5. The Sun_Moon object which were just a DirectionalLight 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...

The Result :
image

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 :)

@Rinocrosser
Copy link

Thank you for all the reviewed issues,
Sadly this one isn't supported, it was THE BEST SKY FOR GODOT 3.

@RemyCampanals
Copy link
Author

I managed to "make it work". If you want, i can make an empty project with all the modifications i made to "make it work".

Unfornately, it seems that Godot 4 fixes the other Godot versions had with the wrong X axis (or Y, i don't remember) so... All the coordinates are wrong, the UV coordinates, the cartesians coordinates to make the UV a panoramasky, etc.
The clouds are stretched like hell and the effect is not usable for the moment.

The mathematical nature of this shader is beyond my understanding.
If someone understand how the clouds shader is made, i can make an archive with what i've done on the most recent beta version of Godot 4.

I hope we can, all together, make this shader compatible with Godot 4 because i think it's the best one.

@Lexpartizan
Copy link
Owner

Lexpartizan commented Jan 24, 2023

Please forgive me for not supporting the adaptation of this sky for Godot 4. My country has unleashed a big war in Europe and I am not able to focus on anything right now. I just can't work on Godot 4 right now because I'm going crazy.

In addition, I want to remind you that I am not the author of this shader. The math is too complicated for me there. I just added a bit of manageability or the background color and a day and night cycle to it. In fact, I only manage the background)) But I also saw this on shadertoy.

@RemyCampanals
Copy link
Author

Please forgive me for not supporting the adaptation of this sky for Godot 4. My country has unleashed a big war in Europe and I am not able to focus on anything right now. I just can't work on Godot 4 right now because I'm going crazy.

Oh you’re from Russian ?
Don’t worry i understand.

For now, the team for Godot 4.0 are making a lot of changes for shaders, so it’s best for everyone to wait until it’s « stable ». And for you to rest :)
Take care

@RemyCampanals
Copy link
Author

When i have time, i’ll upload on github a version « working a little » on Godot 4.0 so you don’t have to scratch your head on the depreacated methods ans the new ways to do things on Godot 4.0.

But i’m afraid the problem lies on the math used in the shader and how the UV is wrapped in the panorama sky, but i can be wrong (as i’m still learning shaders)

@Lexpartizan
Copy link
Owner

Thanks. I'll try to work on the shader a bit later. Let's hope that the math can't be broken and the main problems will be in the script that needs to be adapted. And at least I wrote the script myself and there is no complicated mathematics there.

Unfortunately, the rest is not so simple, I have not done anything for a year because of what is happening. I quit my job in order not to bring income to the country. One person with unlimited power and madness can bring death to hundreds of thousands and even, in the future, millions of people. And the surrounding people are either afraid to oppose, as I am afraid, or are delighted with what is happening (the absolute majority). I hope the war will end with the punishment of criminals.

@Lexpartizan
Copy link
Owner

Lexpartizan commented Jan 24, 2023

Thanks. I'll try to work on the shader a bit later. Let's hope that the math can't be broken and the main problems will be in the script that needs to be adapted. And at least I wrote the script myself and there is no complicated mathematics there.

Unfortunately, the rest is not so simple, I have not done anything for a year because of what is happening. I quit my job in order not to bring income to the country. One person with unlimited power and madness can bring death to hundreds of thousands and even, in the future, millions of people. And the surrounding people are either afraid to oppose, as I am afraid, or are delighted with what is happening (the absolute majority). I hope the war will end with the punishment of criminals.

Yes, we need to see. Sky shaders are now a separate case and use some kind of their own transformation for projection. So, maybe now you can not calculate the projection or somehow need to avoid it.

@RemyCampanals
Copy link
Author

Ok, so here we go :

The things you need to know :

  • All the setget from the gd script have to be redone entirely.
    Instead of a simple
    export (int) var clouds_resolution: int=1024 setget set_clouds_resolution
    we need to write the setget like this
@export var clouds_resolution: int = 1024:
	get:
		return clouds_resolution;
	set(value):
		clouds_resolution = value;
		set_clouds_resolution(clouds_resolution);
  • I deleted the callbacks from the set_hours, set_minutes and set_seconds and i keep the one from time_of_day_setup. It creates a infinite loop otherwise. In godot 3.4 it's not problem but it is in Godot 4.0 :(
  • Playing with the clouds_resolution and the sky_resolution seems to break the shader for unknow reason. So i let them at 1024 and 2048 respectively.
  • Only clouds2d fonction in the shaders "displays clouds" (when the settings of the quality is between 1 and 19. The clouds3d show nothing, but maybe it tries to but below the horizon.

Here's what my result on Godot 4.0 beta 14 :
Sky Shader

@RemyCampanals
Copy link
Author

RemyCampanals commented Jan 24, 2023

Thanks. I'll try to work on the shader a bit later. Let's hope that the math can't be broken and the main problems will be in the script that needs to be adapted. And at least I wrote the script myself and there is no complicated mathematics there.
Unfortunately, the rest is not so simple, I have not done anything for a year because of what is happening. I quit my job in order not to bring income to the country. One person with unlimited power and madness can bring death to hundreds of thousands and even, in the future, millions of people. And the surrounding people are either afraid to oppose, as I am afraid, or are delighted with what is happening (the absolute majority). I hope the war will end with the punishment of criminals.

Yes, we need to see. Sky shaders are now a separate case and use some kind of their own transformation for projection. So, maybe now you can not calculate the projection or somehow need to avoid it.

Yes, and i think in the future we need to use the new Sky Shader. But for now i still not try to understand how it works. Maybe the projection is calculated automaticaly.

Once again, take your time and take care of yourself. There is no emergency for making this shader works with Godot 4.0.
Thanks in advance for your time you already provide me :)

@Lexpartizan
Copy link
Owner

Thanks. I'll try to work on the shader a bit later. Let's hope that the math can't be broken and the main problems will be in the script that needs to be adapted. And at least I wrote the script myself and there is no complicated mathematics there.
Unfortunately, the rest is not so simple, I have not done anything for a year because of what is happening. I quit my job in order not to bring income to the country. One person with unlimited power and madness can bring death to hundreds of thousands and even, in the future, millions of people. And the surrounding people are either afraid to oppose, as I am afraid, or are delighted with what is happening (the absolute majority). I hope the war will end with the punishment of criminals.

Yes, we need to see. Sky shaders are now a separate case and use some kind of their own transformation for projection. So, maybe now you can not calculate the projection or somehow need to avoid it.

Yes, and i think in the future we need to use the new Sky Shader. But for now i still not try to understand how it works. Maybe the projection is calculated automaticaly.

Once again, take your time and take care of yourself. There is no emergency for making this shader works with Godot 4.0. Thanks in advance for your time you already provide me :)

image

I finally forced myself to sit down for this shader. And I already used special SKY shaders. So there is some progress. I think everything will take 2-3 weeks, because I still need to rewrite the code to the script and I constantly encounter the fact that the solutions I am used to do not work in GODOT 4.

@Lexpartizan
Copy link
Owner

Thank you for all the reviewed issues, Sadly this one isn't supported, it was THE BEST SKY FOR GODOT 3.
For GODOT 4
https://github.com/Lexpartizan/Godot_4_sky_shader

@Lexpartizan
Copy link
Owner

Thanks. I'll try to work on the shader a bit later. Let's hope that the math can't be broken and the main problems will be in the script that needs to be adapted. And at least I wrote the script myself and there is no complicated mathematics there.
Unfortunately, the rest is not so simple, I have not done anything for a year because of what is happening. I quit my job in order not to bring income to the country. One person with unlimited power and madness can bring death to hundreds of thousands and even, in the future, millions of people. And the surrounding people are either afraid to oppose, as I am afraid, or are delighted with what is happening (the absolute majority). I hope the war will end with the punishment of criminals.

Yes, we need to see. Sky shaders are now a separate case and use some kind of their own transformation for projection. So, maybe now you can not calculate the projection or somehow need to avoid it.

Yes, and i think in the future we need to use the new Sky Shader. But for now i still not try to understand how it works. Maybe the projection is calculated automaticaly.

Once again, take your time and take care of yourself. There is no emergency for making this shader works with Godot 4.0. Thanks in advance for your time you already provide me :)

https://github.com/Lexpartizan/Godot_4_sky_shader

@RemyCampanals
Copy link
Author

Wow already ?
You rock ! 👌

So excited to go home in order to test this !
Thank you in advance 🙌
And take care !

@RemyCampanals
Copy link
Author

First of all, well done and thank you !

BUT :p
image
I have no clouds in day or night and there is some glitches below the horizon.

Since you provide me a screen where everything works, maybe you didn't push the right version on github ?
(Do you prefer i create an issue in your SkyShader for Godot 4.0 github instead of here ?)

@Lexpartizan
Copy link
Owner

Lexpartizan commented Mar 10, 2023

image

check textures applaying in shader

@RemyCampanals
Copy link
Author

I just opened your project, it seems to have all the parameters set :)

But i don't understand, are you using one single image file in order to "display the moon", "the thunder" and "the noise for clouds" ?
If it's the case, i think it's better to separate. Single Responsibility Principle 😇

@Lexpartizan
Copy link
Owner

Lexpartizan commented Mar 10, 2023

I just opened your project, it seems to have all the parameters set :)

But i don't understand, are you using one single image file in order to "display the moon", "the thunder" and "the noise for clouds" ? If it's the case, i think it's better to separate. Single Responsibility Principle 😇

Give a screenshot of your scene "sky" and specify the shader parameters, please.

I just downloaded this project and opened it separately, everything is fine. Try re-importing the textures as I used the Basis Universalis settings for them.

Single Responsibility Principle
one shader - one texture. Less memory used.

@Lexpartizan
Copy link
Owner

I just opened your project, it seems to have all the parameters set :)

But i don't understand, are you using one single image file in order to "display the moon", "the thunder" and "the noise for clouds" ? If it's the case, i think it's better to separate. Single Responsibility Principle 😇

You have discord? Lexicon#0978

@RemyCampanals
Copy link
Author

I just opened your project, it seems to have all the parameters set :)
But i don't understand, are you using one single image file in order to "display the moon", "the thunder" and "the noise for clouds" ? If it's the case, i think it's better to separate. Single Responsibility Principle 😇

You have discord? Lexicon#0978

Yes i have ! I'm EmryX#7031, i added you :)

@umutbalkan
Copy link

I also downloaded the godot 4 version and opened it, it seems like clouds are beneath the horizon with some problems. Textures and parameters have set
image

@RemyCampanals
Copy link
Author

I also downloaded the godot 4 version and opened it, it seems like clouds are beneath the horizon with some problems. Textures and parameters have set
image

Are you on Nvidia card (RTX 20, 30 or 40 series) ?

@Lexpartizan
Copy link
Owner

Lexpartizan commented Apr 22, 2023

@RemyCampanals
@umutbalkan

My card is 1050. Yes, with the new nvidia graphics cards there are problems with this. I created an issue.
godotengine/godot#76343
There is no solution yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants