Vertex color rendering and baking method and system applied to unity engine
A baking method and vertex technology, applied in the field of 3D scene rendering, can solve problems such as difficulty in editing, lightmap consumes large storage space, and lightmap is difficult to meet actual needs.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0076] Please refer to figure 2 , this embodiment provides a vertex color rendering baking method applied to the Unity engine, which can reduce the storage capacity of AO information and improve baking efficiency at the same time. Specifically, the method may include:
[0077] S1: Create a copy (ColoredMesh) that copies the original mesh model (Mesh); the copy is used to store the vertex color information of the mesh model; if there is no vertex color information in the original mesh model, create a vertex color for the copy information; then save a copy to a resource file.
[0078] It is preferable to set the vertex color information to white; it is preferable to use the AssetDatabase.CreateAsset() method under the UnityEditor namespace in the Unity engine to save the asset file, which is the method provided by the Unity engine to save the model object in the editor mode.
[0079] S2: Read the vertex position and vertex normal of each vertex in the grid model; then convert...
Embodiment 2
[0093] This embodiment is further extended on the basis of the first embodiment, so that it can also adjust the vertex color of the baked model at the same time, so as to meet the custom fine-tuning requirements.
[0094] Specifically, the following steps may also be included:
[0095] S6: Add a mesh collider (MeshCollider) to the model that needs fine-tuning drawing.
[0096] S7: Listen to the scene view update event (SceneView.onSceneGUIDelegate) of the Unity editor.
[0097] S8: Disable object selection when the scene view is updated; preferably, it can be realized by calling HandleUtility.AddDefaultControl(GUIUtility.GetControlID(FocusType.Passive)).
[0098] S9: Monitor mouse events and perform drawing operations.
[0099] When the mouse is pressed, the drawing mode starts; when the mouse is released, the drawing ends;
[0100] When the mouse is held down and the mouse moves, call to emit a ray from the mouse position in the scene view, preferably by calling HandleUtil...
Embodiment 3
[0105] see Figure 4 , this embodiment is a vertex color rendering and baking system applied to the Unity engine provided on the basis of Embodiment 1, including:
[0106] The first creation module 5 is used to create a copy of the grid model;
[0107] The second creation module 6 is used to create a vertex color information for the copy if no vertex color information is stored in the mesh model;
[0108] Reading module 1, used to read the vertex position and vertex normal of each vertex in the grid model;
[0109] A conversion module 8, configured to convert the vertex position and vertex normal into the vertex position and vertex normal in the world coordinate system.
[0110] The first preset module 9 is used to preset the sampling range of the near plane and the far plane of the sampling camera, and preset the pixel rectangle of the sampling camera;
[0111] The second preset module 10 is used to preset the background of the sampling camera to be pure white;
[0112] S...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com