CN111583373B - Model rendering method, device, equipment and storage medium - Google Patents

Model rendering method, device, equipment and storage medium Download PDF

Info

Publication number
CN111583373B
CN111583373B CN202010393723.8A CN202010393723A CN111583373B CN 111583373 B CN111583373 B CN 111583373B CN 202010393723 A CN202010393723 A CN 202010393723A CN 111583373 B CN111583373 B CN 111583373B
Authority
CN
China
Prior art keywords
model
billboards
position data
center point
target object
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010393723.8A
Other languages
Chinese (zh)
Other versions
CN111583373A (en
Inventor
李慧妍
杨星
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Mihoyo Tianming Technology Co Ltd
Original Assignee
Shanghai Mihoyo Tianming Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Mihoyo Tianming Technology Co Ltd filed Critical Shanghai Mihoyo Tianming Technology Co Ltd
Priority to CN202010393723.8A priority Critical patent/CN111583373B/en
Publication of CN111583373A publication Critical patent/CN111583373A/en
Application granted granted Critical
Publication of CN111583373B publication Critical patent/CN111583373B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering

Landscapes

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

Abstract

The embodiment of the invention discloses a model rendering method, a device, equipment and a storage medium, wherein the model rendering method comprises the following steps: obtaining a target object model, wherein the target object model comprises a cross insert sheet profile model and a billboards detail model; determining billboard panel position data of a billboard detail model; and rendering and displaying the target object model based on the billboards position data. According to the technical scheme, the target object model is designed by using two methods of the cross inserting sheet and the billboards, rendering display is carried out, the defects that the rendering time is long, the memory occupation is large, the inserting sheet line effect is obvious in the model and the like are overcome due to excessive use of triangular surfaces of the model, the appearance is not attractive enough and the like are overcome, the rendering pressure of a game engine is relieved, the memory occupation is reduced, and meanwhile, the display picture is attractive.

Description

Model rendering method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of data processing, in particular to a model rendering method, a device, equipment and a storage medium.
Background
In the world of game scenes, it is often necessary to lay a large number of objects to add detail, supplement pictures, and embody regional features, such as using a large number of trees in various patterns to embody different appearances in nature. When laying trees, a cross inserting sheet method is generally adopted to manufacture tree leaf parts and detail switching models of all levels so as to embody full effect and natural detail switching effect of the trees.
In order to make the tree more similar to the real showing effect of the tree in the nature, the art usually uses as many cross inserting sheets as possible, the method consumes too many triangular faces of the model, and the model is also caused to have obvious inserting sheet line effects, so that the art is not attractive enough. In addition, when a low-level detail model is made, in order to ensure natural switching, more triangular faces are needed to be used for implementation, and excessive memory and rendering time are consumed.
Disclosure of Invention
The invention provides a model rendering method, a device, equipment and a storage medium, which relieve the rendering pressure of a game engine, reduce the memory occupation and simultaneously enable a display picture to be more attractive.
In a first aspect, an embodiment of the present invention provides a model rendering method, where the method includes:
Obtaining a target object model, wherein the target object model comprises a cross insert sheet overall model and a billboards detail model;
determining billboard panel position data of the billboard detail model;
and rendering and displaying the target object model based on the billboards position data.
In a second aspect, an embodiment of the present invention further provides a model rendering apparatus, where the apparatus includes:
the target object model acquisition module is used for acquiring a target object model, wherein the target object model comprises a cross insert sheet profile model and a billboards detail model;
the position data determining module is used for determining the billboards position data of the billboards detail model;
and the data rendering and displaying module is used for rendering and displaying the target object model based on the billboards position data.
In a third aspect, an embodiment of the present invention further provides a computer apparatus, including:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement a model rendering method as described in any of the embodiments of the present invention.
In a fourth aspect, embodiments of the present invention further provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a model rendering method according to any of the embodiments of the present invention.
According to the embodiment of the invention, the target object model is obtained, wherein the target object model comprises a cross insert sheet profile model and a billboards detail model; determining billboard panel position data of a billboard detail model; the target object model is rendered and displayed based on the billboards, and the target object model is designed and rendered and displayed by using the two methods of the cross inserting sheet and the billboards, so that the defects of long rendering time, more memory occupation, obvious inserting sheet line effect of the model, attractive appearance and the like caused by excessive use of the triangular surface of the model are overcome, the rendering pressure of a game engine is relieved, the memory occupation is reduced, and meanwhile, the display picture is more attractive.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief description will be given below of the drawings required for the embodiments or the prior art descriptions, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a model rendering method in accordance with a first embodiment of the present invention;
FIG. 2 is a flow chart of a model rendering method in a second embodiment of the present invention;
FIG. 3a is a flow chart of storing data of a center point position of a billboards in accordance with a third embodiment of the invention;
FIG. 3b is a flow chart of a model rendering in accordance with a third embodiment of the present invention;
FIG. 3c is a block diagram of a coordinate storage device according to a third embodiment of the present invention;
FIG. 3d is a schematic illustration of the opacity of an initial object model obtained using the cross insert method in accordance with the third embodiment of the present invention;
FIG. 3e is a schematic diagram showing the opaque effect of a target object model obtained by using the cross insert and billboards method according to the third embodiment of the invention;
FIG. 3f is a schematic illustration of the transparency effect of an initial object model obtained using the cross insert method in accordance with the third embodiment of the present invention;
FIG. 3g is a schematic diagram of a transparent effect of a target object model obtained by using a cross insert and billboards method according to a third embodiment of the invention;
FIG. 3h is a schematic diagram of a transparent effect of a target object model before a player's viewing angle is changed in accordance with a third embodiment of the present invention;
FIG. 3i is a schematic diagram showing a transparent effect of a model of a target object after viewing angle conversion of a player according to a third embodiment of the present invention;
Fig. 4 is a schematic structural diagram of a model rendering device in a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of a computer device in a fifth embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
Fig. 1 is a flowchart of a model rendering method according to an embodiment of the present invention, where the method may be performed by a model rendering device, the device may be implemented in software and/or hardware, and the device may be configured in a computer device. As shown in fig. 1, the method specifically may include the following steps:
s110, acquiring a target object model, wherein the target object model comprises a cross insert sheet overall view model and a billboards detail model.
Preferably, the target object model may be an object model in the game world, which may be a tree model, a house model, a character model, or the like. The target object model in the embodiment comprises a cross insert profile model constructed by a cross insert method and a billboard detail model constructed by a billboard method, wherein the profile model is mainly used for showing the rough outline of an object, and the detail model is used for showing the details of the object. For example, if the target object model is a tree model, the cross-shaped insert profile model is mainly used for showing the general shape of the tree, and the detail model is used for showing the leaf and other detail parts of the tree.
For the cross insert profile model, the number of the cross inserts is not particularly required, and can be determined according to actual requirements so as to be capable of showing the profile of the object and occupy too much memory and rendering time to be optimal. For the billboard detail model, the number of billboard patches can be one or a plurality of the billboard patches, so that the detail of the object can be displayed optimally. Each billboard face may be rotated about its own center point with the face facing always towards the player.
In order to make the player feel the real state of the object similar to the natural world during the game, it is preferable that the target object model in the embodiment may be used when the game scene is that the distance between the object and the viewing angle of the player is within the preset range, and the cross insert model may be used when the game scene is that the distance between the object and the viewing angle of the player is less than the minimum boundary value of the preset range, and the billboards model may be used when the game scene is that the distance between the object and the viewing angle of the player is greater than the maximum boundary value of the preset range. In a game scenario where the distance between the object and the player's perspective is less than the minimum boundary value of the preset range, it is necessary to reveal as much specific details of the object as possible because the distance between the object and the player's perspective is relatively close, and therefore it is necessary to use an advanced detail object model. By way of example, the advanced detail object model may be an object model that is constructed using as many cross tabs as possible. In a game scene in which the distance between the object and the view angle of the player is greater than the maximum boundary value of the preset range, the object can be displayed by adopting a low-level detail object model because the distance between the object and the view angle of the player is far, and specific details of the object do not need to be displayed. By way of example, the low-level detail object model may be an object model made up of a billboard panel. It should be noted that the use scenario of the target object model is only a preferred example, and the target object model in this embodiment may be applied to a case where the game scene is that the distance between the object and the viewing angle of the player is smaller than the minimum boundary value of the preset range, and the game scene is that the distance between the object and the viewing angle of the player is greater than the maximum boundary value of the preset range.
In this embodiment, preferably, the game engine (for example, may be Unity) may obtain the target object model from the model storage database during the game loading process.
S120, determining the billboard panel position data of the billboard detail model.
Wherein the billboard patch position data may include vertex position data and center point position data for each patch. The shape of the billboard panel may be arbitrary, and may be, for example, one of a triangle, a rectangle, and a hexagon, which has three vertices when the billboard panel is a triangle, six vertices when the billboard panel is a hexagon, or the like.
In this embodiment, the center point position data in the billboards position data may be stored in an additional preset data storage space, or may be stored together with each vertex position data, and preferably, the center point position data may be stored in the vertex color data of each vertex. When rendering the billboards, it is preferable to acquire the center point position data in the preset data storage space for the case where the center point position data is stored in the additional preset data storage space, and to acquire the center point position data in the vertex color data of each vertex for the case where the center point position data is stored together with each vertex position data.
And S130, rendering and displaying the target object model based on the billboards position data.
After the position data of the billboards are obtained, the position data of the cross inserting sheets in the target object model are combined, the target object model can be rendered, and the rendered target object model picture is displayed on a corresponding display interface.
Preferably, when the billboard detail model is rendered, a vertex-by-vertex rendering mode can be adopted, namely, each time vertex position data of one vertex is determined, the billboard detail model is rendered by combining with the center point position data, so that the billboard effect is achieved.
According to the model rendering method provided by the embodiment, a target object model is obtained, wherein the target object model comprises a cross insert overall model and a billboards detail model; determining billboard panel position data of a billboard detail model; the target object model is rendered and displayed based on the billboards, and the target object model is designed and rendered and displayed by using the two methods of the cross inserting sheet and the billboards, so that the defects of long rendering time, more memory occupation, obvious inserting sheet line effect of the model, attractive appearance and the like caused by excessive use of the triangular surface of the model are overcome, the rendering pressure of a game engine is relieved, the memory occupation is reduced, and meanwhile, the display picture is more attractive.
On the basis of the above embodiments, further, before obtaining the target object model, the method further includes:
constructing an initial object model based on a cross inserting method, wherein the initial object model comprises a cross inserting profile model and a cross inserting detail model;
and replacing the cross insert detail model with the billboards detail model to obtain the target object model.
In this embodiment, the initial object model (which may also be referred to as a high-precision object model) is constructed by using the cross insert method, and after the cross insert model is constructed, the cross insert detail model may be preferably replaced by a billboard detail model. For example, one billboard panel may be used instead of the cross tab detail model, and a plurality of billboards may be used instead of the cross tab detail model.
When the initial object model is constructed, the initial object model can be constructed by utilizing a cross insert method, and then the initial object model is divided into an outer cross insert profile model and an inner cross insert detail model.
Based on the above embodiments, further, replacing the cross insert detail model with a billboards detail model includes:
and respectively replacing each cross insert in the cross insert detail model with a corresponding billboards, wherein the insert center point of each cross insert is coincident with the panel center point of the corresponding billboards.
When using a billboard panel instead of a cross tab, it is preferable that the orientation mode of the billboard panel be set to always face the camera so that the player can view the form of the object at different viewing angles.
Example two
Fig. 2 is a flowchart of a model rendering method according to a second embodiment of the present invention. This embodiment may be combined with each of the alternatives of one or more embodiments described above, where determining the billboard panel location data of the billboard detail model includes:
acquiring target vertex color data of a billboard panel in the billboard detail model, wherein each target vertex color data corresponds to panel center point position data of the corresponding billboard panel;
and determining the billboards position data based on the target vertex color data.
And before the target vertex color data of the billboards are obtained in the billboards detail model, the method further comprises:
determining the center point position data of the panel relative to the preset origin of the center point of the panel of the billboards;
compressing the center point position data of the surface patch according to the preset vertex color data attribute to obtain compressed surface patch center point position data with the preset vertex color data attribute;
And storing the data of the central point position of the compressed panel into initial vertex color data corresponding to each vertex of the corresponding billboards to obtain target vertex color data.
As shown in fig. 2, the method in this embodiment specifically includes:
s210, acquiring a target object model, wherein the target object model comprises a cross insert sheet profile model and a billboards detail model.
S220, determining the position data of the center point of the panel of the billboards relative to the preset origin.
Since the model only records the center point position data of the model itself after the model is generated, but does not record the center point position data of each billboards in the billboards detail model, the center point position data of each billboards needs to be additionally acquired and recorded.
Preferably, the position coordinate of the center point of the billboards relative to the preset origin can be used as the position data of the center point of the panels, wherein the preset origin can be the center point of the model itself or other preset position points.
S230, compressing the center point position data of the face patch according to the preset vertex color data attribute to obtain compressed face patch center point position data with the preset vertex color data attribute.
In this embodiment, after the patch center point position data is determined, the patch center point position data may preferably be stored in the vertex color data of the patch where the center point is located. Alternatively, the preset vertex color data attribute may be a numerical range of vertex color data, and the patch center point position data may be compressed to data within the numerical range of vertex color data by a compression processing method, for example. Alternatively, the preset vertex color data attribute may be a decimal point number of the vertex color data, and the patch center point data may be compressed to data having a decimal point number of the vertex color data by a compression processing method. The compressing of the patch center point position data may be performed by normalizing the patch center point position data, and may be exemplified by multiplying the patch center point position data by a preset first compression value or multiplying the patch center point position data by a preset second compression value. If the data attribute of the patch center point position data is exactly the same as the preset vertex color data attribute, the patch center point position data can be directly used as compressed patch center point position data.
For example, if the center point position data of the patch is a value exceeding 1 (for example, a value between 0 and 10), and the preset value range of the vertex color data is _ [0,1], the center point position data of the patch can be converted into data between [0,1] through the compression process.
And S240, storing the position data of the center point of the compressed panel in initial vertex color data corresponding to each vertex of the corresponding billboards to obtain target vertex color data.
Since the billboards are rendered vertex by vertex and each vertex is rendered by acquiring the patch center point position data, it is preferable that the compressed patch center point position data be stored in the initial vertex color data for each vertex. For example, if the billboard has three vertices, the compressed panel center point position data of the billboard is stored in the initial vertex color data corresponding to the three vertices, and if the billboard has six vertices, the compressed panel center point position data of the billboard is stored in the initial vertex color data corresponding to the six vertices.
Preferably, storing the compressed panel center point position data in initial vertex color data corresponding to each vertex of the corresponding billboards includes:
Storing X-axis coordinate values in the compressed patch center point position data into an R channel in the initial vertex color data;
storing Y-axis coordinate values in the compressed patch center point position data into a G channel in the initial vertex color data;
and storing the Z-axis coordinate value in the compressed patch center point position data into a B channel in the initial vertex color data.
In this embodiment, the coordinate values of X, Y and Z axis in the compressed surface patch center point position data may be stored in the corresponding R, G and B three color channels in the initial vertex color data, respectively, and the storage correspondence between the specific axis coordinate values and the color channels may be set according to actual needs. Illustratively, in addition to the correspondence described in the above embodiment, the X-axis coordinate value may be stored in the G-channel, the Y-axis coordinate value may be stored in the R-channel, and the Z-axis coordinate value may be stored in the B-channel; the X-axis coordinate values may also be stored in the G-channel, the Y-axis coordinate values in the B-channel, and the Z-axis coordinate values in the R-channel.
S250, acquiring target vertex color data of a billboards in the detailed billboards, wherein each target vertex color data corresponds to the position data of the center point of the corresponding billboards.
After the target object detail model is obtained, the position data of the center point of the patch corresponding to the corresponding vertex can be determined by reading the target vertex color data of each vertex in the billboard detail model. The target vertex color data of the billboard is the center point position data of the panel of the billboard.
S260, determining the billboard panel position data based on the target vertex color data.
Preferably, after the target vertex color data of each vertex is obtained, the patch center point position data corresponding to each vertex may be determined based on the target vertex color data, and the patch center point position data corresponding to each vertex and the vertex position data of each vertex may be used as billboard patch position data.
Preferably, determining the billboard patch position data based on the target vertex color data includes:
decompressing the target vertex color data to obtain the center point position data of the billboards corresponding to each vertex;
and taking vertex position data corresponding to each vertex and the position data of the center point of the billboard surface piece as the position data of the billboard surface piece.
For example, there are multiple billboards in the billboard detail model, and for each billboard, the shape of the panel is rectangular, and four vertexes are provided, and each vertex stores target vertex color data and vertex position data, and the target vertex color data and the vertex position data at each vertex are read point by point to obtain four groups of target vertex color data and vertex position data. Because the target vertex color data stores compressed patch center point position data, it is preferable to decompress the four compressed patch center point position data to obtain four patch center point position data, and use the four sets of patch center point position data and vertex position data as billboard patch position data.
Here, before the vertex position data corresponding to each vertex and the billboards center point position data are used as billboards position data, updating the vertex position data corresponding to each vertex according to the change of the player's viewing angle may be further included.
Specifically, before the player changes the viewing angle, the initial vertex position data corresponding to each vertex and the initial position data of the center point of the billboards may be preferably used as the initial position data of the billboards, and the target object model may be rendered and displayed to the player based on the initial position data of the billboards. When a change in the player's view angle is detected, for each vertex in the billboards, the current vertex position data may be determined using the initial vertex position data, the billboards center point position data, and the player's view angle data, and the initial vertex position data may be updated using the current vertex position data. After the current vertex position data corresponding to each vertex is obtained, the current vertex position data corresponding to each vertex and the position data of the center point of the billboard surface patch are used as the current position data of the billboard surface patch, and the target object model is rendered and displayed to a player based on the initial position data of the billboard surface patch.
And S270, rendering and displaying the target object model based on the billboards position data.
According to the model rendering method provided by the embodiment, a target object model is obtained, wherein the target object model comprises a cross insert overall model and a billboards detail model; determining the center point position data of the panel relative to the preset origin of the center point of the panel of the billboards; compressing the center point position data of the face patch according to the preset vertex color data attribute to obtain compressed face patch center point position data with the preset vertex color data attribute; storing the position data of the center point of the compressed panel in initial vertex color data corresponding to each vertex of the corresponding billboards to obtain target vertex color data; obtaining target vertex color data of a billboard panel in a billboard detail model, wherein each target vertex color data corresponds to panel center point position data of the corresponding billboard panel; the target object model is rendered and displayed based on the billboards, and the target object model is designed and rendered and displayed by using the two methods of the cross inserting sheet and the billboards, so that the defects of long rendering time, more memory occupation, obvious inserting sheet line effect of the model, attractive appearance and the like caused by excessive use of the triangular surface of the model are overcome, the rendering pressure of a game engine is relieved, the memory occupation is reduced, and meanwhile, the display picture is more attractive. In addition, the vertex color data is utilized to store the center point position data of the patch, so that extra storage space is not required, and resources are saved.
Example III
FIG. 3a is a flowchart for storing the center point position data of a panel of a billboards according to a third embodiment of the present invention, wherein the present embodiment provides a preferred embodiment based on the above embodiments, as shown in FIG. 3a, a 3D scene art uses a conventional method for manufacturing cross-shaped inserts to make an initial object model, and then the initial object model is divided into an outer cross-shaped insert profile model M high_outside And inner layer cross insert detail model M high0_inside . M is designed by model design software high0_inside The inner cross inserting sheet is replaced by a Billboard surface sheet, the center point of the Billboard surface sheet is aligned with the center point of the corresponding replaced cross inserting sheet, and the Billboard surface sheet orientation mode is set to always face the camera, so that an inner Billboard detail model M is obtained low_inside
Mary acquisition M by editing software low_inside Center point coordinates of each billboard panel, and the center point coordinate information is stored in the software in a compressed manner on the vertex color. In particular, for M low_inside Each billboard panel T of (1) n Reading the position coordinate P of the center point of the billboards tris (i.e., the relative coordinate values of the center point of each billboards to the center point of the object). Determining a maximum radius R for compression max (the maximum radius R max Preferably a range of values that may be x, y, z), for each billboards T n Center point position coordinate P of (2) tris Coordinate P tris Distance D of triaxial term of (2) x 、D y And D z Compression to the topAnd the color value range is stored in the vertex color data.
Exemplary, for D y From 0 to D y ≤2*R max Is compressed to a range of 0.ltoreq.D y1 A range of 1 or less and stored to each vertex V n In the apex color R channel, for D x from-R max ≤D x ≤R max Is compressed to a range of 0.ltoreq.D x1 A range of 1 or less and stored to each vertex V n In the apex color G channel, for D z from-R max ≤D z ≤R max Is compressed to a range of 0.ltoreq.D z1 A range of 1 or less and stored to each vertex V n Is within the apex color B channel of (c).
Fig. 3b is a flowchart of model rendering according to a third embodiment of the present invention, where, as shown in fig. 3b, in a game loading process, a game engine obtains a target object model, and uses a shader to read each vertex color data of each patch in a billboards detail model, and decompresses each vertex color data to obtain a patch center point position coordinate corresponding to each vertex. For each vertex V, the position coordinates of the center point of the surface patch corresponding to each vertex are utilized n Performing model space shift and then connecting the vertex V n Multiplying the inverse of the model view matrix to achieve the billboards effect. Then, the coordinates of the center point of the patches are reversely shifted, so that each billboards always face the camera and are positioned at the corresponding positions of the objects. And finally, drawing a result by using a shader and drawing the result on a display interface.
Fig. 3c is a schematic diagram of a coordinate storage device according to a third embodiment of the present invention, where, as shown in fig. 3c, a coordinate acquisition module is configured to acquire a center point coordinate of each billboard panel in an mlow_inside, a coordinate compression module is configured to compress the center point coordinate of each billboard panel, a coordinate storage module is configured to store the center point coordinate of each compressed billboard panel into vertex color data of a corresponding vertex, and a coordinate decompression module is configured to decompress each vertex color data.
Fig. 3d is a schematic diagram of an opaque effect of an initial object model obtained by using a cross insert method according to the third embodiment of the present invention, and fig. 3e is a schematic diagram of an opaque effect of a target object model obtained by using a cross insert and a billboard method according to the third embodiment of the present invention, where an obvious insert line effect exists in the initial object model, as shown in fig. 3d and fig. 3e, which is not attractive, and the target object model does not have the disadvantage.
Fig. 3f is a schematic diagram of an initial object model transparent effect obtained by using a cross insert method according to the third embodiment of the present invention, and fig. 3g is a schematic diagram of a target object model transparent effect obtained by using a cross insert and a billboard method according to the third embodiment of the present invention, where, as shown in fig. 3f and fig. 3g, the initial object model has too many triangular patches, so that the states of many leaves are perpendicular to the viewing angle of the player, and the target object model does not have the defect, and the target object model shows a tree, which has a full visual effect, and can improve the user experience of the player.
Fig. 3h is a schematic diagram of a transparent effect of a target object model before viewing angle conversion of a player according to the third embodiment of the present invention, and fig. 3i is a schematic diagram of a transparent effect of a target object model after viewing angle conversion of a player according to the third embodiment of the present invention, where, as shown in fig. 3h and 3i, after a billboards pointed by arrows are rotated, the target object model is still oriented towards the player, i.e. in the game world, regardless of changes of the viewing angle of the player.
Example IV
Fig. 4 is a schematic structural diagram of a model rendering device according to a fourth embodiment of the present invention. As shown in fig. 4, the apparatus of this embodiment includes:
a target object model obtaining module 410, configured to obtain a target object model, where the target object model includes a cross insert profile model and a billboards detail model;
a location data determining module 420, configured to determine billboards location data of the billboards detail model;
the data rendering display module 430 is configured to render and display the target object model based on the billboards position data.
According to the model rendering device provided by the embodiment, a target object model is obtained by utilizing a target object model obtaining module, wherein the target object model comprises a cross insert profile model and a billboard detail model; determining the billboard panel position data of the billboard detail model by utilizing a position data determining module; the target object model is rendered and displayed by the data rendering display module based on the billboards, and the target object model is designed by the two methods of cross insertion sheets and billboards and rendered and displayed, so that the defects of long rendering time, more memory occupation, obvious insertion sheet line effect of the model, poor attractiveness and the like caused by excessive use of the triangular surfaces of the model are overcome, the rendering pressure of a game engine is relieved, the memory occupation is reduced, and meanwhile, the display picture is more attractive.
Based on the above technical solutions, optionally, the model rendering device may further include:
the initial object model building module is used for building an initial object model based on a cross insert method before a target object model is acquired, wherein the initial object model comprises a cross insert profile model and a cross insert detail model;
and the target object model determining module is used for replacing the cross insert detail model with the billboards detail model to obtain a target object model.
Based on the above technical solutions, optionally, the target object model determining module may specifically be configured to:
and respectively replacing each cross insert in the cross insert detail model with a corresponding billboards, wherein the insert center point of each cross insert is coincident with the panel center point of the corresponding billboards.
Based on the above technical solutions, optionally, the location data determining module 420 specifically may include:
the target vertex color data acquisition unit is used for acquiring target vertex color data of a panel of the billboard in the detailed billboard model, wherein each target vertex color data corresponds to panel center point position data of the corresponding billboard;
And a position data determining unit for determining the billboards position data based on the target vertex color data.
Based on the above technical solutions, optionally, the model rendering device may further include:
the panel center point position data determining module is used for determining panel center point position data of a center point of the panel of the billboard relative to a preset origin before obtaining target vertex color data of the panel of the billboard in the detail model of the billboard;
the compressed surface patch center point position data determining module is used for compressing the surface patch center point position data according to the preset vertex color data attribute to obtain compressed surface patch center point position data with the preset vertex color data attribute;
and the target vertex color data determining module is used for storing the position data of the central point of the compressed panel into the initial vertex color data corresponding to each vertex of the corresponding billboards to obtain target vertex color data.
Based on the above technical solutions, optionally, the target vertex color data determining module may specifically be configured to:
storing the X-axis coordinate values in the compressed patch center point position data in an R channel in the top point color data;
storing Y-axis coordinate values in compressed patch center point position data in a G channel in top point color data;
The Z-axis coordinate values in the compressed patch center point position data are stored in the B-channel in the top point color data.
Based on the above technical solutions, optionally, the location data determining unit may specifically include:
the panel center point position data acquisition subunit is used for decompressing the vertex color data to obtain the billboard panel center point position data corresponding to each vertex;
and the position data determining subunit is used for taking the vertex position data corresponding to each vertex and the position data of the center point of the billboards as the billboards position data.
The model rendering device provided by the embodiment of the invention can execute the model rendering method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example five
Fig. 5 is a schematic structural diagram of a computer device according to a fifth embodiment of the present invention. Fig. 5 illustrates a block diagram of an exemplary computer device 512 suitable for use in implementing embodiments of the present invention. The computer device 512 shown in fig. 5 is merely an example, and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in FIG. 5, computer device 512 is in the form of a general purpose computing device. Components of computer device 512 may include, but are not limited to: one or more processors 516, a memory 528, a bus 518 that connects the different system components (including the memory 528 and the processor 516).
Bus 518 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Computer device 512 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by computer device 512 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 528 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 530 and/or cache memory 532. The computer device 512 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage 534 may be used to read from or write to a non-removable, non-volatile magnetic media (not shown in FIG. 5, commonly referred to as a "hard disk drive"). Although not shown in fig. 5, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 518 through one or more data media interfaces. Memory 528 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of embodiments of the invention.
A program/utility 540 having a set (at least one) of program modules 542 may be stored in, for example, memory 528, such program modules 542 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 542 generally perform the functions and/or methods in the described embodiments of the invention.
The computer device 512 may also communicate with one or more external devices 514 (e.g., keyboard, pointing device, display 524, etc., wherein the display 524 may be configured as desired), one or more devices that enable a user to interact with the computer device 512, and/or any devices (e.g., network card, modem, etc.) that enable the computer device 512 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 522. Also, the computer device 512 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through a network adapter 520. As shown, network adapter 520 communicates with other modules of computer device 512 via bus 518. It should be appreciated that although not shown in fig. 5, other hardware and/or software modules may be used in connection with computer device 512, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage, and the like.
Processor 516 executes programs stored in memory 528 to perform various functional applications and data processing, such as implementing model rendering methods provided by embodiments of the present invention.
Example six
A sixth embodiment of the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a model rendering method as provided by the embodiment of the present invention, including:
obtaining a target object model, wherein the target object model comprises a cross insert sheet profile model and a billboards detail model;
determining billboard panel position data of a billboard detail model;
and rendering and displaying the target object model based on the billboards position data.
Of course, the computer-readable storage medium provided by the embodiments of the present invention, on which the computer program is stored, is not limited to performing the method operations described above, but may also perform related operations in the computer-device-based model rendering method provided by any embodiment of the present invention.
The computer storage media of embodiments of the invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (9)

1. A model rendering method, comprising:
obtaining a target object model, wherein the target object model comprises a cross insert sheet overall model and a billboards detail model;
determining billboard panel position data of the billboard detail model;
rendering and displaying the target object model based on the billboards position data;
wherein, before acquiring the target object model, the method further comprises:
constructing an initial object model based on a cross insert method, wherein the initial object model comprises a cross insert profile model and a cross insert detail model;
And replacing the cross insert detail model with a billboards detail model to obtain the target object model.
2. The method of claim 1, wherein replacing the cross tab detail model with a billboards detail model comprises:
and respectively replacing each cross insert in the cross insert detail model with a corresponding billboards, wherein the insert center point of each cross insert is coincident with the panel center point of the corresponding billboards.
3. The method according to any one of claims 1-2, wherein said determining billboards panel position data of the billboards detail model comprises:
acquiring target vertex color data of a billboard panel in the billboard detail model, wherein each target vertex color data corresponds to panel center point position data of the corresponding billboard panel;
and determining the billboards position data based on the target vertex color data.
4. The method of claim 3, further comprising, prior to said obtaining the target vertex color data for the billboard panel in the billboard detail model:
determining the center point position data of the panel relative to the preset origin of the center point of the panel of the billboards;
Compressing the center point position data of the surface patch according to the preset vertex color data attribute to obtain compressed surface patch center point position data with the preset vertex color data attribute;
and storing the data of the central point position of the compressed panel into initial vertex color data corresponding to each vertex of the corresponding billboards to obtain target vertex color data.
5. The method of claim 4, wherein storing the compressed patch center point location data in the initial vertex color data corresponding to each vertex of the corresponding billboards comprises:
storing X-axis coordinate values in the compressed patch center point position data into an R channel in initial vertex color data;
storing Y-axis coordinate values in the compressed patch center point position data into a G channel in initial vertex color data;
and storing the Z-axis coordinate value in the compressed patch center point position data into a B channel in the initial vertex color data.
6. The method of claim 4, wherein determining the billboards position data based on the target vertex color data comprises:
decompressing the target vertex color data to obtain the center point position data of the billboards corresponding to each vertex;
And taking vertex position data corresponding to each vertex and billboards center point position data as the billboards position data.
7. A model rendering apparatus, characterized by comprising:
the target object model acquisition module is used for acquiring a target object model, wherein the target object model comprises a cross insert sheet profile model and a billboards detail model;
the position data determining module is used for determining the billboards position data of the billboards detail model;
the data rendering display module is used for rendering and displaying the target object model based on the billboards position data;
wherein, the model rendering device further includes:
the initial object model building module is used for building an initial object model based on a cross insert method before a target object model is acquired, wherein the initial object model comprises a cross insert profile model and a cross insert detail model;
and the target object model determining module is used for replacing the cross insert detail model with the billboards detail model to obtain a target object model.
8. A computer device, comprising:
one or more processing devices;
a memory for storing one or more programs;
When the one or more programs are executed by the one or more processing devices, the one or more processing devices are caused to implement the model rendering method of any of claims 1-6.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the model rendering method according to any one of claims 1-6.
CN202010393723.8A 2020-05-11 2020-05-11 Model rendering method, device, equipment and storage medium Active CN111583373B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010393723.8A CN111583373B (en) 2020-05-11 2020-05-11 Model rendering method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010393723.8A CN111583373B (en) 2020-05-11 2020-05-11 Model rendering method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111583373A CN111583373A (en) 2020-08-25
CN111583373B true CN111583373B (en) 2023-06-27

Family

ID=72126444

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010393723.8A Active CN111583373B (en) 2020-05-11 2020-05-11 Model rendering method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111583373B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112132934A (en) * 2020-09-22 2020-12-25 上海米哈游天命科技有限公司 Model element deformation processing method, model element deformation processing device, model element image rendering method, model element image rendering device and model element image rendering medium
CN112235634A (en) * 2020-10-16 2021-01-15 广州虎牙科技有限公司 Object rendering method and device, electronic equipment and storage medium
CN112884873B (en) * 2021-03-12 2023-05-23 腾讯科技(深圳)有限公司 Method, device, equipment and medium for rendering virtual object in virtual environment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014067372A (en) * 2012-09-27 2014-04-17 Kddi Corp Motion parallax reproduction program and device and three-dimensional model generation program and device therefor
CN105913476A (en) * 2016-06-14 2016-08-31 腾讯科技(深圳)有限公司 Rendering method and device of vegetation image
CN109903366A (en) * 2019-03-13 2019-06-18 网易(杭州)网络有限公司 The rendering method and device of dummy model, storage medium and electronic equipment
CN110838162A (en) * 2019-11-26 2020-02-25 网易(杭州)网络有限公司 Vegetation rendering method and device, storage medium and electronic equipment
CN110880204A (en) * 2019-11-21 2020-03-13 腾讯科技(深圳)有限公司 Virtual vegetation display method and device, computer equipment and storage medium
CN111127611A (en) * 2019-12-24 2020-05-08 北京像素软件科技股份有限公司 Three-dimensional scene rendering method and device and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014067372A (en) * 2012-09-27 2014-04-17 Kddi Corp Motion parallax reproduction program and device and three-dimensional model generation program and device therefor
CN105913476A (en) * 2016-06-14 2016-08-31 腾讯科技(深圳)有限公司 Rendering method and device of vegetation image
CN109903366A (en) * 2019-03-13 2019-06-18 网易(杭州)网络有限公司 The rendering method and device of dummy model, storage medium and electronic equipment
CN110880204A (en) * 2019-11-21 2020-03-13 腾讯科技(深圳)有限公司 Virtual vegetation display method and device, computer equipment and storage medium
CN110838162A (en) * 2019-11-26 2020-02-25 网易(杭州)网络有限公司 Vegetation rendering method and device, storage medium and electronic equipment
CN111127611A (en) * 2019-12-24 2020-05-08 北京像素软件科技股份有限公司 Three-dimensional scene rendering method and device and electronic equipment

Also Published As

Publication number Publication date
CN111583373A (en) 2020-08-25

Similar Documents

Publication Publication Date Title
CN111583373B (en) Model rendering method, device, equipment and storage medium
CN113674389B (en) Scene rendering method and device, electronic equipment and storage medium
KR20140139553A (en) Visibility-based state updates in graphical processing units
CN111597003B (en) Picture rendering method and device, computer equipment and medium
CN111882631B (en) Model rendering method, device, equipment and storage medium
CN113900797B (en) Three-dimensional oblique photography data processing method, device and equipment based on illusion engine
CN112734896B (en) Environment shielding rendering method and device, storage medium and electronic equipment
CN111583378B (en) Virtual asset processing method and device, electronic equipment and storage medium
CN111798554A (en) Rendering parameter determination method, device, equipment and storage medium
CN111445563A (en) Image generation method and related device
US6791563B2 (en) System, method and computer program product for global rendering
KR20040047413A (en) Comparing method of 2d cad file using graphic type
CN114782612A (en) Image rendering method and device, electronic equipment and storage medium
CN112132941A (en) Character rendering method, device and equipment and storage medium
CN107452046B (en) Texture processing method, device and equipment of three-dimensional city model and readable medium
CN114693893B (en) Data processing method and device, electronic equipment and storage medium
CN112528707A (en) Image processing method, device, equipment and storage medium
CN116452720A (en) Rendering graph generation method, rendering graph generation device, computer equipment and medium thereof
CN113694518B (en) Freezing effect processing method and device, storage medium and electronic equipment
CN109887078B (en) Sky drawing method, device, equipment and medium
CN114693780A (en) Image processing method, device, equipment, storage medium and program product
CN114119831A (en) Snow accumulation model rendering method and device, electronic equipment and readable medium
CN112465692A (en) Image processing method, device, equipment and storage medium
US20240212282A1 (en) Image rendering method and apparatus, device, and medium
CN111882637B (en) Picture rendering method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant