Environments/Getting Started/environments/Getting Started

From Valve Developer Community
Jump to: navigation, search
English (en)
... Icon-Important.png

Getting Started with SteamVR Workshop Tools

Tutorial first.png

In this tutorial, we will walk through the basics of creating an environment using SteamVR Workshop Tools.

Topics we will cover in this tutorial:

  • Creating an addon
  • Player, Floor, Light
  • Build and test
  • Bringing a model into SteamVR Workshop Tools
  • Adding Teleport
  • Adding a sky
  • Submitting to the SteamVR Workshop

What you will need

Tutorial model.png
  • A 3D Model in OBJ or FBX format
    • Your model can be made in any 3D modeling program that supports OBJ or FBX export.
    • This can also be a 3D model made with photogrammetry. For a tutorial on creating a environment from photogrammetry, click here.

Create an addon

SteamVR Workshop Tools
  • Open SteamVR Workshop Tools - this is opened from the SteamVR Status menu > Workshop > Create/Modify an Environment.
  • For a new environment, click “Create Empty Addon” and name your addon (this will be used in the file path of your Workshop submission).
    • A environments "addon" is similar to a Dota 2 custom game. An addon consists of a map, models, materials, Panorama UI files, Lua scripts, etc.--anything that is required to make the addon function.
  • Select your addon and click “Launch Tools.”

Open Hammer

Tutorial openhammer.png
  • Hammer is Source 2's level editor. This is where everything will be assembled before publishing to the Steam Workshop.
  • On the Asset Browser window, click the hammer icon in the top left.
  • In Hammer, hit Ctrl-N to (or File > New File) to start a new map.

Place Player

Tutorial placeplayer.png
  • This determines where the player will start when they load your environment.
  • Select the Entity tool from the left-most tool panel. (light bulb icon).
  • Make sure the Entity Class is “info_player_start” (this should be the default).
  • Click in the center window to place the Player Start. It should look like a low poly scientist, and is a good scale reference.
  • You can adjust the player start position and orientation using the Translate (T) and Rotate (R) tools.
    • Changing the scale of the player start entity will have no effect on the scale of the player in VR. If you wish to change the size objects and models are shown at, change their scale instead.
  • For more information on navigating around Hammer: Hammer Navigation

Add a floor

Tutorial placeground.png
  • Click the block tool on the left.
  • Click and drag in the center panel to make a floor.
  • It will come in centered around the origin, which means your player start will be inside of it.
  • To lower it, first make the grid more granular by pressing the “[“ button.
  • Then press “T” to go into translate mode.
  • Drag the vertical arrow down until the ground is flush with the origin.

Add a light

Tutorial placelight.png
  • Click the entity tool on the left.
  • Type “light_spot” in the entity class field.
  • Click in the center panel to place your light.
  • Use the Translate “T” and Rotate “R” tools to position the light pointing down on the player start.
  • You can make the light brighter by putting a larger number under Brightness in Object Properties.

Build and test

Tutorial buildmap.png
  • Press F9 and click Build to build the map and view it in VR.
  • You will be asked to save – do so.
  • Once this is built you should be able to see a ground and a pool of light in VR. Not much to see or do, but we’ll fix that in the coming steps.

Bring your model into SteamVR Workshop Tools

Tutorial openmodeleditor.png
  • Go back to the Asset Browser click the Model Editor button.
  • Click "New VMDL from Mesh file", browse to, and select your OBJ or FBX.
  • Click OK when it asks if you want to create a new content directory.
  • On the dialog window that comes up, select the “…” button at the end of the environment Directory line.
    • Create a folder here called whatever you want (the name of your environment, for instance).
    • You should end up with something that looks like ".../steamtours_addons/popcorn/models/popcorn".
  • Under the "Collision type" drop down, select "Collision using exact geometry".
  • For everything else you can leave the defaults.
  • Click OK. Depending on the complexity of your model, it may take some time to import.

Bring your model into Hammer

Tutorial placemodel.png
  • Find your model in Asset Browser (you can search in the Asset Browser if you need to).
  • Once you find it, you can drag the model into Hammer.
  • It should now appear in your world.
  • Resize “E”, Move “T”, Rotate “R”, or Duplicate “Shift+Drag” until you are happy with the placement.
    • Depending on what your model (or environment) is, you may not need the floor you created in the earlier steps. Feel free to delete it if you don't need it, it's not required.
  • You can build and view in VR to see if you like how it looks (F9).

Place Teleport areas

By default, players will be able to teleport to any reasonably flat surface. For a greater degree of control, you can also place teleport meshes and teleport markers. Once you place a teleport mesh or marker, the player will only be able to teleport to those places you’ve identified.

Tutorial teleportmesh.png

Placing Teleport meshes

  • Teleport meshes work great for large, flat areas that you would like the user to be able to teleport around.
  • Select the Polygon tool.
  • Click to add vertices around your desired teleport area until you have the shape you want. Hit Enter when done.
  • You may need to Translate(T) and Scale(E) the polygon to get it to the right size and place in your map. Make sure the mesh is slightly above the ground to prevent z-fighting.
  • To make this polygon into a teleport mesh, go to the Materials tab in the center bottom panel. Search for “teleport” and find teleport_area_visible.vmat.
    • Click and drag this material onto your polygon to apply the material.
    • Select the polygon and you should see options show up in the bottom right panel.
      • If you don’t see options, make sure “Mesh” in the top right panel is selected.
      • If your teleport mesh is more complex than a simple square or rectangle, make sure you select 'Physics Type: Mesh' in the Object Properties box - this will ensure the teleport beam correctly traces against the mesh.
    • Click “Tie Selected Meshes to Entity”.
    • Type vr_teleport_area into the field and hit enter. This gives the mesh you just created the properties needed to teleport the player around.
    • If you have a teleport mesh that is concave or non-planar, make sure to set "Physics Type" to "Mesh" under Object Properties.
  • Tip: to add teleport mesh "borders," select all the edges of the teleport mesh, and then use the Resize tool "E" while holding Shift to create a new "face" on the mesh. This will work even if the mesh is already a vr_teleport_area entity.
Tutorial teleportmarker.png

Placing Teleport markers

  • Teleport markers are great for irregularly shaped areas, or spots of interest.
  • Select Entity (light bulb icon).
  • In the Entity Class field type vr_teleport_marker.
  • Placing teleport markers is as simple as clicking on your model. Like everything else, these markers can be moved around once placed.

Add a Sky

  • If your map does not include a sky the background will be completely black.
Tutorial sky1.png

Create the sky material

  • To add a sky, first you will need a cube-map or lat-long image to serve as your sky (like the Background images that are used in SteamVR).
  • You will want this image to be relatively high res – either 8192 x 4096, or 4096 x 2048.
  • In the Asset Browser, click the Material Editor button
  • Click the Create New button in the top left
  • In the center panel, click the Shaders… button. Select “Sky” and click Accept.
  • Hit Ctrl-S to save this material.
  • Once saved, right click on the material in the left panel and click “Open containing folder”
  • Find your sky image and drag it into this materials folder
  • Back in the Material Editor, click on the magnifying glass under Sky Texture in the third panel.
  • Select your sky image and click Accept.
Tutorial sky2.png

Add a sky to your environment

  • Go back to your map in Hammer.
  • Select Entity (light bulb icon)
  • In the Entity Class field type env_sky
  • Click to place this in your map. (It doesn’t matter where you place this, your skybox will still be in the correct place )
  • In the Object Properties menu, click the magnifying glass next to Sky Material.
  • Find and Accept the sky material you just created.
  • Your sky should now appear in your map. Build and test to see how it looks!

Optional: Add a Cubemap

  • Cubemaps are used by the vr_standard shader both for reflections and ambient lighting. For more realistic lighting, it can be useful to add one to your scene.
  • Select Entity (light bulb icon).
  • In the Entity Class field type env_combined_light_probe_volume.
  • Place the entity roughly in the centre of your environment - this will be where your reflections and lighting will be calculated from.
    • For a photogrammetry scene, setting 'Calculate Diffuse Lighting Using Cubemap' on the entity should give you better ambient lighting on transient objects (player avatars etc.)
  • Drag the white dots shown on the sides of the blue cube to encompass the area you will be navigating through - for a rectangular room, this should just contain the walls.
  • For a large scene (such as one containing a geometry-based skydome), creating a light_importance_volume can really help reduce light baking times.
    • Place a light_importance_volume entity in the centre of your map, and extend its bounds to cover the navigable volume. This won't make much difference for photogrammetry-based maps with lighting baked into the materials, but will help things go faster for baking cubemaps.
  • Now, in the Baked Lighting menu at the top of the Hammer window, select Bake All Lighting. This may take a few minutes, and will automatically regenerate any cubemaps in combined light probe volumes in the scene.
  • The light probe entity shown in the 3D view will now look like a mirrored sphere - this is to help visualise what has been baked, and will not appear in the compiled map.
  • Remember to re-bake lighting whenever you significantly change your scene, otherwise things may not match up!
  • You may need to increase the distance for 'Bake Far Z' in the light probe entity's Object Properties if the sky or other distant objects appear as black in the cubemap.

Test your environment

Tutorial first.png
  • To build and test press F9. Make sure the "Full Compile" option is selected.
  • Once built, you should be able to test your environment now in VR.
  • Continue adding and editing models, environments, and lighting to your environment until you feel it's ready to submit to the Workshop.

Submit to the SteamVR Workshop

Destinations workshop manager.png
  • Once you are happy with your environment, make sure to remove any test and temporary maps from your maps directories.
  • Then go back to the Asset Browser and click the Workshop Manager button.
  • Click on the "+" icon or go to File > New Submission.
  • Fill in the fields and select an image to represent your environment. A screenshot of the environment works great as a thumbnail.
  • Finally, click “Submit” to upload your environment to the Steam Workshop. Depending on the size of your submission, this may take a while.
  • Your environment will now show up in the SteamVR Workshop.
    • Don’t forget to sign the Workshop agreement, or others will not be able to see your work.
    • It's also good to subscribe to your new environment to double-check how it appears to the public. It will appear as a separate item in the in-game environments list, with a full name and thumbnail and without a folder icon in the corner.

Congratulations! Other players will now be able to download and explore your environment.