Unity oblique photography development-Unity loads oblique photography models in 3mx and osgb formats

  1. First, let’s take a look at the effect of Unity loading 3mx and osgb formats.
  2. First, use the oblique photography model in 3mx and osgb format generated in the previous chapter. The address of the previous section is: Unity Oblique Photography Development-Aerial Image Generation 3mx and OSGB Model_Virtual Reality (Mote) Blog-CSDN Blog
  3. Using the Software
    1. Unity3d
    2. OSGBImporter (unity3d plug-in, you can download it from the Unity Mall, download address: OSGBImporter | Utilities Tools | Unity Asset Store
  4. Use Unity to create a URP rendering pipeline project (the plug-in supports the default rendering pipeline and HDRP rendering pipeline. The author uses the URP rendering pipeline here to facilitate WebGL and mobile terminals to load models), and import the OSGBImpporter plug-in.
  5. Copy the oblique photography model in 3mx format generated in the previous section to the StreamingAssets/ConvertDatas directory of the project.
  6. Open the case scenario (03_SimpleDemo) that comes with the OSGBImport plug-in, select the ImporterManager game object, and modify the URL
  7. After running Unity, we found that the oblique photography model was not within the camera's field of view. We found the oblique photography model in the Scene window. After adjusting the field of view to a suitable position, we selected the Main Camera object, first disabled the ControlCamera script, and then pressed control+shft+f Press the button to align the camera to the current perspective and copy the camera's Transform data
  8. Stop Unity from running, select the camera object, and paste the data copied in the previous step, as shown in the figure below
  9. If it is URP and HDRP rendering pipeline, you need to create a light in the scene
  10. If you use the URP rendering pipeline to publish WebGL and mobile terminals, you need to add material.shader = Resources.Load<Material>("Materials/RenderMat").shader; to OSGBImporterLoader.cs, as shown in the figure below
  11. Load the OSGB format model. Note that the OSGBImporter plug-in only supports the window segment to read the OSGB format. It is mainly used for high-performance reading of the osgb oblique photography model.
  12. Open the 01_SimpleDemo case project in the OSGBRead directory
  13. If the following script is missing, drag ReaderOSGB into it and replace it.
  14. Configure the OSGB file path, note that it is the Data directory
  15. Refer to steps 7~9 to adjust the initial position of the camera. The following figure shows the adjusted camera parameters.
  16. Attach effects

Guess you like

Origin blog.csdn.net/fengzi1103771698/article/details/132391817