Extraction tutorial

Substrate extraction tutorial

This tutorial provides guidelines on creating a substrate file that can be used in MNPR. For this tutorial, the paper substrate used in the sample is Terschelling, 200gsm, in 20x20cm.

Scanning the substrate

  • Mark the edges and corners with several lines and symbols. These markings are needed to facilitate layer alignment.
  • To obtain a more accurate model of the substrate, scan the substrate in two different orientations, at 2400 dpi. It is important to take note of the orientation used for each scan. The orientations can be top-to-bottom, bottom-to-top, left-to-right, or right-to-left.

Top: Scanned paper substrate in top-to-bottom orientation

Bottom: Scanned paper substrate in right-to-left orientation

Aligning the substrate

Import the two scanned substrates into Photoshop, each in a separate layer. Rotate them so that both are upright. After that, try aligning the two layers so that the positions of the markings of both layers match.

This can be achieved by the following steps:

      • Manually move and rotate the layer until the two layers look aligned.
      • Select the two layers and go to “Edit > Auto-Align layers…”. From our experiments, perspective projection seems to yield the best result in aligning. However, other types of projection may be more suitable depending on the substrates.
      • Click “OK”. Adjust the layers as needed after the auto aligning is done.

Cropping the substrates

  • Obtain a 15x15cm copy of the aligned substrate, leaving out the markings.
  • Save the two layers two separate image files. This can be done by selecting “File > Save for Web…”. In the new window, resize the file to 2048x2048px and save as PNG. For clarity, the files can be named together with their scan orientation (e.g. SubstrateName-t2b.png)

Extracting and loading the substrate model

  • Now that the scans are in the desired size and alignment, import them into the 3D reconstruction software, which is obtainable at (www.digitalepigraphy.org/toolbox/digitize.html). Follow the steps to construct a 3D model of the substrate. Save the model as an OBJ file.
  • Drag and drop the OBJ file into Maya. The current surface looks too uneven and does not represent the real paper substrate well, so it should be scaled down.

The digital epigraphy tool

The loaded OBJ file in Maya

Tweaking the geometry

  • The following steps can be taken to scale down the height of the object:
      • Rotate the object at -90 degrees along the x-axis, so that it lays parallel to the XZ plane.
      • Select all vertices and calculate their average height.
      • Assign the height to the object pivot.
      • Next, reposition the object so that the pivot lies at (0, 0, 0) to the world. This centers the object such that the peaks have positive y values, while the troughs have negative y values.
  • The scaling can be done by multiplying the y value of each vertex by a scale factor. For our substrates, we iterated through the vertices and multiplied the values by 0.04.

Exporting a substrate image

  • Assign the normalHeight shader to the substrate.
  • In the attribute editor, adjust HeightFactor accordingly to obtain an optimal height map which maximizes the range of gray values. The height map can be viewed by importing the heightMap shader onto the object. For our substrates, we set the HeightFactor to 100.0.
  • Turn off color management. This can be done by unchecking “Enable Color Management” in “Windows > Settings/Preferences > Preferences > Color Management”.
  • Open the render settings and modify them as follows:
      • Set the renderer to Maya Hardware 2.0.
      • In “File Output”, set the image format to PNG.
      • In “Image Size”, set presets to 2k Square.
  • View the substrate from the top-Y direction.
  • Enable film gate in camera settings and ensure that the substrate takes up the entire render scene.
  • Render the scene and save the image as a PNG.

Making the substrate texture seamless

  • The substrate has to be slightly edited so that it can be used as a seamless texture in Maya. Open a new canvas of size 6000x6000px in Photoshop. Copy and paste the PNG file in randomized locations to fill up the entire canvas, as shown below. This step is to avoid the repeated patterns on the substrate from becoming too evident when it is used in Maya.
  • Notice that the areas as highlighted by the boxes below contain lines that cause the texture to appear disconnected. Our aim is to clean up these edges. This can be done by using the Clone Stamp Tool which can be made active using the shortcut key “S”.
  • To use the Clone Stamp Tool, select a reference point with ALT + Click and paint over the edges. The tool creates a replica of the referenced point on the targeted areas. Use different reference points to cover up the edges. The opacity and the shape of the brush used for this tool can be changed as needed.
  • Once a satisfactory result has been obtained, merge all the layers with the changes.
  • We have to make sure that this substrate appears seamless when the entire piece is repeated. To do so, first apply the offset filter by selecting “Filter > Other > Offset”. Enter “3000” into both boxes. This moves the edges of the substrate to the center of the canvas.
  • We can observe that there is a horizontal and a vertical line in the middle that separate the substrate, as highlighted below. Repeat the step to cover up the lines using the Clone Stamp Tool.
  • After that, save the image as PNG in 2048x2048px or 4096x4096px, according to your preference. The substrate can now be imported into Maya.