CN113744382A - UV mapping method based on rasterization rendering and cloud equipment - Google Patents

UV mapping method based on rasterization rendering and cloud equipment Download PDF

Info

Publication number
CN113744382A
CN113744382A CN202110883675.5A CN202110883675A CN113744382A CN 113744382 A CN113744382 A CN 113744382A CN 202110883675 A CN202110883675 A CN 202110883675A CN 113744382 A CN113744382 A CN 113744382A
Authority
CN
China
Prior art keywords
point
scalar
grid
information
mapping
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110883675.5A
Other languages
Chinese (zh)
Inventor
赵俊杰
陈健豪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Gravitational Wave Information Technology Co ltd
Original Assignee
Guangzhou Gravitational Wave Information 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 Guangzhou Gravitational Wave Information Technology Co ltd filed Critical Guangzhou Gravitational Wave Information Technology Co ltd
Priority to CN202110883675.5A priority Critical patent/CN113744382A/en
Publication of CN113744382A publication Critical patent/CN113744382A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Landscapes

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

Abstract

The application belongs to the technical field of computers, and particularly relates to a UV mapping method and cloud equipment based on rasterization rendering, wherein the method comprises the following steps: acquiring a regular grid; generating a plurality of UV points according to the type of the regular grid, wherein each UV point comprises UV information and texture information; mapping the UV information of each UV point into position information of an actual grid according to the type of the regular grid; and rendering the actual grid according to the position information and the texture information of the UV point. The beneficial effect of this application is: compared with the traditional mapping method, the method can reduce the calculation amount of the UV mapping method, is favorable for accelerating the calculation through the GPU, fully utilizes computer resources and achieves the effect of modifying and adjusting the UV points in real time; the application also provides cloud equipment for executing the UV mapping method based on the rasterization rendering, so that the effect of rendering the actual grid by using the texture information of the regular grid is realized.

Description

UV mapping method based on rasterization rendering and cloud equipment
Technical Field
The application belongs to the technical field of computers, and particularly relates to a UV mapping method based on rasterization rendering and cloud equipment.
Background
The traditional texture UV mapping operation is realized by means of ray tracing, based on the ideas of recursion and search, rays are shot to a surface point of an actual mesh, the vertex of the surface of an intermediate mesh is searched according to the information pointed by the point, and then UV information is generated.
Under the traditional texture UV operation, a user needs to edit UV information of model mesh vertexes in off-line software from 3D art, and then the UV information is delivered to a 3D art engineer, and if the UV information has problems, the UV information needs to be returned. From the process of making-acceptance-modification, considerable time and labor costs are required.
As the volume of 3D art becomes larger, more practitioners want to be able to modify and adjust the UV points in real time within the 3D editor or 3D presenter.
Disclosure of Invention
In order to solve the defects of the prior art to a certain extent, the application provides a UV mapping method based on rasterization rendering and cloud equipment.
The application provides a UV mapping method based on rasterization rendering, which comprises the following steps: acquiring a regular grid; generating a plurality of UV points according to the type of the regular grid, wherein each UV point comprises UV information and texture information; mapping the UV information of each UV point into position information of an actual grid according to the type of the regular grid; and rendering the actual grid according to the position information and the texture information of the UV point.
In the technical scheme, different UV points are generated according to the type of the grid, and the UV information of the UV points is mapped so as to realize the effect of rendering the actual grid by the texture information on the UV points.
In the above technical solution, the type of the regular grid is a sphere, and the radius of the sphere is r; the generating of the UV points according to the type of the regular grid specifically includes: establishing a coordinate system with the sphere center of the sphere as an origin; taking one point of the surface of the sphere as a first starting point, wherein the UV information of the first starting point is (u ', v'), and u 'and v' are scalars; updating the scalar u' for a first preset number of times m, and generating a first time for each updateA UV point, wherein the scalar u ' of the first UV point generated is updated the ith ' time 'i’I' is more than or equal to 1 and less than or equal to m, and the calculation formula is as follows:
Figure BDA0003191716600000021
scalar of the first UV point generated by the ith 'update is v'i’,v′i’V'; taking another point on the surface of the sphere as a second starting point, wherein the UV information of the second starting point is (u ', v'), and u 'and v' are scalar quantities; updating the scalar v 'for a second preset number of times n, and generating a second UV point in each updating, wherein the scalar of the second UV point generated by the ith' updating
Figure BDA0003191716600000023
I is more than or equal to 1 and is less than or equal to n, and the calculation formula is as follows:
Figure BDA0003191716600000022
scalar quantity of the second UV point generated by the ith' update is
Figure BDA0003191716600000024
The position information includes first position information and second position information, wherein the first position information is (x ', y', z '), x', y 'and z' are scalars, and a formula of the first UV point mapped to the real grid is: x'i’=r cos 2πu′i’;y’i’=r sin 2πu′i’cos 2πv′i’;z’i’=r sin 2πu′i’sin 2πv′i’(ii) a Wherein, x'i’Mapping a first UV point generated for the i 'th update to a scalar x', y 'obtained for the real grid'i’Mapping a first UV point generated for the i 'th update to scalar y', z 'obtained for the real grid'i’Mapping a first UV point generated for the ith 'update to a scalar z' obtained by the actual grid; the second location information is (x ", y", z "), x", y ", and z" are scalars, and the formula for mapping the second UV point to the real grid is:
Figure BDA0003191716600000033
Figure BDA0003191716600000034
wherein the content of the first and second substances,
Figure BDA0003191716600000035
a second UV point generated for the ith '' update is mapped to a scalar x '' obtained for the real grid,
Figure BDA0003191716600000036
a second UV point generated for the ith '' update is mapped to a scalar y '' obtained for the real grid,
Figure BDA0003191716600000037
the second UV point generated for the i '' th update maps to the scalar z '' obtained for the real grid.
In the technical scheme, the first UV point and the second UV point are generated on the regular grid of the sphere type, the two UV points are mapped by using the mapping formula, and the actual grid is rendered by depending on texture information on the UV points.
In the above technical solution, the first preset number m satisfies the following condition:
Figure BDA0003191716600000031
wherein, theta is a first increment of each update of the scalar u'; the second preset number n meets the following condition:
Figure BDA0003191716600000032
where Φ is the second increment of each update of scalar v ".
In the technical scheme, the increment and the preset times are in a certain relation, so that repeated UV points can be prevented from being generated, the calculated amount of the method in the mapping process is reduced, and the effect of modifying and adjusting the UV points in real time is achieved.
In the above technical solution, the type of the regular grid is a cylinder, the radius of the cylinder is r', and the height is h; the generating of the UV points according to the type of the regular grid specifically includes: establishing a coordinate system by taking the circle center of the bottom surface of the cylinder as an origin; taking one point on the surface of the cylinder as a third starting point, wherein the UV information of the third starting point is (u ', v'), and u ', v' are scalars; updating the scalar u 'for a third preset time l, and generating a third UV point for each updating, wherein the scalar of the third UV point generated by the ith' updating
Figure BDA0003191716600000043
The calculation formula of (2) is as follows:
Figure BDA0003191716600000044
scalar quantity of the third UV point generated by the ith' update is
Figure BDA0003191716600000045
The position information is (x ', y', z '), and x', y ', and z' are scalars; the formula for mapping the third UV point to the actual grid is:
Figure BDA0003191716600000046
Figure BDA0003191716600000047
wherein the content of the first and second substances,
Figure BDA0003191716600000048
a third UV point generated for the i '"th update is mapped to the scalar x'" obtained for the real grid,
Figure BDA0003191716600000049
a third UV point generated for the ith update maps to scalar y' "obtained for the real grid,
Figure BDA00031917166000000410
for the i' ″ updateThe generated third UV point is mapped to scalar z "' obtained for the real grid.
In the technical scheme, a third UV point is generated on a regular grid of a cylinder type, and the third UV point is mapped by using a mapping formula, so that the effect of rendering the actual grid by texture information carried on the third UV point is realized.
In the above technical solution, the third preset number of times 1 satisfies the following condition:
Figure BDA0003191716600000042
wherein θ' is a scalar quantity
Figure BDA00031917166000000411
A third increment for each update.
In the technical scheme, the third increment and the third preset times are in a certain relation, so that repeated UV points can be avoided from being generated, the calculated amount of the method in the mapping process is reduced, and the effect of modifying and adjusting the UV points in real time is achieved.
In the above technical solution, the type of the regular grid is a cube; the generating of the UV points according to the type of the regular grid specifically includes: establishing a coordinate system by taking the center of the actual grid as an origin, wherein the origin is also the center of the cube; acquiring 8 vertexes of the cube to serve as fourth UV points, wherein UV information of the fourth UV points is respectively
Figure BDA0003191716600000051
Wherein p is 1, 2, 3 … … 8,
Figure BDA0003191716600000052
and
Figure BDA0003191716600000053
is a scalar; the position information is (u "", v ""), and u "" and v "" are scalars; dividing the smaller two scalars in the UV information by the scalars with the largest absolute values respectively to obtain a first result and a second result; comparing the first result with the first resultThe second result is mapped to [0, 1]]And in the interval, the first result after mapping is scalar u ', and the second result after mapping is scalar v'.
In the technical scheme, 8 vertexes on the cube are used as the fourth UV point, and the method maps the fourth UV point so as to realize the effect of rendering the actual grid by the texture information carried on the fourth UV point.
In the above technical solution, the actual grid is a sphere.
This application on the other hand still provides a high in the clouds equipment, includes: an acquisition module for acquiring a regular grid; the generation module is used for generating UV points containing UV information and texture information according to the type of the regular grid; a mapping module for mapping the UV points to position information of an actual grid; and the rendering module is used for rendering the actual grid according to the position information and the corresponding texture information.
Through the cloud equipment, the UV mapping method based on the rasterization rendering can be executed, so that the effect of rendering the actual grid by using the texture information of the regular grid is realized.
The beneficial effect of this application is: the method comprises the steps that different UV points are generated according to the types of grids, and UV information of the UV points is mapped to achieve the effect of rendering the actual grids by texture information on the UV points; another aspect of the present application provides a cloud device, through which the UV mapping method based on rasterization rendering of the present application can be executed to achieve an effect of rendering an actual mesh using texture information of a regular mesh.
Drawings
FIG. 1 shows a flow diagram of a UV mapping method based on rasterization rendering according to one embodiment of the present application;
fig. 2 shows a schematic structural diagram of a cloud device according to an embodiment of the present application.
Detailed Description
In order that the above objects, features and advantages of the present application may be more clearly understood, a more particular description of the present application will be rendered by reference to the appended drawings and detailed description. It should be noted that the embodiments and features of the embodiments of the present application may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application, but the present application may be practiced in other ways than those specifically described herein, and thus the scope of the present application is not limited by the specific embodiments disclosed below.
Some embodiments of the present application are described below with reference to the accompanying drawings.
As shown in fig. 1, the present application provides a UV mapping method based on rasterization rendering, including: 101: acquiring a regular grid; 102: generating a plurality of UV points according to the type of the regular grid, wherein each UV point comprises UV information and texture information; 103: mapping the UV information of each UV point into position information of an actual grid according to the type of the regular grid; 104: and rendering the actual grid according to the position information and the texture information of the UV point.
In the method, rasterization describes a process of mapping UV information to position information of an actual grid, and because the UV information and the position information have a corresponding relation, UV points can be mapped to the actual grid through rasterization so as to render and color the actual grid by using texture information of the UV points.
The texture information may be color information of UV points on a regular grid.
Different UV points are generated according to the type of the grid, and the UV information of the UV points is mapped to achieve the effect that texture information on the UV points performs rendering on the actual grid.
Specifically, in mathematics, a mapping refers to the relationship of elements "corresponding" to each other between two sets of elements. Since the UV information of the regular grid and the position information of the actual grid have a corresponding relationship, the position information in the actual grid is obtained from the UV information by a mapping method to render the actual grid with the corresponding texture information. Modern GPUs are implemented based on the principle of rasterization rendering, and the UV mapping method is proposed on rasterization rendering, so that the operation can be accelerated directly by the GPU.
For the method, the number of UV points on the regular grid can be preset, and the remaining points can be converted into UV points by a triangular interpolation method for subsequent mapping processes.
Taking a sphere as an example, the rendering process of the method is introduced. The radius of the sphere is r, and a coordinate system with the sphere center of the sphere as an origin is established; taking one point on the surface of the sphere as a first starting point, wherein the UV information of the first starting point is (u ', v'), and u 'and v' are scalars; updating scalar u 'for a first preset number of times m, and generating a first UV point in each updating, wherein scalar u' of the first UV point generated in the ith 'updating'i’I' is more than or equal to 1 and less than or equal to m, and the calculation formula is as follows:
Figure BDA0003191716600000071
scalar of the first UV point generated by the ith 'update is v'i’,v′i’V'; taking another point on the surface of the sphere as a second starting point, wherein the UV information of the second starting point is (u ', v'), and u 'and v' are scalars; updating the scalar v 'for a second preset number of times n, and generating a second UV point in each updating, wherein the scalar of the second UV point generated by the ith' updating
Figure BDA0003191716600000073
I is more than or equal to 1 and n is more than or equal to n, and the calculation formula is as follows:
Figure BDA0003191716600000072
the ith' timeScalar quantity of newly generated second UV point is
Figure BDA0003191716600000074
Figure BDA0003191716600000075
The position information includes first position information and second position information, wherein the first position information is (x ', y', z '), x', y 'and z' are scalars, and the formula for mapping the first UV point to the real grid is: x'i’=r cos 2πu′i’;y’i’=r sin 2πu′i’ cos 2πv′i’;z’i’=r sin2πu′i’ sin2πv′i’(ii) a Wherein, x'i’Mapping the first UV point generated for the ith' update to actual
Scalar x ', y ' obtained from grid 'i’Scalar y ', z' obtained by mapping the first UV point generated for the ith 'update to the actual grid'i’Mapping a first UV point generated for the ith 'update to a scalar z' obtained by the actual grid; the second location information is (x ", y", z "), x", y ", and z" are scalars, and the formula for the second UV point to map to the real grid is:
Figure BDA0003191716600000081
Figure BDA0003191716600000082
wherein the content of the first and second substances,
Figure BDA0003191716600000083
the second UV point generated for the ith "update is mapped to the scalar x" obtained for the real grid,
Figure BDA0003191716600000084
the second UV point generated for the ith "update is mapped to the scalar y" obtained for the real grid,
Figure BDA0003191716600000085
generating for the i '' th updateIs mapped to the scalar z "obtained for the actual grid.
In the above embodiment, the UV information of the first start point and the UV information of the second start point may be obtained in a manner that: establishing a polar coordinate system with the sphere center as an origin, wherein the polar coordinate of the first starting point is (r, u ', v'), u 'is azimuth information of the first starting point in the polar coordinate system, v' is elevation information of the first starting point in the polar coordinate system, and r is a known quantity and is omitted, so that UV information of the first starting point is obtained; the polar coordinates of the second starting point are (r, u ", v"), where u "is the azimuth information of the first starting point in the polar coordinate system, and v" is the elevation information of the first starting point in the polar coordinate system, and since r is a known quantity, it is omitted, thereby obtaining the UV information of the second starting point.
By setting the first preset times m, the generation number of the first UV points is controlled, the generation of the first UV points at the same position is avoided, and the calculation amount is reduced. Further, the first preset number m satisfies the following condition:
Figure BDA0003191716600000091
where θ is the first increment of each update of scalar u'. The first preset times m meeting the conditions enable the generation number of the first UV points to be a reasonable value, and the calculation amount during the execution of the method is effectively reduced.
The second preset times n are set, so that the generation number of the second UV points is controlled, the generation of the second UV points at the same position is avoided, and the calculation amount is reduced. Further, the second preset number n satisfies the following condition:
Figure BDA0003191716600000092
where Φ is the second increment of each update of scalar v ". The second preset number n meeting the above conditions makes the generation number of the second UV points a reasonable value, which can effectively reduce the amount of calculation in the execution of the method.
By the above generation and mapping of the first UV point and the second UV point, the UV information (u ', v ') of the first UV point on the regular grid can be mapped to the position information (x ', y ', z ') on the actual grid. Mapping the UV information (u ', v ') of the second UV point on the regular grid to the position information (x ', y ', z ') on the actual grid, thereby enabling rendering of the actual grid with the corresponding texture information. The number of the first UV point and the second UV point can be increased by a triangle interpolation method, so that the rendering effect is improved. The principle of triangular interpolation is as follows: and knowing the UV information of the three vertexes of the triangle, taking the gravity center coordinate component of the point to be interpolated as a weight, multiplying the three weights by the UV information of the three vertexes respectively, and finally adding the weights together to obtain the UV information of the new UV point.
The rendering process of the method is described by taking a cylinder as an example. The radius of the cylinder is r' and the height is h; establishing a coordinate system by taking the center of the circle of the bottom surface of the cylinder as an origin; taking one point on the surface of the cylinder as a third starting point, wherein the UV information of the third starting point is (u ', v'), and u ', v' are scalars; updating the scalar u 'for a third preset time l, and generating a third UV point for each updating, wherein the scalar of the third UV point generated by the ith' updating
Figure BDA0003191716600000094
The calculation formula of (2) is as follows:
Figure BDA0003191716600000095
scalar quantity of the third UV point generated by the ith' update is
Figure BDA0003191716600000102
The position information is (x ', y', z '), and x', y ', and z' are scalars; the formula for mapping the third UV point to the actual grid is:
Figure BDA0003191716600000103
Figure BDA0003191716600000104
wherein the content of the first and second substances,
Figure BDA0003191716600000105
the third UV point generated for the ith "update is mapped to the scalar x" obtained for the actual grid,
Figure BDA0003191716600000106
the third UV point generated for the ith "update maps to the scalar y" obtained for the actual grid,
Figure BDA0003191716600000107
the third UV point generated for the ith '"update maps to the scalar z'" obtained for the actual grid.
In the above embodiment, the UV information of the third starting point may be obtained by: and establishing a cylindrical coordinate system with the center of the bottom surface of the cylinder as an origin, wherein the coordinates of the first starting point are (r ', u', v '), u' is azimuth information of the first starting point in the coordinate system, v 'is height information of the first starting point in the coordinate system, and r' is a known quantity, so that the UV information of a third starting point is obtained.
By setting the third preset times l, the generation number of the third UV points is controlled, the generation of the third UV points at the same position is avoided, and the calculation amount is reduced. Further, the third preset number n satisfies the following condition:
Figure BDA0003191716600000101
where Φ is the third increment of each update of scalar v ".
By the generation and mapping of the third UV point, the UV information (u ' ", v '") of the third UV point on the regular grid can be mapped to the position information (x ' ", y '", z ' ") on the actual grid, thereby rendering the actual grid using the corresponding texture information.
Taking a cube as an example, the execution flow of the method is described. Establishing a coordinate system by taking the center of the actual grid as an original point, wherein the original point is also the center of the cube; 8 vertexes of the cube are obtained as fourth UV points, and UV information of the fourth UV points is respectively
Figure BDA0003191716600000108
Wherein, i "" ═ 1, 2, 3 … … 8,
Figure BDA0003191716600000114
and
Figure BDA0003191716600000115
is a scalar; the position information is (u "", v ""), and u "" and v "" are scalars; dividing two smaller scalars in the UV information by the scalars with the largest absolute values respectively to obtain a first result and a second result; mapping the first result and the second result to [0, 1]]In the interval, the first result after mapping is scalar u "", and the second result after mapping is scalar v "".
Scalar quantity
Figure BDA0003191716600000116
May be as
Figure BDA0003191716600000117
Wherein the content of the first and second substances,
Figure BDA0003191716600000118
is the i' fourth UV point, ki″″A first result corresponding to the ith "" fourth UV spot; scalar quantity
Figure BDA0003191716600000119
May be as
Figure BDA00031917166000001110
Wherein the content of the first and second substances,
Figure BDA00031917166000001111
is the j' fourth UV point, ji″″Second result corresponding to the ith "" fourth UV spot.
As shown in fig. 2, another aspect of the present application provides a cloud device, including: an obtaining module 201, wherein the obtaining module 201 is configured to obtain a regular grid; the generating module 202, the generating module 202 is configured to generate UV points including UV information and texture information according to the type of the regular grid; the mapping module 203, the mapping module 203 is used for mapping the UV points to the position information of the actual grid; and the rendering module 204, wherein the rendering module 204 is configured to render the actual mesh according to the position information and the corresponding texture information.
The UV mapping method based on rasterization rendering can be executed through the cloud equipment, so that the effect of rendering an actual grid by using texture information of a regular grid is achieved.
Further, when the obtaining module 201 obtains the regular grid of the sphere, the generating module 202 may obtain the UV information (u ', v') of the first starting point and the UV information (u ", v") of the second starting point by using a point on the surface of the sphere as the first starting point, update the first starting point m times, generate one first UV point each time, and generate the first UV point through a formula
Figure BDA00031917166000001112
Obtaining scalar u 'of first UV point'i’Taking scalar v ' of the first initial point as scalar v ' of the first UV point 'i’(ii) a Updating the second initial point n times, generating a second UV point for each update, and calculating the second UV point according to the formula
Figure BDA0003191716600000121
Scalar quantity for obtaining second UV point
Figure BDA0003191716600000122
Taking the scalar u' of the second starting point as the scalar of the second UV point
Figure BDA0003191716600000123
After obtaining the UV information and the texture information of the UV point, the mapping module 203 passes through the formula x'i’=r cos 2πu′i’、y’i’=r sin 2πu′i’ cos 2πv′i’And z'i’=r sin 2πu′i’ sin 2πv′i’Converting the first UV point into corresponding position information (x ') in the real grid'i’,y’i’,z’i’)。x’i’Scalar x ', y' obtained by mapping the first UV point generated for the ith 'update to the real grid'i’Scalar y ', z' obtained by mapping the first UV point generated for the ith 'update to the actual grid'i’The first UV point generated for the ith 'update maps to the scalar z' obtained for the real grid.
The mapping module 203 passes the formula
Figure BDA0003191716600000124
Figure BDA0003191716600000125
And
Figure BDA0003191716600000126
converting the second UV point into corresponding position information in the real grid
Figure BDA0003191716600000127
Wherein the content of the first and second substances,
Figure BDA0003191716600000128
the second UV point generated for the ith "update is mapped to the scalar x" obtained for the real grid,
Figure BDA0003191716600000129
the second UV point generated for the ith "update is mapped to the scalar y" obtained for the real grid,
Figure BDA00031917166000001210
the second UV point generated for the ith "update maps to the scalar z" obtained for the real grid.
Finally, the rendering module 204 colors the actual mesh with texture information on each UV point.
Accordingly, the generating module 202 may further generate more first UV points and second UV points on the regular grid according to the principle of triangular interpolation, so as to improve the coloring effect of the rendering module 204.
Rule net for acquiring sphere by acquisition module 201During the grid generation, the generation module 202 establishes a coordinate system with the center of the circle of the bottom surface of the cylinder as an origin; taking one point on the surface of the cylinder as a third starting point, wherein the UV information of the third starting point is (u ', v'), and u ', v' are scalars; updating the scalar u 'for a third preset time l, and generating a third UV point for each updating, wherein the scalar of the third UV point generated by the ith' updating
Figure BDA0003191716600000132
The calculation formula of (2) is as follows:
Figure BDA0003191716600000133
scalar quantity of the third UV point generated by the ith' update is
Figure BDA0003191716600000134
The mapping module 203 passes the formula
Figure BDA0003191716600000135
Mapping UV information on a third UV point to position information of an actual grid
Figure BDA0003191716600000136
Wherein the content of the first and second substances,
Figure BDA0003191716600000137
the third UV point generated for the ith "update is mapped to the scalar x" obtained for the actual grid,
Figure BDA0003191716600000138
the third UV point generated for the ith "update maps to the scalar y" obtained for the actual grid,
Figure BDA0003191716600000139
the third UV point generated for the ith '"update maps to the scalar z'" obtained for the actual grid.
When the obtaining module 201 obtains the regular grid of the cube, the generating module 202 establishes a coordinate system with the center of the actual grid as an origin, and the origin is also the center of the cube; obtaining cubeThe 8 vertexes of the body are used as fourth UV points, and the UV information of the fourth UV points is respectively
Figure BDA00031917166000001310
Wherein p is 1, 2, 3 … … 8,
Figure BDA00031917166000001311
and
Figure BDA00031917166000001312
is a scalar; the position information is (u "", v ""), and u "" and v "" are scalars; dividing two smaller scalars in the UV information by the scalars with the largest absolute values respectively to obtain a first result and a second result; the mapping module 203 maps the first result and the second result to [0, 1]]In the interval, the first result after mapping is scalar u "", and the second result after mapping is scalar v "".
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems and units may refer to the corresponding processes in the foregoing application embodiments, and are not described herein again.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit and scope of the present disclosure, and the present disclosure should be construed as being covered by the claims and the specification.

Claims (8)

1. A UV mapping method based on rasterization rendering is characterized by comprising the following steps:
acquiring a regular grid;
generating a plurality of UV points according to the type of the regular grid, wherein each UV point comprises UV information and texture information;
mapping the UV information of each UV point into position information of an actual grid according to the type of the regular grid;
and rendering the actual grid according to the position information and the texture information of the UV point.
2. The UV mapping method based on rasterization rendering of claim 1, comprising:
the type of the regular grid is a sphere, and the radius of the sphere is r;
the generating of the UV points according to the type of the regular grid specifically includes:
establishing a coordinate system with the sphere center of the sphere as an origin;
taking one point of the surface of the sphere as a first starting point, wherein the UV information of the first starting point is (u ', v'), and u 'and v' are scalars;
updating scalar u 'for a first preset number of times m, and generating a first UV point in each updating, wherein scalar u' of the first UV point generated in the ith 'updating'i’I' is more than or equal to 1 and less than or equal to m, and the calculation formula is as follows:
Figure FDA0003191716590000011
scalar of the first UV point generated by the ith 'update is v'i’,v′i’=v’;
Taking another point on the surface of the sphere as a second starting point, wherein the UV information of the second starting point is (u ', v'), and u 'and v' are scalar quantities;
updating the scalar v '' for a second preset number of times n, each time generating a second UV point, wherein the ith '' updates the scalar of the generated second UV point
Figure FDA0003191716590000012
I is more than or equal to 1 '' and less than or equal to n, and the calculation formula is as follows:
Figure FDA0003191716590000021
scalar quantity of the second UV point generated by the i '' th update is
Figure FDA0003191716590000022
Figure FDA0003191716590000023
The location information includes first location information and second location information, wherein,
the first position information is (x ', y', z '), and x', y ', and z' are scalars, and a formula of the first UV point mapped to the real grid is:
x’i’,=r cos 2πu′i’
y’i’=r sin 2πu′i’,cos 2πv′i’
z’i’=r sin 2πu′i’sin 2πv′i’
wherein, x'i’Mapping a first UV point generated for the i 'th update to a scalar x', y 'obtained for the real grid'i’Mapping a first UV point generated for the i 'th update to scalar y', z 'obtained for the real grid'i’Mapping a first UV point generated for the ith 'update to a scalar z' obtained by the actual grid;
the second location information is (x ", y", z "), x", y ", and z" are scalars, and the formula for mapping the second UV point to the real grid is:
Figure FDA0003191716590000024
Figure FDA0003191716590000025
Figure FDA0003191716590000026
wherein the content of the first and second substances,
Figure FDA0003191716590000027
the second UV point generated for the ith "update maps to the scalar x" obtained for the real grid,
Figure FDA0003191716590000028
a second UV point generated for the ith '' update is mapped to a scalar y '' obtained for the real grid,
Figure FDA0003191716590000029
the second UV point generated for the i '' th update maps to the scalar z '' obtained for the real grid.
3. The UV mapping method based on rasterization rendering of claim 2,
the first preset number m meets the following condition:
Figure FDA0003191716590000031
wherein, theta is a first increment of each update of the scalar u';
the second preset number n meets the following condition:
Figure FDA0003191716590000032
where Φ is the second increment of each update of scalar v ".
4. The UV mapping method based on rasterization rendering of claim 1, comprising:
the type of the regular grid is a cylinder, the radius of the cylinder is r', and the height of the cylinder is h;
the generating of the UV points according to the type of the regular grid specifically includes:
establishing a coordinate system by taking the circle center of the bottom surface of the cylinder as an origin;
taking one point on the surface of the cylinder as a third starting point, wherein the UV information of the third starting point is (u ', v'), and u ', v' are scalars;
updating the scalar u 'for a third preset time l, and generating a third UV point for each updating, wherein the scalar of the third UV point generated by the ith' updating
Figure FDA0003191716590000034
The calculation formula of (2) is as follows:
Figure FDA0003191716590000033
scalar quantity of the third UV point generated by the ith' update is
Figure FDA0003191716590000035
Figure FDA0003191716590000036
The position information is (x ', y', z '), and x', y ', and z' are scalars;
the formula for mapping the third UV point to the actual grid is:
Figure FDA0003191716590000042
Figure FDA0003191716590000043
Figure FDA0003191716590000044
wherein the content of the first and second substances,
Figure FDA0003191716590000045
a third UV point generated for the i '"th update is mapped to the scalar x'" obtained for the real grid,
Figure FDA0003191716590000046
the third UV point generated for the i "'th update is mapped to the scalar y'" obtained for the real grid,
Figure FDA0003191716590000047
the third UV point generated for the i '' 'th update maps to the scalar z' '' obtained for the real grid.
5. The UV mapping method based on rasterization rendering of claim 4, wherein the third preset number of times 1 satisfies the following condition:
Figure FDA0003191716590000041
wherein θ' is a scalar quantity
Figure FDA0003191716590000048
A third increment for each update.
6. The UV mapping method based on rasterization rendering of claim 1, comprising:
the type of the regular grid is a cube;
the generating of the UV points according to the type of the regular grid specifically includes:
establishing a coordinate system by taking the center of the actual grid as an origin, wherein the origin is also the center of the cube;
acquiring 8 vertexes of the cube to serve as fourth UV points, wherein UV information of the fourth UV points is respectively
Figure FDA0003191716590000049
Wherein p is 1, 2, 3 … … 8,
Figure FDA0003191716590000051
and
Figure FDA0003191716590000052
is a scalar;
the position information is (u "", v ""), and u "" and v "" are scalars;
dividing the smaller two scalars in the UV information by the scalars with the largest absolute values respectively to obtain a first result and a second result;
and mapping the first result and the second result to a [0, 1] interval, wherein the mapped first result is a scalar u ', and the mapped second result is a scalar v'.
7. The UV mapping method based on rasterization rendering of claim 6 wherein said actual grid is a sphere.
8. A cloud device, comprising:
an acquisition module for acquiring a regular grid;
the generation module is used for generating UV points containing UV information and texture information according to the type of the regular grid;
a mapping module for mapping the UV points to position information of an actual grid;
and the rendering module is used for rendering the actual grid according to the position information and the corresponding texture information.
CN202110883675.5A 2021-08-02 2021-08-02 UV mapping method based on rasterization rendering and cloud equipment Pending CN113744382A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110883675.5A CN113744382A (en) 2021-08-02 2021-08-02 UV mapping method based on rasterization rendering and cloud equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110883675.5A CN113744382A (en) 2021-08-02 2021-08-02 UV mapping method based on rasterization rendering and cloud equipment

Publications (1)

Publication Number Publication Date
CN113744382A true CN113744382A (en) 2021-12-03

Family

ID=78729796

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110883675.5A Pending CN113744382A (en) 2021-08-02 2021-08-02 UV mapping method based on rasterization rendering and cloud equipment

Country Status (1)

Country Link
CN (1) CN113744382A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008152743A (en) * 2006-12-18 2008-07-03 Kaadeikku Corporation:Kk Circuit for calculating texture pattern size
US20180144535A1 (en) * 2014-06-06 2018-05-24 Matterport, Inc. Optimal texture memory allocation
CN108280870A (en) * 2018-01-24 2018-07-13 郑州云海信息技术有限公司 A kind of point cloud model texture mapping method and system
CN111508052A (en) * 2020-04-23 2020-08-07 网易(杭州)网络有限公司 Rendering method and device of three-dimensional grid body
CN112802172A (en) * 2021-02-24 2021-05-14 网易(杭州)网络有限公司 Texture mapping method and device of three-dimensional model, storage medium and computer equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008152743A (en) * 2006-12-18 2008-07-03 Kaadeikku Corporation:Kk Circuit for calculating texture pattern size
US20180144535A1 (en) * 2014-06-06 2018-05-24 Matterport, Inc. Optimal texture memory allocation
CN108280870A (en) * 2018-01-24 2018-07-13 郑州云海信息技术有限公司 A kind of point cloud model texture mapping method and system
CN111508052A (en) * 2020-04-23 2020-08-07 网易(杭州)网络有限公司 Rendering method and device of three-dimensional grid body
CN112802172A (en) * 2021-02-24 2021-05-14 网易(杭州)网络有限公司 Texture mapping method and device of three-dimensional model, storage medium and computer equipment

Similar Documents

Publication Publication Date Title
CN106469463B (en) A kind of rendering method mixed based on CPU with GPU
CN112884902B (en) Point cloud registration-oriented target ball position optimization method
CN105787865A (en) Fractal image generation and rendering method based on game engine and CPU parallel processing
CN104463954B (en) A kind of analogy method and system of 3-D view surface details
CN103500467A (en) Constructive method of image-based three-dimensional model
CN109685901A (en) A kind of military symbol mark and draw in dynamic arrow mark method for drafting
CN109035383A (en) A kind of method for drafting, device and the computer readable storage medium of volume cloud
CN112206528B (en) Vegetation model rendering method, device, equipment and storage medium
CN110378992A (en) Towards large scene model web terminal dynamic rendering LOD processing method
CN106296813B (en) Three-dimensional static map producing method
CN106600684A (en) Oblique model organization construction method
CN112365598B (en) Method, device and terminal for converting oblique photography data into three-dimensional data
CN111563948A (en) Virtual terrain rendering method for dynamically processing and caching resources based on GPU
CN114067079A (en) Complex curved surface electromagnetic wave vector dynamic visualization method
CN114998503A (en) White mold automatic texture construction method based on live-action three-dimension
CN105976306B (en) It is a kind of based on energy consumption-error budget real-time drawing method
CN117274527B (en) Method for constructing three-dimensional visualization model data set of generator equipment
CN113744382A (en) UV mapping method based on rasterization rendering and cloud equipment
CN109087391A (en) Drawing method is marked by a kind of army under three-dimensional scenic
KR101098830B1 (en) Surface texture mapping apparatus and its method
CN110619675A (en) OsgEarth-based surface vector data loading method
CN109887103B (en) Unity3D positioning and point-distributing method, device, equipment and computer-readable storage medium
CN116630486B (en) Semi-automatic animation production method based on Unity3D rendering
CN110442906B (en) Quantitative characterization method for plane morphological parameters of cardiac beach sand body
Wang Construction of Internet Game Development Environment based on OpenGL and Augmented Reality

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