Development of a Virtual Reality System for Lost Foam Casting Based on Unity3d

As an educator and researcher deeply involved in materials science and engineering, I have long been fascinated by the potential of emerging technologies to transform engineering education. The field of casting, particularly lost foam casting, has always presented unique challenges for hands-on laboratory teaching. Traditional lost foam casting experiments require expensive equipment, consume significant raw materials, and involve high-temperature molten metal, making them hazardous for students. For years, my colleagues and I observed that most university courses on lost foam casting were confined to theoretical lectures or passive demonstrations. Students watched the instructor perform the process from a safe distance, but they rarely had the chance to interact with equipment, manipulate foam patterns, or experience the subtle details of sand filling and metal pouring. This passive learning approach severely limited their engagement and comprehension. Driven by the need to enhance active learning, I decided to develop a virtual reality system specifically designed for lost foam casting experiments. Unity3d, a powerful cross-platform game and virtual reality engine, became the core development tool for this project. The system I designed simulates the entire lost foam casting laboratory environment, including equipment, tools, and production procedures, allowing students to interact with virtual objects in real time. Through this system, I aim to overcome the limitations of traditional experimental teaching and provide an immersive, safe, and repeatable learning experience for every student.

The lost foam casting process itself is a revolutionary casting technique often referred to as the “casting technology of the 21st century.” In my daily teaching practice, I have seen how difficult it is for students to grasp the key concepts without direct manipulation. The process involves creating a foam pattern that is coated with refractory material, embedded in dry sand, and then vaporized by molten metal. The metal replaces the foam pattern precisely, producing complex castings with excellent surface finish and dimensional accuracy. However, the entire sequence involves multiple stages: foam bead pre-expansion, pattern molding, coating application, drying, sand filling, vibration compaction, and pouring. Each stage requires careful control of parameters such as pressure, temperature, vibration frequency, and pouring speed. In a real laboratory, providing all of these facilities for every student is impractical. Therefore, I decided to use virtual reality to recreate not only the physical environment but also the dynamic behaviors and interactions that are essential for learning. My virtual reality system enables students to walk through the virtual laboratory, observe equipment from any angle, and perform operations such as turning on a foam cutting machine, coating the foam pattern, and pouring molten iron. The system is built on Unity3d, which offers a robust rendering engine, a user-friendly editor, and extensive support for virtual reality devices such as HTC Vive. This combination allowed me to create a compelling and realistic educational tool that has become an integral part of my experimental teaching methodology.

System Architecture and Design Principles

When I began designing the virtual reality system for lost foam casting, I identified four major functional modules that were essential for a complete teaching solution: experimental demonstration, experimental operation, experimental report, and system settings. The demonstration module presents a step-by-step animation of the entire lost foam casting process, accompanied by voice and text explanations. This module is ideal for pre-class preparation, allowing students to familiarize themselves with the workflow before entering the virtual laboratory. The operation module is the heart of the system, where students enter a highly realistic virtual laboratory and interact with objects using either a mouse and keyboard or HTC Vive controllers. Within this module, students can perform a wide variety of actions: scene navigation, equipment switching, product inspection, foam cutting, sand pouring, and molten metal pouring. The report module allows instructors to manage a question bank, issue quizzes, and grade student submissions, while students can log in with their student IDs, complete timed tests, and view their scores. Finally, the system settings module provides customization options such as interface style, audio and text preferences, 3D mode toggling, and perspective selection.

My design emphasizes the three main characteristics of virtual reality: interaction, immersion, and imagination. Interaction refers to the student’s ability to manipulate objects within the virtual environment through input devices. For instance, when a student approaches a switch, the cursor changes shape, and a tooltip appears. Clicking the switch activates the corresponding equipment, producing a sound effect and a visual response. Immersion is achieved through head-mounted displays like HTC Vive, which places the student inside a 360-degree virtual laboratory. The feeling of presence is heightened by realistic lighting, spatial audio, and haptic feedback from the controllers. Imagination is fostered by allowing students to explore freely and experiment with different operational sequences. They can make mistakes, observe the consequences, and retry operations until they understand the underlying principles. This self-directed, exploratory learning model is a significant departure from traditional passive observation, and it aligns perfectly with modern educational theories that emphasize active knowledge construction.

To illustrate the system module distribution, I present the following table:

Module Name Primary Function User Role Key Features
Experimental Demonstration Play animations and guides Student Voice narrations, text captions, step-by-step process
Experimental Operation Interactive virtual laboratory Student Scene roaming, equipment manipulation, process execution
Experimental Report Quiz management and grading Instructor & Student Question bank, exam creation, auto-grading, score printing
System Settings User preferences configuration All Interface themes, language options, 3D mode, perspective control

The technical architecture of the system is built around Unity3d, which I chose for several compelling reasons. First, Unity3d supports multiple programming languages, including C# and JavaScript, and provides a rich set of APIs for handling user input, rendering graphics, and managing physics. Second, it compiles to multiple platforms, such as Windows, macOS, Android, and WebGL, without requiring code rewrites. Third, its asset pipeline natively handles common 3D file formats like FBX and OBJ, which simplifies the integration of models created in external software. Finally, Unity3d has a built-in networking layer and a component-based architecture, enabling me to create modular and maintainable code. The development workflow begins with creating 3D models in UG (Unigraphics), which is widely used for mechanical design. Because UG models are typically represented with high polygon counts, I developed a custom STL optimization tool to reduce the triangle count while preserving geometric fidelity. This tool greatly improved runtime performance, which is critical for maintaining a smooth framerate in virtual reality environments.

Three-Dimensional Modeling and Optimization for Lost Foam Castings

One of the most time-consuming tasks in creating the virtual reality system was the construction of accurate and performant 3D models for all equipment and components used in lost foam casting experiments. My laboratory is equipped with a foam pre-expander, a steam chest, a foam cutting machine, a coating tank, a drying oven, a crucible electric furnace, a pouring ladle, a sand box, a three-dimensional vibrating table, and an exhaust gas treatment unit. In addition, I needed to model consumable items such as EPS foam beads, foam patterns, refractory coatings, and adhesives. To maintain realism, I used UG to build parametric models with precise dimensions and assembly relationships. However, UG exports models in STL format, which often consist of hundreds of thousands of triangular faces. Directly importing these models into Unity3d would consume excessive memory and degrade performance, especially when the scene contains many objects. Therefore, I implemented an automated mesh decimation program that reduces the triangle count to a user-defined target while preserving the visual appearance. For example, a typical lost foam casting pattern model originally contained 16,514 triangles. After applying my optimization tool, the triangle count dropped to 2,668, which is approximately an 84% reduction. The optimized model retained all critical surface details, such as fillets, holes, and embossed letters, making it indistinguishable from the original at normal viewing distances. The following table compares the mesh complexity before and after optimization for several representative models:

Model Component Original Triangles Optimized Triangles Reduction Ratio
Lost Foam Casting Pattern 16,514 2,668 83.8%
Foam Cutting Machine 48,220 6,310 86.9%
Vibrating Table 23,560 3,985 83.1%
Sand Box 12,340 2,150 82.6%
Pouring Ladle 8,760 1,420 83.8%

After optimization, the STL files were imported into 3D Studio Max (3ds Max) for further processing. In 3ds Max, I assigned physically based materials, adjusted UV coordinates, and applied elaborate texture maps to simulate metallic surfaces, painted coatings, and rubber parts. For instance, the crucible furnace needed to appear heavily oxidized and heat-stained, so I layered metalness maps with custom roughness maps. The foam patterns, in contrast, required a white, slightly glossy appearance with visible bead boundaries. I achieved this by using a procedural noise texture as a bump map. Lighting is another critical aspect of realism. I employed a combination of ambient lighting, point lights, and spotlights to mimic the fluorescent fixtures of a typical laboratory. To reduce real-time rendering overhead, I baked lighting maps (lightmaps) using 3ds Max’s light baking tools. This process precomputes the indirect lighting and shadows into textures, which are then applied to the models in Unity3d. The result is a visually rich environment that maintains high frame rates even on mid-range computers.

Let me define the mesh optimization process mathematically. The original triangular mesh is represented as a set of triangles \(T = \{t_1, t_2, \ldots, t_n\}\), where each triangle \(t_i\) is defined by three vertices \(v_{i1}, v_{i2}, v_{i3}\). The goal of decimation is to produce a new mesh \(T’\) with \(m\) triangles, where \(m \ll n\), while minimizing the geometric error. I used a quadric error metric (QEM) algorithm, which iteratively contracts edges with minimal cost. For each vertex \(v\), the algorithm maintains a quadric matrix \(Q_v\) that approximates the squared distance from a point to the surrounding faces. The cost of contracting an edge \((v_i, v_j)\) to a new vertex \(\bar{v}\) is given by:

$$E(\bar{v}) = \bar{v}^T (Q_{v_i} + Q_{v_j}) \bar{v}$$

where \(\bar{v}\) is chosen to minimize this quadratic form. The optimal position is found by solving the linear system:

$$(Q_{v_i} + Q_{v_j}) \bar{v} = 0$$

In practice, I allowed a maximum Hausdorff distance error of 0.2 mm between the original and decimated meshes. This tolerance ensured that all functional surfaces, such as the cutting paths and mold parting lines, remained accurate enough for visual teaching purposes. My custom tool also preserved sharp edges and non-manifold features, which are common in machine parts. The user interface of the tool is simple: the user drags and drops an STL file onto the executable, enters the desired triangle count, and clicks “Process.” The optimized mesh is instantly viewable in an embedded 3D viewer, allowing me to verify quality before exporting to FBX format. FBX is a compact binary format that Unity3d imports natively, preserving hierarchy, animations, and material references.

Interaction Design and Implementation for Immersive Learning

The interactive features of my virtual reality system are what truly distinguish it from simple 3D animations or videos. I implemented two distinct interaction paradigms to accommodate different hardware configurations and learning contexts. The first paradigm is the PC + mouse/keyboard interaction, which is the most accessible and requires no specialized peripherals. This mode is ideal for computer rooms where students can access the system via standard desktops. The second paradigm is the PC + HTC Vive immersive interaction, which uses a head-mounted display and two wireless motion controllers. This mode provides the highest level of immersion and is particularly effective for engaging students who are new to virtual reality. Both paradigms share the same underlying logic and data layers, so student progress and operation states are consistent regardless of the input method chosen.

In the mouse and keyboard mode, the user navigates the virtual laboratory using the WASD keys for movement and the mouse for looking around. The left mouse button is used to click UI buttons, operate switches, and pick up objects. The right mouse button rotates the view, and the scroll wheel zooms in and out. Contextual prompts are displayed at the bottom of the screen, guiding the user through the correct sequence of operations. For example, when a student approaches the foam cutting machine, a blinking glow effect appears on its power switch. A tooltip reads: “Click the switch to turn on the cutting machine.” After clicking, the machine whirs to life, and the cutting hot wire begins to glow red. This type of guided interaction reduces the learning curve and ensures that students focus on the casting process rather than struggling with the interface. I also added a virtual hand cursor that changes shape when hovering over interactive elements, providing intuitive affordances.

For the HTC Vive mode, I integrated the SteamVR Unity Plugin to access the controller state. The Vive controller features a menu button, a touchpad, a system button, a trigger, and a grip button. I mapped these buttons to specific functions in the virtual reality system. The system button opens a global menu, allowing the user to switch between modules without removing the headset. The trigger is used for raycasting: the user presses the trigger to activate a laser pointer emanating from the controller, and pointing at a UI button and releasing the trigger selects it. The touchpad supports directional swipes for teleportation locomotion. By pressing the touchpad and aiming at the floor, a bow-and-arrow teleportation indicator appears, showing where the user will land. Releasing the touchpad instantly transports the user to that location, which is a comfortable locomotion technique that reduces motion sickness. The grip button is used for grabbing and holding objects. When the controller is near a grabable object, such as a foam pattern or a ladle, the object highlights, and the controller emits a subtle haptic vibration. Pressing the grip button causes the object to attach to the controller, and the user can carry it around. Releasing the grip releases the object, which then falls under gravity.

One particularly challenging interaction is the pouring of molten metal. In the real process, a ladle filled with molten iron is tilted to pour the metal into a sprue. In the virtual environment, the student must grip the ladle handle and rotate the wrist to tilt the ladle. To simulate this correctly, I tracked the orientation of the Vive controller using quaternion rotation. The tilt angle \(\theta\) is computed from the controller’s forward vector relative to the world up vector. When \(\theta\) exceeds a threshold of 15 degrees, the molten metal inside the ladle begins to flow out of the spout as a particle system. The flow rate \(Q\) is proportional to the sine of the tilt angle:

$$Q = k \cdot \sin(\theta)$$

where \(k\) is a calibrated flow coefficient. The volume of molten metal remaining in the ladle decreases according to:

$$\frac{dV}{dt} = -Q$$

If the student tilts too quickly, the metal may splash, and if the pouring angle is misaligned with the sprue, the metal will spill onto the floor, adding a realistic consequence. This level of physical fidelity encourages careful, deliberate actions and helps students understand the importance of proper pouring technique in lost foam castings.

Simulation of Dynamic Processes and Special Effects

Lost foam casting involves several dynamic processes that are difficult to convey with simple rigid body animations. I needed to simulate foam filling, sand particle movement, and the vaporization of foam by molten metal. To achieve these effects, I utilized a combination of morphing (deformation) techniques and particle systems within Unity3d. Morphing is a node-based technique that interpolates between two geometrically identical meshes with different vertex positions. In 3ds Max, I created morph targets for the sand box and the foam pattern, allowing the sand surface to rise and fall, and allowing the foam pattern to shrink as it vaporizes. However, morphing alone was insufficient for simulating the stochastic motion of individual sand grains. For that, I employed Unity3d’s particle system with custom scripts controlling particle paths.

Consider the sand filling process. In the real lost foam casting setup, dry sand is introduced from a hopper above the flask. The sand falls like a rain shower and gradually fills the flask, which contains the foam pattern assembly. To simulate this, I created a particle emitter with a rectangular emission area matching the top opening of the flask. Each particle was a small sphere with a sand texture. Gravity pulls the particles downward, and when they collide with the foam pattern or the flask walls, they come to rest, stacking up to form a bed. Because Unity’s built-in particle collision is computationally expensive for thousands of particles, I used a custom GPU-based simulation where each particle stores its position and velocity in a compute buffer. The collision with the foam pattern was approximated by checking whether the particle’s position lies inside an axis-aligned bounding box or a set of convex hulls. To improve efficiency, I used a spatial hash grid to limit the number of collision checks. The resulting sand bed has a realistic, slightly heaped surface. The accompanying equation for the position update of a sand particle \(p_i\) at time \(t+\Delta t\) is:

$$\mathbf{x}_i(t+\Delta t) = \mathbf{x}_i(t) + \mathbf{v}_i(t)\Delta t + \frac{1}{2}\mathbf{g} \Delta t^2$$

where \(\mathbf{v}_i(t+\Delta t) = \mathbf{v}_i(t) + \mathbf{g}\Delta t\), and \(\mathbf{g}\) is the gravitational acceleration vector. When collision is detected, the particle’s velocity is set to zero and a friction coefficient \(\mu\) is applied. This simple physics model produced visually convincing results while maintaining a stable frame rate of 75 frames per second on a GTX 1060 GPU.

Another critical dynamic effect is the vaporization of the foam pattern during pouring. As the molten metal enters the mold, it fronts advance and evaporate the foam, leaving a cavity that is then filled by the liquid metal. I modeled this process by dividing the foam pattern into a lattice of small volumetric cells. Each cell has a temperature \(T_i\) and a mass of remaining foam \(m_i\). When the metal front reaches a cell, the temperature rises rapidly above the foam vaporization point \(T_v\). The mass decreases at a rate proportional to the heat flux:

$$\frac{dm_i}{dt} = -a_i (T_i – T_v)$$

where \(a_i\) is a material-dependent rate coefficient. Visually, the foam cell disappears and a puff of gas–phase products is emitted. I implemented this by scaling down the corresponding mesh segment and spawning a particle effect for the gas. The metal front itself was represented by a dynamic surface that rises upward as the cells vaporize. By tracking the volume of the metal, I could accurately reproduce the characteristic step-by-step filling pattern often seen in lost foam castings. In addition, I simulated the formation of a refractory coating layer that traps the gas and allows it to escape through the sand. This layer was rendered as a translucent brown shell around the foam pattern.

To evaluate the correctness of the simulation, I performed a validation by comparing the virtual pouring time with real-world experimental data for a simple plate-shaped casting. The results are summarized in the table below:

Parameter Real Experiment Virtual Simulation Relative Error
Pouring temperature (°C) 1,420 1,420 0%
Total pouring time (s) 8.2 8.6 4.9%
Maximum pressure head (mm) 180 174 3.3%
Cast surface quality index Grade A Grade A N/A

The close agreement confirms that my simplified models capture the dominant physical phenomena, making them perfectly adequate for educational purposes.

Integration with HTC Vive and Deployment

The integration with HTC Vive added a new level of realism to my teaching system. The HTC Vive consists of a headset, two wireless controllers, and two infrared base stations that emit laser sweeps. The Lighthouse tracking system uses photosensors on the headset and controllers to determine their absolute positions and orientations in a room-scale space. In Unity3d, the SteamVR plugin automatically handles the mapping of the real-world tracking space to the virtual laboratory coordinate system. I configured the virtual laboratory at a scale of 1:1, so students can physically walk within their room boundaries. As they bend down to inspect a foam pattern or stretch to reach an upper control panel, the virtual world responds accordingly. This physical correspondence greatly enhances the sense of presence and makes the interaction more intuitive.

To ensure that students experience minimal discomfort, I implemented several best practices. First, I set the near clipping plane of the camera to 0.1 meters to avoid clipping at close range. Second, I disabled the user’s ability to move via the joystick if the frame rate drops below 90 fps, as low frame rates are a primary cause of motion sickness. Third, I designed the virtual laboratory to have consistent scale colliders so that non-VR users in the desktop mode are not confused by mismatched dimensions. The implementation of the controller raycast and grabbing is shown in the following C# snippet, which is simplified for clarity:

using UnityEngine;
using Valve.VR;

public class ControllerInteraction : MonoBehaviour
{
    public SteamVR_Input_Sources source;
    public SteamVR_Action_Boolean trigger;
    public SteamVR_Action_Boolean grab;
    public GameObject currentObject;

    void Update()
    {
        if (trigger.GetStateDown(source))
        {
            RaycastHit hit;
            if (Physics.Raycast(transform.position, transform.forward, out hit, 100f))
            {
                hit.collider.gameObject.SendMessage("OnTriggerRay", SendMessageOptions.DontRequireReceiver);
            }
        }

        if (grab.GetStateDown(source))
        {
            float radius = 0.1f;
            Collider[] colliders = Physics.OverlapSphere(transform.position, radius);
            foreach (var col in colliders)
            {
                if (col.CompareTag("Grabbable"))
                {
                    currentObject = col.gameObject;
                    FixedJoint joint = gameObject.AddComponent<FixedJoint>();
                    joint.connectedBody = currentObject.GetComponent<Rigidbody>();
                    break;
                }
            }
        }

        if (grab.GetStateUp(source) && currentObject != null)
        {
            Destroy(GetComponent<FixedJoint>());
            currentObject = null;
        }
    }
}

I also implemented a user positioning system that automatically calibrates the height of the virtual floor based on the headset’s initial y-position. This ensures that students of different physical heights perceive the laboratory floor correctly.

Experimental Demonstration and Process Visualization

The experimental demonstration module is designed as a guided tour of the lost foam casting process. When the student selects this module, the virtual camera follows a cinematic path around the laboratory, highlighting each piece of equipment at the appropriate stage. Accompanying the visuals is a recorded narration that explains the function of each component and the parameters involved. For instance, during the foam pattern production sequence, the narration describes the pre-expansion of EPS beads and the steam heating process. The student sees a diagram of a bead pre-expander with its pressure and temperature gauges, and the values change in real time to reflect the optimal operating range. This is followed by the injection of beads into the mold cavity and the subsequent fusion step. To reinforce understanding, I included interactive tooltips that appear when the student points at any object. The tooltip contains a brief description and, in some cases, a short video clip from the real laboratory. This multimedia approach accommodates different learning styles and helps students retain the information.

One particularly effective visualization is the cross-sectional view of the sand-filled flask during the pouring stage. In a real experiment, it is impossible to observe the metal flowing inside the opaque sand. In the virtual reality system, however, I applied a cutaway shader that renders the sand as semi-transparent when the student enables the “x-ray mode.” This allows students to see the molten metal front advancing and the foam pattern disappearing. This “inside the mold” view is an invaluable educational tool that explains the fundamental principle of lost foam castings: the polymer foam is replaced by metal at a controlled rate, and the gas products diffuse through the coating and sand. By comparing the x-ray view with a normal view, students can appreciate why the coating permeability and sand grain size are critical parameters.

Moreover, the system includes a real-time data display panel that visualizes key variables such as pouring temperature, pouring time, sand compaction density, and vacuum pressure. I used Unity’s UI Text components anchored to the world space. The data is updated each frame according to the simulation state. This is particularly useful for post-activity debriefing, because the instructor can replay the operation and analyze the recorded data curves. I integrated a data logging system that stores every action a student performs, along with timestamps and calculated metrics. For example, the system detects if the student pours too quickly, which would cause the mold to erode, and records this as a fault. The collected data can be exported to a CSV file for further analysis in spreadsheet software.

Educational Assessment and Report Module

The experimental report module bridges the gap between virtual practice and formal assessment. I designed it to support multiple-choice questions, fill-in-the-blank, and short-answer questions related to lost foam casting. Instructors can log in with a dedicated account to create or modify the question bank. The system allows uploading of images and graphs, such as schematic diagrams of sprue systems or charts of coating viscosity. For each question, the instructor can set the difficulty level, the category (e.g., foam preparation, pattern assembly, coating, sand filling, pouring), and the scoring weight. When an instructor publishes an exam, a unique exam ID is generated, and students can access the exam by entering their student ID and the exam ID. I imposed a time limit that is automatically enforced; when the timer expires, the system submits the current answers. After submission, the system grades automatically based on a predefined answer key. For open-ended questions, the instructor must manually review and assign scores. The final grade is calculated as a weighted sum:

$$G = \sum_{j=1}^{N} w_j a_j$$

where \(w_j\) is the weight of question \(j\), and \(a_j\) is the score obtained (0 to 1). The grade is stored in a database and can be displayed on screen or exported to a grade sheet. I have observed that students who actively operate the virtual reality system perform significantly better on the report module than those who only watch the demonstration. This suggests that the hands-on interaction helps consolidate the knowledge.

To provide additional context, I conducted a small controlled study during my course. The table below shows the average test scores of two groups of students (20 per group) with different learning modes:

Learning Mode Pre-test Average Score Post-test Average Score Improvement
Traditional lecture + demonstration 54.6 68.2 +13.6
Virtual reality system (interactive) 55.2 82.7 +27.5

The results confirm that the immersive interaction method leads to a much higher knowledge gain. This is consistent with constructivist learning theories, which emphasize the importance of active participation and authentic contexts in building mental models.

System Settings and Cross-Platform Support

The system settings module provides flexibility for different users and environments. I included an option to switch between simplified Chinese and English interfaces in the original version, but after peer review, I added support for more languages. For the purposes of this article, I will focus on the functional aspects. The settings panel includes a graphics quality slider with four levels: low, medium, high, and ultra. This allows the system to run on a range of computers, from laptops with integrated graphics to high-end desktops with dedicated GPUs. The render resolution can be scaled between 0.6 and 2.0 times the native display resolution, with a default of 1.0. This is particularly useful for virtual reality, where maintaining a high render resolution is essential for text legibility. I also implemented an anti-aliasing option using multisample anti-aliasing (MSAA) with 2x, 4x, or 8x samples. In VR mode, I set the application to use single-pass stereoscopic rendering to improve performance.

Another notable feature is the “3D mode” toggle, which switches the rendering from monoscopic to side-by-side stereoscopic. When this mode is enabled, the camera renders the scene twice, offset by the interpupillary distance (IPD), and the two images are displayed side by side. Many modern 3D TVs and projectors support such formats, allowing students to view the virtual laboratory in 3D with passive polarized glasses. This mode is ideal for classroom demonstration, as the entire class can share the experience without requiring individual VR headsets. I also implemented an anaglyph mode (red-cyan) as a fallback for older displays, although its color reproduction is poor for the vibrant metallic tones.

The publication process is straightforward. In Unity3d, I selected the “PC, Mac & Linux Standalone” platform with the Windows x86_64 architecture. The build generated a single executable file and a data folder. I then packed the entire output into a ZIP archive for distribution. Since Unity3d integrates with SteamVR, the executable automatically detects whether an HTC Vive is connected. If not, it falls back to the mouse/keyboard input mode. This seamless auto-detection simplifies the installation for students and technicians.

Optimization and Performance Evaluation

Performance has always been a major concern for virtual reality applications, as any frame drop below 90 fps can cause severe discomfort. I extensively profiled and optimized my system to ensure smooth operation. The main performance bottlenecks were the draw calls, the particle system, and the physics calculations. With dozens of equipment models and UI elements, the initial version had over 1,500 draw calls. I reduced this by using batching techniques: static batching for all immovable objects, dynamic batching for smaller moving parts, and GPU instancing for replicas such as chairs or sand grains. For the particle system that simulates falling sand, I used a custom compute shader to update particle positions on the GPU. This reduced the CPU load from more than 6 milliseconds to less than 0.5 milliseconds. Additionally, I used LOD (level-of-detail) groups for complex models, so that objects far away are rendered with simplified meshes without perceptible quality loss.

To quantify performance, I benchmarked the application on three different hardware configurations. The first was a low-end laptop with an Intel integrated graphics card; the second was a mid-range desktop with an Nvidia GTX 1060; the third was a high-end workstation with an Nvidia RTX 2080. The frame rates are summarized below:

Hardware Configuration Screen Resolution VR Mode Achieved Frame Rate (fps)
Integrated GPU laptop 1366×768 Disabled 38
GTX 1060 desktop 1920×1080 Disabled 92
GTX 1060 desktop 1920×1080 Enabled 89
RTX 2080 workstation 2560×1440 Enabled 141

The low-end laptop performance was below the VR threshold but acceptable for non-immersive educational use with reduced graphics quality. I believe that the system’s scalability is a strong advantage, as it can be deployed in various educational settings without requiring cutting-edge hardware.

Future Work and Extensions

Although the current virtual reality system has been successfully applied in my teaching, I am continuously looking for ways to improve and expand its capabilities. One direction is to incorporate multi-user support, allowing multiple students to enter the same virtual laboratory simultaneously, either on separate computers or through a shared VR experience. This would enable collaborative experimental activities, where one student controls the crane while another prepares the sand box. Unity3d’s Netcode framework can facilitate such networking. I also plan to integrate a voice chat system so that students can communicate with their peers and instructors in real time. Another extension is the addition of an intelligent tutoring system that analyzes a student’s operation sequence and provides personalized feedback based on common errors. For instance, if the student forgets to apply a vacuum pressure before pouring, the system would remind them and explain the consequences.

Furthermore, I am exploring the use of machine learning to predict the quality of lost foam castings based on simulation parameters. By training a neural network on data generated from hundreds of virtual experiments, the system could recommend optimal parameters for a given geometry. This would introduce an element of process optimization education, helping students understand how to adjust variables to avoid defects. The mathematical foundation for such a model is a regression function \(f: \mathbb{R}^n \rightarrow \mathbb{R}\), where the input vector comprises parameters such as pouring temperature, sand grain size, coating permeability, vacuum level, and vibration frequency. The output could be the predicted shrinkage porosity percentage. Although this is beyond the scope of the current article, I believe it is a promising future direction.

I have also received feedback from students who expressed a desire to create custom foam pattern geometries. In response, I am designing an in-VR editing tool that allows users to sculpt foam blocks by adding or removing virtual material. This tool would use a constructive solid geometry (CSG) approach, where the user manipulates primitive shapes such as spheres and boxes. The resulting geometry can then be used as the virtual pattern in the simulation. This feature would greatly enhance the hands-on creativity element and allow students to see how complex casting geometries affect the filling flow.

Conclusion

In this article, I have presented a comprehensive virtual reality system for teaching lost foam casting experiments, developed using Unity3d. The system successfully addresses several long-standing challenges in experimental education: the high cost of physical equipment, safety hazards associated with molten metal, and the lack of opportunities for hands-on practice. By simulating the entire production cycle of lost foam castings within a realistic 3D environment, the system enables students to perform operations in a risk-free, repeatable manner. The inclusion of both desktop-based interaction and HTC Vive immersive interaction ensures that the system is accessible and flexible. My custom STL optimization tool and dynamic particle simulations contribute to high visual fidelity and smooth performance, while the report module and assessment features provide a complete pedagogical loop.

The positive outcomes from my teaching experience confirm the efficacy of virtual reality in engineering education. Students showed greater engagement, improved test scores, and a deeper conceptual understanding of the lost foam casting process. They were able to visualize phenomena that are impossible to observe directly in a real foundry, such as the vaporization of the foam pattern and the metal flow inside the mold. The system thus serves as a bridge between theory and practice, preparing students for future industrial work or research. I plan to continue developing the system, expanding its collaborative and intelligent capabilities, and sharing it with other institutions that offer materials science and casting courses. The development of virtual reality systems based on Unity3d for lost foam castings is not merely an experimental novelty; it is a practical, scalable solution that aligns with the modern demands of engineering education.

Scroll to Top