image : A knife thing rendered in blender

Sketchfab api texture mixer thing

What it is

A little bit of JavaScript for The sketchfab api to mix/fade between two textures on a 3D model. Open source, if it’s handy, please use it, if you’ve got improvements, please contribute.

Where It is

Available on github, with a preview here.

What it isn’t

It isn’t finished…. It works with 1 material on a model only. It does appear to function on mobile devices, but not as a result of any plan, and it isn’t polished or optimised in anyway so don’t expect it to solve all your needs.

The Outro

The idea for the above goes back years and years and to some of the first objects I tried to 3D capture. Artefacts with fine details (a figurine, not the knife knife, that’s not archaeological at all, just a knife thing) that just don’t do well in the diffuse light of photogrammetry. Some fine features preserve in 3D and can be added back into a web-ready model with a bit of texture shoogling, specular maps and the like. Other features really don’t capture well, but can be integrated into your capture workflow with some patience a tripod and a few techniques and clobber (raking light, RTI, NIR, polarised light etc, this guy’s pages have some nice examples, kit, and a bread recipe too!).

But attempting to recreate ‘the real thing’ in 3D just isn’t always what we’re after. Being able to see all the details is well and good, but observing them and understanding them takes time. Sometimes we want to skip to the end and have someone show us what’s important like in a good old hand-drawing. Having both together and switching between source and Interpretation in 3D space, even better.

This sort of thing is pretty standard fare in 3D editing software and there are options online too. I really like 3DHOP as a 3D web viewer (PoTree is also great of course), the tools, the functions, the ability for local installs, streamed models and pretty darn customisable. It’s great. But Sketchfab is pretty handy too – with everyone’s models in one place for idle discoveries, it’s easy to use, the viewer is getting pretty, and the API provides that bit extra potential over your standard sketchfab view.

It’s also pretty darn popular in heritage circles these days, and it was down to a conversation with fellow photographer Owen Murray that gave this thing some momentum. Switching between textures, that’s pretty doable with examples online and configurators available – and used to great effect for multispectral photography by the guys at Rigsters. But what about mixing between one texture and another more slowly, that must be doable right?

Well, nothing said it isn’t, but nothing leapt out as an example of it already being done. It probably has been done with a top-notch easy plug-and play piece of code lying out there in plain sight, but it wasn’t spotted, so this was made instead.

The main expected potential is for sharing artefact illustrations or epigraphy between researchers, with this in mind, clarity of texture is important. Unfortunately, with great texture size comes quickly diminishing levels of performance, and so a quick switcheroo was implemented to reduce lag during the mixing, and a big yellow button to load in an extra-special res texture when looking at it all close-up like. As mentioned at the start, there’s still more to be done on this, and it was to some extent and excuse for dipping a toe into the waters of the Sketchfab API, but hopefully a toe that someone will find useful.