Talk:Skybox (2D)

From Valve Developer Community
Jump to: navigation, search

For some reason when I use a 2D skybox stuff above my eye level is drawn over by the sky box. Is there a way to fix this? Is this something that will go awayu if I use a 3D skybox? (I plan to eventually) Thanks! --Foolster41 13:09, 11 Nov 2007 (PST)

Vue Esprit skybox creation

Anyone knows how can I get a well fit skybox with Vue Esprit? I'm trying it but it needs a lot of time until I could get the right parameters. --erwaitin 16:47, 18 February 2009 (UTC)

Skybox Creation Using Softimage

It seams that there is a bit of crucial information lacking about actually creating the skybox texture itself in such a way as to avoid distortion. I found out the hard way so I thought I'd post it here.

Using Softimage 20XX or XSI Mod Tool you can create a skybox texture with correct distortion fairly easily.

  • Step one: In an image editor (preferably Photoshop) create a texture of decent resolution (say 4096 X 1024) for the panorama that will be your sky. Essentially, the goal is to create an image that will be seamless on the sides and also at the top. I say at the top, but in reality the top will have to be seamless with itself because this texture will be applied to a sphere with a cylindrical texture projection. The easiest way I know to do this is to use Photoshop's built in offset filter. The offset filter is located under the Filter > Other > Offset. To use it, set the horizontal offset to (in this case) 2048 and leave the vertical offset at 0. This will shift the image over 2048 pixels which is half of 4096 pixels revealing the tile seam. I recommend using the clone stamp tool and layers to blend the seam. Make a new layer. This layer should be empty and transparent. Select the clone stamp tool and in the drop down menu for Sample select All Layers. Now when you select a point for sampling using the Alt key you can sample from the image below and paint on this layer above. Then you can erase unwanted parts with a soft or hard edge to blend the layers. Or even use a quick mask. When the seam looks good flatten your layers and use the offset filter again with the same settings. Now your image is back to normal. *Remember to leave a little room at the top of the image alone, basically don't paint clouds or gradients here so that the top edge will fold on itself correctly when you project the image later. I'd leave about ten pixels at the top which are a solid color. **Also important is to make sure the horizon line is lined up with the vertical center. you can accomplish this by setting a guide at the vertical center of the image which will serve as, well, a guide :/


  • Step two: Now that the image is complete save it as a png or tga or even a psd for all Softimage cares. Open Softimage and create a primitive sphere in the model menu under Get>Primitive>Polymesh>Sphere. Set the vertical divisions to 16 and the horizontal divisions to 16 as well. Make it's radius 1024 so it's nice and big. With the sphere selected, assign a cylindrical texture projection under Get>Property>Texture Projection>Cylindrical in the Render menu. Now the primitive has UV tiles so we can map our texture. With the sphere still selected assign the sphere a texture map, go to Get>Texture>Image in the Render menu. In the image property editor browser for the sky image you made previously. In the camera view, if you have the render settings set to texture rather than shaded you should see your texture projected onto the sphere. Only problem is that it's shaded. We'll fix that. Select the sphere and assign it a constant material under Render>Get>Material>Constant. You don't need to do anything more than that, you're sky dome is complete.


  • Step three: All you have to do now is add another camera to the scene under Model>Get>Primitive>Camera>Perspective. Change the camera horizontal lens angle to 90 degrees. Set the image ratio to 1. This will make the camera view square. When you created the camera it was spawned at the origin point of the scene. In other words the direct center of the sphere. Set one of your view ports to your new camera to see it's view point. When you created the camera it should have been selected but if you lost it just go into Softimage's explorer under View>General>Explorer and select your camera from the list. On the right side of the screen there is a section under the heading Transform under Transform>Rotation were're going to be changing the y value. At the moment the y value is 0. Let's take your first snapshot before we go further. Select View>Render>Render Prieview. This will pull up a preview of your render. For most skybox textures 512x512 will be sufficient so a preview render should do just fine but if you require more resolution you can always do a render pass. In the Render Preview window under Options select the view port that you assigned your camera to previously. You will then see a rendering from the y 0 rotation position of your custom perspective camera. Save the image under Save Picture (you might want to save them sequentially). All you have to do now is go back to the transform tab and rotate the camera's y axis to 90, then save a picture, rotate to 180, save, then 270 etc. That will give you 4 square images at 720 x 720. Now you just need the top ( I don't bother with the bottom but you could do that as well). Rotate the camera's x axis to 90 degrees and grab that image. Now you're done. *You may notice that the top image has a bit of artifact in the dead center it's usually just a 4 pixel black dot. Well all you have to do is open the image in your image editor and erase it. **One other thing i discovered is that regardless of what vtfedit shows in Valve's vmt files your texture must must must use the "sky" shader and not "UnlitGeneric" this sent me on a tangent for a whole day till I realized this!

--Snakemilk 21:24, 19 May 2011 (UTC)

render order

is there any way to change this? I have a room where two corridors merge, and go out to a balcony place

but the corridors can be seen through the skybox.

ordinarily, I'd merely try to rearrange it, but I've done so so many times, I want to find the REAL answer.

can anyone help? :S Kizzycocoa 00:57, 12 December 2009 (UTC)

Sounds like you haven't bothered to compile VVIS or haven't constructed your map properly. Or look for errors that either kill VVIS or muck it up. That's about all I can offer given the info provided.--Lost 01:00, 12 December 2009 (UTC)

I have compiled it.

according to this, the width between skybox and the corridor wall is 192 (width from face to face) is that why? :S Kizzycocoa 01:03, 12 December 2009 (UTC)

here is the layout.

Layout.png

from the skybox (blue), you can see the long hallways behind. it is meant to be, like, a building buried into the face of a mountain. know why? x.x Kizzycocoa 11:30, 12 December 2009 (UTC)

The skybox renders after the world. So any part of the world that is visible will always render over the skybox. It's apparent you're a new mapper, so you can just give this a read: Visibility optimization. Let me know if that helps. If you optimize your maps properly you should cease to experience that problem.--1/4 Life 22:40, 12 December 2009 (UTC)
actually, I have mapped a wehile. I thought they were rendered at the same time. hence why this occasionally happens (the hallway), and occasionally doesn't (the massive room/beach area below).
however, the article describes how to optimize the portal file. the render order is a recurring foe for me.
case and point: water shows through walls as they are rendered last for me.
any way to change it? or is there any way to sort it?
I only ask, as it seems it took part of a brushes texture, not the entire brush is displayed. and it happens only on nearby/visible stuff, yet the far corridor walls aren't visible, but they show up :S Kizzycocoa 22:51, 12 December 2009 (UTC)
the reason why that happens is because the visleaf you're in can "see" the visleaves in the corridor, and therefore renders the area. Solokiller 12:05, 13 December 2009 (UTC)
aha, slowly getting there
so, if I used hint brushes, could I make it so that part isn't seen by the other visleaf? Kizzycocoa 12:10, 13 December 2009 (UTC)
That, and possibly the use of an areaportal to help further cull the visleafs being rendered. Areaportal location would be best within the doorway to the halls there. Combine that with a hint face a bit down each hall as needed and you should solve the visibility issues with the leafs.--Lost 15:04, 13 December 2009 (UTC)

ah, ok. thanks! ^^

A bit late to join the discussion but I think you are missing one vital fact in this map design. If that was a real building and you were standing at the end of the balcony you SHOULD be able to see the that corridor. --Noggin182 21:49, 16 August 2010 (UTC)

Occlusion

what it is is that you need a wall in your 3d skybox so that you cannot look towards the corridors. Otherwise the area isn't occluded an can be seen through the skybox. Imagine the skybox as a window, if you look out of it you can see those corridors (assumng you had a room laid out the same) so it isn't surprising. MLSTRM 15:55, 12 December 2009 (UTC)

that can't be :S
the window isn't showing the room under it, or the massive beach area I had a long way away from the skybox.
plus, it doesn't show the whole corridor. only the floor/ceiling and part of the wall at the far ends of the corridors. :S Kizzycocoa 16:13, 12 December 2009 (UTC)

Portal 2 Skybox Glitch

It seems that normal skyboxes don't work in Portal 2, except for the solid black and white ones (which use UnlitGeneric). Should we mention this on the page?

Also, they seem to be glitchy when seen through linked portal doors. FelixGriffin 14:40, 23 September 2011 (PDT)

Check out the .vmts of your skybox that's not working - is it using the $ignorez 1 parameter? This causes problems with skyboxes in Portal 2 for me. --RabidMonkey 22:08, 19 November 2011 (PST)

Sky Shader

Recent edit removed sky shader and made it unlitgeneric. It needs to be "sky" though because the hdr texture adjusts for tonemapping. You probably had a bright white sky because you didn't make a hdr compressed texture, or tonemapping in the map is incorrect.--M2VC 18:21, 27 March 2013 (PDT)