## 3 Methodology  
### System Overview  
The overall structure of the proposed GPU-based PBD (Position-Based Dynamics) cloth simulation system for Mixed Reality environments is illustrated in Figure 2. The system is designed considering the characteristics of the Meta Quest platform within the Unity engine environment [25] and consists of four main modules: (1) Data Management Module, (2) GPU-Based Simulation Module, (3) Collision Handling Module, and (4) Rendering and Integration Module.  
The **Data Management Module** manages data such as vertex and topology information of the cloth mesh, physical properties, and constraint settings. It is responsible for efficiently transferring this data between CPU and GPU memory. This module initializes the cloth geometry and constructs the necessary data structures for simulation.  
The **GPU-Based Simulation Module** implements the Position-Based Dynamics algorithm using Compute Shaders, executing the cloth simulation pipeline in parallel. It includes stages such as external force application, velocity update, position prediction, constraint satisfaction, and collision handling. Each stage is implemented as an independent compute kernel to maximize parallel processing efficiency.  
The **Collision Handling Module** manages interactions between the cloth and its environment, handling three types of collisions: (1) collisions with primitive shapes such as spheres and boxes, (2) collisions with complex meshes acquired from real-world scans using spatial mapping, and (3) collisions with user hands through hand tracking [7]. In particular, real-world mesh collision leverages spatial mapping data obtained from Meta Quest's environmental awareness features, enabling realistic interactions between the virtual cloth and real-world structures like desks and chairs.  
The **Rendering and Integration Module** visualizes simulation results and integrates them into Unity's rendering system. It handles double-sided rendering, shading, texture mapping, and transforms simulation data to match Unity's coordinate and transform systems.  
The overall workflow of the system is as follows: during initialization, the vertex, triangle, and constraint data structures are generated on the CPU and transferred to GPU memory. In each frame, parallel simulation is performed on the GPU based on the current simulation state and environmental data (e.g., spatial meshes and hand tracking data). Upon completion, simulation results are selectively transferred back to the CPU and integrated into the Unity rendering pipeline.  
The main features of the proposed system are summarized as follows. First, the entire simulation process is performed on the GPU, enabling real-time performance even with high-resolution cloth meshes. Second, the system supports precise physical interactions with objects in the real world using Meta Quest's hand tracking and spatial mapping capabilities. Third, various cloth materials and behaviors can be expressed through user-defined constraints and physical parameters. Fourth, the system is seamlessly integrated with Unity, allowing easy adoption in existing XR applications.  
Figure 2: GPU-based PBD cloth simulation system architecture.  
This system design aims to achieve high-quality cloth simulation even on standalone XR headsets with limited computational resources. The next sections provide a detailed description of each module and the core algorithms used.