CN114418829A - Static scene occlusion processing method and device, electronic equipment and readable medium - Google Patents

Static scene occlusion processing method and device, electronic equipment and readable medium Download PDF

Info

Publication number
CN114418829A
CN114418829A CN202111659543.0A CN202111659543A CN114418829A CN 114418829 A CN114418829 A CN 114418829A CN 202111659543 A CN202111659543 A CN 202111659543A CN 114418829 A CN114418829 A CN 114418829A
Authority
CN
China
Prior art keywords
scene
voxel
static scene
grid
occlusion
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.)
Pending
Application number
CN202111659543.0A
Other languages
Chinese (zh)
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.)
Zhuhai Jianxin Interactive Entertainment Co ltd
Original Assignee
Zhuhai Jianxin Interactive Entertainment 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 Zhuhai Jianxin Interactive Entertainment Co ltd filed Critical Zhuhai Jianxin Interactive Entertainment Co ltd
Priority to CN202111659543.0A priority Critical patent/CN114418829A/en
Publication of CN114418829A publication Critical patent/CN114418829A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Graphics (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • Image Generation (AREA)

Abstract

The invention relates to a technical scheme of a static scene shielding processing method, a static scene shielding processing device, electronic equipment and a readable medium, wherein the technical scheme comprises the following steps: dividing the static scene into a plurality of voxel grids according to the shielding processing request; carrying out pre-calculation processing of occlusion rejection on the voxel grids to obtain a potential visible set of each grid; and performing detection on the voxel grid through a camera, and removing invisible scene model objects from a rendering queue through the potential visible set. The invention has the beneficial effects that: the visibility information of the scene is calculated through the scene division and the pre-calculation process after the scene is made, and the data is applied to remove invisible objects during running, so that invisible scene elements are removed from the rendering queue, the occurrence of repeated drawing is reduced, and the waste of rendering resources is also reduced. As the main calculated amount is generated in the pre-calculation stage, the invention has lower expenditure in operation, improves the fluency of the game and brings better experience to the player.

Description

Static scene occlusion processing method and device, electronic equipment and readable medium
Technical Field
The invention relates to the field of computers, in particular to a static scene occlusion processing method and device, electronic equipment and a readable medium.
Background
With the development of graphic hardware, objects in scenes in a 3D game are more and more abundant, and the size of the scenes is also more and more large. However, the improvement of hardware performance cannot completely keep up with the improvement of scene rendering pressure, and still meets the bottleneck of graphics hardware, wherein a large part of rendering resources are wasted by rendering objects which cannot be seen by a player, and the waste can cause a complementary process of game operation and picture blocking.
Disclosure of Invention
The invention aims to solve at least one technical problem in the prior art, provides a static scene occlusion processing method, a static scene occlusion processing device, an electronic device and a readable medium, and improves the game running efficiency.
The technical scheme of the invention comprises a static scene shielding processing method, which is characterized by comprising the following steps: dividing the static scene into a plurality of voxel grids according to the shielding processing request; carrying out pre-calculation processing of occlusion rejection on the voxel grids to obtain a potential visible set of each grid; and performing detection on the voxel grid through a camera, and removing invisible scene model objects from a rendering queue through the potential visible set.
The method for processing the static scene occlusion, wherein the pre-calculation processing comprises the following steps: and generating various types of rays, sampling and judging the visibility between the scene model object and the voxel grid in a ray casting mode. The use of low-differentiation sequences generates uniformly distributed random sampling points in three-dimensional space.
The static scene occlusion processing method, wherein sampling comprises: if the visibility of the scene model object is judged, generating uniformly distributed random sampling rays in a three-dimensional space by using a low-differentiation sequence; and if the invisible scene model object is confirmed, generating additional sampling rays on the original rays by adopting the strategies of random deflection and ray mutation.
The static scene occlusion processing method comprises the following steps: according to the sampling result, if any sampling ray collides with an object except the target object, the scene model object colliding with the ray can be directly marked as visible, and the object of the potential visible set of all the voxel grids passed by the ray in the middle can be marked as visible.
According to the static scene occlusion processing method, performing pre-calculation processing of occlusion culling on the voxel grids to obtain a potential visible set of each grid further includes: merging the potentially visible sets of the adjacent voxel grids after the pre-calculation process is finished according to the similarity of the potentially visible sets of any two adjacent voxel grids.
The static scene occlusion processing method, wherein detecting the voxel grid by a camera, and removing invisible scene model objects from a rendering queue through the potential visibility set comprises: according to the spatial position of the camera, the method comprises the steps of positioning to a grid data structure which is located in a two-dimensional top view and comprises a list of the voxel grids, determining the voxel grid with the smallest granularity and comprising the spatial position of the camera according to the height of the camera, obtaining potential visible set data corresponding to the voxel grid, and removing objects in a rendering queue.
The static scene occlusion processing method comprises the following steps: and adopting a stream type loading strategy when planning the scene shielding processing of the static scene, wherein the stream type loading strategy is resident in a memory for the common data block of the static scene, and executes the swap-in and swap-out processing for the map data of the resident memory according to a using strategy.
The technical scheme of the invention also comprises a static scene shielding processing device, which is characterized by comprising the following steps: the scene dividing module is used for dividing the static scene into a plurality of voxel grids according to the shielding processing request; the pre-calculation module is used for performing pre-calculation processing of occlusion rejection on the voxel grids to obtain a potential visible set of each grid; and the occlusion processing module is used for detecting the voxel grid through a camera and removing the invisible scene model object from the rendering queue through the potential visible set.
The technical scheme of the invention also comprises the electronic equipment which is characterized by comprising a processor and a memory; the memory is used for storing programs; the processor executes the program to realize the static scene occlusion processing method.
The technical solution of the present invention further includes a computer-readable storage medium, wherein the storage medium stores a program, and the program is executed by a processor to implement any one of the static scene occlusion processing methods.
The invention has the beneficial effects that: the visibility information of the scene is calculated through the scene division and the pre-calculation process after the scene is made, and the invisible object is removed by applying the data during the operation, so that the invisible scene elements of the player are removed from the rendering queue, the occurrence of repeated drawing is reduced, and the waste of rendering resources is also reduced. As the main calculated amount is generated in the pre-calculation stage, the invention has lower expenditure in operation, improves the fluency of the game and brings better experience to the player.
Drawings
The invention is further described below with reference to the accompanying drawings and examples;
fig. 1 is a flowchart illustrating a static scene occlusion processing method according to an embodiment of the present invention.
FIG. 2 is a schematic diagram of a pre-calculation process according to an embodiment of the present invention.
FIG. 3 is a schematic flow chart of occlusion culling according to an embodiment of the invention.
Fig. 4a and 4b are schematic diagrams illustrating comparison between before and after static scene occlusion processing according to an embodiment of the present invention.
Fig. 5 shows a schematic view of an apparatus according to an embodiment of the invention.
Detailed Description
Reference will now be made in detail to the present preferred embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to like elements throughout.
In the description of the present invention, the meaning of a plurality of means is one or more, the meaning of a plurality of means is two or more, and larger, smaller, larger, etc. are understood as excluding the number, and larger, smaller, inner, etc. are understood as including the number.
In the description of the present invention, the consecutive reference numbers of the method steps are for convenience of examination and understanding, and the implementation order between the steps is adjusted without affecting the technical effect achieved by the technical solution of the present invention by combining the whole technical solution of the present invention and the logical relationship between the steps.
In the description of the present invention, unless otherwise explicitly defined, terms such as set, etc. should be broadly construed, and those skilled in the art can reasonably determine the specific meanings of the above terms in the present invention in combination with the detailed contents of the technical solutions.
Fig. 1 is a flowchart illustrating a static scene occlusion processing method according to an embodiment of the present invention. The process comprises the following steps:
s100, dividing the static scene into a plurality of voxel grids according to the shielding processing request;
s200, carrying out pre-calculation processing of occlusion rejection on the voxel grids to obtain a potential visible set of each grid; the potential visible set comprises visibility information of all objects in the scene, wherein each object occupies a binary bit and describes visible information of the object in a corresponding grid.
And S300, detecting the voxel grid through a camera, and removing the invisible scene model object from a rendering queue through the potential visible set.
In some embodiments, the static scene is divided into voxel grids according to the set partition granularity, and pre-calculation processing of occlusion elimination is performed on each grid. This process should be done after the scene is completed, and a conservative Potentially Visible Set (PVS) of each trellis is generated by a random sampling method. And when the shielding and removing process occurs in operation, detecting the grid where the current camera is located according to the position of the current camera, and removing the invisible object from the rendering queue by applying the PVS of the grid.
FIG. 2 is a schematic diagram of a pre-calculation process according to an embodiment of the present invention. The method comprises the following steps:
s210, generating various types of rays, sampling and judging the visibility between the scene model object and the voxel grid in a ray casting mode;
s220, according to the sampling result, if any sampling ray collides with an object except the target object, directly marking the scene model object colliding with the ray as visible;
and S230, combining the potential visible sets of the adjacent voxel grids after the pre-calculation process is finished according to the similarity of the potential visible sets of any two adjacent voxel grids.
In some embodiments, during the pre-calculation stage, the invention determines the visibility between the scene object and the grid by means of ray casting, and generates the sampling ray by means of various ways. And the reliability of the result is ensured. The low-differentiation sequence is used for generating random sampling points which are uniformly distributed in a three-dimensional space in a normal process, so that the utilization rate of the sampling points is improved, and the comprehensive coverage of any number of sampling points on the whole space is ensured. In the process of confirming invisible objects, extra sampling rays are generated by adopting a random deflection and ray mutation strategy, the conservative degree of a calculation result is increased, and the probability of mistaken removal is reduced.
Furthermore, the invention utilizes the spatial consistency of the sampled rays in order to improve the utilization rate of the sampled rays. The description is as follows: if a sampled ray collides with an object other than the target object, the object colliding with the ray may be marked as visible directly, and the object of the potentially visible set of all the bins traversed by the ray may be marked as visible. Therefore, in the subsequent process, the grids can skip the detection process of the object, the calculation amount is reduced, and the efficiency of the pre-calculation process is improved.
Because the invention selects a calculation mode based on a sampling method in order to accelerate the calculation process, the calculation mode can generate a result of false rejection, namely, a visible object is judged to be invisible, thereby influencing the picture quality. In order to minimize the side effect, the invention utilizes the similarity of the potential visible sets of the adjacent grids, and after the pre-calculation process is finished, the potential visible sets of the voxel grids which are combined and adjacent are converged, so that the conservative degree of the result is improved, and the influence on the picture quality is reduced. In addition, the grids with the same potential visible set are subjected to merging operation, and the data volume of pre-calculation output is reduced.
FIG. 3 is a schematic flow chart of occlusion culling according to an embodiment of the invention. In the game running stage, the projection position of the camera is quickly calculated through the position of the camera, the grid with the minimum size is searched according to the height, and the corresponding potential visible set data is applied to eliminate scene objects.
In some embodiments, since in practice a game scene may be very large, the potential visible aggregate data band for the full scene it generates may be very large, increasing the stress on memory if loaded in its entirety. The planning stream type loading strategy is needed, only the needed or common data block is resident in the memory, and the rest data blocks are exchanged according to the strategy, so that the pressure of the memory is reduced.
Fig. 4a and 4b are schematic diagrams illustrating comparison between before and after static scene occlusion processing according to an embodiment of the present invention. FIG. 4a is a top view of a static scene in a full scene when no occlusion culling is performed, where the number of triangles at a certain view angle is 5.9M when no occlusion culling is performed on the static scene; FIG. 4b is a top view of a full scene of a scene after applying occlusion culling with a grid size of 15mx15M, wherein the number of triangles of the scene at the same viewing angle as that of FIG. 4a after applying occlusion culling with a grid size of 15mx15M is 2.7M, where M is million.
Fig. 5 shows a schematic view of an apparatus according to an embodiment of the invention. The device includes: the scene dividing module is used for dividing the static scene into a plurality of voxel grids according to the shielding processing request; the pre-calculation module is used for performing pre-calculation processing of occlusion rejection on the voxel grids to obtain a potential visible set of each grid; and the occlusion processing module is used for detecting the voxel grids through the camera and removing the invisible scene model object from the rendering queue through the potential visible set.
The embodiment of the invention also provides the electronic equipment, which comprises a processor and a memory;
the memory stores a program;
the processor executes a program to execute the static scene occlusion processing method; the electronic device has a function of loading and operating a software system for static scene occlusion processing provided by the embodiment of the present invention, for example, a Personal Computer (PC), a mobile phone, a smart phone, a Personal Digital Assistant (PDA), a wearable device, a pocket PC (ppc), a tablet PC, and the like.
An embodiment of the present invention further provides a computer-readable storage medium, where the storage medium stores a program, and the program is executed by a processor to implement the static scene occlusion processing method.
It should be recognized that the method steps in embodiments of the present invention may be embodied or carried out by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer readable memory. The method may use standard programming techniques. Each program may be implemented in a high level procedural or object oriented programming language to communicate with a computer system. However, the program(s) can be implemented in assembly or machine language, if desired. In any case, the language may be a compiled or interpreted language. Furthermore, the program can be run on a programmed application specific integrated circuit for this purpose.
Further, the operations of processes described herein can be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by context. The processes described herein (or variations and/or combinations thereof) may be performed under the control of one or more computer systems configured with executable instructions, and may be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) collectively executed on one or more processors, by hardware, or combinations thereof. The computer program includes a plurality of instructions executable by one or more processors.
Further, the method may be implemented in any type of computing platform operatively connected to a suitable interface, including but not limited to a personal computer, mini computer, mainframe, workstation, networked or distributed computing environment, separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, and the like. Aspects of the invention may be embodied in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, optically read and/or write storage medium, RAM, ROM, or the like, such that it may be read by a programmable computer, which when read by the storage medium or device, is operative to configure and operate the computer to perform the procedures described herein. Further, the machine-readable code, or portions thereof, may be transmitted over a wired or wireless network. The invention described herein includes these and other different types of non-transitory computer-readable storage media when such media include instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor. The invention also includes the computer itself when programmed according to the methods and techniques described herein.
A computer program can be applied to input data to perform the functions described herein to transform the input data to generate output data that is stored to non-volatile memory. The output information may also be applied to one or more output devices, such as consumers. In a preferred embodiment of the present invention, the transformed data represents physical and tangible objects, including particular visual depictions of physical and tangible objects produced on the consumer.
The embodiments of the present invention have been described in detail with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge of those skilled in the art without departing from the gist of the present invention.

Claims (10)

1. A static scene occlusion processing method is characterized by comprising the following steps:
dividing the static scene into a plurality of voxel grids according to the shielding processing request;
carrying out pre-calculation processing of occlusion rejection on the voxel grids to obtain a potential visible set of each grid;
and performing detection on the voxel grid through a camera, and removing invisible scene model objects from a rendering queue through the potential visible set.
2. The static scene occlusion processing method of claim 1, wherein the pre-computation processing comprises:
and generating various types of rays, sampling and judging the visibility between the scene model object and the voxel grid in a ray casting mode.
3. The static scene occlusion processing method of claim 2, wherein the sampling comprises:
if the visibility of the scene model object is judged, generating uniformly distributed random sampling rays in a three-dimensional space by using a low-differentiation sequence;
and if the invisible scene model object is confirmed, generating additional sampling rays on the original rays by adopting the strategies of random deflection and ray mutation.
4. The static scene occlusion processing method of claim 3, further comprising:
according to the sampling result, if any sampling ray collides with an object except the target object, the scene model object colliding with the ray can be directly marked as visible, and the object of the potential visible set of all the voxel grids passed by the ray in the middle can be marked as visible.
5. The static scene occlusion processing method of claim 1, wherein the pre-computing process of occlusion culling on the voxel grid to obtain the potentially visible set of each grid further comprises:
merging the potentially visible sets of the adjacent voxel grids after the pre-calculation process is finished according to the similarity of the potentially visible sets of any two adjacent voxel grids.
6. The static scene occlusion processing method of claim 1, wherein the performing, by the camera, the detection of the voxel grid, the culling of the invisible scene model object from the rendering queue through the set of potential visualizations comprises:
according to the spatial position of the camera, the method comprises the steps of positioning to a grid data structure which is located in a two-dimensional top view and comprises a list of the voxel grids, determining the voxel grid with the smallest granularity and comprising the spatial position of the camera according to the height of the camera, obtaining potential visible set data corresponding to the voxel grid, and removing objects in a rendering queue.
7. The static scene occlusion processing method of claim 1, further comprising:
and adopting a stream type loading strategy when planning the scene shielding processing of the static scene, wherein the stream type loading strategy is resident in a memory for the common data block of the static scene, and executes the swap-in and swap-out processing for the map data of the resident memory according to a using strategy.
8. A static scene occlusion processing device, comprising:
the scene dividing module is used for dividing the static scene into a plurality of voxel grids according to the shielding processing request;
the pre-calculation module is used for performing pre-calculation processing of occlusion rejection on the voxel grids to obtain a potential visible set of each grid;
and the occlusion processing module is used for detecting the voxel grid through a camera and removing the invisible scene model object from the rendering queue through the potential visible set.
9. An electronic device comprising a processor and a memory;
the memory is used for storing programs;
the processor executes the program to implement the static scene occlusion processing method of any of claims 1-7.
10. A computer-readable storage medium, characterized in that the storage medium stores a program which is executed by a processor to implement the static scene occlusion processing method of any of claims 1-7.
CN202111659543.0A 2021-12-30 2021-12-30 Static scene occlusion processing method and device, electronic equipment and readable medium Pending CN114418829A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111659543.0A CN114418829A (en) 2021-12-30 2021-12-30 Static scene occlusion processing method and device, electronic equipment and readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111659543.0A CN114418829A (en) 2021-12-30 2021-12-30 Static scene occlusion processing method and device, electronic equipment and readable medium

Publications (1)

Publication Number Publication Date
CN114418829A true CN114418829A (en) 2022-04-29

Family

ID=81270023

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111659543.0A Pending CN114418829A (en) 2021-12-30 2021-12-30 Static scene occlusion processing method and device, electronic equipment and readable medium

Country Status (1)

Country Link
CN (1) CN114418829A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115591242A (en) * 2022-09-29 2023-01-13 深圳市手心游戏科技有限公司(Cn) Game map loading method and device and computer equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115591242A (en) * 2022-09-29 2023-01-13 深圳市手心游戏科技有限公司(Cn) Game map loading method and device and computer equipment
CN115591242B (en) * 2022-09-29 2023-10-03 深圳市手心游戏科技有限公司 Game map loading method and device and computer equipment

Similar Documents

Publication Publication Date Title
CN110136082B (en) Occlusion rejection method and device and computer equipment
JP7146091B2 (en) Information embedding method in video, computer equipment and computer program
US10176627B2 (en) Tree-based graphics primitive rendering
EP3333805B1 (en) Removing or identifying overlapping fragments after z-culling
US10748332B2 (en) Hybrid frustum traced shadows systems and methods
CN112669463B (en) Method for reconstructing curved surface of three-dimensional point cloud, computer device and computer-readable storage medium
CN110490963B (en) 3D graphics rendering with implicit geometry
CN111921202B (en) Data processing method, device and equipment for virtual scene and readable storage medium
CN113791914B (en) Object processing method, device, computer equipment, storage medium and product
CN110990516A (en) Map data processing method and device and server
CN114529658A (en) Graph rendering method and related equipment thereof
CN109377552B (en) Image occlusion calculating method, device, calculating equipment and storage medium
CN114418829A (en) Static scene occlusion processing method and device, electronic equipment and readable medium
US20200098169A1 (en) Method and system for depth pre-processing and geometry sorting using binning hardware
US9595133B2 (en) Information processing apparatus, control method, and storage medium for defining tiles with limited numbers of fragments
CN111597845A (en) Two-dimensional code detection method, device and equipment and readable storage medium
CN117237502A (en) Three-dimensional rendering method, device, equipment and medium
CN108470368B (en) Method and device for determining rendering object in virtual scene and electronic equipment
CN111340790A (en) Bounding box determination method and device, computer equipment and storage medium
KR102638038B1 (en) Apparatus and method for denoising based on non-local mean
CN108664284B (en) Method for displaying scene based on multi-detail level technology and storage medium
CN114596195A (en) Topographic data processing method, system, device and computer storage medium
CN110384926B (en) Position determining method and device
CN114627221B (en) Scene rendering method and device, operator and readable storage medium
CN114007134B (en) Video processing method, device, electronic equipment and storage medium

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