01XR simulation— Hemodialysis VR Simulator
An immersive Unity simulator where trainees assemble a hemodialysis circuit, run the machine and rehearse emergencies with their hands, not from a manual.
01 Problem
Dialysis machines are complex and unforgiving, and hands-on time with a real one is scarce. A 2025 study in Scientific Reports (Rettinger et al.) found VR/AR training outperformed conventional machine training.
02 Idea
Rebuild the whole room. Let a trainee perform the real sequence of set up, prime, connect and run, and make mistakes where they cost nothing.
03 Build
Three scenes (main menu, training, emergencies), XR sockets for every consumable, a working machine panel, voice guidance, and an in-headset AI assistant.
04 Result
A working multi-scene simulator that later became the front-end for project 02: a high-risk CKD result launches this training.
The machine panel, as built in Unity
Press the buttons. The screenshot and the dialyzer behind this page respond.




Build
01
Circuit assembly
Seven consumables snap onto XR sockets in clinical order. Each placement fires its own voice cue through SocketAudioOnPlace.cs, and grabbed parts change material (XRGrabMaterialChange.cs).
02
Machine panel
T1 Test, Prime, Start and Blood each drive the machine screen through VideoButtonController.cs and change the state of the lines.
03
Fluid without fluid simulation
The tubing appears to flow because a material's texture offset scrolls every frame. That is cheap enough for standalone VR. The line running through this page uses the same trick in GLSL.
04
Emergencies & Ask AI
A separate scene for needle dislodgement and high-pressure alarms, plus an in-headset voice assistant that explains equipment (for example, what a dialyzer actually filters).

Placement order, enforced by sockets
- 1Arterial chamber & line
- 2Venous chamber & line
- 3Dialyzer
- 4Saline bag
- 5Bicarbonate cartridge
- 6Acid concentrate
- 7Heparin syringe



One idea, two engines
Fluid without fluid simulation.
In the simulator, the tubing looks alive because a material's texture offset advances every frame. That costs almost nothing, which matters on a standalone headset. The circuit on this page is the same idea moved into a fragment shader.
Read the Unity sourcepublic class FlowingMaterialEffect : MonoBehaviour
{
public Material material;
public float flowSpeedX = 0.1f;
public float flowSpeedY = 0.1f;
private Vector2 currentOffset;
void Update()
{
currentOffset = material.GetTextureOffset("_MainTex");
currentOffset.x += flowSpeedX * Time.deltaTime;
currentOffset.y += flowSpeedY * Time.deltaTime;
material.SetTextureOffset("_MainTex", currentOffset);
}
}// liquidFrag: the circuit on this page
// u runs along the tube; uTime * uFlow is
// the same scrolling offset, per fragment.
float phase = u * uLength / 1.35
- uTime * uFlow;
float band = smoothstep(0.35, 1.0,
sin(phase * 6.2831) * 0.5 + 0.5);
c = mix(c, c * 1.22 + 0.04, band * 0.35);
