Ewance
← All challenges Software Engineer

Build a Real-Time Draped-Cloth Simulator for an Online Fashion Showroom

Duration
2 weeks
Level
Advanced
Type
Code
Team
1 to 5 people

The situation

Maison Lévrier sells direct-to-consumer womenswear built around fluid, draped fabrics whose appeal is hard to convey in flat product photos. The in-house fashion-technology team wants an interactive showroom that lets shoppers see how a garment actually falls and moves before they buy.

Your task

Build a real-time cloth simulator inside a Three.js showroom that drapes five tuned garments on a digital mannequin at 30 frames per second on mid-range laptop hardware.

The brief

What you do

  1. Build a position-based-dynamics cloth solver and wrap it in a Three.js viewer.
  2. Starting from the provided cloth-solver starter module, implement a triangulated cloth mesh with distance constraints (to hold the fabric together), bending constraints (to control how stiff or soft it folds), gravity, a simple adjustable wind force, and collision against a sphere-approximated mannequin.
  3. Run four substeps per frame with eight constraint-solving passes per substep.
  4. Add on-screen controls for wind strength and mannequin pose.
  5. Load the garment and mannequin geometry from the provided public glTF sample assets, and tune each of the five garments to match the drape behavior and parameter ranges described in the provided artist tuning brief.

Success looks like

Success means: five garments that hang and sway without exploding or stretching unnaturally, a viewer an artist can re-tune unaided, and a steady 30 frames per second on a mid-range laptop graphics chip (Intel Iris Xe class).

What you will practice

  • Implement a stable position-based-dynamics cloth solver with distance and bending constraints
  • Integrate a physics solver cleanly with a Three.js rendering pipeline
  • Profile and optimize a real-time WebGL scene to hold a target frame rate on modest hardware
  • Translate an artist's qualitative drape goals into concrete numerical simulation parameters
  • Document technical parameters clearly enough for a non-engineer to re-tune them

A suggested way in

  1. Use the substep + constraint-iteration structure (4 substeps, 8 iterations) to keep the simulation stable without small time steps
  2. Profile with Chrome DevTools and RenderDoc to find frame-time bottlenecks before optimizing
  3. Keep solver state in flat typed arrays to reduce per-frame allocation and garbage collection
  4. Approximate the mannequin with a few spheres for collision rather than testing against the full mesh

Skills you will practice

Physically based simulation, 3D rendering, Webgl, Math for graphics, Shading and lighting, Performance optimization

Where it leads

Graphics / Simulation Engineer, WebGL / Frontend 3D Engineer, Technical Artist

How it is assessed

  • Simulation quality30%

    Each of the five garments drapes believably and matches the behavior described in the artist tuning brief, with no explosions or visible over-stretching.

  • Performance25%

    All five tuned scenes hold 30 frames per second on Intel Iris Xe-class hardware, demonstrated in the screen recordings and DevTools traces.

  • Artist usability25%

    Using only the handoff document, an artist can re-tune any parameter for any garment in the provided scenes without engineer help.

  • Code organization20%

    The solver from the starter module is cleanly separated from rendering code so it can be reused, as shown in the submitted source.

Resources

  • Three.jsTool

    Provides the WebGL scene graph and viewer the simulator renders into.

  • TypeScriptTool

    Adds type safety to the solver and viewer for a maintainable, reusable codebase.

  • Chrome DevToolsTool

    Profiles frame time and memory to confirm the 30fps target is met.

  • RenderDocTool

    Inspects GPU draw calls to debug rendering artifacts and performance.

  • GitTool

    Version-controls the solver, scenes, and documentation deliverables.

Sample Ewance certificate of completion, verified by LearnCoin
Sample certificate
Your proof

Finish it. Earn this.

A verified certificate with your name. Anyone can check it.

Time to practice.

Solve this challenge
Related challenges

More like this.