Why can I see through the skybox?

xillok

L1: Registered
Jan 2, 2012
2
0
Hi. I made a map where the two spawn points are sticking out behind the skybox. Ultimately I'm going to change it so that it doesn't look like the spawn door leads to nothing when you look from outside. But I noticed that when looking from outside you can actually see through the skybox and into the spawn. I'm just wondering if anyone knows why that might be happening. I ran the compile log through interlopers and it only found that error where it can't build the default cubemap because of a broken skybox. I'm using the trainyard skybox and I found a site about fixing that error, but it didn't seem completely necessary. Could that be the source of my see-through problem? I can also host the map if that would help, but I don't know how to do that.
 

Nineaxis

Quack Doctor
aa
May 19, 2008
1,767
2,820
Visleafs

When any part of a visleaf is potentially visible from any part of the current visleaf, the entire contents of that visleaf are considered for rendering.

The visleaf of your spawn room is registered as (potentially) visible by the game, so it is rendered on the screen. The skybox texture doesn't block out anything behind it from rendering, and the skybox itself always renders behind anything else being rendered.
 

xillok

L1: Registered
Jan 2, 2012
2
0
The visleaf of your spawn room is registered as (potentially) visible by the game

How would I prevent that? In the Skybox Optimization dev wiki page it talks about the skybox obscuring something behind it. That's why I thought that would work in this case.
 

Nineaxis

Quack Doctor
aa
May 19, 2008
1,767
2,820
It works in the same way any other brush "obscures" what is behind it. For nothing to render behind it, the visleaf (or visleafs) behind it must not be rendering. This requires you to optimize your visleaf structure so that the visleaf behind won't render when the player is in the visleaf in front, by making sure vbsp recognizes that the two can't see each other.

Here's a good guide for understanding how optimization works in Source.

There's nothing special about the skybox brush in terms of functionality when it comes to visleafs, optimization, and bsp structure.