Stuck with the skybox

Ask about mapping, UDMF, using DoomBuilder/editor of choice, etc, 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.
Post Reply
imagine
Posts: 18
Joined: Sun Jun 08, 2025 6:23 pm
Operating System Version (Optional): Win11

Stuck with the skybox

Post by imagine »

Hi guys!

I'm stuck with the skybox feature. Well, that was so easy in BUILD: every ceiling could be just switched between regular / parallax mode right in build.exe. With gzDoom I have spent a couple of days, have watched a lot of videos, and still can't do such a simple thing. Please help me!

What I did:

1. Created a new resource pack named main.pk3 in SLADE.

2. Added a couple of tiles in the TEXTURE subfolder.

3. Added SKYBOX.png (256*128) there.



4. Added it to the patch table.



5. Added it to TEXTUREx.



6. Created a new entry, MAPINFO, in the root folder of main.pk3.

7. Added the following text there:

Code: Select all

map MAP01 "TestSkybox"
sky1 "SKYBOX" 0
sky2 "SKYBOX" 0
8. In Universal Doom Builder created a new map (name: MAP01.wad, type: GZDoom: Doom2 (UDMF), resources: gzdoom.pk3 and main.pk3).



9. Created a sector, set its ceiling to SKYBOX.

I expected to see it as a parallax texture, but alas, it was just a regular texture:



10. I tried it in gzDoom (F9) — the same. But! The automap shows, that the map name is TestSkybox. It means, that my MAPINFO was applied.




What I also tried to make it work:

10. Opened MAP01.wad in SLADE.

11. Added the same MAPINFO there.

12. Run it from command line:

Code: Select all

"D:\Games\GZDoom\gzdoom.exe" -iwad "" -skill "3" -file "D:\Code\Alma\gzDoomTutorial\!Skybox\main.pk3" "D:\Code\Alma\gzDoomTutorial\!Skybox\MAP01.wad"
But it didn't help either.

The only way I achieved the result is the following:

1. I had added doom2.wad to resources when creating a map.

2. Set a ceiling to F_SKY1 (it immediately starts showing as a skybox in UDB, and that is what I want also!)

3. Added a script:

Code: Select all

#include "zcommon.acs"

script "SkyMapChange" ENTER
{
  ChangeSky("SKYBOX", "SKYBOX");
} 
And then it worked as expected. It seems, that being a parallax is a property of F_SKY1. When I change its source to "SKYBOX", the property value is left unchanged, so it works.

But I don't want any references to doom2.wad, so this is not an option for me. It seems, I tried everything I can think of. I even unpacked doom2.wad and examined its content, looking for what makes SKY1 parallax, but to no avail. Please help me!

Both my MAP01.wad and main.pk3 are uploaded here, if you want to take a look.

Thank you in advance!
User avatar
Kappes Buur
 
 
Posts: 4184
Joined: Thu Jul 17, 2003 12:19 am
Graphics Processor: nVidia (Legacy GZDoom)
Location: British Columbia, Canada
Contact:

Re: Stuck with the skybox

Post by Kappes Buur »

This sky in your map is not a skybox but just a sky image.

To have a new sky image in your map MAP01.wad (UDMF), all you need to do is import the sky image with Slade3 and name it RSKY1


However, there are a few caveats you need to consider :
  • some source ports do not support PNG images
  • some source ports do not support odd sized images
  • the image must be tiled properly
GZDoom supports png and odd sizes,
for other formats convert to Graphics (Doom) and 256x128

Use a graphics app to tile the image before importing with Slade3
For example in GZDoom which has look up/down

UHH -OHH Not good

To make it work for you,
you could resize the image to 256x128 and then add a flipped image to make it 512x128
Spoiler:
then import that image with Slade3
Spoiler:
and patch it in Texture1 Editor to 512x128
Spoiler:
in GZDOOM:
Spoiler:
Last edited by Kappes Buur on Wed Jul 09, 2025 10:38 pm, edited 6 times in total.
User avatar
Enjay
 
 
Posts: 27132
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Stuck with the skybox

Post by Enjay »

Edit: I typed this before I saw Kappes Buur's reply.

In a map, putting F_SKY1 on the ceiling (or the floor for that matter) means "use the defined sky texture as a parallax sky here". So, it's essentially a marker for the sector to use a sky. It never appears itself.

So, if you have specified a texture as a sky in MAPINFO, and then put F_SKY1 on the ceiling of a sector, you should see your sky there, and it should behave appropriately. If I read your post correctly, I *think* you have got that far.

The problem seems to be that you want to free yourself from Doom2.wad resources entirely? Is that correct?

Two potential solutions: simply put a 64x64 graphic of your own making into your resources and call it F_SKY1. It doesn't matter what it looks like. It will never be seen in game.

Alternatively, you could have a Gameinfo section in your MAPINFO file and use the SkyFlatName = "<lump>" to specify the name of the flat that you want to use as your sky marker. In that case, whenever you use your flat on a ceiling, you should see the appropriate sky for the map behaving as a sky. It's just that the game will now be using the flat you specified instead of F_SKY1 to mark sky sectors.

I don't know if the attached will help, but in GZDoom it works in Doom, Doom2, Heretic, Hexen, whatever. It uses a non F_SKY1 flat to mark skies and uses a custom texture for the sky (plus some other custom textures for the walls and floor).

https://aspectsweb.co.uk/enjay/doom/exa ... kyTest.pk3

There is no scripting in this map: just a very basic map, some custom textures and a MAPINFO file. (Oh, and a music lump just so you know that what I did, doesn't break music.)

imagine
Posts: 18
Joined: Sun Jun 08, 2025 6:23 pm
Operating System Version (Optional): Win11

Re: Stuck with the skybox

Post by imagine »

Oh, I've got it!

I add the parallax texture as RSKY1, but reference it as F_SKY1. Yep, this finally works. Thank you, @Kappes Buur and @Enjay! You helped me a lot!

The next question I've just faced: what's the grey circle in the zenith? I see it with my custom sky as well as I saw it with the original DOOM sky texture.


Kappes Buur wrote: Wed Jul 09, 2025 4:20 pm
Enjay wrote: Wed Jul 09, 2025 4:31 pm
User avatar
Kappes Buur
 
 
Posts: 4184
Joined: Thu Jul 17, 2003 12:19 am
Graphics Processor: nVidia (Legacy GZDoom)
Location: British Columbia, Canada
Contact:

Re: Stuck with the skybox

Post by Kappes Buur »

imagine wrote: Wed Jul 09, 2025 5:53 pm The next question I've just faced:
what's the grey circle in the zenith? I see it with my custom sky as well as I saw it with the original DOOM sky texture.
I have no idea and don't even want to guess.
Please, provide a link to the map.
User avatar
phantombeta
Posts: 2181
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: Stuck with the skybox

Post by phantombeta »

That's just how GZDoom renders Doom-style skies. The only way to avoid it is to use a real skybox, whether a texture-based GLDEFS one, or an in-map one.
User avatar
Enjay
 
 
Posts: 27132
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Stuck with the skybox

Post by Enjay »

As phantombeta said, it's how GZDoom handles it. This wasn't an issue in the original Doom because you couldn't look up and down. So, a 128 tall texture filled the view. However, because you can look up in GZDoom, you can see areas that are higher than the top of the texture. So, GZDoom fills that area using colours based on those at the top of the sky texture.

So, yep, GZDoom does support full 360 degree skybox textures and skyboxes that you can construct in-map. Both of these allow you to look straight up and still see actual sky.


Edit:
Some side information about normal texture skies in Doom that might be of interest:

Sky textures in Doom are reversed/mirrored when displayed in game. So, if you have something in the sky with a feature that is direction-critical (e.g. writing on a building) reverse your image in a graphics editor before including it in your project.

The default Doom skies were all 256x128 pixels in size. A 256-wide image repeats 4 times across the sky. So, if you have a feature like a sun or a moon in the sky, it will be shown 4 times. A 1024-wide sky wraps perfectly and only displays once across the whole sky.
imagine
Posts: 18
Joined: Sun Jun 08, 2025 6:23 pm
Operating System Version (Optional): Win11

Re: Stuck with the skybox

Post by imagine »

phantombeta wrote: Wed Jul 09, 2025 11:09 pm That's just how GZDoom renders Doom-style skies. The only way to avoid it is to use a real skybox, whether a texture-based GLDEFS one, or an in-map one.
The GLDEFS skybox is exactly what I need. It looks lovely. Thank you!

And thank you everyone for guiding me!

I've found this video, that covers creating GLDEFS skyboxes:

imagine
Posts: 18
Joined: Sun Jun 08, 2025 6:23 pm
Operating System Version (Optional): Win11

Re: Stuck with the skybox

Post by imagine »

phantombeta wrote: Wed Jul 09, 2025 11:09 pm That's just how GZDoom renders Doom-style skies. The only way to avoid it is to use a real skybox, whether a texture-based GLDEFS one, or an in-map one.
Now I want an even better skybox )) So, my new questions are:

1. Is it possible to rotate the skybox from a script? I mean changing the SkyRotate entry of map in ZMAPINFO. In fact, my first thought when I saw “SkyRotate” was that it's speed, not just static angles. I should use a TICK script (haven't used it before) to smoothly increment the values, right?

2. Is it possible to have two GLDEFS skyboxes, one for the sky and one for clouds? Of course, if yes, I would like to rotate the second only.
imagine
Posts: 18
Joined: Sun Jun 08, 2025 6:23 pm
Operating System Version (Optional): Win11

Re: Stuck with the skybox

Post by imagine »

Well, skybox rotation can be done without scripts just by setting the second parameter in the sky definition:

Code: Select all

map MAP01 "3D Skybox Test Map"
{
	Sky1 = SkyP, 0.1 ← this
}
But still no ideas about multiple textures/skyboxes.
imagine
Posts: 18
Joined: Sun Jun 08, 2025 6:23 pm
Operating System Version (Optional): Win11

Re: Stuck with the skybox

Post by imagine »

This approach doesn't work:

GLDEFS

Code: Select all

Skybox SkyP fliptop
{
	front
	right
	back
	left
	top
	bottom
}

Skybox SkyC fliptop
{
	cfront
	cright
	cback
	cleft
	ctop
	cbottom
}
ZMAPINFO

Code: Select all

map MAP01 "3D Skybox Test Map"
{
	Sky1 = SkyC, 0.5
	Sky2 = SkyP, 0.0
	SkyRotate = 1.0, 0.0, 0.0
	DoubleSky
}
I tried swapping SkyC / SkyP, made background of the SkyC files both black (0) and transparent, nothing helped.

All 12 images are the same size (1024*1024).
User avatar
Enjay
 
 
Posts: 27132
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Stuck with the skybox

Post by Enjay »

Can you give us a bit more than "doesn't work" or "nothing helped"? There are 1001 different ways for something to "not work".
imagine
Posts: 18
Joined: Sun Jun 08, 2025 6:23 pm
Operating System Version (Optional): Win11

Re: Stuck with the skybox

Post by imagine »

Enjay wrote: Sat Jul 12, 2025 3:57 am Can you give us a bit more than "doesn't work" or "nothing helped"? There are 1001 different ways for something to "not work".
Only the first sky is visible.

Even worse, it seems that when you add DoubleSky flag to ZMAPINFO, gzDoom switches from GLDEFS skybox to the old skybox with the gray circle in zenith.

I hoped to use GLDEFS (since it's the right way to create a real skybox) and have a separate layer for clouds.
User avatar
Enjay
 
 
Posts: 27132
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Stuck with the skybox

Post by Enjay »

It's been a long time since I tried, but I'm sure I remember GLDEFs-like skyboxes not supporting a second sky for clouds (which I think is what you are looking for).

One solution that I hit on a long time ago was to construct a GLDEFS skybox (or you could make an in-map skybox with the same textures as those defined in GLDEFS), but I also made an MD3 model, put my clouds textures on the faces of the model, then made an in-map skybox that had the model placed in it and the skybox camera was placed inside the model. The model was set to be translucent and to rotate slowly. Fussy, but it worked.
Post Reply

Return to “Mapping”