Jump to content

TIP: Line portals and F_SKY1 gotcha


smeghammer

Recommended Posts

I've recently been playing with line portals (type 1, so I could use different z-values for each side) and I found a reproducible bug where a visual artefact is created. I posted this issue - with the fix - here. I thought I'd share as a little tip in case it is useful to anyone.

 

test map

 

I learned a while back about the trick of leaving linedefs un-textured when adjacent to a sky flat so the sky extends down to the bottom of the linedef. This is useful for horizons etc. So, I have a map that uses this trick to show sky behind a wall:

 

linedef_sky.png?raw=true 

 

Note this is also showing a sector portal above me (top left grey roof) so the sky is actually two stacked sectors. 

 

Behind me is a linedef portal into an impossibly large room:

 

line_portal_in.png?raw=true

 

Now, this is all good until I go through the portal and look back out. When I do, I see the texture that is on the 'spacer' portal (ceiling and wall) rather than the SKY texture rendered, but only where it is 'background' linedef with no texture.

 

So the 'spacer' textures are being rendered where there is no 'background' (i.e. through the portal) texture. The actual ceiling sky is unaffected:

 

line_portal_out_bug.png?raw=true

 

So what we are seeing here is the texture and flats assigned to the 'spacer' sector 'behind' the linedef portal (bottom right block, red square to the left):

editor_textured.png?raw=true

 

The fix was actually very simple - I set the spacer sector flats to SKY and removed the linedef textures:

 

portal_spacer_untextured.png?raw=true

 

  

And this rendered fine when playing.  I am *probably* still seeing the 'spacer' texture, but as it is SKY and attached untextured linedefs, you cannot see any artefact:

line_portal_out_fixed.png?raw=true

 

 

I hope this is of use to someone.

Edited by smeghammer
added download link

Share this post


Link to post

Dunno what @Graf Zahl would think of that. It kinda looks like undefined behavior. There are other, clearly defined ways of "lowering skies" such as surrounding your outside wall with a layer of sectors with a lower sky height.

Share this post


Link to post

I can't remember where I read that feature of untextured walls adjacent to a SKY texture. It seemed to give me the desired effect. If there is a better way I'm all ears... Do you mean the line line_horizon special? 

 

2 hours ago, Gez said:

looks like undefined behavior

Agreed. If the technique I have used to lower the sky to the horizon is non-standard, then the behaviour I described is probably an edge case.

 

It wasn't so much the SKY thing though - it was the odd behaviour when viewing a linedef that should inherit(?) a SKY texture from an adjacent SKY through a line portal. The workaround above seems to do the trick so far. I'll look at other methods though. Still learning...

Share this post


Link to post
28 minutes ago, smeghammer said:

If there is a better way I'm all ears... Do you mean the line line_horizon special? 

I mean something like that... Pay attention to the outer sector on which I put sky floors (that's not needed, technically, but it's tidy and it prevents them from appearing on the textured automap even if the sector flag for that is overridden).

skyhack.zip

Share this post


Link to post
  • 2 weeks later...

I looked at @Gez's example which works well. However, in my example I am using sector portals in the outside area (so my outside is stacked) and I can't get stacked, zero height surrounding sectors to work for the sky.

 

The workaround of using untextured flat or wall to correctly view SKY through a line portal seems to consistently work. Check out my latest WiP that uses this trick quite extensively. 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...