Skyboxes
by D B · in Artist Corner · 07/10/2005 (11:52 am) · 26 replies
Hi.
I just have a quick question about skyboxes. I've used them in UnrealEd before, and I was wondering if I do something similar, as in add the skybox into my map in gameSpace or if it is something that I do in Torque now.
Thanks.
I just have a quick question about skyboxes. I've used them in UnrealEd before, and I was wondering if I do something similar, as in add the skybox into my map in gameSpace or if it is something that I do in Torque now.
Thanks.
About the author
#2
Thanks again.
07/10/2005 (2:18 pm)
Thanks, Spencer. I just have one more question. How do you determine what part of the level consists of the sky? (as in what parts of the map will consist of the skybox environment; for example, a building where you can only see the sky from a window, how would that be set up in a map?). My apologies if this question is kind of simple, but I'm still a little new at this.Thanks again.
#3
I hope you're enjoying Torque so far. I'm continually amazed at what it can do.
Anyway, on to your question -- are you wanting to have a level that is set entirely indoors, but with limited views of a super-cool skybox?
If I'm understanding you correctly, and that's what you're trying to do, then you would need to 1) create a new "mission" inside the Torque editor and 2) add a reference to your skybox (using the steps that Spencer described above) and finally 3) you can drop your interior objects / maps onto the mission terrain. You will want to make sure your spawn markers will drop your players inside the interior, though. And there's lots of other things that you might want to stick in there, but that should get you started.
If I misunderstood your question, sorry about that. Hopefully one of us can get you headed in the right direction.
Aaron E.
07/10/2005 (3:17 pm)
Hi Danny,I hope you're enjoying Torque so far. I'm continually amazed at what it can do.
Anyway, on to your question -- are you wanting to have a level that is set entirely indoors, but with limited views of a super-cool skybox?
If I'm understanding you correctly, and that's what you're trying to do, then you would need to 1) create a new "mission" inside the Torque editor and 2) add a reference to your skybox (using the steps that Spencer described above) and finally 3) you can drop your interior objects / maps onto the mission terrain. You will want to make sure your spawn markers will drop your players inside the interior, though. And there's lots of other things that you might want to stick in there, but that should get you started.
If I misunderstood your question, sorry about that. Hopefully one of us can get you headed in the right direction.
Aaron E.
#4
[edit- I was slow posting,sry]
07/10/2005 (3:20 pm)
You don't tag surfaces as you did in Ued. The skybox is physically there in releationship the the rest of your Torque world. A window for example, is an actual functioning window that allows you to see the skybox that's placed by the engine beyond the terrain. That help?[edit- I was slow posting,sry]
#5
Now, you also have another option, which you can see in a number of Quake interior engine titles. Basically, texture a wall to look like the viewpoint from the window and make sure that it's the right distance, etc to only be seen from the window--making it look like a landscape rather than a wall. Nightfire, Soldier of Fortune, etc used this technique often rather than creating a singular skybox. It's a simple trick that can have great results.
If you have interior/exterior areas that need to interact seemlessly, a single skybox is a better option.
07/10/2005 (4:31 pm)
Skyboxes tutorial from Games Extract.Now, you also have another option, which you can see in a number of Quake interior engine titles. Basically, texture a wall to look like the viewpoint from the window and make sure that it's the right distance, etc to only be seen from the window--making it look like a landscape rather than a wall. Nightfire, Soldier of Fortune, etc used this technique often rather than creating a singular skybox. It's a simple trick that can have great results.
If you have interior/exterior areas that need to interact seemlessly, a single skybox is a better option.
#6
I don't know if I can add to what these guys have said, and I'm not sure I can answer your latest question. It's worth considering, however, that you have to approch things in a fundamentally different way with Torque.
Basically, in Torque, you start with terrain (and skybox), and plop buildings (referred to as "interiors") onto the terrain. I think the Torque notion of an "interior" is similar to Half-Life-type brush-based object. In Torque (and unlike Half-Life, or Unreal) if your interior has holes in it, you can see out to the sky (like these other guys said).
In Unreal, I think you're carving into a space with rectalinear shapes (and you can add terrain into that space as an individual object). If you want a polygon to be a window, you mark it so it shows the skybox, right? Torque is nothing like that :).
One thing you might want to look into - and I haven't played with this much - is a feature in Torque interiors by which you can use portals to turn off the terrain. Basically, if you walk through a door into an interior, and get deep enough in there, there's no need to be rendering the outside terrain. So there's portals you can place in the interior to turn off the terrain (but not, of course, the interior itself). What I'm wondering is - and maybe someone else here can answer this - is, does this portal also turn off the sky? If not, it might be a handy tool to have in your toolbox. If, as you say, you want a building where you can only see the sky (and not the terrain) from inside. This would be for a skylight or something.
-Spencer
07/10/2005 (4:39 pm)
Hi Danny, I don't know if I can add to what these guys have said, and I'm not sure I can answer your latest question. It's worth considering, however, that you have to approch things in a fundamentally different way with Torque.
Basically, in Torque, you start with terrain (and skybox), and plop buildings (referred to as "interiors") onto the terrain. I think the Torque notion of an "interior" is similar to Half-Life-type brush-based object. In Torque (and unlike Half-Life, or Unreal) if your interior has holes in it, you can see out to the sky (like these other guys said).
In Unreal, I think you're carving into a space with rectalinear shapes (and you can add terrain into that space as an individual object). If you want a polygon to be a window, you mark it so it shows the skybox, right? Torque is nothing like that :).
One thing you might want to look into - and I haven't played with this much - is a feature in Torque interiors by which you can use portals to turn off the terrain. Basically, if you walk through a door into an interior, and get deep enough in there, there's no need to be rendering the outside terrain. So there's portals you can place in the interior to turn off the terrain (but not, of course, the interior itself). What I'm wondering is - and maybe someone else here can answer this - is, does this portal also turn off the sky? If not, it might be a handy tool to have in your toolbox. If, as you say, you want a building where you can only see the sky (and not the terrain) from inside. This would be for a skylight or something.
-Spencer
#7
I haven't started building interiors yet, but I agree with you about the usefulness of turning off terrains from deep inside an interior while retaining skyboxes. It would be very cool if Torque supports that. Hopefully someone here has tried it and can tell us if it's possible.
By the way, I just read your profile. Amazing. I really enjoyed Drakan:ootf and D:tag and it's very cool to see that you helped develop the second one. To me, great 3D worlds start with beautiful terrains and both of those games had inspiring landscapes for their time. They helped me see the potential of free-form exploration in gaming and got me interested making my own worlds. The PC version was where I first learned to mod games and after that, I was hooked. Now that I'm developing with Torque, it surprises me how often I measure my work against those first experiences with the Drakan games. As you might imagine, Torque's landscape-centric approach is one of my favorite things about the engine.
Sorry for the nostalgia moment there. Reading your profile just brought back fond memories.
Aaron E.
07/10/2005 (6:56 pm)
Spencer,I haven't started building interiors yet, but I agree with you about the usefulness of turning off terrains from deep inside an interior while retaining skyboxes. It would be very cool if Torque supports that. Hopefully someone here has tried it and can tell us if it's possible.
By the way, I just read your profile. Amazing. I really enjoyed Drakan:ootf and D:tag and it's very cool to see that you helped develop the second one. To me, great 3D worlds start with beautiful terrains and both of those games had inspiring landscapes for their time. They helped me see the potential of free-form exploration in gaming and got me interested making my own worlds. The PC version was where I first learned to mod games and after that, I was hooked. Now that I'm developing with Torque, it surprises me how often I measure my work against those first experiences with the Drakan games. As you might imagine, Torque's landscape-centric approach is one of my favorite things about the engine.
Sorry for the nostalgia moment there. Reading your profile just brought back fond memories.
Aaron E.
#8
07/10/2005 (8:08 pm)
It's easy. Remove the terrain from the mission file.
#9
Yes, you're right, dropping the terrain entirely can work (never tried it myself, though) and that may give Spencer the result he is after. If so, cool. But I got the impression that he wanted to have seemless indoor and outdoor environments and wanted the performance benefits of switching off the terrain while exploring the deepest parts of an interior -- and still keeping his skybox active and visible from openings in the ceiling/roof.
I don't have any experience creating interiors, but that kind of functionality sounds like it would be useful. I still have a lot to learn about this stuff, so maybe that type of thing isn't possible.
Aaron E.
07/10/2005 (9:19 pm)
David,Yes, you're right, dropping the terrain entirely can work (never tried it myself, though) and that may give Spencer the result he is after. If so, cool. But I got the impression that he wanted to have seemless indoor and outdoor environments and wanted the performance benefits of switching off the terrain while exploring the deepest parts of an interior -- and still keeping his skybox active and visible from openings in the ceiling/roof.
I don't have any experience creating interiors, but that kind of functionality sounds like it would be useful. I still have a lot to learn about this stuff, so maybe that type of thing isn't possible.
Aaron E.
#10
That's really nice to hear from a Drakan fan :)! I still feel for all the hardcore people who wanted Drakan:TAG to come out on PC. I felt the same way.
I love terrain. It was one of the first things I tried to build in 3D - a familiar mountain pass from Vermont, where I grew up. I was hooked on Tribes the first time I saw the screens with the terrain.
One of the reasons I wanted to work at Surreal was because of the open environments in the first Drakan, so I was psyched to work on the sequel. (I wanted to work at Dynamix, but they didn't want me. So instead I went off to work on Syphon Filter, Drakan, LotR, and The Suffering. Meanwhile, Dynamix went out of business. Hah! ;))
I can honestly say, though, that building terrain in Torque is way more fun than building terrain in Surreal's Riot engine (which we used in Drakan and LotR among others). The Riot engine was more feature-rich (for instance you could make caves with multiple stacked heightmap terrains), but difficult. After a few years of that, the Torque terrain tools are like playing with a toy for me :). To be fair, the Riot engine was more focused on gameplay than terrain after Drakan. Compared to Torque, setting up gameplay is really cool and intuitive in the Riot engine, the tools are just way more powerful.
Sorry to be so chatty, but you gave me the opportunity to talk about myself :)
BTW, it was Danny, the original poster, who was looking for suggestions on the skybox thing. I was just throwing out ideas for him.
-Spencer
07/10/2005 (11:30 pm)
Aaron, That's really nice to hear from a Drakan fan :)! I still feel for all the hardcore people who wanted Drakan:TAG to come out on PC. I felt the same way.
I love terrain. It was one of the first things I tried to build in 3D - a familiar mountain pass from Vermont, where I grew up. I was hooked on Tribes the first time I saw the screens with the terrain.
One of the reasons I wanted to work at Surreal was because of the open environments in the first Drakan, so I was psyched to work on the sequel. (I wanted to work at Dynamix, but they didn't want me. So instead I went off to work on Syphon Filter, Drakan, LotR, and The Suffering. Meanwhile, Dynamix went out of business. Hah! ;))
I can honestly say, though, that building terrain in Torque is way more fun than building terrain in Surreal's Riot engine (which we used in Drakan and LotR among others). The Riot engine was more feature-rich (for instance you could make caves with multiple stacked heightmap terrains), but difficult. After a few years of that, the Torque terrain tools are like playing with a toy for me :). To be fair, the Riot engine was more focused on gameplay than terrain after Drakan. Compared to Torque, setting up gameplay is really cool and intuitive in the Riot engine, the tools are just way more powerful.
Sorry to be so chatty, but you gave me the opportunity to talk about myself :)
BTW, it was Danny, the original poster, who was looking for suggestions on the skybox thing. I was just throwing out ideas for him.
-Spencer
#11
If you click on your loaded interior, you can search through the options to find a showTerrainInside box to check/uncheck.
07/11/2005 (7:12 am)
Ah, yes. I see. Removing the terrain completely wouldn't be an option, then. The search seems to be broken or reindexing this morning (devmaster links are the only ones that come up). Do a search a little later on "Tunneling through terrain". While there's a bit of noise in the thread, the majority of it is signal.If you click on your loaded interior, you can search through the options to find a showTerrainInside box to check/uncheck.
#12
@David. Thanks for the search reference. I'll check that out since I'm starting to get curious about it as well. I'm sorry about adding the signal interferance. Looking back on it now, I realize that I did kind of hijack Danny's original thread.
Aaron E.
07/11/2005 (7:58 am)
@Spencer. Oops. Sorry for the mixup. I get confused easily. :) There's tons more I could say about Drakan, RIOT and organic terrain building (!arches!), but I'll stop. Anyway, thanks for posting -- I enjoyed that blast from the past.@David. Thanks for the search reference. I'll check that out since I'm starting to get curious about it as well. I'm sorry about adding the signal interferance. Looking back on it now, I realize that I did kind of hijack Danny's original thread.
Aaron E.
#13
So, if say, I have a small cave, and I make a "hole" in the ceiling (where the map consists of, say a cube with part of the top subtracted) and have the sky terrain in place, I should be able to have it so one can look up at the hole and see the sky, right?
Also, what happens if a character "runs into" the sky (be it a big hole in the side of the level or something)? Will they react as if hitting a dead end?
Thanks again.
07/12/2005 (2:59 pm)
Thank you for all of your responses (sorry my late response).So, if say, I have a small cave, and I make a "hole" in the ceiling (where the map consists of, say a cube with part of the top subtracted) and have the sky terrain in place, I should be able to have it so one can look up at the hole and see the sky, right?
Also, what happens if a character "runs into" the sky (be it a big hole in the side of the level or something)? Will they react as if hitting a dead end?
Thanks again.
#14
If your cave is an interior type object (.DIF file) and has holes/portals in various places, you should be able to see your terrain and sky and any detail objects that are within view. But the big if here is if your cave is inside of a hill or somehow under the terrain (which should always be the case, I suppose). If your cave is inside or underneath the lanscape, then looking up from the cave to the outside world won't quite work like you want, unless you prepare your terrain to handle open ceilings in the .DIFs below. For example . . .
. . . lets say you've built an underground maze that you wish to populate with badguys or spawn points or whatever. In different places, you might have openings in the ceiling of your interior file to let the natural sunlight through and tantalize your players with the prospect of freedom. Also, lets assume that your maze is completely below the ground. On the surface of the terrain, directly above these skylights in your interior, you will need to sculpt and cut out part of the landscape so that it will look right. You might want to make your interior protrude a bit or maybe add some detail .DTS stuff to fit around the hole hole in the terrain to make it look natural (and a bit forboding too, maybe). You will need to do similar things to any doors (openings/portals) that lead into or out of the maze.
At least that's how I understand it to work. I've read a lot about interiors and looked at several really nice ones created by others, but I haven't built my first .DIF yet. So, I could be mis-stating a few things. Hopefully someone will correct me if I'm wrong. :)
As for the sky, you can't run into it. Believe me, I've tried. If you use a traditional skybox, it will always stay well out of reach, no matter how far you run, drive, fly, or teleport. The same pretty much goes for the terrain. Your landscape features will repeat indefinitely, so you can run in one direction for 24 hours a day for years without reaching the end of your 'world'. The only problem with repeating terrains is that any holes you punch into surface will show up in the corresponding spot on each of the repeats. So you will need to keep that in mind and work around it. There are ways to turn off the repeating nature of the terrains, but it's not an easy task from what I hear (requires lots of nasty codings-es).
So, I hope I answered your questions ok. If I need to clarify any of it, let me know.
Aaron E.
07/12/2005 (6:30 pm)
Danny,If your cave is an interior type object (.DIF file) and has holes/portals in various places, you should be able to see your terrain and sky and any detail objects that are within view. But the big if here is if your cave is inside of a hill or somehow under the terrain (which should always be the case, I suppose). If your cave is inside or underneath the lanscape, then looking up from the cave to the outside world won't quite work like you want, unless you prepare your terrain to handle open ceilings in the .DIFs below. For example . . .
. . . lets say you've built an underground maze that you wish to populate with badguys or spawn points or whatever. In different places, you might have openings in the ceiling of your interior file to let the natural sunlight through and tantalize your players with the prospect of freedom. Also, lets assume that your maze is completely below the ground. On the surface of the terrain, directly above these skylights in your interior, you will need to sculpt and cut out part of the landscape so that it will look right. You might want to make your interior protrude a bit or maybe add some detail .DTS stuff to fit around the hole hole in the terrain to make it look natural (and a bit forboding too, maybe). You will need to do similar things to any doors (openings/portals) that lead into or out of the maze.
At least that's how I understand it to work. I've read a lot about interiors and looked at several really nice ones created by others, but I haven't built my first .DIF yet. So, I could be mis-stating a few things. Hopefully someone will correct me if I'm wrong. :)
As for the sky, you can't run into it. Believe me, I've tried. If you use a traditional skybox, it will always stay well out of reach, no matter how far you run, drive, fly, or teleport. The same pretty much goes for the terrain. Your landscape features will repeat indefinitely, so you can run in one direction for 24 hours a day for years without reaching the end of your 'world'. The only problem with repeating terrains is that any holes you punch into surface will show up in the corresponding spot on each of the repeats. So you will need to keep that in mind and work around it. There are ways to turn off the repeating nature of the terrains, but it's not an easy task from what I hear (requires lots of nasty codings-es).
So, I hope I answered your questions ok. If I need to clarify any of it, let me know.
Aaron E.
#15
Thanks again.
07/12/2005 (7:31 pm)
Thanks, Aaron. The only thing I was really confused about there was from the first two paragraphs. If I wanted the sky to be visible from a hole in the top of the cave ceiling, would I be needing to do something extra to my map?Thanks again.
#16
Since I haven't created any .MAP or .DIF interior files yet, I can't give you any specifics on how to create those for Torque. I just know that other people have built some very nice interiors that integrate well with their surface terrains. For making your own interiors with portals, you may need to dig through the GG web site (using the nifty Google search tool).
However, I am pretty good at shaping landscapes and preparing them for interiors. If that's what you're interested in, here goes . . .
In Torque, terrain objects are basically greyscale-type bitmaps where the dark and light areas of the image are interpreted by the engine to correspond to low and high areas of the landscape. Here's an example of a typical heightmap.

Here's what that image looks like when the dark and bright spots are translated into a 3D terrain mesh.

And here's what it would look like if that mesh had a texture map applied to it.

In this image, notice that I've placed green square markers where someone might want to cut holes in the terrain to allow players to enter or exit a cave or maze. The red dots indicate where additional holes could be cut in the terrain to allow players to see into the cave from the outside, or out of the cave if they are stuck down there.
So how do you cut holes in the terrain? First, take a look at this image . . .

With that in mind, start up a level, go into edit mode (F11) , then hit F6 to go into terrain editor mode (or if you want, you can click on the Window menu item, then click on the Terrain Editor sub-menu item, but that's slower). Once you are into the terrain editor, you should now have two cool options in the Actions menu (Set Empty and Clear Empty). When those two actions are used on the same terrain square, it will cut out a hole in your terrain where the square was. Very nifty.
Again, it will be important to make sure you build your interiors (caves/whatever) so that they match up well with your terrain (accidental protrusions are very un-cool).
I hope that helps some with the terrain stuff. Maybe someone else can help with the MAP/DIF crafting issues.
Aaron E.
[edited typos]
[edited broken links]
07/13/2005 (9:16 am)
Danny,Since I haven't created any .MAP or .DIF interior files yet, I can't give you any specifics on how to create those for Torque. I just know that other people have built some very nice interiors that integrate well with their surface terrains. For making your own interiors with portals, you may need to dig through the GG web site (using the nifty Google search tool).
However, I am pretty good at shaping landscapes and preparing them for interiors. If that's what you're interested in, here goes . . .
In Torque, terrain objects are basically greyscale-type bitmaps where the dark and light areas of the image are interpreted by the engine to correspond to low and high areas of the landscape. Here's an example of a typical heightmap.
Here's what that image looks like when the dark and bright spots are translated into a 3D terrain mesh.
And here's what it would look like if that mesh had a texture map applied to it.
In this image, notice that I've placed green square markers where someone might want to cut holes in the terrain to allow players to enter or exit a cave or maze. The red dots indicate where additional holes could be cut in the terrain to allow players to see into the cave from the outside, or out of the cave if they are stuck down there.
So how do you cut holes in the terrain? First, take a look at this image . . .
With that in mind, start up a level, go into edit mode (F11) , then hit F6 to go into terrain editor mode (or if you want, you can click on the Window menu item, then click on the Terrain Editor sub-menu item, but that's slower). Once you are into the terrain editor, you should now have two cool options in the Actions menu (Set Empty and Clear Empty). When those two actions are used on the same terrain square, it will cut out a hole in your terrain where the square was. Very nifty.
Again, it will be important to make sure you build your interiors (caves/whatever) so that they match up well with your terrain (accidental protrusions are very un-cool).
I hope that helps some with the terrain stuff. Maybe someone else can help with the MAP/DIF crafting issues.
Aaron E.
[edited typos]
[edited broken links]
#17
07/13/2005 (9:49 am)
Alright. Thanks again Aaron for all your help.
#18
07/13/2005 (9:53 am)
No problem. Have fun.
#19
10/17/2005 (3:47 pm)
Quick note: I don't believe you would need to cut holes to view the sky from _under_ the terrain since the engine doesn't render backfaces... you would, of course, need to cut a hole for the cave entrance(s).
#20
Yes, you're right about backface rendering for terrains. I have seen it in action so many times, it should have sunk in earlier. But anyway, thanks for pointing it out.
@Everyone
I just realized that my image links were broken. I recently changed my web host and domain. The links should be fixed now.
10/22/2005 (9:18 pm)
@Kevin, Yes, you're right about backface rendering for terrains. I have seen it in action so many times, it should have sunk in earlier. But anyway, thanks for pointing it out.
@Everyone
I just realized that my image links were broken. I recently changed my web host and domain. The links should be fixed now.
Torque 3D Owner Spencer Boomhower
I'm pretty sure you could dig up detailed info in the docs, but offhand, I can tell you this:
Basically, you add six textures to your data directory. These form the six sides of an environment-map-type cube. They reside in the \data\skies\ directory. In that directory, you'll also see .dml files, like sky_storm.dml. These are simply lists that refer to the sky textures. Open up a .dml file with a text editor and you'll see that, in addition to the textures for the six sides of the cube, there's a seventh sky texture listed. I'm pretty sure that is only used for environment maps, but don't quote me on that. You might also see a couple items on the list with "cloud" in their name. These refer to the semi-transparent cloud layers you see scrolling over head in the game.
Once in game, if you open up the editor (f11) then hit f3, in that section you should see a heading called "skies" or "sky" or something. In there, you shoud be able to type the name of the .dml file you want to use. Don't forget to hit "apply" after you do :).
Dig through the directories, swap in test textures with the same names as existing textures, and if all else fails, read the instructions :). Shouldn't be too hard to grasp if you've used other game engines.
Hope this helps.
-Spencer
[edit: typo]