Banner image
Rec Room Studio Performance TipsMay 20, 2024
Rec Room Studio DataDownloading and preparing Rec Room Studio data for your room requires time, especially for users with slower internet connections. Therefore, it's crucial to optimize your data in Rec Room Studio. Improvements in memory usage with Rec Room Studio data typically lead to faster load times. Since data preparation is often a significant factor in load times for many rooms, it's essential to prioritize optimization efforts especially if you have players navigating through subrooms.
Page image
Performance Tips
  1. Optimize mesh usage by combining them into simpler groups where appropriate. Avoid overloading with large groups, as this can affect performance.
    1. Consider merging meshes that are used repeatedly. For instance, a fence composed of individual posts and boards can be combined into a single mesh for sections of the fence.
  2. Minimize the number of materials.
  3. Mark objects as static if they are not going to move.
  4. Employ GPU instancing (draw call) where suitable.
    1. Ensure that items flagged as Static and intended for GPU Instancing aren't also flagged for "Static Batching," as this will override GPU instancing.
Materials & Draw CallsMultiple materials on meshes can increase draw calls. Aim for one material per mesh. Draw calls occur per mesh, per material, except in complex cases. Issues arise when surpassing a threshold of unique meshes and materials.
  • A draw call represents a command sent from the CPU to the GPU, instructing it to render an object, texture, or shader on the screen. Each draw call provides the necessary information for the graphics API to execute the rendering process.
  • Monitoring Draw Calls. It's ideal to aim for a range between 50 and 200 max per frame, which appears to be an optimal sweet spot for Quest 2 performance, especially when coupled with Occlusion culling.
  • Draw Calls Tutorial: https://www.youtube.com/watch?app=desktop&v=IrYPkSIvpIw
  • You can see draw call estimates a subroom’s objects in the Geometry Render tab of the Performance Explorer in Rec Room Studio.
Page image
Reducing Draw CallsA good way to improve performance is to reduce the number of draw calls in your room. A draw call can be any object that shows on screen. Examples of what would cause a draw call would be meshes, vfx, game objects, and materials. Here are some tools you can utilize in order to reduce draw call count.Use Static BatchingStatic batching is a built-in tool in Unity designed to optimize the rendering of static meshes. It can help reduce draw calls by rendering identical objects once rather than multiple times.Object CullingObject culling can be utilized to prevent the rendering of objects that are not visible to the player in the background.
Page image
TexturesTextures can have a large impact on the time it takes to load and render a room. In general, try to keep texture sizes relative to the size of objects in your room - larger objects might need larger textures, while smaller objects should use smaller textures.
  • Most platforms prefer textures that are sized with power of two (32, 64, 128, 512, 1024, etc), square, and in general ‘smaller is better’. A good practice is to go as low as you can, without impacting the visual quality of your room.
  • Rec Room automatically adjusts texture sizes for different platforms. To keep things smooth, stick to textures that are 1024x1024 (1K) or smaller.
  • Alpha masks and transparency are more expensive to render, so minimize their usage for the best performance.
  • Use texture size overrides sparingly and only when necessary.
  • Learn more on compressing textures in Unity: https://docs.unity3d.com/Manual/class-TextureImporterOverride.html
Texture Atlases/Trim sheetsTexture atlases or trim sheets can consolidate multiple textures into a single one, allowing the utilization of a single material.
Page image
Render TexturesIn Unity, a render texture is a special type of texture that stores the image rendered by a camera. It allows you to capture the output of a camera and use it as a texture in your scene. Render textures are commonly used for creating effects like reflections, shadows, or dynamic textures on objects in a scene. They are also used in off-screen rendering for things like mini-maps or surveillance cameras. Essentially, they provide a way to capture and manipulate rendered images within the Unity environment.
  • It's advisable to minimize or altogether refrain from using render textures, as they can cause poor performance.
  • Tip: If you're going to use render textures and cameras, use only one in the scene.
Grayscale TexturesUse grayscale textures where possible and tint the material in Rec Room Studio to save on the number of textures you have.
  • For example, instead of importing two different colored wood textures, import one greyscale one and create two materials in Rec Room Studio with different tints. This significantly reduces the upload size.
Page image
Page image
In the example above, one texture is in color while the other is grayscale. When utilizing grayscale textures, Unity's color wheel allows you to adjust its color dynamically, eliminating the need for separate color textures and thus improving performance. By using grayscale textures, you can efficiently apply color variations directly within the Unity editor, resulting in significant performance savings.MeshesIn Unity, meshes are the 3D shapes that make up objects in your virtual experiences. They define the structure and appearance of these objects.
  • Too many meshes
    • When a scene contains an excessive number of separate mesh objects, performance issues can occur due to the overhead of managing and rendering each individual mesh.
  • Meshes with excessive polygons & vertices
    • 3D models with a lot of tiny pieces (high poly count). They make things look detailed but can slow down your creative experiences and impact performance.
      • Tip: Aim for meshes with fewer than 5k triangles in RRStudio content. While a "hero" mesh with 20k-30k triangles may be acceptable, excessive use can lead to issues.
      • Tip: In optimizing performance, note that vertex count has a greater impact than polygon count.
  • Mesh Tips 
    • Add extra detail only where necessary. If you can achieve the same effect using textures, choose that option instead of adding unnecessary detail to the mesh, such as a slight bevel.
      • Tip: Utilize normal maps to add details!
    • When working with meshes, consider the significance of each object within the room. If it's an item players will directly interact with, it's worth investing resources to ensure it looks great. However, for small decorative elements like ceiling-hanging plants, it's best to keep them as low-poly as possible.
PrefabsModels encompass more than just meshes. A model in Unity typically refers to a collection of meshes, along with other associated data such as materials, textures, animations, and rigging (if applicable).
  • Structure Model Tips 
    • Modeling areas within a structure that players or users cannot access, such as the entire interior of a building in a game or virtual environment, is unnecessary and should be avoided. Allocating resources to model inaccessible interior areas unnecessarily complicates the project and can harm performance without enhancing the user experience.
Transparency
  • Avoid transparency and only use it when necessary.
  • Consider faking transparency by using an opaque material with a high spec and gloss example (image example would be good here).
  • Avoid many layers of transparency. It is more expensive to look through many panes of glass versus 1 pane of glass.
  • Avoid large glass surface areas that take up a large portion of the screen.
  • Consider using alpha clip or additional geometry to sell a transparent silhouette instead of using full transparency. (See how we do our trees in RROs).
  • There are many ways to fake transparency and consider using multiple methods to sell a more performant look.
CollisionUse capsule, sphere or box colliders over mesh colliders whenever possible to optimize performance.Unity CanvasConsider adding fonts cautiously, as they can be unexpectedly memory-intensive in Unity. We recommend using the default fonts provided by Rec Room Studio to optimize performance.SkyboxIf you're using big textures, keep them for the skybox, but don't go over 2K size; it's usually not needed.Avoid using EXR files for skyboxes. Even though they're common in free resources, they're huge and have too much detail for regular use. Convert your HDR files to png format instead.TerrainTerrain game objects are generally memory expensive to have in your room. For indoor, urban, or mostly flat scenes, try using a plane instead.GPU Instancing on terrain details
  • Instancing, in the context of GPU instancing, optimizes memory usage by instructing the GPU to utilize existing model data stored in memory and draw it across multiple instances simultaneously, rather than processing each instance individually.
  • By default, Unity terrains offer GPU instancing solely for detail meshes. This is valuable particularly when incorporating abundant foliage, such as grass, onto terrains.
  • The size of the terrain combined maps can be set with the "Base Texture Resolution" setting.
Terrain Maps Texture SizeTerrains require numerous uncompressed textures to store the data used to define their height, color, details, and other characteristics. The size of these maps can be set in the terrain settings.
  • Use 4 texture layers or less, anything more than 4 will double the cost of the terrain system.
  • Creators aiming to save memory without compromising detail can achieve this by shrinking the size of their terrain, ensuring that the details are more concentrated and focused.
  • Adjust settings in terrain settings by selecting your terrain and navigating to the Inspector window.
Page image
Combined Maps
  • You can combine different grayscale texture maps together using separate RGB channels in a texture, such as smoothness metallic and AO. This allows you to condense the number of textures you have from three to one. Alternatively, you could use one image and place your metallic in the Red channel, AO in the green, height in blue, and smoothness in alpha. This approach maintains the same level of detail while reducing memory usage by a quarter. This is particularly helpful for terrain layers, as they have a 'mask map' property.
  • Example: Terrain Paint > Paint Texture > with layer palette selected > Mask Map
Page image
Billboarding ComponentBillboards are an effective way to orient an object to face the camera. These can quickly impact frame rate if you have too many, so try to stay under 20-30 of them in a room.Emitters/Particle Systems/VFX
  • A great place to start for optimizing a particle system is to focus on how can I solve this problem with less?
  • In general, there are lots of ways to kill your perf with particles. While skipping over one of these guidelines won't kill your perf, Skipping over multiple guidelines will generate a more expensive particle system.
  • Look at other optimization best practices that are already established above (Texture, Mesh, memory).
  • Keep your texture size small (Less than 512).
  • Reduce the total amount of emitters in your system and your scene.
  • Keep your particle count below 100 (utilize the max particle count option).
  • Use the least amount of particles as possible, don't try to max out your system.
  • Using a particle system to spawn lots of meshes will reduce performance.
  • Avoid complex shaders and materials. Keep it simple and use shaders that don't require lighting. (additive, multiple, unlit).
  • If using meshes, keep them simple and low poly (200 triangles or ideally the least amount of tris as possible).
  • Try to use a traditional 2d particle quad whenever possible.
  • Avoid using complex particle operations like (Noise, Lights, Tails, Sub Emitters, Collision).
  • Avoid large particles that take up a lot of screen real estate.
  • Use simple curves instead of a complex curve with many points.
  • Don’t use cast shadows, avoid lighting your particles.
Imported SoundsPlease keep an eye on the quality, format, and length of audio files, as they can take up a lot of memory.
  • Make sure that your audio files are mono (1 channel) if you intend to use them as 3D sound effects. You are wasting space if you use stereo files as 3D positional sounds.
  • When using stereo sound effects, make sure that the file contains different information in the left and right channel. If the left and right channels contain the same information, the file will sound the same as mono files but will take up twice as much space.
  • Keep your loops as short as you can get away with to keep the size to a minimum. Loops should be long enough that the player won’t recognize that it is looping but not a millisecond longer. 
  • Edit out unnecessary silence from the audio files. Try to keep the tail of the sound as short as possible without making it end abruptly. 
  • Don’t go over sample rate of 48kHz. There’s very little sonic advantage to going any higher and doubling the sample rate doubles the size.
  • You are most likely fine with bit depth of 16 bit. Most Rec Room experiences wouldn’t benefit from having a wide dynamic range since many of the players are playing on mobile.
  • Compression formats are often a trade off among memory, CPU usage and quality. For shorter sounds you can usually use PCM or even ADPCM in some cases for extra savings. For medium or longer sounds use Vorbis/mp3. Play around with the “Quality” settings to maximize the savings without any perceived loss in audio fidelity. 
  • Consider setting large audio files, such as ambience or music, to stream for a huge memory savings. However, streaming isn’t ideal for sounds that require perfect sync as there can be a slight delay in playback. 
  • Unity has a great writeup of Audio clips - https://docs.unity3d.com/Manual/class-AudioClip.html
Note: If you're a tutorial creator, I encourage you to create small bite-sized portions of this information. It's incredibly helpful, and we may share your content [=)]!
Check out our other Performance Tips!