Room Creation - eisclimber/ExPresS-XR GitHub Wiki

Room Creation

ExPresS XR has an in-editor tutorial for its room creator and creating rooms using ProBuilder. The following description is from the "Room Creation Tutorial".

You will find a YouTube video regarding this topic here.

How to Create a Room

ExPresS XR comes with a Room Generator that is able to generate rectangular rooms of arbitrary size.

For more complex rooms and levels, Unity's ProBuilder can be used, which is already installed. It allows simple vertex and edge modification, allowing a similar workflow as with most 3D modeling software. The following dialog will let you create some directly, but it also highlights how to create it yourself. For further details on how to use ProBuilder take a look at this tutorial.

If you already have models for your room, you can skip to the last two steps to add a custom skybox and teleportation.

In the next step, you have the option to open the room creator, and the ProBuilder-Dialog will automatically launch.

Create Rooms

In order to auto-generate a room, you can use the Room Creator. It will create a simple room with some sample Materials and optional Teleportation. Open it by clicking the button above or selecting 'ExPresS XR > Rooms... > Room Creator' in the Menu Bar. To create a room with ProBuilder, start by pressing on the '+'-sign next to the 'New Shape'-option in the ProBuilder-Dialog. This will open another window where you can select the shape 'Cube'. Keep the scale on (1, 1, 1). Otherwise, the materials will not scale properly. Be sure to hit 'Build' as the blue cube (and any other shape) will be just a preview. After pressing 'Build' the cube will turn gray. Go into face mode by selecting it in the little toolbar that appeared when opening ProBuilder at the top of the game view. Select a face and move the arrows to change the size. Do this for all dimensions, until your room has the desired dimensions. If an exact size is required, you can enable the grid (dropdown top right) and set the grid size accordingly. Go back to Object-Mode and select the room, then select 'Invert Object normals' from the ProBuilder-Menu. Materials can be assigned to each wall or to the whole object via drag'n'drop by selecting them in the corresponding mode.

Add Furniture

With the room's general layout complete, you can now place your furniture. Most of the furniture can be added later, but placing doors and windows is recommended now as they later require cutouts to be made in order to go or look outside. These modifications can be performed much easier with doors and windows in place as visual indicators of where to make them.

Feel free to buy or create your own models. Some window and door models can be found at: "Assets/ExPresS XR/Tutorial Assets/Room/".

Place the doors and windows at your desired location, intersecting the room's walls. If you don't have the correct models yet but know the dimensions, place a cube instead or enable grid snapping.

Make Cutouts

Finally, in order to create holes that allow users to walk or look through, we have to punch some holes. This can be done the easiest by adding edges that wrap around the room to split its faces in such a way that they fit the dimensions of the window/door and can be removed after. This is called an "Inserting Edge Loops".

Change to ProBuilder's "Edge Selection"-Mode (The triangle at the top of the Scene-View). Select an edge of the room that is orthogonal to the direction to split the room and choose the "Insert Edge Loop"-Option of ProBuilder. Move the newly generated edge loop to the desired location by using it's gimbal. (When placing doors or windows, try to move the edge loop inside the window/door's frame rather than placing it exactly on the edge of the frame may cause light to seep through at the side of the frame.)

Place more edge loops enclosing the area to cut out. Then change to ProBuilders "Face Selection"-Mode, select the face to remove and delete it by choosing the "Delete Face"-Option.

Extrude Hallways

Proceed like when making cutouts, but instead of deleting a face, extrude it. Press 'W' to change to the "Move Tool" in "Face Selection"-Mode and select a face and extrude it to the desired length by holding shift and moving the faces gimbal'. Afterward, assign the material to the floor material and combine both floors by selecting both and executing the ProBuilders "Merge Faces"-Option. If your room has was generated with a TeleportationArea, execute the "ExPresS XR > Rooms... > Update Teleportation Area of Selected Rooms"-MenuCommand.

(Optional) Skybox

The skybox is a special texture that is used to provide a visual background at "infinity", but it can also be used to get lighting information for the scene.
The texture can either be a HDRi texture (a HD 3D-Image with lighting information) or one generated from a shader like the default skybox.
You can set it by going to 'Window > Rendering > Lighting', under the tab 'Environment' the value 'Skybox Material' and either modifying the default skybox shader, using one of the HDRi's in "Assets/ExPresS XR/Materials/Skyboxes/DefaultSkybox.mat" or creating your own.

(Optional) Teleportation Area

If players should be able to teleport on any floor in the room, a teleportation area can be added to the whole room by selecting the MenuItem "ExPresS XR > Rooms... > Add Teleportation Area to Selected Rooms". It will be added as a child of the room and can be manipulated with ProBuilder to your likings. Be sure that the area is a little bit above the room's floor to be detected properly. If the whole floor should be a teleportation area, simply selecting "ExPresS XR > Rooms... > Update Teleportation Area of Selected Rooms" after manipulating the floor layout will do just that.

⚠️ **GitHub.com Fallback** ⚠️