Back to Projects

VR-ready Cornell Box simulation

Preview Project View Code

What

I developed an interactive VR-ready Cornell Box simulation inspired by physically-based rendering principles. The 3D environment includes realistic lighting, material response, and user interface control. The project was built using Three.js and shader programming, and features a full VR interface with controller support.


How

Modeling
  • Constructed a Cornell Box-style room with walls, ceiling, and floor using PlaneGeometry, with accurate positioning and rotation.
Materials
  • Applied different materials on key objects:
    • MeshLambertMaterial on a cone
    • MeshPhongMaterial on a cylinder
    • MeshPhysicalMaterial on a sphere
  • All parameters were adjustable via lil-gui.
Lighting
  • Integrated multiple types of lights:
    • Ambient
    • Point
    • Directional
    • Hemisphere
    • Spot
  • Added RectAreaLight for each wall to simulate light bouncing and improve realism.
(Note: Turn off the Ambient light to see the effects clearly)
GUI Integration
  • Created a GUI panel to control lighting types, colors, intensity, and material properties (transparency, metalness, textures).
  • Embedded the GUI in VR using HTMLMesh and InteractiveGroup.
VR Integration
  • Enabled WebXR using VRButton and XRControllerModelFactory.
  • Supported VR controller interaction and GUI manipulation within the 3D space.

Results

  • Created an immersive WebXR environment simulating realistic materials and lighting.
  • Achieved real-time interactivity in both desktop and VR modes.
  • Developed an extendable platform for testing PBR and UI experimentation in VR.
  • Gained proficiency in integrating shader-based materials, VR interfaces, and dynamic lighting using Three.js.
Preview Project View Code