Virtual reality ancient building rendering display method and device
Through component-level material binding and GPU parallel processing of the hierarchical clipping algorithm, the problems of spatial division efficiency and loss of local geometric features in ancient building rendering are solved, achieving efficient and accurate ancient building rendering effects and supporting real-time rendering of scenes with millions of triangles.
Patent Information
- Application Number
- CN202510528700.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-09-12
AI Technical Summary
Existing rendering technology has problems in ancient building models, such as insufficient spatial division efficiency, imbalance between dynamic cropping accuracy and performance, and loss of local geometric features. It is especially difficult to achieve efficient and accurate rendering effects in complex ancient building scenes.
It adopts component-level material binding, GPU parallel processing and hierarchical clipping algorithm, generates a tree-like hierarchical structure, node local convex hull and bounding sphere for coarse and fine clipping, combines frustum clipping, obtains the final visible primitive list, and performs rasterization and shading.
It achieves differentiated presentation of ancient building materials, accurately reproduces historical details, improves rendering efficiency and accuracy, supports real-time rendering of scenes with millions of triangles, and increases processing speed by 120 times.
Smart Images

Figure CN120635369A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of rendering technology, and in particular to a virtual reality ancient building rendering display method and a virtual reality ancient building rendering display device. Background Art
[0002] In the field of architectural rendering, existing rendering technologies typically use primitive optimization methods based on view frustum culling to improve rendering efficiency. Traditional solutions typically perform preliminary screening by constructing axis-aligned bounding boxes (AABBs), then combine this with view frustum culling to eliminate invisible primitives. However, this approach has the following drawbacks: (1) Inefficient space division: Existing technologies often use single-level bounding boxes or uniform meshes, which are difficult to adapt to the complex geometric structures of ancient architectural models. For example, when model vertices span multiple meshes, vertex data must be copied to achieve distribution, resulting in memory redundancy and increased computational effort.
[0003] (2) Imbalance between dynamic cropping accuracy and performance Traditional frustum culling algorithms rely on CPU serial computation, traversing large scenes element by element, and fail to fully utilize GPU parallel computing resources. While some solutions attempt to introduce bounding spheres for coarse culling, the lack of a hierarchical, fine-grained culling mechanism leads to over-culling or residual invisible elements in complex scenes of ancient buildings.
[0004] (3) Loss of local geometric features Ancient architectural models contain intricate carvings, hollows, and other local structures. Existing methods, such as global bounding boxes or uniform convex hulls, struggle to accurately represent these local geometric features. When the view frustum only partially intersects the model, traditional clipping algorithms can incorrectly remove key details, resulting in holes or distortion in the rendered image. Summary of the Invention
[0005] The purpose of the present invention is to provide a virtual reality ancient building rendering display method to solve at least one of the above technical problems.
[0006] One aspect of the present invention provides a virtual reality ancient building rendering and display method, the virtual reality ancient building rendering and display method comprising: Load the model to be rendered and bind the materials of each component of the model to be rendered; Configure light source information and environment information; Perform coordinate transformation on each component of the model to be rendered, and transform each component of the model to be rendered into the world coordinate system; Generate the primitive information of each component of the model to be rendered in the world coordinate system; Get the view frustum information; According to the view frustum information, the primitive information of each component of the model to be rendered is clipped in the world coordinate system to obtain the final visible primitive list; Perform rasterization on the retained primitive information, thereby obtaining each rasterized primitive information and placing it in the geometric attribute buffer; Obtain the brightness and darkness distribution information and RGB color information of each primitive; The primitive information in the corresponding geometric attribute buffer is shaded according to the acquired light and dark distribution information and RGB color information, thereby obtaining a preliminary rendered image.
[0007] Optionally, clipping the primitive information of each component of the model to be rendered in the world coordinate system according to the view frustum information to obtain the final visible primitive list includes: Get the coordinates of each vertex of the model to be rendered; Calculate the minimum x-axis value, the minimum y-axis value, the minimum z-axis value, the maximum x-axis value, the maximum y-axis value, and the maximum z-axis value of each vertex coordinate in the world coordinate system respectively; the minimum x-axis value, the minimum y-axis value, the minimum z-axis value, the maximum x-axis value, the maximum y-axis value, and the maximum z-axis value of each vertex form a bounding box aligned with the coordinate axes in the world coordinate system; Based on the bounding box information, the primitive information of each component of the model to be rendered is clipped in the world coordinate system to obtain a final visible primitive list.
[0008] Optionally, clipping the primitive information of each component of the model to be rendered in the world coordinate system based on the bounding box information to obtain a final visible primitive list includes: Dividing the obtained bounding box to generate a tree-like hierarchical structure, wherein the tree-like hierarchical structure includes a plurality of child nodes; Generate a node local convex hull for each node in the tree hierarchy; Generate a bounding sphere for each node in the tree hierarchy; Performing rough clipping of the primitive information of each component of the model to be rendered according to the bounding sphere range by GPU parallel processing; The primitive information of each component of the model to be rendered after the rough clipping is finely clipped using the local convex hull of the node in a GPU parallel processing manner to form a final visible primitive list.
[0009] Optionally, the obtained bounding box is divided to generate a tree-like hierarchical structure, where the tree-like hierarchical structure includes a plurality of child nodes including: Use the bounding box as the root node of the tree structure; Set the volume threshold of the bounding box; The bounding box is divided by dynamic partitioning to form multiple sub-bounding boxes, and each sub-bounding box is used as a child node; The following judgments are made for the model vertices at each position: When the coordinates of each vertex of any model are completely within a sub-bounding box, the vertices of the model are allocated to the sub-bounding box; When the vertices of any model are located in different sub-bounding boxes, they are allocated using the copy allocation strategy.
[0010] Optionally, generating a local convex hull of each node in the tree-like hierarchical structure includes: Perform the following operations for each node: Get the coordinates of each vertex of each model belonging to this node; An incremental convex hull algorithm is performed on each vertex of each obtained model to generate a local convex hull of the node.
[0011] Optionally, performing an incremental convex hull algorithm on each vertex of each acquired model to generate a local convex hull of the node includes: The coordinates of each vertex of each model in the node are obtained by taking any point in any axis of the world coordinate system as the initial point, and sorting them from near to far from the point, thereby obtaining a vertex coordinate sequence; Select the first three vertex coordinates in the sequence to construct an initial convex hull of a triangle; The remaining vertex coordinates in the vertex coordinate sequence are divided according to the initial convex hull to form a local convex hull of the node.
[0012] Optionally, dividing the remaining vertex coordinates in the vertex coordinate sequence according to the initial convex hull to form a local convex hull of the node includes: Perform the following operations on each of the remaining vertex coordinates in the vertex coordinate sequence in an iterative manner: Step A: Use the cross product method to determine the relationship between the vertex and each edge of the initial convex hull, and determine whether the vertex is in the initial convex hull based on the obtained relationship. If not, then Step B: updating the initial convex hull according to the vertex coordinates to form a new local convex hull, and in subsequent iterations, using the new local convex hull to determine the relationship with the next vertex; Repeat step A and step B until all vertex coordinates in the vertex coordinate sequence are judged, and the local convex hull finally obtained is the local convex hull of the node.
[0013] Optionally, generating a bounding sphere for each node in the tree-like hierarchical structure includes: Perform the following processing for each node: Collect the vertex coordinates of all geometries in the node; Calculate the average value of all vertex coordinates as the center point of the bounding sphere; Find the maximum distance from the center of the bounding sphere to all vertices as the bounding sphere radius.
[0014] Optionally, the view cone information includes a camera view matrix, a projection matrix, and scene parameters; The step of roughly clipping the primitive information of each component of the model to be rendered according to the bounding sphere range by using the GPU parallel processing includes: The following parallel processing is performed on each node: For each node's bounding sphere, calculate the distance from its center to each plane of the viewing cone; Obtaining viewing frustum information according to the camera view matrix, projection matrix, and scene parameters; The bounding sphere of each node is clipped according to the frustum information. The visibility of the bounding sphere is determined based on the positional relationship between the bounding sphere and the frustum plane. If it is not visible, the node where the bounding sphere is located is eliminated; if it is visible, the node where the bounding sphere is located is retained.
[0015] Optionally, the step of performing fine clipping on the primitive information of each component of the model to be rendered after rough clipping by using the local convex hull of the node in a GPU parallel processing manner to form a final visible primitive list includes: For each node retained after coarse pruning, the following parallel processing is performed: Project the vertices of the node local convex hull of the node to the viewing frustum plane; According to the separating axis theorem, the intersection relationship between the convex hull and the viewing cone is determined. If they do not intersect, it means that the local convex hull of the node is invisible, and the node corresponding to the local convex hull of the node is eliminated. If they intersect, the node where the local convex hull of the node is located is retained.
[0016] The present application also provides a virtual reality ancient building rendering display device, which includes: A model preprocessing module, which is used to load the model to be rendered and perform material binding on various components of the model to be rendered; A light source and environment configuration module, which is used to configure light source information and environment information; A coordinate transformation module, wherein the coordinate transformation module is used to perform coordinate transformation on each component of the model to be rendered, and transform each component of the model to be rendered into a world coordinate system; A graphic element information acquisition module, the graphic element information acquisition module is used to generate graphic element information of each component of the model to be rendered in the world coordinate system; A visual cone information acquisition module, wherein the visual cone information acquisition module is used to acquire visual cone information; A visible primitive list acquisition module is used to clip primitive information of each component of the model to be rendered in the world coordinate system according to the view cone information to obtain a final visible primitive list; A rasterization module, the rasterization module is used to perform rasterization processing on the retained primitive information, thereby obtaining each rasterized primitive information and placing it in a geometric attribute buffer; RGB information acquisition module, the RGB information acquisition module is used to obtain the light and dark distribution information and RGB color information of each primitive information; The preliminary rendering module is used to perform coloring processing on the primitive information in the corresponding geometric attribute buffer according to the acquired light and dark distribution information and RGB color information, thereby obtaining a preliminary rendering completed picture.
[0017] Beneficial effects:
[0018] The virtual reality ancient building rendering and display method of this application achieves differentiated presentation of materials such as wooden structures, bricks and tiles, and painted paintings of ancient buildings through component-level material binding. It can accurately reproduce historical details such as the gloss refraction of glazed tiles and the moss erosion marks on blue bricks, with material fidelity reaching sub-millimeter level. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 This is a flowchart of a virtual reality ancient building rendering and display method according to an embodiment of the present application. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solutions and advantages of the implementation of this application clearer, the technical solutions in the embodiments of this application will be described in more detail below in conjunction with the drawings in the embodiments of this application. In the drawings, the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions. The described embodiments are part of the embodiments of this application, not all of the embodiments. The embodiments described below with reference to the drawings are exemplary and are intended to be used to explain this application, and should not be understood as limitations on this application. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application. The embodiments of this application are described in detail below in conjunction with the drawings.
[0021] like Figure 1 The virtual reality ancient building rendering display method shown includes: Load the model to be rendered and bind the materials of each component of the model to be rendered; Configure light source information and environment information; Perform coordinate transformation on each component of the model to be rendered, and transform each component of the model to be rendered into the world coordinate system; Generate the primitive information of each component of the model to be rendered in the world coordinate system; Get the view frustum information; According to the view frustum information, the primitive information of each component of the model to be rendered is clipped in the world coordinate system to obtain the final visible primitive list; Perform rasterization on the retained primitive information, thereby obtaining each rasterized primitive information and placing it in the geometric attribute buffer; Obtain the brightness and darkness distribution information and RGB color information of each primitive; The primitive information in the corresponding geometric attribute buffer is shaded according to the acquired light and dark distribution information and RGB color information, thereby obtaining a preliminary rendered image.
[0022] The virtual reality ancient building rendering and display method of this application achieves differentiated presentation of materials such as wooden structures, bricks and tiles, and painted paintings of ancient buildings through component-level material binding. It can accurately reproduce historical details such as the gloss refraction of glazed tiles and the moss erosion marks on blue bricks, with material fidelity reaching sub-millimeter level.
[0023] In this embodiment, the light and dark distribution information and RGB color information of each primitive information are obtained in the following manner: Get the preset material information; Get light source information; Obtain the light and dark distribution information and RGB color information of each primitive information according to the light source information and the preset material information; The primitive information in the corresponding geometric attribute buffer is shaded according to the acquired light and dark distribution information and RGB color information, thereby obtaining a preliminary rendered image.
[0024] In this embodiment, the following method is used to obtain the light and dark distribution information and RGB color information of each primitive information based on the light source information and the preset material information: For the convenience of description, a red wooden pillar (PBR material has been confirmed) and a point light source are used as an example.
[0025] Assume that the object material information is as follows: Vermilion PBR material (RGB: 204,51,51), Roughness: 0.7, Metalness: 0, Normal Map Strength: 1.0.
[0026] Light source type: point light source; Light source properties: Color: RGB (255, 204, 153), Intensity: 800 lumens, Position: (2.5, 3.0, 1.0), Attenuation radius: 3 meters.
[0027] Observation point: Camera position: (0,5,15), Observation direction vector: (0,-0.8,1) after normalization; Target primitive information fragment: world coordinates: (1.2, 2.8, 0.5), normal vector: (0,0.9,0.4) after normalization, view vector: (0.2,-0.7,0.6) after normalization.
[0028] First, calculate the light attenuation: The distance from the light source to the fragment is obtained using the following formula: In this embodiment, d is the straight-line distance from the light source to the target pixel segment (unit: meter). x1, y1, z1 are the world coordinates of the light source.
[0029] x2, y2, z2 are the world coordinates of the target pixel fragment.
[0030] In this embodiment, the straight-line distance from the light source to the target pixel segment is 1.732 m.
[0031] The attenuation coefficient formula is as follows: ; In this embodiment, Attenuation==0.25.
[0032] Attenuation is the light source attenuation coefficient, and its value range is (0,1]. The farther the distance, the more obvious the attenuation.
[0033] In this embodiment, the radiation intensity is obtained by the following formula: L i = Light source intensity × Attenuation; where L i is the radiation intensity of the light source after attenuation (unit: lumen). In this embodiment, L i It is 200lm.
[0034] In this embodiment, the normal distribution term is obtained by the following formula: ; Where α is the material roughness, ranging from 0 to 1, with larger values indicating rougher surfaces. N is the normalized vector. H is the normalized half-angle vector (calculated from the view vector V and the light vector L). N·H is the dot product of the normal vector and the half-angle vector. D is the value of the normal distribution function, which describes the probability density of the microsurface normal distribution.
[0035] In this embodiment, α=0.7; H=normalize(V+L), calculated H=(0.48,0.42,0.76).
[0036] D≈0.184.
[0037] In this embodiment, the geometric shielding term is obtained by the following formula: Where G is the geometric attenuation term, with a value range of [0,1], which describes the energy loss caused by microsurface self-occlusion. N·V is the dot product of the normal vector and the view vector.
[0038] In this embodiment, G≈0.32.
[0039] In this embodiment, the Fresnel term formula is as follows: F=F0+(1−F0)(1−V·H) 5 Where F0 is the basic Fresnel reflection coefficient. V·H is the dot product of the view vector and the half-angle vector. F is the Fresnel term, which describes the proportion of light reflected from the surface. In this embodiment, the basic Fresnel reflection coefficient is 0.04, so F ≈ 0.532.
[0040] In this embodiment, the bidirectional reflectance distribution function is calculated using the following formula: ;in, f r is the BRDF (Bidirectional Reflectance Distribution Function) value, which describes the directional distribution of light reflected from a surface. N·L is the dot product of the normal vector and the light vector. L is the normalized light vector (pointing from the light source position to the target pixel fragment).
[0041] In this embodiment, f r ≈−0.083.
[0042] The reflected light intensity is calculated using the following formula: ; Among them, θ0 is the angle of incidence, and Color is the color value of the object material (RGB space, needs to be normalized).
[0043] In this embodiment, L0≈13.0RGB values.
[0044] The final color value formula is as follows: Final Color = Base Color × (Ambient + L0); where Final Color is the final color value of the target pixel fragment (in RGB space). Base Color is the base color of the object's material (in RGB space, normalized). Ambient is the ambient light intensity.
[0045] In this embodiment, Final Color≈50.1RGB value.
[0046] In this embodiment, clipping the primitive information of each component of the model to be rendered in the world coordinate system according to the view cone information to obtain the final visible primitive list includes: Get the coordinates of each vertex of the model to be rendered; Calculate the minimum x-axis value, the minimum y-axis value, the minimum z-axis value, the maximum x-axis value, the maximum y-axis value, and the maximum z-axis value of each vertex coordinate in the world coordinate system respectively; the minimum x-axis value, the minimum y-axis value, the minimum z-axis value, the maximum x-axis value, the maximum y-axis value, and the maximum z-axis value of each vertex form a bounding box aligned with the coordinate axes in the world coordinate system; Based on the bounding box information, the primitive information of each component of the model to be rendered is clipped in the world coordinate system to obtain a final visible primitive list.
[0047] In this embodiment, clipping the primitive information of each component of the model to be rendered in the world coordinate system based on the bounding box information to obtain the final visible primitive list includes: Dividing the obtained bounding box to generate a tree-like hierarchical structure, wherein the tree-like hierarchical structure includes a plurality of child nodes; Generate a node local convex hull for each node in the tree hierarchy; Generate a bounding sphere for each node in the tree hierarchy; Performing rough clipping of the primitive information of each component of the model to be rendered according to the bounding sphere range by GPU parallel processing; The primitive information of each component of the model to be rendered after the rough clipping is finely clipped using the local convex hull of the node in a GPU parallel processing manner to form a final visible primitive list.
[0048] In this embodiment, the obtained bounding box is divided to generate a tree-like hierarchical structure, and the tree-like hierarchical structure includes multiple child nodes including: Use the bounding box as the root node of the tree structure; Set the volume threshold of the bounding box; The bounding box is divided by dynamic partitioning to form multiple sub-bounding boxes, and each sub-bounding box is used as a child node; The following judgments are made for the model vertices at each position: When the coordinates of each vertex of any model are completely within a sub-bounding box, the vertices of the model are allocated to the sub-bounding box; When the vertices of any model are located in different sub-bounding boxes, they are allocated using the copy allocation strategy.
[0049] In this embodiment, generating a local convex hull of each node in the tree-like hierarchical structure includes: Perform the following operations for each node: Get the coordinates of each vertex of each model belonging to this node; An incremental convex hull algorithm is performed on each vertex of each obtained model to generate a local convex hull of the node.
[0050] In this embodiment, performing an incremental convex hull algorithm on each vertex of each acquired model to generate a local convex hull of the node includes: The coordinates of each vertex of each model in the node are obtained by taking any point in any axis of the world coordinate system as the initial point, and sorting them from near to far from the point, thereby obtaining a vertex coordinate sequence; Select the first three vertex coordinates in the sequence to construct an initial convex hull of a triangle; The remaining vertex coordinates in the vertex coordinate sequence are divided according to the initial convex hull to form a local convex hull of the node.
[0051] In this embodiment, dividing the remaining vertex coordinates in the vertex coordinate sequence according to the initial convex hull to form a local convex hull of the node includes: Perform the following operations on each of the remaining vertex coordinates in the vertex coordinate sequence in an iterative manner: Step A: Use the cross product method to determine the relationship between the vertex and each edge of the initial convex hull, and determine whether the vertex is in the initial convex hull based on the obtained relationship. If not, then Step B: updating the initial convex hull according to the vertex coordinates to form a new local convex hull, and in subsequent iterations, using the new local convex hull to determine the relationship with the next vertex; Repeat step A and step B until all vertex coordinates in the vertex coordinate sequence are judged, and the local convex hull finally obtained is the local convex hull of the node.
[0052] In this embodiment, generating a bounding sphere for each node in the tree-like hierarchical structure includes: Perform the following processing for each node: Collect the vertex coordinates of all geometries in the node; Calculate the average value of all vertex coordinates as the center point of the bounding sphere; Find the maximum distance from the center of the bounding sphere to all vertices as the bounding sphere radius.
[0053] In this embodiment, the view frustum information includes a camera view matrix, a projection matrix, and scene parameters; The step of roughly clipping the primitive information of each component of the model to be rendered according to the bounding sphere range by using the GPU parallel processing includes: The following parallel processing is performed on each node: For each node's bounding sphere, calculate the distance from its center to each plane of the viewing cone; Obtaining viewing frustum information according to the camera view matrix, projection matrix, and scene parameters; The bounding sphere of each node is clipped according to the frustum information. The visibility of the bounding sphere is determined based on the positional relationship between the bounding sphere and the frustum plane. If it is not visible, the node where the bounding sphere is located is eliminated; if it is visible, the node where the bounding sphere is located is retained.
[0054] For example, the bounding sphere represents the smallest sphere that contains all the geometry of the node. The center of the bounding sphere can be calculated using the following formula: ; In this embodiment, the radius of the enclosing sphere can be calculated using the following formula: Among them, Center x Indicates the center position of the x-axis, Center y Indicates the center position of the Y axis, Center z Indicates the center position of the Z axis.
[0055] For example, suppose there are three node geometry vertices: A(0,0,0), B(2,0,0), C(1,2,0); Center of the bounding sphere: ; Bounding sphere radius: .
[0056] In this embodiment, the viewing frustum is a visible space area defined by the camera view matrix and the projection matrix, which determines which objects in the scene will be rendered. The eight vertices of the viewing frustum can be calculated through the camera view matrix, the projection matrix and the scene parameters, thereby defining the visible space area.
[0057] In this embodiment, the step of finely clipping the primitive information of each component of the model to be rendered after the rough clipping by using the local convex hull of the node to form a final visible primitive list includes: For each node retained after coarse pruning, the following parallel processing is performed: Project the vertices of the node local convex hull of the node to the viewing frustum plane; According to the separating axis theorem, the intersection relationship between the convex hull and the viewing cone is determined. If they do not intersect, it means that the local convex hull of the node is invisible, and the node corresponding to the local convex hull of the node is eliminated. If they intersect, the node where the local convex hull of the node is located is retained.
[0058] In this embodiment, the Separating Axis Theorem (SAT) is used to determine whether two convex geometric bodies intersect. The principle is: if there exists a separating axis such that the projections of the two geometric bodies on the axis do not overlap, then they do not intersect. The Separating Axis Theorem is prior art and will not be further described here.
[0059] In this embodiment, if the projection intervals of the local convex hull of the node and the viewing cone on any separating axis do not overlap, then they do not intersect.
[0060] In this embodiment, the bounding box, convex hull, and bounding sphere are different concepts. The bounding box is a simple geometric shape (such as an axis-aligned bounding box (AABB)) used to quickly determine whether objects intersect. The bounding box is typically a rectangle or cube, which is simple to calculate and suitable for rough intersection detection.
[0061] The convex hull is the smallest convex polygon within a bounding box, used to accurately represent the shape of an object. The convex hull can tightly wrap the object and describe the object's geometric features more accurately than the bounding box.
[0062] In the prior art, a bounding box is generally used to obtain a list of visible primitives. However, using a bounding box has the following disadvantages: The bounding box is a rough geometric shape that cannot accurately represent the complex shape of an object. For example, for a curved object, the bounding box will contain a lot of empty space.
[0063] The advantage of the node local convex hull used in this application is that it can tightly wrap the object vertices, providing a more accurate geometric representation. In addition, when the bounding box and the bounding sphere intersect, the node local convex hull is used for more accurate collision detection.
[0064] Before performing local convex hull analysis on a node, we first use a bounding sphere for rough pruning. This is because the bounding sphere's frustum test requires minimal computation (it only requires determining the positional relationship between the sphere and the frustum), allowing for the rapid elimination of a large number of invisible nodes. Using a bounding sphere for high-level nodes in a tree structure avoids inefficient traversal of lower-level nodes.
[0065] The present application also provides a virtual reality ancient building rendering display device, which includes a model preprocessing module, a light source and environment configuration module, a coordinate transformation module, a primitive information acquisition module, a view cone information acquisition module, a visible primitive list acquisition module, a rasterization module, an RGB information acquisition module, and a preliminary rendering module, wherein: The model preprocessing module is used to load the model to be rendered and bind the materials of each component of the model to be rendered; The light source and environment configuration module is used to configure light source information and environment information; The coordinate transformation module is used to transform the coordinates of each component of the model to be rendered, and transform each component of the model to be rendered into the world coordinate system; The primitive information acquisition module is used to generate primitive information of each component of the model to be rendered in the world coordinate system; The cone information acquisition module is used to obtain cone information; The visible primitive list acquisition module is used to clip the primitive information of each component of the model to be rendered in the world coordinate system according to the view cone information to obtain the final visible primitive list; The rasterization module is used to perform rasterization processing on the retained primitive information, thereby obtaining each rasterized primitive information and placing it in the geometric attribute buffer; The RGB information acquisition module is used to obtain the light and dark distribution information and RGB color information of each primitive information; The preliminary rendering module is used to perform coloring processing on the primitive information in the corresponding geometric attribute buffer according to the acquired light and dark distribution information and RGB color information, thereby obtaining a preliminary rendering completed picture.
[0066] This application has the following advantages: (1) Calculate the light source attenuation coefficient using the distance formula (e.g., a point light source attenuates to 25% within 3 meters), and combine it with the radiation intensity formula to achieve true energy transfer; (2) Integrate the three elements of normal distribution (D), geometric occlusion (G), and Fresnel reflection (F) to support complex surface reflection characteristics (such as the mixed effect of diffuse and specular reflection of wooden columns); (3) In the rough-cutting phase, bounding spheres are used to quickly eliminate invisible nodes (the computational effort is only 1 / 3 that of bounding boxes). In the fine-cutting phase, the local convex hull is used to tightly wrap the geometry (reducing redundant space by 30%-50% compared to AABB bounding boxes). Furthermore, through tree-like hierarchical management, bounding boxes are dynamically divided and vertex allocation strategies are replicated to avoid inefficient traversal of low-level nodes. Using this culling method, culling efficiency has been measured to increase by 40%, supporting real-time rendering of scenes with millions of triangles.
[0067] (4) The bounding sphere cone test and convex hull SAT test are performed through GPU parallel rendering, and the separating axis theorem (SAT) is used to achieve millisecond-level intersection judgment of the convex hull and cone through parallel rendering. Compared with CPU single-threaded cropping, the processing speed is increased by 120 times, supporting 4K resolution and 60fps smooth rendering.
[0068] Although the present invention has been described in detail above using general descriptions and specific embodiments, it will be apparent to those skilled in the art that modifications and improvements may be made based on the present invention. Therefore, such modifications and improvements, which do not depart from the spirit of the present invention, are intended to be within the scope of protection claimed herein.
Claims
1. A virtual reality ancient building rendering display method, characterized in that: The virtual reality ancient building rendering display method includes: Load the model to be rendered and bind the materials of each component of the model to be rendered; Configure light source information and environment information; Perform coordinate transformation on each component of the model to be rendered, and transform each component of the model to be rendered into the world coordinate system; Generate the primitive information of each component of the model to be rendered in the world coordinate system; Get the view frustum information; According to the view frustum information, the primitive information of each component of the model to be rendered is clipped in the world coordinate system to obtain the final visible primitive list; Perform rasterization on the retained primitive information, thereby obtaining each rasterized primitive information and placing it in the geometric attribute buffer; Obtain the brightness and darkness distribution information and RGB color information of each primitive; The primitive information in the corresponding geometric attribute buffer is shaded according to the acquired light and dark distribution information and RGB color information, thereby obtaining a preliminary rendered image.
2. The virtual reality ancient building rendering display method according to claim 1, characterized in that: The step of clipping the primitive information of each component of the model to be rendered in the world coordinate system according to the view frustum information to obtain the final visible primitive list includes: Get the coordinates of each vertex of the model to be rendered; Calculate the minimum x-axis value, the minimum y-axis value, the minimum z-axis value, the maximum x-axis value, the maximum y-axis value, and the maximum z-axis value of each vertex coordinate in the world coordinate system respectively; the minimum x-axis value, the minimum y-axis value, the minimum z-axis value, the maximum x-axis value, the maximum y-axis value, and the maximum z-axis value of each vertex form a bounding box aligned with the coordinate axes in the world coordinate system; Based on the bounding box information, the primitive information of each component of the model to be rendered is clipped in the world coordinate system to obtain a final visible primitive list.
3. The virtual reality ancient building rendering display method according to claim 2, characterized in that: The step of clipping the primitive information of each component of the model to be rendered in the world coordinate system based on the bounding box information to obtain a final visible primitive list includes: Dividing the obtained bounding box to generate a tree-like hierarchical structure, wherein the tree-like hierarchical structure includes a plurality of child nodes; Generate a node local convex hull for each node in the tree hierarchy; Generate a bounding sphere for each node in the tree hierarchy; Performing rough clipping of the primitive information of each component of the model to be rendered according to the bounding sphere range by GPU parallel processing; The primitive information of each component of the model to be rendered after the rough clipping is finely clipped using the local convex hull of the node in a GPU parallel processing manner to form a final visible primitive list.
4. The virtual reality ancient building rendering display method according to claim 3, characterized in that: The obtained bounding box is divided to generate a tree-like hierarchical structure, wherein the tree-like hierarchical structure includes a plurality of child nodes including: Use the bounding box as the root node of the tree structure; Set the volume threshold of the bounding box; The bounding box is divided by dynamic partitioning to form multiple sub-bounding boxes, and each sub-bounding box is used as a child node; The following judgments are made for the model vertices at each position: When the coordinates of each vertex of any model are completely within a sub-bounding box, the vertices of the model are allocated to the sub-bounding box; When the vertices of any model are located in different sub-bounding boxes, they are allocated using the copy allocation strategy.
5. The virtual reality ancient building rendering display method according to claim 4, characterized in that: Generating a local convex hull of each node in the tree-like hierarchical structure includes: Perform the following operations for each node: Get the coordinates of each vertex of each model belonging to this node; An incremental convex hull algorithm is performed on each vertex of each obtained model to generate a local convex hull of the node.
6. The virtual reality ancient building rendering display method according to claim 5, characterized in that: The step of performing an incremental convex hull algorithm on each vertex of each acquired model to generate a local convex hull of the node includes: The coordinates of each vertex of each model in the node are obtained by taking any point in any axis of the world coordinate system as the initial point, and sorting them from near to far from the point, thereby obtaining a vertex coordinate sequence; Select the first three vertex coordinates in the sequence to construct an initial convex hull of a triangle; The remaining vertex coordinates in the vertex coordinate sequence are divided according to the initial convex hull to form a local convex hull of the node.
7. The virtual reality ancient building rendering display method according to claim 6, characterized in that: The dividing of the remaining vertex coordinates in the vertex coordinate sequence according to the initial convex hull to form a local convex hull of the node includes: Perform the following operations on each of the remaining vertex coordinates in the vertex coordinate sequence in an iterative manner: Step A: Use the cross product method to determine the relationship between the vertex and each edge of the initial convex hull, and determine whether the vertex is in the initial convex hull based on the obtained relationship. If not, then Step B: updating the initial convex hull according to the vertex coordinates to form a new local convex hull, and in subsequent iterations, using the new local convex hull to determine the relationship with the next vertex; Repeat step A and step B until all vertex coordinates in the vertex coordinate sequence are judged, and the local convex hull finally obtained is the local convex hull of the node.
8. The virtual reality ancient building rendering display method according to claim 7, characterized in that: Generating a bounding sphere for each node in the tree-like hierarchical structure includes: Perform the following processing for each node: Collect the vertex coordinates of all geometries in the node; Calculate the average value of all vertex coordinates as the center point of the bounding sphere; Find the maximum distance from the center of the bounding sphere to all vertices as the bounding sphere radius.
9. The virtual reality ancient building rendering display method according to claim 8, characterized in that: The view cone information includes a camera view matrix, a projection matrix, and scene parameters; The step of roughly clipping the primitive information of each component of the model to be rendered according to the bounding sphere range by using the GPU parallel processing includes: The following parallel processing is performed on each node: For each node's bounding sphere, calculate the distance from its center to each plane of the viewing cone; Obtaining viewing frustum information according to the camera view matrix, projection matrix, and scene parameters; The bounding sphere of each node is clipped according to the frustum information. The visibility of the bounding sphere is determined based on the positional relationship between the bounding sphere and the frustum plane. If it is not visible, the node where the bounding sphere is located is eliminated; if it is visible, the node where the bounding sphere is located is retained.
10. The virtual reality ancient building rendering display method according to claim 9, characterized in that: The step of finely clipping the primitive information of each component of the model to be rendered after the rough clipping by using the local convex hull of the node to form a final visible primitive list includes: For each node retained after coarse pruning, the following parallel processing is performed: Project the vertices of the node local convex hull of the node to the viewing frustum plane; According to the separating axis theorem, the intersection relationship between the convex hull and the viewing cone is determined. If they do not intersect, it means that the local convex hull of the node is invisible, and the node corresponding to the local convex hull of the node is eliminated. If they intersect, the node where the local convex hull of the node is located is retained.
11. A virtual reality ancient building rendering display device, characterized in that: The virtual reality ancient building rendering display device includes: A model preprocessing module, which is used to load the model to be rendered and perform material binding on various components of the model to be rendered; A light source and environment configuration module, which is used to configure light source information and environment information; A coordinate transformation module, wherein the coordinate transformation module is used to perform coordinate transformation on each component of the model to be rendered, and transform each component of the model to be rendered into a world coordinate system; A graphic element information acquisition module, the graphic element information acquisition module is used to generate graphic element information of each component of the model to be rendered in the world coordinate system; A visual cone information acquisition module, wherein the visual cone information acquisition module is used to acquire visual cone information; A visible primitive list acquisition module is used to clip primitive information of each component of the model to be rendered in the world coordinate system according to the view cone information to obtain a final visible primitive list; A rasterization module, the rasterization module is used to perform rasterization processing on the retained primitive information, thereby obtaining each rasterized primitive information and placing it in a geometric attribute buffer; RGB information acquisition module, the RGB information acquisition module is used to obtain the light and dark distribution information and RGB color information of each primitive information; The preliminary rendering module is used to perform coloring processing on the primitive information in the corresponding geometric attribute buffer according to the acquired light and dark distribution information and RGB color information, thereby obtaining a preliminary rendering completed picture.
Citation Information
Patent Citations
Building information model display method and system, electronic equipment and storage medium
CN115587409A
WebGL-based image rendering method and device, equipment and storage medium
CN116091684A
