TTLG|Thief|Bioshock|System Shock|Deus Ex|Mobile
Results 1 to 6 of 6

Thread: Swappable skyboxes

  1. #1
    Registered: Apr 2011

    Swappable skyboxes

    Over in the discord, Schlock asked, "is there a good way to change the skybox while the mission is being played?"

    My best understanding is that changing the newsky during a mission is not possible. But it is possible, using NewDark materials, to render a non-sky material as a skybox with a cubemap texture. And if, instead of hardcoding the cubemap texture name in the .mtl, you use one of the envmap zones to specify the texture, then a script can dynamically change this skybox while running.

    • Can change skyboxes
    • Can maybe even use animated skybox textures (although I've not tried)
    • Can have different skyboxes in different areas of the map, even indoors.

    • Can't have newsky effects in this fake sky: so no distant art, no celestial objects, no cloud deck
    • You can't have weather effects under this fake sky, as preciptation only spawns underneath SKY_HACK
    • You can't use fog in areas with this fake sky: it looks terrible, as the brushes fog up like ordinary walls, not like a proper sky
    • You can't use sunlight in areas with this fake sky: it's only cast from SKY_HACK.

    Here's a demo mission (T2, requires NewDark 1.26 or later). Note: because I'm lazy, I just added a .mtl for the cave texture. You should probably use your own fam instead. (Dropbox)

    Last edited by vfig; 22nd May 2020 at 18:18.

  2. #2
    Registered: May 2017
    Location: USA
    Dope! I’ve been looking for a way to accomplish exactly this!
    Last edited by trefoilknot; 20th May 2020 at 09:56.

  3. #3
    Registered: Apr 2011
    There's some more discussion on potential uses and caveats over in #scripting in Discord. Also a second test map, which changes both the skybox and lighting when you walk in and out of a room: (Dropbox). It's basically a quick hack to begin exploring the possibilities—and weaknesses—of using animlights instead of sunlight.

    For future reference, there’s a good—if short—discussion in this thread on simulating daylight changes by varying the mission’s lighting, and two missions that do this: Midday Eclipse and Mine Saga's End.
    Last edited by vfig; 23rd May 2020 at 13:20.

  4. #4
    Registered: Nov 2003
    Location: France
    @ vfig

    That's pretty cool. I have an other way of changing the sky.
    EX: I was getting annoyed by how the distant art wouldn't cover the bottom end of the sky correctly. So, here's what I did.

    1.) I make my usual newsky settings.
    2.) I created a half sphere-like object that has my desired distant art.
    3.) I have the object physically attached to the player.

    This is how I got the background mountain range set in the 10th mission of TROTB 2. Now with this idea in mind, theoretically you can have this object with joint sections for like clouds and what not. Also, you could have the object change according to what roombrush the player is in. Therefore, you could make multiple custom sky objects. I think I'll do something like this in one of my future FMs.

  5. #5
    Registered: Apr 2011
    That's an interesting approach! Were there any downsides you encountered with it, like does it work with fog correctly?

  6. #6
    Registered: Feb 2000
    Location: Paris, France
    This is very cool; I was trying to achieve this age ago.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts