# A Layered Method Based on Depth of Focus for Rapid Generation of Computer-Generated Holograms
## 4 Texture Mapping  
Unlike the analytical polygon-based method, the proposed method in this paper utilizes FFT to perform angular spectrum diffraction, which consequently affords it substantial convenience when applied to texture-mapping tasks. In this section, we present the application of one of the most common texture-mapping methods, UV mapping, to the proposed method in this paper. In 3D modeling software, it is possible to paint texture maps onto 3D models, which can then be exported as triangle meshes where each vertex of the triangles is assigned a set of UV coordinates. However, merely knowing the UV coordinates at the vertices of a triangle is insufficient for texturing purposes because we need to determine the texture information at any point within the triangle. Barycentric interpolation is one method that addresses this issue, enabling us to calculate the attribute values at any arbitrary point within a triangle based on the attributes of its three vertices. The barycentric interpolation can be expressed by the following equation:  
\[P=\alpha A+\beta B+\gamma C. \tag{5}\]  
Here, \(A\), \(B\), and \(C\) denote a specific property of the triangle's three vertices, which could be coordinates, UV coordinates, colors, or normals, among others; \(P\) represents the same property of a point within the triangle; and \((\alpha\), \(\beta\), \(\gamma)\) denote the barycentric coordinates of that point. The following relationship exists between \(\alpha\), \(\beta\), and \(\gamma\):  
\[\alpha+\beta+\gamma=1, \tag{6}\]  
where, \(\alpha\), \(\beta\), and \(\gamma\) can be calculated using the method detailed in [42], and hence, the UV coordinates of point \(P\) can be obtained through barycentric interpolation, as represented by Equation (5), utilizing the UV coordinates of points \(A\), \(B\), and \(C\). In the proposed method, the triangles need to be projected, but the projection does not change the UV coordinates of the points. If you want to calculate the texture information of the projection point of a point P within a triangle, you can refer to the steps shown in Figure 9. In the figure, \((U_{P}\), \(V_{P})\) denote the UV of point \(P\), and \((U_{A}\), \(V_{A})\), \((U_{B}\), \(V_{B})\), and \((U_{C}\), \(V_{C})\) denote the UV of the three vertices of the triangle, respectively. In order to inspect the effect of texture mapping applied in the proposed method, a hologram of the tiger model, as shown in Figure 10a, was generated. Figure 10a shows the tiger model with texture mapping applied, Figure 10b shows the triangle mesh of the model, and Figure 10c shows the texture map of the tiger model. In the experiment, the diffraction distance was set to 300 mm, the resolution of the hologram was \(1920\times 1080\), the pixel pitch was 0.045 mm, and the light wavelength was 532 nm. The generated holograms were numerically reconstructed at different distances to obtain the results shown in Figure 11. The 3D object carrying the texture is successfully reconstructed in Figure 11. In addition, the 3D sense of the hologram was verified by focusing on different places. Figure 10: The 3D model of the tiger. (**a**) The original model with additional textures. (**b**) The triangle mesh of the model. (**c**) Texture map. Figure 9: Process for calculating the texture of a projected point. In order to test the effect of the textured holograms in real optical experiments, an optical path was constructed, as shown schematically in Figure 12. In order to be able to give the reconstructed image higher diffraction efficiency, the hologram was encoded as a phase hologram and loaded onto a phase LCOS. Some previous studies [43; 44] can help us to better select a suitable LCOS as well as understand its principles. The phase LCOS used in the experiment had a resolution of \(1920\times 1080\) with a pixel pitch of 0.045 mm, and the laser wavelength used was 532 nm. The reconstructed image was received through a CCD (charge-coupled device) and displayed on a computer connected to the CCD.