Skybox Questions

  • If you're asking a question make sure to set the thread type to be a question!
Mar 2, 2018
124
4
This isn't the classic skybox question you were probably expecting,I understand how to make a skybox and scale it seamlessly with the world with a sky_camera
My question is, how does the engine decide if and where to render the skybox and how is it rendered (in parts or all together, which I'm guessing is the latter).
Is the skybox rendered for a client if and only if they have a worldbrush with a skybox tool texture in their PVS?
How are the world brushes with the skybox texture related to the skybox's rendering process?
From what I've seen the skybox is rendered by its offset from the point 0 0 0 and the sky_camera, so what's the purpose of the skybox tool texture? Is it like a nodraw that tells the engie there's nothing in front of the skybox in the face area of that texture?
 

ics

http://ics-base.net
aa
Jun 17, 2010
841
540
3D skybox is rendered always, unless the user disables it with cvar r_3dsky 0. If you have world geometry in the way, it wont show up, but it is still rendered.
 
Mar 2, 2018
124
4
3D skybox is rendered always, unless the user disables it with cvar r_3dsky 0. If you have world geometry in the way, it wont show up, but it is still rendered.
Are all visleafs in the skybox rendered? What's the purpose of the tool texture brushes then?
 

ics

http://ics-base.net
aa
Jun 17, 2010
841
540
There is no purpose putting hint/skip into 3dskybox if that is what you mean. What tool brushes you refer to?
 

Da Spud Lord

Occasionally I make maps
aa
Mar 23, 2017
1,339
994
3D skybox is rendered always, unless the user disables it with cvar r_3dsky 0. If you have world geometry in the way, it wont show up, but it is still rendered.
It doesn't always render, AFAIK. I believe HyperCam is right, in that the skybox only renders if a toolsskybox brush is in the PVS. (It also won't render when the camera is outside the map.) I can't test this right now to be sure, but I've been on maps with 3D skyboxes, and in certain places far from the sky, you can noclip out of the playable space, find a spot with nodraw, and see the hall of mirrors instead of the skybox. One example that comes to mind is the basement in 2Fort.
 

ics

http://ics-base.net
aa
Jun 17, 2010
841
540
Toolsskybox purpose is to show the 3dskybox behind it. It can also be used to seal a map like any brush. But never put a cube over your map with it.
 
Mar 2, 2018
124
4
Toolsskybox purpose is to show the 3dskybox behind it. It can also be used to seal a map like any brush. But never put a cube over your map with it.
What do you mean by showing the skybox behind it? That's exactly the point of this thread..
When you place a toolskybox texture it can show the skybox in front of it as well so we already know this definition is wrong..
 

henke37

aa
Sep 23, 2011
2,075
515
The engine does several rendering passes. first, if the camera is in a pvs flagged as having a skybox brush in it, it draws the 2d skybox. Then it checks if the pvs is flagged for a 3d skybox (there is one to begin with AND the brush face didn't use the 2dsky material) and draws the 3d skybox. Then it draws the regular level geometry and models. Then it renders post processing effects such as bloom and color correction. Then it draws the hud.

Oh, and drawing level geometry itself is a multi step process where it first draws opaque content and then semitransparent content.
And somewhere in all of this it has time for realtime cubemaps and rendertextures.
 
Last edited: