Creating a Realistic Laboratory Environment for VR
Author: Taras Voznyi
Introduction
Imagine you are a student in an actual biolab. A single careless movement could contaminate a microbiological sample. You might break a slide costing $100, or worse, improperly load a centrifuge, leading to mechanical failure and dangerous debris.
In the real world, such errors result in lost time, waste of expensive materials, and real safety hazards. At the same time, the fear of making mistakes often acts as a barrier to experimentation and deep understanding.
But what if a damaged $500,000 instrument could be restored to working order by pressing a "Reset" button?
That is where Virtual Reality (VR) revolutionizes the learning process. It allows students to fail, learn, and repeat complex procedures in an environment where the only outcome is knowledge.
However, for this approach to be effective, the virtual space must be more than just a game; it must be convincing.
Our objective was to create a realistic virtual laboratory that remains a comfortable environment for learning. This requires a complex balance. We need realism to ensure credibility and aid in the acquisition of motor skills. Yet, we must work within the strict technical limitations of VR, where unoptimized geometry or incorrect lighting can ruin the user's immersion.
In this article, I will take you through my workflow as a 3D Environment Artist creating a VR bio-lab simulation. We will explore the entire process: from reference gathering and scene blockout to asset optimization and lighting techniques in Unity that ensure performance remains stable at 90+ FPS.
Analysis and Blockout
Our work on the virtual laboratory began with a deep dive into how real biomedical labs are set up. We gathered and processed a wealth of information: from safety standards and technological protocols to hundreds of photos and videos from real bio-labs. This research provided a clear understanding of key aspects such as zoning, ergonomics, and physical dimensions. You can only effectively plan the space once you truly understand its functionality.
Virtual Reality requires adherence to specific rules that differ from real life or standard video games. When designing the lab, we were guided by several key principles:
- 1:1 Scale: This is perhaps the most critical technical aspect. In standard games, we aren't always bound to real-world scale, but in VR, any disproportion is immediately noticeable and ruins the illusion of presence. Objects in VR often appear smaller than they do on a flat monitor, so adhering to strict real-world proportions is essential.
- User Safety: We deliberately avoid placing virtual chairs. Inside the headset, the brain trusts the environment, and a user might instinctively try to sit on a non-existent object, leading to a real-world fall.
- Clearance for the Virtual Assistant: We ensured there was ample space for our virtual assistant, Celly, to maneuver without blocking the user's view or clipping through geometry.
- Technical Constraints: Factors like polycount and draw calls heavily influence the scene, but with smart planning during the blockout phase, we can minimize their impact before we even begin detailing.
Based on this plan, I created the "blockout," a rough 3D draft of the laboratory. Using primitive shapes in Blender, I modeled the structural elements, fixtures (lab benches, shelving, wall cabinets), and essential equipment. Next, all objects were arranged in the Unity scene, and basic lighting was set up.
The deciding factor was testing in the VR headset. Only by actually "walking" through the virtual room could I evaluate the true ergonomics. This allowed me to identify cramped areas and adjust room dimensions before starting the detailed graphic work.
Modularity as the Foundation of Flexibility
To make the laboratory adaptable and functional, I developed a modular furniture system. Lab benches, cabinets, shelving, and sinks were created as separate, unified elements (Figure 2). I paid special attention to corner sections and joints. This allowed us to work with the assets like a construction set: from a limited pool of parts, we could assemble any workstation configuration to fit the room's specific function without spending time modeling new furniture.
Geometry vs. Textures: The VR Specifics
I utilized the classic High-Poly to Low-Poly workflow: creating a highly detailed model first, then "baking" those details onto an optimized model via a Normal Map.
However, there is a critical difference in VR. On a standard monitor, a Normal Map mimics depth perfectly. But in VR, users have binocular vision and can inspect objects up close. Under this scrutiny, the illusion breaks, and Normal Maps look flat.
To counter this, I followed a strict rule:
- Large and Medium Details: Handles, switches, and deep grooves must be modeled with actual geometry.
- Micro-details: Surface texture, scratches, and tiny bolts remain on Normal Maps.
This approach achieved the necessary balance. For example, our complex microscope model consists of only 16,000 triangles, yet, thanks to the strategic distribution of geometry, it looks completely realistic even at close range.
Context-Aware Optimization
The lab is filled with dozens of devices: centrifuges, fridges, microscopes. If every single one were maxed out in detail simultaneously, achieving 90 FPS with high image quality would be impossible.
We implemented an asset-swapping system:
- Background Equipment: If a device sits on a nearby table and isn't part of the current lesson, we use a simplified, highly optimized version. It lacks internal parts and uses fewer texture sets.
- Interactive Equipment: When a student begins a lesson involving a specific device, the system instantly swaps the simplified model for a high-fidelity, functional analog with internal components and moving parts.
This approach allows us to save system resources where the user's attention isn't focused and allocate maximum quality where it truly matters.
Texturing and Physically Based Rendering (PBR)
The final stage is giving surfaces a realistic look. All assets were textured in Substance Painter using PBR maps for the Unity Universal Render Pipeline (URP). This ensures that metal, plastic, and glass interact with light correctly, which is a key factor for immersion in Virtual Reality.
We imported the final assets into Unity, setting up materials based on the standard Unity URP Lit shader. This provided the ideal balance between visual quality and rendering speed.
During the assembly process, we made a crucial design decision: adding a terrace along the main laboratory hall where the largest windows are located. This created a smooth visual transition from the sterile interior to the outside world, effectively eliminating that claustrophobic "closed box" feeling.
From a technical perspective, the use of prefabs was key. Identical objects, such as lab benches, lamps, and desktop equipment, were all converted into prefabs. This not only optimized the scene but also significantly streamlined our workflow; by adjusting parameters on a single bench, we automatically updated every bench in the laboratory.
Why We Abandoned Level of Detail (LOD)
In classic game development, the LOD system, where models become less detailed as they move farther from the camera, is standard. However, for our VR lab, we decided against this approach. In a relatively small room, the visual "popping" caused by LOD switching would be too noticeable. Instead, thanks to our strategy of using two equipment types (static background vs. interactive), we achieved high performance without the visual artifacts associated with LODs.
Lighting: Sterility and Comfort
Lighting in VR is about more than just visibility; it is about eye comfort. My main goal was to create an evenly lit room without harsh shadows or excessive contrast, which can quickly tire the eyes and distract from learning.
We opted out of real-time lighting to save resources. Instead, we used baked lighting. All light and shadow information was pre-calculated and "baked" into the scene's lightmaps. To ensure the highest possible fidelity, I used the Bakery plugin, which produces superior results compared to Unity's native lightmapper.
The lighting scheme consisted of two components:
- HDRI Map: Created soft, diffuse daylight entering from the windows.
- Area Lights: Simulated artificial illumination from ceiling lamps.
Volume and Reflections on a Budget
Since we disabled dynamic shadows, there was a risk that the interactive objects, which students move around, would look "flat." To prevent this, we baked Ambient Occlusion (AO) maps directly into the textures of movable objects. This added necessary shading in crevices and cracks, preserving the sense of volume without adding CPU load.
For realistic reflections on glass and metal, we evenly distributed static reflection probes throughout the scene. These "photograph" the environment and project that reflection onto glossy surfaces.
Finally, we made the decision to disable post-processing. While effects like Bloom or Color Grading make the image more visually appealing, they are too "expensive" in VR performance terms. For us, image clarity and a stable 90 FPS took precedence over artistic filters.
Conclusion
Creating a virtual laboratory is more than just modeling microscopes and centrifuges; it is about crafting an experience where students feel truly present. By carefully balancing high-fidelity visuals with strict optimization techniques, from smart asset swapping to baked lighting, we managed to build an environment that looks realistic and runs smoothly at 90 FPS.
Ultimately, the technology fades into the background. What remains is a safe space where the "fear of failure" is replaced by the freedom to experiment. This project proves that with the right technical workflow, VR can transform expensive, high-risk training into an accessible and forgiving learning journey.