Idiot Skybox (impossible leaking)
Quote from zivi7 on February 11, 2013, 8:47 amFracture wrote:yeah i pretty much knew that stuff from the last agonizing thread about skyboxes.Yet you built a box with a sky_camera while all you want is a 2D sky.
Which one to use depends on what you want the player to see. Let's say you have a hole in the ceiling through which the player should be able to see those clouds you have. In this case, all you have to do is texture this hole with toolsskybox and nothing else. This guide has pictures that should be easy to understand.
This:
[spoiler]
[/spoiler]
Becomes this ingame:
[spoiler]
[/spoiler]
If that is all you want, do only that, nothing more. You only need a 3D skybox with a sky_camera if you want the player to see structures in the sky. But: in Portal 2 even then you will usually not really need this. Most of the time, it should be enough to just raise the ceiling a bit further or make the hole in the floor a bit deeper, texture it with toolsskybox or maybe even only toolsblack and place some beams or whatever between this ceiling and your map. Add an Env_fog_controller (there are many presets to test in the global_ents-instance) and it'll easily create the impression of ongoing testchamber rows for example. MrLate's latest coop map has some bottomless pits that you could check for an example.
But let's say you already have a rather huge test chamber and find that additional space for this effect would hit performance too much. Then a 3D skybox might indeed help. I never realized this myself either till LPfreaky pointed out the benefits to me. Probably it was because most tutorials for 3D skyboxes are made for Counterstrike or Left 4 Dead with their city environments where it made perfect sense to me that you'd see buildings in the distance that you can't reach. But it can be useful in Portal 2 as well.
Your 3D skybox could look like this in Hammer:
[spoiler]
[/spoiler]
In your example, you have an empty box with a sky_camera in the middle. That is pointless.
In the picture above, the sky_camera sits in its specific spot to tell the game where to display all those downscaled brushes and models. That's why all those guides tell you to start off with a sky_camera at the origin of your main map.This is what that skybox looks like ingame:
[spoiler]
[/spoiler]
Notice how the ping tool seems to hit a wall. That is because it does! The ping tool is hitting the most outer world_brush-wall that is the border of the main map. It is just textured with toolsskybox. Everything beyond it is not really there, but an illusion created with the 3D skybox. The sky_camera in the 3D skybox tells the game to project what it sees inside the 3D skybox onto the toolsskybox-surfaces in the mainmap.
Yet you built a box with a sky_camera while all you want is a 2D sky.
Which one to use depends on what you want the player to see. Let's say you have a hole in the ceiling through which the player should be able to see those clouds you have. In this case, all you have to do is texture this hole with toolsskybox and nothing else. This guide has pictures that should be easy to understand.
This:

Becomes this ingame:

If that is all you want, do only that, nothing more. You only need a 3D skybox with a sky_camera if you want the player to see structures in the sky. But: in Portal 2 even then you will usually not really need this. Most of the time, it should be enough to just raise the ceiling a bit further or make the hole in the floor a bit deeper, texture it with toolsskybox or maybe even only toolsblack and place some beams or whatever between this ceiling and your map. Add an Env_fog_controller (there are many presets to test in the global_ents-instance) and it'll easily create the impression of ongoing testchamber rows for example. MrLate's latest coop map has some bottomless pits that you could check for an example.
But let's say you already have a rather huge test chamber and find that additional space for this effect would hit performance too much. Then a 3D skybox might indeed help. I never realized this myself either till LPfreaky pointed out the benefits to me. Probably it was because most tutorials for 3D skyboxes are made for Counterstrike or Left 4 Dead with their city environments where it made perfect sense to me that you'd see buildings in the distance that you can't reach. But it can be useful in Portal 2 as well.
Your 3D skybox could look like this in Hammer:

In your example, you have an empty box with a sky_camera in the middle. That is pointless.
In the picture above, the sky_camera sits in its specific spot to tell the game where to display all those downscaled brushes and models. That's why all those guides tell you to start off with a sky_camera at the origin of your main map.
This is what that skybox looks like ingame:

Notice how the ping tool seems to hit a wall. That is because it does! The ping tool is hitting the most outer world_brush-wall that is the border of the main map. It is just textured with toolsskybox. Everything beyond it is not really there, but an illusion created with the 3D skybox. The sky_camera in the 3D skybox tells the game to project what it sees inside the 3D skybox onto the toolsskybox-surfaces in the mainmap.
Quote from FelixGriffin on February 11, 2013, 5:15 pmJust by the way, where did you get those 1/16 scale vactubes?
Just by the way, where did you get those 1/16 scale vactubes?

Quote from josepezdj on February 11, 2013, 5:47 pmFelixGriffin wrote:Just by the way, where did you get those 1/16 scale vactubes?You could always decompile them, scale them and recompile them back again
You could always decompile them, scale them and recompile them back again
Quote from Lpfreaky90 on February 11, 2013, 6:01 pmFelixGriffin wrote:Just by the way, where did you get those 1/16 scale vactubes?Custom models; made the way Jose explained.
Custom models; made the way Jose explained.
Quote from zivi7 on February 11, 2013, 6:07 pmjosepezdj wrote:You could always decompile them, scale them and recompile them back againUnfortunately, the only standard skybox model you get is that giant crane. But you can create your own from the models in the game.
Skotty made a tutorial on how to decompile models. The next step is downsizing them, explained in this rescaling tutorial from interlopers.net. Finally, Josepezdj has posted instructions how to recompile models.
I didn't get it to work for every model I tried it with though. The small bts lightcages appeared in Hammer but not ingame. The big spiral staircase got all messed up, I assume the rescaling destroyed the connection points between tower and stairs.
But so far it did work flawlessly for those corkscrew vactubes, several walkways and an arms_exterior-model that I wanted. I might upload them soon when I tried some more.

Unfortunately, the only standard skybox model you get is that giant crane. But you can create your own from the models in the game.
Skotty made a tutorial on how to decompile models. The next step is downsizing them, explained in this rescaling tutorial from interlopers.net. Finally, Josepezdj has posted instructions how to recompile models.
I didn't get it to work for every model I tried it with though. The small bts lightcages appeared in Hammer but not ingame. The big spiral staircase got all messed up, I assume the rescaling destroyed the connection points between tower and stairs.
But so far it did work flawlessly for those corkscrew vactubes, several walkways and an arms_exterior-model that I wanted. I might upload them soon when I tried some more.
Quote from FelixGriffin on February 11, 2013, 9:29 pmThanks!
Thanks!
Quote from Fracture on February 11, 2013, 11:58 pmWhy doesn't anyone believe i know the differance between 2d and 3d skyboxes?! I built a 3d skybox in part2 of this mappack.
This 2d skybox is being a bitch, though.
Thankfully I just realised what you were talking about involving my skybox files. I wouldn't have if it were not for the fact that I knew there were imported.
Could have clarified a bit more over one thing and not the other.
It's working now, thanks
Why doesn't anyone believe i know the differance between 2d and 3d skyboxes?! I built a 3d skybox in part2 of this mappack.
This 2d skybox is being a bitch, though.
Thankfully I just realised what you were talking about involving my skybox files. I wouldn't have if it were not for the fact that I knew there were imported.
Could have clarified a bit more over one thing and not the other.
It's working now, thanks

Quote from BenVlodgi on February 12, 2013, 12:24 amFracture wrote:Why doesn't anyone believe i know the differance between 2d and 3d skyboxes?!probably because you....
Fracture wrote:Could have clarified a bit more over one thing and not the otherFracture wrote:It's working now, thanksExcellent!
probably because you....
Excellent!
Quote from Lpfreaky90 on February 12, 2013, 12:36 amFracture wrote:Why doesn't anyone believe i know the differance between 2d and 3d skyboxes?! I built a 3d skybox in part2 of this mappack.This 2d skybox is being a bitch, though.
Now where is the dummies guide to .Vmt?
===== The dummies guide to .vmt's =====
1) vmt's (valve material type) are files that define materials.
2) Materials have properties:
- The texture (how do they look)
- Their type (what are the properties, what sounds do they make)
- How they are lit. (does the brightness need to change?)
- What's the weight of the block you create?3) A vmt will always start with it's shader, that's how it's lit.
- For models this is usually VertexLitGeneric.
- For textures this is usually LightmappedGeneric.
- For skybox textures in portal 2 this must be UnlitGeneric4) Now the vmt will also need an actual texture; that's the $basetexture
- The base texture always uses the relative path from your game's base materials folder.
- In the case of portal 2 this is portal 2/portal2/materials/
- It's good practice to keep your vmt and vmf in the same folder, that makes it much easier.
- For skybox textures to work your vmt's and vmf's MUST BE in the materials/skybox folder.
- So for your skybox textures you will need to have $basetexture = skybox/nameofyourtexture5) After you have those basic parameters you can add some aditionals, in the case of skybox it's probably only relevant to change if the texture should receive for or not; that's $nofog
===== some more skybox stuff =====
1) A skybox needs 6 textures, all with a different suffix:
- up for up
- rt for right
- lf for left
- ft for front
- bk for back
- dn for down
2) in your map properties you need to set the skybox name to the texture; without the suffix;
so if your textures are called "lp_skyup; lp_skyrt" etc; the name for your skybox texture is "lp_sky".So; let's assume we have a skybox texture called lp_sky; this is how a vmt could look like:
lp_skyup.vmf:
- Code: Select all
"UnlitGeneric"
{
"$basetexture" "skybox/lp_skyup"
"$nofog" "1"
}lp_skyrt.vmf:
- Code: Select all
"UnlitGeneric"
{
"$basetexture" "skybox/lp_skyrt"
"$nofog" "1"
}etc, you should get the point
This 2d skybox is being a bitch, though.
Now where is the dummies guide to .Vmt?
===== The dummies guide to .vmt's =====
1) vmt's (valve material type) are files that define materials.
2) Materials have properties:
- The texture (how do they look)
- Their type (what are the properties, what sounds do they make)
- How they are lit. (does the brightness need to change?)
- What's the weight of the block you create?
3) A vmt will always start with it's shader, that's how it's lit.
- For models this is usually VertexLitGeneric.
- For textures this is usually LightmappedGeneric.
- For skybox textures in portal 2 this must be UnlitGeneric
4) Now the vmt will also need an actual texture; that's the $basetexture
- The base texture always uses the relative path from your game's base materials folder.
- In the case of portal 2 this is portal 2/portal2/materials/
- It's good practice to keep your vmt and vmf in the same folder, that makes it much easier.
- For skybox textures to work your vmt's and vmf's MUST BE in the materials/skybox folder.
- So for your skybox textures you will need to have $basetexture = skybox/nameofyourtexture
5) After you have those basic parameters you can add some aditionals, in the case of skybox it's probably only relevant to change if the texture should receive for or not; that's $nofog
===== some more skybox stuff =====
1) A skybox needs 6 textures, all with a different suffix:
- up for up
- rt for right
- lf for left
- ft for front
- bk for back
- dn for down
2) in your map properties you need to set the skybox name to the texture; without the suffix;
so if your textures are called "lp_skyup; lp_skyrt" etc; the name for your skybox texture is "lp_sky".
So; let's assume we have a skybox texture called lp_sky; this is how a vmt could look like:
lp_skyup.vmf:
- Code: Select all
"UnlitGeneric"
{
"$basetexture" "skybox/lp_skyup"
"$nofog" "1"
}
lp_skyrt.vmf:
- Code: Select all
"UnlitGeneric"
{
"$basetexture" "skybox/lp_skyrt"
"$nofog" "1"
}
etc, you should get the point
Quote from FelixGriffin on February 12, 2013, 4:54 pmNice guide! The only other shader I think P2 ever uses is SolidEnergy, but I haven't been able to figure out what properties it accepts--it seems to take everything used in other shaders, never be lit, and break on models or in different rendermodes.
Lpfreaky90 wrote:4) Now the vmt will also need an actual texture; that's the $base_texture
- The base texture always uses the relative path from your game's base materials folder.
- In the case of portal 2 this is portal 2/portal2/materials/
- It's good practice to keep your vmt and vmf in the same folder, that makes it much easier.
- For skybox textures to work your vmt's and vmf's MUST BE in the materials/skybox folder.
- So for your skybox textures you will need to have $basetexture = skybox/nameofyourtextureBtw, Fracture, $base_texture is a typo. It's always $basetexture.
Just trying to forestall another of these threads.
Nice guide! The only other shader I think P2 ever uses is SolidEnergy, but I haven't been able to figure out what properties it accepts--it seems to take everything used in other shaders, never be lit, and break on models or in different rendermodes.
- The base texture always uses the relative path from your game's base materials folder.
- In the case of portal 2 this is portal 2/portal2/materials/
- It's good practice to keep your vmt and vmf in the same folder, that makes it much easier.
- For skybox textures to work your vmt's and vmf's MUST BE in the materials/skybox folder.
- So for your skybox textures you will need to have $basetexture = skybox/nameofyourtexture
Btw, Fracture, $base_texture is a typo. It's always $basetexture.
Just trying to forestall another of these threads.