Skybox Questions

Discussion in 'Mapping Questions & Discussion' started by Unregistered HyperCam 2, Jul 10, 2018.

  1. Unregistered HyperCam 2

    Unregistered HyperCam 2 L3: Member

    Messages:
    112
    Positive Ratings:
    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?
     
  2. ics

    aa ics http://ics-base.net

    Messages:
    730
    Positive Ratings:
    442
    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.
     
  3. Unregistered HyperCam 2

    Unregistered HyperCam 2 L3: Member

    Messages:
    112
    Positive Ratings:
    4
    Are all visleafs in the skybox rendered? What's the purpose of the tool texture brushes then?
     
  4. ics

    aa ics http://ics-base.net

    Messages:
    730
    Positive Ratings:
    442
    There is no purpose putting hint/skip into 3dskybox if that is what you mean. What tool brushes you refer to?
     
  5. fubarFX

    aa fubarFX The "raw" in "nodraw"

    Messages:
    1,633
    Positive Ratings:
    1,808
    The skybox tool texture acts like nodraw + it emits env_light. That's about it.
     
    • Thanks Thanks x 1
  6. Unregistered HyperCam 2

    Unregistered HyperCam 2 L3: Member

    Messages:
    112
    Positive Ratings:
    4
    So it's as if the skybox is one big func_viscluster?
     
  7. fubarFX

    aa fubarFX The "raw" in "nodraw"

    Messages:
    1,633
    Positive Ratings:
    1,808
    yeah there's no visibility optimization in the skybox as far as I know
     
    • Thanks Thanks x 1
  8. Da Spud Lord

    aa Da Spud Lord L0: Crappy Member

    Messages:
    846
    Positive Ratings:
    574
    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.
     
  9. Unregistered HyperCam 2

    Unregistered HyperCam 2 L3: Member

    Messages:
    112
    Positive Ratings:
    4
    Ah I didn't notice your comment, the toolsskybox one
     
  10. ics

    aa ics http://ics-base.net

    Messages:
    730
    Positive Ratings:
    442
    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.
     
  11. Unregistered HyperCam 2

    Unregistered HyperCam 2 L3: Member

    Messages:
    112
    Positive Ratings:
    4
    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..
     
  12. henke37

    aa henke37

    Messages:
    1,947
    Positive Ratings:
    462
    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.
     
    • Thanks Thanks x 1
    Last edited: Jul 12, 2018