Automatic rendering method and device of building block model, equipment and storage medium
Through automated building block model rendering methods, building block model files are analyzed and optimized, and camera and lighting parameters are set, time-consuming and error problems caused by manual intervention in the existing rendering process are solved, and efficient and high-quality rendering effects are achieved.
Patent Information
- Application Number
- CN202510068384.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2045-01-16
AI Technical Summary
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.
Provides an automated rendering method for building block models, which can generate rendering results by obtaining building block model files, parsing and standardizing data structures, setting camera parameters and lighting environment parameters, and applying these parameters to model rendering to generate rendering results.
The rendering process is automated, manual intervention is reduced, data processing efficiency is improved, and rendering quality and consistency is improved.
Smart Images

Figure CN119494906A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an automatic rendering method, device, equipment and storage medium for a building block model. Background Art
[0002] In the field of building block design and production, it is usually necessary to convert building block models into high-quality rendering images for multiple links such as customer confirmation, packaging printing, and factory quality inspection. The existing rendering method usually involves the following steps: first, the designer uses a special building block CAD software to create a building block model; then, the model is imported into a general 3D design software (such as 3DMAX, Blender, etc.) for remodeling; then, the designer manually adjusts the camera position, lighting environment, material parameters, etc.; finally, the rendering calculation is performed to obtain the final image.
[0003] However, this approach has a major drawback: the entire process requires a lot of manual intervention, especially in the model conversion and rendering parameter adjustment stages. This is not only time-consuming and labor-intensive, but also prone to human errors, such as mapping errors, missing building block models, etc. In addition, when the building block model is modified in the CAD software, the designer needs to manually synchronize these changes in the 3D design software, which further increases the risk of errors and workload. Summary of the invention
[0004] The main purpose 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, which is time-consuming and labor-intensive and prone to human errors; A first aspect of the present invention provides an automatic rendering method for a building block model, the automatic rendering method for a building block model comprising: 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; The scene rendering parameters are applied to the optimized model data and the standardized data structure to perform model rendering to obtain a model rendering result.
[0005] Optionally, in a first implementation of the first aspect of the present invention, the camera parameters and lighting environment parameters of the scene where the building block model is located are respectively set based on the standardized data structure to obtain the scene rendering parameters, including: 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.
[0006] Optionally, in a second implementation of the first aspect of the present invention, the camera position of the camera of the scene where the building block model is located is adjusted iteratively by binary division according to the model boundary data to obtain optimal camera position coordinates, and camera parameters are set according to the optimal camera position coordinates, and the camera parameters of the camera are obtained, 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.
[0007] Optionally, in a third implementation of the first aspect of the present invention, 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.
[0008] Optionally, in a fourth implementation of the first aspect of the present invention, 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, 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.
[0009] Optionally, in a fifth implementation of the first aspect of the present invention, applying the scene rendering parameters to the optimized model data and the standardized data structure to perform model rendering to obtain a model rendering result includes: According to the camera parameters and the lighting environment parameters in the scene rendering parameters, a rendering scene space is constructed to obtain a scene data structure; Importing the optimized model data into the scene data structure, and setting the material properties of each building block element 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 rendered image; The optimized rendered image is post-processed using a machine learning denoising model to obtain a model rendering result.
[0010] Optionally, in a sixth implementation of the first aspect of the present invention, performing model rendering of the building block model according to the rendering preparation data and the standardized data structure, and accelerating rendering through path caching and importance sampling optimization during the rendering process to obtain an optimized rendered image includes: Performing spatial division on the rendering preparation data, constructing an acceleration structure, obtaining a scene space index, and generating an initial light path according to the scene space index and a building block splicing relationship in a standardized data structure, to obtain a sampling path set; Applying the rendering equation to the sampling path set, performing Monte Carlo integration calculation, and obtaining the estimated radiance value of each point in the scene; The radiance estimation value is stored in a path cache, and an importance sampling distribution is constructed based on the cache data to obtain an optimized sampling strategy; The optimized sampling strategy is used to perform additional light sampling, and the rendering equation is solved again in combination with the data in the path cache to obtain an optimized rendered image.
[0011] A second aspect of the present invention provides an automatic rendering device for a building block model, the automatic rendering device for a building block model comprising: 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; The model rendering module is used to apply the scene rendering parameters to the optimized model data and the standardized data structure to perform model rendering to obtain a model rendering result.
[0012] A third aspect of the present invention provides an automatic rendering device for a building block model, comprising: 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 via lines; the at least one processor calls the instructions in the memory so that the automatic rendering device for the building block model executes the steps of the above-mentioned automatic rendering method for the building block model.
[0013] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the steps of the above-mentioned method for automatically rendering a building block model.
[0014] The above-mentioned automatic 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, and obtain the standardized data structure of the building block model file; based on the standardized data structure, respectively set the camera parameters and lighting environment parameters of the scene where the building block model is located to obtain the scene rendering parameters; according to the standardized data structure and scene rendering parameters, the building block model is optimized to obtain the optimized model data; the scene rendering parameters are applied to the optimized model data and the standardized data structure to perform model rendering to obtain the model rendering result. This method realizes the automation of the rendering process by automatically parsing and setting parameters of the building block model file, reduces manual intervention, and realizes the unified management of model information through the application of standardized data structure, improves data processing efficiency, and achieves the improvement and consistency of rendering quality.
[0015] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0016] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a schematic diagram of a first embodiment of an automatic rendering method of a building block model in an embodiment of the present invention; Figure 2 A schematic diagram of an embodiment of an automatic rendering device for a building block model in an embodiment of the present invention; Figure 3 Schematic diagram of an embodiment of an automatic rendering device for a building block model in an embodiment of the present invention. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0019] The terms "including" and "having" and any variations thereof mentioned in the embodiments of the present invention are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device end including a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or device ends.
[0020] To facilitate understanding of this embodiment, firstly, a method for automatically rendering a building block model disclosed in an embodiment of the present invention is described in detail. Figure 1 As shown, the method comprises the following steps: 101. Obtain 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; In one embodiment of the present invention, the automatic rendering method of the building block model first receives the building block model file through the Internet Protocol (IP protocol). The method supports multiple file formats, including dedicated building block file formats, Wavefront obj format, fbx format, stl format and other common 3D format files. This multi-format support ensures the wide applicability of the system and can process 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 to file transfer requests from the network. Other computer systems, whether 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, and may come directly 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 arrives at the designated listening port, the system automatically detects and receives the file. This process triggers the subsequent processing flow of the rendering system, including file format identification, data parsing and other steps. The system will select the appropriate parser to extract the model data according to the file type received. For files in the building block-specific 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 data structures used internally by the system. During the parsing process, the system not only extracts basic geometric data, but also processes material information, map data (if any), and any additional metadata. This information is crucial for the subsequent rendering process and can ensure the accuracy and realism of the final rendering results. After the parsing is completed, 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.
[0021] 102. Based on the standardized data structure, the camera parameters and the lighting environment parameters of the scene where the building block model is located are set respectively to obtain the scene rendering parameters; In one embodiment of the present invention, the camera parameters and lighting environment parameters of the scene where the building block model is located are set separately based on the standardized data structure to obtain scene rendering parameters, including: performing bounding box calculation on the building block model according to the building block model geometric information in the standardized data structure to obtain model boundary data; performing binary iterative adjustment on the camera position of the camera of the scene where the building block model is located according to the model boundary data to obtain optimal camera position coordinates, and setting camera parameters according to the optimal camera position coordinates to obtain camera parameters of the camera; performing main direction analysis on the building block model orientation information in the standardized data structure to obtain the model main axis vector, and setting lighting environment parameters according to the model main axis vector to obtain lighting environment parameters; using the camera parameters and the lighting environment parameters as scene rendering parameters.
[0022] Specifically, first, the bounding box of the building block model is calculated according to the geometric information of the building block model in the standardized data structure to obtain the 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 a cube aligned with the coordinate axis, which completely contains all parts of the building block model. During the calculation process, the system traverses the geometric information of each building block element in the standardized data structure to find the minimum and maximum values of all vertex coordinates. These extreme values constitute the six faces of the bounding box. The obtained model boundary data includes the coordinates of the center point of the bounding box, the length, width and height dimensions, and the diagonal length. This information is crucial for subsequent camera position calculations because they provide information on the overall spatial distribution of the model, which helps to determine the appropriate viewing distance and viewing angle. In addition, the bounding box calculation can also be used to quickly eliminate objects outside the view frustum to improve rendering efficiency.
[0023] Specifically, next, according to the model boundary data, the camera position of the scene where the building block model is located is adjusted by binary division iteration 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 observation point that can fully and clearly display the entire building block model. Binary division iteration adjustment is an efficient search algorithm that is 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 narrows the search range by continuous binary division and evaluation. The evaluation criteria include the coverage of the model in the field of view, the visibility of key features, etc. In each iteration, the system calculates the view cone under the current camera position and checks whether the model falls completely within the view cone, 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 sets other camera parameters accordingly, such as field of view angle, near and far clipping planes, etc., to ensure that the model can be rendered completely and clearly.
[0024] Specifically, the orientation information of the building block model in the standardized data structure is analyzed in the main direction to obtain the main axis vector of the model, and the lighting environment parameters are set according to the main axis vector of the model to obtain the lighting environment parameters. The purpose of this step is to determine the overall orientation of the building block model so as to set a suitable lighting environment and make the rendering result more natural and beautiful. The main direction analysis usually involves statistics and clustering of the directions of various parts of the model. The system first extracts the orientation information of each building block element from the standardized data structure, which may be stored in the form of a normal vector or a rotation matrix. Then, the principal component analysis (PCA) or other clustering algorithms are used to process these direction data to find the main axis vector that best represents the orientation of the entire model. This main axis vector is usually aligned with the longest dimension of the model. After obtaining the main axis vector of the model, the system will set the lighting environment parameters accordingly. This includes determining the direction and intensity of the main light source, which is usually set at a certain angle to the main axis vector to create suitable shadows and three-dimensional effects. At the same time, the system will also set fill light and ambient light to balance the overall lighting effect to ensure that every part of the model can be clearly illuminated. The setting of lighting environment parameters also needs to consider the material properties of the model in order to correctly simulate the reaction of different materials to light.
[0025] Specifically, finally, the camera parameters and lighting environment parameters are used as scene rendering parameters. This step integrates all the parameters calculated previously into a complete scene rendering parameter set. The scene rendering parameters are the key input of the subsequent rendering process, which defines the viewing angle and lighting conditions during rendering. The camera parameter part includes the camera's position coordinates, orientation vector, field of view, near and far clipping plane distances, etc. These parameters jointly determine the viewing angle and visible range during rendering. The lighting environment parameter part includes the position, intensity, color, attenuation coefficient, 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 scene rendering parameter set not only facilitates the unified call and management of the subsequent rendering process, but also facilitates possible parameter fine-tuning. In addition, this parameterized method also enables the system to easily save and reuse specific rendering settings, which is conducive to maintaining consistency between different rendering tasks, or quickly switching different scene settings according to different rendering requirements.
[0026] Furthermore, 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 search 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; constructing a local search space with the initial optimal camera position as the center, and performing a binary search on the local search space to obtain the optimal camera position coordinates; and 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.
[0027] Specifically, first, an initial camera position search space is constructed based on the model boundary data, and a camera position candidate point set is determined based on the search space. The purpose of this step is to create a reasonable search range to improve the efficiency of subsequent search for the optimal camera position. The system uses the previously calculated model boundary data, including the coordinates and size information of the center point of the bounding box, to define a spherical or hemispherical search space. This search space is centered on the center of the bounding box, 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 fully observed. In this search space, the system will uniformly generate a series of candidate points, which constitute the camera position candidate point set. The number of candidate points needs to strike a balance between coverage and computational efficiency, and can usually be generated using algorithms such as spherical uniform sampling or golden spiral sampling. 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, which helps to quickly locate the possible optimal observation position.
[0028] Specifically, next, the field of view coverage is evaluated for each point in the camera position candidate set, and the initial optimal camera position is determined based on the evaluation results. The purpose of this step is to select the most promising camera position from a large number of candidate points. Field of view coverage evaluation is a key process that measures the completeness and clarity of the model in the field of view when observing the model from each candidate point. The evaluation process usually includes the following aspects: First, the system simulates placing a camera at each candidate point, calculates the projected area of the model in the frustum when observed from that point, and compares it with the ideal projected area. The ideal projected area is usually defined as the model occupying 60% to 80% of the field of view. 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 to one side of the picture. Each candidate point will receive a comprehensive score that reflects the overall quality of the model observed from that 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 and greatly reduces the spatial range that needs to be searched.
[0029] Specifically, a local search space is constructed with the initial optimal camera position as the center, and a binary search is performed on the local search space to obtain the coordinates of the optimal camera position. The purpose of this step is to make fine adjustments based on the initial optimal position to find the true optimal observation point. The local search space is usually constructed in a spherical or cubic shape, with the initial optimal camera position as the center, and the radius or side length is determined according to the required accuracy, which is usually much smaller than the initial search space. In this local space, the system uses binary search for iterative search. The use of binary search is based on the assumption that the quality of the camera position is continuous with the position change in the local space. The search process first divides the local space into two in the three main axis directions to generate new candidate points. The field of view coverage 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 of multiple consecutive iterations is less than a certain threshold. The use of binary search can quickly converge to the local optimal solution, greatly improving the search efficiency. The final coordinates are the optimal camera position coordinates, which represent the observation point that can best display the building block model under given conditions.
[0030] Specifically, finally, according to the optimal camera position coordinates and the model boundary data, the focal length, field of view angle and depth of field parameters of the camera are calculated to obtain the camera parameters of the camera. The purpose of this step is to set the specific parameters of the camera based on the best observation point found to ensure that the rendered image can best display the building block model. First, the system calculates the camera's orientation vector using the optimal camera position coordinates and the center of the bounding box of the model. Then, according to the size of the model and the camera position, the appropriate focal length is calculated. The calculation of the focal length needs to consider the expected size of the model in the image, which usually makes the model occupy most of the area of the picture, but not 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 fully display the entire model. 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 expected clarity effect. The focal plane is usually set at the center 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 a clear range.
[0031] 103. Optimize the building block model according to the standardized data structure and scene rendering parameters to obtain optimized model data; In one 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 model optimization of 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 building block edges in the building block model according to the building block element geometry information in the standardized data structure to obtain the chamfer parameter set; meshing and vertex displacement of the building block model to obtain optimized mesh data with chamfer effects, and UV unfolding 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 the normal vector data; extracting the corresponding material parameters from the 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 the optimized material parameter set.
[0032] Specifically, first, according to the geometric information of the building block elements in the standardized data structure, the chamfer radius of the building block edges in the building block model is calculated to obtain the chamfer parameter set. 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 rounded corners. The system analyzes the geometric information of each building block element, 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 blocks to ensure that the generated chamfer effect is both beautiful and practical. Different chamfering strategies are applied to different types of building blocks, such as slabs, bricks or building blocks of special shapes. The system also needs to consider the joints between adjacent building blocks to ensure that the chamfer does not affect the splicing of the building blocks. The final chamfer parameter set contains the chamfer radius information of each edge, which will be used for subsequent mesh subdivision and vertex displacement processing.
[0033] Specifically, next, the block model is meshed and vertex displaced to obtain optimized mesh data with chamfering effect, and the optimized mesh data is UV unfolded to obtain UV coordinate mapping data. The purpose of this step is to add details to achieve chamfering effect while maintaining the overall shape of the model, and to prepare for subsequent texture mapping. The mesh subdivision process first increases the number of polygons on the model surface, especially in areas that need chamfering such as edges and corners. The subdivision algorithm uses methods such as Catmull-Clark subdivision or Loop subdivision to displace vertices near the edge according to the information in the chamfer parameter set to form a smooth chamfering effect. This process requires careful control to ensure that the chamfering effect looks natural without excessively increasing the number of polygons and affecting rendering performance. After completing the mesh subdivision and vertex displacement, the system will perform UV unfolding on the optimized mesh. UV unfolding is the process of mapping the surface of a three-dimensional model to a two-dimensional plane, assigning two-dimensional texture coordinates to each vertex. For the block model, UV unfolding needs to consider the geometric characteristics of the block to ensure that the texture is continuous at the joints and avoid obvious seams. The system will use automatic UV unwrapping algorithms, such as minimum stretch-based methods, or preset UV templates for specific types of blocks. The resulting UV coordinate mapping data specifies the corresponding texture coordinates for each vertex, ready for subsequent material application and rendering.
[0034] Specifically, according to 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 overall light and dark effects. The calculation process first uses the optimized mesh data, and for each vertex, the normal vectors of all adjacent faces are considered. These face normal vectors are calculated by cross product, and then weighted average is performed to obtain the initial normal vector of the vertex. The weight can be determined based on area or angle to ensure more accurate results. For vertices in the chamfered area, special attention should be paid to the smooth transition of the normal vector to avoid sharp edges when 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 when there is a normal map. The lighting environment data in the scene rendering parameters will also affect the calculation of the normal vector. For example, the normal vector may need to be fine-tuned according to the direction of the main light source to enhance a specific lighting effect. The final normal vector data contains the normal vector information of each vertex of the model. 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.
[0035] 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 element to present a realistic appearance when rendering. The system first determines the material category of each building block element, such as plastic, metal, rubber, etc., based on 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, and refractive index. For special building blocks, such as transparent or luminous elements, the corresponding transparency or self-luminous parameters need to be extracted. After extracting the basic parameters, the system will adjust 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 given lighting conditions. For example, the specular reflection intensity may need to be increased in a strong light environment, while the reflection intensity may need to be reduced in soft light to avoid excessive brightness. In addition, the system also needs to consider the camera position and viewing angle, and some directional material effects may need to be fine-tuned. If there is map information, the system will combine the map with the material parameters to ensure the correct application of color and texture. The final optimized material parameter set contains complete material information for each building block component, which 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.
[0036] Furthermore, 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 the scene rendering parameters to obtain an optimized material parameter set, including: classifying and analyzing 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; texture information is extracted from the standardized data structure, and resolution matching and color space conversion are performed on the texture to obtain processed texture data; according to the processed texture data and UV coordinate mapping data, a material-texture mapping relationship is generated to obtain a texture application scheme; 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.
[0037] Specifically, first, the building block type information in the standardized data structure is classified and analyzed to obtain a building block material type mapping table. The purpose of this step is to establish the correspondence between building block types and material types, laying the foundation for subsequent material parameter extraction. The system will traverse each building block element in the standardized data structure and analyze its type information. This type information includes the shape of the building block (such as bricks, plates, special shapes, etc.), functions (such as connectors, decorative parts, 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 building blocks correspond to transparent plastic materials, and metal decorative parts correspond to metal materials. This process may involve complex rule sets and decision trees to handle various special cases and boundary conditions. The resulting building block material type mapping table is a structured data set that specifies the corresponding material type for each building block type. This mapping table not only contains direct type correspondences, but can also contain some additional information, such as material priority, special processing tags, etc., which will play an important role in the subsequent material parameter extraction and adjustment process.
[0038] 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, each of which 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, it may be necessary to additionally extract reflectivity and metalness parameters; and 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 relationship between them needs to be defined. The final initial material parameter set is a comprehensive data structure containing the initial material properties of all building block components.
[0039] Specifically, the texture information is extracted from the standardized data structure, and the texture is resolution matched and color space 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 the texture information related to the building block model from the standardized data structure. These textures may include color maps, 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 texture is correctly associated with the corresponding building block element. 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 downsample to optimize performance; if the resolution is too low, it needs to be upsampled using advanced interpolation algorithms to ensure rendering quality. In addition, the system needs to perform color space conversion. The original texture may exist in different color spaces (such as sRGB, linear RGB, etc.), and the rendering system may require a specific color space. The conversion process ensures that the color is accurately represented in the final rendering. This step also includes additional processing of the textures, such as compression, mipmap generation, etc., to optimize rendering performance and memory usage. The final processed texture data is an optimized and standardized set of textures that are ready to be applied to the corresponding building block models.
[0040] Specifically, based on the processed texture data and UV coordinate mapping data, a material texture mapping relationship is generated to obtain a texture application plan. The purpose of this step is to determine how to accurately apply the processed texture to the surface of the building block model. The system first analyzes the processed texture data to identify the type and purpose of each texture. Then, it matches this information with the UV coordinate mapping data generated previously. The UV coordinate mapping data defines the texture coordinates corresponding to each point on the model surface, while the material texture mapping relationship determines which textures should be applied to which parts of the model. This process needs to take into account the geometric characteristics of the model and the characteristics of the texture. For example, for a building block surface with a repeating pattern, the system needs to calculate the correct texture tiling parameters; for a building block with special marks or patterns, it is necessary to accurately align the texture and model features. The system also needs to handle the situation of multi-layer textures, such as the combined use of color maps and normal maps. When generating the mapping relationship, the system also considers rendering performance and may use lower resolution textures for some less important areas. The resulting texture application plan is a detailed guide that specifies how each texture should be accurately mapped to the model surface, including parameters such as scaling, rotation, tiling, etc., ensuring that the design intent can be accurately reproduced when rendering.
[0041] 104. Apply the scene rendering parameters to optimize the model data and standardize the data structure to perform model rendering, and obtain a model rendering result.
[0042] In one embodiment of the present invention, the applying the scene rendering parameters to the optimized model data and the standardized data structure to perform model rendering and 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 properties of each building block element according to a 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 rendered image; and post-processing the optimized rendered image using a machine learning denoising model to obtain a model rendering result.
[0043] Specifically, first, according to the camera parameters and lighting environment parameters in the scene rendering parameters, the rendering scene space is constructed to obtain the scene data structure. The purpose of this step is to create a virtual three-dimensional environment to provide a basic framework for the subsequent rendering process. The system uses camera parameters (such as position, orientation, field of view, etc.) to define the observation space, which determines the viewing angle and range of the final rendered image. At the same time, the light sources in the scene are set according to the lighting environment parameters, including the main light source, fill light, and ambient light. The position, intensity, and color of these light sources directly affect the light and dark contrast and overall atmosphere of the rendering results. 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 final 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 calculation.
[0044] 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 optimized building block model geometry data 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 map data (such as color map, normal map, etc.). In this process, the system also needs to consider the needs 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 glow effect to some building block components, or adjust the transparency to highlight certain parts. In addition, the system also needs to handle the splicing of multiple building block groups to ensure the continuity and consistency of the material at the seams. The resulting rendering preparation data is a complete data set ready for rendering calculations, which includes scene information, optimized model geometry data, complete material settings, and all necessary rendering parameters.
[0045] Specifically, the model rendering of the building block model is performed according to the rendering preparation data and the standardized data structure, and the rendering is accelerated by path caching and importance sampling optimization during the rendering process to obtain an optimized rendering image. This step is the core of the entire rendering process, and the purpose is to generate high-quality building block model images. 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, the ray tracing algorithm is started, which simulates the propagation and interaction of light in the scene by solving the rendering equation proposed by James T. Kajiya in 1986. In this process, the system will emit multiple rays for each pixel, trace the propagation paths of these rays in the scene, calculate their interactions with the surface of the building block model, and finally determine the color value of each pixel. In order to improve rendering efficiency, the system uses path caching technology to store the calculated light path information and reuse it in subsequent similar calculations, thereby reducing repeated calculations. At the same time, the system also uses importance sampling technology to preferentially sample those light paths that contribute more to the final image according to the distribution of light sources and material characteristics in the scene, further improving rendering efficiency. During the rendering process, the system will also perform special processing on specific building block components according to the previous pre-rendering processing requirements, such as adding special effects, adjusting visibility, etc. The final optimized rendering image is a high-quality visual representation of the building block model that meets customer needs.
[0046] 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 and identifies the areas that need to be denoised. Then, a pre-trained machine learning denoising model is applied to process these areas. This model is usually trained based on a deep learning algorithm (such as a convolutional neural network) and can effectively distinguish between details and noise in the image. The denoising process needs to remove unnecessary noise and graininess while retaining image details and texture. When applying the denoising model, the system considers the characteristics of different materials and lighting conditions and uses different denoising intensities for different areas. After denoising, the system also performs 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 final model rendering result is a high-quality, low-noise, and color-accurate building block model image that can be directly used for customer confirmation, product display, packaging printing, and many other purposes. This final result not only showcases the fine details and realistic material effects of the building block model, but also ensures consistent performance of the image on various output devices.
[0047] Furthermore, the model rendering of the building block model is performed according to the rendering preparation data and the standardized data structure, and the rendering is accelerated through path caching and importance sampling optimization during the rendering process to obtain an optimized rendered image, including: spatially dividing the rendering preparation data, constructing an acceleration structure, obtaining a scene space index, and generating 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; applying a rendering equation to the sampling path set, performing a Monte Carlo integral calculation, and obtaining a radiance estimate for each point in the scene; storing the radiance estimate in a path cache, and constructing an importance sampling distribution based on the cached data to obtain an optimized sampling strategy; performing additional light sampling using the optimized sampling strategy, and solving the rendering equation again in combination with the data in the path cache to obtain an optimized rendered image.
[0048] Specifically, first, the rendering preparation data is spatially divided, an acceleration structure is constructed, the scene space index is obtained, and the initial light path is generated according to the scene space index and the building block splicing relationship in the standardized data structure to obtain the sampling path set. The purpose of this step is to optimize the efficiency of ray tracing during the rendering process. The system uses a spatial partitioning algorithm (such as an octree or a KD tree) to segment the scene and create a hierarchical spatial index structure. This structure can quickly locate the intersection of light and objects in the scene, greatly reducing the amount of calculation. During the construction process, the system considers the particularity of the building block model, such as regular geometric shapes and repeated 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 the initial light path. Here, the needs of pre-rendering processing are considered, such as hiding or adjusting certain building block components according to customer requirements. The system emits light from the camera position, quickly determines the intersection of light and the building block model through the spatial index, and then calculates the reflection or refraction direction according to the material information and lighting conditions to form a complete light path. This process generates multiple light paths for each pixel to form a sampling path set. This path set contains complete information about the propagation of light in the scene, laying the foundation for subsequent rendering calculations.
[0049] Specifically, next, the rendering equation is applied to the set of sampled paths, and the Monte Carlo integral calculation is performed to obtain the estimated radiance value of each point in the scene. This step is the core of the rendering process, and the purpose is 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 path, the system calculates the energy transfer of the light at each intersection, considering factors such as direct lighting, indirect lighting, and the reflective properties of the material. Since the analytical solution of the rendering equation is usually difficult to calculate directly, the system uses the Monte Carlo method for numerical integration. This method estimates the integral value through random sampling and can effectively handle complex lighting conditions. During the calculation process, the system pays special attention to the special material effects of the building block model, such as subsurface scattering of plastics, refraction of transparent building blocks, etc. At the same time, the system also considers special effects specified in the pre-rendering process, such as the luminous effect or material adjustment of certain building blocks. By calculating and averaging a large number of sampling paths, the system obtains the estimated radiance value of each surface point.
[0050] Specifically, the radiance estimate is stored in the path cache, and the importance sampling distribution is constructed based on the cache data to obtain the optimized sampling strategy. The purpose of this step is to improve rendering efficiency and image quality. The system first stores the calculated radiance estimate in the path cache. This cache is a data structure that records the light transmission information at different positions and directions in the scene. The use of the cache can avoid repeated calculations of similar light paths, thereby significantly reducing the calculation time. Next, the system analyzes the data in the cache and constructs the importance sampling distribution. This distribution reflects the contribution of different areas in the scene to the final image. For example, for the surface of a block with obvious highlights or an area with complex geometric structures, the system will assign a higher sampling weight. During the construction process, the system will also consider special requirements specified in the pre-rendering processing, such as the part of the block that needs to be highlighted may get a higher sampling weight. The resulting optimized sampling strategy is a solution to guide subsequent ray tracing, which can more effectively allocate computing resources and focus on the areas that have the greatest impact on the final image quality.
[0051] Specifically, at the end, the optimized sampling strategy is used to perform additional light sampling, and the rendering equation is solved again in combination with the data in the path cache to obtain the optimized rendered image. The purpose of this step is to further improve the quality of the rendered image. The system generates new light paths based on the optimized sampling strategy, which are concentrated in the important areas previously determined. When tracing these new rays, the system will first check the path cache. If similar path information is found, the cached data is directly used, which greatly reduces the amount of calculation. For new paths that are not cached, the system will apply the rendering equation again for calculation. This process combines the new sampling data with the previous cached data, making the final rendering result more accurate and detailed. At this stage, the system also pays special attention to special effects specified in the pre-rendering process, such as material changes of certain building blocks or special lighting effects, to ensure that these effects are accurately presented in the final image. In this way, the system can maximize the image quality, especially in visually important areas, with limited computing resources. The resulting optimized rendered image is not only highly realistic and detailed, but also accurately reflects the customer's specific needs and design intent.
[0052] In this embodiment, the building block model file of the building block model is obtained, the building block model file is parsed, and a 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 to perform model rendering to obtain a model rendering result. This method realizes the automation of the rendering process and reduces manual intervention by automatically parsing and setting parameters of the building block model file, and realizes the unified management of model information through the application of the standardized data structure, improves data processing efficiency, and achieves the improvement and consistency of rendering quality.
[0053] The above describes the automatic rendering method of the building block model in the embodiment of the present invention. The following describes the automatic rendering device of the building block model in the embodiment of the present invention. Figure 2 , an embodiment of the automatic rendering device of the building block model in the embodiment of the present invention includes: The file parsing module 201 is used to obtain 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; A scene calculation module 202, used to respectively set the camera parameters and the 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 203 is used to optimize the building block model according to the standardized data structure and scene rendering parameters to obtain optimized model data; The model rendering module 204 is used to apply the scene rendering parameters to the optimized model data and the standardized data structure to perform model rendering to obtain a model rendering result.
[0054] In an embodiment of the present invention, the automatic rendering device of the building block model runs the automatic rendering method of the building block model, and 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, and obtains the standardized data structure of the building block model file; based on the standardized data structure, respectively sets the camera parameters and lighting environment parameters of the scene where the building block model is located to obtain the scene rendering parameters; according to the standardized data structure and the scene rendering parameters, the building block model is optimized to obtain the optimized model data; the scene rendering parameters are applied to the optimized model data and the standardized data structure to perform model rendering to obtain the model rendering result. This method realizes the automation of the rendering process by automatically parsing and setting parameters of the building block model file, reduces manual intervention, and realizes the unified management of model information through the application of the standardized data structure, improves the data processing efficiency, and achieves the improvement and consistency of rendering quality.
[0055] 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. 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.
[0056] Figure 3 3 is a schematic diagram of the structure of an automatic rendering device for a building block model provided by an embodiment of the present invention. The automatic rendering device 300 for the building block model may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 310 (for example, one or more processors) and a memory 320, and one or more storage media 330 (for example, one or more mass storage device terminals) storing application programs 333 or data 332. Among them, the memory 320 and the storage medium 330 may be short-term storage or permanent storage. The program stored in the storage medium 330 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the automatic rendering device 300 for the building block model. Furthermore, the processor 310 may be configured to communicate with the storage medium 330, and execute a series of instruction operations in the storage medium 330 on the automatic rendering device 300 for the building block model to implement the steps of the automatic rendering method of the building block model.
[0057] The automatic rendering device 300 of the building block model may also include one or more power supplies 340, one or more wired or wireless network interfaces 350, one or more input and output interfaces 360, and / or one or more operating systems 331, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, etc. It will be appreciated by those skilled in the art that Figure 3 The structure of the automatic rendering device for the building block model shown does not constitute a limitation on the automatic rendering device for the building block model provided by the present invention, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.
[0058] 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 are executed on a computer, the computer executes the steps of the automatic rendering method of the building block model.
[0059] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system, device, or unit can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.
[0060] If 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 this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the whole 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, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0061] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the 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; The scene rendering parameters are applied to the optimized model data and the standardized data structure to perform model rendering 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: According to the geometric information of the building block elements in the standardized data structure, the chamfer radius of the building block edge in the building block model is calculated 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. The automatic rendering method of a building block model according to claim 1, characterized in that: The applying the scene rendering parameters to the optimized model data and the standardized data structure to perform model rendering to obtain a model rendering result comprises: According to the camera parameters and the lighting environment parameters in the scene rendering parameters, a rendering scene space is constructed to obtain a scene data structure; Importing the optimized model data into the scene data structure, and setting the material properties of each building block element 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 rendered image; The optimized rendered image is post-processed using a machine learning denoising model to obtain a model rendering result.
7. The automatic rendering method of a building block model according to claim 6, characterized in that: The step of performing model rendering of the building block model according to the rendering preparation data and the standardized data structure, and accelerating the rendering by path caching and importance sampling optimization during the rendering process to obtain an optimized rendered image comprises: Performing spatial division on the rendering preparation data, constructing an acceleration structure, obtaining a scene space index, and generating an initial light path according to the scene space index and a building block splicing relationship in a standardized data structure, to obtain a sampling path set; Applying the rendering equation to the sampling path set, performing Monte Carlo integration calculation, and obtaining the estimated radiance value of each point in the scene; The radiance estimation value is stored in a path cache, and an importance sampling distribution is constructed based on the cache data to obtain an optimized sampling strategy; The optimized sampling strategy is used to perform additional light sampling, and the rendering equation is solved again in combination with the data in the path cache to obtain an optimized rendered image.
8. 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; The model rendering module is used to apply the scene rendering parameters to the optimized model data and the standardized data structure to perform model rendering to obtain a model rendering result.
9. 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-7.
10. 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-7 are implemented.
Citation Information
Patent Citations
Fast rendering method for virtual scene and model
CN107103638A
Method and device for generating anthropomorphic 3D model
CN113436301A
Three-dimensional model rendering method and system for digital twin simulation scene
CN113963100A
Station yard inspection method based on unmanned aerial vehicle matrix shooting
CN116858192A
Scene rendering method and device and electronic equipment
CN118096989A
Cited By
Film and television animation material optimization method and system applied to real-time rendering
CN120612400A
Automatic rendering method and system of building block model, medium and product
CN120672924A