A rendering display method, device, computer device, and storage medium
By obtaining point cloud point slope information of rock terrain in the game scene, dividing and cutting the skin area into plots, matching the skin patch data for rendering, the problem of low manual drawing efficiency is solved, and efficient and real rock terrain rendering is achieved.
Patent Information
- Application Number
- CN202210335189.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-31
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2042-03-31
AI Technical Summary
In game scenes, the way of drawing rock terrain by hand is inefficient, making it difficult to efficiently render widely distributed mountain terrain.
By obtaining the point cloud point slope information of the target model, the skin area is divided, and further cut into skin plots according to the surface characteristics, matching the skin patch data of the calibrated skin plot for rendering.
It improves the efficiency of rock terrain rendering, can better reflect the differences between mountains and rivers, and improves the authenticity of rendering display.
Smart Images

Figure CN114663565B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technologies, and in particular, to a rendering and display method, apparatus, computer device, and storage medium. Background Art
[0002] In application scenarios such as games, there is a need to construct a scene, for example, a game scene, where there are many mountains and rivers with rocky landforms distributed in the game scene. In some possible cases, the rocky terrain of the mountains and rivers is rendered by manual drawing to enhance the authenticity of the mountains and rivers when displayed. However, since the mountains and rivers are widely distributed in the scene, if the manual drawing method is used, the workload will be large, resulting in low efficiency. Summary of the Invention
[0003] Embodiments of the present disclosure at least provide a rendering and display method, apparatus, computer device, and storage medium.
[0004] In a first aspect, an embodiment of the present disclosure provides a rendering and display method, including: obtaining a target model of a rocky terrain to be rendered, and determining a skinning area for rendering the rocky terrain of the target model based on the slope information corresponding to each point cloud point in the target model; dividing the skinning area into skinning plots for rendering the rocky terrain based on the surface features corresponding to the skinning area, to obtain at least one skinning plot for rendering the rocky terrain; for any skinning plot, matching a corresponding target calibrated skinning plot from the preset calibrated skinning plots for the skinning plot, and determining corresponding target skinning patch data for the skinning plot based on the skinning patch data corresponding to the target calibrated skinning plot; and rendering and displaying the rocky terrain of the target model based on the determined target skinning patch data corresponding to each skinning plot.
[0005] In an optional implementation manner, the determining a skinning area for rendering the rocky terrain of the target model based on the slope information corresponding to each point cloud point in the target model includes: screening target point cloud points whose corresponding slope information is within the slope range from the respective point cloud points based on the slope information corresponding to the respective point cloud points and a preset slope range determined for the rocky terrain; and determining the skinning area based on the position information of the target point cloud points in the target model.
[0006] In an alternative implementation, before dividing the skin area into at least one skin plot for rendering the rock terrain based on the surface features corresponding to the skin area, the method further includes: performing pre-cutting processing on the skin area to obtain each sub-skin area of the skin area; the dividing the skin area into at least one skin plot for rendering the rock terrain based on the surface features corresponding to the skin area includes: determining the surface features corresponding to each sub-skin area based on the surface features corresponding to the skin area; and dividing each sub-skin area into the at least one skin plot based on the surface features corresponding to each sub-skin area respectively.
[0007] In an alternative implementation, the performing pre-cutting processing on the skin area to obtain each sub-skin area of the skin area includes: performing pre-cutting processing on the skin area based on a plurality of preset plane directions to obtain the sub-skin areas corresponding to the skin area in the plurality of plane directions respectively.
[0008] In an alternative implementation, it further includes: in response to the length of the sub-skin area in any plane direction exceeding a preset length threshold in a preset direction, performing secondary cutting processing on the sub-skin area in the preset direction to update each sub-skin area corresponding to the skin area.
[0009] In an alternative implementation, the performing pre-cutting processing on the skin area to obtain each sub-skin area of the skin area includes: in response to a hole-shaped skin area being included in the skin area, determining a corresponding cutting line for the hole-shaped skin area; the cutting line is used to split the hole-shaped skin area into a plurality of non-connected skin areas; and performing pre-cutting processing on the hole-shaped skin area based on the cutting line determined for the hole-shaped skin area to obtain each sub-skin area of the hole-shaped skin area.
[0010] In an alternative implementation, the dividing each sub-skin area into the at least one skin plot based on the surface features corresponding to each sub-skin area respectively includes: for any sub-skin area, determining a plot division auxiliary line for the sub-skin area based on the surface features corresponding to the sub-skin area; and dividing the sub-skin area into at least one skin plot corresponding to the sub-skin area based on the plot division auxiliary line determined for the sub-skin area.
[0011] In an alternative embodiment, the method of dividing the skin area of the sub-skin area into at least one skin plot corresponding to the sub-skin area based on the plot division auxiliary line determined for the sub-skin area includes: determining a plurality of division nodes on the plot division auxiliary line; for any division node, dividing the sub-skin area into at least one skin plot associated with the division node in the sub-skin area based on the preset division size of the skin plot and the position of the division node on the plot division auxiliary line.
[0012] In a second aspect, an embodiment of the present disclosure further provides a rendering display device, including: a first processing module, configured to obtain a target model of a rock terrain to be rendered, and determine a skin area of the rock terrain to be rendered for the target model based on the slope information corresponding to each point cloud point in the target model; a division module, configured to divide the skin area into at least one skin plot of the rock terrain to be rendered based on the surface features corresponding to the skin area; a second processing module, configured to match a corresponding target calibrated skin plot for any skin plot from the preset calibrated skin plots, and determine corresponding target skin patch data for the skin plot based on the skin patch data corresponding to the target calibrated skin plot; a rendering display module, configured to render and display the rock terrain of the target model based on the determined target skin patch data corresponding to each skin plot.
[0013] In an alternative embodiment, when determining the skin area of the rock terrain to be rendered for the target model based on the slope information corresponding to each point cloud point in the target model, the first processing module is configured to: screen out target point cloud points with slope information within the slope range from the point cloud points based on the slope information corresponding to each point cloud point and the preset slope range determined for the rock terrain; determine the skin area based on the position information of the target point cloud points in the target model.
[0014] In an alternative embodiment, before dividing the skin area into at least one skin plot of the rock terrain to be rendered based on the surface features corresponding to the skin area, the division module is further configured to: perform pre-cutting processing on the skin area to obtain each sub-skin area of the skin area; when dividing the skin area into at least one skin plot of the rock terrain to be rendered based on the surface features corresponding to the skin area, the division module is configured to: determine the surface features corresponding to each sub-skin area based on the surface features corresponding to the skin area; divide each sub-skin area into the at least one skin plot based on the surface features corresponding to each sub-skin area.
[0015] In an alternative embodiment, when the partitioning module performs pre-cutting on the skin area to obtain each sub-skin area of the skin area, it is configured to: perform pre-cutting on the skin area based on a plurality of preset plane directions, so as to obtain sub-skin areas corresponding to the skin area in the plurality of plane directions respectively.
[0016] In an alternative embodiment, the partitioning module is further configured to: in response to the length of the sub-skin area in any plane direction exceeding a preset length threshold in a preset direction, perform secondary cutting on the sub-skin area in the preset direction to update each sub-skin area corresponding to the skin area.
[0017] In an alternative embodiment, when the partitioning module performs pre-cutting on the skin area to obtain each sub-skin area of the skin area, it is configured to: in response to a hole-shaped skin area being included in the skin area, determine a corresponding cutting line for the hole-shaped skin area; the cutting line is used to split the hole-shaped skin area into a plurality of non-connected skin areas;
[0018] Based on the cutting line determined for the hole-shaped skin area, perform pre-cutting on the hole-shaped skin area to obtain each sub-skin area of the hole-shaped skin area.
[0019] In an alternative embodiment, when the partitioning module performs skin plot partitioning on each sub-skin area respectively based on the surface features corresponding to each sub-skin area to obtain the at least one skin plot, it is configured to: for any sub-skin area, determine a plot partitioning auxiliary line for the sub-skin area based on the surface feature corresponding to the sub-skin area; based on the plot partitioning auxiliary line determined for the sub-skin area, perform skin plot partitioning on the sub-skin area to obtain at least one skin plot corresponding to the sub-skin area.
[0020] In an alternative embodiment, when the partitioning module performs skin plot partitioning on the sub-skin area based on the plot partitioning auxiliary line determined for the sub-skin area to obtain at least one skin plot corresponding to the sub-skin area, it is configured to: determine a plurality of partitioning nodes on the plot partitioning auxiliary line; for any partitioning node, perform skin plot partitioning on the sub-skin area based on a preset partitioning size of the skin plot and the position of the partitioning node on the plot partitioning auxiliary line, so as to obtain at least one skin plot associated with the partitioning node in the sub-skin area.
[0021] In a third aspect, an alternative implementation of the present disclosure also provides a computer device, including a processor and a memory. The memory stores machine-readable instructions executable by the processor. The processor is configured to execute the machine-readable instructions stored in the memory. When the machine-readable instructions are executed by the processor, the machine-readable instructions are configured to execute the steps in the first aspect or any possible implementation manner in the first aspect.
[0022] In a fourth aspect, an alternative implementation of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run, it executes the steps in the first aspect or any possible implementation manner in the first aspect.
[0023] For the effect description of the above rendering display device, computer device, and computer-readable storage medium, refer to the description of the above rendering display method, which will not be elaborated here.
[0024] After obtaining the target model of the rock terrain to be rendered in the rendering display method, device, computer device, and storage medium provided by the embodiments of the present disclosure, first, according to the slope information corresponding to each point cloud point, the skinning area of the rock terrain to be rendered can be determined for the target model. In order to more quickly determine the different skinning patch data to be used when rendering the rock terrain at different positions for the skinning area, the skinning area can be further cut into skinning plots according to the corresponding surface features, and by presetting different calibrated skinning plots and the corresponding skinning patch data when rendering the rock terrain, the corresponding skinning patch data can be determined for each skinning plot in the skinning area, so as to render and display the rock terrain of the target model. In this way, by dividing the skinning plots according to the surface features of the skinning area, while the skinning plots can reflect the differences of mountains and rivers, it is easier to determine the corresponding skinning patch data through matching with the calibrated skinning plots, and the terrain rendering efficiency is relatively high.
[0025] To make the above objects, features, and advantages of the present disclosure more obvious and understandable, the following specific preferred embodiments are given, and in conjunction with the accompanying drawings, the detailed description is as follows. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] To more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following will briefly introduce the accompanying drawings required for the embodiments. The accompanying drawings are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and, together with the specification, are used to explain the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate some embodiments of the present disclosure and should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other related drawings can be obtained based on these drawings.
[0027] Figure 1 Shows a flowchart of a rendering display method provided by an embodiment of the present disclosure;
[0028] Figure 2 Shows a schematic diagram of a target model provided by an embodiment of the present disclosure;
[0029] Figure 3 Shows a schematic diagram of an auxiliary line for plot division provided by an embodiment of the present disclosure;
[0030] Figure 4 Shows a schematic diagram of a plurality of skinned plots provided by an embodiment of the present disclosure;
[0031] Figure 5 Shows a schematic diagram of a specific determination of skinned plots provided by an embodiment of the present disclosure;
[0032] Figure 6 Shows a schematic diagram of another specific determination of skinned plots provided by an embodiment of the present disclosure;
[0033] Figure 7 Shows a schematic diagram of a target model for rendering a rocky terrain provided by an embodiment of the present disclosure;
[0034] Figure 8 Shows a schematic diagram of a rendering display device provided by an embodiment of the present disclosure;
[0035] Figure 9 Shows a schematic diagram of a computer device provided by an embodiment of the present disclosure. Detailed implementation manners
[0036] To make the objectives, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only a part rather than all of the embodiments of the present disclosure. The components of the embodiments of the present disclosure described and illustrated herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure is not intended to limit the scope of the present disclosure claimed, but merely represents selected embodiments of the present disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of the present disclosure without creative efforts fall within the scope of protection of the present disclosure.
[0037] According to research, when constructing larger scenes such as game scenes, in order to improve realism, there may be a need to render rocky terrain in a large area of mountains and rivers. Since the trends, slopes, surface features, etc. of mountains and rivers at different locations in the scene are different, when rendering rocky terrain, the mountains and rivers are not directly rendered in the same rocky terrain. Instead, different rocky terrains are rendered in a targeted manner according to the differences in the mountains and rivers. Therefore, manual drawing is usually used to render rocky terrain for mountains and rivers, but since mountains and rivers are widely distributed in the scene, this manual drawing method will be more labor-intensive and result in low efficiency.
[0038] Based on the above research, the present disclosure provides a rendering and display method. After obtaining the target model of the rock terrain to be rendered, the skin area of the rock terrain to be rendered can be determined for the target model first according to the slope information corresponding to each point cloud point. In order to more quickly determine the different skin patch data selected for rendering the rock terrain at different positions for the skin area, the skin area can be further cut into skin plots according to the corresponding surface features, and by presetting different calibrated skin plots and the corresponding skin patch data when rendering the rock terrain, the corresponding skin patch data is determined for each skin plot in the skin area, thereby rendering and displaying the rock terrain of the target model. In this way, the skin plots are divided according to the surface features of the skin area, so that the skin plots can reflect the differences in mountains and rivers, and the corresponding skin patch data can be more easily determined by matching with the calibrated skin plots, and the terrain rendering efficiency is higher.
[0039] The defects existing in the above solutions are the results obtained by the inventor after practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed by the present disclosure for the above problems below should be the contributions made by the inventor to the present disclosure during the disclosure process.
[0040] 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.
[0041] To facilitate the understanding of this embodiment, first, a rendering and display method disclosed in the embodiments of the present disclosure will be introduced in detail. The execution subject of the rendering and display method provided in the embodiments of the present disclosure is generally a computer device with certain computing capabilities. Such a computer device includes, for example: a terminal device, a server, or other processing devices. The terminal device may be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementation manners, the rendering and display method may be implemented by a processor calling computer-readable instructions stored in a memory.
[0042] The rendering and display method provided in the embodiments of the present disclosure can be applied to scenarios such as the game field and the production of animation and film and television. For example, in the game field, it is applied to the production of game scenes, or in the production scene of animation and film and television, it is applied to the production of animation scenes. In game scenes or animation scenes, a variety of landscaping objects are usually designed, such as mountains, rivers, deserts, etc. For mountain landscaping, in order to utilize the mountains to enhance the authenticity of the scene, according to the characteristics of large range and continuity of mountains in the real scene, a large range of laying is carried out in the scene. Here, the laid mountain landscaping, that is, the target model that can be obtained. After obtaining the target model, by using the rendering and display method provided in the embodiments of the present disclosure, it is also possible to determine the skin patch data corresponding to the target model under the skinning plots with a smaller granularity, so as to use the skin patch data to render and display a rocky terrain for the mountains, thereby improving the authenticity.
[0043] The rendering and display method provided in the embodiments of the present disclosure will be described below.
[0044] See Figure 1 As shown, it is a flowchart of a rendering and display method provided in the embodiments of the present disclosure. The method includes steps S101 to S104, where:
[0045] S101: Obtain a target model of a rocky terrain to be rendered, and based on the slope information corresponding to each point cloud point in the target model, determine a skinning area for the target model to render the rocky terrain;
[0046] S102: Based on the surface features corresponding to the skinning area, divide the skinning area into skinning plots to obtain at least one skinning plot for rendering the rocky terrain;
[0047] S103: For any skin plot, match the corresponding target calibrated skin plot from the preset calibrated skin plots for this skin plot, and based on the skin patch data corresponding to the target calibrated skin plot, determine the corresponding target skin patch data for this skin plot;
[0048] S104: Based on the target skin patch data corresponding to each determined skin plot respectively, render and display the rock terrain of the target model.
[0049] The above S101 - S104 will be described in detail below.
[0050] Regarding the above S101, first, the target model will be described. Here, the target model specifically includes the model of the rock terrain to be rendered, such as the mountains and rivers laid on the game scene or the animation scene. In a possible case, all or selected partial areas of the mountains and rivers laid in the scene can be used as the determined target model. For the target model, it can specifically be composed of point cloud points. By setting different positions for different point cloud points, the target model can display characteristics similar to the mountains and rivers in the real scene. For example, the undulating shape of the mountains and rivers can be formed by point clouds with varying heights.
[0051] Since in the real scene, the mountains and rivers include relatively steep areas covered with rocks and relatively flat areas covered with vegetation, etc., when rendering the rock terrain for the target model, the slope information corresponding to each point cloud point in the target model will also be used to determine the skin area of the rock terrain to be rendered for the target model.
[0052] In a possible case, when determining the skin area of the rock terrain to be rendered for the target model, the following method can be specifically adopted: Based on the slope information corresponding to each of the point cloud points and the preset slope range determined for the rock terrain, screen out the target point cloud points whose corresponding slope information is within the slope range from the point cloud points; Based on the position information of the target point cloud points in the target model, determine the skin area.
[0053] Among them, when determining the slope information corresponding to each point cloud point, specifically, the reference point cloud points used to represent the bottom boundary of the target model can be determined from the point cloud points based on the position information corresponding to each of the point cloud points; For each point cloud point among the point cloud points, based on the position information corresponding to this point cloud point and the position information corresponding to multiple reference point cloud points respectively, determine the distance information corresponding between this point cloud point and the multiple reference point cloud points respectively; Based on the distance information corresponding between this point cloud point and the multiple reference point cloud points respectively, determine the corresponding target reference point cloud point among the multiple reference point cloud points; Based on the position information corresponding to this point cloud point and the reference position information corresponding to the target reference point cloud point, determine the slope information corresponding to this point cloud point.
[0054] After determining the position information corresponding to each point cloud point, the reference point cloud points located on the bottom boundary in the target model can be determined. At the position where the bottom boundary is located, there are specifically also multiple point cloud points, which are referred to as reference point cloud points here. For any point cloud point among the point cloud points, according to the position information corresponding to the point cloud point and the position information corresponding to each reference point cloud point, the distance information corresponding to the point cloud point between multiple reference point cloud points can be determined, so as to further select the reference point cloud point with the smallest corresponding distance information as the target reference point cloud point corresponding to the point cloud point. In the case where the corresponding target reference point cloud point is determined, according to the position information corresponding to the point cloud point and the position information corresponding to the target reference point cloud point, the included angle between the connection line of the point cloud point and the target reference point cloud point and the bottom boundary can be determined as the slope information corresponding to the point cloud point.
[0055] Here, the above-mentioned method for determining the slope information for the point cloud point is only a specific example provided by the embodiments of the present disclosure, and other optional methods for determining the slope information for the point cloud point are within the protection scope of the present disclosure. In specific implementation, the method for determining the slope information is not limited either.
[0056] For the rock terrain to be rendered, according to the distribution law of rocks in the real scene, it can be known that the rock terrain usually exists within a certain slope range on the mountains and rivers. Therefore, a preset slope range can be determined for the rock terrain, and then according to the slope information of each point cloud point determined for the target model, the target point cloud points with the corresponding slope information within the slope range can be screened out from the point cloud points, so as to use the position information of the target point cloud points in the target model to determine the skinning area of the mountain and river terrain to be rendered for the target model.
[0057] Exemplarily, refer to Figure 2 As shown, it is a schematic diagram of a target model provided by the embodiments of the present disclosure. By screening the slope range of each point cloud point in the target model, the target point cloud points can be determined on the surface of the target model to form a dark skinning area.
[0058] Regarding the above S102, since the target model may be widely distributed, the actually occupied area of the determined skinning area may be large or may be relatively scattered. Therefore, in order to perform the rendering of the rock terrain more pertinently, before dividing the skinning area into skinning plots, specifically, the skinning area can also be pre-cut to obtain each sub-skinning area of the skinning area, so as to reduce the size of the area occupied by the skinning area when dividing the skinning plots.
[0059] In a specific implementation, when performing pre-cutting on the skin area, pre-cutting can be performed on the skin area based on a plurality of preset plane directions to obtain sub-skin areas corresponding to the skin area in each of the plurality of plane directions.
[0060] Exemplarily, a plurality of preset plane directions can be determined, for example, according to the model coordinate system of the target model. For example, the plane direction formed by any two coordinate axes in the model coordinate system can be used as the preset plane direction. In this way, the plurality of sub-skin areas cut out also have characteristics in the plane direction, such as corresponding to the plane direction reflecting flat terrain or the plane direction reflecting steep terrain.
[0061] In addition, since the skin area is determined by screening the point cloud points in the target model according to the slope information, there may be a problem that the occupied area of the sub-skin area corresponding to the plane direction reflecting steep terrain is still too large. In this case, secondary cutting can be performed on the sub-skin area, and the sub-skin areas corresponding to the skin area can be updated.
[0062] In a specific implementation, for example, the following method is adopted: in response to the length of the sub-skin area in any plane direction exceeding a preset length threshold in a preset direction, secondary cutting is performed on the sub-skin area in the preset direction, and the sub-skin areas corresponding to the skin area are updated.
[0063] Among them, the preset length threshold can be determined according to the actual situation. For example, according to the preset division size of the skin plot after cutting, the maximum length when dividing the sub-skin area can be determined. Or, according to the actual computing power of the computer device, the maximum occupied area of the sub-skin area when the sub-skin area can be divided into skin plots can be determined to calculate the maximum length of the sub-skin area in the preset direction. Here, the method of setting the preset length threshold can be determined according to the actual situation and is not limited here.
[0064] In a possible situation, the skin area can also include a hole-shaped skin area. Since the inner surface of the hole-shaped skin area is circular, the normal vectors corresponding to the point cloud points therein will have opposite direction changes. Therefore, the normal vectors of the point cloud points in the skin area can be used to determine whether a certain position in the skin area is a hole-shaped skin area. Since the hole-shaped skin area is a connected area, directly cutting the hole-shaped skin area into skin plots may result in the obtained skin plots being concave polygons, and it is difficult to match such concave polygon skin plots with the calibrated skin plots. Therefore, the hole-shaped skin area will be cut, and then the sub-skin areas after cutting will be used for the division of skin plots to avoid obtaining concave polygon skin plots.
[0065] Specifically, when it is determined that the skin area includes a hole-shaped skin area, a corresponding cutting line can be determined for the hole-shaped skin area. The cutting line is used to split the hole-shaped skin area into multiple non-connected skin areas. Exemplarily, the cutting line can include a straight line in the maximum depth direction of the hole-shaped skin area to perform pre-cutting processing on the hole-shaped skin area to obtain two sub-skin areas. Alternatively, the cutting line can also include multiple lines to further reduce the area occupied by each sub-skin area obtained after cutting, facilitating the subsequent cutting of the skin plots.
[0066] In a possible case, there may be a situation where the obtained sub-skin areas share vertices. If, when performing the cutting of the skin plots on the sub-skin areas, the sub-skin areas sharing vertices are used to determine the auxiliary line for plot division during cutting, the sub-skin areas sharing vertices may cause errors in determining the auxiliary line for plot division. For specific details, refer to the following description of the auxiliary line for plot division, which will not be elaborated here. To avoid such problems, for the sub-skin areas sharing vertices, the vertex positions of the vertices shared by a certain sub-skin area can be adjusted so that there are no shared vertices between the sub-skin areas, thereby enabling the accurate determination of the auxiliary line for plot division using the sub-skin areas.
[0067] In the case where each sub-skin area is obtained after pre-cutting processing, according to the surface characteristics corresponding to the skin area, the surface characteristics corresponding to each sub-skin area can be determined. Specifically, based on the surface characteristics corresponding to each sub-skin area respectively, each sub-skin area can be respectively divided into skin plots to obtain at least one skin plot, thereby using the skin plots to determine the skin patch data when rendering the rock terrain.
[0068] In a specific implementation, when dividing each sub-skin area into skin plots respectively, the following method can be adopted: for any sub-skin area, based on the surface characteristics corresponding to the sub-skin area, an auxiliary line for plot division is determined for the sub-skin area; based on the auxiliary line for plot division determined for the sub-skin area, the sub-skin area is divided into skin plots to obtain at least one skin plot corresponding to the sub-skin area.
[0069] Specifically, when determining the auxiliary line for plot division according to the surface characteristics corresponding to the sub-skin area, refer to Figure 3As shown, it is a schematic diagram of an auxiliary line for plot division provided by an embodiment of the present disclosure. According to the schematic diagram, when determining the auxiliary line for plot division by using the surface features corresponding to the sub-skin area, for example, the point cloud points at the ridge line position corresponding to the surface features in the sub-skin area can be connected to form the auxiliary line for plot division. That is, the dark ridge line in the figure forms the auxiliary line for plot division with multiple turning points through the connection of some point cloud points. In a possible case, the auxiliary line for plot division can be determined by manually selecting point cloud points, or the point cloud points can be screened according to the surface features, and then the screened point cloud points can be connected to form the auxiliary line for plot division.
[0070] In another possible case, the auxiliary line for plot division can also be determined according to the sub-skin area obtained after pre-cutting processing. For example, the vertices located at the ridge line are determined in the sub-skin area, and then the auxiliary line for plot division is determined along the side line of the sub-skin area where the vertex is located. For the case of sharing vertices in the sub-skin area described above, if the sub-skin area is used to determine the auxiliary line for plot division, due to the sharing of vertices, when determining the side line of one sub-skin area along the vertex, it is easy to wrongly determine the side line of the shared vertex on another sub-skin area. In this way, the obtained auxiliary line for plot division cannot represent the surface features. Therefore, after dividing the skin plots, it may cause the matching skin patch data not to accurately reflect the surface features of the target model at this position.
[0071] In the case of determining the auxiliary line for plot division, the sub-skin area can be divided into skin plots by using the auxiliary line for plot division to obtain at least one skin plot corresponding to the sub-skin area. Specifically, multiple division nodes can be determined on the auxiliary line for plot division; for any division node, based on the preset division size of the skin plot and the position of the division node on the auxiliary line for plot division, the sub-skin area is divided into skin plots to obtain at least one skin plot associated with the division node in the sub-skin area.
[0072] Exemplarily, see Figure 4 As shown, it is a schematic diagram of dividing the sub-skin area into multiple skin plots by using the auxiliary line for plot division provided by an embodiment of the present disclosure. For the convenience of description, a black line is marked on an auxiliary line for plot division, and the division nodes are represented by black dots on the marked black line.
[0073] Among them, when determining the division nodes, the inflection points formed by the bending on the plot division auxiliary line can be used as the division nodes. In a possible case, if there is a long straight line between two inflection points, nodes can be further selected on the straight line. For example, by setting the maximum length between two division nodes, when determining the positions of the division nodes on the plot division auxiliary line, it is only necessary to ensure that the length between the two division nodes is less than this maximum length. Alternatively, at least one division node can also be randomly selected on the plot division auxiliary line.
[0074] After determining the division nodes from the plot division auxiliary line, along the plot division auxiliary line, the sub-skin area can be divided by using the division nodes. In a possible case, along two adjacent division nodes on the plot division auxiliary line, two straight lines can be extended on the sub-skin area, and multiple nodes can be further determined on these two straight lines. The part of the sub-skin area framed by these two straight lines and the plot division auxiliary line can be used to divide the skin plots.
[0075] Exemplarily, refer to Figure 5 shown, which is a schematic diagram of a specific method for determining skin plots provided by an embodiment of the present disclosure; Figure 5 The plot division auxiliary line shown in Figure 4 is a partial plot division auxiliary line in . For division node 51 and division node 52, two straight lines can be extended along the sub-skin area, including straight line 53 and straight line 54 shown in dotted lines. On straight line 53 and straight line 54, multiple nodes can be further determined, such as the nodes marked with hollow circles different from the division nodes in the figure. Using these nodes, as well as the part of the sub-skin area framed by straight line 53, straight line 54 and the plot division auxiliary line, multiple skin plots can be determined, such as the skin plots divided by white lines in the figure. Among them, when determining multiple nodes from the straight line, they can be determined randomly, or equidistantly, or the nodes can also be determined according to the terrain features on the straight line. Specifically, it can be determined according to the actual situation and will not be elaborated here. In this way, since the terrain features can be referred to when dividing the skin plots, the division of the skin plots can be more adapted to the features of the target model itself.
[0076] In addition, the sub-skin area can also be divided into skin plots according to the preset division size of the skin plots and the positions of the division nodes on the plot division auxiliary line. Exemplarily, refer to Figure 6 shown, which is another schematic diagram of a specific method for determining skin plots. For division node 61 and division node 62, according to the preset division size of the skin plots, multiple skin plots can be divided on the sub-skin area, such as three skin plots framed by black lines. In this way, compared with Figure 5In the manner shown, the obtained skin plots are easier to control in shape and are consistent with the calibrated skin plots described below. Therefore, the efficiency in subsequent matching of the skin plots will also be higher.
[0077] For the above S103, in the case of determining at least one skin plot, corresponding calibrated skin plots can also be matched for the skin plots. Among them, the calibrated skin plots can be designed as rectangular plots, such as three rectangular plots with aspect ratios of 1:2, 1:1, and 2:1; in the case of determining the calibrated skin plots, corresponding skin patch data can also be determined for the calibrated skin plots to determine the corresponding rock terrain differences for the calibrated skin plots of different shapes through different skin patch data.
[0078] For any skin plot, since when dividing the skin plot, it is not guaranteed that the skin plot after division is a standard rectangle, an approximate rectangle can also be fitted for the skin plot through the vertices of the skin plot. After determining the corresponding rectangle of the skin plot, using the characteristics of the rectangle, such as the aspect ratio characteristic, the corresponding target skin plot can be determined in the calibrated skin plots to determine the skin patch data corresponding to the skin plot.
[0079] In a possible case, in addition to having a specific aspect ratio, the calibrated skin plots also have a fixed size, such as a size of 10 pixel points × 10 pixel points. For any skin plot, its size is not exactly the same. Therefore, after determining the corresponding target calibrated skin plot, the skin patch data of the target calibrated skin plot can also be scaled to obtain the skin patch data that can cover the skin plot as the target skin patch data.
[0080] For the above S104, in the case of determining the target skin patch data corresponding to each skin plot respectively, using the target skin patch data, the rock terrain can be rendered and displayed for the target model.
[0081] Exemplarily, refer to Figure 7 As shown, it is a schematic diagram of a target model for rendering a rock terrain provided by an embodiment of the present disclosure. Among them, Figure 7 (a) shows a schematic diagram after rendering the rock terrain for the target model by using the rendering display method provided by the embodiment of the present disclosure. Since when rendering the rock terrain in the embodiment of the present disclosure, it is divided into skin plots with smaller granularity for rendering, compared with Figure 7 (b) in which the rock terrain of the target model is rendered as a whole in a large area, the rendered rock terrain is more in line with the terrain characteristics at different positions in terms of details. Therefore, the result of the rendering display is more realistic.
[0082] The rendering and display method, device, computer device and storage medium provided by the embodiments of the present disclosure, after obtaining the target model of the rock terrain to be rendered, first, according to the slope information corresponding to each point cloud point therein, determine the skinning area of the rock terrain to be rendered for the target model. In order to more quickly determine the different skinning patch data selected for rendering the rock terrain at different positions for the skinning area, the skinning area can be further cut into skinning plots according to the corresponding surface features, and by presetting different calibrated skinning plots and the corresponding skinning patch data when rendering the rock terrain, determine the corresponding skinning patch data for each skinning plot in the skinning area, so as to render and display the rock terrain of the target model. In this way, by dividing the skinning plots according to the surface features of the skinning area, while the skinning plots can reflect the differences of mountains and rivers, it is easier to determine the corresponding skinning patch data through matching with the calibrated skinning plots, and the terrain rendering efficiency is relatively high.
[0083] Those skilled in the art can understand that in the above method of the specific implementation manner, the writing order of each step does not mean a strict execution order that constitutes any limitation on the implementation process, and the specific execution order of each step should be determined according to its function and possible internal logic.
[0084] Based on the same inventive concept, the embodiments of the present disclosure also provide a rendering and display device corresponding to the rendering and display method. Since the principle of solving problems by the device in the embodiments of the present disclosure is similar to the above rendering and display method of the embodiments of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be elaborated.
[0085] Referring to Figure 8 As shown, it is a schematic diagram of a rendering and display device provided by an embodiment of the present disclosure. The device includes: a first processing module 81, a dividing module 82, a second processing module 83, and a rendering and display module 84; wherein,
[0086] The first processing module 81 is configured to obtain a target model of the rock terrain to be rendered, and based on the slope information corresponding to each point cloud point in the target model, determine a skinning area of the rock terrain to be rendered for the target model;
[0087] The dividing module 82 is configured to divide the skinning area into at least one skinning plot for the rock terrain to be rendered based on the surface features corresponding to the skinning area;
[0088] The second processing module 83 is configured to, for any skinning plot, match a corresponding target calibrated skinning plot for the skinning plot from the preset calibrated skinning plots, and based on the skinning patch data corresponding to the target calibrated skinning plot, determine corresponding target skinning patch data for the skinning plot;
[0089] The rendering display module 84 is configured to render and display the rock terrain of the target model based on the target skin patch data corresponding to each determined skin plot.
[0090] In an alternative implementation, when determining the skin area to be rendered for the rock terrain of the target model based on the slope information corresponding to each point cloud point in the target model, the first processing module 81 is configured to: screen out the target point cloud points whose corresponding slope information is within the slope range from the respective point cloud points based on the slope information corresponding to the respective point cloud points and the preset slope range determined for the rock terrain; determine the skin area based on the position information of the target point cloud points in the target model.
[0091] In an alternative implementation, before dividing the skin area into at least one skin plot to be rendered for the rock terrain based on the surface features corresponding to the skin area, the dividing module 82 is further configured to: perform a pre-cutting process on the skin area to obtain each sub-skin area of the skin area; when dividing the skin area into at least one skin plot to be rendered for the rock terrain based on the surface features corresponding to the skin area, the dividing module 82 is configured to: determine the surface features corresponding to each sub-skin area based on the surface features corresponding to the skin area; divide each sub-skin area into the at least one skin plot based on the surface features corresponding to each sub-skin area.
[0092] In an alternative implementation, when performing a pre-cutting process on the skin area to obtain each sub-skin area of the skin area, the dividing module 82 is configured to: perform a pre-cutting process on the skin area based on a plurality of preset plane directions to obtain the sub-skin areas corresponding to the skin area in the plurality of plane directions respectively.
[0093] In an alternative implementation, the dividing module 82 is further configured to: in response to the length of the sub-skin area in any plane direction exceeding a preset length threshold in a preset direction, perform a secondary cutting process on the sub-skin area in the preset direction to update each sub-skin area corresponding to the skin area.
[0094] In an alternative implementation, when performing a pre-cutting process on the skin area to obtain each sub-skin area of the skin area, the dividing module 82 is configured to: in response to the inclusion of a hole-shaped skin area in the skin area, determine a corresponding cutting line for the hole-shaped skin area; the cutting line is used to split the hole-shaped skin area into a plurality of non-connected skin areas.
[0095] Based on the cutting lines determined for the cavity skin area, pre-cut the cavity skin area to obtain each sub-skin area of the cavity skin area.
[0096] In an optional implementation manner, when the dividing module 82 divides each sub-skin area into at least one skin plot based on the surface features respectively corresponding to each sub-skin area, it is used for: for any sub-skin area, determining a plot division auxiliary line for the sub-skin area based on the surface feature corresponding to the sub-skin area; and dividing the sub-skin area into at least one skin plot corresponding to the sub-skin area based on the plot division auxiliary line determined for the sub-skin area.
[0097] In an optional implementation manner, when the dividing module 82 divides the sub-skin area into at least one skin plot corresponding to the sub-skin area based on the plot division auxiliary line determined for the sub-skin area, it is used for: determining a plurality of division nodes on the plot division auxiliary line; and for any division node, dividing the sub-skin area into at least one skin plot associated with the division node in the sub-skin area based on the preset division size of the skin plot and the position of the division node on the plot division auxiliary line.
[0098] The description of the processing flow of each module in the device and the interaction flow between the modules can refer to the relevant descriptions in the above method embodiments and will not be elaborated here.
[0099] The embodiments of the present disclosure also provide a computer device, as Figure 9 shown, which is a schematic structural diagram of the computer device provided by the embodiments of the present disclosure, including:
[0100] A processor 10 and a memory 20; the memory 20 stores machine-readable instructions executable by the processor 10, and the processor 10 is used to execute the machine-readable instructions stored in the memory 20. When the machine-readable instructions are executed by the processor 10, the processor 10 executes the following steps:
[0101] Obtain the target model of the rock terrain to be rendered, and based on the slope information corresponding to each point cloud point in the target model, determine the skinning area of the rock terrain to be rendered for the target model; based on the surface features corresponding to the skinning area, divide the skinning area into skinning plots to obtain at least one skinning plot of the rock terrain to be rendered; for any skinning plot, match the corresponding target calibrated skinning plot from the preset calibrated skinning plots, and based on the skinning patch data corresponding to the target calibrated skinning plot, determine the corresponding target skinning patch data for the skinning plot; based on the determined target skinning patch data corresponding to each skinning plot respectively, render and display the rock terrain of the target model.
[0102] The above-mentioned memory 20 includes a memory 210 and an external memory 220; the memory 210 here is also called the internal memory, which is used to temporarily store the operation data in the processor 10 and the data exchanged with the external memory 220 such as the hard disk. The processor 10 exchanges data with the external memory 220 through the memory 210.
[0103] The specific execution process of the above instructions can refer to the steps of the rendering and display method described in the embodiments of the present disclosure, which will not be elaborated here.
[0104] The embodiments of the present disclosure also provide a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, it executes the steps of the rendering and display method described in the above method embodiments. Among them, the storage medium can be a volatile or non-volatile computer-readable storage medium.
[0105] The embodiments of the present disclosure also provide a computer program product, which carries program codes. The instructions included in the program codes can be used to execute the steps of the rendering and display method described in the above method embodiments. Specifically, refer to the above method embodiments, which will not be elaborated here.
[0106] Among them, the above computer program product can be specifically implemented by means of hardware, software or a combination thereof. In an alternative embodiment, the computer program product is specifically embodied as a computer storage medium. In another alternative embodiment, the computer program product is specifically embodied as a software product, such as a Software Development Kit (SDK), etc.
[0107] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems and devices described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein. In several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For another example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the couplings or direct couplings or communication connections shown or discussed with each other can be through some communication interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.
[0108] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0109] In addition, in each embodiment of the present disclosure, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.
[0110] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such an understanding, the technical solution of the present disclosure, in essence, or the part that contributes to the prior art or part of this technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present disclosure. The foregoing storage medium includes: various media that can store program codes such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs.
[0111] Finally, it should be noted that the above-described embodiments are only specific embodiments of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than limiting them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that any person skilled in the art within the technical scope disclosed by the present disclosure can still modify the technical solutions described in the foregoing embodiments or can easily think of changes, or perform equivalent replacements on some of the technical features; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should all be covered within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.
Claims
1. A rendering display method, characterized in that, Including: Obtain a target model of the rock terrain to be rendered, and based on the slope information corresponding to each point cloud point in the target model, determine a skinning area for rendering the rock terrain of the target model; Based on the surface features corresponding to the skinning area, divide the skinning area into skinning plots to obtain at least one skinning plot for rendering the rock terrain; For any skinning plot, match a corresponding target calibrated skinning plot from the preset calibrated skinning plots, and based on the skinning patch data corresponding to the target calibrated skinning plot, determine corresponding target skinning patch data for the skinning plot; Render and display the rock terrain of the target model based on the determined target skinning patch data corresponding to each skinning plot.
2. The method according to claim 1, wherein The step of determining a skinning area for rendering the rock terrain of the target model based on the slope information corresponding to each point cloud point in the target model includes: Based on the slope information corresponding to each point cloud point and a preset slope range determined for the rock terrain, screen out target point cloud points whose corresponding slope information is within the slope range from the point cloud points; Based on the position information of the target point cloud points in the target model, determine the skinning area.
3. The method according to claim 1, wherein Before dividing the skinning area into skinning plots to obtain at least one skinning plot for rendering the rock terrain based on the surface features corresponding to the skinning area, the method further includes: Perform pre-cutting processing on the skinning area to obtain each sub-skinning area of the skinning area; The step of dividing the skinning area into skinning plots to obtain at least one skinning plot for rendering the rock terrain based on the surface features corresponding to the skinning area includes: Based on the surface features corresponding to the skinning area, determine the surface features corresponding to each sub-skinning area; Based on the surface features corresponding to each sub-skinning area, divide each sub-skinning area into skinning plots to obtain the at least one skinning plot.
4. The method according to claim 3, wherein The step of performing pre-cutting processing on the skinning area to obtain each sub-skinning area of the skinning area includes: Based on a plurality of preset plane directions, perform pre-cutting processing on the skinning area to obtain sub-skinning areas corresponding to the skinning area in the plurality of plane directions respectively.
5. The method according to claim 4, wherein It further includes: In response to the length of a sub-skinning area in a preset direction exceeding a preset length threshold in any plane direction, perform secondary cutting processing on the sub-skinning area in the preset direction to update each sub-skinning area corresponding to the skinning area.
6. The method according to claim 3, wherein The step of performing pre-cutting processing on the skinning area to obtain each sub-skinning area of the skinning area includes: In response to a hole-shaped skinning area being included in the skinning area, determine a corresponding cutting line for the hole-shaped skinning area; the cutting line is used to split the hole-shaped skinning area into a plurality of non-connected skinning areas; Based on the cutting line determined for the hole-shaped skinning area, perform pre-cutting processing on the hole-shaped skinning area to obtain each sub-skinning area of the hole-shaped skinning area.
7. The method according to claim 3, characterized in that, Performing skin plot division on each of the sub-skin regions respectively based on the corresponding surface features of each of the sub-skin regions to obtain the at least one skin plot includes: For any one of the sub-skin regions, determining an auxiliary line for plot division for the sub-skin region based on the surface feature corresponding to the sub-skin region; Performing skin plot division on the sub-skin region based on the auxiliary line for plot division determined for the sub-skin region to obtain at least one skin plot corresponding to the sub-skin region.
8. The method according to claim 7, wherein The performing skin plot division on the sub-skin region based on the auxiliary line for plot division determined for the sub-skin region to obtain at least one skin plot corresponding to the sub-skin region includes: Determining a plurality of division nodes on the auxiliary line for plot division; For any one of the division nodes, performing skin plot division on the sub-skin region based on a preset division size of the skin plot and the position of the division node on the auxiliary line for plot division to obtain at least one skin plot associated with the division node in the sub-skin region.
9. A rendering display device, characterized in that, Including: A first processing module, configured to obtain a target model of a rock terrain to be rendered, and determine a skin region for rendering the rock terrain for the target model based on the slope information corresponding to each point cloud point in the target model; A division module, configured to perform skin plot division on the skin region based on the surface feature corresponding to the skin region to obtain at least one skin plot for rendering the rock terrain; A second processing module, configured to, for any one of the skin plots, match a corresponding target calibrated skin plot from the preset calibrated skin plots for the skin plot, and determine corresponding target skin patch data for the skin plot based on the skin patch data corresponding to the target calibrated skin plot; A rendering and display module, configured to render and display the rock terrain of the target model based on the target skin patch data respectively corresponding to the determined skin plots.
10. A computer device, characterized in that, Including: A processor and a memory, the memory stores machine-readable instructions executable by the processor, the processor is configured to execute the machine-readable instructions stored in the memory, when the machine-readable instructions are executed by the processor, the processor executes the steps of the rendering and display method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, when the computer program is run by a computer device, the computer device executes the steps of the rendering and display method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Image drawing method and device, electronic equipment and readable storage medium
CN112052864A
Virtual scene generation method and device, computer equipment and storage medium
CN113066183A