Moving nightsky with clouds hemisphere

Handy guides on how to do things, written by users for users.

Moderators: GZDoom Developers, Raze Developers

Forum rules
Please don't start threads here asking for help. This forum is not for requesting guides, only for posting them. If you need help, the Editing forum is for you.

Moving nightsky with clouds hemisphere

Postby vedan77 » Sun Sep 26, 2021 9:21 am

Hi,

for another approach to skyboxes, here's a SkyViewpoint in a hemisphere that has a moving night sky ceiling texture.

I added seven layers of 3d sectors with scrolling floors and transparent cloud textures. The textures themselves are quite big in their dimensions, but not in their file size.

There also is a blue additive light to compliment the colors of the sky texture (which is above the cloud layers).

The code is simple, scrolling speeds can be defined easily:

Code: Select allExpand view
#include "zcommon.acs"

script "sky" OPEN { // sky
   int skyspeed_x = 2;         // x scrolling speed of sky
   int skyspeed_y = 1;         // y scrolling speed of sky
   
   int minspeed_x = 1;         // x min scrolling speed of clouds
   int minspeed_y = 1;         // y min scrolling speed of clouds
   int maxspeed_x = 4;         // x max scrolling speed of clouds
   int maxspeed_y = 4;         // y max scrolling speed of clouds
   
   int cloudspeed_x = Random(minspeed_x, maxspeed_x);
   int cloudspeed_y = Random(minspeed_y, maxspeed_y);
   
   int scroll_start = 992;      // starting sector (clouds)
   int scroll_end   = 999;      // end sector (sky)
   
   while (scroll_start <= scroll_end) {
      if (scroll_start < 999) {
         Scroll_Floor(scroll_start, cloudspeed_x, cloudspeed_y, 0);
         cloudspeed_x = Random(minspeed_x, maxspeed_x);
         cloudspeed_y = Random(minspeed_y, maxspeed_y);
         scroll_start += 1;
      } else {
         Scroll_Ceiling(scroll_start, skyspeed_x, skyspeed_y, 0);
         break;
      }
   }
}


In a wide, open area, distant clouds look pretty much 2d.

If anybody got any ideas on how to improve this, don't hesitate^^

FILE DOWNLOAD ON MEDIAFIRE

Screenshots of second demo map

Last edited by vedan77 on Sun Sep 26, 2021 3:29 pm, edited 2 times in total.
vedan77
 
Joined: 20 Aug 2021

Re: Moving nightsky with clouds hemisphere

Postby Enjay » Sun Sep 26, 2021 11:59 am

It's nice but the clouds look a bit flat/distorted to me.

Also, when running the test map I get:
Code: Select allExpand view
Runaway script "Sky" terminated
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Moving nightsky with clouds hemisphere

Postby vedan77 » Sun Sep 26, 2021 1:47 pm

Enjay wrote:It's nice but the clouds look a bit flat/distorted to me.


That's what it says in the description. Problem is, that I'd have to increase the size of the hemisphere by a nice amount. This would be no problem at all for x & y, but for z.

Then, the cloud layers could be far more higher. I'll try to work on that, but it's very tedious.

UPDATE: Added a second demo map with a bigger hemisphere, but clouds still look pretty 2d when far away.

Things to fiddle around with to customize it a little more:
- height of cloud textures
- texture scaling of cloud textures

Enjay wrote:Also, when running the test map I get:
Code: Select allExpand view
Runaway script "Sky" terminated


I inserted a "break;" for correctly ending the whlie loop, it shouldn't appear anymore.
vedan77
 
Joined: 20 Aug 2021

Re: Moving nightsky with clouds hemisphere

Postby ramon.dexter » Sun Sep 26, 2021 11:19 pm

WHile loop needs to have a Delay(tics) inside, break; is for switches.
User avatar
ramon.dexter
rudebwoy
 
Joined: 20 Oct 2015
Location: Kozolupy, Bohemia
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support


Return to Tutorials

Who is online

Users browsing this forum: No registered users and 0 guests