CN111951342A - Back surface component removing method and system based on off-screen rendering and storage medium - Google Patents

Back surface component removing method and system based on off-screen rendering and storage medium Download PDF

Info

Publication number
CN111951342A
CN111951342A CN202010736223.XA CN202010736223A CN111951342A CN 111951342 A CN111951342 A CN 111951342A CN 202010736223 A CN202010736223 A CN 202010736223A CN 111951342 A CN111951342 A CN 111951342A
Authority
CN
China
Prior art keywords
component
rendering
container
components
obtaining
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202010736223.XA
Other languages
Chinese (zh)
Other versions
CN111951342B (en
Inventor
马骁
郝方位
陶海波
叶宇飞
陈雷行
廖灿灿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CCTEG Chongqing Engineering Group Co Ltd
Original Assignee
CCTEG Chongqing Engineering Group Co Ltd
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 CCTEG Chongqing Engineering Group Co Ltd filed Critical CCTEG Chongqing Engineering Group Co Ltd
Priority to CN202010736223.XA priority Critical patent/CN111951342B/en
Publication of CN111951342A publication Critical patent/CN111951342A/en
Application granted granted Critical
Publication of CN111951342B publication Critical patent/CN111951342B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Architecture (AREA)
  • Computer Graphics (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Image Generation (AREA)

Abstract

The invention relates to a back component removing method, a back component removing system and a storage medium based on off-screen rendering, wherein the back component removing method comprises the steps of obtaining rendering data of all components in a model to be rendered, loading all the components and all the rendering data into a preset initial component container, and initializing the initial component container to obtain a rendering component container; obtaining a visible set diffusion array set according to the rendering component container, obtaining a plurality of target adjacent components according to the rendering component container and the visible set diffusion array set, and obtaining a potential visible set container according to all the target adjacent components; and performing off-screen rendering according to all target adjacent components in the potential visible set container to obtain a plurality of rendering query frame data, updating the rendering component container according to all the rendering query frame data to obtain a target rendering component container, and finishing the back component removal. When the method is used for shielding inquiry and rejection, whether the component is shielded or not can be distinguished with higher recognition rate, the recognition effect is more obvious, and the rejection effect is stable.

Description

Back surface component removing method and system based on off-screen rendering and storage medium
Technical Field
The invention relates to the technical field of graphics rendering optimization, in particular to a back component removing method and system based on off-screen rendering and a storage medium.
Background
The elimination of the back component refers to that in the process of rendering a large-volume three-dimensional model, because the rendered volume greatly exceeds the rendering limit of the current mainstream GPU rendering, component geometries which are not rendered on a screen or are not obvious at a remote place on the back of the rendered model are eliminated through a series of methods at the software level, and the method is an optimization method for the graphics rendering performance.
At present, two main solutions are available, one is to perform occlusion back face rejection based on a depth buffer (i.e. z-buffer), the rejection effect of the method is not ideal, and there is a problem that when a transparent component is in front of an opaque component, the opaque component behind the transparent component is rejected. The other method is to use a query mode of a WebGl API interface (the WebGl API is a JavaScript API and can render high-performance interactive 3D and 2D graphics in any compatible Web browser without using plug-ins) to perform occlusion query and elimination, the method needs to construct a bounding box and perform occlusion test according to the bounding box, however, the construction of the bounding box of most application scenes is irregular construction, and the use of the regular construction of the bounding box causes elimination errors, so that the elimination is not accurate. Therefore, when the two methods are used for back component occlusion query and elimination in a large-volume model (such as hundreds of thousands of components), 100% of the results cannot guarantee whether the identified component is occluded or not, the query effect of invisible components is poor, and after occlusion query and elimination, the ratio of the determined invisible set to the total component floats greatly, so that the frame rate of a rendered frame is very unstable.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a method, a system and a storage medium for removing a back member based on off-screen rendering, which can distinguish whether the member is shielded or not with higher recognition rate when the back member of a large number of models is shielded, inquired and removed, and has more obvious effect of recognizing invisible members and stable removal effect.
The technical scheme for solving the technical problems is as follows:
a back component removing method based on off-screen rendering comprises the following steps:
step 1: obtaining rendering data of all components in a model to be rendered, loading all the components and all the rendering data into a preset initial component container, and initializing the initial component container to obtain a rendering component container;
step 2: calculating to obtain a visible set diffusion array set according to the rendering component container, obtaining a plurality of target adjacent components according to the rendering component container and the visible set diffusion array set, and obtaining a potential visible set container according to all the target adjacent components;
and step 3: and performing off-screen rendering according to all the target adjacent components in the potential visible set container to obtain a plurality of rendering query frame data, updating the rendering component container according to all the rendering query frame data to obtain a target rendering component container, and finishing back component removal.
According to another aspect of the invention, the invention also provides a back component removing system based on off-screen rendering, which is applied to the back component removing method based on off-screen rendering, and comprises an initialization module, a calculation module, an off-screen rendering module and an updating module;
the initialization module is used for acquiring rendering data of all components in a model to be rendered, loading all the components and all the rendering data into a preset initial component container, and then initializing the initial component container to obtain a rendering component container;
the computing module is used for obtaining a visible set diffusion array set through computing according to the rendering component container, obtaining a plurality of target adjacent components according to the rendering component container and the visible set diffusion array set, and obtaining a potential visible set container according to all the target adjacent components;
the off-screen rendering module is used for performing off-screen rendering according to all the target adjacent components in the potential visible set container to obtain a plurality of rendering query frame data;
and the updating module is used for updating the rendering component container according to all the rendering query frame data to obtain a target rendering component container and finish back component removal.
According to another aspect of the present invention, there is provided an off-screen rendering-based backside component culling system, which includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program is executed to implement the steps of the off-screen rendering-based backside component culling method in the present invention.
In accordance with another aspect of the present invention, there is provided a computer storage medium comprising: at least one instruction which, when executed, implements steps in an off-screen rendering based method of backside member culling of the present invention.
The method and the system for removing the back component based on off-screen rendering and the storage medium have the advantages that: the method comprises the steps of obtaining a rendering component container by initializing acquired rendering data of components, providing a rendering data source for subsequent query of a visibility component, obtaining a visible set diffusion array set by calculation to obtain a potential visible set container, wherein the potential visible set container contains visible components and possibly remote non-obvious components, facilitating subsequent off-screen rendering, further facilitating updating the rendering component container according to a rendering query frame obtained after rendering, obtaining model component data only eliminating back components, namely data stored in a target rendering component container, achieving elimination of component geometries which are not rendered on the back of a model to be rendered or component geometries which are not viewed at a distance, effectively improving the rendering effect of the graph, and achieving optimization of the rendering performance of the graph; the rendering component container comprises all components in the model to be rendered, the potential visible set container comprises all visible components in the model to be rendered, and the target rendering component container comprises all components in the model to be rendered without back components;
the method, the system and the storage medium for removing the back surface component can more accurately inquire out the potential visible set, can distinguish whether the component is shielded or not with higher recognition rate when shielding, inquiring and removing the back surface component of a large-volume model, have more obvious inquiring effect on invisible components, and can realize the self-contained detail removing effect by changing the rendering inquiry frame data, thereby effectively ensuring the stability of the removing effect and having wider application range.
Drawings
Fig. 1 is a schematic flowchart of a method for removing a backside member based on off-screen rendering according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a rendering component container according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating a process of obtaining a visible set diffusion array set according to a first embodiment of the present invention;
FIG. 4 is a schematic flow chart of obtaining a potential visible container according to a first embodiment of the present invention;
FIG. 5 is a schematic flow chart illustrating another implementation of obtaining a potential visible collection container according to an embodiment of the present invention;
FIG. 6 is a flowchart illustrating updating a render component container according to a first embodiment of the present invention;
fig. 7 is a schematic structural diagram of a backside component culling system based on off-screen rendering according to a second embodiment of the present invention.
Detailed Description
The principles and features of this invention are described below in conjunction with the following drawings, which are set forth by way of illustration only and are not intended to limit the scope of the invention.
The present invention will be described with reference to the accompanying drawings.
In a first embodiment, as shown in fig. 1, a method for removing a backside member based on off-screen rendering includes the following steps:
s1: obtaining rendering data of all components in a model to be rendered, loading all the components and all the rendering data into a preset initial component container, and initializing the initial component container to obtain a rendering component container;
s2: calculating to obtain a visible set diffusion array set according to the rendering component container, obtaining a plurality of target adjacent components according to the rendering component container and the visible set diffusion array set, and obtaining a potential visible set container according to all the target adjacent components;
s3: and performing off-screen rendering according to all the target adjacent components in the potential visible set container to obtain a plurality of rendering query frame data, updating the rendering component container according to all the rendering query frame data to obtain a target rendering component container, and finishing back component removal.
The method comprises the steps of obtaining a rendering component container by initializing acquired rendering data of components, providing a rendering data source for subsequent query of a visibility component, obtaining a visible set diffusion array set by calculation to obtain a potential visible set container, wherein the potential visible set container contains visible components and possibly remote non-obvious components, facilitating subsequent off-screen rendering, further facilitating updating the rendering component container according to a rendering query frame obtained after rendering, obtaining model component data only eliminating back components, namely data stored in a target rendering component container, achieving elimination of component geometries which are not rendered on the back of a model to be rendered or component geometries which are not viewed at a distance, effectively improving the rendering effect of the graph, and achieving optimization of the rendering performance of the graph; the rendering component container comprises all components in the model to be rendered, the potential visible set container comprises all visible components in the model to be rendered, and the target rendering component container comprises all components in the model to be rendered without back components;
the method for rejecting the back component can accurately inquire the potential visible set, can distinguish whether the component is shielded or not with higher recognition rate when the back component of a large-size model is shielded, the query effect of the invisible component is more obvious, and meanwhile, the effect of rejecting the self-contained details can be realized by changing the rendering query frame data, so that the stability of the rejection effect is effectively guaranteed, and the application range is wider.
It should be noted that when S1 is the first frame of a certain back-surface component-removing process, the components stored in the initial component container are all components of the model to be rendered, and the initial component container needs to be initialized, and when S1 is the intermediate frame of the back-surface component-removing process (i.e., when the intermediate frame is not the first frame, such as the second frame), the initial component container is the target rendering component container of the previous frame (i.e., the first frame) of the back-surface component-removing process, and at this time, the component container is initialized, and does not need to be initialized again, that is, in the whole back-surface component-removing process, S1 is executed first, and then the execution is performed in a loop from S2 to S3.
Specifically, the present embodiment is based on the culling of the backside member implemented by the GPU off-screen rendering technique. The GPU rendering mechanism refers to that the display content calculated by the CPU is submitted to the GPU, the rendering result is put into a frame buffer area after the GPU rendering is finished, and then the video controller reads data in the frame buffer area line by line according to the VSync signal and transmits the data to the display for display through possible digital-to-analog conversion.
There are two ways of GPU screen rendering:
On-Screen Rendering means current Screen Rendering, meaning that the Rendering operation of the GPU is performed in the Screen buffer currently used for display.
Off-Screen Rendering means Off-Screen Rendering, which means that the GPU opens a new buffer area outside the current Screen buffer area for Rendering operation.
And rendering that is not performed in the GPU's current screen buffer is referred to as GPU off-screen rendering.
It should be noted that the specific operation steps of off-screen rendering are prior art, and the specific details are not described herein again.
Specifically, the rendering data includes center point position information of each member in the model to be rendered.
The component distance between every two components is convenient to calculate subsequently through the central point position information of the components, so that a rendering component container is convenient to obtain, meanwhile, the adjacent components corresponding to each component are convenient to determine, and a visible set diffusion array is further determined; the center point position information belongs to the geometric information of the component, and may further include geometric information of other aspects, such as a component dimension, and the rendering data may further include other information of the component, such as material information.
Preferably, as shown in fig. 2, in S1, the step of obtaining the rendering component container includes:
s11: according to a preset color coding method, coding each component in the initial component container respectively to obtain a color code corresponding to each component one by one;
s12: obtaining the member distance between every two members according to the central point position information of every two members in the initial member container;
s13: and obtaining the rendering component container according to all components, all color codes and all component distances.
The initialization of an initial component container is realized by carrying out color coding on the components and calculating the component distance between every two components, so that rendering data under the current frame condition can be conveniently and completely added into the rendering component container; the RGB color is composed of three eight-bit binary systems, 256(R) × 256(G) × 256(B) ═ 16777216 members can be represented by the RGB color, 0-16777215 color codes can be used as identification numbers of the members, the members and the RGB color are bound through the color codes, subsequent visible set diffusion array sets are determined conveniently by combining member distances, a potential visible set container is obtained, and visibility query with higher identification rate is achieved.
Specifically, in the embodiment, rendering data of a model to be rendered, which is obtained by loading a gltf and/or glb model file, is defined and assigned with an argument n as 1, and is automatically added 1 each time data of the model file is traversed, because a model component (mesh) is composed of geometric information (geometry) and material information (material), the embodiment only takes the geometric information, creates a pure color material instance according to the argument n, synthesizes the pure color material instance into the model component (mesh), and then traverses all the model files, and then obtains rendering data;
the purpose of adding all rendering data obtained by loading the gltf and/or glb model file into the initial component container is to enable the first frame to perform S2 to calculate the potential visible set according to the contents of all components, and then the second frame to perform S2 to search for neighboring nodes under the visible set diffusion array based on the previous rendering result, so as to achieve the dynamic visibility query of the whole model.
Preferably, as shown in fig. 3, in S2, the specific step of obtaining the visible set diffusion array set includes:
s21: selecting one component from the rendering component container as a first component, searching a 1 st adjacent component corresponding to the minimum value of the component distances between the first components in the rest components except the first component in the rendering component container according to all the component distances, and obtaining a visible set diffusion array corresponding to the first component according to the color code corresponding to the first component and the color code corresponding to the 1 st adjacent component;
s22: according to all the component distances, searching a 2 nd adjacent component corresponding to the minimum value of the component distances between the 1 st adjacent components in the 1 st rest components of the rendering component container, and obtaining a visible set diffusion array corresponding to the 1 st adjacent component according to the color coding corresponding to the 1 st adjacent component and the color coding corresponding to the 2 nd adjacent component;
s23: according to all the component distances, searching an N +1 th adjacent component corresponding to the minimum value of the component distances between the nth adjacent components in the Nth residual components of the rendering component container, and obtaining a visible set diffusion array corresponding to the Nth adjacent component according to the color code corresponding to the Nth adjacent component and the color code corresponding to the N +1 th adjacent component; wherein N is 2, 3, 4 … …, and the total number of rendering component container components is N + 2; the Nth residual member is the residual member except the first member and the 1 st to the Nth adjacent members in the rendering member container;
s24: and obtaining the visible set diffusion array set according to all the visible set diffusion arrays.
For the optional first number of members, the member with the shortest distance to the first number of members (i.e. the member distance corresponding to the minimum value) in the rest members except the first number of members in the rendering member container is the 1 st adjacent member, that is, the most likely visibility member corresponding to the first number of members, and the color code corresponding to the first number of members and the color code corresponding to the 1 st adjacent member constitute the visible set diffusion array of the first number of members; similarly, as for the 1 st adjacent member, among the remaining members other than the first-number member and the 1 st adjacent member (simply referred to as the 1 st remaining member), and then the visible set diffusion array corresponding to the 1 st adjacent component can be determined according to the same method, according to the searching sequence of the adjacent components and according to the distances of all the components, the visible set diffusion array corresponding to the nth neighboring element may be found in the nth remaining element, and so on, the visible set diffusion arrays of all the components in the rendering component container can be obtained, and a visible set diffusion array set is obtained (wherein the last component automatically forms a visible set diffusion array set with the last adjacent component without searching, when the total number of the components in the rendering component container is N +2, the searching times are N +1 times, and the number of the visible set diffusion arrays in the visible set diffusion array set is N +1 groups); the method has higher accuracy in querying the visible component, is simple and easy to implement, can obtain more than 90% of the query effect of the visible component, and further can ensure the rendering stability.
Specifically, in this embodiment, after loading the gltf and/or glb model file, traversing all components (mesh) to obtain component information, calculating a parcel box, and obtaining position information of a center point of each component (mesh), except for the first component placed in the visible set diffusion array set, the other components calculate a distance from the center point of the last added component in the remaining components, and the component with the smallest distance is sequentially placed in the visible set diffusion array set, and color coding of the component is performed, so that a component with the closest distance and no repetition with other components can be conveniently found.
Preferably, as shown in fig. 4, in S2, the specific step of obtaining the potential visible collection container includes:
s25: judging whether a rendered component exists in the rendering component container, if not, obtaining a target adjacent component and a target adjacent component color code corresponding to each component in the rendering component container according to the visible set diffusion array set; obtaining the potential visible set container according to all target adjacent members and all target adjacent member color codes;
if so, acquiring all rendered components in the rendering component container, and searching a target adjacent component corresponding to each rendered component and a target adjacent component color code in the visible set diffusion array set; and emptying a preset visible set container, and loading the target adjacent components corresponding to all the rendered components and the target adjacent component color codes corresponding to all the rendered components into the visible set container to obtain the potential visible set container.
Since S1 may be in the first frame of a certain back-surface component removing process, or in the intermediate frame of the back-surface component removing process, when the frame is the first frame, the rendered component container does not have any rendered component, the target neighboring component and the target neighboring component color code thereof corresponding to each component of the rendered component container may be directly queried in the visible set diffusion array set, and these target neighboring components and the target neighboring component color codes thereof are potential visible set containers under the current first frame; when the intermediate frame is used, as the rendered components exist before, namely the rendered components exist in the container of the rendered components at the time, the target adjacent components corresponding to each rendered component and the color codes of the target adjacent components corresponding to the target adjacent components are inquired in the visible set diffusion array set, meanwhile, the preset visible set container (namely, the potential visible set container in the previous processing process) is emptied, and then the potential visible set container under the current intermediate frame is obtained according to all the target adjacent components and the color codes of the target adjacent components corresponding to the target adjacent components at the time; by the method, on one hand, the potential visible set (namely the visible content stored in the potential visible set container) can be efficiently inquired, on the other hand, the dynamic update of the potential visible set container can be realized, and further the real-time back component elimination can be realized.
Specifically, the complete process of finding the visible set diffusion array set to obtain the potential visible set container in this embodiment is shown in fig. 5.
Preferably, the rendering query frame data includes rendering frame pixel RGB data; as shown in fig. 6, in S3, the specific step of obtaining the target rendering component container includes:
s31: converting each rendering pixel RGB data into corresponding target rendering color codes respectively;
s32: obtaining a target visible component set according to all target rendering color codes;
s33: and updating the rendering component container according to the target visible component set to obtain the target rendering component container, and finishing back component elimination.
Traversing and counting pixel RGB data obtained after rendering through an off-screen rendering technology, counting RGB color values in the pixel RGB data, converting the RGB color values into 6-bit 16-system numbers (the highest two bits represent R values, the middle two bits represent G values, and the lowest two bits represent B values) which can represent target rendering color codes of 0x 000000-0 xfffffff, wherein the code values also correspond to color code values coded in advance; in the actual operation process, the width and height interval of the traversal pixels can be increased by increasing the detail rejection intensity, and as the obtained pixel data is a uint array with the image width x 4 image height, corresponding to the loaded component, a non-repetitive and actually visible component set can be obtained, namely a target visible component set, the rendering component container is updated according to the target visible component set, and the obtained target selected rendering component container can truly render the component which is not actually occluded, so that the final rendering effect is obtained; the removing method can achieve the component removing effect of more than 90%, is stable in effect, meanwhile, compared with the traditional method, the method achieves the effect of removing details, can change the width and height interval of the traversal pixels according to the actual situation, and further achieves the purpose of changing the judgment step length of the rendering query frame data to increase the detail removing strength based on the rendering query frame data of the rendering frame pixel RGB data.
In the second embodiment, as shown in fig. 7, a back surface component removing system based on off-screen rendering is applied to the back surface component removing method based on off-screen rendering in the first embodiment, and includes an initialization module, a calculation module, an off-screen rendering module, and an update module;
the initialization module is used for acquiring rendering data of all components in a model to be rendered, loading all the components and all the rendering data into a preset initial component container, and then initializing the initial component container to obtain a rendering component container;
the computing module is used for obtaining a visible set diffusion array set through computing according to the rendering component container, obtaining a plurality of target adjacent components according to the rendering component container and the visible set diffusion array set, and obtaining a potential visible set container according to all the target adjacent components;
the off-screen rendering module is used for performing off-screen rendering according to all the target adjacent components in the potential visible set container to obtain a plurality of rendering query frame data;
and the updating module is used for updating the rendering component container according to all the rendering query frame data to obtain a target rendering component container and finish back component removal.
The rendering data of the components acquired by the initialization module is initialized to obtain a rendering component container, a rendering data source is provided for the follow-up query of the visibility components, a visible set diffusion array set is obtained by calculation by the calculation module to further obtain a potential visible set container, the potential visible set container contains visible components, and may also be a remote non-obvious component, which can facilitate the off-screen rendering of the subsequent off-screen rendering module, so that the updating module can update the rendering component container according to the rendering query frame obtained after rendering to obtain the model component data only excluding the back component, the data stored in the target rendering component container realizes the elimination of component geometries which are not rendered on the back surface of the model to be rendered or component geometries which are not obvious at a distance, effectively improves the graph rendering effect and realizes the optimization of the graph rendering performance; the rendering component container comprises all components in the model to be rendered, the potential visible set container comprises all visible components in the model to be rendered, and the target rendering component container comprises all components in the model to be rendered without back components;
the back component removing system can accurately inquire out a potential visible set, can distinguish whether a component is shielded or not with higher recognition rate when the back component of a model with large volume is shielded, the query effect of an invisible component is more obvious, and meanwhile, the self-contained detail removing effect can be realized by changing rendering query frame data, so that the stability of the removing effect is effectively guaranteed, and the application range is wider.
Preferably, the rendering data includes center point position information of each member in the model to be rendered.
Preferably, the initialization module is specifically configured to:
according to a preset color coding method, coding each component in the initial component container respectively to obtain a color code corresponding to each component one by one;
obtaining the member distance between every two members according to the central point position information of every two members in the initial member container;
and obtaining the rendering component container according to all components, all color codes and all component distances.
Preferably, the calculation module is specifically configured to:
selecting one component from the rendering component container as a first component, searching a 1 st adjacent component corresponding to the minimum value of the component distances between the first components in the rest components except the first component in the rendering component container according to all the component distances, and obtaining a visible set diffusion array corresponding to the first component according to the color code corresponding to the first component and the color code corresponding to the 1 st adjacent component;
according to all the component distances, searching a 2 nd adjacent component corresponding to the minimum value of the component distances between the 1 st adjacent components in the 1 st rest components of the rendering component container, and obtaining a visible set diffusion array corresponding to the 1 st adjacent component according to the color coding corresponding to the 1 st adjacent component and the color coding corresponding to the 2 nd adjacent component;
according to all the component distances, searching an N +1 th adjacent component corresponding to the minimum value of the component distances between the nth adjacent components in the Nth residual components of the rendering component container, and obtaining a visible set diffusion array corresponding to the Nth adjacent component according to the color code corresponding to the Nth adjacent component and the color code corresponding to the N +1 th adjacent component; wherein N is 2, 3, 4 … …, and the total number of rendering component container components is N + 2; the Nth residual member is the residual member except the first member and the first adjacent member to the Nth adjacent member in the rendering member container;
and obtaining the visible set diffusion array set according to all the visible set diffusion arrays.
Preferably, the calculation module is further specifically configured to:
judging whether a rendered component exists in the rendering component container, if not, obtaining a target adjacent component and a target adjacent component color code corresponding to each component in the rendering component container according to the visible set diffusion array set; obtaining the potential visible set container according to all target adjacent members and all target adjacent member color codes;
if so, acquiring all rendered components in the rendering component container, and searching a target adjacent component corresponding to each rendered component and a target adjacent component color code in the visible set diffusion array set; and emptying a preset visible set container, and loading the target adjacent components corresponding to all the rendered components and the target adjacent component color codes corresponding to all the rendered components into the visible set container to obtain the potential visible set container.
Preferably, the rendering query frame data includes rendering frame pixel RGB data; the update module is specifically configured to:
converting each rendering pixel RGB data into corresponding target rendering color codes respectively;
obtaining a target visible component set according to all target rendering color codes;
and updating the rendering component container according to the target visible component set to obtain the target rendering component container, and finishing back component elimination.
Third embodiment, based on the first embodiment and the second embodiment, the present embodiment further discloses a back surface member culling system based on off-screen rendering, which includes a processor, a memory, and a computer program stored in the memory and executable on the processor, where the computer program implements the specific steps of S1 to S3 when running.
Through the computer program stored on the memory and running on the processor, the elimination of the component geometry of which the back surface of the model to be rendered is not rendered or the component geometry which is not obvious at a distance can be realized, the graph rendering effect is effectively improved, the optimization of the graph rendering performance is realized, a potential visible set can be inquired more accurately, when the back surface component of a large-size model is subjected to shielding inquiry and elimination, whether the component is shielded or not can be distinguished with higher identification rate, the inquiry effect of an invisible component is more obvious, meanwhile, the elimination effect of the self-contained details can be realized by changing the rendering inquiry frame data, the stability of the elimination effect is effectively ensured, and the application range is wider.
The present embodiment also provides a computer storage medium having at least one instruction stored thereon, where the instruction when executed implements the specific steps of S1-S3.
Through executing a computer storage medium containing at least one instruction, the elimination of component geometries which are not rendered on the back of a model to be rendered or component geometries which are not obvious at a distance can be realized, the graph rendering effect is effectively improved, the optimization of the graph rendering performance is realized, a potential visible set can be inquired more accurately, when the back component of a large-size model is subjected to shielding inquiry and elimination, whether the component is shielded or not can be distinguished with higher identification rate, the inquiry effect of an invisible component is more obvious, meanwhile, the self-contained detail elimination effect can be realized by changing rendering inquiry frame data, the stability of the elimination effect is effectively guaranteed, and the application range is wider.
Details of the embodiment are not described in detail in the first embodiment and the specific descriptions in fig. 1 to 6, which are not repeated herein.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (10)

1. A back component removing method based on off-screen rendering is characterized by comprising the following steps:
step 1: obtaining rendering data of all components in a model to be rendered, loading all the components and all the rendering data into a preset initial component container, and initializing the initial component container to obtain a rendering component container;
step 2: calculating to obtain a visible set diffusion array set according to the rendering component container, obtaining a plurality of target adjacent components according to the rendering component container and the visible set diffusion array set, and obtaining a potential visible set container according to all the target adjacent components;
and step 3: and performing off-screen rendering according to all the target adjacent components in the potential visible set container to obtain a plurality of rendering query frame data, updating the rendering component container according to all the rendering query frame data to obtain a target rendering component container, and finishing back component removal.
2. The off-screen rendering-based backside member elimination method according to claim 1, wherein the rendering data includes center point position information of each member in the model to be rendered.
3. The off-screen rendering-based backside member elimination method according to claim 2, wherein in the step 1, the specific step of obtaining the rendering member container comprises:
step 11: according to a preset color coding method, coding each component in the initial component container respectively to obtain a color code corresponding to each component one by one;
step 12: obtaining the member distance between every two members according to the central point position information of every two members in the initial member container;
step 13: and obtaining the rendering component container according to all components, all color codes and all component distances.
4. The off-screen rendering-based method for removing backside members according to claim 3, wherein in the step 2, the specific step of obtaining the visible set diffusion array set comprises:
step 21: selecting one component from the rendering component container as a first component, searching a 1 st adjacent component corresponding to the minimum value of the component distances between the first components in the rest components except the first component in the rendering component container according to all the component distances, and obtaining a visible set diffusion array corresponding to the first component according to the color code corresponding to the first component and the color code corresponding to the 1 st adjacent component;
step 22: according to all the component distances, searching a 2 nd adjacent component corresponding to the minimum value of the component distances between the 1 st adjacent components in the 1 st rest components of the rendering component container, and obtaining a visible set diffusion array corresponding to the 1 st adjacent component according to the color coding corresponding to the 1 st adjacent component and the color coding corresponding to the 2 nd adjacent component;
step 23: according to all the component distances, searching an N +1 th adjacent component corresponding to the minimum value of the component distances between the nth adjacent components in the Nth residual components of the rendering component container, and obtaining a visible set diffusion array corresponding to the Nth adjacent component according to the color code corresponding to the Nth adjacent component and the color code corresponding to the N +1 th adjacent component; wherein N is 2, 3, 4 … …, and the total number of rendering component container components is N + 2; the Nth residual member is the residual member except the first member and the 1 st to the Nth adjacent members in the rendering member container;
step 24: and obtaining the visible set diffusion array set according to all the visible set diffusion arrays.
5. The off-screen rendering-based backside member elimination method according to claim 4, wherein in the step 2, the specific step of obtaining the potential visible set container comprises:
step 25: judging whether a rendered component exists in the rendering component container, if not, obtaining a target adjacent component and a target adjacent component color code corresponding to each component in the rendering component container according to the visible set diffusion array set; obtaining the potential visible set container according to all target adjacent members and all target adjacent member color codes;
if so, acquiring all rendered components in the rendering component container, and searching a target adjacent component corresponding to each rendered component and a target adjacent component color code in the visible set diffusion array set; and emptying a preset visible set container, and loading the target adjacent components corresponding to all the rendered components and the target adjacent component color codes corresponding to all the rendered components into the visible set container to obtain the potential visible set container.
6. The off-screen rendering based backside component culling method of claim 5, wherein the rendering query frame data comprises rendering frame pixel RGB data; in step 3, the specific step of obtaining the target rendering component container includes:
step 31: converting each rendering pixel RGB data into corresponding target rendering color codes respectively;
step 32: obtaining a target visible component set according to all target rendering color codes;
step 33: and updating the rendering component container according to the target visible component set to obtain the target rendering component container, and finishing back component elimination.
7. The off-screen rendering-based back component removing system is applied to the off-screen rendering-based back component removing method in any one of claims 1 to 6, and comprises an initialization module, a calculation module, an off-screen rendering module and an updating module;
the initialization module is used for acquiring rendering data of all components in a model to be rendered, loading all the components and all the rendering data into a preset initial component container, and then initializing the initial component container to obtain a rendering component container;
the computing module is used for obtaining a visible set diffusion array set through computing according to the rendering component container, obtaining a plurality of target adjacent components according to the rendering component container and the visible set diffusion array set, and obtaining a potential visible set container according to all the target adjacent components;
the off-screen rendering module is used for performing off-screen rendering according to all the target adjacent components in the potential visible set container to obtain a plurality of rendering query frame data;
and the updating module is used for updating the rendering component container according to all the rendering query frame data to obtain a target rendering component container and finish back component removal.
8. The off-screen rendering based backside member culling system of claim 7, wherein the rendering data comprises center point location information for each member in the model to be rendered;
the initialization module is specifically configured to:
respectively initializing each component in the initial component container according to a preset color coding method to obtain a color code corresponding to each component one by one;
obtaining the member distance between every two members according to the central point position information of every two members in the initial member container;
and obtaining the rendering component container according to all components, all color codes and all component distances.
9. An off-screen rendering based backface signature culling system comprising a processor, a memory and a computer program stored in said memory and executable on said processor, said computer program when executed implementing the method steps of any one of claims 1 to 6.
10. A computer storage medium, the computer storage medium comprising: at least one instruction which, when executed, implements the method steps of any one of claims 1 to 6.
CN202010736223.XA 2020-07-28 2020-07-28 Back component eliminating method, system and storage medium based on off-screen rendering Active CN111951342B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010736223.XA CN111951342B (en) 2020-07-28 2020-07-28 Back component eliminating method, system and storage medium based on off-screen rendering

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010736223.XA CN111951342B (en) 2020-07-28 2020-07-28 Back component eliminating method, system and storage medium based on off-screen rendering

Publications (2)

Publication Number Publication Date
CN111951342A true CN111951342A (en) 2020-11-17
CN111951342B CN111951342B (en) 2023-06-06

Family

ID=73339672

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010736223.XA Active CN111951342B (en) 2020-07-28 2020-07-28 Back component eliminating method, system and storage medium based on off-screen rendering

Country Status (1)

Country Link
CN (1) CN111951342B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101025828A (en) * 2006-02-24 2007-08-29 腾讯科技(深圳)有限公司 Method for shading model afterimage effect
US20150123968A1 (en) * 2013-11-07 2015-05-07 Autodesk, Inc. Occlusion render mechanism for point clouds
US20160175709A1 (en) * 2014-12-17 2016-06-23 Fayez Idris Contactless tactile feedback on gaming terminal with 3d display
US20170085867A1 (en) * 2015-09-17 2017-03-23 Lumii, Inc. Multi-view displays and associated systems and methods
US20170186136A1 (en) * 2015-12-28 2017-06-29 Volkswagen Ag System and methodologies for super sampling to enhance anti-aliasing in high resolution meshes
CN109448136A (en) * 2018-09-29 2019-03-08 北京航空航天大学 A kind of virtual scene browsing method based on area-of-interest
CN110390714A (en) * 2018-04-16 2019-10-29 脸谱科技有限责任公司 For rendering the system, method and non-transitory storage medium of spill effect
CN110517345A (en) * 2019-08-28 2019-11-29 网易(杭州)网络有限公司 A kind of method and device of threedimensional model rendering

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101025828A (en) * 2006-02-24 2007-08-29 腾讯科技(深圳)有限公司 Method for shading model afterimage effect
US20150123968A1 (en) * 2013-11-07 2015-05-07 Autodesk, Inc. Occlusion render mechanism for point clouds
US20160175709A1 (en) * 2014-12-17 2016-06-23 Fayez Idris Contactless tactile feedback on gaming terminal with 3d display
US20170085867A1 (en) * 2015-09-17 2017-03-23 Lumii, Inc. Multi-view displays and associated systems and methods
US20170186136A1 (en) * 2015-12-28 2017-06-29 Volkswagen Ag System and methodologies for super sampling to enhance anti-aliasing in high resolution meshes
CN110390714A (en) * 2018-04-16 2019-10-29 脸谱科技有限责任公司 For rendering the system, method and non-transitory storage medium of spill effect
CN109448136A (en) * 2018-09-29 2019-03-08 北京航空航天大学 A kind of virtual scene browsing method based on area-of-interest
CN110517345A (en) * 2019-08-28 2019-11-29 网易(杭州)网络有限公司 A kind of method and device of threedimensional model rendering

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
PAN WANG等: "Multi-GPU Compositeless Parallel Rendering Algorithm" *
林仁回: "基于GPU的多通道快速直接体绘制研究" *
章冲: "网络环境下煤矿三维建模及可视化关键技术研究" *

Also Published As

Publication number Publication date
CN111951342B (en) 2023-06-06

Similar Documents

Publication Publication Date Title
US10347042B2 (en) Importance sampling of sparse voxel octrees
Amanatides et al. A fast voxel traversal algorithm for ray tracing.
US6456285B2 (en) Occlusion culling for complex transparent scenes in computer generated graphics
CN110827389A (en) Strict ray triangle intersection
KR101082215B1 (en) A fragment shader for a hybrid raytracing system and method of operation
US8610712B2 (en) Object selection in stereo image pairs
US9754405B1 (en) System, method and computer-readable medium for organizing and rendering 3D voxel models in a tree structure
CN110827387A (en) Method for traversing intersection point by continuous hierarchical bounding box without shader intervention
US7499051B1 (en) GPU assisted 3D compositing
CN110111408B (en) Large scene rapid intersection method based on graphics
WO2012158868A2 (en) Rendering tessellated geometry with motion and defocus blur
CN105405166A (en) LOD model generation method based on linear quadtree
CN112764004B (en) Point cloud processing method, device, equipment and storage medium
CN108229363A (en) Key frame dispatching method and device, electronic equipment, program and medium
US20160071315A1 (en) Convex Polygon Clipping During Rendering
WO2017164924A1 (en) System for gpu based depth reprojection for accelerating depth buffer generation
CN114359269A (en) Virtual food box defect generation method and system based on neural network
CN101310303B (en) Method for displaying high resolution image data together with time-varying low resolution image data
CN113643416A (en) Three-dimensional image volume rendering method, three-dimensional image volume rendering device, and computer-readable storage medium
KR20060118535A (en) System and method for transparency rendering
CN116152039B (en) Image rendering method
CN111951342B (en) Back component eliminating method, system and storage medium based on off-screen rendering
US20240095993A1 (en) Reducing false positive ray traversal in a bounding volume hierarchy
US20240095995A1 (en) Reducing false positive ray traversal using ray clipping
CN115168682B (en) Large-scale space-time point data LOD drawing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant