Page 1 of 1

Moving nightsky with clouds hemisphere

Posted: Sun Sep 26, 2021 9:21 am
by vedan77
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 all

#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


Re: Moving nightsky with clouds hemisphere

Posted: Sun Sep 26, 2021 11:59 am
by Enjay
It's nice but the clouds look a bit flat/distorted to me.

Also, when running the test map I get:

Code: Select all

Runaway script "Sky" terminated

Re: Moving nightsky with clouds hemisphere

Posted: Sun Sep 26, 2021 1:47 pm
by vedan77
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 all

Runaway script "Sky" terminated
I inserted a "break;" for correctly ending the whlie loop, it shouldn't appear anymore.

Re: Moving nightsky with clouds hemisphere

Posted: Sun Sep 26, 2021 11:19 pm
by ramon.dexter
WHile loop needs to have a Delay(tics) inside, break; is for switches.