Scripting a Skybox Transition from Night to Day?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

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!)
Post Reply
User avatar
Tormentor667
Posts: 13530
Joined: Wed Jul 16, 2003 3:52 am
Contact:

Scripting a Skybox Transition from Night to Day?

Post by Tormentor667 »

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?
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

Re: Scripting a Skybox Transition from Night to Day?

Post by Nevander »

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.
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Scripting a Skybox Transition from Night to Day?

Post by Rachael »

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.
User avatar
Major Cooke
Posts: 8170
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?

Post by Major Cooke »

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.
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Scripting a Skybox Transition from Night to Day?

Post by Rachael »

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.
Gez
 
 
Posts: 17833
Joined: Fri Jul 06, 2007 3:22 pm

Re: Scripting a Skybox Transition from Night to Day?

Post by Gez »

Have you asked Nash? His Bumi stuff is pretty much exactly what you want.
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Scripting a Skybox Transition from Night to Day?

Post by Nash »

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.
User avatar
Major Cooke
Posts: 8170
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?

Post by Major Cooke »

User avatar
Tormentor667
Posts: 13530
Joined: Wed Jul 16, 2003 3:52 am
Contact:

Re: Scripting a Skybox Transition from Night to Day?

Post by Tormentor667 »

Nash wrote:The easiest solution was given by Rachael - put your second skybox in an inverted cube and fade that cube in and out.
Thanks for the hints to all of you, we are exactly trying that now :)
User avatar
Tormentor667
Posts: 13530
Joined: Wed Jul 16, 2003 3:52 am
Contact:

Re: Scripting a Skybox Transition from Night to Day?

Post by Tormentor667 »

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.
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Scripting a Skybox Transition from Night to Day?

Post by Rachael »

This may require a working example to diagnose.
User avatar
Tormentor667
Posts: 13530
Joined: Wed Jul 16, 2003 3:52 am
Contact:

Re: Scripting a Skybox Transition from Night to Day?

Post by Tormentor667 »

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
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Scripting a Skybox Transition from Night to Day?

Post by Rachael »

"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.
User avatar
Tormentor667
Posts: 13530
Joined: Wed Jul 16, 2003 3:52 am
Contact:

Re: Scripting a Skybox Transition from Night to Day?

Post by Tormentor667 »

I understand that :)

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

Return to “Scripting”