Page MenuHomePhabricator

Enable backface visibility in 3D viewer
Closed, ResolvedPublic

Description

I've been looking at the recently uploaded files on Commons, and it seems a lot of files render very funny because they have backfaces that really should be visible.

Examples:

These would display in a much more intuitive way if the viewer enabled backface visibility. With three.js, apparently you have to pass side: THREE.DoubleSide to the MeshPhongMaterial constructor. I tested this with this hack in JS console:

mw.mmv.ThreeD.prototype.geometryToObject = function ( geometry ) {
	var material = new THREE.MeshPhongMaterial( { color: 0xf0ebe8, shininess: 5, flatShading: true, side: THREE.DoubleSide } );
	return new THREE.Mesh( geometry, material );
};

…but I'm not sure where else this would have to be changed to apply to server-generated thumbnails too.

Event Timeline

matmarex created this task.Mar 5 2018, 10:20 PM
Restricted Application added a project: Multimedia. · View Herald TranscriptMar 5 2018, 10:20 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
brion added a subscriber: brion.Mar 6 2018, 12:47 AM

Change 416616 had a related patch set uploaded (by Brion VIBBER; owner: Brion VIBBER):
[mediawiki/extensions/3D@master] [WIP] Specify meshes as double-sided to fix some renderings

https://gerrit.wikimedia.org/r/416616

Change 416617 had a related patch set uploaded (by Brion VIBBER; owner: Brion VIBBER):
[3d2png@master] [WIP] Specify meshes as double-sided to fix some renderings

https://gerrit.wikimedia.org/r/416617

Ramsey-WMF triaged this task as Normal priority.
Ramsey-WMF moved this task from Untriaged to Triaged on the Multimedia board.

Change 416616 merged by jenkins-bot:
[mediawiki/extensions/3D@master] Specify meshes as double-sided to fix some renderings

https://gerrit.wikimedia.org/r/416616

Change 416617 merged by Matthias Mullie:
[3d2png@master] Specify meshes as double-sided to fix some renderings

https://gerrit.wikimedia.org/r/416617

matthiasmullie closed this task as Resolved.Mar 29 2018, 7:21 AM