Automated Rendering Method, Device, Equipment and Storage Medium for Building Block Model

Through automatic analysis and parameter setting, the rendering of building block models is automated, time-consuming and error problems caused by manual intervention in the existing technology are solved, and rendering quality and consistency are improved.

CN119494906BActive Publication Date: 2025-06-13SHENZHEN QIANQI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510068384.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-16
Publication Date
2025-06-13
Estimated Expiration
2045-01-16

AI Technical Summary

Technical Problem

The rendering process of existing building block models requires a lot of manual intervention, which leads to time-consuming and labor-intensive and easy to introduce human errors.

Method used

By obtaining the file of the building block model, parsing and converting it into a standardized data structure, automatically setting camera parameters and lighting environment parameters, model optimization, and applying these parameters to render to generate high-quality rendered images.

Benefits of technology

The rendering process is automated, manual intervention is reduced, data processing efficiency is improved, rendering quality and consistency is improved, and error risk is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119494906B_ABST
    Figure CN119494906B_ABST
Patent Text Reader

Abstract

The present invention provides an automated rendering method, device, equipment and storage medium for a building block model. The method includes: obtaining a building block model file of the building block model, parsing the building block model file to obtain a standardized data structure of the building block model file; based on the standardized data structure, respectively setting the camera parameters and lighting environment parameters of the scene where the building block model is located to obtain scene rendering parameters; according to the standardized data structure and the scene rendering parameters, optimizing the building block model to obtain optimized model data; applying the scene rendering parameters to the optimized model data and the standardized data structure for model rendering to obtain a model rendering result. Through the automatic parsing and parameter setting of the building block model file, this method realizes the automation of the rendering process, reduces manual intervention, and through the application of the standardized data structure, realizes the unified management of model information, improves the data processing efficiency, and realizes the improvement and consistency of rendering quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular, to an automated rendering method, device, equipment and storage medium for building block models. Background Art

[0002] In the field of building block design and production, it is usually necessary to convert building block models into high-quality rendered images for multiple links such as customer confirmation, packaging printing, and factory quality inspection. Existing rendering methods generally involve the following steps: First, designers use specialized building block CAD software to create building block models; then, the models are imported into general 3D design software (such as 3DMAX, Blender, etc.) for re-modeling; next, designers manually adjust camera positions, lighting environments, material parameters, etc.; finally, rendering calculations are performed to obtain the final image.

[0003] However, this method has a major defect: the entire process requires a large amount of manual intervention, especially in the model conversion and rendering parameter adjustment stages. This not only takes time and effort but also easily introduces human errors, such as texture errors and missing building block models. In addition, when the building block model is modified in the CAD software, designers need to manually synchronize these changes in the 3D design software, which further increases the risk of errors and the workload. Summary of the Invention

[0004] The main object of the present invention is to solve the technical problem that a large amount of manual intervention is required in the existing building block model rendering process, resulting in time-consuming and laborious work and easily introducing human errors;

[0005] The first aspect of the present invention provides an automated rendering method for building block models, and the automated rendering method for building block models includes:

[0006] Obtain the building block model file of the building block model, parse the building block model file, and obtain the standardized data structure of the building block model file;

[0007] Based on the standardized data structure, set the camera parameters and lighting environment parameters of the scene where the building block model is located respectively to obtain scene rendering parameters;

[0008] According to the standardized data structure and scene rendering parameters, optimize the building block model to obtain optimized model data;

[0009] Apply the scene rendering parameters to the optimized model data and the standardized data structure for model rendering to obtain a model rendering result.

[0010] Optionally, in the first implementation manner of the first aspect of the present invention, setting the camera parameters and lighting environment parameters of the scene where the building block model is located based on the standardized data structure to obtain the scene rendering parameters includes:

[0011] Performing a bounding box calculation on the building block model according to the geometric information of the building block model in the standardized data structure to obtain model boundary data;

[0012] According to the model boundary data, performing a dichotomy iteration adjustment on the camera position of the camera in the scene where the building block model is located to obtain the optimal camera position coordinates, and setting the camera parameters according to the optimal camera position coordinates to obtain the camera parameters of the camera;

[0013] Performing a main direction analysis on the orientation information of the building block model in the standardized data structure to obtain the model main axis vector, and setting the lighting environment parameters according to the model main axis vector to obtain the lighting environment parameters;

[0014] Taking the camera parameters and the lighting environment parameters as the scene rendering parameters.

[0015] Optionally, in the second implementation manner of the first aspect of the present invention, the performing a dichotomy iteration adjustment on the camera position of the camera in the scene where the building block model is located according to the model boundary data to obtain the optimal camera position coordinates, and setting the camera parameters according to the optimal camera position coordinates to obtain the camera parameters of the camera includes:

[0016] According to the model boundary data, constructing an initial camera position search space, and determining a set of camera position candidate points based on the initial camera position search space;

[0017] Evaluating the field of view coverage rate for each point in the set of camera position candidate points, and determining the initial optimal camera position according to the evaluation results;

[0018] Taking the initial optimal camera position as the center, constructing a local search space, and performing a dichotomy iteration search on the local search space to obtain the optimal camera position coordinates;

[0019] According to the optimal camera position coordinates and the model boundary data, calculating the camera focal length, field of view angle and depth of field parameters of the camera to obtain the camera parameters of the camera.

[0020] Optionally, in the third implementation manner of the first aspect of the present invention, the optimized model data includes a chamfer parameter set, UV coordinate mapping data, normal vector data and a material parameter set;

[0021] The performing model optimization on the building block model according to the standardized data structure and the scene rendering parameters to obtain the optimized model data includes:

[0022] Calculate the chamfer radius of the edges of the building block model according to the geometric information of the building block elements in the standardized data structure, and obtain a set of chamfer parameters;

[0023] Perform mesh subdivision and vertex displacement on the building block model to obtain optimized mesh data with a chamfer effect, and perform UV unwrapping processing on the optimized mesh data to obtain UV coordinate mapping data;

[0024] Calculate the normal vector of each vertex of the building block model according to the UV coordinate mapping data and the lighting environment data in the scene rendering parameters, and obtain normal vector data;

[0025] Based on the building block type information in the standardized data structure, extract the corresponding material parameters from a preset material library and adjust them according to the scene rendering parameters to obtain an optimized set of material parameters.

[0026] Optionally, in the fourth implementation manner of the first aspect of the present invention, the extracting the corresponding material parameters from a preset material library based on the building block type information in the standardized data structure and adjusting them according to the scene rendering parameters to obtain an optimized set of material parameters includes:

[0027] Classify and analyze the building block type information in the standardized data structure to obtain a building block material type mapping table;

[0028] Extract the corresponding basic material parameters from a preset material library according to the building block material type mapping table to obtain an initial set of material parameters;

[0029] Extract texture information from the standardized data structure, perform resolution matching and color space conversion on the texture to obtain processed texture data;

[0030] Generate a material texture mapping relationship according to the processed texture data and the UV coordinate mapping data to obtain a texture application plan;

[0031] Dynamically adjust the material parameters based on the initial set of material parameters, the texture application plan, and the lighting environment data in the scene rendering parameters to obtain an optimized set of material parameters.

[0032] Optionally, in the fifth implementation manner of the first aspect of the present invention, the applying the scene rendering parameters to the optimized model data and the standardized data structure for model rendering to obtain a model rendering result includes:

[0033] Construct a rendering scene space according to the camera parameters and lighting environment parameters in the scene rendering parameters to obtain a scene data structure;

[0034] Import the optimized model data into the scene data structure, and set the material attributes of each building block component according to the material parameter set to obtain the rendering preparation data;

[0035] Perform model rendering of the building block model according to the rendering preparation data and the standardized data structure, and accelerate the rendering through path caching and importance sampling optimization during the rendering process to obtain an optimized rendered image;

[0036] Post-process the optimized rendered image using a machine learning denoising model to obtain the model rendering result.

[0037] Optionally, in the sixth implementation manner of the first aspect of the present invention, the performing model rendering of the building block model according to the rendering preparation data and the standardized data structure, and accelerating the rendering through path caching and importance sampling optimization during the rendering process to obtain an optimized rendered image includes:

[0038] Perform spatial partitioning on the rendering preparation data, construct an acceleration structure to obtain a scene space index, and generate an initial light ray path according to the scene space index and the building block splicing relationship in the standardized data structure to obtain a sampling path set;

[0039] Apply the rendering equation to the sampling path set and perform Monte Carlo integral calculation to obtain the radiance estimation values of each point in the scene;

[0040] Store the radiance estimation values in the path cache and construct an importance sampling distribution based on the cached data to obtain an optimized sampling strategy;

[0041] Use the optimized sampling strategy to perform additional ray sampling, and combine the data in the path cache to solve the rendering equation again to obtain an optimized rendered image.

[0042] The second aspect of the present invention provides an automatic rendering device for a building block model, and the automatic rendering device for the building block model includes:

[0043] A file parsing module, configured to obtain the building block model file of the building block model, parse the building block model file to obtain the standardized data structure of the building block model file;

[0044] A scene calculation module, configured to set the camera parameters and lighting environment parameters of the scene where the building block model is located based on the standardized data structure to obtain scene rendering parameters;

[0045] A model optimization module, configured to optimize the building block model according to the standardized data structure and the scene rendering parameters to obtain optimized model data;

[0046] A model rendering module, configured to apply the scene rendering parameters to the optimized model data and the standardized data structure for model rendering, so as to obtain a model rendering result.

[0047] A third aspect of the present invention provides an automated rendering device for a building block model, including: a memory and at least one processor, wherein instructions are stored in the memory, and the memory and the at least one processor are interconnected through a line; the at least one processor calls the instructions in the memory, so that the automated rendering device of the building block model executes the steps of the above-mentioned automated rendering method of the building block model.

[0048] A fourth aspect of the present invention provides a computer-readable storage medium, in which instructions are stored, and when it runs on a computer, it enables the computer to execute the steps of the above-mentioned automated rendering method of the building block model.

[0049] The above-mentioned automated rendering method, device, equipment and storage medium of the building block model obtain the building block model file of the building block model, parse the building block model file to obtain the standardized data structure of the building block model file; based on the standardized data structure, set the camera parameters and lighting environment parameters of the scene where the building block model is located respectively to obtain scene rendering parameters; according to the standardized data structure and scene rendering parameters, optimize the building block model to obtain optimized model data; apply the scene rendering parameters to the optimized model data and the standardized data structure for model rendering to obtain a model rendering result. This method realizes the automation of the rendering process through the automatic parsing and parameter setting of the building block model file, reduces manual intervention, and through the application of the standardized data structure, realizes the unified management of model information, improves the data processing efficiency, and realizes the improvement and consistency of rendering quality.

[0050] Other features and advantages of the present invention will be described in the following specification, and, in part, will be obvious from the specification, or will be understood by implementing the present invention. The objectives and other advantages of the present invention are realized and obtained by the structures specifically pointed out in the specification, claims and drawings.

[0051] To make the above-mentioned objectives, features and advantages of the present invention more obvious and understandable, the following specific preferred embodiments are given, and in conjunction with the accompanying drawings, the detailed description is as follows. Description of the Drawings

[0052] Figure 1 It is a schematic diagram of the first embodiment of the automated rendering method of the building block model in the embodiment of the present invention;

[0053] Figure 2 It is a schematic diagram of an embodiment of the automated rendering device of the building block model in the embodiment of the present invention;

[0054] Figure 3 This is a schematic diagram of an embodiment of the automated rendering device for the building block model in the embodiments of the present invention. Detailed implementation manners

[0055] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Apparently, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0056] The terms "including" and "having" and any variations thereof mentioned in the embodiments of the present invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but optionally further includes other unlisted steps or units, or optionally further includes other steps or units inherent to these processes, methods, products or devices.

[0057] To facilitate the understanding of this embodiment, first, a detailed introduction to an automated rendering method for a building block model disclosed in the embodiments of the present invention will be given. As Figure 1 shown, this method includes the following steps:

[0058] 101. Obtain the building block model file of the building block model, parse the building block model file, and obtain the standardized data structure of the building block model file;

[0059] In an embodiment of the present invention, the automated rendering method of the building block model first receives the building block model file through the Internet Protocol (IP protocol). This method supports multiple file formats, including dedicated building block file formats, common 3D format files such as Wavefront obj format, fbx format, and stl format, etc. This multi-format support ensures the wide applicability of the system and enables it to handle model files from different software and design tools. To achieve file transfer, the system sets up a listening service based on the Transmission Control Protocol (TCP) and the Hypertext Transfer Protocol (HTTP). This architecture allows the system to act as a server and continuously listen for file transfer requests from the network. Other computer systems, whether they are design workstations, clients, or other software systems, can send files to the designated listening port of the rendering system according to the requirements of the HTTP protocol. The source of the file is not restricted. It may directly come from the design software of the building block designer, or it may be a modified model provided by the customer, or a file automatically generated by other computer systems. This flexibility enables the rendering system to be seamlessly integrated into various workflows and adapt to different usage scenarios. When the file transfer reaches the designated listening port, the system will automatically detect and receive the file. This process triggers the subsequent processing flow of the rendering system, including steps such as file format recognition and data parsing. The system will select an appropriate parser according to the received file type to extract the model data. For files in the dedicated building block format, the system will use a specially designed parser to directly extract the geometric information, position data, connection relationships, etc. of the building block components. For general 3D format files such as obj, fbx, or stl, the system will use the corresponding general parser to convert the 3D data in these formats into a data structure used internally by the system. During the parsing process, the system not only extracts basic geometric data but also processes material information, texture data (if any), and any additional metadata. These information are crucial for the subsequent rendering process and can ensure the accuracy and realism of the final rendering result. After parsing, all the extracted information is converted into a standardized internal data structure. This data structure is the core of the system design. It organizes information from different source files in a unified format, including geometric data, topological relationships, material properties, spatial information, etc.

[0060] 102. Based on the standardized data structure, set the camera parameters and lighting environment parameters of the scene where the building block model is located respectively to obtain scene rendering parameters;

[0061] In one embodiment of the present invention, based on the standardized data structure, the camera parameters and lighting environment parameters of the scene where the building block model is located are respectively set, and the obtained scene rendering parameters include: performing a bounding box calculation on the building block model according to the geometric information of the building block model in the standardized data structure to obtain model boundary data; according to the model boundary data, performing a bisection iteration adjustment on the camera position of the camera in the scene where the building block model is located to obtain the optimal camera position coordinates, and setting the camera parameters according to the optimal camera position coordinates to obtain the camera parameters of the camera; performing a principal direction analysis on the orientation information of the building block model in the standardized data structure to obtain the model principal axis vector, and setting the lighting environment parameters according to the model principal axis vector to obtain the lighting environment parameters; taking the camera parameters and the lighting environment parameters as the scene rendering parameters.

[0062] Specifically, first, a bounding box calculation is performed on the building block model according to the geometric information of the building block model in the standardized data structure to obtain model boundary data. This step is to determine the approximate range and size of the entire building block model in three-dimensional space. The bounding box is an axis-aligned cube that completely encloses all parts of the building block model. During the calculation process, the system traverses the geometric information of each building block component in the standardized data structure to find the minimum and maximum values of all vertex coordinates. These extreme values form the six faces of the bounding box. The obtained model boundary data includes the center point coordinates, length, width, height dimensions, and diagonal length of the bounding box. This information is crucial for subsequent camera position calculations because it provides the overall spatial distribution information of the model, helping to determine the appropriate viewing distance and perspective. In addition, the bounding box calculation can also be used to quickly cull objects outside the viewing frustum, improving rendering efficiency.

[0063] Specifically, next, according to the model boundary data, a bisection iteration adjustment is performed on the camera position of the camera in the scene where the building block model is located to obtain the optimal camera position coordinates, and the camera parameters are set according to the optimal camera position coordinates to obtain the camera parameters of the camera. This process aims to find an optimal viewing point that can completely and clearly display the entire building block model. The bisection iteration adjustment is an efficient search algorithm suitable for finding the optimal solution that meets specific conditions. Here, the system first sets an initial search range according to the size of the bounding box, and then continuously bisects and evaluates to narrow the search range. The evaluation criteria include the coverage rate of the model in the field of view and the visibility of key features. In each iteration, the system calculates the viewing frustum at the current camera position and checks whether the model completely falls within the viewing frustum, while also ensuring that the model is not too small or too large. This process is repeated until a camera position that meets the preset criteria is found. After obtaining the optimal camera position coordinates, the system will set other camera parameters, such as the field of view angle, near and far clipping planes, etc., to ensure that the model can be rendered completely and clearly.

[0064] Specifically, perform a principal direction analysis on the orientation information of the building block models in the standardized data structure to obtain the model principal axis vector, and set the lighting environment parameters according to the model principal axis vector to obtain the lighting environment parameters. The purpose of this step is to determine the overall orientation of the building block models so as to set an appropriate lighting environment and make the rendering results more natural and beautiful. The principal direction analysis usually involves statistical analysis and clustering of the directions of various parts of the model. The system first extracts the orientation information of each building block component from the standardized data structure, and this information may be stored in the form of normal vectors or rotation matrices. Then, use principal component analysis (PCA) or other clustering algorithms to process these direction data and find the principal axis vector that best represents the overall orientation of the model. This principal axis vector is usually aligned with the longest dimension of the model. After obtaining the model principal axis vector, the system will set the lighting environment parameters accordingly. This includes determining the direction and intensity of the main light source. Usually, the main light source is set at a certain angle to the principal axis vector to create appropriate shadows and a three-dimensional effect. At the same time, the system also sets the fill light and ambient light to balance the overall lighting effect and ensure that every part of the model can be clearly illuminated. The setting of the lighting environment parameters also needs to consider the material characteristics of the model to correctly simulate the reaction of different materials to light.

[0065] Specifically, finally, use the camera parameters and the lighting environment parameters as the scene rendering parameters. This step integrates all the previously calculated parameters into a complete set of scene rendering parameters. The scene rendering parameters are the key inputs for the subsequent rendering process, which define the viewing perspective and lighting conditions during rendering. The camera parameter part includes the position coordinates of the camera, the orientation vector, the field of view angle, the near and far clipping plane distances, etc. These parameters together determine the viewing perspective and visible range during rendering. The lighting environment parameter part includes the positions, intensities, colors, attenuation coefficients, etc. of each light source. These parameters determine the lighting effect during rendering and directly affect the light and dark contrast and color performance of the model. Integrating these parameters together to form a unified set of scene rendering parameters not only facilitates the unified call and management of the subsequent rendering process, but also provides convenience for possible parameter fine-tuning. In addition, this parameterized method also enables the system to easily save and reuse specific rendering settings, which is beneficial to maintaining consistency between different rendering tasks or quickly switching different scene settings according to different rendering requirements.

[0066] Further, the method of iteratively adjusting the camera position of the camera in the scene where the building block model is located by dichotomy according to the model boundary data to obtain the optimal camera position coordinates, and setting the camera parameters according to the optimal camera position coordinates, to obtain the camera parameters of the camera includes: constructing an initial camera position search space according to the model boundary data, and determining a set of candidate camera positions based on the initial camera position search space; evaluating the field of view coverage rate for each point in the set of candidate camera positions, and determining the initial optimal camera position according to the evaluation result; constructing a local search space centered on the initial optimal camera position, and performing dichotomy iterative search on the local search space to obtain the optimal camera position coordinates; calculating the camera focal length, field of view angle and depth of field parameters of the camera according to the optimal camera position coordinates and the model boundary data, to obtain the camera parameters of the camera.

[0067] Specifically, first, an initial camera position search space is constructed according to the model boundary data, and a set of candidate camera positions is determined based on this search space. The purpose of this step is to create a reasonable search range to improve the efficiency of subsequent searching for the optimal camera position. The system uses the previously calculated model boundary data, including the center point coordinates and size information of the bounding box, to define a spherical or hemispherical search space. This search space has the center of the bounding box as the center of the sphere, and its radius is usually set to 1.5 to 2 times the length of the diagonal of the bounding box to ensure that the entire model can be observed completely. Within this search space, the system uniformly generates a series of candidate points, and these points form a set of candidate camera positions. The number of candidate points needs to balance the coverage range and computational efficiency, and algorithms such as spherical uniform sampling or golden spiral sampling can usually be used to generate them. Each candidate point represents a potential camera position, and observing the model from this position may result in different visual effects. The initial search space and candidate point set constructed in this way provide a good starting point for subsequent camera position optimization, and help to quickly locate the possible optimal observation position.

[0068] Specifically, next, the field of view coverage rate of each point in the set of candidate camera positions is evaluated, and the initial optimal camera position is determined based on the evaluation results. The purpose of this step is to screen out the most potential camera positions from numerous candidates. The field of view coverage rate evaluation is a crucial process, which measures the integrity and clarity of the model in the field of view when observing the model from each candidate point. The evaluation process generally includes the following aspects: First, the system simulates placing a camera at each candidate point, calculates the projected area of the model within the viewing cone when observing from this point, and compares it with the ideal projected area. The ideal projected area is usually defined as 60% to 80% of the field of view occupied by the model. Second, the system checks whether the key features of the model are all within the field of view to avoid important parts being cropped. Third, the system evaluates the visibility of each part of the model to ensure that there is no important occlusion. Finally, the balance of the model in the picture is also considered to avoid the model being too biased towards one side of the picture. Each candidate point will get a comprehensive score, reflecting the overall quality of observing the model from this point. The point with the highest score is selected as the initial optimal camera position. This initial position provides a good starting point for subsequent fine-tuning, greatly narrowing the scope of the search space.

[0069] Specifically, taking the initial optimal camera position as the center, a local search space is constructed, and a dichotomy iterative search is performed on this local search space to obtain the optimal camera position coordinates. The purpose of this step is to perform fine-tuning based on the initial optimal position to find the true optimal observation point. The construction of the local search space usually adopts a spherical or cubic shape, with its center being the initial optimal camera position, and the radius or side length being determined according to the required accuracy, usually much smaller than the initial search space. Within this local space, the system uses the dichotomy method for iterative search. The use of the dichotomy method is based on the assumption that within the local space, the quality of the camera position changes continuously with the position. The search process first performs a dichotomy in the three main axis directions of the local space to generate new candidate points. The field of view coverage rate of these new points is evaluated, and the best point is selected as the new search center. Then the search space is reduced by half, and the above process is repeated with this new center. This iterative process will continue until the search space is smaller than the preset threshold, or the improvement amplitude of consecutive iterations is less than a certain threshold. The use of the dichotomy method can quickly converge to the local optimal solution, greatly improving the search efficiency. The finally obtained coordinates are the optimal camera position coordinates, which represent the observation point that can best display the building block model under the given conditions.

[0070] Specifically, finally, based on the optimal camera position coordinates and the model boundary data, calculate the focal length, field of view angle, and depth of field parameters of the camera to obtain the camera parameters. The purpose of this step is to set the specific parameters of the camera based on the found best viewing point to ensure that the rendered image can best display the building block model. First, the system calculates the orientation vector of the camera using the optimal camera position coordinates and the center of the bounding box of the model. Then, based on the size of the model and the camera position, calculate an appropriate focal length. The calculation of the focal length needs to consider the expected size of the model in the image, usually making the model occupy most of the image area but not being too crowded. The calculation of the field of view angle is closely related to the focal length, which determines the range that the camera can see. A larger field of view angle can include more scenes but may cause perspective distortion; a smaller field of view angle can provide a more natural visual effect but may not be able to display the entire model completely. Therefore, the system needs to find a balance between the two. The setting of the depth of field parameters needs to consider the depth range of the model and the desired clarity effect. Usually, the focal plane is set at the center position of the model, and the depth of field range is adjusted according to the size of the model to ensure that the entire model is within the clear range.

[0071] 103. Optimize the building block model according to the standardized data structure and scene rendering parameters to obtain optimized model data;

[0072] In an embodiment of the present invention, the optimized model data includes a chamfer parameter set, UV coordinate mapping data, normal vector data, and a material parameter set; the optimizing the building block model according to the standardized data structure and scene rendering parameters to obtain optimized model data includes: calculating the chamfer radius of the edges of the building blocks in the building block model according to the geometric information of the building block components in the standardized data structure to obtain a chamfer parameter set; performing mesh subdivision and vertex displacement on the building block model to obtain optimized mesh data with a chamfer effect, and performing UV unwrapping processing on the optimized mesh data to obtain UV coordinate mapping data; calculating the normal vector of each vertex of the building block model according to the UV coordinate mapping data and the lighting environment data in the scene rendering parameters to obtain normal vector data; extracting the corresponding material parameters from a preset material library based on the building block type information in the standardized data structure and adjusting them according to the scene rendering parameters to obtain an optimized material parameter set.

[0073] Specifically, first, based on the geometric information of the building block components in the standardized data structure, the chamfer radius of the edges of the building block model is calculated to obtain a set of chamfer parameters. The purpose of this step is to enhance the realism and visual appeal of the model. In the real world, the edges of building blocks are usually not completely sharp but have a certain degree of chamfer or rounding. The system analyzes the geometric information of each building block component, including its size, shape, and edge position. According to the type and size of the building block, the system assigns an appropriate chamfer radius to each edge. This process needs to consider the actual manufacturing process and material properties of the building block to ensure that the generated chamfer effect is both aesthetically pleasing and practical. For different types of building blocks, such as flat plates, bricks, or building blocks with special shapes, different chamfering strategies are applied. The system also needs to consider the connection points between adjacent building blocks to ensure that the chamfer does not affect the assembly of the building blocks. The final set of chamfer parameters contains the chamfer radius information for each edge, and this information will be used for subsequent mesh subdivision and vertex displacement processing.

[0074] Specifically, next, the building block model is subjected to mesh subdivision and vertex displacement to obtain optimized mesh data with a chamfer effect, and this optimized mesh data is subjected to UV unwrapping processing to obtain UV coordinate mapping data. The purpose of this step is to increase details to achieve the chamfer effect while maintaining the overall shape of the model and prepare for subsequent texture mapping. The mesh subdivision process first increases the number of polygons on the model surface, especially in areas that require chamfering, such as edges and corners. Subdivision algorithms such as Catmull-Clark subdivision or Loop subdivision are used. According to the information in the set of chamfer parameters, the vertices near the edges are displaced to form a smooth chamfer effect. This process needs to be carefully controlled to ensure that the chamfer effect looks natural and does not overly increase the number of polygons, affecting the rendering performance. After completing the mesh subdivision and vertex displacement, the system performs UV unwrapping processing on the optimized mesh. UV unwrapping is the process of mapping the surface of a 3D model to a 2D plane, assigning 2D texture coordinates to each vertex. For the building block model, UV unwrapping needs to consider the geometric features of the building block to ensure that the texture is continuous at the joints and avoid obvious seams. The system uses automatic UV unwrapping algorithms, such as the method based on minimum stretching, or preset UV templates for specific types of building blocks. The final UV coordinate mapping data assigns corresponding texture coordinates to each vertex, preparing for subsequent material application and rendering.

[0075] Specifically, based on the UV coordinate mapping data and the lighting environment data in the scene rendering parameters, the normal vector of each vertex of the building block model is calculated to obtain the normal vector data. The purpose of this step is to generate the correct normal vector for each vertex, which is crucial for accurately calculating the lighting effect. The normal vector is a unit vector perpendicular to the surface, which determines how light interacts with the surface, thereby affecting shadows, highlights, and the overall light and dark effect. The calculation process first uses the optimized mesh data. For each vertex, the normal vectors of all adjacent faces are considered. These face normal vectors are calculated through cross products and then weighted and averaged to obtain the initial normal vector of the vertex. The weights can be determined based on area or angle to ensure more accurate results. For the vertices in the chamfered area, special attention needs to be paid to the smooth transition of the normal vector to avoid sharp edges during rendering. In addition, the system also needs to consider the UV coordinate mapping data to ensure that the normal vector is consistent with the texture direction, especially in the case of normal maps. The lighting environment data in the scene rendering parameters also affects the calculation of the normal vector. For example, it may be necessary to fine-tune the normal vector according to the direction of the main light source to enhance specific lighting effects. The finally obtained normal vector data contains the normal vector information of each vertex of the model, and this information will be directly used in the subsequent lighting calculation and rendering process to ensure that the building block model can present the correct visual effect under different lighting conditions.

[0076] Specifically, finally, based on the building block type information in the standardized data structure, the corresponding material parameters are extracted from the preset material library and adjusted according to the scene rendering parameters to obtain the optimized material parameter set. The purpose of this step is to assign appropriate material properties to each building block component to present a realistic appearance during rendering. The system first determines the material category of each building block component, such as plastic, metal, rubber, etc., according to the building block type information in the standardized data structure. Then, the corresponding basic material parameters are extracted from the pre-established material library. These parameters usually include physical properties such as diffuse color, specular reflection intensity, roughness, refractive index, etc. For special building blocks, such as transparent or light-emitting components, the corresponding transparency or self-luminous parameters also need to be extracted. After extracting the basic parameters, the system will adjust them according to the scene rendering parameters. This includes adjusting the reflection parameters according to the lighting environment to ensure that the material presents the correct appearance under the given lighting conditions. For example, in a strong light environment, it may be necessary to increase the specular reflection intensity, while in a soft lighting environment, it may be necessary to reduce the reflection intensity to avoid being overly bright. In addition, the system also needs to consider the camera position and perspective, and may need to fine-tune some directional material effects. If there is texture information, the system will combine the texture with the material parameters to ensure the correct application of colors and textures. The finally obtained optimized material parameter set contains the complete material information of each building block component, and this information will be directly used in the renderer to ensure that the building block model presents an accurate and realistic appearance in the final rendered image.

[0077] Furthermore, based on the block type information in the standardized data structure, extracting the corresponding material parameters from a preset material library and adjusting them according to the scene rendering parameters to obtain an optimized set of material parameters includes: classifying and analyzing the block type information in the standardized data structure to obtain a block material type mapping table; according to the block material type mapping table, extracting the corresponding basic material parameters from the preset material library to obtain an initial set of material parameters; extracting texture information from the standardized data structure, performing resolution matching and color space conversion on the texture to obtain processed texture data; generating a material texture mapping relationship according to the processed texture data and UV coordinate mapping data to obtain a texture application plan; dynamically adjusting the material parameters based on the initial set of material parameters, the texture application plan, and the lighting environment data in the scene rendering parameters to obtain an optimized set of material parameters.

[0078] Specifically, first, classify and analyze the block type information in the standardized data structure to obtain a block material type mapping table. The purpose of this step is to establish the correspondence between block types and material types, laying the foundation for subsequent material parameter extraction. The system will traverse each block component in the standardized data structure and analyze its type information. This type information includes the shape of the block (such as bricks, plates, special shapes, etc.), functions (such as connectors, decorative pieces, etc.), and material properties (such as ordinary plastic, transparent plastic, metal, rubber, etc.). During the analysis process, the system will match this information with predefined material types. For example, ordinary bricks may correspond to standard plastic materials, transparent blocks correspond to transparent plastic materials, and metal decorative pieces correspond to metal materials, etc. This process may involve complex rule sets and decision trees to handle various special cases and boundary conditions. The finally obtained block material type mapping table is a structured data set that specifies the corresponding material type for each block type. This mapping table not only contains direct type correspondence relationships but may also include some additional information, such as the priority of the material, special processing marks, etc., which will play an important role in the subsequent material parameter extraction and adjustment processes.

[0079] Specifically, next, according to the building block material type mapping table, the corresponding basic material parameters are extracted from the preset material library to obtain the initial material parameter set. The purpose of this step is to assign initial material properties to each building block component. The preset material library is a database containing various material presets, and each material preset defines a series of parameters, such as diffuse color, specular reflection intensity, roughness, refractive index, etc. The system will traverse each entry in the building block material type mapping table and extract the corresponding parameter set from the material library according to the specified material type. This process needs to consider the diversity and complexity of materials. For example, for standard plastic materials, the system needs to extract basic color information and surface smoothness; for metal materials, additional reflectivity and metallicity parameters may need to be extracted; for transparent materials, transparency and refractive index also need to be considered. During the extraction process, the system also needs to handle some special cases, such as multi-layer materials or composite materials. For these complex materials, multiple sets of parameters need to be extracted and the relationships between them defined. The final obtained initial material parameter set is a comprehensive data structure containing the initial material properties of all building block components.

[0080] Specifically, the texture information is extracted from the standardized data structure, and the resolution of the texture is matched and the color space is converted to obtain the processed texture data. The purpose of this step is to prepare and optimize the texture resources for rendering. The system first identifies and extracts all texture information related to the building block model from the standardized data structure. These textures may include color textures, normal maps, glossiness maps, etc., which are used to enhance the visual details and realism of the model. The extraction process needs to ensure that the textures are correctly associated with the corresponding building block components. Next, the system performs resolution matching for each texture. This involves evaluating the resolution and quality requirements of the rendering target and then adjusting the texture size accordingly. If the original texture resolution is too high, the system will perform downsampling to optimize performance; if the resolution is too low, advanced interpolation algorithms need to be used for upsampling to ensure the rendering quality. In addition, the system also needs to perform color space conversion. The original texture may exist in different color spaces (such as sRGB, linear RGB, etc.), while the rendering system may require a specific color space. The conversion process ensures the accurate representation of colors in the final rendering. This step also includes additional processing of the textures, such as compression, mipmap generation, etc., to optimize the rendering performance and memory usage. The final obtained processed texture data is a set of optimized and standardized textures that are ready to be applied to the corresponding building block models.

[0081] Specifically, based on the processed texture map data and UV coordinate mapping data, a material texture map mapping relationship is generated to obtain a texture map application plan. The purpose of this step is to determine how to accurately apply the processed texture maps to the surface of the building block model. The system first analyzes the processed texture map data to identify the type and usage of each texture map. Then, it matches this information with the previously generated UV coordinate mapping data. The UV coordinate mapping data defines the texture coordinates corresponding to each point on the model surface, while the material texture map mapping relationship determines which texture maps should be applied to which parts of the model. This process needs to consider the geometric characteristics of the model and the characteristics of the texture maps. For example, for the surface of a building block with a repeating pattern, the system needs to calculate the correct texture tiling parameters; for a building block with special markings or patterns, the texture map and model features need to be precisely aligned. The system also needs to handle the case of multi-layer texture maps, such as the combined use of color texture maps and normal texture maps. When generating the mapping relationship, the system also considers the rendering performance and may use lower-resolution texture maps for some less important areas. The final obtained texture map application plan is a detailed guide that specifies how each texture map should be precisely mapped to the model surface, including parameters such as scaling, rotation, and tiling, to ensure that the design intent can be accurately reproduced during rendering.

[0082] 104. Apply the scene rendering parameters to the optimized model data and the standardized data structure for model rendering to obtain the model rendering result.

[0083] In an embodiment of the present invention, the applying the scene rendering parameters to the optimized model data and the standardized data structure for model rendering to obtain the model rendering result includes: constructing a rendering scene space according to the camera parameters and lighting environment parameters in the scene rendering parameters to obtain a scene data structure; importing the optimized model data into the scene data structure and setting the material attributes of each building block component according to the material parameter set to obtain rendering preparation data; performing model rendering of the building block model according to the rendering preparation data and the standardized data structure, and accelerating the rendering through path caching and importance sampling optimization during the rendering process to obtain an optimized rendering image; performing post-processing on the optimized rendering image using a machine learning denoising model to obtain the model rendering result.

[0084] Specifically, first, based on the camera parameters and lighting environment parameters in the scene rendering parameters, a rendering scene space is constructed to obtain a scene data structure. The purpose of this step is to create a virtual three-dimensional environment, providing a basic framework for the subsequent rendering process. The system uses camera parameters (such as position, orientation, field of view, etc.) to define the viewing space, which determines the perspective and range of the final rendered image. At the same time, light sources in the scene are set according to the lighting environment parameters, including the main light source, fill light, and ambient light, etc. The position, intensity, and color of these light sources directly affect the contrast and overall atmosphere of the rendering result. During the construction process, the system also needs to consider the requirements of pre-rendering processing, such as hiding or deleting certain building block components according to customer needs. This involves dynamic adjustment of the scene data structure to ensure that the final rendered content meets specific display requirements. In addition, the system also needs to set the boundaries and background of the rendering space, which may include a skybox or a specific background environment. The finally obtained scene data structure is a comprehensive data set containing all spatial information, lighting settings, and rendering parameters, which provides the necessary environmental information for the subsequent model import and rendering calculations.

[0085] Specifically, next, the optimized model data is imported into the scene data structure, and the material properties of each building block component are set according to the material parameter set to obtain the rendering preparation data. The purpose of this step is to integrate the previously optimized building block model data with the rendering scene and apply the corresponding material settings. The system first imports the geometric data of the optimized building block model into the constructed scene space to ensure that the position, orientation, and scale of the model in the scene are correct. Then, the system traverses each building block component and sets specific material properties for each component according to the previously obtained material parameter set. This includes applying basic material parameters (such as diffuse color, specular reflection intensity, etc.) and texture data (such as color texture, normal map, etc.). During this process, the system also needs to consider the requirements of pre-rendering processing, such as adjusting the material or adding special effects to specific building blocks according to customer requirements. For example, it may be necessary to add a glowing effect to some building block components or adjust the transparency to highlight certain parts. In addition, the system also needs to handle the splicing situation of multiple building block groups to ensure the continuity and consistency of the material at the seams. The finally obtained rendering preparation data is a complete data set ready for rendering calculations, which includes scene information, optimized model geometric data, complete material settings, and all necessary rendering parameters.

[0086] Specifically, based on the rendering preparation data and the standardized data structure, the model rendering of the building block model is performed, and during the rendering process, rendering acceleration is achieved through path caching and importance sampling optimization to obtain an optimized rendered image. This step is the core of the entire rendering process, aiming to generate high-quality images of the building block model. The system first initializes the rendering engine based on the rendering preparation data and sets rendering parameters such as resolution and number of samples. Then, it starts to execute the ray tracing algorithm, specifically by solving the rendering equation proposed by James T. Kajiya in 1986 to simulate the propagation and interaction of light in the scene. During this process, the system emits multiple rays for each pixel, traces the propagation paths of these rays in the scene, calculates their interactions with the surface of the building block model, and finally determines the color value of each pixel. To improve the rendering efficiency, the system adopts the path caching technique to store the calculated ray path information and reuse it in subsequent similar calculations, thereby reducing duplicate calculations. At the same time, the system also uses the importance sampling technique, according to the distribution of light sources and material properties in the scene, to preferentially sample the ray paths that contribute more to the final image, further improving the rendering efficiency. During the rendering process, the system will also perform special processing on specific building block components according to the previous pre-rendering requirements, such as adding special effects and adjusting visibility. The finally obtained optimized rendered image is a high-quality visual representation of the building block model that meets the customer's requirements.

[0087] Specifically, finally, the optimized rendered image is post-processed using a machine learning denoising model to obtain the model rendering result. The purpose of this step is to further improve the image quality and eliminate the noise generated during the rendering process. The system first analyzes the optimized rendered image to identify the areas that need to be denoised. Then, it applies a pre-trained machine learning denoising model to process these areas. This model is usually trained based on deep learning algorithms (such as convolutional neural networks) and can effectively distinguish the details and noise in the image. The denoising process needs to remove unnecessary noise and graininess while preserving the details and textures of the image. When applying the denoising model, the system will consider the characteristics under different materials and lighting conditions and use different denoising intensities for different areas. After denoising, the system will also perform color calibration and color space conversion to ensure the color accuracy and consistency of the final image. This step also includes other post-processing techniques such as sharpening and contrast adjustment to further enhance the visual effect of the image. The finally obtained model rendering result is a high-quality, low-noise, and color-accurate image of the building block model, which can be directly used for various purposes such as customer confirmation, product display, and packaging printing. This final result not only demonstrates the fine details and real material effects of the building block model but also ensures the consistent performance of the image on various output devices.

[0088] Furthermore, model rendering of the building block model is performed according to the rendering preparation data and the standardized data structure, and rendering acceleration is performed through path caching and importance sampling optimization during the rendering process. The steps to obtain the optimized rendering image include: performing spatial partitioning on the rendering preparation data, constructing an acceleration structure to obtain a scene space index, and generating an initial light ray path based on the scene space index and the building block splicing relationship in the standardized data structure to obtain a sampling path set; applying the rendering equation to the sampling path set and performing Monte Carlo integral calculation to obtain the radiance estimation value of each point in the scene; storing the radiance estimation value in the path cache, and constructing an importance sampling distribution based on the cached data to obtain an optimized sampling strategy; using the optimized sampling strategy to perform additional ray sampling, and combining the data in the path cache to solve the rendering equation again to obtain the optimized rendering image.

[0089] Specifically, first, perform spatial partitioning on the rendering preparation data, construct an acceleration structure to obtain a scene space index, and generate an initial light ray path based on the scene space index and the building block splicing relationship in the standardized data structure to obtain a sampling path set. The purpose of this step is to optimize the ray tracing efficiency during the rendering process. The system uses a spatial partitioning algorithm (such as an octree or KD tree) to divide the scene and create a hierarchical spatial index structure. This structure can quickly locate the intersection points of light rays and objects in the scene, greatly reducing the amount of calculation. During the construction process, the system will consider the special characteristics of the building block model, such as regular geometric shapes and repetitive structures, to optimize the spatial partitioning strategy. Then, the system uses this spatial index and the building block splicing information in the standardized data structure to generate an initial light ray path. The requirements of pre-rendering processing will be considered here, such as hiding or adjusting certain building block components according to customer requirements. The system emits light rays from the camera position, quickly determines the intersection points of the light rays and the building block model through the spatial index, and then calculates the reflection or refraction direction based on the material information and lighting conditions to form a complete light ray path. Multiple light ray paths will be generated for each pixel in this process, constituting a sampling path set. This path set contains the complete information of the light ray propagation in the scene, laying the foundation for subsequent rendering calculations.

[0090] Specifically, next, the rendering equation is applied to the set of sampled paths, and Monte Carlo integration is performed to obtain the radiance estimate values for each point in the scene. This step is the core of the rendering process, aiming to calculate the final color of each pixel. The system uses the rendering equation proposed by James T. Kajiya in 1986 as the theoretical basis, which describes the propagation and interaction of light in the scene. For each light ray path, the system calculates the energy transfer of the light ray at each intersection point, considering factors such as direct illumination, indirect illumination, and the reflection characteristics of the material. Since the analytical solution of the rendering equation is usually difficult to calculate directly, the system adopts the Monte Carlo method for numerical integration. This method estimates the integral value through random sampling and can effectively handle complex lighting situations. During the calculation process, the system will pay special attention to the special material effects of the building block models, such as the subsurface scattering of plastics and the refraction of transparent building blocks. At the same time, the system will also consider the special effects specified in the pre-rendering process, such as the glowing effect or material adjustment of certain building blocks. By calculating and averaging a large number of sampled paths, the system obtains the radiance estimate value for each surface point.

[0091] Specifically, the radiance estimate values are stored in the path cache, and an importance sampling distribution is constructed based on the cache data to obtain an optimized sampling strategy. The purpose of this step is to improve the rendering efficiency and image quality. The system first stores the calculated radiance estimate values in the path cache. This cache is a data structure that records the light ray transmission information at different positions and directions in the scene. The use of the cache can avoid repeated calculations of similar light ray paths, thus significantly reducing the calculation time. Next, the system analyzes the data in the cache and constructs an importance sampling distribution. This distribution reflects the contribution degree of different regions in the scene to the final image. For example, for the surface of building blocks with obvious highlights or areas with complex geometric structures, the system will assign higher sampling weights. During the construction process, the system will also consider the special requirements specified in the pre-rendering process. For example, the parts of the building blocks that need to be highlighted may obtain higher sampling weights. The finally obtained optimized sampling strategy is a scheme that guides subsequent ray tracing. It can more effectively allocate computing resources and focus on the regions that have the greatest impact on the final image quality.

[0092] Specifically, finally, an optimized sampling strategy is used for additional ray sampling, and combined with the data in the path cache, the rendering equation is solved again to obtain an optimized rendered image. The purpose of this step is to further improve the quality of the rendered image. The system generates new ray paths according to the optimized sampling strategy, and these paths are concentrated in the previously determined important regions. When tracing these new rays, the system will first check the path cache. If similar path information is found, the cached data will be directly used, greatly reducing the computational effort. For new paths without cache, the system will apply the rendering equation again for calculation. This process combines the new sampling data and the previous cached data, making the final rendering result more accurate and detailed. At this stage, the system will also pay special attention to the special effects specified in the pre-rendering process, such as the material changes or special lighting effects of certain building blocks, to ensure that these effects are accurately presented in the final image. In this way, the system can maximize the improvement of image quality with limited computing resources, especially in visually important regions. The finally obtained optimized rendered image not only has a high degree of realism and rich details, but also can accurately reflect the specific needs and design intentions of the customer.

[0093] In this embodiment, by obtaining the building block model file of the building block model, parsing the building block model file, the standardized data structure of the building block model file is obtained; based on the standardized data structure, the camera parameters and lighting environment parameters of the scene where the building block model is located are respectively set to obtain scene rendering parameters; according to the standardized data structure and the scene rendering parameters, the building block model is optimized to obtain optimized model data; the scene rendering parameters are applied to the optimized model data and the standardized data structure for model rendering to obtain a model rendering result. This method realizes the automation of the rendering process by automatically parsing and parameter setting of the building block model file, reduces manual intervention, and through the application of the standardized data structure, realizes the unified management of model information, improves the data processing efficiency, and realizes the improvement and consistency of the rendering quality.

[0094] The automated rendering method of the building block model in the embodiment of the present invention is described above. Next, the automated rendering device of the building block model in the embodiment of the present invention will be described. Please refer to Figure 2 , an embodiment of the automated rendering device of the building block model in the embodiment of the present invention includes:

[0095] A file parsing module 201, configured to obtain the building block model file of the building block model, parse the building block model file, and obtain the standardized data structure of the building block model file;

[0096] A scene calculation module 202, configured to respectively set the camera parameters and lighting environment parameters of the scene where the building block model is located based on the standardized data structure to obtain scene rendering parameters;

[0097] The model optimization module 203 is configured to optimize the building block model according to the standardized data structure and the scene rendering parameters to obtain optimized model data;

[0098] The model rendering module 204 is configured to apply the scene rendering parameters to the optimized model data and the standardized data structure for model rendering to obtain a model rendering result.

[0099] In an embodiment of the present invention, the automatic rendering device of the building block model runs the above-mentioned automatic rendering method of the building block model. The automatic rendering device of the building block model obtains the building block model file of the building block model, parses the building block model file to obtain the standardized data structure of the building block model file; based on the standardized data structure, sets the camera parameters and the lighting environment parameters of the scene where the building block model is located respectively to obtain scene rendering parameters; optimizes the building block model according to the standardized data structure and the scene rendering parameters to obtain optimized model data; applies the scene rendering parameters to the optimized model data and the standardized data structure for model rendering to obtain a model rendering result. This method realizes the automation of the rendering process through the automatic parsing and parameter setting of the building block model file, reduces manual intervention, and through the application of the standardized data structure, realizes the unified management of model information, improves the data processing efficiency, and realizes the improvement and consistency of the rendering quality.

[0100] Above Figure 2 The automatic rendering device of the building block model in the embodiment of the present invention is described in detail from the perspective of modular functional entities. Next, the automatic rendering device of the building block model in the embodiment of the present invention is described in detail from the perspective of hardware processing.

[0101] Figure 3FIG. 0 is a schematic structural diagram of an automated rendering device for a building block model provided by an embodiment of the present invention. The automated rendering device 300 for the building block model may vary greatly due to different configurations or performances, and may include one or more processors (central processing units, CPUs) 310 (for example, one or more processors) and a memory 320, and one or more storage media 330 for storing application programs 333 or data 332 (for example, one or more mass storage device terminals). Among them, the memory 320 and the storage media 330 may be transient storage or persistent storage. The program stored in the storage media 330 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the automated rendering device 300 for the building block model. Further, the processor 310 may be configured to communicate with the storage media 330 and execute a series of instruction operations in the storage media 330 on the automated rendering device 300 for the building block model to implement the steps of the above-mentioned automated rendering method for the building block model.

[0102] The automated rendering device 300 for the building block model may further include one or more power supplies 340, one or more wired or wireless network interfaces 350, one or more input / output interfaces 360, and / or one or more operating systems 331, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, and so on. Those skilled in the art can understand that Figure 3 the shown structural diagram of the automated rendering device for the building block model does not limit the automated rendering device for the building block model provided by the present invention, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0103] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions run on a computer, the computer is caused to execute the steps of the automated rendering method for the building block model.

[0104] Those skilled in the art can clearly understand that for the sake of convenience and brevity of description, the specific working processes of the above-described system or device and unit can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.

[0105] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.

[0106] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. An automatic rendering method for a building block model, characterized in that: The automatic rendering method of the building block model includes: Acquire a building block model file of the building block model, parse the building block model file, and obtain a standardized data structure of the building block model file; Based on the standardized data structure, camera parameters and lighting environment parameters of the scene where the building block model is located are respectively set to obtain scene rendering parameters; According to the standardized data structure and scene rendering parameters, the building block model is optimized to obtain optimized model data; According to the camera parameters and lighting environment parameters in the scene rendering parameters, a rendering scene space is constructed to obtain a scene data structure; the optimization model data is imported into the scene data structure, and the material properties of each building block element are set according to the material parameter set to obtain rendering preparation data; the rendering preparation data is spatially divided to construct an acceleration structure to obtain a scene space index, and an initial light path is generated according to the scene space index and the building block splicing relationship in the standardized data structure to obtain a sampling path set; a rendering equation is applied to the sampling path set to perform Monte Carlo integral calculation to obtain a radiosity estimate for each point in the scene; the radiosity estimate is stored in a path cache, and an importance sampling distribution is constructed based on the cached data to obtain an optimized sampling strategy; additional light sampling is performed using the optimized sampling strategy, and the rendering equation is solved again in combination with the data in the path cache to obtain an optimized rendered image; the optimized rendered image is post-processed using a machine learning denoising model to obtain a model rendering result.

2. The automatic rendering method of a building block model according to claim 1, characterized in that: The step of respectively setting the camera parameters and the lighting environment parameters of the scene where the building block model is located based on the standardized data structure to obtain the scene rendering parameters comprises: Calculate the bounding box of the building block model according to the building block model geometry information in the standardized data structure to obtain model boundary data; According to the model boundary data, the camera position of the camera of the scene where the building block model is located is adjusted iteratively by binary division to obtain the optimal camera position coordinates, and the camera parameters are set according to the optimal camera position coordinates to obtain the camera parameters of the camera; Performing a main direction analysis on the orientation information of the building block model in the standardized data structure to obtain a model principal axis vector, and setting a lighting environment parameter according to the model principal axis vector to obtain a lighting environment parameter; The camera parameters and the lighting environment parameters are used as scene rendering parameters.

3. The automatic rendering method of a building block model according to claim 2, characterized in that: The camera position of the camera in the scene where the building block model is located is adjusted iteratively by binary division according to the model boundary data to obtain the optimal camera position coordinates, and the camera parameters are set according to the optimal camera position coordinates to obtain the camera parameters of the camera, including: constructing an initial camera position search space according to the model boundary data, and determining a camera position candidate point set based on the initial camera position search space; Performing a field of view coverage evaluation on each point in the camera position candidate point set, and determining an initial optimal camera position according to the evaluation result; Taking the initial optimal camera position as the center, constructing a local search space, performing a binary iterative search on the local search space, and obtaining the coordinates of the optimal camera position; The camera focal length, field of view angle and depth of field parameters of the camera are calculated according to the optimal camera position coordinates and the model boundary data to obtain the camera parameters of the camera.

4. The automatic rendering method of a building block model according to claim 1, characterized in that: The optimization model data includes a chamfer parameter set, UV coordinate mapping data, normal vector data and a material parameter set; The step of optimizing the building block model according to the standardized data structure and the scene rendering parameters to obtain the optimized model data includes: Calculating the chamfer radius of the edges of the blocks in the block model according to the geometric information of the block elements in the standardized data structure to obtain a chamfer parameter set; Performing mesh subdivision and vertex displacement on the building block model to obtain optimized mesh data with chamfering effect, and performing UV unfolding processing on the optimized mesh data to obtain UV coordinate mapping data; Calculate the normal vector of each vertex of the building block model according to the UV coordinate mapping data and the lighting environment data in the scene rendering parameters to obtain normal vector data; Based on the building block type information in the standardized data structure, corresponding material parameters are extracted from a preset material library, and adjusted according to scene rendering parameters to obtain an optimized material parameter set.

5. The automatic rendering method of a building block model according to claim 4, characterized in that: Based on the building block type information in the standardized data structure, corresponding material parameters are extracted from the preset material library, and adjusted according to the scene rendering parameters to obtain an optimized material parameter set including: Classify and analyze the building block type information in the standardized data structure to obtain a building block material type mapping table; According to the building block material type mapping table, corresponding basic material parameters are extracted from a preset material library to obtain an initial material parameter set; Extracting texture information from the standardized data structure, performing resolution matching and color space conversion on the texture to obtain processed texture data; Generate a material texture mapping relationship based on the processed texture data and UV coordinate mapping data to obtain a texture application solution; Based on the initial material parameter set, the texture application scheme and the lighting environment data in the scene rendering parameters, the material parameters are dynamically adjusted to obtain an optimized material parameter set.

6. An automatic rendering device for a building block model, characterized in that: The automatic rendering device of the building block model comprises: A file parsing module, used for acquiring a building block model file of a building block model, parsing the building block model file, and obtaining a standardized data structure of the building block model file; A scene calculation module, used to set the camera parameters and lighting environment parameters of the scene where the building block model is located based on the standardized data structure, and obtain scene rendering parameters; A model optimization module, used to optimize the building block model according to the standardized data structure and scene rendering parameters to obtain optimized model data; A model rendering module is used to construct a rendering scene space according to the camera parameters and lighting environment parameters in the scene rendering parameters to obtain a scene data structure; import the optimized model data into the scene data structure, and set the material properties of each building block element according to the material parameter set to obtain rendering preparation data; spatially divide the rendering preparation data, construct an acceleration structure, obtain a scene space index, and generate an initial light path according to the scene space index and the building block splicing relationship in the standardized data structure to obtain a sampling path set; apply the rendering equation to the sampling path set, perform Monte Carlo integral calculation, and obtain the radiosity estimation value of each point in the scene; store the radiosity estimation value in a path cache, and construct an importance sampling distribution based on the cached data to obtain an optimized sampling strategy; use the optimized sampling strategy to perform additional light sampling, and combine the data in the path cache to solve the rendering equation again to obtain an optimized rendered image; use a machine learning denoising model to post-process the optimized rendered image to obtain a model rendering result.

7. An automatic rendering device for a building block model, characterized in that: The automatic rendering device of the building block model comprises: a memory and at least one processor, wherein the memory stores instructions; The at least one processor calls the instructions in the memory to enable the automatic rendering device of the building block model to perform the steps of the automatic rendering method of the building block model as described in any one of claims 1-5.

8. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by the processor, the steps of the automatic rendering method of the building block model as described in any one of claims 1-5 are implemented.

Citation Information

Patent Citations

  • Fast rendering method for virtual scene and model

    CN107103638A

  • Station yard inspection method based on unmanned aerial vehicle matrix shooting

    CN116858192A

  • Scene rendering method and device and electronic equipment

    CN118096989A