CN110738719A - Web3D model rendering method based on visual range hierarchical optimization - Google Patents

Web3D model rendering method based on visual range hierarchical optimization Download PDF

Info

Publication number
CN110738719A
CN110738719A CN201910924078.5A CN201910924078A CN110738719A CN 110738719 A CN110738719 A CN 110738719A CN 201910924078 A CN201910924078 A CN 201910924078A CN 110738719 A CN110738719 A CN 110738719A
Authority
CN
China
Prior art keywords
space
rendering
units
cell
unit
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
CN201910924078.5A
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.)
Hangzhou Normal University
Original Assignee
Hangzhou Normal University
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 Hangzhou Normal University filed Critical Hangzhou Normal University
Priority to CN201910924078.5A priority Critical patent/CN110738719A/en
Publication of CN110738719A publication Critical patent/CN110738719A/en
Pending legal-status Critical Current

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
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/005Tree description, e.g. octree, quadtree

Landscapes

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

Abstract

The invention discloses an Web3D model rendering method based on visual range hierarchical optimization, which comprises a preprocessing stage, a visibility calculation stage, a working stage and a running stage, wherein the preprocessing stage comprises the steps of (1) generating series space units for a three-dimensional model, ensuring that each block edge of the three-dimensional model is surrounded in the space unit, (2) carrying out visibility calculation on each space units from different viewpoints, recording the visibility of each space unit at different viewpoints, eliminating invisible space units, (3) distributing random numbers for each space unit which is not eliminated, sequencing and storing according to the numbers as key values, and the running stage comprises the steps of (4) dynamically calculating the detail level factors of each space unit along with the change of the viewpoints, and (5) dynamically determining the necessary space units of the current detail level model according to the detail level factors, forming a triangular sequence by the necessary space units and finally sending the triangular sequence to a rendering pipeline for rendering.

Description

Web3D model rendering method based on visual range hierarchical optimization
Technical Field
The invention relates to the technical field of visualization, in particular to Web3D model rendering methods based on visual range hierarchical optimization.
Background
Three-dimensional (3D) graphics are increasingly used more widely because they represent the world more realistically and intuitively than two-dimensional graphics, and are more easily perceived and accepted by humans, however, rendering three-dimensional graphics requires computers with greater rendering capabilities, especially on the Web side, which is very challenging for large three-dimensional graphics since only CPU resources have been called for rendering in the past.
With the rapid development of related technologies such as computer hardware, computer graphics and the like and the appearance of WebGL, at present, a browser can directly call GPU resources to render, so that rapid rendering of a complex three-dimensional model at the browser end is possible. However, with the rapid increase of the volume of the three-dimensional model, the rendering frame rate of the browser is reduced, and an excessively low frame rate may weaken the real-time interaction of the product, and may even bring a bad experience to the user. Therefore, in order to improve the rendering speed and quality of the browser end for the large-volume model, the rendering of the large-volume model needs to be optimized, and the rendering efficiency is improved on the premise of ensuring the model accuracy.
For example, the concepts of tile structures and detail levels commonly used in map products are very close, namely, according to the scaling condition of the map, the concepts of BVH (bounding volume hierarchy), BSPtree (binary space partitioning tree), Quadtree (quad tree), Octree (Octree) and k-d tree are used as scene partitioning modes frequently used by developers, and the visibility rejection is based on the assumption that invisible geometry and triangles inevitably exist in the large model scene, so that the complexity of the model rendering is reduced, and the consumption of the model rendering is reduced.
Disclosure of Invention
Aiming at the defects in the field and the technical problem of low frame rate of rendering a large-volume model by a browser, the invention provides Web3D model rendering methods based on visual range hierarchical optimization, which can be applied to the fields with 3D visualization requirements, such as intelligent buildings, data centers, health care and the like.
A Web3D model rendering method based on visual range hierarchical optimization comprises the following steps:
a pretreatment stage:
(1) generating series of space cells for the three-dimensional model, ensuring that each edges of the three-dimensional model are enclosed in a space cell;
(2) performing visibility calculation on each space units from different viewpoints, recording the visibility of each space unit at different viewpoints, and removing invisible space units;
(3) distributing random numbers for each space unit which is not removed, and sorting and storing the random numbers as key values;
and (3) an operation stage:
(4) dynamically calculating a level of detail factor for each spatial cell as the viewpoint changes;
(5) and dynamically determining the necessary spatial units of the current detail level model according to the detail level factors, forming the necessary spatial units into a triangular sequence, and finally sending the triangular sequence to a rendering pipeline for rendering.
Preferably, the specific steps of step (1) are:
(1-1) generating an enclosing body of the whole three-dimensional model, namely space units;
(1-2) dividing space units into two subspace units and serving as parent nodes of the two subspace unit nodes;
(1-3) carrying out n times of space division according to the division method in the step (1-2), and finally constructing a recursive included directional bounding box tree by all nodes, wherein the depth of the constructed directional bounding box tree is n, and the number of leaves is 2nI.e. finally dividing the three-dimensional model into 2nA subspace element.
And (3) using the directional bounding box tree to assist in generating the spatial unit, and obtaining spatial unit sets with different fine granularities by giving different depth values. The more spatial cells are generated, the better the visibility calculation effect of step (2) can be made. The present invention divides the three-dimensional model into 128 (the 7 th power of 2) spatial units, i.e., given a depth of n-7. That is, the direction bounding box tree has 128 bottommost leaves, which is 7 in depth.
Preferably, the specific steps of step (2) are:
(2-1) uniformly distributing m cameras around the three-dimensional model as m viewpoints, and sampling the overall shape of the three-dimensional model;
(2-2) performing the visibility calculation by calling a function getVis (cell, camera id), wherein the cell represents any space cells, and the camera id represents any cameras or viewpoints, the function returning the visibility of the specified cameras to the specified space cells;
(2-3) performing visibility calculation for each pairs of camera and spatial cell combination one by one;
and (2-4) eliminating the spatial unit with the visibility of 0.
Visibility determines how many features are visible in a particular spatial cell from a given viewpoint. The calculation formula is as follows:
Figure BDA0002218400280000031
for each viewpoint camera ID, the features in the spatial cell are rendered four times, wherein rendering is used for setting a depth buffer, the second rendering is used for obtaining the visible pixel number and is recorded as totalPixels, the third rendering is used for rendering all the spatial cells and filling the depth buffer, and finally rendering is used for rendering the current spatial cell again to calculate the pixel number passing the depth test, namely the pixel number not blocked visPixes.
In the present invention, m may be 16.
Preferably, the step (3) comprises the following specific steps:
(3-1) assigning random numbers to each space units which are not removed, and assigning the assigned random numbers as key values of the space units;
and (3-2) performing binary sorting on all the space units according to the key values and then storing the space units.
Preferably, the specific steps of step (4) are:
(4-1) dynamically acquiring the visibilities of any groups of viewpoints and space units acquired in the preprocessing stage, and recording the visibilities as Vis (cell);
(4-2) respectively calculating a detail level factor of each space unit according to Vis (cell) and the distance from the viewpoint to each space units, and recording the detail level factor as factor (lod);
and (4-3) storing the factor (lod) of each space unit in a cache of the video memory.
Preferably, the specific steps of step (5) are:
(5-1) according to the ordered spatial unit sequence obtained in the preprocessing stage, calculating to obtain a least necessary spatial unit to represent the current detail level model, and marking the least necessary spatial unit as Ncell×Factor(lod);
(5-2) generating a triangle sequence of necessary space units in parallel by using the parallel capability of the GPU;
and (5-3) sending the triangle sequence to a rendering pipeline for rendering.
In step (5-1), NcellThe characteristic number of each space unit is represented, and the first N randomly ordered space units can be selected because the randomness of the space units is ensured in the preprocessing stagecellX factor (lod) features represent the least necessary spatial units under the current viewpoint.
Compared with the prior art, the invention has the main advantages that: according to the invention, by adopting the sight distance layered optimization method, unnecessary space units are removed, and under the condition of not influencing user experience, the complexity of the model is simplified, the transmission flow of the model can be reduced, and the loading efficiency is improved.
Drawings
FIG. 1 is a schematic view of a view distance hierarchical optimization algorithm of the present invention;
FIG. 2 is a schematic diagram of assisted generation of a set of spatial cells using a directional bounding box tree;
FIG. 3 is a schematic diagram of computing the visibility of spatial cells from different viewpoints;
FIG. 4 is a diagram illustrating a hierarchical comparison of details of a three-dimensional model after the optimization process according to an embodiment.
Detailed Description
the invention is further described with reference to the accompanying drawings and specific examples, it being understood that these examples are intended to illustrate the invention only and are not intended to limit the scope of the invention.
The flow of the sight distance layered optimization algorithm of the invention is shown in figure 1 and is divided into a preprocessing stage and an operation stage. The preprocessing stage comprises generation of space units, visibility calculation and random leaf sorting; the run phase includes LOD (level of Detail) selection and generation of triangle sequences.
The embodiment specifically illustrates the above Web3D model rendering method based on the line-of-sight hierarchical optimization, which includes:
a pretreatment stage:
(1) as shown in fig. 2, series of spatial cells are generated for the three-dimensional model, and each edges of the three-dimensional model are ensured to be enclosed in the spatial cells, which includes the following steps:
(1-1) generating an enclosing body of the whole three-dimensional model, namely space units;
(1-2) dividing space units into two subspace units and serving as parent nodes of the two subspace unit nodes;
(1-3) performing space division for 7 times according to the division method in the step (1-2), and finally constructing a recursive directional bounding box tree by all nodes, wherein the depth of the constructed directional bounding box tree is 7, and the number of leaves is 128, namely, the three-dimensional model is finally divided into 128 subspace units.
(2) As shown in fig. 3, performing visibility calculation on spatial units from different viewpoints, recording the visibility of each spatial unit at different viewpoints, and removing invisible spatial units, specifically including the steps of:
(2-1) uniformly distributing 16 cameras around the three-dimensional model as 16 viewpoints, and sampling the overall shape of the three-dimensional model;
(2-2) performing the visibility calculation by calling a function getVis (cell, camera id), wherein the cell represents any space cells, and the camera id represents any cameras or viewpoints, the function returning the visibility of the specified cameras to the specified space cells;
getVis (cell, camera ID) function calculation formula is as follows:
Figure BDA0002218400280000051
for each viewpoint camera ID, the features in the spatial cell are rendered four times, wherein rendering is used for setting a depth buffer, the second rendering is used for obtaining the visible pixel number and is recorded as totalPixels, the third rendering is used for rendering all the spatial cells and filling the depth buffer, and finally rendering is used for rendering the current spatial cell again to calculate the pixel number passing the depth test, namely the pixel number not blocked visPixes.
(2-3) performing visibility calculation for each pairs of camera and spatial cell combination one by one;
and (2-4) eliminating the spatial unit with the visibility of 0.
(3) Distributing random numbers for each space unit which is not removed, and sorting and storing the random numbers as key values, wherein the specific steps are as follows:
(3-1) assigning random numbers to each space units which are not removed, and assigning the assigned random numbers as key values of the space units;
and (3-2) performing binary sorting on all the space units according to the key values and then storing the space units.
And (3) an operation stage:
(4) with the change of the viewpoint, dynamically calculating the detail level factor of each spatial unit, and the specific steps are as follows:
(4-1) dynamically acquiring the visibilities of any groups of viewpoints and space units acquired in the preprocessing stage, and recording the visibilities as Vis (cell);
(4-2) respectively calculating a detail level factor of each space unit according to Vis (cell) and the distance from the viewpoint to each space units, and recording the detail level factor as factor (lod);
and (4-3) storing the factor (lod) of each space unit in a cache of the video memory.
(5) Dynamically determining the necessary spatial units of the current detail level model according to the detail level factors, forming the necessary spatial units into a triangular sequence, and finally sending the triangular sequence to a rendering pipeline for rendering, wherein the method comprises the following specific steps:
(5-1) according to the ordered spatial unit sequence obtained in the preprocessing stage, calculating to obtain a least necessary spatial unit to represent the current detail level model, and marking the least necessary spatial unit as Ncell×Factor(lod);NcellThe characteristic number of each space unit is represented, and the first N randomly ordered space units can be selected because the randomness of the space units is ensured in the preprocessing stagecellX factor (lod) features represent the least necessary spatial units under the current viewpoint.
(5-2) generating a triangle sequence of necessary space units in parallel by using the parallel capability of the GPU;
and (5-3) sending the triangle sequence to a rendering pipeline for rendering.
The effect of the model after the operation of the view-distance hierarchical optimization algorithm according to the present embodiment is as shown in fig. 4, the smaller the number of pixels visible in the spatial unit farther from the viewpoint.
Furthermore, it should be understood that various changes and modifications can be made by one skilled in the art after reading the above description of the present invention, and equivalents also fall within the scope of the invention as defined by the appended claims.

Claims (6)

1, Web3D model rendering method based on visual range hierarchical optimization, characterized by comprising:
a pretreatment stage:
(1) generating series of space cells for the three-dimensional model, ensuring that each edges of the three-dimensional model are enclosed in a space cell;
(2) performing visibility calculation on each space units from different viewpoints, recording the visibility of each space unit at different viewpoints, and removing invisible space units;
(3) distributing random numbers for each space unit which is not removed, and sorting and storing the random numbers as key values;
and (3) an operation stage:
(4) dynamically calculating a level of detail factor for each spatial cell as the viewpoint changes;
(5) and dynamically determining the necessary spatial units of the current detail level model according to the detail level factors, forming the necessary spatial units into a triangular sequence, and finally sending the triangular sequence to a rendering pipeline for rendering.
2. The method for rendering the Web3D model based on the line-of-sight hierarchical optimization according to claim 1, wherein the step (1) comprises the following specific steps:
(1-1) generating an enclosing body of the whole three-dimensional model, namely space units;
(1-2) dividing space units into two subspace units and serving as parent nodes of the two subspace unit nodes;
(1-3) carrying out n times of space division according to the division method in the step (1-2), and finally constructing a recursive included directional bounding box tree by all nodes, wherein the depth of the constructed directional bounding box tree is n, and the number of leaves is 2nI.e. finally dividing the three-dimensional model into 2nA subspace element.
3. The method for rendering the Web3D model based on the line-of-sight hierarchical optimization according to claim 1, wherein the step (2) comprises the following specific steps:
(2-1) uniformly distributing m cameras around the three-dimensional model as m viewpoints, and sampling the overall shape of the three-dimensional model;
(2-2) performing the visibility calculation by calling a function getVis (cell, camera id), wherein the cell represents any space cells, and the camera id represents any cameras or viewpoints, the function returning the visibility of the specified cameras to the specified space cells;
(2-3) performing visibility calculation for each pairs of camera and spatial cell combination one by one;
and (2-4) eliminating the spatial unit with the visibility of 0.
4. The method for rendering the Web3D model based on the line-of-sight hierarchical optimization according to claim 1, wherein the step (3) comprises the following steps:
(3-1) assigning random numbers to each space units which are not removed, and assigning the assigned random numbers as key values of the space units;
and (3-2) performing binary sorting on all the space units according to the key values and then storing the space units.
5. The method for rendering the Web3D model based on the line-of-sight hierarchical optimization according to claim 1, wherein the step (4) comprises the following steps:
(4-1) dynamically acquiring the visibilities of any groups of viewpoints and space units acquired in the preprocessing stage, and recording the visibilities as Vis (cell);
(4-2) respectively calculating a detail level factor of each space unit according to Vis (cell) and the distance from the viewpoint to each space units, and recording the detail level factor as factor (lod);
and (4-3) storing the factor (lod) of each space unit in a cache of the video memory.
6. The method for rendering the Web3D model based on the line-of-sight hierarchical optimization according to claim 1, wherein the step (5) comprises the following steps:
(5-1) according to the ordered spatial unit sequence obtained in the preprocessing stage, calculating to obtain a least necessary spatial unit to represent the current detail level model, and marking the least necessary spatial unit as Ncell×Factor(lod);
(5-2) generating a triangle sequence of necessary space units in parallel by using the parallel capability of the GPU;
and (5-3) sending the triangle sequence to a rendering pipeline for rendering.
CN201910924078.5A 2019-09-27 2019-09-27 Web3D model rendering method based on visual range hierarchical optimization Pending CN110738719A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910924078.5A CN110738719A (en) 2019-09-27 2019-09-27 Web3D model rendering method based on visual range hierarchical optimization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910924078.5A CN110738719A (en) 2019-09-27 2019-09-27 Web3D model rendering method based on visual range hierarchical optimization

Publications (1)

Publication Number Publication Date
CN110738719A true CN110738719A (en) 2020-01-31

Family

ID=69269755

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910924078.5A Pending CN110738719A (en) 2019-09-27 2019-09-27 Web3D model rendering method based on visual range hierarchical optimization

Country Status (1)

Country Link
CN (1) CN110738719A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111354067A (en) * 2020-03-02 2020-06-30 成都偶邦智能科技有限公司 Multi-model same-screen rendering method based on Unity3D engine

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6747651B1 (en) * 1998-07-18 2004-06-08 National University Of Singapore System and method for creating bounding volume hierarchies utilizing model simplification
CN104867174A (en) * 2015-05-08 2015-08-26 腾讯科技(深圳)有限公司 Three-dimensional map rendering and display method and system
CN107886564A (en) * 2017-10-13 2018-04-06 上海秉匠信息科技有限公司 The method shown for realizing three-dimensional scenic

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6747651B1 (en) * 1998-07-18 2004-06-08 National University Of Singapore System and method for creating bounding volume hierarchies utilizing model simplification
CN104867174A (en) * 2015-05-08 2015-08-26 腾讯科技(深圳)有限公司 Three-dimensional map rendering and display method and system
CN107886564A (en) * 2017-10-13 2018-04-06 上海秉匠信息科技有限公司 The method shown for realizing three-dimensional scenic

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
吴香太: "基于GPU的大规模复杂场景渲染的优化算法研究与实现" *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111354067A (en) * 2020-03-02 2020-06-30 成都偶邦智能科技有限公司 Multi-model same-screen rendering method based on Unity3D engine

Similar Documents

Publication Publication Date Title
US11734879B2 (en) Graphics processing using directional representations of lighting at probe positions within a scene
CN110738721B (en) Three-dimensional scene rendering acceleration method and system based on video geometric analysis
US8570322B2 (en) Method, system, and computer program product for efficient ray tracing of micropolygon geometry
US10553013B2 (en) Systems and methods for reducing rendering latency
US10529117B2 (en) Systems and methods for rendering optical distortion effects
US8368714B2 (en) Curved surface rendering system and method
US8743114B2 (en) Methods and systems to determine conservative view cell occlusion
US10699467B2 (en) Computer-graphics based on hierarchical ray casting
US10553012B2 (en) Systems and methods for rendering foveated effects
US9978176B2 (en) Simplifying small mesh components with redundant backs
CN113034657B (en) Rendering method, device and equipment for illumination information in game scene
Vyatkin Method of binary search for image elements of functionally defined objects using graphics processing units
Scholz et al. Real‐time isosurface extraction with view‐dependent level of detail and applications
CN110738719A (en) Web3D model rendering method based on visual range hierarchical optimization
Scholz et al. Level of Detail for Real-Time Volumetric Terrain Rendering.
Lee et al. A bimodal empty space skipping of ray casting for terrain data
KR101281156B1 (en) Ray tracing core and processing mehtod for ray tracing
CA2515017A1 (en) Visual simulation of dynamic moving bodies
Lau An efficient low-cost antialiasing method based on adaptive postfiltering
Blåwiik Fusing Stereo Measurements into a Global 3D Representation
Ahokas Shadow Maps
CN117911659A (en) Construction method and system of visual association scene graph oriented to industrial meta universe
Cunha et al. Revisiting the visibility problem with a hybrid structure paradigm
CN117034679A (en) Method and device for converting square block into physical model and computer storage medium
JP2019114261A (en) Visibility function of three-dimensional scene

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200131

RJ01 Rejection of invention patent application after publication