Method for automatically setting Lod in batches based on unreal engine and computer readable storage medium

By building custom editor behavior controls in Unreal Engine and automatically setting up LOD hierarchical settings, the problem of cumbersome and difficult to optimize rendering performance in traditional LOD settings is solved, and development efficiency and rendering performance are improved.

CN119565156APending Publication Date: 2025-03-07浪潮智慧城市科技有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411517775.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

The traditional LOD setting method requires developers to manually assign different levels of LOD to each asset, and set multiple parameters such as surface reduction and screen size, which makes the process cumbersome and time-consuming, making it difficult to ensure the optimization of global rendering performance.

Method used

By building custom editor behavior controls in Unreal Engine, defining functions that obtain functions and process LOD hierarchy settings, it is possible to automatically generate and apply different LOD hierarchy for assets based on preset rules or user-defined parameters.

Benefits of technology

It reduces the work burden of developers, improves the development efficiency of three-dimensional scenes, and intelligently optimizes rendering resource allocation, significantly improves the rendering performance and frame rate stability of the scene.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119565156A_ABST
    Figure CN119565156A_ABST
Patent Text Reader

Abstract

The invention provides a method for automatically setting objects LOD in batches based on an unreal engine and a computer readable storage medium, and belongs to the technical field of computer graphics and virtual reality. A proper LOD level is automatically allocated to selected assets through capitalized script behaviors, a user only needs to define the basic LOD level, and the user experience is improved. The system can automatically process levels and simplify in batches, manual one-by-one setting is not needed, and time and labor cost are greatly saved. In addition, the method also supports the automatic calculation of the screen size, and ensures that the rendering performance is optimized while the scene reality sense is maintained. The function of automatically setting the LOD levels in batches is widely applied to the fields of game development, virtual reality, building design visualization and the like, powerful tool support is provided for developers, and the rendering efficiency and the user experience can be remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer graphics and virtual reality technology, and in particular to a method for automatically setting object Lods in batches based on an Unreal Engine and a computer-readable storage medium. Background Art

[0002] At present, my country's digital economy is entering a new stage of rapid development. Digital twins are an important part of the digital economy. Three-dimensional scene modeling is an important part of digital twin technology. Through three-dimensional modeling technology, the morphology, structure, and characteristics of physical objects can be digitized to build a real and detailed digital model. However, complex three-dimensional scenes often contain tens of thousands of assets, such as buildings, vegetation, characters, etc., and the level of detail and rendering complexity of these assets vary. In order to achieve high-quality real-time rendering under limited hardware resources, level of detail (LOD) technology came into being. The traditional LOD setting method requires developers to manually assign different levels of LOD to each asset and set multiple parameters such as face reduction and screen size. This process is cumbersome and time-consuming, and it is difficult to ensure the optimization of global rendering performance. Summary of the invention

[0003] In order to solve the above technical problems, the present invention provides a method for automatically setting object LOD in batches based on Unreal Engine, aiming to solve the inefficiency and performance optimization problems in the traditional LOD setting method through automated and intelligent means. The core goal of the present invention is to reduce the workload of developers, improve the development efficiency of three-dimensional scenes, and significantly improve the rendering performance and frame rate stability of the scene by intelligently optimizing the allocation of rendering resources. At the same time, the present invention also aims to provide a flexible and adjustable LOD configuration scheme to meet the diverse needs under different application scenarios and performance requirements.

[0004] The technical solution of the present invention is:

[0005] A method for automatically setting LOD levels in batches based on Unreal Engine, building an Unreal asset behavior tool through a blueprint function, and adding it to a project for use. The specific steps are as follows:

[0006] S1. In the Unreal Engine editor environment, build a custom editor behavior control that is intended to be part of the user interface, allowing users to interactively perform subsequent operations;

[0007] S2. Define and implement one or more acquisition functions within the editor behavior control. The functions of these functions are to traverse and identify the assets or scene objects specified by the user through the interface. The acquisition functions can accurately identify and return references to a set of assets or objects selected by the user, providing basic data for subsequent processing;

[0008] S3. Create a function to process LOD level settings. These functions receive the assets or objects obtained from the acquisition function as input, and automatically generate and apply different LOD levels for these assets or objects based on preset rules or user-defined parameters. This process may include calculating the optimal LOD switching point, generating or modifying LOD models, etc.

[0009] Furthermore,

[0010] The specific calculation process of obtaining the selected asset object in step S2 is as follows:

[0011] S201. Edit the ActorActionUtility blueprint script created by the machine tool through Editor Utilities;

[0012] S202. Get the selected assets through the GetSelectedAssets node;

[0013] S203. Filter the array of selected assets through the return value of the ForEachLoopd node;

[0014] S204. Determine the type of the array through the StaticMeshEditorSubsystem node.

[0015] The corresponding step S3 calculates the number of meshes of StaticMesh and the distance between the camera through the MakeEditorScriptingMeshReductionOptions function, including the following steps:

[0016] S301. Use the MakeStaticMeshReductionSettings node to define the number of LOD levels and the level of detail of each level;

[0017] S302. Use the StaticMeshEditorSubsystem node to get the type of the selected object;

[0018] S303. Use the MakeArray node to obtain the selected object array and pass the data to the SetLod function.

[0019] Going further,

[0020] The lod classification of StaticMesh is calculated and set through the SetLod function. The specific operations are as follows:

[0021] S401. Used to display the setting results to the user in real time during the LOD setting process, including but not limited to the customization of the number of LOD static meshes, so that the user can adjust according to the needs;

[0022] S402. Integrate the functions of the above modules into blueprint scripting tools. These tools provide a graphical interface through the blueprint system of Unreal Engine, so that non-programmer users can also easily access and utilize these functions.

[0023] Step S3 generates the uasset asset file through the compiled script tool and calls it:

[0024] S501. Use the staticMeshReductionSettings node to enable the automatic calculation of LODScreenSize.

[0025] The lod classification of StaticMesh is calculated and displayed through the SetLod function. The specific operations are as follows:

[0026] S601. The above-mentioned editor behavior control also includes a feedback mechanism for displaying the setting results to the user in real time during the LOD setting process, including but not limited to the customization of the number of LOD static meshes, so that the user can make adjustments as needed.

[0027] S701. This method can be applied to multiple asset StaticMeshes in batches at the same time to achieve automatic batch LOD level setting for a selected set of assets, thereby improving the performance optimization efficiency of games or applications:

[0028] S702. This method supports integration into the Unreal Engine in the form of a plug-in, so that developers can load and use it in other Unreal Engines.

[0029] In addition, the present invention also provides a computer-readable storage medium, in which a computer program is stored. The computer program can be executed by a processor to implement any one of the methods described above.

[0030] The beneficial effects of the present invention are

[0031] Improve development efficiency: Traditional LOD settings usually require developers to manually adjust and optimize, which is time-consuming, labor-intensive and error-prone. The present invention uses automated tools and algorithms to achieve automatic generation and adjustment of LOD, which greatly reduces the burden on developers, improves development efficiency and accuracy, and is more flexible and intuitive to operate. It greatly simplifies the process of scene construction, and the model generated by this script automatically switches the LOD level according to the screen distance. The copied model does not increase additional resource consumption. Compared with the traditional modeling method, this method is more intuitive, easy to understand and maintain, and also improves development efficiency.

[0032] Easy to integrate and expand: This invention is based on UE's blueprint and exists in the form of uasset assets. It can be quickly deployed in project engineering, and the generated LOD model can be exported to the outside in the form of FBX, which has high flexibility and scalability.

[0033] Optimize resource utilization: The present invention can automatically adjust the loading and unloading strategies of LOD, dynamically manage resources according to changes in game scenes and the perspective of players, avoid unnecessary resource loading and memory usage, effectively optimize resource utilization, and reduce the game's demand for hardware resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 It is a schematic diagram of the workflow of the present invention. DETAILED DESCRIPTION

[0035] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0036] The present invention provides a method for setting LOD based on the Unreal Engine asset behavior editor. The method is to construct a script function through a blueprint in the Unreal Engine, compile the constructed function into a uasset asset and add it to the content browser file of the project, and then use it through the scripted asset behavior function in the Unreal Editor. The specific steps are as follows:

[0037] 1. Create editor behavior controls

[0038] S1. Enable the script plug-in. First, you need to enable the Editor Scripting Utilities plug-in in the UE plug-in manager.

[0039] S2. Create editor tools. Create editor behavior controls in the UE's Content Browser to store localized uasset asset files for scripts.

[0040] S3. Select the script method. ActorActionUtility and AssetActionUtility determine whether the script is for Acotr operation or Asset operation. The script needs to perform batch LOD setting operations on StaticMesh Assets. Select the AssetActionUtility class to create a script.

[0041] 2. Set the acquisition function to obtain the selected assets

[0042] S1. Create a function. Double-click to enter the AssetActionUtility blueprint script editor, add a function in the Function menu, name it Set_Lod, and the function receives the target object list as input.

[0043] S2. Filter the selected objects. Add GetSeletedAssets to receive the execution of Setlod, create a ForEachLoop node to obtain the return value of GetSeletedAsset, and output the obtained array to the CastToStaticMesh node. The logic of this function is to filter the objects in the selected asset array, obtain the selected Assets (you may select multiple, so it is an Array), loop through them, and determine whether they are StaticMesh one by one.

[0044] S3. Set the target object. Add a StaticMeshEditorSubsystem node and input the target channel of SetLods, and define the function's Assets as static mesh objects.

[0045] 3. Create Lod function

[0046] S1. StaticMesh model reduction. Add the MakeStaticMeshReductionSettings node to control the number of meshes and LODs of the StaticMesh object.

[0047] S2.LOD array transfer. Use the MakeArray node to set the four sets of LOD data as a structure array (Settings), and then pass it to the MakeEditorScriptingMeshReductionOptions structure.

[0048] S3. Complete script compilation. Input the MakeEditorScriptingMeshReductionOptions structure into the ReductionOptions channel required by SetLods and save and compile

[0049] 4. Use of script tools

[0050] S1. Script tool loading method. Save the compiled script to the project, and it will be automatically loaded after the project is opened.

[0051] S2. Execute the script function. After the project is opened, select the StaticMesh object that needs to be set in the Content Browser, and execute the SetLod script command through the ScriptedAssetActions menu of the right click. At this time, the pop-up window can customize the mesh settings of each level of LOD, or you can directly execute the default parameters through the OK button to complete the LOD grading.

[0052] S3. Save the asset. After executing the script, the StaticMesh object is saved and the asset source file is modified.

[0053] The above description is only a preferred embodiment of the present invention, which is only used to illustrate the technical solution of the present invention, and is not used to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A method for automatically setting object Lod in batches based on Unreal Engine, characterized in that: Use the blueprint function to build an Unreal asset behavior tool and add it to the project for use. The specific steps are as follows: S1. In the editor environment of Unreal Engine, a custom editor behavior control is built. As part of the user interface, the control allows users to interactively perform subsequent operations. S2. Define and implement one or more acquisition functions within the editor behavior control. The functions of these functions are to traverse and identify the assets or scene objects specified by the user through the interface, identify and return references to a group of assets or objects selected by the user, and provide basic data for subsequent processing; S3. Create a function to handle LOD level settings. These functions receive the assets or objects obtained from the acquisition function as input, and automatically generate and apply different LOD levels for these assets or objects based on preset rules or user-defined parameters.

2. The method according to claim 1, characterized in that The process of step S3 includes calculating the optimal LOD switching point and generating or modifying the LOD model.

3. The method according to claim 1, characterized in that The specific steps of obtaining the selected asset object in step S2 are as follows: S201. Edit the ActorActionUtility blueprint script created by the machine tool through Editor Utilities. S202, obtaining the selected assets through the GetSelectedAssets node; S203. Filter the array of selected assets through the return value of the ForEachLoopd node; S204. Determine the type of the array through the StaticMeshEditorSubsystem node.

4. The method according to claim 3, characterized in that The corresponding step S3 calculates the number of meshes of StaticMesh and the distance between the camera through the MakeEditorScriptingMeshReductionOptions function, including the following steps: S301, use the MakeStaticMeshReductionSettings node to define the number of LOD levels and the level of detail of each level; S302, using the StaticMeshEditorSubsystem node to obtain the type of the selected object; S303. Use the MakeArray node to obtain the selected object array and pass the data to the SetLod function.

5. The method according to claim 4, characterized in that The lod classification of StaticMesh is calculated and set through the SetLod function. The specific operations are as follows: S401, used to display the setting results to the user in real time during the LOD setting process, including the customization of the number of LOD static meshes, so that the user can adjust according to the needs; S402, used to integrate the function of step S401 into blueprint scripting tools, which provide a graphical interface through the blueprint system of Unreal Engine.

6. The method according to claim 4, characterized in that Step S3 generates the uasset asset file through the compiled script tool and calls it: S501. Use the staticMeshReductionSettings node to enable the automatic calculation of LODScreenSize.

7. The method according to claim 5, characterized in that The lod classification of StaticMesh is calculated and displayed through the SetLod function. The specific operations are as follows: S601. The editor behavior control also includes a feedback mechanism for displaying the setting results to the user in real time during the LOD setting process, including the customization of the number of LOD static meshes, so that the user can make adjustments as needed.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which can be executed by a processor to implement the method according to any one of claims 1 to 7.