WO2022095714A1 - 图像渲染的处理方法和装置、存储介质及电子设备 - Google Patents

图像渲染的处理方法和装置、存储介质及电子设备 Download PDF

Info

Publication number
WO2022095714A1
WO2022095714A1 PCT/CN2021/125371 CN2021125371W WO2022095714A1 WO 2022095714 A1 WO2022095714 A1 WO 2022095714A1 CN 2021125371 W CN2021125371 W CN 2021125371W WO 2022095714 A1 WO2022095714 A1 WO 2022095714A1
Authority
WO
WIPO (PCT)
Prior art keywords
dimensional
rendering
sub
objects
image
Prior art date
Application number
PCT/CN2021/125371
Other languages
English (en)
French (fr)
Inventor
黎宇航
秦义明
朱方
施嘉理
盛斌
陆平
王依可
Original Assignee
中兴通讯股份有限公司
上海交通大学
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司, 上海交通大学 filed Critical 中兴通讯股份有限公司
Publication of WO2022095714A1 publication Critical patent/WO2022095714A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/005Tree description, e.g. octree, quadtree
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/10Constructive solid geometry [CSG] using solid primitives, e.g. cylinders, cubes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/20Finite element generation, e.g. wire-frame surface description, tesselation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • G06T3/4038Scaling the whole image or part thereof for image mosaicing, i.e. plane images composed of plane sub-images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20112Image segmentation details
    • G06T2207/20132Image cropping

Definitions

  • the present disclosure relates to the technical field of image processing, and in particular, to an image rendering processing method and apparatus, a storage medium, and an electronic device.
  • the related art usually adopts a static manner to divide the image line rendering resources.
  • the image line rendering resource division in a static way is to allocate the image model to be processed into multiple task nodes with the same processing resources, and then render the multiple task nodes.
  • the tasks responsible for each rendering node are The throughput is fixed.
  • this method is convenient and simple, it cannot interact with dynamic images.
  • there will be problems such as uneven resource allocation and long waiting time for task scheduling and low image rendering processing efficiency.
  • Embodiments of the present disclosure provide an image rendering processing method and apparatus, a storage medium, and an electronic device, so as to at least solve the problem of low graphics rendering efficiency in the related art.
  • an image rendering processing method which includes: receiving a three-dimensional graphic object, cutting the three-dimensional graphic object to a view cone to obtain a three-dimensional graphic cone; Tree segmentation to generate three-dimensional graphics sub-objects; calculating the rendering complexity of the three-dimensional graphics sub-objects; under the condition that the rendering complexity of the three-dimensional graphics sub-objects does not meet the rendering conditions, perform several quad-trees on the three-dimensional graphics sub-objects segmentation to obtain multiple target three-dimensional graphics sub-objects that meet the above rendering conditions; rendering the multiple above-mentioned target three-dimensional graphics sub-objects on the plane to be rendered respectively to obtain the rendered target three-dimensional graphics sub-objects; The three-dimensional graphic sub-objects are spliced to obtain a two-dimensional rendering image corresponding to the three-dimensional graphic object.
  • an image rendering processing device including: a first cropping module, configured to receive a three-dimensional graphic object, and to perform a view frustum cropping on the three-dimensional graphic object to obtain a three-dimensional graphic cone; a segmentation module, configured to perform quad-tree segmentation on the three-dimensional graphics cone to generate a three-dimensional graphics sub-object; a first calculation module, configured to calculate the rendering complexity of the three-dimensional graphics sub-object; a first processing module, configured to Under the circumstance that the rendering complexity of the above-mentioned three-dimensional graphics sub-object does not meet the rendering conditions, perform quadtree segmentation on the above-mentioned three-dimensional graphics sub-object several times to obtain a plurality of target three-dimensional graphics sub-objects that meet the above-mentioned rendering conditions; the first rendering module is set to render a plurality of the above-mentioned target three-dimensional graphics sub-objects respectively on the plane to be rendered, so as to obtain the rendered target three
  • a computer-readable storage medium is also provided, where a computer program is stored in the computer-readable storage medium, wherein the computer program is configured to execute any one of the above method embodiments when running steps in .
  • an electronic device comprising a memory and a processor, wherein the memory stores a computer program, the processor is configured to run the computer program to execute any of the above Steps in Method Examples.
  • FIG. 1 is a hardware structural block diagram of a mobile terminal according to an image rendering processing method according to an embodiment of the present disclosure
  • FIG. 2 is a schematic diagram of an image rendering processing system architecture according to an embodiment of the present disclosure
  • FIG. 3 is a flowchart of a processing method for image rendering according to an embodiment of the present disclosure
  • FIG. 4 is a schematic diagram of a grid model segmentation effect of an image rendering processing method according to an embodiment of the present disclosure
  • FIG. 5 is a schematic diagram of a point cloud model segmentation effect of an image rendering processing method according to an embodiment of the present disclosure
  • FIG. 6 is a schematic diagram of a grid model segmentation effect of another image rendering processing method according to an embodiment of the present disclosure
  • FIG. 7 is a schematic structural diagram of an image rendering processing apparatus according to an embodiment of the present disclosure.
  • FIG. 1 is a hardware structural block diagram of a mobile terminal of an image rendering processing method according to an embodiment of the present disclosure.
  • the mobile terminal may include one or more (only one is shown in FIG. 1 ) processor 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 configured to store data, wherein the above-mentioned mobile terminal may further include a transmission device 106 and an input/output device 108 configured as a communication function.
  • FIG. 1 is only a schematic diagram, which does not limit the structure of the above-mentioned mobile terminal.
  • the mobile terminal may also include more or fewer components than those shown in FIG. 1 , or have a different configuration than that shown in FIG. 1 .
  • the memory 104 may be configured to store computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the image rendering processing methods in the embodiments of the present disclosure, and the processor 102 runs the computer programs stored in the memory 104, Thereby, various functional applications and data processing are performed, that is, the above-mentioned method is realized.
  • Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
  • the memory 104 may further include memory located remotely from the processor 102, and these remote memories may be connected to the mobile terminal through a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
  • Transmission means 106 are arranged to receive or transmit data via a network.
  • the specific example of the above-mentioned network may include a wireless network provided by a communication provider of the mobile terminal.
  • the transmission device 106 includes a network adapter (Network Interface Controller, NIC for short), which can be connected to other network devices through a base station so as to communicate with the Internet.
  • the transmission device 106 may be a radio frequency (Radio Frequency, RF for short) module, which is configured to communicate with the Internet in a wireless manner.
  • RF Radio Frequency
  • the system architecture includes: a model loading module 201 , a distributed rendering module 202 , and a control browsing module 203 , wherein,
  • the model loading module 201 mainly realizes the loading and saving of the three-dimensional image model, and the characteristic information required by the statistical system;
  • the distributed rendering module 202 mainly realizes the distributed rendering of the simulated three-dimensional image, and records the rendered results in the rendering target.
  • control browsing module 203 In the texture, it is passed to the control browsing module 203; the control browsing module 203 is mainly set to realize the operation of the control system, perform the frustum segmentation of the 3D image model and the assignment of tasks, summarize and display the results of the frustum segmentation, and display the system status information, dealing with interactive information of complex 3D image models.
  • the model loading module 201 sends the point cloud model and mesh model data to the control browsing module 203, and the control browsing module 203 divides the point cloud model and the mesh model into the view cone and stores it in the divided sub-view cone list , and then the control browsing module 203 sends the sub-view frustum list to the distributed rendering module 203 for image rendering, and the distributed rendering module 203 sends the rendered rendering result list including child nodes to the control browsing module 203 for aggregation and display.
  • FIG. 3 is a flowchart of the image rendering processing method according to the embodiment of the present disclosure, as shown in FIG. 3 .
  • the process includes the following steps:
  • Step S302 receiving a three-dimensional graphic object, and clipping the three-dimensional graphic object to a view cone to obtain a three-dimensional graphic cone;
  • Step S304 performing quadtree segmentation on the three-dimensional graphics cone to generate a three-dimensional graphics sub-object
  • Step S306 calculating the rendering complexity of the three-dimensional graphics sub-object
  • Step S308 in the case that the rendering complexity of the three-dimensional graphics sub-object does not reach the rendering condition, perform quadtree segmentation on the three-dimensional graphics sub-object several times to obtain multiple target three-dimensional graphics sub-objects that meet the rendering conditions;
  • Step S310 respectively rendering a plurality of target three-dimensional graphics sub-objects on the plane to be rendered, to obtain a rendered target three-dimensional graphics sub-object;
  • Step S312 splicing the rendered target three-dimensional graphic sub-objects to obtain a two-dimensional rendering image corresponding to the three-dimensional graphic object.
  • the three-dimensional graphic objects may include but are not limited to grid model objects or point cloud model objects, which are not limited here; , that is to say, through the frustum cropping, the pyramid model with solid elements in the 3D graphics object is obtained, and the sub-objects without solid elements are removed, that is, the part without solid elements in the 3D image is removed; thus, the image rendering can be reduced. amount of calculation.
  • the sub-objects 406 of insubstantial elements are eliminated to obtain the three-dimensional graphic cone 402 .
  • step S304 in practical application, the 3D graphics cone is divided into quadtrees to generate 3D graphics sub-objects, that is to say, the 3D image pyramid obtained after the viewing cone is cut into quarters is divided into four equal parts to obtain the same processing resources.
  • Four 3D graphics sub-objects As shown in FIG. 4 , the 3D graphics cone 402 is divided into a quad-tree, and then a 3D graphics sub-object 408 is obtained (there is a shaded area in the figure).
  • the rendering complexity of the three-dimensional graphics sub-object is calculated.
  • the three-dimensional graphics object is a grid model
  • the number of triangular meshes in the three-dimensional graphics sub-object is calculated to obtain the mesh model.
  • the 3D object is a point cloud model
  • the number of point clouds in the 3D graphics sub-object is used to obtain the rendering complexity under the point cloud model.
  • the three-dimensional graphics object 400 shown in FIG. 4 is a mesh model, and the image rendering complexity under the mesh model is obtained by calculating the number of triangular meshes 404 of the three-dimensional graphics sub-object 408 in the mesh model.
  • the three-dimensional graphic object 500 shown in FIG. 5 is a point cloud model
  • the image rendering complexity under the point cloud model is obtained by calculating the number of point clouds 504 of the three-dimensional graphic cone 502 in the point cloud model.
  • a dynamic method is used to divide the rendering resources of image lines.
  • the processed image model is dynamically segmented.
  • a binary prediction tree is drawn for the segmented image model.
  • the rendering child nodes in the drawing process are combined with the leaf nodes in the binary tree, and the amount of rendering tasks assigned to each rendering processor in the previous frame is quantified and recorded in the form of time. down, and then distribute the load of each rendering processor reasonably and evenly according to the time value.
  • the theoretical basis is that two pictures in adjacent time series are often represented by frames in 3D rendering, that is, two frame pictures.
  • Drawing consumes roughly the same resources.
  • the implementation of the task assignment is as follows: first, the time for drawing the previous frame is calculated, and the binary prediction tree is refreshed. The purpose of the refresh is to make relatively small task blocks merge and divide complex task blocks. Allocate to more render nodes.
  • the service for interactive rendering changes is too large (that is, the difference between the two frames of images before and after the rendering object is large)
  • it will cause large fluctuations in rendering performance, which will make the construction of binary prediction tree work. becomes difficult and partially fails.
  • the final image synthesis lacks consistent features, reducing image rendering efficiency.
  • the present disclosure adopts the method steps shown in FIG. 3 to solve the above technical problem.
  • the present disclosure not only solves the problems of uneven distribution of image rendering resources and long scheduling time caused by static methods, but also solves the large fluctuations in rendering performance caused by the above-mentioned dynamic binary tree model method, and the final rendering picture. Synthesizing the lack of consistent features is a technical problem.
  • the 3D graphics cone is divided into a quadtree to generate a 3D graphics sub-object, and then the rendering complexity of the 3D graphics sub-object is calculated;
  • the problem of low graphics rendering efficiency in the image rendering process can be solved, thereby achieving the effect of improving graphics rendering efficiency and rationally allocating image rendering processing resources.
  • steps S306-S308 include: determining the number of primitives in the three-dimensional graphics sub-object; wherein, the primitives are basic image elements of images included in the three-dimensional graphics sub-object; if the number of primitives If the value is greater than or equal to the preset primitive value, it is determined that the rendering complexity of the current 3D graphics sub-object does not meet the rendering condition; the 3D graphics sub-object is divided into quadtrees several times to obtain the number of primitives less than or equal to the preset primitive. Value of multiple target 3D graphics sub-objects. Setting the preset primitive value is determined according to the computing capability of the child nodes processed by each rendering task.
  • the maximum number of primitives that each child node can process is 3, and the preset primitive value can be set to 3.
  • the value of the primitive in the 3D graphics sub-object is, for example, 5, it is determined that the rendering complexity of the current 3D graphics sub-object does not meet the rendering condition. At this time, it is necessary to continue to perform quadtree segmentation on the current 3D graphics sub-object. , to obtain multiple target 3D graphics sub-objects with the number of primitives less than or equal to 3.
  • the number of primitives contained in the 3D graphics sub-object 602 is 5.
  • the preset primitive value is 3
  • the current 3D graphics sub-object 602 is continuously subjected to quadtree segmentation to obtain the rendering condition.
  • the target graphics sub-object 604, the target graphics sub-object 606, the number of primitives in the target graphics sub-object 604 is 3, and the number of primitives in the target graphics sub-object 606 is 2.
  • steps S306-S308 include: when the three-dimensional graphics object is a mesh model, determining the number of triangular meshes in the three-dimensional graphics sub-object; wherein the triangular meshes are included in the three-dimensional graphics sub-object.
  • the basic image element of the image if the number of triangular meshes is greater than the preset triangular mesh value, it is determined that the rendering complexity of the current 3D graphics sub-object does not meet the rendering conditions; Acquires multiple target 3D graphics sub-objects whose number of triangular meshes is less than or equal to the preset triangular mesh value. As shown in FIG.
  • steps S306-S308 include: when the three-dimensional graphic object is a point cloud model, determining the number of point clouds in the three-dimensional graphic sub-object; Basic image element; if the number of point clouds is greater than or equal to the preset point cloud value, it is determined that the rendering complexity of the current 3D graphics sub-object does not meet the rendering conditions; the 3D graphics sub-object is divided into quadtrees several times to obtain the point cloud Multiple target 3D graphics sub-objects whose number is less than or equal to the preset point cloud value. As shown in FIG.
  • the 3D graphics object 500 is a mesh model
  • the number of triangular meshes contained in the 3D graphics sub-object 508 (the shaded area in the figure) is greater than the preset triangular mesh value
  • the current The rendering complexity of the 3D graphics sub-object 508 has not reached the rendering condition; the 3D graphics sub-object is divided into quadtrees several times to obtain multiple target 3D graphics sub-objects whose triangular mesh quantity is less than or equal to the preset triangular mesh value .
  • step S310 includes: projecting a plurality of target 3D graphics sub-objects onto a plane to be rendered to obtain a 3D image projection sub-object; wherein the 3D image projection sub-object is the rendered target 3D graphics sub-object.
  • step S312 includes: determining the two-dimensional coordinates of the three-dimensional image projection sub-object in the plane to be rendered; splicing the three-dimensional image projection sub-object in the plane to be rendered according to the two-dimensional coordinates to obtain a two-dimensional rendering. ; Output the 2D rendering to the interface to be displayed.
  • the projection sub-object 604 in Figure (a1) and the projection sub-object 606 in Figure (a2) can be obtained by splicing the two to obtain the target rendering object 602 in Figure (a);
  • the display interface may be a display of a terminal such as a mobile phone, a tablet computer, a notebook computer, a PC, etc., which is not limited here.
  • the image rendering processing method further includes: generating a two-dimensional initial picture with the same size as the interface to be displayed according to the resolution of the interface to be displayed; optionally, the color value of the two-dimensional initial picture may be 0, that is to say, the color of the two-dimensional initial image is black, which is not limited here; the two-dimensional rendering image is projected into the two-dimensional initial image according to the preset ratio, and the two-dimensional target image is obtained; the two-dimensional target image is output to the waiting UI.
  • the resolution of the interface to be displayed is 640*480
  • a two-dimensional initial picture with the same resolution and size as the interface to be displayed is stored first, as shown in Figure (a) in Figure 6 , the color value of the two-dimensional initial picture is zero (that is, the picture is a pure black picture), and then the two-dimensional rendering image 600 is projected into the two-dimensional initial picture according to the preset ratio (resolution is 640*480) to obtain a two-dimensional Target picture, output the target two-dimensional picture to the computer screen.
  • the execution subject of the above steps may be a terminal device or the like, and the terminal device may be a terminal such as a mobile phone, a tablet computer, a notebook computer, a PC, etc., but is not limited thereto.
  • the above-mentioned image rendering processing method further includes:
  • OGRE Object-Oriented Graphics Rendering Engine
  • Control the browsing module 203 to perform a view frustum segmentation method based on rendering complexity and quadtree model, and perform task assignment. During each rendering, the control browsing module 203 listens to the user's input to the corresponding parameters of the model. After the control browsing module 203 determines the primitive elements in the three-dimensional image that need to be rendered, the viewing cone is segmented based on the rendering complexity (that is, the number of primitives in the three-dimensional image) according to the data in the current viewing cone, and the segmentation process uses The quadtree model is used for the point cloud model or mesh model input by the user. Try to ensure that the amount of rendering data in each sub-view frustum is not greater than the threshold K processed by the graphics processing node.
  • the browsing module 203 is controlled to allocate the sub-view cones to each sub-rendering module, that is, send them to the distributed rendering module 202 .
  • the distributed rendering module 202 After the distributed rendering module 202 completes the rendering of each node, it transmits the rendering result to the total node in the control browsing module 203, ensures the consistency of the rendering result according to the image stitching algorithm, and transmits the final result to the display interface of the client. middle.
  • the above-mentioned image rendering processing method further includes:
  • a quadtree model is established to segment the frustum of the 3D image. After determining the image resources that need to be rendered, firstly take the center of the content to be rendered as the root node to divide the view cone of the 3D image into four pieces, and then detect the number of primitives that need to be rendered in each divided sub-view cone , for the point cloud data model, the number of point clouds in the sub-view frustum area needs to be counted, and for the mesh model, the number of triangular meshes in the sub-view frustum area needs to be counted.
  • each sub-view frustum needs to be saved as the up, down, left and right coordinates of the sub-view frustum and the projection object in the two-dimensional plane to be rendered.
  • Input the task parameters and 3D image data to be processed, including the view frustum F that needs to be segmented; the model M that has been determined in the view frustum; and the rendering amount K that each child node can carry.
  • the fragments (triangular meshes or polygonal meshes) contained in the model M, or the number of point clouds are obtained.
  • steps 3 and 4 are not satisfied, it indicates that the number of fragments or point clouds that need to be rendered currently cannot be afforded by a single node, then the segmentation operation needs to be continued. Divide the current sub-view frustum into four equal parts by continuing to use the quad-tree division method.
  • the image rendering processing system will assign the view cone list to each image rendering child node for rendering tasks. Therefore, each rendering child node can use the maximum rendering efficiency for image rendering.
  • the image stitching algorithm is as follows: firstly, an all-black image is initialized to generate an initialization image, and the size is set to be the same as the pixels contained in the main window of the interface to be displayed.
  • the control browsing module will perform projection transformation on the rendering target texture according to its position, and adjust it to its corresponding size. After that, the control browsing module will place the partial result into the initialization picture according to the coordinates corresponding to the sub-view frustum.
  • the final composite image result will be passed to the control browsing module, and further displayed to the display interface of the client.
  • the three-dimensional graphics cone is divided into a quadtree to generate a three-dimensional graphics sub-object, and then the rendering complexity of the three-dimensional graphics sub-object is calculated; Segmentation is performed to obtain multiple target 3D graphics sub-objects that meet the rendering conditions; therefore, the problem of low graphics rendering efficiency in the image rendering process can be solved, thereby achieving the effect of improving graphics rendering efficiency and rationally allocating image rendering processing resources. .
  • a graphics rendering processing apparatus is also provided, and the apparatus is used to implement the above-mentioned embodiments and preferred implementation manners, which have been described and will not be repeated.
  • the term "module” may be a combination of software and/or hardware that implements a predetermined function.
  • the apparatus described in the following embodiments is preferably implemented in software, implementations in hardware, or a combination of software and hardware, are also possible and contemplated.
  • FIG. 7 is a structural block diagram of an image rendering processing apparatus according to an embodiment of the present disclosure. As shown in FIG. 7 , the apparatus includes:
  • the first cropping module 702 is configured to receive a three-dimensional graphic object, and perform a view cone cropping of the three-dimensional graphic object to obtain a three-dimensional graphic cone;
  • the first segmentation module 704 is configured to perform quadtree segmentation on the three-dimensional graphics cone to generate a three-dimensional graphics sub-object;
  • the first calculation module 706 is configured to calculate the rendering complexity of the three-dimensional graphics sub-object
  • the first processing module 708 is configured to perform quadtree segmentation on the three-dimensional graphics sub-object several times when the rendering complexity of the three-dimensional graphics sub-object does not meet the rendering conditions, so as to obtain multiple target three-dimensional graphics sub-objects that meet the rendering conditions. object;
  • the first rendering module 710 is configured to render a plurality of target 3D graphics sub-objects on the plane to be rendered, respectively, to obtain the rendered target 3D graphics sub-object;
  • the first splicing module 712 is configured to splicing the rendered target three-dimensional graphic sub-objects to obtain a two-dimensional rendering image corresponding to the three-dimensional graphic object.
  • the three-dimensional graphic objects may include but are not limited to grid model objects or point cloud model objects, which are not limited here; That is to say, through the frustum cropping, a pyramid model with solid elements in the 3D graphics object is obtained, and the sub-objects without solid elements are removed, that is, the part without solid elements in the 3D image is removed; thus, the calculation amount in the image rendering can be reduced. .
  • the sub-objects 406 of insubstantial elements are eliminated to obtain the three-dimensional graphic cone 402 .
  • the 3D graphics pyramid is divided into quadtrees to generate 3D graphics sub-objects, that is to say, the 3D image pyramid obtained after the viewing cone is cut into four equal parts, and four objects with the same processing resources are obtained.
  • 3D graphics sub-object As shown in FIG. 4 , the 3D graphics cone 402 is divided into a quad-tree, and then a 3D graphics sub-object 408 is obtained (there is a shaded area in the figure).
  • the rendering complexity of the 3D graphics sub-object is calculated.
  • the rendering under the mesh model is obtained by calculating the number of triangular meshes in the 3D graphics sub-object.
  • Complexity When the 3D object is a point cloud model, the number of point clouds in the 3D graphics sub-object is used to obtain the rendering complexity under the point cloud model.
  • the three-dimensional graphics object 400 shown in FIG. 4 is a mesh model, and the image rendering complexity under the mesh model is obtained by calculating the number of triangular meshes 404 of the three-dimensional graphics sub-object 408 in the mesh model.
  • the three-dimensional graphic object 500 shown in FIG. 5 is a point cloud model, and the image rendering complexity under the point cloud model is obtained by calculating the number of point clouds 504 of the three-dimensional graphic cone 502 in the point cloud model.
  • the 3D graphics pyramid is divided into quadtrees to generate 3D graphics sub-objects, and then the rendering complexity of the 3D graphics sub-objects is calculated; Therefore, the problem of low graphics rendering efficiency in the image rendering process can be solved, thereby improving the graphics rendering efficiency and rationally allocating image rendering processing resources. Effect.
  • the above modules can be implemented by software or hardware, and the latter can be implemented in the following ways, but not limited to this: the above modules are all located in the same processor; or, the above modules can be combined in any combination The forms are located in different processors.
  • Embodiments of the present disclosure also provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, wherein the computer program is configured to execute the steps in any one of the above method embodiments when running.
  • the above-mentioned computer-readable storage medium may include, but is not limited to, a USB flash drive, a read-only memory (Read-Only Memory, referred to as ROM for short), and a random access memory (Random Access Memory, referred to as RAM for short) , mobile hard disk, magnetic disk or CD-ROM and other media that can store computer programs.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • An embodiment of the present disclosure also provides an electronic device, including a memory and a processor, where a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
  • the above-mentioned electronic device may further include a transmission device and an input-output device, wherein the transmission device is connected to the above-mentioned processor, and the input-output device is connected to the above-mentioned processor.
  • modules or steps of the present disclosure can be implemented by a general-purpose computing device, and they can be centralized on a single computing device or distributed in a network composed of multiple computing devices
  • they can be implemented in program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, can be performed in a different order than shown here.
  • the described steps, or they are respectively made into individual integrated circuit modules, or a plurality of modules or steps in them are made into a single integrated circuit module to realize.
  • the present disclosure is not limited to any particular combination of hardware and software.

Abstract

本公开实施例提供了一种图像渲染的处理方法和装置、存储介质及电子设备,接收三维图形对象,将三维图形对象进行视锥体裁剪得到三维图形锥体;上述方法包括:将三维图形锥体进行四叉树分割,生成三维图形子对象;计算三维图形子对象的渲染复杂度;在三维图形子对象的渲染复杂度未达到渲染条件的情况下,对三维图形子对象进行若干次四叉树分割,以获取达到渲染条件的多个目标三维图形子对象;对多个目标三维图形子对象在待渲染平面分别进行渲染,得到渲染后的目标三维图形子对象;将渲染后的目标三维图形子对象进行拼接,得到三维图形对象对应的二维渲染图。

Description

图像渲染的处理方法和装置、存储介质及电子设备
相关申请的交叉引用
本公开基于2020年11月09日提交的发明名称为“图像渲染的处理方法和装置、存储介质及电子设备”的中国专利申请CN202011241830.5,并且要求该专利申请的优先权,通过引用将其所公开的内容全部并入本公开。
技术领域
本公开涉及图像处理技术领域,具体而言,涉及一种图像渲染的处理方法和装置、存储介质及电子设备。
背景技术
对于图像渲染资源处理和任务的划分,相关技术中通常采用静态的方式对图像行渲染资源划分。采用静态方式对图像行渲染资源划分是将待处理的图像模型分配成多个相同处理资源的任务节点,然后对该多个任务节点进行渲染,在此处理过程中,每个渲染节点负责的任务处理量都是固定的。这种做法虽然方便简单,但是无法进行动态图像的交互,同时也会存在资源分配不均匀,任务调度等待时间过长等图像渲染处理效率较低问题。
针对上述图像渲染过程中存在的渲染图像合成效率低下的问题,目前尚未提出有效的解决方案。
发明内容
本公开实施例提供了一种图像渲染的处理方法和装置、存储介质及电子设备,以至少解决相关技术中图形渲染效率低下的问题。
根据本公开的一个实施例,提供了一种图像渲染的处理方法,包括:接收三维图形对象,将上述三维图形对象进行视锥体裁剪得到三维图形锥体;将上述三维图形锥体进行四叉树分割,生成三维图形子对象;计算上述三维图形子对象的渲染复杂度;在上述三维图形子对象的渲染复杂度未达到渲染条件的情况下,对上述三维图形子对象进行若干次四叉树分割,以获取达到上述渲染条件的多个目标三维图形子对象;对多个上述目标三维图形子对象在待渲染平面分别进行渲染,得到渲染后的目标三维图形子对象;将上述渲染后的目标三维图形子对象进行拼接,得到上述三维图形对象对应的二维渲染图。
根据本公开的另一个实施例,提供了一种图像渲染的处理装置,包括:第一裁剪模块,设置为接收三维图形对象,将上述三维图形对象进行视锥体裁剪得到三维图形锥体;第一分割模块,设置为将上述三维图形锥体进行四叉树分割,生成三维图形子对象;第一计算模块,设置为计算上述三维图形子对象的渲染复杂度;第一处理模块,设置为在上述三维图形子对象的渲染复杂度未达到渲染条件的情况下,对上述三维图形子对象进行若干次四叉树分割,以获取达到上述渲染条件的多个目标三维图形子对象;第一渲染模块,设置为对多个上述目标三维图形子对象在待渲染平面分别进行渲染,得到渲染后的目标三维图形子对象;第一拼接模块,设置为将上述渲染后的目标三维图形子对象进行拼接,得到上述三维图形对象对应 的二维渲染图。
根据本公开的又一个实施例,还提供了一种计算机可读存储介质,上述计算机可读存储介质中存储有计算机程序,其中,上述计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。
根据本公开的又一个实施例,还提供了一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行上述任一项方法实施例中的步骤。
附图说明
图1是根据本公开实施例的图像渲染的处理方法的移动终端的硬件结构框图;
图2是根据本公开实施例的图像渲染的处理系统架构示意图;
图3是根据本公开实施例的图像渲染的处理方法的流程图;
图4是根据本公开实施例的一种图像渲染的处理方法的网格模型分割效果示意图;
图5是根据本公开实施例的一种图像渲染的处理方法的点云模型分割效果示意图;
图6是根据本公开实施例的另一种图像渲染的处理方法的网格模型分割效果示意图;
图7是根据本公开实施例的图像渲染的处理装置的结构示意图。
具体实施方式
下文中将参考附图并结合实施例来详细说明本公开的实施例。
需要说明的是,本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。
本申请实施例中所提供的方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。以运行在移动终端上为例,图1是本公开实施例的一种图像渲染的处理方法的移动终端的硬件结构框图。如图1所示,移动终端可以包括一个或多个(图1中仅示出一个)处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)和设置为存储数据的存储器104,其中,上述移动终端还可以包括设置为通信功能的传输设备106以及输入输出设备108。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述移动终端的结构造成限定。例如,移动终端还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。
存储器104可设置为存储计算机程序,例如,应用软件的软件程序以及模块,如本公开实施例中的图像渲染的处理方法对应的计算机程序,处理器102通过运行存储在存储器104内的计算机程序,从而执行各种功能应用以及数据处理,即实现上述的方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至移动终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
传输装置106设置为经由一个网络接收或者发送数据。上述的网络具体实例可包括移动终端的通信供应商提供的无线网络。在一个实例中,传输装置106包括一个网络适配器(Network Interface Controller,简称为NIC),其可通过基站与其他网络设备相连从而可 与互联网进行通讯。在一个实例中,传输装置106可以为射频(Radio Frequency,简称为RF)模块,其设置为通过无线方式与互联网进行通讯。
本申请实施例可以运行于图2所示的图像渲染的处理系统架构上,如图2所示,该系统架构包括:模型载入模块201、分布式渲染模块202、控制浏览模块203,其中,模型载入模块201主要实现三维图像模型的载入和保存,以及统计系统所需的特征信息;分布式渲染模块202主要实现模拟三维图像的分布式渲染,以及将渲染后的结果记录在渲染目标纹理中,传递给控制浏览模块203;控制浏览模块203主要设置为实现控制系统的运行,进行三维图像模型的视锥分割和任务的分配,将视锥分割结果进行汇总和展示,以及展示系统状态信息,处理复杂三维图像模型的交互信息。模型载入模块201将点云模型和网格模型数据发送至控制浏览模块203,控制浏览模块203将点云模型和网格模型进行视锥分割后,存入到分割后的子视锥列表中,然后控制浏览模块203将该子视锥列表发送到分布式渲染模块203进行图像渲染,分布式渲染模块203将渲染后的包含子节点的渲染结果列表发送到控制浏览模块203进行汇总和展示。
在本实施例中提供了一种运行于图2所示的图像渲染系统架构上的图像渲染的处理方法,图3是根据本公开实施例的图像渲染的处理方法的流程图,如图3所示,该流程包括如下步骤:
步骤S302,接收三维图形对象,将三维图形对象进行视锥体裁剪得到三维图形锥体;
步骤S304,将三维图形锥体进行四叉树分割,生成三维图形子对象;
步骤S306,计算三维图形子对象的渲染复杂度;
步骤S308,在三维图形子对象的渲染复杂度未达到渲染条件的情况下,对三维图形子对象进行若干次四叉树分割,以获取达到渲染条件的多个目标三维图形子对象;
步骤S310,对多个目标三维图形子对象在待渲染平面分别进行渲染,得到渲染后的目标三维图形子对象;
步骤S312,将渲染后的目标三维图形子对象进行拼接,得到三维图形对象对应的二维渲染图。
在步骤S302中,实际应用时,三维图形对象可以包括但不限于网格模型对象或者是点云模型对象,在此不做限定;将所述三维图形对象进行视锥体裁剪得到三维图形锥体,也就是说,通过视锥体裁剪,得到三维图形对象中有实体元素的椎体模型,剔除无实体元素子对象,即剔除掉三维图像中没有实体元素的部分;从而能减少图像渲染中的计算量。如图4所示,三维图形对象400经过视锥体裁剪后,剔除无实体元素子对象406,得到三维图形锥体402。
在步骤S304中,实际应用时,三维图形锥体进行四叉树分割,生成三维图形子对象,也就是说将进行视锥裁剪后得到的三维图像椎体进行四等分,得到处理资源相同的四个三维图形子对象。如图4所示,将三维图形锥体402进行四叉树分割,后得到三维图形子对象408(图中有阴影部分区域)。
在步骤S306中,实际应用时,计算三维图形子对象的渲染复杂度,例如,当三维图形对象为网格模型时,通过计算三维图形子对象中的三角网格数量来得到该网格模型下的渲染复 杂度;当三维对象为点云模型时,三维图形子对象中的点云的数量来得到该点云模型下的渲染复杂度。如图4所示,图4显示的三维图形对象400为网格模型,通过计算该网格模型中三维图形子对象408的三角网格404的数量来得到该网格模型下的图像渲染复杂度。如图5所示,图5显示的三维图形对象500为点云模型,通过计算该点云模型中三维图形锥体502的点云504的数量来得到该点云模型下的图像渲染复杂度。
相关技术中为了解决采用静态方式带来的图像渲染的资源分配不均匀,以及图像渲染调度等待时间过长等问题,采用动态方式对图像行渲染资源划分,该动态方式主要利用二叉树的特性,对待处理的图像模型进行动态的分割。通过该方法对该分割后的图像模型绘制一棵二叉预测树。利用二叉预测树的叶子节点的特性,让绘制过程中的渲染子节点和二叉树中的叶节点相结合,将它前帧中每个渲染处理机被分配的渲染任务量以时间的形式量化记录下来,然后根据时间数值去合理均匀的分配每个渲染处理机的负载。其理论依据是,在相邻时序上的两个画面,在三维渲染中常用帧来代表,也即两个帧画面,它们的绘制时间序列上变化不是很大,所以在进行这两个帧的绘制所消耗的资源大致相同。该任务分配的实现方式如下:首先计算得到前一帧进行绘制的时间,对二叉预测树进行刷新,刷新的目的,是使得相对较小的任务块可以进行合并,复杂的任务块进行划分,分配给更多的渲染节点。但是该算法在复杂的渲染场景中,如果进行交互渲染变化的服务过大(即渲染对象前后两帧图像差别较大),会导致渲染性能造成较大的波动,使得构建二叉预测树的工作变得困难,并且会部分失效。最终的画面合成缺乏一致性特征,降低图像渲染效率。
为了解决上述采用动态方式对图像行渲染资源划分导致的图像渲染效率低下的问题,本公开采用了如图3中所示的方法步骤来解决上述技术问题。本公开不仅解决了采用静态方式带来的图像渲染资源分配不均匀,以及调度时间过长问题,而且解决了上述采用动态二叉树模型方式下出现的渲染性能造成较大的波动,以及最终的渲染画面合成缺乏一致性特征为技术问题。
通过上述步骤,由于采用了将三维图形锥体进行四叉树分割,生成三维图形子对象,然后计算三维图形子对象的渲染复杂度;通过将不符合渲染复杂度的三维子对象多次进行分割以获取达到渲染条件的多个目标三维图形子对象;因此,可以解决图像渲染过程中存在的图形渲染效率低下的问题,进而达到了提高图形渲染效率,以及合理分配图像渲染处理资源的效果。
在一实施例中,步骤S306-S308包括:确定所述三维图形子对象中的图元的数量;其中,所述图元为三维图形子对象中包含的图像的基本图像元素;若图元数量大于等于预设图元值,则确定当前的三维图形子对象的渲染复杂度未达到渲染条件;对三维图形子对象进行若干次四叉树分割,以获取图元数量小于或等于预设图元值的多个目标三维图形子对象。设置预设图元值是根据每个渲染任务处理的子节点计算能力而确定的,例如每个子节点能处理的图元个数最大为3个,就可以设置预设图元值为3。当三维图形子对象中的图元值例如为5时,就确定当前的三维图形子对象的渲染复杂度未达到渲染条件,此时就需要对当前的三维图形子对象中继续进行四叉树分割,以获取图元数量小于或等于3的多个目标三维图形子对象。如图6所示,三维图形子对象602中包含的图元数量为5,当预设的图元值为3时,对当前的三维图形子对象602继续进行四叉树分割,得到达到渲染条件的目标图形子对象604,目 标图形子对象606,目标图形子对象604中的图元数量为3,目标图形子对象606中的图元数量为2。
在一实施例中,步骤S306-S308包括:在三维图形对象为网格模型的情况下,确定三维图形子对象中的三角网格的数量;其中,三角网格为三维图形子对象中包含的图像的基本图像元素;若三角网格数量大于预设三角网格值,则确定当前的三维图形子对象的渲染复杂度未达到渲染条件;对三维图形子对象进行若干次四叉树分割,以获取三角网格数量小于或等于预设三角网格值的多个目标三维图形子对象。如图4所示,三维图形对象400为网格模型的情况下,当三维图形子对象408包含的三角网格数量大于预设三角网格值,则确定当前的三维图形子对象408的渲染复杂度未达到渲染条件;对三维图形子对象进行若干次四叉树分割,以获取三角网格数量小于或等于预设三角网格值的多个目标三维图形子对象。
在一实施例中,步骤S306-S308包括:在三维图形对象为点云模型的情况下,确定三维图形子对象中的点云的数量;其中,点云为三维图形子对象中包含的图像的基本图像元素;若点云数量大于等于预设点云值,则确定当前的三维图形子对象的渲染复杂度未达到渲染条件;对三维图形子对象进行若干次四叉树分割,以获取点云数量小于或等于预设点云值的多个目标三维图形子对象。如图5所示,三维图形对象500为网格模型的情况下,当三维图形子对象508(图中有阴影部分区域)包含的三角网格数量大于预设三角网格值,则确定当前的三维图形子对象508的渲染复杂度未达到渲染条件;对三维图形子对象进行若干次四叉树分割,以获取三角网格数量小于或等于预设三角网格值的多个目标三维图形子对象。
在一实施例中,步骤S310包括:将对多个目标三维图形子对象投影到待渲染平面,得到三维图像投影子对象;其中,三维图像投影子对象为渲染后的目标三维图形子对象。
在一实施例中,步骤S312包括:确定出三维图像投影子对象在待渲染平面中的二维坐标;根据二维坐标将三维图像投影子对象在待渲染平面中进行拼接,得到二维渲染图;输出二维渲染图至待显示界面。如图6中,图(a1)中的投影子对象604和图(a2)中的投影子对象606,将二者进行拼接后即可得到图(a)的目标渲染对象602中;其中,待显示界面可以为手机、平板电脑、笔记本电脑、PC机等终端的显示器,在此不做限定。
在一实施例中,该图像渲染的处理方法还包括:根据待显示界面的分辨率大小,生成与待显示界面尺寸相同的二维初始图片;可选地,二维初始图片的颜色值可以为零,也就是说二维初始图片的颜色为黑色,在此不做限定;将二维渲染图按预设比例投影到二维初始图片中,得到二维目标图片;输出二维目标图片至待显示界面。也就是说,例如待显示的界面(比如电脑屏幕)的分辨率为640*480,先生存与待显示界面分辨率和尺寸相同的二维初始图片,如图6中的图(a)所示,二维初始图片的颜色值为零(即该图片为纯黑色图片),然后将二维渲染图600按预设比例(分辨率为640*480)投影到二维初始图片中,得到二维目标图片,将目标二维图片输出到电脑屏幕中。
其中,上述步骤的执行主体可以为终端设备等,终端设备可以为手机、平板电脑、笔记本电脑、PC机等终端,但不限于此。
基于前述实施例,在一应用实施例中,结合图2所示,上述图像渲染的处理方法还包括:
在大规模场景渲染的应用场景下,使用基于图像渲染复杂度和四叉树模型来对三维图像 的视锥进行分割,能够实现图像渲染任务资源的均匀分配,本公开实例中可以使用目标对象渲染引擎(Object-Oriented Graphics Rendering Engine,简称为OGRE)OGRE自带的camera类、frustum类的接口进行了实现。实现过程如下步骤:
1.在总节点通过模型载入模块201,载入网格模型或点云模型,将其传递给控制浏览模块203。
2.控制浏览模块203进行基于渲染复杂度和四叉树模型的视锥分割方法,并进行任务的分配。在每一次渲染时,控制浏览模块203监听用户的输入对模型的相应参数。控制浏览模块203确定出需要渲染的三维图像中的图元元素后,根据当前视锥中的数据基于渲染复杂度(即三维图像中的图元的个数)对视锥进行分割,分割过程使用四叉树模型的方式对用户输入的点云模型或网格模型进行。尽量保证每个子视锥中渲染数据量不大于图形处理节点处理的阈值K。
3.三维图像进行视锥分割完成后,控制浏览模块203将子视锥分配给各个子渲染模块,即发送至分布式渲染模块202。
4.分布式渲染模块202在完成各节点渲染完成后,将渲染结果传递至控制浏览模块203中的总节点,根据图像拼接算法保证渲染结果的一致性,并将最终结果传递至客户端的显示界面中。
基于前述实施例,在一应用实施例中,上述图像渲染的处理方法还包括:
基于渲染复杂度建立一个四叉树模型对三维图像的视锥进行分割。在确定好需要渲染的图像资源之后,首先以需要图像渲染内容的中心为根节点把三维图像的视锥平均分成四块,然后检测每个被均分的子视锥中需要渲染的图元数目,对于点云数据模型而言,需要统计该子视锥区域中的点云数量,对于网格模型而言,需要统计该子视锥区域的三角网格数量。如果子视锥中没有图元元素,则跳过这个子视锥;如果判断出当前子视锥中包含的图元数目超过阈值K,则再次进行对当前子视锥进行四等分,直到每个子视锥中的图元数目小于或等于阈值K,就可以返回目标子视锥。这样就可以确保每个子任务渲染数据量最多不超过每个渲染子节点处理任务的上限值K。在具体的实现中,每个子视锥需要保存为该子视锥与待渲染的二维平面中的投影对象的上、下、左、右坐标。
在该实施例的具体实现中,采用以下算法:
输入要处理的任务参数及三维图像数据,包括需要进行分割的视锥F;已经确定好在视锥中的模型M;和每个子节点可以承载的渲染量K。
1.通过数据的预处理操作,得到模型M所包含的片元(三角网格片或多边形网格片),或者点云的数量。
2.之后首先创建一个全局的视锥列表,来存储将上述视锥F进行分割的子视锥。
3.如果子视锥需要渲染的片元数量或点云数量等于零了,那么就停止对当前子视锥进行分割操作。
4.如果需要渲染的片元数量或者点云数量小于设置的单个渲染节点可以承载的渲染量K值时,就将这部分的需要渲染的对象放入一个子视锥中。
5.如果步骤3和4都不满足,表明当前需要渲染的片元数量或者点云数量是单个节点无法承受的,那么就需要继续进行分割的操作。通过继续使用四叉树的分割方式,将当前的子视锥范围进行四等分。
6.最后对于分割后得到的子视锥行步骤3-5的递归操作,直到满足步骤3和4中的条件,得到最终的视锥列表。
7.图像渲染的处理系统会将该视锥列表分别分给每个图像渲染子节点,进行渲染任务。因此,可以使得每个渲染子节点都可以使用最大的渲染效率进行图像渲染。
8.完成了视锥分割的工作之后,将这些渲染任务分配给子节点进行渲染。得到各个视锥对应的图像之后,然后将这些图像在图像渲染总节点进行拼接整合得到二维渲染图像。
其中,图像拼接算法为:首先初始化生成一张全黑的图片初始化图片,大小设置为和待显示界面的主视窗所含像素相同。图像渲染的处理系统每当收到一个子渲染节点的结果时,控制浏览模块会将该渲染目标纹理根据其位置进行投影变换,调整到它对应的大小。之后,控制浏览模块会根据该子视锥对应的坐标将该部分结果放置到初始化图片中。当所有子任务的画面都处理完成后,最终合成的图像结果将被传递给控制浏览模块,进一步展示给客户端的显示界面。
本公开通过上述步骤,由于采用了将三维图形锥体进行四叉树分割,生成三维图形子对象,然后计算三维图形子对象的渲染复杂度;通过将不符合渲染复杂度的三维子对象多次进行分割以获取达到渲染条件的多个目标三维图形子对象;因此,可以解决图像渲染过程中存在的图形渲染效率低下的问题,进而达到了提高图形渲染效率,以及合理分配图像渲染处理资源的效果。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本公开各个实施例所述的方法。
在本实施例中还提供了一种图形渲染的处理装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图7是根据本公开实施例的图像渲染的处理装置的结构框图,如图7所示,该装置包括:
第一裁剪模块702,设置为接收三维图形对象,将三维图形对象进行视锥体裁剪得到三维图形锥体;
第一分割模块704,设置为将三维图形锥体进行四叉树分割,生成三维图形子对象;
第一计算模块706,设置为计算三维图形子对象的渲染复杂度;
第一处理模块708,设置为在三维图形子对象的渲染复杂度未达到渲染条件的情况下,对三维图形子对象进行若干次四叉树分割,以获取达到渲染条件的多个目标三维图形子对象;
第一渲染模块710,设置为对多个目标三维图形子对象在待渲染平面分别进行渲染,得到渲染后的目标三维图形子对象;
第一拼接模块712,设置为将渲染后的目标三维图形子对象进行拼接,得到三维图形对象对应的二维渲染图。
在本申请实施例中,三维图形对象可以包括但不限于网格模型对象或者是点云模型对象,在此不做限定;将所述三维图形对象进行视锥体裁剪得到三维图形锥体,也就是说,通过视锥体裁剪,得到三维图形对象中有实体元素的椎体模型,剔除无实体元素子对象,即剔除掉三维图像中没有实体元素的部分;从而能减少图像渲染中的计算量。如图4所示,三维图形对象400经过视锥体裁剪后,剔除无实体元素子对象406,得到三维图形锥体402。
在本申请实施例中,三维图形锥体进行四叉树分割,生成三维图形子对象,也就是说将进行视锥裁剪后得到的三维图像椎体进行四等分,得到处理资源相同的四个三维图形子对象。如图4所示,将三维图形锥体402进行四叉树分割,后得到三维图形子对象408(图中有阴影部分区域)。
在本申请实施例中,计算三维图形子对象的渲染复杂度,例如,当三维图形对象为网格模型时,通过计算三维图形子对象中的三角网格数量来得到该网格模型下的渲染复杂度;当三维对象为点云模型时,三维图形子对象中的点云的数量来得到该点云模型下的渲染复杂度。如图4所示,图4显示的三维图形对象400为网格模型,通过计算该网格模型中三维图形子对象408的三角网格404的数量来得到该网格模型下的图像渲染复杂度。如图5所示,图5显示的三维图形对象500为点云模型,通过计算该点云模型中三维图形锥体502的点云504的数量来得到该点云模型下的图像渲染复杂度。
在本公开实施例中,由于采用了将三维图形锥体进行四叉树分割,生成三维图形子对象,然后计算三维图形子对象的渲染复杂度;通过将不符合渲染复杂度的三维子对象多次进行分割以获取达到渲染条件的多个目标三维图形子对象;因此,可以解决图像渲染过程中存在的图形渲染效率低下的问题,进而达到了提高图形渲染效率,以及合理分配图像渲染处理资源的效果。
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。
本公开的实施例还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。
在一个示例性实施例中,上述计算机可读存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。
本公开的实施例还提供了一种电子装置,包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。
在一个示例性实施例中,上述电子装置还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。
本实施例中的具体示例可以参考上述实施例及示例性实施方式中所描述的示例,本实施 例在此不再赘述。
显然,本领域的技术人员应该明白,上述的本公开的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本公开不限制于任何特定的硬件和软件结合。
以上所述仅为本公开的优选实施例而已,并不用于限制本公开,对于本领域的技术人员来说,本公开可以有各种更改和变化。凡在本公开的原则之内,所作的任何修改、等同替换、改进等,均应包含在本公开的保护范围之内。

Claims (10)

  1. 一种图像渲染的处理方法,包括:
    接收三维图形对象,将所述三维图形对象进行视锥体裁剪得到三维图形锥体;
    将所述三维图形锥体进行四叉树分割,生成三维图形子对象;
    计算所述三维图形子对象的渲染复杂度;
    在所述三维图形子对象的渲染复杂度未达到渲染条件的情况下,对所述三维图形子对象进行若干次四叉树分割,以获取达到所述渲染条件的多个目标三维图形子对象;
    对多个所述目标三维图形子对象在待渲染平面分别进行渲染,得到渲染后的目标三维图形子对象;
    将所述渲染后的目标三维图形子对象进行拼接,得到所述三维图形对象对应的二维渲染图。
  2. 根据权利要求1所述的方法,其中,所述计算所述三维图形子对象的渲染复杂度;
    在所述三维图形子对象的渲染复杂度未达到渲染条件的情况下,对所述三维图形子对象进行若干次四叉树分割,以获取达到所述渲染条件的多个目标三维图形子对象;包括:
    确定所述三维图形子对象中的图元的数量;其中,所述图元为所述三维图形子对象中包含的图像的基本图像元素;
    若所述图元数量大于预设图元值,则确定当前的所述三维图形子对象的渲染复杂度未达到渲染条件;
    对所述三维图形子对象进行若干次四叉树分割,以获取所述图元数量小于或等于预设图元值的多个目标三维图形子对象。
  3. 根据权利要求2所述的方法,其中,所述方法包括:
    在所述三维图形对象为网格模型的情况下,确定所述三维图形子对象中的三角网格的数量;其中,所述三角网格为所述三维图形子对象中包含的图像的基本图像元素;
    若所述三角网格数量大于预设三角网格值,则确定当前的所述三维图形子对象的渲染复杂度未达到渲染条件;
    对所述三维图形子对象进行若干次四叉树分割,以获取所述三角网格数量小于或等于预设三角网格值的多个目标三维图形子对象。
  4. 根据权利要求2所述的方法,其中,所述方法还包括:
    在所述三维图形对象为点云模型的情况下,确定所述三维图形子对象中的点云的数量;其中,所述点云为所述三维图形子对象中包含的图像的基本图像元素;
    若所述点云数量大于预设点云值,则确定当前的所述三维图形子对象的渲染复杂度未达到渲染条件;
    对所述三维图形子对象进行若干次四叉树分割,以获取所述点云数量小于或等于预设点云值的多个目标三维图形子对象。
  5. 根据权利要求1所述的方法,其中,所述对多个所述目标三维图形子对象在待渲染平面分别进行渲染,得到渲染后的目标三维图形子对象,包括:
    将所述对多个所述目标三维图形子对象投影到待渲染平面,得到三维图像投影子对象;其中,所述三维图像投影子对象为渲染后的目标三维图形子对象。
  6. 根据权利要求5所述的方法,其中,所述将所述渲染后的目标三维图形子对象进行拼接,得到所述三维图形对象对应的二维渲染图,包括:
    确定出三维图像投影子对象在所述待渲染平面中的二维坐标;
    根据所述二维坐标将所述三维图像投影子对象在所述待渲染平面中进行拼接,得到所述二维渲染图;
    输出所述二维渲染图至待显示界面。
  7. 根据权利要求6所述的方法,其中,所述方法还包括:
    根据所述待显示界面的分辨率大小,生成与所述待显示界面尺寸相同的二维初始图片;
    将所述二维渲染图按预设比例投影到所述二维初始图片中,得到二维目标图片;
    输出所述二维目标图片至所述待显示界面。
  8. 一种图像渲染的处理装置,包括:
    第一裁剪模块,设置为接收三维图形对象,将所述三维图形对象进行视锥体裁剪得到三维图形锥体;
    第一分割模块,设置为将所述三维图形锥体进行四叉树分割,生成三维图形子对象;
    第一计算模块,设置为计算所述三维图形子对象的渲染复杂度;
    第一处理模块,设置为在所述三维图形子对象的渲染复杂度未达到渲染条件的情况下,对所述三维图形子对象进行若干次四叉树分割,以获取达到所述渲染条件的多个目标三维图形子对象;
    第一渲染模块,设置为对多个所述目标三维图形子对象在待渲染平面分别进行渲染,得到渲染后的目标三维图形子对象;
    第一拼接模块,设置为将所述渲染后的目标三维图形子对象进行拼接,得到所述三维图形对象对应的二维渲染图。
  9. 一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行所述权利要求1至7任一项中所述的方法。
  10. 一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行所述权利要求1至7任一项中所述的方法。
PCT/CN2021/125371 2020-11-09 2021-10-21 图像渲染的处理方法和装置、存储介质及电子设备 WO2022095714A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011241830.5A CN114463473A (zh) 2020-11-09 2020-11-09 图像渲染的处理方法和装置、存储介质及电子设备
CN202011241830.5 2020-11-09

Publications (1)

Publication Number Publication Date
WO2022095714A1 true WO2022095714A1 (zh) 2022-05-12

Family

ID=81404734

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/125371 WO2022095714A1 (zh) 2020-11-09 2021-10-21 图像渲染的处理方法和装置、存储介质及电子设备

Country Status (2)

Country Link
CN (1) CN114463473A (zh)
WO (1) WO2022095714A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116206046A (zh) * 2022-12-13 2023-06-02 北京百度网讯科技有限公司 渲染处理方法、装置、电子设备及存储介质
CN116912395A (zh) * 2023-09-14 2023-10-20 武汉蜂鸟龙腾软件有限公司 基于OpenGL的图形混合渲染方法、装置及存储介质
CN117876555A (zh) * 2024-03-12 2024-04-12 西安城市发展资源信息有限公司 一种基于poi检索的三维模型数据高效渲染方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831632A (zh) * 2012-07-24 2012-12-19 上海晨思电子科技有限公司 镜像纹理生成方法、装置以及计算机
CN107978018A (zh) * 2017-12-22 2018-05-01 广州视源电子科技股份有限公司 立体图形模型的构建方法、装置、电子设备及存储介质
US10147226B1 (en) * 2016-03-08 2018-12-04 Pixelworks, Inc. 2D motion vectors from 3D model data
CN110738721A (zh) * 2019-10-12 2020-01-31 四川航天神坤科技有限公司 基于视频几何分析的三维场景渲染加速方法及系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831632A (zh) * 2012-07-24 2012-12-19 上海晨思电子科技有限公司 镜像纹理生成方法、装置以及计算机
US10147226B1 (en) * 2016-03-08 2018-12-04 Pixelworks, Inc. 2D motion vectors from 3D model data
CN107978018A (zh) * 2017-12-22 2018-05-01 广州视源电子科技股份有限公司 立体图形模型的构建方法、装置、电子设备及存储介质
CN110738721A (zh) * 2019-10-12 2020-01-31 四川航天神坤科技有限公司 基于视频几何分析的三维场景渲染加速方法及系统

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116206046A (zh) * 2022-12-13 2023-06-02 北京百度网讯科技有限公司 渲染处理方法、装置、电子设备及存储介质
CN116206046B (zh) * 2022-12-13 2024-01-23 北京百度网讯科技有限公司 渲染处理方法、装置、电子设备及存储介质
CN116912395A (zh) * 2023-09-14 2023-10-20 武汉蜂鸟龙腾软件有限公司 基于OpenGL的图形混合渲染方法、装置及存储介质
CN116912395B (zh) * 2023-09-14 2024-01-12 武汉蜂鸟龙腾软件有限公司 基于OpenGL的图形混合渲染方法、装置及存储介质
CN117876555A (zh) * 2024-03-12 2024-04-12 西安城市发展资源信息有限公司 一种基于poi检索的三维模型数据高效渲染方法

Also Published As

Publication number Publication date
CN114463473A (zh) 2022-05-10

Similar Documents

Publication Publication Date Title
WO2022095714A1 (zh) 图像渲染的处理方法和装置、存储介质及电子设备
CN110751712A (zh) 基于云平台的在线三维渲染技术及系统
CN110706341B (zh) 一种城市信息模型的高性能渲染方法、装置及存储介质
US10699365B2 (en) Method, apparatus, and storage medium for processing particle system
CN112057851A (zh) 一种基于多显卡的单帧画面实时渲染方法
US20170161947A1 (en) Method and system for converting an existing 3d model into graphical data
CN112316433B (zh) 游戏画面渲染方法、装置、服务器和存储介质
US11792245B2 (en) Network resource oriented data communication
CN112001993A (zh) 一种面向大场景的多gpu城市仿真系统
CN111476851A (zh) 图像处理方法、装置、电子设备及存储介质
CN111932663A (zh) 基于多层级非对称通信管理的并行绘制方法
CN105701850A (zh) 用于合作动画的实时方法
US20230316626A1 (en) Image rendering method and apparatus, computer device, and computer-readable storage medium
US20230343021A1 (en) Visible element determination method and apparatus, storage medium, and electronic device
CN110038302B (zh) 基于Unity3D的网格生成方法及装置
CN115861510A (zh) 对象渲染方法、装置、电子设备、存储介质及程序产品
CN116468736A (zh) 基于空间结构的前景图像分割方法、装置、设备、介质
CN106780693B (zh) 一种通过绘制方式选择三维场景中物体的方法及系统
WO2022033162A1 (zh) 一种模型加载方法以及相关装置
CN106447753B (zh) 一种物体模型的渲染简化的方法及系统
WO2022135050A1 (zh) 渲染方法、设备以及系统
Arora et al. Distributed cluster processing to evaluate interlaced run-length compression schemes
CN116433818B (zh) 一种云端cpu及gpu平行渲染方法
US11757986B2 (en) Implementing an intelligent network of distributed compute nodes
CN117014655A (zh) 视频渲染方法、装置、设备和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21888411

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 26.09.2023)