Rendering method, device, electronic device and storage medium based on Gaussian splashing
By calculating and sorting Gaussian points, the computing power requirement for rendering three-dimensional scenes is reduced, and the problem of high requirements for device computing power in Gaussian splashing technology is solved, and efficient rendering is achieved under limited equipment conditions.
Patent Information
- Application Number
- CN202411479452.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2044-10-23
AI Technical Summary
In Gaussian splashing technology, the number of Gaussian points to be rendered in a three-dimensional scene is huge, which makes it difficult to popularize rendering on the device's computing power, especially on mobile phones, and can only be limited to PCs with independent graphics cards.
By obtaining the Gaussian splash file of the 3D scene to be rendered and the octree of the 3D mesh model, calculate the maximum number of renderable Gaussian points in the default rendering mode, calculate the LOD hierarchy data based on the grid where the character is located and the rendering proportion group, and determine the activation network lattice, sample and deep sort Gaussian points, generate an ordered array of Gaussian points to be rendered, used to render three-dimensional scene images.
While ensuring the rendering effect of the grid where the character is located and its surroundings, it reduces the number of Gaussian points, effectively reduces the computing power required for rendering, and realizes efficient rendering of three-dimensional scenes on devices with limited computing power.
Smart Images

Figure CN119006682B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a rendering method, device, electronic device and storage medium based on Gaussian splashing. Background Art
[0002] Traditional rendering is usually based on a three-dimensional model. The three-dimensional model of the scene is composed of several vertices. The triangle patch composed of three vertices is used as the smallest rendering unit. The position, size, color, transparency and other information of each vertex are used during rendering. Different from the traditional rendering method, the emerging Gaussian splash technology uses the Gaussian ellipsoid as the smallest rendering unit. The rendering scene includes several Gaussian ellipsoids. A single Gaussian ellipsoid carries information such as position (that is, the three-dimensional coordinates in the scene), covariance (reflecting how the ellipsoid is scaled or stretched), color and Alpha (transparency). Therefore, the Gaussian ellipsoid can be abstractly understood as a point of different size, color and transparency at different angles. The Gaussian ellipsoid is hereinafter referred to as a Gaussian point. For example, Figure 1 In the figure, three Gaussian points of different colors and positions are shown, and each Gaussian point is ellipsoidal ( Figure 1 The ellipsoid lines are only for viewing aids and do not actually exist).
[0003] Gaussian splash technology requires that each point cloud in the 3D scene to be rendered be converted into a Gaussian point in advance to obtain a Gaussian splash file of the 3D scene to be rendered, so that rendering can be performed based on the Gaussian splash file. Generally, the number of Gaussian points in a Gaussian splash file depends on the scale of the scene and the rendering accuracy requirements. For example, the number of Gaussian points in a Gaussian splash file for an outdoor scene with a diameter of about one kilometer can reach millions or even tens of millions. Therefore, the rendering of Gaussian splash scenes requires high computing power of the device and is difficult to popularize. Summary of the invention
[0004] The purpose of the present invention is to provide a rendering method, device, electronic device and storage medium based on Gaussian splashing to improve the problems existing in the prior art.
[0005] The embodiments of the present invention can be implemented as follows:
[0006] In a first aspect, the present invention provides a rendering method based on Gaussian splashing, comprising:
[0007] Obtaining a Gaussian splash file, a three-dimensional mesh model, and an octree corresponding to the three-dimensional mesh model of a three-dimensional scene to be rendered; the Gaussian splash file includes a number of Gaussian points, and the three-dimensional mesh model includes a number of meshes;
[0008] Calculate the maximum number of renderable Gaussian points for the default rendering mode;
[0009] Calculate the LOD level data of the octree based on the grid where the character is located, the maximum number of renderable Gaussian points, and a preset rendering ratio group; the rendering ratio group reflects that the proportion of the number of Gaussian points to be rendered in each grid diffused outward from the grid where the character is located gradually decreases;
[0010] Based on the LOD level data of the octree, determine each activated mesh existing in the three-dimensional mesh model;
[0011] Based on the rendering ratio group, sampling all Gaussian points to be rendered in each of the activated grids from the Gaussian splash file;
[0012] The Gaussian points to be rendered in all activated grids are depth-sorted to obtain an ordered array of Gaussian points to be rendered; the ordered array of Gaussian points to be rendered is used to render a scene image of the three-dimensional scene to be rendered.
[0013] In a second aspect, the present invention provides a rendering device based on Gaussian splashing, comprising:
[0014] An acquisition module, used to acquire a Gaussian splash file, a three-dimensional mesh model, and an octree corresponding to the three-dimensional mesh model of a three-dimensional scene to be rendered; the Gaussian splash file includes a number of Gaussian points, and the three-dimensional mesh model includes a number of meshes;
[0015] Gaussian point calculation module, used to calculate the maximum number of renderable Gaussian points for the default rendering mode;
[0016] A level update module, for calculating the LOD level data of the octree based on the grid where the character is located, the maximum number of renderable Gaussian points, and a preset rendering ratio group; the rendering ratio group reflects that the proportion of the number of Gaussian points to be rendered in each grid diffused outward from the grid where the character is located gradually decreases;
[0017] A mesh determination module, configured to determine each activated mesh existing in the three-dimensional mesh model based on the LOD level data of the octree;
[0018] A sampling module, configured to sample all Gaussian points to be rendered in each of the activated grids from the Gaussian splash file based on the rendering ratio group;
[0019] The depth sorting module is used to perform depth sorting on the Gaussian points to be rendered in all activated grids to obtain an ordered array of Gaussian points to be rendered; the ordered array of Gaussian points to be rendered is used to render a scene image of the three-dimensional scene to be rendered.
[0020] In a third aspect, the present invention provides an electronic device, comprising: a memory and a processor, wherein the memory stores a software program, and when the electronic device is running, the processor executes the software program to implement the Gaussian splash-based rendering method as described in the first aspect above.
[0021] In a fourth aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the rendering method based on Gaussian splattering described in the first aspect is implemented.
[0022] Compared with the prior art, the embodiments of the present invention provide a rendering method, device, electronic device and storage medium based on Gaussian splashing, firstly obtaining a Gaussian splashing file, a three-dimensional mesh model and an octree corresponding to the three-dimensional mesh model of a three-dimensional scene to be rendered; the Gaussian splashing file includes a plurality of Gaussian points, and the three-dimensional mesh model includes a plurality of meshes; calculating the maximum number of Gaussian points that can be rendered in the default rendering mode; calculating the LOD level data of the octree based on the mesh where the character is located, the maximum number of Gaussian points that can be rendered and a preset rendering ratio group; the rendering ratio group reflects that the proportion of the number of Gaussian points to be rendered in each mesh that diffuses outward from the mesh where the character is located gradually decreases; based on the LOD level data of the octree, determining each activated mesh existing in the three-dimensional mesh model; based on the rendering ratio group, sampling all Gaussian points to be rendered in each activated mesh from the Gaussian splashing file; performing depth sorting on the Gaussian points to be rendered in all activated meshes to obtain an ordered array of Gaussian points to be rendered; the ordered array of Gaussian points to be rendered is used to render a scene image of the three-dimensional scene to be rendered. In this way, the LOD level data of the octree is calculated according to the mesh where the character is located, the maximum number of Gaussian points that can be rendered, and the rendering scale group to further determine all activated meshes. Finally, all Gaussian points to be rendered in each activated mesh are sampled based on the rendering scale group, and finally all Gaussian points to be rendered are depth sorted and rendered. In this way, the number of Gaussian points to be rendered is reduced while ensuring the rendering effect of the mesh where the character is located and its surroundings, effectively reducing the computing power required for rendering. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0024] Figure 1 A schematic diagram of a Gaussian ellipsoid.
[0025] Figure 2One of the flowchart diagrams of a rendering method based on Gaussian splatting provided by an embodiment of the present invention.
[0026] Figure 3 The second flowchart of a rendering method based on Gaussian splashing provided by an embodiment of the present invention.
[0027] Figure 4 A third flowchart of a rendering method based on Gaussian splatting provided in an embodiment of the present invention.
[0028] Figure 5 A fourth flowchart of a rendering method based on Gaussian splatting provided in an embodiment of the present invention.
[0029] Figure 6 Four levels of two-dimensional mapping diagrams of regional distribution are provided in an embodiment of the present invention.
[0030] Figure 7 A schematic structural diagram of a rendering device based on Gaussian splashing provided by an embodiment of the present invention.
[0031] Figure 8 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0033] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0034] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0035] In addition, the terms “first”, “second”, etc., if used, are merely used to distinguish between the descriptions and should not be understood as indicating or implying relative importance.
[0036] It should be noted that, in the absence of conflict, the features in the embodiments of the present invention may be combined with each other.
[0037] As mentioned in the background technology section, the number of Gaussian points in a Gaussian splash file usually depends on the scene scale and rendering accuracy requirements. For example, the number of Gaussian points in a Gaussian splash file for an outdoor scene with a diameter of about one kilometer can reach millions or even tens of millions. Therefore, the rendering of Gaussian splash scenes requires high computing power of the device and is difficult to popularize. In particular, Gaussian splash scenes are difficult to render on mobile phones and can only be limited to rendering on PCs with independent graphics cards.
[0038] Please refer to Figure 2 , Figure 2 A flowchart of a rendering method based on Gaussian splashing provided by an embodiment of the present invention is provided. The execution subject of the method is an electronic device, which may be, but is not limited to, a smart phone, a smart tablet, a personal computer, a server, etc. The method includes the following steps S101 to S106:
[0039] S101, obtaining a Gaussian splash file, a three-dimensional mesh model, and an octree corresponding to the three-dimensional mesh model of a three-dimensional scene to be rendered.
[0040] In this embodiment, the Gaussian splash file may include a number of Gaussian points, each of which is converted from a point cloud in the three-dimensional scene to be rendered. The three-dimensional mesh model is obtained by meshing the three-dimensional space of the three-dimensional scene to be rendered, including a number of meshes, and the octree is formed based on the three-dimensional mesh model. Each node in the octree includes at most eight child nodes. The root node of the octree represents the entire three-dimensional space of the three-dimensional scene to be rendered. The octree includes a number of leaf nodes, each of which corresponds to a mesh in the three-dimensional mesh model.
[0041] Optionally, the 3D scene to be rendered may be a local city 3D scene, a suburban 3D scene, or a 3D scene of a certain geographical location, or other real scenes, or may be a virtual 3D game scene produced by animation.
[0042] S102: Calculate the maximum number of renderable Gaussian points in the default rendering mode.
[0043] Optionally, the rendering mode may include a high frame rate mode, a balanced mode, and a high quality mode. The default rendering mode is the balanced mode.
[0044] In this embodiment, it is necessary to first calculate and store the maximum number of renderable Gaussian points of the high frame rate mode and the high image quality mode, and then further determine the maximum number of renderable Gaussian points of the balanced mode based on the maximum number of renderable Gaussian points of the two modes.
[0045] Optionally, the difference between the three rendering modes is that the ideal target frame rates during rendering are different. The ideal target frame rate of the high frame rate mode is greater than the ideal target frame rate of the high image quality mode, and the ideal target frame rate of the balanced mode is between the two.
[0046] In the optional examples, taking mobile phone rendering (i.e., the execution subject is a smartphone) as an example, considering the performance of the mobile phone, the ideal target frame rates of the high frame rate mode and the high image quality mode can be 40 frames and 20 frames respectively, while the ideal target frame rate of the balanced mode is between the two. This example is only an example, and the embodiments of the present invention are not limited to this.
[0047] S103, calculating the LOD level data of the octree based on the grid where the character is located, the maximum number of renderable Gaussian points, and a preset rendering scale group.
[0048] In this embodiment, the preset rendering ratio group can reflect that the proportion of the number of Gaussian points to be rendered in each grid diffused outward from the grid where the character is located is gradually reduced.
[0049] S104: Determine each activated mesh in the three-dimensional mesh model based on the LOD level data of the octree.
[0050] In this embodiment, if there are Gaussian points to be rendered in the mesh, it is an activated mesh. Correspondingly, if all Gaussian points in the mesh do not need to be rendered, it is considered an invalid mesh.
[0051] Optionally, the LOD level data of the octree includes the LOD level of each leaf node. The LOD level can be divided into multiple levels from low to high. The rendering ratio group can include the proportion of the number of Gaussian points to be rendered corresponding to each level. The proportion of the number of Gaussian points to be rendered corresponding to each level gradually decreases from low level to high level.
[0052] S105 . Based on the rendering ratio group, all Gaussian points to be rendered in each activated grid are sampled from the Gaussian splash file.
[0053] In this embodiment, since all Gaussian points to be rendered in each activated grid are sampled from the Gaussian splash file based on the rendering ratio group, the number of Gaussian points to be rendered in each activated grid that diffuses outward from the grid where the character is located is reduced successively. This effectively reduces the number of Gaussian points to be rendered while ensuring the rendering effect of the grid where the character is located and its surroundings, without the need to fully render the Gaussian splash file.
[0054] S106 , performing depth sorting on the Gaussian points to be rendered in all activated grids to obtain an ordered array of Gaussian points to be rendered.
[0055] In this embodiment, the ordered array of Gaussian points to be rendered can be used to render a scene image of the three-dimensional scene to be rendered.
[0056] It is understandable that in computer graphics and 3D rendering, the camera position is one of the key factors that determine the rendering results. The camera position and camera orientation determine the viewing angle and field of view of the scene. Initially, there is a preset initial camera position, and the subsequent camera position may change due to user operations. The depth is the distance between the Gaussian point to be rendered and the camera position. The farther away from the camera position, the greater the depth.
[0057] Therefore, in the order of depth from large to small, the Gaussian points to be rendered in all activated grids are arranged to obtain an ordered array of Gaussian points to be rendered, which can be used to render the scene image of the three-dimensional scene to be rendered. Since the Gaussian points are rendered semi-transparent, the painter's algorithm (a common algorithm in graphics) is followed during rendering, so that the farther the object, the earlier it is rendered, and the closer the object, the later it is rendered.
[0058] The rendering method based on Gaussian splash provided by the embodiment of the present invention first obtains the Gaussian splash file, the three-dimensional mesh model and the octree corresponding to the three-dimensional mesh model of the three-dimensional scene to be rendered; then calculates the maximum number of Gaussian points that can be rendered in the default rendering mode; then calculates the LOD level data of the octree according to the mesh where the character is located, the maximum number of Gaussian points that can be rendered and the rendering ratio group to further determine all activated meshes, and finally samples all Gaussian points to be rendered in each activated mesh from the Gaussian splash file based on the rendering ratio group, and finally renders after depth sorting all Gaussian points to be rendered. In this way, while ensuring the rendering effect of the mesh where the character is located and its surroundings, the number of Gaussian points rendered is reduced, effectively reducing the computing power required for rendering.
[0059] In an optional implementation, when rendering is performed based on the ordered array of Gaussian points to be rendered obtained in step S106, a game character can be rendered at the same time, which can support the user to control the game character in a third-person perspective to interact and move in the three-dimensional scene to be rendered.
[0060] In the present invention, during the period when the rendering mode remains unchanged and the user does not control the game character, it is a static scene, and rasterization rendering can be performed based on the ordered array of Gaussian points to be rendered obtained in step S106 to continuously render scene images frame by frame, without the need to perform depth sorting before rendering each frame in the static scene, thereby reducing the computing power consumption in the static scene.
[0061] However, the camera position corresponds to the game character position, and when the user controls the game character to move or rotate, the camera position or camera orientation will also change accordingly. Therefore, the method may further include the following steps S107, S108, and S109.
[0062] S107. When it is sensed that the user controls the character to move so that the camera position corresponding to the character changes by more than a preset distance, the grid where the character is located is updated, and the process returns to step S103.
[0063] In this embodiment, when it is sensed that the user controls the movement of the character so that the camera position corresponding to the character changes by more than a preset distance compared with the camera position corresponding to the previous frame of the scene image, the grid where the character is located is updated and steps S103-S106 are returned to be re-executed to determine a new ordered array of Gaussian points to be rendered, so as to render a new frame of the scene image.
[0064] S107. When it is sensed that the user controls the character to rotate so that the camera rotation angle corresponding to the character exceeds the preset rotation angle, the grid where the character is located is updated, and the execution returns to step S103.
[0065] In this embodiment, when it is sensed that the user is manipulating the character's rotation so that the camera orientation corresponding to the previous frame of the scene image exceeds the preset rotation angle compared to the camera rotation angle corresponding to the character, the grid where the character is located is updated and steps S103-S106 are returned to be re-executed to determine a new ordered array of Gaussian points to be rendered, so as to render a new frame of the scene image.
[0066] Optionally, both the preset distance and the preset rotation angle can be flexibly set, and the preset rotation angle is divided into a preset horizontal rotation angle and a vertical rotation angle. For example, the preset distance is 0.01 or 0.02, and the preset rotation angle is: the horizontal rotation angle and the vertical rotation angle are both preset to 0.05° or 0.1°.
[0067] S109 , when a mode switching operation of the user is sensed, after obtaining the maximum number of renderable Gaussian points corresponding to the target rendering mode specified by the user, return to execute step S103 .
[0068] In this embodiment, when the current rendering mode is the default rendering mode (ie, the balanced mode), the user can specify to switch to the high frame rate mode or the high image quality mode. After the mode is switched, the maximum number of renderable Gaussian points is also switched accordingly.
[0069] Therefore, when the user's mode switching operation is sensed, after obtaining the maximum number of renderable Gaussian points corresponding to the target rendering mode specified by the user, return to re-execute steps S103-S106 to determine a new ordered array of Gaussian points to be rendered, so as to render a new frame of scene image.
[0070] Therefore, after executing the above step S106, the electronic device may execute one of the above steps S107, S108, and S109 and then return to re-execute S103-S106.
[0071] In an optional implementation method, the maximum number of renderable Gaussian points supported by each rendering mode can be reversed based on the ideal target frame rates of the high frame rate mode and the high image quality mode while adapting to the device performance, thereby supporting rendering adaptation on different types of electronic devices and ensuring the rendering effect.
[0072] Correspondingly, in Figure 2 Based on Figure 3 The sub-steps of the above step S102 may include S1021~S1023.
[0073] S1021, obtaining the ideal target frame rate, the preset number of initial Gaussian points and the initial step size of the high frame rate mode and the high image quality mode respectively.
[0074] In this embodiment, the preset initial Gaussian point numbers and initial step sizes of the high frame rate mode and the high image quality mode may be different or the same.
[0075] S1022. For the target mode, based on the ideal target frame rate, the initial number of Gaussian points and the initial step size of the target mode, calculate the maximum number of renderable Gaussian points of the target mode.
[0076] In this embodiment, the target mode is a high frame rate mode or a high image quality mode. That is, the calculation logic of the maximum number of renderable Gaussian points in the high frame rate mode or the high image quality mode is the same, but the ideal target frame rate, the preset initial number of Gaussian points and the initial step size based on the calculation of the two modes may be different.
[0077] Optionally, correspondingly, in Figure 3 Based on Figure 4 , the sub-steps of step S1022 may include S001~S008.
[0078] S001. Render a frame of initialization loading interface according to the initial number of Gaussian points, and obtain a first real-time frame rate when rendering is completed.
[0079] In this embodiment, according to the current initial number of Gaussian points, a frame of the initialization loading interface is rendered, and after obtaining the first real-time frame rate when the rendering is completed, it can be determined whether the first real-time frame rate is lower than the ideal target frame rate. If the first real-time frame rate is not lower than the ideal target frame rate, it means that the current device performance can still support the rendering of more Gaussian points, and then execute the following step S002 and return to execute S001l; if the first real-time frame rate is lower than the ideal target frame rate, it means that the current device performance cannot reach the ideal target frame rate when rendering the current initial number of Gaussian points, and it is necessary to further reduce the number of Gaussian points, and then continue to execute the following step S003.
[0080] S002. If the first real-time frame rate is not lower than the ideal target frame rate, the number of initial Gaussian points is increased by an initial step size.
[0081] S003. If the first real-time frame rate is lower than the ideal target frame rate, the current initial number of Gaussian points is reduced by the undetermined step size to obtain the undetermined number of Gaussian points.
[0082] In this embodiment, the initial value of the to-be-determined step length may be a set ratio of the initial step length, which may be 10% or 20%.
[0083] S004. Render a frame of the initialization loading interface according to the number of Gaussian points to be determined, and obtain a second real-time frame rate when the rendering is completed.
[0084] In this embodiment, according to the current number of pending Gaussian points, a frame of the initialization loading interface is rendered, and after the second real-time frame rate is obtained when the rendering is completed, it can be determined whether the second real-time frame rate is equal to the ideal target frame rate.
[0085] S005. Determine whether the second real-time frame rate is equal to the ideal target frame rate.
[0086] In this embodiment, if the second real-time frame rate is not equal to the ideal target frame rate, the following step S006 is executed; if the second real-time frame rate is equal to the ideal target frame rate, the following step S008 is executed.
[0087] S006. Determine whether the to-be-determined step length is equal to the preset minimum step length.
[0088] In this embodiment, if the undetermined step length is not equal to the preset minimum step length, the following step S007 is executed; if the undetermined step length is equal to the preset minimum step length, the following step S008 is executed.
[0089] In an optional example, if the above-mentioned setting ratio is 10%, then the preset minimum step size may be 10 or 1; if the above-mentioned setting ratio is 20%, then the preset minimum step size may be 16 or 80. This example is only an example and is not limited here.
[0090] S007. Reduce the number of pending Gaussian points by a set ratio of the pending step length.
[0091] S008. Using the current number of pending Gaussian points as the maximum number of renderable Gaussian points.
[0092] In the optional example, the number of initial Gaussian points in the target mode is assumed to be , initial step length , set the ratio to 10%, and preset the minimum step size to 1. The following is an example of calculating the maximum number of renderable Gaussian points for the target mode.
[0093] Then, after executing step S002 for the first time, the number of initial Gaussian points used to render a frame of the initial loading interface is After executing step S002 for the second time, the number of initial Gaussian points used to render a frame of the initial loading interface is changed to 110000. After executing step S002 for the third time, the number of initial Gaussian points used in rendering a frame to initialize the loading interface It becomes 130000, and so on.
[0094] After the 10th execution of step S002, the number of initial Gaussian points becomes 200000. If the first real-time frame rate obtained after rendering a frame of the initial loading interface is just lower than the ideal target frame rate, then go to step S003 to obtain the first number of pending Gaussian points. 199000, this is the first decrease, the decrease step is .
[0095] Based on the number of undetermined Gaussian points , execute steps S004 to S006 in sequence, and then execute step S007 for the first time, and then determine the number of Gaussian points , the decreasing step size is 100; after iterating to the second execution of step S007, the number of Gaussian points to be determined , the decrement step size adopted is 10;
[0096] If this is based on After rendering one frame, the second real-time frame rate when the loading interface is initialized is exactly equal to the ideal target frame rate. Then the maximum number of Gaussian points that can be rendered in the target mode is .
[0097] If based on When the second real-time frame rate of the initial loading interface after rendering a frame is not equal to the ideal target frame rate, the iteration will continue to execute step S007 for the third time to obtain the number of undetermined Gaussian points. , the decrement step size used at this time is 1, the judgment result of step S006 is "yes", the decrement ends and the loop is jumped out, and the The maximum number of renderable Gaussian points as a target mode.
[0098] The above examples are only examples. The number of initial Gaussian points preset for the target mode in the embodiment of the present invention is , initial step length There is no limit on the initial values of setting the ratio and the preset minimum step size. You can use the empirical values after multiple explorations to ensure that most devices can support rendering.
[0099] Obviously, through the above steps S001 to S008, the maximum number of Gaussian points that can be rendered in the target mode can be calculated. During the calculation process, the number of initial Gaussian points is first calculated. Starting from the preset initial value, the initial step size is increased multiple times until the current When the first real-time frame rate after rendering a frame and initializing the loading interface is lower than the ideal target frame rate of the target mode, the frame rate is based on the latest Reduce the pending step size to get the number of pending Gaussian points , then Perform multiple iterations of decrement, and each decrement step is a set ratio of the previous decrement step (for example, 10% or 20%) until the current After rendering a frame, the second real-time frame rate of the initial loading interface is exactly equal to the ideal target frame rate of the target mode or the decreasing step has reached the preset minimum step, then the current latest The maximum number of renderable Gaussian points as a target mode.
[0100] By first increasing the initial step size multiple times with a larger one, and then decreasing it multiple times with smaller steps that gradually become smaller, and the decreasing step size gradually changes from the initial step size to the set ratio of the last decreasing step size, the maximum number of renderable Gaussian points that can support stable rendering to the ideal target frame rate based on the current performance of the device can be detected more accurately.
[0101] S1023. Calculate the average of the maximum number of Gaussian points that can be rendered in the high frame rate mode and the maximum number of Gaussian points that can be rendered in the high image quality mode to obtain the maximum number of Gaussian points that can be rendered in the default rendering mode.
[0102] In this embodiment, the maximum number of renderable Gaussian points in the balanced mode is directly taken as the average of the maximum number of renderable Gaussian points in the high frame rate mode and the maximum number of renderable Gaussian points in the high image quality mode to balance the image quality and frame rate.
[0103] In an optional implementation, the LOD level can be divided into four levels from low to high, namely, the core level, the first level, the second level, and the third level. The rendering ratio group may include the ratio of the number of Gaussian points to be rendered corresponding to each of the four levels, and the ratio of the number of Gaussian points to be rendered gradually decreases from the core level to the third level. That is, the ratio of the number of Gaussian points to be rendered corresponding to the core level, the first level, the second level, and the third level are respectively ,in Decrease in sequence.
[0104] In the optional example, It can be 100%, 60%, 20%, and 0% respectively. The final rendering effect is that with the character's mesh as the center, all meshes corresponding to the leaf nodes of the core, first, and second LOD levels have Gaussian points to be rendered, and all meshes corresponding to the leaf nodes of the third LOD level finally present a fog effect.
[0105] or It can be 100%, 80%, 65%, and 30% respectively. In this way, the closer the mesh is to the character, the more Gaussian points to be rendered, and the farther the mesh is from the character, the fewer Gaussian points to be rendered. In other words, the closer the mesh is to the character, the finer the rendering will be, and the farther the mesh is from the character, the coarser the rendering will be.
[0106] The above two examples are only examples and are not intended to be used here. The specific value of is limited.
[0107] In other words, the setting of the rendering scale group can greatly reduce the computing power required for rendering, while ensuring the rendering effect within a certain range around the game character without affecting the user experience.
[0108] Correspondingly, in Figure 2 Based on Figure 5 The sub-steps of the above step S103 may include S1031~S103c.
[0109] S1031. Based on the Gaussian splatter file, determine the number of Gaussian points in each grid in the three-dimensional grid model.
[0110] In this embodiment, each Gaussian point in the Gaussian splash file carries a position (i.e., a three-dimensional coordinate in the three-dimensional scene to be rendered), a covariance (reflecting how the ellipsoid is scaled or stretched), a color, and an Alpha (transparency). Based on the position carried by the Gaussian point, it is possible to determine in which grid the Gaussian point is located, and thus the number of Gaussian points in each grid can be determined.
[0111] S1032. Take the core level, the first level, and the second level as the target levels in sequence.
[0112] S1033. For each target level, find each leaf node to be traversed corresponding to the target level that meets the preset adjacent condition from the octree, and arrange them in ascending order based on the distance between the grid corresponding to each leaf node to be traversed and the grid where the character is located to obtain a set of nodes to be traversed.
[0113] In this embodiment, the preset adjacent conditions are different for the three different layers: the core layer, the first layer, and the second layer. Figure 6 The two-dimensional map of regional distribution of four levels is given. Figure 6 The center of the circle represents the grid position of the character. The preset adjacent conditions are divided into the following three cases:
[0114] 1. For the core level, the preset adjacent condition can be that the leaf node has no LOD level set and the distance between the mesh corresponding to the leaf node and the mesh where the character is located does not exceed the core preset radius R0 of the core level;
[0115] 2. For the first level, the preset adjacent condition is that the leaf node has no LOD level set and the distance between the mesh corresponding to the leaf node and the mesh where the character is located is between the initial value of the core preset radius R0 of the core preset radius and the first preset radius R1 of the first level;
[0116] 3. For the second level, the preset adjacent condition is that the leaf node has no LOD level set and the distance between the grid corresponding to the leaf node and the grid where the character is located is between the initial value of the first preset radius R1 of the first level and the second preset radius R2 of the second level.
[0117] In this way, the preset adjacent conditions of the three levels are linked in sequence, ensuring that the leaf nodes corresponding to each grid spreading outward from the grid where the character is located can be accessed, thereby setting the LOD level to avoid omissions.
[0118] It should be noted that Figure 6 The example shown is only an example of converting three-dimensional into two-dimensional for ease of understanding. In fact, R0, R1, and R2 are spherical areas in three-dimensional space, not circular areas.
[0119] It can be understood that, from the following step S103a, R0, R1, and R2 may all increase from their initial values.
[0120] Optionally, the core preset radius R0, the first preset radius R1 and the second preset radius R2 increase in size in sequence, and the values of the three are based on the actual situation. For example, the initial values of R0, R1 and R2 are 10, 30 and 50 respectively, or the initial values of R0, R1 and R2 are 10, 40 and 55 respectively. This example is only an example and is not limited here. S1034. Take the first leaf node to be traversed from the set of nodes to be traversed as the access node.
[0121] In this embodiment, the first leaf node to be traversed is taken from the set of nodes to be traversed as the access node each time. Each time S1034 is executed, one leaf node to be traversed is reduced from the set of nodes to be traversed. In this way, the LOD level can be set first for the leaf node corresponding to the grid closer to the grid where the character is located.
[0122] S1035 . Determine the number of Gaussian points to be rendered in the grid corresponding to the access node based on the proportion of the number of Gaussian points to be rendered corresponding to the target level and the number of Gaussian points in the grid corresponding to the access node.
[0123] In this embodiment, the product of the ratio of the number of Gaussian points to be rendered corresponding to the target level and the number of Gaussian points of the grid corresponding to the access node is the number of Gaussian points to be rendered of the grid corresponding to the access node.
[0124] In the optional example, suppose They are 100%, 60%, 20%, and 0% respectively. The number of Gaussian points of the grid corresponding to the current access node is 500. The number of Gaussian points to be rendered s of the grid corresponding to the access node is calculated as follows:
[0125] (1) The target level is the core level: s=100%*500=500;
[0126] (2) The target level is the first level: s=60%*500=300;
[0127] (3) The target level is the second level: s=20%*500=100.
[0128] This example is merely an example and is not intended to be limiting.
[0129] S1036. The sum of the pending sum value and the number of Gaussian points to be rendered in the grid corresponding to the access node is taken as a new pending sum value.
[0130] In this embodiment, the initial value of the to-be-determined sum value S is 0, and the number of Gaussian points to be rendered in the grid corresponding to each access node taken out from the to-be-traversed node set of the target level is gradually increased.
[0131] S1037 , determining whether the new pending sum value exceeds the target ratio of the maximum number of renderable Gaussian points.
[0132] In this embodiment, if the new pending sum value does not exceed the target ratio of the maximum number of renderable Gaussian points, the following steps S1038 and S1039 are executed. If the new pending sum value exceeds the target ratio of the maximum number of renderable Gaussian points, the following step S103b is executed, and then the node traversal of the next level is performed, or the following step S103c is executed.
[0133] In the present invention, when the target level is the core level, the target ratio is the preset core ratio corresponding to the core level. ; When the target level is the first level, the target ratio is the first preset ratio corresponding to the first level ; When the target level is the second level, the target ratio is the second preset ratio corresponding to the second level Among them, the preset core ratio, the first preset ratio and the second preset ratio are reduced in sequence and the sum of the three is less than or equal to 1, that is, There is also a third preset ratio corresponding to the third level. ,and .
[0134] In this way, by successively decreasing the preset core ratio, the first preset ratio, the second preset ratio and the third preset ratio, the maximum number of renderable Gaussian points can be allocated to the core level, the first level, the second level and the third level from most to least, ensuring that the closer the grid is to the character, the greater the number of renderable Gaussian points allocated, and the more refined the subsequent rendering can be; and the farther the grid is from the character, the fewer the number of renderable Gaussian points allocated, so as to reduce the computing power consumption required for rendering.
[0135] In an alternative example, When the percentage is 100%, 60%, 20%, and 0%, respectively, Can be respectively , so that all meshes corresponding to leaf nodes in the third level will show fog effect after rendering, so as to reduce computing power consumption. If it is not 0, This example is only for illustration and is not intended to be limiting.
[0136] S1038. Set the LOD level of the access node as the target level.
[0137] S1039: Determine whether the set of nodes to be traversed is empty.
[0138] In this embodiment, under the premise that the current new pending sum value does not exceed the target ratio of the maximum number of renderable Gaussian points, if the set of nodes to be traversed is empty at this time, it means that the nodes have not been traversed completely, and the preset radius of the target layer can be expanded, that is, the following step S103a is executed and then the above step S1034 is returned to execute. If the set of nodes to be traversed is not empty at this time, the above step S1034 is directly returned to execute.
[0139] S103a, increasing the preset radius of the target level by a set length as a new preset radius of the target level, and then reacquiring a set of nodes to be traversed corresponding to the visited node based on the new preset radius of the target level.
[0140] In this embodiment, when reacquiring the set of nodes to be traversed corresponding to the visited node, the preset adjacent condition corresponding to the target level is still required, but the preset radius of the target level involved in the preset adjacent condition has been increased by a set length.
[0141] Optionally, the size of the set length can be flexibly set, for example, the set length can be 2 or 4 or 5, which is only an example and is not limited here.
[0142] S103b, discard the set of nodes to be traversed, and complete the LOD level setting of the target level.
[0143] In this embodiment, if the new pending sum value exceeds the target ratio of the maximum number of renderable Gaussian points, it means that the number of renderable Gaussian points of the grids corresponding to the leaf nodes of all target levels have been allocated, and then the node traversal of the next level is performed, or the following step S103c is executed.
[0144] It can be understood that the core level, the first level, and the second level are taken as target levels in turn, and for each target level, a round of steps S1033 to S103b needs to be executed.
[0145] S103c, after completing the traversal of the nodes at the core level, the first level, and the second level, the LOD level of all the remaining leaf nodes in the octree that have not been set to the LOD level are set to the third level.
[0146] In this embodiment, after completing the traversal of the nodes at the core level, the first level, and the second level, the LOD level of all the remaining leaf nodes in the octree for which the LOD level is not set is directly set to the third level.
[0147] In an optional implementation, the number of Gaussian points to be rendered corresponding to the third level is In the case of, the sub-steps of the above step S104 may include: S104a, for each leaf node of the octree, if the LOD level of the leaf node is not the third level, the mesh corresponding to the leaf node is used as the active mesh. In the case of LOD level 3, the meshes corresponding to all leaf nodes in the third level are invalid meshes (the Gaussian points in them do not need to be rendered), and the rest of the meshes are activated meshes.
[0148] In another optional implementation, the number of Gaussian points to be rendered at the third level corresponds to In this case, the sub-steps of the above step S104 may include: S1041. For each leaf node whose LOD level in the octree is not the third level, the mesh corresponding to the leaf node is used as the activated mesh.
[0149] S1042. Based on the proportion of the number of Gaussian points to be rendered corresponding to the third level and the third preset ratio, find each existing activated mesh from the meshes corresponding to all leaf nodes whose LOD level in the octree is the third level.
[0150] It can be understood that for the grids corresponding to all leaf nodes of the third level LOD level, due to the proportion of the number of Gaussian points to be rendered corresponding to the third level and the existence of the third preset ratio, the number of Gaussian points that can be rendered is the third preset ratio of the maximum number of Gaussian points that can be rendered, that is, some of these grids may still have the number of renderable Gaussian points allocated to them as 0, which are invalid grids.
[0151] Optionally, sub-steps of step S1042 may include S10421 to S10427:
[0152] S10421, find out the meshes corresponding to all leaf nodes with LOD level of the third level from the octree, and obtain multiple pending meshes;
[0153] S10422, based on the distance between each undetermined grid and the grid where the character is located, all undetermined grids are arranged in descending order;
[0154] S10422, taking the first undetermined grid as the current grid;
[0155] S10423, determining the number of Gaussian points to be rendered in the current grid based on the proportion of the number of Gaussian points to be rendered corresponding to the third level and the number of Gaussian points in the current grid;
[0156] S10424, taking the sum of the pending accumulated value and the number of Gaussian points to be rendered in the current grid as a new pending accumulated value; the initial value of the pending accumulated value is 0;
[0157] S10425, determining whether the new pending accumulated value exceeds a third preset ratio of the maximum number of renderable Gaussian points;
[0158] S10426, after confirming that the current grid is an activated grid, taking the next pending grid as a new activated grid;
[0159] S10427. Confirm that the current grid and all subsequent pending grids are invalid grids.
[0160] In this embodiment, if the judgment result of S10425 is yes, the following step S104265 is performed and then the process returns to S10423. If the judgment result of S10425 is no, step S10427 is performed.
[0161] Through the above steps S10421~S10427, the activated mesh and the invalid mesh can be clearly identified from the meshes corresponding to all leaf nodes of the third level LOD level, and it is ensured that the distance between the found activated mesh and the mesh where the character is located is closer than the distance between the invalid mesh and the mesh where the character is located. That is, during subsequent rendering, among all meshes of the third level LOD level, the Gaussian points in the activated mesh close to the mesh where the character is located will still be partially rendered, while the Gaussian points in the invalid mesh far away from the mesh where the character is located will not be rendered but will present a fog effect, so as to ensure the layering of the rendering.
[0162] In an optional implementation, when sampling all Gaussian points to be rendered in each activated grid from the Gaussian splash file, it is necessary to consider the sampling uniformity of Gaussian points of various colors to ensure that there is no color imbalance in subsequent rendering. Correspondingly, the sub-steps of the above step S105 may include S1051 to S1056.
[0163] S1051. For any activated grid, obtain all Gaussian points in the activated grid from the Gaussian splash file.
[0164] S1052: Classify all Gaussian points in the activated grid according to color to obtain multiple Gaussian point sets. In this embodiment, after classification, the colors of all Gaussian points in each Gaussian point set are of the same type, such as blue, red, and green.
[0165] S1053. Calculate the ratio of the number of Gaussian points in each Gaussian point set to the number of Gaussian points in the activated grid to obtain the occupancy rate of each Gaussian point set.
[0166] S1054, based on the proportion of the number of Gaussian points to be rendered corresponding to the LOD level of the leaf node corresponding to the activated grid, the number of Gaussian points in the activated grid, and the occupancy of each Gaussian point set, calculate the number of sampling points of each Gaussian point set respectively.
[0167] In this embodiment, for a Gaussian point set in an activated grid, the proportion of the number of Gaussian points to be rendered corresponding to the LOD level of the leaf node corresponding to the activated grid, the number of Gaussian points in the activated grid, and the occupancy rate of the Gaussian point set are multiplied in sequence to obtain the number of sampling points M of the Gaussian point set in the activated grid.
[0168] S1055 . Based on the number of sampling points of each Gaussian point set, randomly sample each Gaussian point set respectively, and use each Gaussian point randomly sampled from all Gaussian point sets as a Gaussian point to be rendered in the activated grid.
[0169] In this embodiment, for a Gaussian point set with M sampling points in the activated grid, M Gaussian points are randomly sampled from the Gaussian point set as Gaussian points to be rendered.
[0170] S1056. Traverse each activated grid to obtain all Gaussian points to be rendered in each activated grid.
[0171] In this embodiment, each activated grid executes the above steps S1051 to S1055 to sample all Gaussian points to be rendered in each activated grid.
[0172] It should be noted that the execution order of each step in the above method embodiment is not limited to that shown in the drawings, and the execution order of each step shall be based on the actual application situation.
[0173] In order to execute the corresponding steps in the above method embodiment and various possible implementation modes, an implementation method of a rendering device based on Gaussian splashing is provided below.
[0174] See also Figure 7 , Figure 7 The Gaussian splash-based rendering device 200 includes: an acquisition module 210 , a Gaussian point calculation module 220 , a level update module 230 , a grid determination module 240 , a sampling module 250 , and a depth sorting module 260 .
[0175] An acquisition module 210 is used to acquire a Gaussian splash file, a three-dimensional mesh model, and an octree corresponding to the three-dimensional mesh model of a three-dimensional scene to be rendered; the Gaussian splash file includes a number of Gaussian points, and the three-dimensional mesh model includes a number of meshes;
[0176] Gaussian point calculation module 220, used to calculate the maximum number of renderable Gaussian points in the default rendering mode;
[0177] The level update module 230 is used to calculate the LOD level data of the octree based on the grid where the character is located, the maximum number of Gaussian points that can be rendered, and a preset rendering ratio group; the rendering ratio group reflects that the proportion of the number of Gaussian points to be rendered in each grid diffused outward from the grid where the character is located is gradually reduced;
[0178] A mesh determination module 240 is used to determine each activated mesh existing in the three-dimensional mesh model based on the LOD level data of the octree;
[0179] A sampling module 250, for sampling all Gaussian points to be rendered in each activated grid from the Gaussian splash file based on the rendering ratio group;
[0180] The depth sorting module 260 is used to perform depth sorting on the Gaussian points to be rendered in all activated grids to obtain an ordered array of Gaussian points to be rendered; the ordered array of Gaussian points to be rendered is used to render a scene image of the three-dimensional scene to be rendered.
[0181] Optionally, the rendering device 200 based on Gaussian splashing may further include an updating module 270, which is used to: when it is sensed that the user controls the movement of the character so that the camera position corresponding to the character changes by more than a preset distance, or when it is sensed that the user controls the rotation of the character so that the camera rotation angle corresponding to the character exceeds a preset rotation angle, after updating the grid where the character is located, return to the step of calculating the LOD level data of the octree based on the grid where the character is located, the maximum number of renderable Gaussian points, and the preset rendering ratio group;
[0182] The update module 270 can also be used to, when sensing the user's mode switching operation, obtain the maximum number of renderable Gaussian points corresponding to the target rendering mode specified by the user, and then return to execute the step of calculating the LOD level data of the octree based on the character's mesh, the maximum number of renderable Gaussian points and the preset rendering ratio group.
[0183] Optionally, the rendering mode includes a high frame rate mode, a balanced mode and a high image quality mode; the default rendering mode is the balanced mode. The Gaussian point calculation module 220 can be specifically used to: obtain the ideal target frame rate, the preset initial number of Gaussian points and the initial step size of the high frame rate mode and the high image quality mode; for the target mode, based on the ideal target frame rate, the initial number of Gaussian points and the initial step size of the target mode, calculate the maximum number of renderable Gaussian points of the target mode; the target mode is the high frame rate mode or the high image quality mode; calculate the average of the maximum number of renderable Gaussian points of the high frame rate mode and the maximum number of renderable Gaussian points of the high image quality mode, and obtain the maximum number of renderable Gaussian points of the default rendering mode.
[0184] Optionally, the Gaussian point calculation module 220 can be specifically used to: render a frame of the initialization loading interface according to the initial number of Gaussian points, and obtain a first real-time frame rate when the rendering is completed; if the first real-time frame rate is not lower than the ideal target frame rate, increase the initial number of Gaussian points by the initial step length, and return to execute the step of rendering a frame of the initialization loading interface according to the initial number of Gaussian points, and obtain the first real-time frame rate when the rendering is completed; if the first real-time frame rate is lower than the ideal target frame rate, reduce the current initial number of Gaussian points by the to-be-determined step length to obtain the to-be-determined number of Gaussian points, and the initial value of the to-be-determined step length is a set ratio of the initial step length; render according to the to-be-determined number of Gaussian points The first frame initialization loading interface is rendered, and the second real-time frame rate is obtained when the rendering is completed; when the second real-time frame rate is not equal to the ideal target frame rate, if the pending step length is not equal to the preset minimum step length, the number of pending Gaussian points is reduced by the set proportion of the pending step length, and then the step of rendering a frame initialization loading interface according to the number of pending Gaussian points, and obtaining the second real-time frame rate when the rendering is completed is returned. If the pending step length is equal to the preset minimum step length, the current number of pending Gaussian points is used as the maximum number of renderable Gaussian points; when the second real-time frame rate is equal to the ideal target frame rate, the number of pending Gaussian points is directly used as the maximum number of renderable Gaussian points.
[0185] Optionally, the octree includes a number of leaf nodes, each leaf node corresponds to a mesh in the three-dimensional mesh model; the LOD level data includes the LOD level of each leaf node, the LOD level includes a core level, a first level, a second level and a third level; the rendering ratio group includes the proportion of the number of Gaussian points to be rendered corresponding to each level, and the proportion of the number of Gaussian points to be rendered gradually decreases from the core level to the third level. The level update module 230 can be specifically used for: determining the number of Gaussian points in each grid in the three-dimensional grid model based on the Gaussian splash file; taking the core level, the first level, and the second level as the target level in turn; for each target level, finding each leaf node to be traversed corresponding to the target level that meets the preset adjacent condition from the octree, and arranging them in ascending order based on the distance between the grid corresponding to each leaf node to be traversed and the grid where the character is located to obtain a set of nodes to be traversed; taking any leaf node to be traversed from the set of nodes to be traversed as a visited node; determining the number of Gaussian points to be rendered of the grid corresponding to the visited node based on the proportion of the number of Gaussian points to be rendered corresponding to the target level and the number of Gaussian points of the grid corresponding to the visited node; taking the sum of the pending sum value and the number of Gaussian points to be rendered of the grid corresponding to the visited node as a new pending sum value, and the initial value of the pending sum value is 0; if the new pending sum value does not exceed the target ratio of the maximum number of renderable Gaussian points, the LO of the visited node is set. After the D level is set as the target level, it is determined whether the set of nodes to be traversed is empty; if it is empty, the preset radius of the target level is increased by a set length as the new preset radius of the target level, and then the set of nodes to be traversed corresponding to the visited node is re-acquired based on the new preset radius of the target level, and the step of taking out any leaf node to be traversed from the set of nodes to be traversed as the visited node is returned to be executed; if it is not empty, it directly returns to execute the step of taking out any leaf node to be traversed from the set of nodes to be traversed as the visited node; wherein, the target ratio is one of the preset core ratio, the first preset ratio and the second preset ratio, and the sum of the preset core ratio, the first preset ratio and the second preset ratio is 1; if the new pending sum value exceeds the target ratio of the maximum number of renderable Gaussian points, the node traversal of the target level is completed; after completing the node traversal of the core level, the first level and the second level, the LOD level of all remaining leaf nodes in the octree for which the LOD level has not been set is set to the third level.
[0186] Optionally, the octree includes a plurality of leaf nodes, each leaf node corresponds to a mesh in the three-dimensional mesh model; the LOD level data includes the LOD level of each leaf node, and the LOD level includes a core level, a first level, a second level, and a third level. The mesh determination module 240 can be specifically used to: for each leaf node of the octree, if the LOD level of the leaf node is not the third level, use the mesh corresponding to the leaf node as the active mesh.
[0187] Optionally, the octree includes a number of leaf nodes, each leaf node corresponds to a mesh in the three-dimensional mesh model; the LOD level data includes the LOD level of each leaf node, the LOD level includes the core level, the first level, the second level and the third level; the rendering ratio group includes the proportion of the number of Gaussian points to be rendered corresponding to each level, and the proportion of the number of Gaussian points to be rendered gradually decreases from the core level to the third level; the Gaussian points carry color. The sampling module 250 can be specifically used for: for any activated grid, obtaining all Gaussian points in the activated grid from the Gaussian splash file; classifying all Gaussian points in the activated grid according to color to obtain multiple Gaussian point sets; calculating the ratio of the number of Gaussian points in each Gaussian point set to the number of Gaussian points in the activated grid to obtain the occupancy rate of each Gaussian point set; calculating the number of sampling points of each Gaussian point set based on the proportion of the number of Gaussian points to be rendered corresponding to the LOD level of the leaf node corresponding to the activated grid, the number of Gaussian points in the activated grid and the occupancy rate of each Gaussian point set; based on the number of sampling points of each Gaussian point set, randomly sampling each Gaussian point set, and using each Gaussian point randomly sampled from all Gaussian point sets as the Gaussian point to be rendered in the activated grid; traversing each activated grid to obtain all Gaussian points to be rendered in each activated grid.
[0188] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the rendering device 200 based on Gaussian splashing described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0189] See also Figure 8 , Figure 8 The electronic device 300 includes a processor 310 , a memory 320 , and a bus 330 , wherein the processor 310 is connected to the memory 320 via the bus 330 .
[0190] The memory 320 may be used to store software programs, for example, software programs corresponding to the rendering device 200 based on Gaussian splashing provided in the embodiment of the present invention. The processor 310 executes various functional applications and data processing to implement the rendering method based on Gaussian splashing provided in the embodiment of the present invention by running the software programs stored in the memory 320.
[0191] Among them, the memory 320 can be but is not limited to: RAM (Random Access Memory), ROM (Read Only Memory), FLASH (Flash Memory), PROM (Programmable Read-Only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electric Erasable Programmable Read-Only Memory), etc.
[0192] The processor 310 may be an integrated circuit chip with signal processing capability. The processor 310 may be a general-purpose processor, including: CPU (Central Processing Unit), NP (Network Processor), etc.; it may also be: DSP (Digital Signal Processing), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0193] Understandably, Figure 8 The structure shown is for illustration only. The electronic device 300 may also include Figure 8 More or fewer components as shown, or with Figure 8 Different configurations are shown. Figure 8 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0194] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the rendering method based on Gaussian splashing disclosed in the above embodiment is implemented. The computer-readable storage medium can be, but is not limited to, various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a PROM, an EPROM, an EEPROM, a FLASH disk, or an optical disk.
[0195] In summary, the embodiments of the present invention provide a rendering method, device, electronic device and storage medium based on Gaussian splash, firstly obtaining a Gaussian splash file, a three-dimensional mesh model and an octree corresponding to the three-dimensional mesh model of a three-dimensional scene to be rendered; the Gaussian splash file includes a plurality of Gaussian points, and the three-dimensional mesh model includes a plurality of meshes; calculating the maximum number of renderable Gaussian points of the default rendering mode; calculating the LOD level data of the octree based on the mesh where the character is located, the maximum number of renderable Gaussian points and a preset rendering ratio group; the rendering ratio group reflects that the proportion of the number of Gaussian points to be rendered in each mesh diffused outward from the mesh where the character is located gradually decreases; based on the LOD level data of the octree, determining each activated mesh existing in the three-dimensional mesh model; based on the rendering ratio group, sampling all Gaussian points to be rendered in each activated mesh from the Gaussian splash file; performing depth sorting on the Gaussian points to be rendered in all activated meshes to obtain an ordered array of Gaussian points to be rendered; the ordered array of Gaussian points to be rendered is used to render a scene image of the three-dimensional scene to be rendered. In this way, the LOD level data of the octree is calculated according to the mesh where the character is located, the maximum number of Gaussian points that can be rendered, and the rendering scale group to further determine all activated meshes. Finally, all Gaussian points to be rendered in each activated mesh are sampled based on the rendering scale group, and finally all Gaussian points to be rendered are depth sorted and rendered. In this way, the number of Gaussian points to be rendered is reduced while ensuring the rendering effect of the mesh where the character is located and its surroundings, effectively reducing the computing power required for rendering.
[0196] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A rendering method based on Gaussian splashing, characterized in that: include: Obtain a Gaussian splash file, a three-dimensional mesh model, and an octree corresponding to the three-dimensional mesh model of a three-dimensional scene to be rendered; The Gaussian splash file includes a plurality of Gaussian points, and the three-dimensional grid model includes a plurality of grids; Calculate the maximum number of renderable Gaussian points for the default rendering mode; Calculate the LOD level data of the octree based on the grid where the character is located, the maximum number of renderable Gaussian points, and a preset rendering scale group; The rendering ratio group reflects that the proportion of the number of Gaussian points to be rendered in each grid diffused outward from the grid where the character is located is gradually reduced; Based on the LOD level data of the octree, determine each activated mesh existing in the three-dimensional mesh model; Based on the rendering ratio group, sampling all Gaussian points to be rendered in each of the activated grids from the Gaussian splash file; Depth sorting of the Gaussian points to be rendered in all activated grids is performed to obtain an ordered array of Gaussian points to be rendered; the ordered array of Gaussian points to be rendered is used to render a scene image of the three-dimensional scene to be rendered; The rendering modes include a high frame rate mode, a balanced mode, and a high image quality mode; the default rendering mode is the balanced mode; and the step of calculating the maximum number of renderable Gaussian points of the default rendering mode includes: Obtaining the ideal target frame rate, the preset number of initial Gaussian points and the initial step size of each of the high frame rate mode and the high image quality mode; For a target mode, based on an ideal target frame rate, an initial number of Gaussian points, and an initial step size of the target mode, a maximum number of renderable Gaussian points of the target mode is calculated; the target mode is the high frame rate mode or the high image quality mode; Calculating the average of the maximum number of Gaussian points that can be rendered in the high frame rate mode and the maximum number of Gaussian points that can be rendered in the high image quality mode to obtain the maximum number of Gaussian points that can be rendered in the default rendering mode; The step of calculating the maximum number of renderable Gaussian points of the target mode based on the ideal target frame rate, the initial number of Gaussian points and the initial step size of the target mode comprises: Rendering a frame of initialization loading interface according to the initial number of Gaussian points, and obtaining a first real-time frame rate when rendering is completed; If the first real-time frame rate is not lower than the ideal target frame rate, after increasing the initial number of Gaussian points by the initial step size, returning to the step of rendering a frame of the initialization loading interface according to the initial number of Gaussian points, and obtaining the first real-time frame rate when the rendering is completed; If the first real-time frame rate is lower than the ideal target frame rate, the current number of initial Gaussian points is reduced by a pending step length to obtain a pending Gaussian point number, wherein the initial value of the pending step length is a set ratio of the initial step length; Rendering a frame of initialization loading interface according to the undetermined number of Gaussian points, and obtaining a second real-time frame rate when rendering is completed; In the case where the second real-time frame rate is not equal to the ideal target frame rate, if the pending step length is not equal to the preset minimum step length, then after reducing the number of pending Gaussian points by the set ratio of the pending step length, returning to the step of rendering a frame of the initialization loading interface according to the pending Gaussian point number, and obtaining the second real-time frame rate when the rendering is completed, if the pending step length is equal to the preset minimum step length, then using the current number of pending Gaussian points as the maximum number of renderable Gaussian points; When the second real-time frame rate is equal to the ideal target frame rate, the undetermined number of Gaussian points is directly used as the maximum number of renderable Gaussian points.
2. The method according to claim 1, characterized in that: The octree includes a plurality of leaf nodes, each of which corresponds to a mesh in the three-dimensional mesh model; the LOD level data includes the LOD level of each leaf node, and the LOD level includes a core level, a first level, a second level, and a third level; the rendering ratio group includes a ratio of the number of Gaussian points to be rendered corresponding to each level, and the ratio of the number of Gaussian points to be rendered gradually decreases from the core level to the third level; The step of calculating the LOD level data of the octree based on the grid where the character is located, the maximum number of renderable Gaussian points, and a preset rendering ratio group includes: Based on the Gaussian splatter file, determining the number of Gaussian points in each of the grids in the three-dimensional grid model; sequentially taking the core level, the first level, and the second level as target levels; For each target level, find each to-be-traversed leaf node corresponding to the target level that meets the preset adjacent condition from the octree, and arrange the nodes in ascending order based on the distance between the grid corresponding to each to-be-traversed leaf node and the grid where the character is located to obtain a set of nodes to be traversed; Take any leaf node to be traversed from the set of nodes to be traversed as a visit node; Determine the number of Gaussian points to be rendered in the grid corresponding to the access node based on the proportion of the number of Gaussian points to be rendered corresponding to the target level and the number of Gaussian points in the grid corresponding to the access node; The sum of the pending sum value and the number of Gaussian points to be rendered of the grid corresponding to the access node is taken as a new pending sum value, where the initial value of the pending sum value is 0; If the new pending sum value does not exceed the target ratio of the maximum number of renderable Gaussian points, the LOD level of the visited node is set to the target level and then it is determined whether the set of nodes to be traversed is empty; if it is empty, the preset radius of the target level is increased by a set length as the new preset radius of the target level and then the set of nodes to be traversed corresponding to the visited node is re-acquired based on the new preset radius of the target level, and the step of taking out any leaf node to be traversed from the set of nodes to be traversed as a visited node is returned to be executed; if it is not empty, the step of taking out any leaf node to be traversed from the set of nodes to be traversed as a visited node is directly returned to be executed; wherein, the target ratio is one of a preset core ratio, a first preset ratio and a second preset ratio, and the sum of the preset core ratio, the first preset ratio and the second preset ratio is 1; If the new pending sum value exceeds the target ratio of the maximum number of renderable Gaussian points, completing the node traversal of the target level; After completing the node traversal of the core level, the first level, and the second level, the LOD level of all the remaining leaf nodes in the octree that are not set with the LOD level is set to the third level.
3. The method according to claim 1, characterized in that The octree includes a plurality of leaf nodes, each of which corresponds to a mesh in the three-dimensional mesh model; the LOD level data includes the LOD level of each leaf node, and the LOD level includes a core level, a first level, a second level, and a third level; The step of determining each activated mesh existing in the three-dimensional mesh model based on the LOD level data of the octree comprises: For each leaf node of the octree, if the LOD level of the leaf node is not the third level, the mesh corresponding to the leaf node is used as the activated mesh.
4. The method according to claim 1, characterized in that: The octree includes a plurality of leaf nodes, each of which corresponds to a mesh in the three-dimensional mesh model; the LOD level data includes the LOD level of each leaf node, and the LOD level includes a core level, a first level, a second level, and a third level; the rendering ratio group includes the proportion of the number of Gaussian points to be rendered corresponding to each level, and the proportion of the number of Gaussian points to be rendered gradually decreases from the core level to the third level; the Gaussian points carry colors; The step of sampling all Gaussian points to be rendered in each of the activated grids from the Gaussian splash file based on the rendering ratio group comprises: For any of the activated grids, obtaining all Gaussian points in the activated grid from the Gaussian splash file; Classifying all Gaussian points in the activation grid according to the colors to obtain multiple Gaussian point sets; Respectively calculating the ratio of the number of Gaussian points in each Gaussian point set to the number of Gaussian points in the activation grid to obtain the occupancy rate of each Gaussian point set; Based on the proportion of the number of Gaussian points to be rendered corresponding to the LOD level of the leaf node corresponding to the activated grid, the number of Gaussian points in the activated grid, and the occupancy rate of each Gaussian point set, respectively calculate the number of sampling points of each Gaussian point set; Based on the number of sampling points of each Gaussian point set, each Gaussian point set is randomly sampled respectively, and each Gaussian point randomly sampled from all Gaussian point sets is used as a Gaussian point to be rendered in the activation grid; Each of the activated grids is traversed to obtain all Gaussian points to be rendered in each of the activated grids.
5. The method according to claim 1, characterized in that The method further comprises: When it is sensed that the user manipulates the character to move so that the position of the camera corresponding to the character changes by more than a preset distance, or when it is sensed that the user manipulates the character to rotate so that the rotation angle of the camera corresponding to the character exceeds a preset rotation angle, after updating the grid where the character is located, returning to execute the step of calculating the LOD level data of the octree based on the grid where the character is located, the maximum number of renderable Gaussian points, and the preset rendering ratio group; or, When the user's mode switching operation is sensed, after obtaining the maximum number of renderable Gaussian points corresponding to the target rendering mode specified by the user, return to execute the step of calculating the LOD level data of the octree based on the grid where the character is located, the maximum number of renderable Gaussian points and the preset rendering ratio group.
6. A rendering device based on Gaussian splashing, characterized in that: include: An acquisition module, used to acquire a Gaussian splash file, a three-dimensional mesh model, and an octree corresponding to the three-dimensional mesh model of a three-dimensional scene to be rendered; The Gaussian splash file includes a plurality of Gaussian points, and the three-dimensional grid model includes a plurality of grids; Gaussian point calculation module, used to calculate the maximum number of renderable Gaussian points for the default rendering mode; A level update module, used to calculate the LOD level data of the octree based on the mesh where the character is located, the maximum number of renderable Gaussian points and a preset rendering scale group; The rendering ratio group reflects that the proportion of the number of Gaussian points to be rendered in each grid diffused outward from the grid where the character is located is gradually reduced; A mesh determination module, configured to determine each activated mesh existing in the three-dimensional mesh model based on the LOD level data of the octree; A sampling module, configured to sample all Gaussian points to be rendered in each of the activated grids from the Gaussian splash file based on the rendering ratio group; A depth sorting module, used for performing depth sorting on the Gaussian points to be rendered in all activated grids to obtain an ordered array of Gaussian points to be rendered; the ordered array of Gaussian points to be rendered is used to render a scene image of the three-dimensional scene to be rendered; Among them, the rendering mode includes a high frame rate mode, a balanced mode and a high image quality mode; the default rendering mode is the balanced mode; the Gaussian point calculation module is specifically used to: obtain the ideal target frame rate, the preset initial number of Gaussian points and the initial step size of the high frame rate mode and the high image quality mode respectively; for the target mode, based on the ideal target frame rate, the initial number of Gaussian points and the initial step size of the target mode, calculate the maximum number of renderable Gaussian points of the target mode; the target mode is the high frame rate mode or the high image quality mode; calculate the average of the maximum number of renderable Gaussian points of the high frame rate mode and the maximum number of renderable Gaussian points of the high image quality mode, and obtain the maximum number of renderable Gaussian points of the default rendering mode; Among them, when the Gaussian point calculation module is used to calculate the maximum number of renderable Gaussian points of the target mode based on the ideal target frame rate, the initial number of Gaussian points and the initial step size of the target mode, it is specifically used to: render a frame of initialization loading interface according to the initial number of Gaussian points, and obtain a first real-time frame rate when rendering is completed; if the first real-time frame rate is not lower than the ideal target frame rate, then increase the initial number of Gaussian points by the initial step size, and return to execute the step of rendering a frame of initialization loading interface according to the initial number of Gaussian points, and obtaining the first real-time frame rate when rendering is completed; if the first real-time frame rate is lower than the ideal target frame rate, then reduce the current initial number of Gaussian points by a to-be-determined step size to obtain a to-be-determined number of Gaussian points, and the initial value of the to-be-determined step size is the initial A setting ratio of the step length; according to the pending number of Gaussian points, rendering a frame of initialization loading interface, and obtaining a second real-time frame rate when rendering is completed; when the second real-time frame rate is not equal to the ideal target frame rate, if the pending step length is not equal to the preset minimum step length, reducing the pending number of Gaussian points by the set ratio of the pending step length, returning to execute the step of rendering a frame of initialization loading interface according to the pending number of Gaussian points, and obtaining the second real-time frame rate when rendering is completed, if the pending step length is equal to the preset minimum step length, using the current pending number of Gaussian points as the maximum number of renderable Gaussian points; when the second real-time frame rate is equal to the ideal target frame rate, directly using the pending number of Gaussian points as the maximum number of renderable Gaussian points.
7. An electronic device, characterized in that: include: A memory and a processor, wherein the memory stores a software program, and when the electronic device is running, the processor executes the software program to implement the Gaussian splash-based rendering method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the rendering method based on Gaussian splattering according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Face high-fidelity and drivable reconstruction method based on three-dimensional Gaussian splashing
CN118736108A
Method for recovering highlight details based on three-dimensional Gaussian point cloud splashing algorithm
CN118736125A
