What ZOZO’s cloth solver means for virtual try-on

Fashion stores on WooCommerce keep asking for 3D garment previews, and the ask keeps dying in the same place. The cloth clips through the mannequin, the whole thing reads as rubber, and nobody trusts it enough to put it on a product page. That failure, fabric passing through fabric, has been an open problem in graphics for about thirty years, and the version of it virtual try-on needs now looks solved. A fashion company did it.

Ferran Alia wrote a long walkthrough of the work on Towards Data Science, and it is the best starting point if you want the derivations. Below is the short version, with the parts a store owner or a WordPress developer needs.

Why cloth clips in the first place

Underneath the render, simulated fabric is a mesh of vertices and triangles, and at every time step the engine integrates F = ma across all of them at once. The elastic half of that, how each triangle resists stretching and shearing, has been understood for decades. Contact is the part that breaks. The classic answer is penalty forces: push overlapping surfaces apart with a force proportional to the overlap. The force is zero until surfaces have already passed into each other, so anything fast enough can tunnel straight through, and if you stiffen the penalty enough to catch fast motion, the integration becomes unstable and the scene explodes. The other classic answer, detecting intersection after the step and snapping vertices apart, doesn’t conserve energy, drifts over long runs, and in scenes with thousands of contacts resolving one overlap often creates two more.

The wrong fix that always ships first

On the store side the wrong fix is nearly always a browser cloth demo built on springs, tuned until the launch screenshot looks right. It survives the demo, then a sleeve moves a little faster than in your test and a shopper watches fabric pass through a shoulder. Tuning can’t fix it: with springs, penetration is a property of the method itself. The deeper mistake is assuming the simulation has to run in the shopper’s browser at all.

What the cubic barrier changes

In 2020 the IPC paper reframed contact as energy instead of force. Add a term that goes to infinity as two surfaces approach zero distance, and an energy-minimising solver cannot cross it, so penetration stops being punished and becomes unreachable. The barrier in that paper is logarithmic, and the logarithm is where the trouble sits. Its curvature grows without bound as surfaces get close, and curvature is what decides how well conditioned the Newton solve is, so tight scenes need more and more iterations and can fail to converge at all.

Real fabric makes it worse. Cotton resists after stretching one to five percent, which means a tight strain limit and a very small activation distance, which squeezes that already explosive curvature into almost no room. ZOZO, Japan’s largest fashion e-commerce company, tackled this problem in an ACM Transactions on Graphics paper from late 2024, then open sourced the solver under Apache 2.0. They replaced the logarithm with a cubic, B = κ(1 – d/d̂)^3, whose curvature tops out at 6κ/d̂² no matter how close the surfaces get, and they compute the stiffness κ per element from the local elasticity so the barrier and the material stay in proportion. Their large-scale tests report beyond 184 million simultaneous contact pairs without interpenetration. It reminds me of most performance fixes I’ve shipped on client stores, where the win came from changing the approach.

Most summaries skip a caveat. A finite barrier cannot by itself guarantee zero penetration, because a vertex carrying enough kinetic energy can clear a finite energy hill in a single step. The solver still uses continuous collision detection to shrink time steps before that can happen, and the README is blunt that the guarantee holds only when a solution is found, and that in extreme cases it can stall. It is also built for offline rendering only (the README says not real time), ships as a Docker image around a gigabyte, and their own cost table puts a demo scenario at roughly a dollar an hour on an AWS L4 instance. None of that stops e-commerce use, but it does rule out running it inside the shopper’s browser.

How it fits a virtual try-on build on WooCommerce

That points to a boring architecture that fits WordPress well. Render offline, cache the result, and let the product page only serve assets. From the store’s side the moving part is queueing a re-render when a product changes, which is what Action Scheduler is for. Enqueue on product save, push the mesh to a small GPU box running the solver in Docker, and ingest the finished loop when the render service calls back.

<?php
// Queue a re-render whenever a product with a garment mesh is saved.
add_action( 'woocommerce_update_product', 'bbioon_queue_garment_render' );

function bbioon_queue_garment_render( $product_id ) {
	if ( ! get_post_meta( $product_id, '_bbioon_garment_mesh', true ) ) {
		return;
	}

	// unique: true, so saving twice does not stack duplicate jobs.
	as_enqueue_async_action(
		'bbioon_render_garment',
		array( 'product_id' => $product_id ),
		'bbioon-vto',
		true
	);
}

add_action( 'bbioon_render_garment', 'bbioon_run_garment_render' );

function bbioon_run_garment_render( $product_id ) {
	$mesh = get_post_meta( $product_id, '_bbioon_garment_mesh', true );

	$response = wp_remote_post( 'https://render.internal.example/simulate', array(
		'timeout' => 30,
		'body'    => wp_json_encode( array(
			'mesh'         => $mesh,
			'mannequin'    => 'default',
			'strain_limit' => 0.02,
		) ),
	) );

	if ( is_wp_error( $response ) || 202 !== wp_remote_retrieve_response_code( $response ) ) {
		// Marking it failed makes Action Scheduler retry it.
		return new WP_Error( 'bbioon_render_unavailable', 'Render service did not accept the job.' );
	}
}

Two notes if you copy this. Returning WP_Error from the callback marks the action failed and the queue retries it, so don’t build a second retry layer on top. And keep the solver off the PHP host, because a long render job on a shared host is a predictable way to lose the account. The same offline-first pattern is why I preprocess expensive model output offline instead of calling it on every page load.

On a client site this week I’d do the smallest possible version: one hero product with a clean mesh, one draping loop rendered offline, embedded as video or a GLB, then watch whether shoppers engage before promising anything store-wide. If you want to test this on a single product first, that’s the kind of pipeline I build, so send me the product and we can scope it.

author avatar
Ahmad Wael
I'm a WordPress and WooCommerce developer with 15+ years of experience building custom e-commerce solutions and plugins. I specialize in PHP development, following WordPress coding standards to deliver clean, maintainable code. Currently, I'm exploring AI and e-commerce by building multi-agent systems and SaaS products that integrate technologies like Google Gemini API with WordPress platforms, approaching every project with a commitment to performance, security, and exceptional user experience.

Leave a Comment