Uploading a model from 3DF Zephyr to Sketchfab

In this post we look at:

  • how to reduce the size of the model before upload, through
    • decimation, and
    • normal maps (advanced, optional);
  • how to directly upload the model to Sketchfab from within 3DF Zephyr;
  • after upload, how to change some settings within the Sketchfab model viewer
    • straightening the model,
    • changing the background,
    • adding a Normal Map (advanced; optional),
    • adding an annotation.

This post assumes that the reader knows their way around the 3DF Zephyr interface, has produced a model in 3DF Zephyr, and has a Sketchfab login. Production of Normal Maps within 3DF Zephyr requires access to the Lite version of the software (although Normal Maps can also be baked in other software).

Reducing the size of the model

Generating a model in 3DF Zephyr includes several successive stages:

  1. New project / Add images;
  2. Run the ‘Camera orientation’ stage (produces a Sparse Point Cloud);
  3. Run the ‘3D Model generation’ stage (produces both a Dense Point Cloud and a Mesh);
  4. Run the ‘Textured generation’ stage (produces a Textured Mesh).

The size of the final Textured Mesh depends on different factors, but that size often exceeds 50MB. A Sketchfab Free account has an upload limit of 50MB. It is possible to process the model in 3DF Zephyr in such a way that the model detail is retained but its file size is brought down to below the 50MB threshold.

Decimation

One way to reduce file size is through a Mesh Filter called Decimation. This is a process that is applied at the Mesh stage, before the mesh is textured (i.e. after stage 3, as defined above, but prior to commencement of stage 4).

Decimation is a process that decreases the density of the mesh (the density of points and triangles) while still retaining its overall shape. It is worthwhile experimenting with decimation to observe its effect on both file size and model quality, but a useful default figure is 100k, i.e. 100,000 vertices. A mesh that has been decimated down to 100k should fit within the 50MB limit.

Cloning the mesh before editing

When performing destructive and/or irreversible edits on the mesh, it can be advisable to clone the mesh and then perform the edit on that clone, in case we make a mistake during editing and need to return to the previous version of the mesh. This also applies when performing decimation, as in, it is advisable to clone the mesh and perform the decimation on the clone (while leaving the original mesh untouched). Helpfully, 3DF Zephyr offers an option within the Decimation dialogue, to clone the mesh and perform the decimation on that clone.

Following this method of cloning and thereby backing-up the mesh, prior to each destructive edit, will result in a list of meshes within the one file. We can manually change the name of each mesh to track the edits, for example our file might contain these several meshes:

  • Mesh 1 [original, unedited]
  • Mesh 1 cropped [after being manually cropped]
  • Mesh 1 cropped dec-100k [the cropped mesh, but decimated down to 100k]

After performing the Mesh edits, we can then start the Texturing stage, making sure to select the correct Mesh from the drop down menu within the wizard.

Normal maps

(What follows is discussion of a more advanced technique. If decimation is satisfactory in reducing the file size, then there should be no need to employ the following method.)

‘Normal maps’ are a special type of behind-the-scenes texture file that can be used in 3D models to superimpose high detail on to a low detail mesh. It is a way of giving ‘fake’ geometry detail to a model. ‘Fake’ insofar as the detail of the model is not actually present in the geometry of the mesh, but is projected onto that mesh through the details recorded in the hidden texture file. Specifically, the extra detail is conveyed through the way that hidden file interacts with the source(s) of illumination in the 3D scene, to embellish the mesh surface with additional ‘geometry’ that casts shadows.

The reason this is relevant here is that normal maps can be used in conjunction with decimation to keep the file size way down but retain high detail. 3DF Zephyr (Lite version) has the capacity to produce Normal Maps. This feature is found in the menu: Workflow>Advanced>Generate and Export Normal Maps.

Normal Map production in 3DF Zephyr requires:

  • a high detail Mesh (e.g. the original, unedited, non-decimated version of the mesh)
  • a low detail Mesh (e.g. the same mesh but decimated)
  • a Textured Mesh that has been generated from the low detail Mesh.

The Texturing stage needs to be complete before the Normal Maps production can proceed. Mainly because the Normal Maps use the same texture coordinates as the regular texture, a.k.a. the Diffuse Map, so that regular texture needs to be generated first in order to provide the model with those texture coordinates which are then also used by the Normal Map.

Demonstration of Decimation and Normal Maps

The following file, hosted on Sketchfab, shows the effects of decimation on mesh geometry, and how a Normal Map can ‘restore’ some of that geometry.

As is apparent, the Mesh that has been decimated to 100k verts has retained most of its geometry, and the addition of the Normal Map to that 100k model offers only a marginal improvement. It is only when the mesh is further decimated to 10k and below that the Normal Map plays a significant role in ‘restoring’ some of the original detail.

Direct upload from 3DF Zephyr to Sketchfab

There are different ways to export assets out of 3DF Zephyr. One of the ways that a Textured Mesh can be exported is through a direct upload to Sketchfab, this option is available in the export dialogue, and requires a Sketchfab account with an associated API Token.

The Sketchfab API Token is a long string of letters and numbers that is unique to each Sketchfab account. Much like a password, this Token is something that should never be shared with anyone else: “Keep your API Token secret” (https://help.sketchfab.com/hc/en-us/articles/202600683-Finding-your-API-Token).

To directly upload a textured mesh from 3DF Zephyr to Sketchfab, start the export dialogue, choose ‘Upload to Sketchfab’, then enter your API token from Sketchfab into the 3DF Zephyr dialogue at the relevant juncture.

This results in the model being directly uploaded from 3DF Zephyr onto your Sketchfab account, without having to first export the model then manually upload it through the Sketchfab website. When the model has finished uploading and processing, it will then be possible to Edit 3D Settings.

Modifying (improving) the model appearance within the Sketchfab viewer

On Sketchfab, enter the ‘Edit 3D Settings’ page for the model in question. This editing page has several tabs with a range of options for modifying the appearance of the model. It is worthwhile playing around and experimenting with all the different options to see how they influence the model appearance. Paid Sketchfab accounts (Plus, Pro, Premium etc.) have some more 3D Settings than the Free account, but even the Free offers many ways to customise and alter the model appearance.

In what follows we look at a handful of the basic settings.

Straightening the model

The 3D space of 3DF Zephyr and the Sketchfab viewer seem to be out of sync insofar as models directly uploaded from 3DF Zephyr are placed in the 3D scene on their side. (The two different 3D spaces seem to have different ‘up’ orientations.) Assuming that the model was correctly oriented in 3DF Zephyr, i.e. it was already facing up, then the way to rectify this within the Sketchfab 3D Settings is, within Scene/General/Straighten Model, click once on the right arrow of the X axis:

Sketchfab, Edit 3D Settings, correcting the model orientation

Changing the background (solid colour)

At the bottom of that Scene tab within the 3D Settings page are some options for the Background. It is possible to edit the background colour, e.g. with a colour that contrasts or compliments with the colours of the model in the foreground (depending on the desired effect). For example:

Sketchfab, Edit 3D Settings, changing the background colour

Adding a normal map (optional; advanced)

As mentioned above, the Normal Map interacts with the light source in the 3D scene. The Sketchfab viewer has the option of rendering models as either Shadeless (no light sources in scene) or Lit (the model is illuminated by light sources).

Photogrammetry models such as those produced in 3DF Zephyr are derived from photographs, and a photograph captures the interaction between a light source and a surface. So photos, and derived photogrammetry models, already have a light source ’embedded’ into the colouring and shading of the model. For this reason it can be beneficial to render photogrammetry models as Shadeless, and direct uploads from 3DF Zephyr will automatically set that as the Shading type in the Sketchfab 3D viewer.

However, if a Normal Map is to be added to the model then the first thing we have to do is change the Scene Shading from Shadeless to Lit:

Sketchfab, Edit 3D Settings, change Scene Shading from Shadeless to Lit

Then it becomes possible to add a Normal Map, through upload, to the model. This option is available in the Materials tab, half way down the list of material channels. Follow the interface prompts to upload the Normal Map and apply it to the model.

Sketchfab, Edit 3D Settings, adding a Normal Map

It is worth noting that for Normal Maps generated in 3DF Zephyr, the ‘Flip green’ option within the Sketchfab viewer settings should be set OFF (its default is ON).

More information on uploading and assigning textures can be found on this relevant Sketchfab help page: https://help.sketchfab.com/hc/en-us/articles/202600873-Materials-and-Textures#textures.

Adding an annotation

Annotations are a way of conveying further information about the model, such as facts about the heritage of the real world subject, or even information on the photogrammetry production method that was used. Annotations can also serve to draw attention to specific features on the model.

Sketchfab, examples of annotations

‘Annotations’ is one of the tabs within the Edit 3D Settings page. More information on how to add and edit them can be found on the relevant Sketchfab help page: https://help.sketchfab.com/hc/en-us/articles/202512456-Annotations.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: