custom sky showing as flat + other issues

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
vAethor
Posts: 93
Joined: Wed May 10, 2017 4:10 pm

custom sky showing as flat + other issues

Post by vAethor »

Earlier today I read up on creating and importing custom flats and textures. I've made two so far and successfully imported them into GZDoom Builder, then reloaded them into Slade 3 when I imported my map WAD.

Skies aren't so simple, it looks like. I was following a Doom Builder tutorial for creating open-air sectors, claiming all you need to do is set the ceiling flat to one of the three vanilla skies (it worked for him.)

I tried doing the exact same thing with my custom sky (even made sure to be 256 x 128):
Image

But when I re-imported the map WAD back into Slade and tested it, this happened:
Image

Custom sky is in FLATS directory in the PK3 I'm making.

I tried adding code for a custom sky in ZMAPINFO here:

Code: Select all

map MAP01 "testroom1"
{
	Sky1 = "NTSKY1"
}
It stayed the same.

But then I read from browsing similar forum threads you need to name even your custom sky graphics "F_SKY," so I renamed my sky flat "F_SKY1" and changed the sky definition in ZMAPINFO to Sky1 = "F_SKY1" but all I got was a missing texture ceiling:
Image

My only thought is to rename my sky "F_SKY1" in the resource I have for it in Doom Builder, since I'm assuming the missing texture is because the map's clearly referencing a texture called NTSKY1, but that it's not registering as a sky because Doom doesn't know to do as such, since it's not called F_SKY1.

On a slightly different notw, I also notice my wall texture only appears if it's in between the P markers in the map WAD
Image
but goes missing if I move the lumps out into the main PK3.

Is there any more elegant way to store custom map textures on a more general level in my PK3?


Any thoughts would be appreciated.
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: custom sky showing as flat + other issues

Post by wildweasel »

The problem is that you're not supposed to use the sky image itself as the ceiling flat. F_SKY1 is what I'd call a "redirect flat" - it is not intended to be visible, rather, it signals Doom that instead of a ceiling flat, it should be displaying the defined sky for the map. So in this case, use F_SKY1 as the ceiling flat, and in your MAPINFO, define NTSKY1 as the map's Sky property.

As for your wall patch, if you don't need to composite it with other patches, try putting it in between TX_START/TX_END lumps to signal ZDoom that those are already complete textures. I misread your question - to have them take effect in a PK3, you'd want to put them in a folder called /textures/.
vAethor
Posts: 93
Joined: Wed May 10, 2017 4:10 pm

Re: custom sky showing as flat + other issues

Post by vAethor »

Image
Hey, it works!

Except if I freelook too far up this happens:
Image

Though I'm assuming that's something I'll have to fix myself in my image editor.
However, I recall seeing a really old example WAD where the author had what looked like a modified version of the vanilla Phobos mountains sky as a texture, layered over a smaller repeating flat representing clouds (the flat was animated, apparently using an ACS script I have yet to research.) The result looked like this:
Image

I'm thinking I may edit some of the clouds, replace the black with transparency and patch it over a smaller repeating flat of like a starfield or something, so it doesn't have that ugly cutoff when you look up too high. Bear in mind this particular set of flats, textures and sky is for a map idea I have with some of the wall textures and flats swapped out for the skybox, to give the impression of the map floating in an ethereal dreamscape (but won't be able to actually walk out there obviously, plus that's a recipe for slime trails,) so the sky will be "below" as well as above, as I've seen some other maps do.

Also, created a TEXTURES directory and put all my non-flat textures there. It works perfectly.
User avatar
Chris
Posts: 2978
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: custom sky showing as flat + other issues

Post by Chris »

There's a few ways to do a sky. The standard Doom way is to have a sky texture, then set a sector's ceiling to F_SKY1 to have the engine render that 2D texture in place of the ceiling. Doom didn't have the ability to look up and down, so the texture was "painted flat" onto the screen. When freelook was added to ZDoom, it needed to horribly stretch or tile the image vertically so it had something to show when looking up. With GZDoom, the ability to look all the way up and down means a 2D texture isn't enough, so it pastes the texture onto the inside of a cylinder and blends the top to a flat color. The software renderer then got a similar ability with color blending, to avoid the tiling or horrid stretching.

Another option is to use a skybox. This acts as a replacement to the sky texture, and is a set of 6 images that are pasted onto the inside of a cube, so it has something to show no matter where you look. Unfortunately it only works with OpenGL rendering (neither the normal software renderer, or the software poly renderer seem to support them).

The third option is a ]sky camera (confusingly also called a skybox, considering it can be any possible map geometry and not just a box/cube). This lets you define a point in the map that acts as the view of the sky. You can set up any map geometry you desire and apply any effects you want (including scrolling flats), and instead of a flat texture, cylinder, or cube, the engine will render the sky using the camera's position. This, obviously, requires defining the geometry for the sky in each map. The example wad you mention likely does this.
vAethor
Posts: 93
Joined: Wed May 10, 2017 4:10 pm

Re: custom sky showing as flat + other issues

Post by vAethor »

Chris wrote:There's a few ways to do a sky. The standard Doom way is to have a sky texture, then set a sector's ceiling to F_SKY1 to have the engine render that 2D texture in place of the ceiling. Doom didn't have the ability to look up and down, so the texture was "painted flat" onto the screen. When freelook was added to ZDoom, it needed to horribly stretch or tile the image vertically so it had something to show when looking up. With GZDoom, the ability to look all the way up and down means a 2D texture isn't enough, so it pastes the texture onto the inside of a cylinder and blends the top to a flat color. The software renderer then got a similar ability with color blending, to avoid the tiling or horrid stretching.

Another option is to use a skybox. This acts as a replacement to the sky texture, and is a set of 6 images that are pasted onto the inside of a cube, so it has something to show no matter where you look. Unfortunately it only works with OpenGL rendering (neither the normal software renderer, or the software poly renderer seem to support them).

The third option is a ]sky camera (confusingly also called a skybox, considering it can be any possible map geometry and not just a box/cube). This lets you define a point in the map that acts as the view of the sky. You can set up any map geometry you desire and apply any effects you want (including scrolling flats), and instead of a flat texture, cylinder, or cube, the engine will render the sky using the camera's position. This, obviously, requires defining the geometry for the sky in each map. The example wad you mention likely does this.
Hmm, the third option sounds promising. I'm not currently into doing true 3D since A. I like my Doom blocky and retro and feel like it just isn't Doom if it isn't faux-3D software BSP rendering (I even prefer playing at 320 x 200 when I can :P,) and B. GZDoom's latest enhancements to the software renderer (like improved freelook and somehow dynamic colored lighting...seriously dat lighting. HOW did they even?!) have sorta made OpenGL obsolete for me in what I specifically want to do, unless I am literally playing other peoples' WADs that require it, or experimenting with fancy sprite/texture filters.

Well the third sounds the most advanced, but for me currently, I'd rather keep it simple as I am a semi-beginner here (haven't played around in Slade since 2014 but haven't made a real WAD since 2009, and it was XWE lump-replacement trash.) So I guess I'll have to make do with GZDoom's software stretching until I read up on how to set up a sky camera. Any pointers to tutorials on where to get started?
User avatar
Chris
Posts: 2978
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: custom sky showing as flat + other issues

Post by Chris »

Simply create a square sector off in it's own little place in the map, texture it with whatever you want to use for the distant horizon and sky, and place a SkyViewpoint object in it (leave its TID as 0 to have it automatically replace all normal F_SKY1 flats). Just make sure the sector is tall enough and has a high enough light level to see it.

https://www.zdoom.org/zdkb/skybox.html
Locked

Return to “Editing (Archive)”