Scripting a Skybox Transition from Night to Day?
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
-
- Posts: 13552
- Joined: Wed Jul 16, 2003 3:52 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Germany
Scripting a Skybox Transition from Night to Day?
Okay, imagine the following situation: I have a 360° skybox mapped to a 6-sided sector cube that is meant for night-time. Now I have another 360° skybox mapped to a 6-sided sector cube that is meant for daytime. What I would like to do now is fade from one sector to the other - or actually fade from night to day. How would you guys achieve that?
-
- Posts: 2254
- Joined: Mon Jan 06, 2014 11:32 pm
Re: Scripting a Skybox Transition from Night to Day?
I'd use a combination of sets of graphics to represent a day night cycle (dawn, mid day, sunset, night) and changing light values of the map to achieve the transition. Use ChangeFloor, ChangeCeiling, SetLineTexture, and Light_ChangeToValue.
-
- Posts: 13881
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: Scripting a Skybox Transition from Night to Day?
What I would do is simply create an interior cube model, assign it to an actor that's in the same location as your skybox viewer actor, map the daytime skybox to that, put it in your nighttime skybox, and simply set its Alpha value between 0.0 and 1.0 depending on what time of day it is.
-
- Posts: 8200
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: Scripting a Skybox Transition from Night to Day?
As in an actual model? According to the wiki, you may need to make it a little more spherical, it appears. Hopefully I'm wrong.
-
- Posts: 13881
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: Scripting a Skybox Transition from Night to Day?
I don't see it saying that, at all... and in fact it shouldn't matter. Technically the existing skybox GZDoom uses is a model, anyway, if you think about it.
It's not altogether a different method than what Quake2 uses, anyhow.
It's not altogether a different method than what Quake2 uses, anyhow.
-
-
- Posts: 17937
- Joined: Fri Jul 06, 2007 3:22 pm
Re: Scripting a Skybox Transition from Night to Day?
Have you asked Nash? His Bumi stuff is pretty much exactly what you want.
-
-
- Posts: 17477
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Re: Scripting a Skybox Transition from Night to Day?
Bumi would be waaaaaaay too complicated for whatever it is Torm wants to do. :P Plus my skybox isn't as artistic as pre-rendered skyboxes. It's just the sun and moon and a bunch of flat cloud sprites.
The easiest solution was given by Rachael - put your second skybox in an inverted cube and fade that cube in and out.
The easiest solution was given by Rachael - put your second skybox in an inverted cube and fade that cube in and out.
-
- Posts: 8200
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
-
- Posts: 13552
- Joined: Wed Jul 16, 2003 3:52 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Germany
Re: Scripting a Skybox Transition from Night to Day?
Thanks for the hints to all of you, we are exactly trying that nowNash wrote:The easiest solution was given by Rachael - put your second skybox in an inverted cube and fade that cube in and out.

-
- Posts: 13552
- Joined: Wed Jul 16, 2003 3:52 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Germany
Re: Scripting a Skybox Transition from Night to Day?
Okay, still having issues: I tried it with a model skybox and with alpha but for some reason the model doesn't get affected by any alpha settings, no matter if through script or through UDMF.
-
- Posts: 13881
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: Scripting a Skybox Transition from Night to Day?
This may require a working example to diagnose.
-
- Posts: 13552
- Joined: Wed Jul 16, 2003 3:52 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Germany
Re: Scripting a Skybox Transition from Night to Day?
I found the problem myself, the rendering in UDMF needs to be tagged as "translucent", with "normal", the Alpha doesn't change anything. Unfortunately I found a different problem now: viewtopic.php?f=2&t=58608
-
- Posts: 13881
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: Scripting a Skybox Transition from Night to Day?
"Normal" not being translucent is normal, actually (pun not intended).
It's actually meant to trigger a simpler drawer set in the software renderer that bursts extremely quickly since it does not need to check the pixels underneath or do translucency math.
As for the model issue - I am sorry but that's definitely going to need an example posted.
It's actually meant to trigger a simpler drawer set in the software renderer that bursts extremely quickly since it does not need to check the pixels underneath or do translucency math.
As for the model issue - I am sorry but that's definitely going to need an example posted.
-
- Posts: 13552
- Joined: Wed Jul 16, 2003 3:52 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Germany
Re: Scripting a Skybox Transition from Night to Day?
I understand that 
No problem, I will create an example in a few minutes.

No problem, I will create an example in a few minutes.