Advertisement
MrFunreal

HDR SKybox Creation Documantation

Sep 22nd, 2018
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.32 KB | None | 0 0
  1. First off, if you make the skybox for your own map, the skybox name compiled in the map properties should be "Skyboxname_hdr" the _hdr is important
  2.  
  3. 1. Make skybox in blender. (use blend file provided, draw on the sphere texture, make your own terrain or import one you downloaded)
  4.  
  5. 2. Render skybox on the sphere. This renders a "round" skybox, so you will not have a square looking skybox in the game.
  6. When rendering, the render proccess should show all six sides in the render window and then the camera view at the very end.
  7. To export the skybox render, go to the envbox texture tab, on the right side of the "Environment Map" category should be a drop down arrow
  8. Click it and select "Save Environment Map"
  9.  
  10. 3. Seperate each piece into its own texture. Flip all pieces horizontally and rotate the top and bottom +90°
  11.  
  12. 4. Use VTFedit to make LDR skybox textures (import as DXT5, apply Clamp S, Clamp T, Anisotropic, No Mipmap, No Level Of Detail, save as skyboxname_XY)
  13. XY are the suffixes:
  14. left = lf
  15. Front = ft
  16. Right = rt
  17. Back = bk
  18. top = up
  19. Bottom = dn
  20.  
  21. 5. Use HDRShop to make hdr version of skybox texture (Shift +, Save as "portable Floatmap pfm", with suffix _hdr*side* )
  22.  
  23. 6. Create txt files for every single pfm file containing the following:
  24. pfm 1 // Flag as HDR texture
  25. pfmscale 1 // brightness multiplier
  26. nonice 1 // prevent seams appearing at low texture detail
  27. //nocompress 1 // optional; removing halves filesize, but causes color banding under close inspection
  28. clamps 1 //adds Clamp S
  29. clampt 1 //adds Clamp T
  30.  
  31. 7. use Vtex to compile pfm into hdr skybox textures.
  32. Drag and drop like vpk.exe will not work, instead make a bat file containing the following:
  33. "vtex.exe location" -game "gameinfo.txt location" -outdir "output location of finished vtf files" -nopause -mkdir "folder that contains the txt files" skyboxname_hdrside.txt here
  34. pause
  35.  
  36. The "pause" line prevents the cmd window from closing so you can look for errors
  37. Do this for every single side, for example:
  38. "F:\programme\steam\steamapps\common\left 4 dead 2\bin\vtex.exe" -game "F:\programme\steam\steamapps\common\left 4 dead 2\left4dead2" -outdir "F:\programme\steam\steamapps\common\left 4 dead 2\PreviewMap\materials\skybox" -nopause -mkdir "F:\programme\steam\steamapps\common\left 4 dead 2\PreviewMap\materialsrc\skybox" Sky_TestVacant_hdrbk.txt
  39. "F:\programme\steam\steamapps\common\left 4 dead 2\bin\vtex.exe" -game "F:\programme\steam\steamapps\common\left 4 dead 2\left4dead2" -outdir "F:\programme\steam\steamapps\common\left 4 dead 2\PreviewMap\materials\skybox" -nopause -mkdir "F:\programme\steam\steamapps\common\left 4 dead 2\PreviewMap\materialsrc\skybox" Sky_TestVacant_hdrlf.txt
  40. "F:\programme\steam\steamapps\common\left 4 dead 2\bin\vtex.exe" -game "F:\programme\steam\steamapps\common\left 4 dead 2\left4dead2" -outdir "F:\programme\steam\steamapps\common\left 4 dead 2\PreviewMap\materials\skybox" -nopause -mkdir "F:\programme\steam\steamapps\common\left 4 dead 2\PreviewMap\materialsrc\skybox" Sky_TestVacant_hdrrt.txt
  41. "F:\programme\steam\steamapps\common\left 4 dead 2\bin\vtex.exe" -game "F:\programme\steam\steamapps\common\left 4 dead 2\left4dead2" -outdir "F:\programme\steam\steamapps\common\left 4 dead 2\PreviewMap\materials\skybox" -nopause -mkdir "F:\programme\steam\steamapps\common\left 4 dead 2\PreviewMap\materialsrc\skybox" Sky_TestVacant_hdrft.txt
  42. "F:\programme\steam\steamapps\common\left 4 dead 2\bin\vtex.exe" -game "F:\programme\steam\steamapps\common\left 4 dead 2\left4dead2" -outdir "F:\programme\steam\steamapps\common\left 4 dead 2\PreviewMap\materials\skybox" -nopause -mkdir "F:\programme\steam\steamapps\common\left 4 dead 2\PreviewMap\materialsrc\skybox" Sky_TestVacant_hdrup.txt
  43. "F:\programme\steam\steamapps\common\left 4 dead 2\bin\vtex.exe" -game "F:\programme\steam\steamapps\common\left 4 dead 2\left4dead2" -outdir "F:\programme\steam\steamapps\common\left 4 dead 2\PreviewMap\materials\skybox" -nopause -mkdir "F:\programme\steam\steamapps\common\left 4 dead 2\PreviewMap\materialsrc\skybox" Sky_TestVacant_hdrdn.txt
  44. pause
  45.  
  46. 8. when the vtf textures are made, you need to set up the VMT file to use a LDR skybox when players don't have HDR enabled. Use this for all VMT files:
  47. "sky"
  48. {
  49. "$hdrcompressedtexture" "skybox/skyboxname_hdrXY" //HDR texture
  50. "$nofog" "1"
  51. "$ignorez" "1"
  52. "$basetexture" "skybox/Sky_TestVacant_dn" //LDR texture
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement