|
|
Line 1: |
Line 1: |
| In this tutorial you will learn how to create your own panoramic views using [[screenshot]]s taken within the [[Source]] engine. It will assume that you know how to use the console and the Source engine in general.
| | {{src topicon}} |
|
| |
|
| == What is a Panorama Image? ==
| | [[File:Sp a3 trainsition01 panorama.png|thumb|right|A panoramic view of the map sp_a3_transition01 from {{p2|4}}]] |
| A panorama image typically refers to a very wide-angle image created by combining multiple photos together, to create an image with a wider perspective than could be obtained by a single photo. The process of combining the images together is called "stitching".
| |
|
| |
|
| That image after being transformed can sometimes be viewed using a viewer that creates the illusion that we are inside the image. There are several viewers to view panoramas (and several formats).
| | == What is a panorama? == |
|
| |
|
| With this tutorial you will learn how to create a static image panorama, as well as panoramas that use the QTVR "Virtual Reality" format ([http://www.apple.com/quicktime/download/ QuickTime] Virtual Reality).
| | A Panorama is a type of picture that is created by combining together multiple pictures to create one single wide-angle picture which can be used to create an unbroken view of the whole region surrounding an observer..<br> |
| | This can give the viewer the illusion of being "inside" the image.<br> |
| | The process of combining the images together is called "stitching". |
|
| |
|
| You need [http://www.apple.com/quicktime/download/ QuickTime] (unsupported) to view the QVTR samples.
| | == Prerequisites == |
|
| |
|
| == Creating Panoramic Views ==
| | In this tutorial [https://hugin.sourceforge.io/ Hugin] was used to create a 360° view of the map "[[Underground_(Portal_2)|sp_a3_transition01]]" from {{p2|4}}.<br> |
| Creating a panorama using the Source engine is very similar to creating them in real life. But, instead of taking pictures using a real camera, you take [[screenshots]] using the engine.
| | However, there are plenty of other programs on the internet that can be used for creating panoramas, even {{ps|4}} has the functionality integrated. [https://www.youtube.com/watch?v=EX6ErVu4AH4 Tutorial for stitching images in photoshop]<br> |
| | Optionally, if the images are in the standard .tga format, ffmpeg can be used to quickly convert all of them to .png format. Below is a windows command line command for batch image conversion with ffmpeg.<br> |
| | {{Code|preset=3|for %f in (*.tga) do ffmpeg -i "%f" "%~nf.png"}} |
|
| |
|
| There are a lot of panorama creation tools so feel free to find one to your taste and use this tutorial as a base only.
| | == Creating the panorama == |
|
| |
|
| Recent versions of [[Wikipedia:Adobe Photoshop|Adobe Photoshop]] include an '''"Auto-Align Layers"''' function which can automatically stitch together several images to make a static panoramic image, including distorting images to make them align better. This takes very little time to set up and seconds to process, however, the end result is a single normal image, rather than format for a panorama viewer plugin.
| | To create the panorama we first need some images of the scene we want to turn into our panorama. |
| | # Choose the location. |
| | # Activate cheats with {{Code|preset=2|sv_cheats 1}} |
| | # Hide the gun [[viewmodel]] and hud with this chained command: {{Code|preset=2|r_drawviewmodel 0;crosshair 0;cl_drawhud 0}} |
| | # Set the FOV (field of view) to 90° with {{Code|preset=2|fov 90}} |
| | # Disable developer mode if it is active to avoid capturing the console output in the screenshot. {{Code|preset=2|developer 0}}.{{Note|If the chosen area has moving elements, disable them with: {{Code|preset=2|phys_timescale 0}}, {{Code|preset=2|ai_disable 1}} and {{Code|preset=2|npc_freeze}} respectively or set {{Code|preset=2|host_timescale}} to 0.1. Also if the game has a vignette like in {{L4D}} it has to be disabled with {{Code|preset=2|mat_vignette_enable 0}}}} |
| | # Stand still in the chosen location and enter the following commands one by one. |
| | {{Note|In {{csgo|4}}{{Code|preset=2|mat_vignette_enable}} is a hidden cvar so {{Code|preset=2|mat_postprocess_enable 0}} has to be used}} |
| | {| class="standard-table" style="width: 50%;" |
| | |- |
| | ! Perfectly horizontal !! Angled 45° down !! Angled 45° up !! Up / Down |
| | |- |
| | | setang 0 0 0 || setang 45 0 0 || setang -45 0 0 || setang 90 0 0 |
| | |- |
| | | setang 0 45 0 || setang 45 45 0 || setang -45 45 0 || setang -90 0 0 |
| | |- |
| | | setang 0 90 0 || setang 45 90 0 || setang -45 90 0 || -=/=- |
| | |- |
| | | setang 0 135 0 || setang 45 135 0 || setang -45 135 0 || -=/=- |
| | |- |
| | | setang 0 180 0 || setang 45 180 0 || setang -45 180 0 || -=/=- |
| | |- |
| | | setang 0 225 0 || setang 45 225 0 || setang -45 225 0 || -=/=- |
| | |- |
| | | setang 0 270 0 || setang 45 270 0 || setang -45 270 0 || -=/=- |
| | |- |
| | | setang 0 315 0 || setang 45 315 0 || setang -45 315 0 || -=/=- |
| | |- |
| | |} |
| | {{Note|Every setang command has to be followed by the {{Code|preset=2|screenshot}} command. To make the process quicker bind the screenshot command to a key with {{Code|preset=2|bind key_you_want screenshot}}}} |
|
| |
|
| This tutorial also shows two ways of creating panoramic views to be used in the QVTR virtual reality format. The [http://www.panoguide.com/howto/display/gocubic.jsp GoCubic] way is simple but the results are not so good while the [http://www.realviz.com/products/st/index.php Realviz Stitcher] way requires more work but the results are a lot better.
| | == Stitching the images == |
| | | [[File:Settings hugin import.png|90px|frame|right|The import settings as described in step 2.]] |
| == Preparing to make the panoramic view == | | Once the images have been acquired and converted into png format, Hugin can be started. |
| Before you start taking the screenshots that will be used to make the panoramic view you should choose the location from which you are going to make the panoramic view. It should be a interesting area with good lighting (no one will want to see a boring area or a area that is too dark to see).
| | # Under the "Assistant" tab press the "Load images" button and select '''all''' of the images that are part of the panorama. |
| | | # When prompted set the "HFOV (v)" setting to 90 (as seen in the image).{{Note|In the iterations step, the process will show what appear to be errors but they're not actual errors.}} |
| == Creating panoramic views using {{ps|3.1}} or [http://www.realviz.com/products/st/index.php Realviz Stitcher] ==
| | # Next, press the "Align" button to start the automatic alignment process. This can take a while. |
| ''By [[user:DAVLevels|Davide 'DAV' Cintrão]]''
| | # Enter the "Move/Drag" tab and apply a roll of 180 if the panorama appears upside down. |
| | | # Go back into the "Assistant" tab and press the "Create panorama" button and set the output image format which is labeled as "LDR Format".{{Note|If you have not yet saved your project it will prompt you to save it and then prompt you where you want to save the panorama it is about to output.}} |
| Briefly it requires a lot of screenshots, a lot of stitching, and [http://www.realviz.com/products/st/index.php Realviz Stitcher]. [[user:DAVLevels|I]] used [http://www.realviz.com/products/st/index.php Realviz Stitcher 3.5], it is not the latest version but the newer version should be similar. [http://www.realviz.com/products/stx/index.php Realviz Stitcher Express] should work also.
| | # You're done! |
| | |
| Pros:
| |
| *Higher quality Panoramic Views
| |
| *Water shown correctly
| |
| *Textures shown as in game (with reflections)
| |
|
| |
| Cons:
| |
| *a lot of work to take the screenshots
| |
| *Requires a lot of work to stitch the screenshots
| |
| | |
| === Preparing the Source engine to take the screenshots ===
| |
| Since the only goal is to take screenshots, you should raise all Video settings to the maximum allowed by your system, including the game resolution. Source may turn into a slide show but don't worry about that because you are only going to take screenshots, not to play.
| |
| | |
| You need to hide the gun model and the hud:
| |
| *''r_drawviewmodel 0'' - hides the gun model (0: hide; 1: show, impulse 200 also works)
| |
| *''cl_drawhud 0'' - hides the hud (0: hide; 1: show)
| |
| And change the fov (field of view) to 90 degrees:
| |
| *''fov 90'' - game default: 75
| |
| | |
| Also, if the area where the screenshots are going to be taken has enemies, water or some moving parts, you will need to freeze Source (if you don't freeze it the moving content will appear blurred in the created panorama). For the moving parts simply change the map to make them stop.
| |
| | |
| For the rest, the normal pause doesn't work (at least, [[user:DAVLevels|I]] failed to make it work as needed) but, there are some console commands that can help:
| |
| *''host_timescale'' - slows down the host (1: normal speed; 0.1 - 10% of normal speed; 0.01 - 1% of normal speed; 0 - doesn't work)
| |
| *''phys_timescale'' - stops the physics where they are (1: normal speed; 0 - freezes physics)
| |
| *''ai_disable'' - should be used with ''npc_freeze'', disable the ai of all npc (1: disabled; 0: enabled)
| |
| *''npc_freeze'' - should be used with ''ai_disable'', freezes the npc (it will freeze/unfreeze the npc in the crosshair, check ''npc_select'' to change targeted npc)
| |
| | |
| Use the console commands above as you need, for example, if you want to make a panoramic view where you will see a lot of barrels in the air enter ''phys_timescale 0'' when the barrels are in the air and they will stay there.
| |
| | |
| Also, you may need to disable a darkening vignette (common in games since {{L4D}}) that otherwise will appear duplicated across your panorama pieces.
| |
| *''mat_vignette_enable 0'' - disables the vignette. If it's still on your screen it might need to be turned off in [[Postprocess controller]], a point entity that controls screen effects like vignettes and film grain that are undesirable for panorama creation. In {{CSGO}}, ''mat_vignette_enable'' is a hidden cvar. As a last resort, there is ''mat_postprocess_enable 0''.
| |
| | |
| === Taking the screenshots ===
| |
| You need to take a lot of screenshots in different angles to make the panoramic view.
| |
| | |
| There are two ways to take the screenshots in the Source Engine:
| |
| *''jpeg'' - jpeg console command (''jpeg_quality'' changes the quality)
| |
| *''tga'' - screenshot console command
| |
| | |
| Bind a key to the way you want to take the screenshot (later, you will need just to press that key to take the screenshot). [http://www.realviz.com/products/st/index.php Realviz Stitcher] opens both jpeg and tga file formats.
| |
| | |
| The screenshots will have to be made using the same origin using different angles (you cant move the player while taking the screenshots).
| |
| | |
| ====Using Precise Angles====
| |
| {{note|This part is not necessary if stitching using Photoshop, as Photoshop's auto-alignment allows freehand screenshots to be taken. The screenshots will work provided the player only rotates the camera view using the mouse and doesn't move the camera's origin}} | |
| Instead of moving the players view in different angles ''by hand'', a good way to make sure you got all the needed screenshots is to use the ''setang'' command to set the players view angle.
| |
| | |
| The ''setang'' command will change the players view to the entered angle:
| |
| *''setang X Y Z'' - X: look left-right (horizontal); Y: look up-down (vertical); Z: pitch (not needed, always 0)
| |
| | |
| You should take a screenshot every 30 degrees, both in the X and Y axis. But, in the 60/-60 Y degrees a screenshot every 45 degree is enough for the X axis and, in the 90/-90 Y degrees one single screenshot is enough.
| |
| | |
| And so, you need to keep setting the angle (using the console) and take the screenshot (ESC will close the console):
| |
| <pre><nowiki>
| |
| setang 0 0 0
| |
| screenshot
| |
| setang 0 30 0
| |
| screenshot
| |
| (...)
| |
| setang 0 300 0
| |
| screenshot
| |
| setang 0 330 0
| |
| screenshot
| |
| setang -30 0 0
| |
| screenshot
| |
| setang -30 30 0
| |
| screenshot
| |
| (...)
| |
| setang -30 300 0
| |
| screenshot
| |
| setang -30 330 0
| |
| screenshot
| |
| setang -60 0 0
| |
| screenshot
| |
| setang -60 45 0
| |
| screenshot
| |
| (...)
| |
| setang -30 270 0
| |
| screenshot
| |
| setang -30 315 0
| |
| screenshot
| |
| setang -90 0 0
| |
| screenshot
| |
| (...)
| |
| setang 30 0 0
| |
| screenshot
| |
| setang 30 30 0
| |
| screenshot
| |
| (...)
| |
| setang 30 300 0
| |
| screenshot
| |
| setang 30 330 0
| |
| screenshot
| |
| setang 60 0 0
| |
| screenshot
| |
| setang 60 45 0
| |
| screenshot
| |
| (...)
| |
| setang 30 270 0
| |
| screenshot
| |
| setang 30 315 0
| |
| screenshot
| |
| setang 90 0 0
| |
| screenshot
| |
| </nowiki></pre>
| |
| | |
| You will probably take more screenshots then needed (specially on the higher/lower Y axis) but no problem there since you are not forced to use all the screenshots to make the panorama.
| |
| | |
| If you still have moving parts that you didn't manage to stop/freeze, take a screenshot of those moving parts and then use them in the stitching (it helps to reduce the blurring).
| |
| | |
| | |
| Some screenshots samples from above:
| |
| [[File:HTCPV_Pic07.jpg|Realviz Stitcher screenshots sample.]]
| |
| | |
| ===Stitching using {{ps|3.1|nt=0}} CS-series===
| |
| | |
| {{note|This tutorial used CS4, but CS3 and CS5, and possibly newer versions (including CC) have similar image-alignment tools. The tutorial assumes you have basic knowledge of layers and the crop tool.}}
| |
| | |
| *Create a new document, with dimensions large enough to hold your screenshots. You might want to start off with something as large as 4000x4000, as you can always crop it.
| |
| *Drag each screenshot you will be using into the document as a new layer. Roughly arrange the layers in the right positions (this can be ''very rough'' as Photoshop will realign them anyway) and in the right order. When one image overlaps another, the higher image will be preferred, but they may be blended during the final step.
| |
| [[File:Panorama Part 1.jpg|600px]]
| |
| *Select each layer and go to Edit>Auto-Align Layers. Use these settings and accept.
| |
| [[File:Panorama Part 2.jpg|600px]]
| |
| *The images will be automatically distorted and positioned to make a rough panorama. The edges won't be perfect, but that's okay, the next step will seamlessly blend them.
| |
| [[File:Panorama Part 3.jpg|600px]]
| |
| *With each layer still selected, go to Edit>Auto-Blend Layers. Use these settings.
| |
| [[File:Panorama Part 4.jpg|360px]]
| |
| *This will give you a seamlessly blended panorama
| |
| [[File:Panorama Part 5.jpg|600px]]
| |
| | |
| *The last step is simply to crop the image to remove the empty space around the edges. Enjoy your panorama.
| |
| [[File:Complete Panorama.jpg|700px]]
| |
| | |
| === Stitching using Realviz===
| |
| To do the stitching you need to do this:
| |
| *Start [http://www.realviz.com/products/st/index.php Realviz Stitcher 3.5]
| |
| *It will open the default new project, you can keep it or go to the ''File'' Menu and select the ''New'' Item
| |
| [[File:HTCPV_Pic02.jpg|Realviz Stitcher screenshots sample.]]
| |
| *Load all the screenshots you have taken before using the toolbar button or going to the ''File'' Menu and selecting the ''Load Images'' Item
| |
| [[File:HTCPV_Pic03.jpg|Realviz Stitcher screenshots sample.]]
| |
| *Drag the first screenshot to the main area. This will be the screenshot that all other screenshots will use to be stitch, so pick the screenshot that was taken from the angle 0 0 0 (should be the first).
| |
| [[File:HTCPV_Pic04.jpg|Realviz Stitcher screenshots sample.]]
| |
| *Now keep dragging the screenshots until you get a 360 angle image and a closed panorama. To do this, you need to drag the screenshots near the already dragged ones and press enter. [http://www.realviz.com/products/st/index.php Realviz Stitcher] will then stitch the screenshots or ask you to readjust (or force it).
| |
| [[File:HTCPV_Pic05.jpg|Realviz Stitcher screenshots sample.]]
| |
| | |
| If you are having problems using [http://www.realviz.com/products/st/index.php Realviz Stitcher] check the [http://www.realviz.com/products/encyclopedia.php?product=st Realviz Tutorials].
| |
| | |
| When you end the stitching you will have something like this:
| |
| ;[[File:HTCPV_Pic06.jpg|Realviz Stitcher screenshots sample.]]
| |
| | |
| ==== Finishing the Panoramic View====
| |
| With all the screenshots stitched and with a closed panorama you can now make the panoramic view.
| |
| | |
| Go to the ''Render'' Menu and select the ''Render'' Item and set the settings you want for the panoramic view. Try different values as you want/need. | |
| | |
| | |
| Recommended settings when making panoramas:
| |
| *For low quality panoramic views but smaller files: type QTVR (JPEG, High Quality, Motion 75%, Static 75%, default for the rest); Image Quality Method 1; Sharpen normal; Resolution 768x768. Sample [http://davlevels.planetquake.gamespy.com/qtvrhl2subscr2.htm here].
| |
| *For high quality panoramic views but bigger files: type QTVR (JPEG, High Quality, Motion 75%, Static 75%, default for the rest); Image Quality Method 1; Sharpen normal; Resolution 3072x3072. Sample [http://www.fileplanet.com/dl.aspx?/planetquake/davlevels/hl2subscr2_b.mov here] (FilePlanet download).
| |
| | |
| | |
| It'll take some time to create the panorama but at the end you will have your [http://www.apple.com/quicktime/download/ QTVR] panorama created.
| |
| | |
| == Samples ==
| |
| *[http://davlevels.planetquake.gamespy.com/ DAVLevels]
| |
| **[http://davlevels.planetquake.gamespy.com/qtvrhl2subscr1.htm DAVSub Source QTVR 1]
| |
| **[http://davlevels.planetquake.gamespy.com/qtvrhl2subscr2.htm DAVSub Source QTVR 2]
| |
| | |
| == Creating panoramic views using [http://www.panoguide.com/howto/display/gocubic.jsp GoCubic] ==
| |
| ''By David Johnson: original posted [http://blog.johnsto.co.uk/?action=view&id=57 here]. Used with the authors permission.''
| |
| | |
| Briefly it requires the console commands ''mat_envmaptgasize 512'', ''envmap'' and the [http://www.panoguide.com/howto/display/gocubic.jsp GoCubic] tool.
| |
| | |
| Pros:
| |
| *very easy to use
| |
| | |
| Cons:
| |
| *Water doesn't show up correctly (no reflections)
| |
| *Low resolution (512x512 maximum)
| |
| *Shiny textures appear not so shiny
| |
| | |
| | |
| === Preparing the Source engine to take the screenshots ===
| |
| You need to increase the envmap tga size to the max supported using the console command:
| |
| *''mat_envmaptgasize 512''
| |
| | |
| | |
| === Taking the screenshots ===
| |
| Simply type the following command using the console:
| |
| *''envmap''
| |
| | |
| | |
| This will create 6 screenshots in the ''cubemap_screenshots'' directory that will be named 'XX.tga', where XX is coded as ft (front), lf (left), rt (right), bk (back/behind), up (up) and dn (down).
| |
| | |
| For example:
| |
| [[File:HTCPV_Pic01.jpg|GoCubic screenshots sample.]]
| |
| | |
| | |
| === Setting the screenshots ===
| |
| [http://www.panoguide.com/howto/display/gocubic.jsp GoCubic] expects to be given 6 images named in sequence, i.e. 'shot1.tga', 'shot2.tga', 'shot3.tga', 'shot4.tga', 'shot5.tga' and 'shot6.tga'. These map to the front, right, back, left, up and down images.
| |
| | |
| | |
| Naturally, Source naming differs. So, we need to rename the images we've already got to match, for example:
| |
| :d1_trainstation_01rt.tga » d1_trainstation_1.tga
| |
| :d1_trainstation_01ft.tga » d1_trainstation_2.tga
| |
| :d1_trainstation_01lf.tga » d1_trainstation_3.tga
| |
| :d1_trainstation_01bk.tga » d1_trainstation_4.tga
| |
| :d1_trainstation_01up.tga » d1_trainstation_5.tga
| |
| :d1_trainstation_01dn.tga » d1_trainstation_6.tga
| |
| | |
| | |
| All the screenshots are now ready to make the panoramic view.
| |
| | |
| === Making the Panoramic View ===
| |
| Converting to a GoCubic supported format (Episode 1 Mods and latter):
| |
| * Download and install Photoshop from [http://www.adobe.com/products/photoshop/ here]
| |
| * Download the DirectX 9 D3DXTextureFormat.8bi plug in from [http://files.filefront.com/D3DXTextureFormatzip/;6583154;;/fileinfo.html here] or direct [http://nigredostudios.com/temp/D3DXTextureFormat.zip here].
| |
| * Install the plug in as per the readme
| |
| * Open the 6 PFM Files in photoshop. When asked convert the color pallet, say no, and then save the PFM file as Tiff
| |
| | |
| To do the panorama you need to do this:
| |
| *Load up [http://www.panoguide.com/howto/display/gocubic.jsp GoCubic]
| |
| *Go to the ''Make Pano'' menu and select the ''Make Pano Movie...'' item
| |
| *Browse to the location where you renamed the files, and select the first one (e.g. ''d1_trainstation_1.tga''), and hit Open
| |
| *Another window will pop up asking where you want to save the generated panorama, so specify a filename or accept the default ''default.mov''
| |
| | |
| | |
| It'll do a little crunching and within seconds you have your [http://www.apple.com/quicktime/download/ QTVR] panorama.
| |
| | |
| ==See also==
| |
| *[[Screenshot]]
| |
| *[[How To Take Artistic Screenshots]]
| |
|
| |
|
| == External links == | | == External links == |
| *[http://www.panoguide.com/howto/display/gocubic.jsp GoCubic] | | * [https://jaxry.github.io/panorama-to-cubemap/ Panorama to Cubemap]: Useful tool for turning panoramas into [[cubemap|cubemaps]] |
| *[http://www.realviz.com/products/st/index.php Realviz Stitcher]
| | * [https://hugin.sourceforge.io/download/ Official Hugin download link] |
| *[http://www.realviz.com/products/stx/index.php Realviz Stitcher Express] | | * [[cubemap]] |
| *[http://www.realviz.com/products/encyclopedia.php?product=st Realviz Tutorials] | | * [[env_cubemap]] |
| | |
| [[Category:Level Design]] | |
| [[Category:Tutorials]] | |