GameBanana shows no ads to members. Sign up now!
Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

Fake Skyboxes Using Cubemaps

A Tutorial for Source Engine

Fake Skyboxes for the Source Engine

Creating a fake skybox allows you to have multiple skyboxes, it also allows you to hide geometry behind the material, as it will not render anything behind it as though it were a solid brush! The benefits of this method is mainly that you can make fake skies up to 4096x4096 without the use of any resolution scaling software.

   !!!! If you're unsure if you need LDR or HDR, you only need to make the HDR version as it will work for both LDR and HDR - but beware the file size will be huge and it will be preferable to use LDR if you can. !!!!

If do you need HDR ensure you have either Photoshop or ImageConverter!
Note: While ImageConverter does work, the colours will suffer. Photoshop will look better.

1.

To start off, we need to have a folder setup that is in your game directory (eg, tf2/materialsrc, cstrike/materialsrc, csgo/materialsrc) that mirrors the one you'll want it output to. For instance, if you want your output folder to be "cstrike/materials/fakeskies/" then your folder setup should be "cstrike/materialsrc/fakeskies/"

2.

Then, we need to convert our VTFs into image editor readable files. Find your skybox of choice in your files, it should have 6 total VTFs, one for each face, as such:

<yoursky>bk.vtf
<yoursky>dn.vtf
<yoursky>ft.vtf
<yoursky>lf.vtf
<yoursky>rt.vtf
<yoursky>up.vtf


We need to convert these into TGA files, you can do this through VTFEdit by individually opening all 6 VTFs and exporting them (File > Export). The result should be 6 TGA files, one for each of the skybox's faces, and move them to your working folder we created in materialsrc.

Your materialsrc folder should look something similar, with 6 newly generated TGAs.

!!! LDR Steps - If you do not need LDR, skip these two steps. !!!



1. (LDR STEP)

Create a .txt file with the same name as your skybox and within it, add the following lines:


nonice 1
nocompress 1


2. (LDR STEP)

Drag the TXT file onto VTEX.exe located in your /bin (eg, Counter-Strike Source/bin, Team Fortress 2/bin, Counter-Strike Global Offensive/bin).


Once compiled, VTEX will put the resulting VTF in your "cstrike/materials/" - and not the current "materialsrc" path.

!!! HDR Steps - If you do not need HDR, skip these three steps. !!!



1. (HDR STEP)

Before we begin, the Source engine wants us to use .pfm files for HDR so to convert them from TGA you can use Photoshop or ImageConverter.
(Side note: Source likely has a built-in way to do this with "pfm2tgas.exe" but there's a lack of documentation on it)

Photoshop:

Open up the 6 TGA files, then navigate to Image > Mode > 32 Bits/Channel to convert the image, in addition, we need to flip all 6 vertically so go Image > Image Rotation > Flip Vertically, then File > Save As > Select "Portable Bit Map" and rename the file extension to .pfm - do this for all 6 TGAs

ImageConverter:

Drag and drop all 6 TGA files into ImageConverter, change the following settings in the "Save" and in the "Actions" section:

Rotate and Mirror > Flip Horizontally

Name: %name%
Format: *.pfm - Portable Float Map

When the settings are correct, hit "Convert and Save."

2. (HDR STEP)

Create a .txt file with the same name as your skybox and add the following lines:


pfm 1
pfmscale 1
nonice 1
nocompress 1

Note: if you've made an LDR version from the steps above, just add the two new lines pertaining to the PFMs.

3. (HDR STEP)

Drag the TXT file onto VTEX.exe located in your /bin (eg, Counter-Strike Source/bin, Team Fortress 2/bin, Counter-Strike Global Offensive/bin).

Once compiled, VTEX will put the resulting VTF in your "cstrike/materials/" - and not the current "materialsrc" path.


3.

Finally now the HDR and/or LDR VTFs have been generated, you can create a matching VMT file:



"WindowImposter"
{
 "$envmap" "<yourpath>/<yoursky>"
 "$nofog" "1"
}


Note: If you ONLY made HDR, remove the .hdr naming part of the VTF. If you have both, the game will find the .hdr version on its own!

!!! This material will not seal your map, so be careful what brush(es) you put it on !!!



Thanks to Juxtapo, NvC_DmN_CH, Shadow Sheep, and xen for their help on this tutorial.

If there are any errors in the tutorial, or you're having trouble you may contact me on Discord - Syncronyze#5202
Sign up to access this!

No comments yet

Embed

Share banner
Image URL
HTML embed code
BB embed code
Markdown embed code

Credits

Creator
Syncronyze
Syncronyze Joined 6y ago
Offline
1,060 points Ranked 25,239th
9 medals 1 rare
  • 6 years a member Medal icon
  • One month a member Medal icon
  • 6 months a member Medal icon
  • 1 year a member Medal icon
  • Returned 100 times Medal icon
  • 2 years a member Medal icon
:)
Special Thanks
NvC_DmN_CH avatar Apocalyptic Flag
Affiliation
Apocalyptic
NvC_DmN_CH username pic Joined 7y ago
There
Apocalyptic Flag Affiliation: Apocalyptic
13,405 points Ranked 491st
49 medals 4 legendary 13 rare
  • Returned 5000 times Medal icon
  • 15+ Entries! GameBanana’s Christmas Giveaway 2017 Medal icon
  • 1st Place - The Heatwave Skinning Contest Medal icon
  • Became a Ripe Supporter Medal icon
  • Submitted 20 Gamefiles Medal icon
  • 3rd Place - The
Original Tutorial
xen
Information
Shadow Sheep
Information
Juxtapo
Juxtapo Joined 14y ago
Offline
6,810 points Ranked 1,039th
13 medals 1 legendary 1 rare
  • 10 years a member Medal icon
  • 6 years a member Medal icon
  • Became a Studio Leader Medal icon
  • Reached 1,000 Points Medal icon
  • Reached 2,500 Points Medal icon
  • One month a member Medal icon
Good Guy

Submitter

Syncronyze avatar
Syncronyze Joined 6y ago
Offline
1,060 points Ranked 25,239th
9 medals 1 rare
  • 6 years a member Medal icon
  • One month a member Medal icon
  • 6 months a member Medal icon
  • 1 year a member Medal icon
  • Returned 100 times Medal icon
  • 2 years a member Medal icon
Syncronyze
Creator
Sign up to access this!
Sign up to access this!
Sign up to access this!

Game

Sign up to access this!

Category

Details

Difficulty Level
Intermediate

Attributes

Share

  • Share on Reddit
  • Share on Twitter
  • Share on Facebook
  • Today's Pick
    Featured on Dec 23 2020
  • 4
  • 868
  • 1mo
  • 30d

More Other/Misc Tutorials