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

Sun does not move when AtmosphericScattering is disabled #122

Open
SaulMyers opened this issue Nov 13, 2022 · 6 comments
Open

Sun does not move when AtmosphericScattering is disabled #122

SaulMyers opened this issue Nov 13, 2022 · 6 comments

Comments

@SaulMyers
Copy link

SaulMyers commented Nov 13, 2022

I've noticed that with AtmosphericScattering disabled, the sun just sits in the default position and doesn't move with the time of day. I suspect this code here is the problem but I don't know why - the 'sky->RenderSky();' call is made and this calculates the angle of the sun.

Tested in G1 and G2.

image

@lucifer602288
Copy link
Collaborator

lucifer602288 commented Nov 14, 2022

I confirm this behaviour with AtmosphericScattering disabled. And then at 12 o`clock with the most recent sun time code the sun jumps.
The sun jumps only with AtmosphericScattering disabled.

@SaulMyers
Copy link
Author

I quite like the look of the sky with atmospheric scattering turned off so I'd like to fix it, but no luck so far.

RE the sun still jumping at 12PM, I hadn't noticed that but that's also something I'd like to solve. I had some code that worked but junked it when the latest merge introduced new logic. I'll have another look at that too when I get time.

@SaulMyers
Copy link
Author

Correction, the sun does move with atmospheric scattering turned off, it's just not in sync with the light direction and is not altered by the timescale. You can see the godrays move around the sky when you turn the time scale up, but not the sun.

So it seems that I need to work out how to alter the position of the 'original' sun, as opposed to atmospheric scattering's version of the sun, which is displayed via a shader. Turning AS off seems to display the old engine's sky.

The 'old' sky includes the moon at night too, so it would be good to get this working.

@kirides if you have any input on this then please chime in. I had a look at older versions of the renderer (like X11 old) and it didn't include the option to turn AS off at all.

Changing the position of the 'original' sun might require a hook back into the old engine...?

@lucifer602288
Copy link
Collaborator

Fixed by SaiyansKing:
SaiyansKing@a91e463

@SaulMyers
Copy link
Author

Thanks for this SaiyansKing! I wish the devs I work with were this responsive 😁

Looks good so far - sun position looks right and moon appears at night which is great. But I'll continue testing and report back if I see any issues.

In the mean time I'll close this issue.

@SaulMyers SaulMyers reopened this Nov 28, 2022
@SaulMyers
Copy link
Author

No issues with this in the base game but the sun doesn't move correctly in the add-on world with atmospheric scattering disabled I'm afraid:

image

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

2 participants