Rendering method, device, and system
By performing matrix operations on remote computing nodes through a distributed rendering system, the problem of excessively long ray tracing rendering time is solved, achieving efficient real-time rendering effects.
Patent Information
- Application Number
- CN202011291346.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-17
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2040-11-17
AI Technical Summary
Existing real-time rendering technologies, such as ray tracing, involve a large amount of computation, resulting in poor real-time performance and making it difficult to meet the 33-millisecond rendering time requirement at a refresh rate of 30 frames per second.
A distributed rendering system is adopted, which performs matrix operations on remote computing nodes through the rendering application server and the rendering engine to generate rendered images, including constructing multiple matrices and performing intersection operations to reduce ray tracing rendering time.
It effectively reduces the time required for ray tracing rendering, improves the real-time performance of rendering, and meets the refresh rate requirement of 30 frames per second.
Smart Images

Figure CN114581588B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of 3D graphics, and more particularly to a rendering method, device, and system. Background Technology
[0002] Rendering refers to the process of generating images from a 3D model using software. The 3D model is a description of a 3D object using a strictly defined language or data structure, including geometry, viewpoint, texture, and lighting information. The image is a digital image or a bitmap image. The term "rendering" is similar to "an artist's rendering of a scene." Additionally, rendering is used to describe "the process of calculating the effects in a video editing file to generate the final video output." Rendering can include pre-rendering (offline rendering) or real-time rendering (online rendering). Pre-rendering is typically used for scripted live-action simulations such as movies and commercials; real-time rendering is typically used for unscripted live-action simulations such as flight training, 3D games, and interactive architectural demonstrations.
[0003] Real-time rendering places extremely high demands on computational speed. Taking 3D games as an example, at a refresh rate of 30 frames per second, each frame takes approximately 33 milliseconds to render. Therefore, the rendering time for each frame must absolutely not exceed 33 milliseconds. Currently, real-time rendering typically employs ray tracing rendering.
[0004] However, ray tracing rendering requires a huge amount of computation, so it takes a long time and has poor real-time performance. Summary of the Invention
[0005] To address the aforementioned issues, this application provides a rendering method, device, and system that can effectively reduce the time required for ray tracing rendering.
[0006] In a first aspect, a rendering system is provided, including a rendering application server, a rendering application client, and a rendering engine, wherein the rendering application client is deployed on a terminal device, and the rendering application server and the rendering engine are deployed on a remote computing node;
[0007] The rendering application server is used to receive rendering requests, wherein the rendering requests are used to indicate the direction vectors of M rays and the position information of N grids. Based on the direction vectors of the M rays and the position information of the N grids, the rendering engine is invoked to construct multiple matrices, matrix operations are performed on the multiple matrices to obtain the intersection result of the M rays and the N grids, and a rendered image is generated based on the intersection result of the M rays and the N grids.
[0008] The rendering application client is used to generate the rendering request and receive the rendered image.
[0009] In some possible designs, the mesh is a triangle obtained by segmenting a 3D model of the target scene.
[0010] In some possible designs, the position information of the N grids includes: the vertex coordinates of the N grids, or the vectors of each edge of the N grids.
[0011] In some possible designs, the plurality of matrices includes: matrix D 3M*3 Matrix E2 3*N Matrix E1 N*3 Matrix S 3MN*3 Matrix E1' 3*N and matrix E2' N*3 , wherein, the D 3M*3 E2 is a matrix composed of the direction vectors of the M rays. 3*N E1 is a 3*N matrix composed of the vectors of the second edge e2 of N grids. N*3 S is a matrix of size N*3 composed of the vectors of the first edge e1 of the N grids. 3MN*3 The matrix E1' is composed of the vectors of the starting points of the M rays and the vertices V0 of the N grids; 3*N E2' is a 3*N matrix composed of the vectors of the first edge e1 of the N grids. N*3 It is a matrix of size N*3 composed of the vectors of the second edge e2 of the N grids.
[0012] In some possible designs, the matrix D 3M*3 for:
[0013]
[0014] Where d1 is the direction vector of the first ray, d2 is the direction vector of the second ray, ..., d M Let M be the direction vector of the Mth ray;
[0015] The matrix E2 3*N for:
[0016]
[0017] in, Let e2 be the vector projection of the second edge e2 of the first grid onto the x-axis. Let e2 be the vector projection of the second edge e2 of the first grid onto the y-axis. Let e2 be the vector projection of the second edge e2 of the first grid onto the z-axis, ... Let e2 be the vector projection of the second edge e2 of the Nth grid onto the x-axis. Let e2 be the vector projection of the second edge e2 of the Nth grid onto the y-axis. Let e2 be the vector projection of the second edge e2 of the Nth grid onto the z-axis;
[0018] The matrix E1 N*3 for:
[0019]
[0020] in, Let e1 be the vector projection of the first edge e1 of the first grid onto the x-axis. Let e1 be the vector projection of the first edge e1 of the first grid onto the y-axis. Let e1 be the projection of the vector of the first edge e1 of the first grid onto the z-axis, ... Let e1 be the vector projection of the first edge e1 of the Nth grid onto the x-axis. Let e1 be the vector projection of the second edge e1 of the Nth grid onto the y-axis. Let e1 be the vector projection of the second edge e1 of the Nth grid onto the z-axis.
[0021] The matrix S 3MN*3 for:
[0022]
[0023] Among them, S 11 Let S be the vector from the origin of the first ray and the vertex V0 of the first grid, ..., S 1N S is the vector from the origin of the first ray to the vertex V0 of the Nth grid; 21 Let S be the vector from the origin of the second ray to the vertex V0 of the first grid, ..., S 2N The vector from the origin of the second ray to the vertex V0 of the Nth grid; ...; S M1 Let S be the vector from the origin of the Mth ray to the vertex V0 of the first grid, ..., S MN Let V be the vector connecting the starting point of the Mth ray and the vertex V0 of the Nth grid.
[0024] The matrix E1' 3*N for:
[0025]
[0026] in, Let e1 be the vector projection of the first edge e1 of the first grid onto the x-axis. Let e1 be the vector projection of the first edge e1 of the first grid onto the y-axis. Let e1 be the projection of the vector of the first edge e1 of the first grid onto the z-axis, ... Let e1 be the vector projection of the first edge e1 of the Nth grid onto the x-axis. Let e1 be the vector projection of the first edge e1 of the Nth grid onto the y-axis. Let e1 be the vector of the first edge e1 of the Nth grid, projected onto the z-axis.
[0027] The matrix E2' N*3 for:
[0028]
[0029] in, Let e2 be the vector projection of the second edge of the first triangle's mesh onto the x-axis. Let e2 be the vector projection of the second edge of the first triangle's mesh onto the y-axis. Let e2 be the projection of the vector of the second side e2 of the first triangle onto the z-axis, ... Let e2 be the vector projection of the second edge e2 of the Nth grid onto the x-axis. Let e2 be the vector projection of the second edge e2 of the Nth grid onto the y-axis. Let e2 be the projection of the vector of the second edge e2 of the Nth grid onto the z-axis.
[0030] In some possible designs, the matrix operation is as follows:
[0031]
[0032] In a second aspect, a rendering system is provided, including a management device, a rendering application server, a rendering application client, and a rendering engine, wherein the rendering application client is deployed on a terminal device, and the management device, the rendering application server, and the rendering engine are deployed on a remote computing node;
[0033] The management device is used to generate a rendering request, wherein the rendering request is used to indicate the direction vectors of M rays and the position information of N grids, and the rendering request is sent to the rendering application server.
[0034] The rendering application server is used to receive the rendering request, call the rendering engine to construct multiple matrices according to the direction vectors of the M rays indicated by the rendering request and the position information of the N grids, perform matrix operations on the multiple matrices to obtain the intersection result of the M rays and the N grids, and generate a rendered image according to the intersection result of the M rays and the N grids.
[0035] The rendering application client is used to receive the rendered image.
[0036] In some possible designs, the mesh is a triangle obtained by segmenting a 3D model of the target scene.
[0037] In some possible designs, the position information of the N grids includes: the vertex coordinates of the N grids, or the vectors of each edge of the N grids.
[0038] In some possible designs, the plurality of matrices includes: matrix D 3M*3 Matrix E2 3*N Matrix E1 N*3 Matrix S 3MN*3 Matrix E1' 3*N and matrix E2' N*3 , wherein, the D 3M*3 E2 is a matrix composed of the direction vectors of the M rays. 3*N E1 is a 3*N matrix composed of the vectors of the second edge e2 of N grids. N*3 S is a matrix of size N*3 composed of the vectors of the first edge e1 of the N grids. 3MN*3 The matrix E1' is composed of the vectors of the starting points of the M rays and the vertices V0 of the N grids; 3*N E2' is a 3*N matrix composed of the vectors of the first edge e1 of the N grids. N*3 It is a matrix of size N*3 composed of the vectors of the second edge e2 of the N grids.
[0039] In some possible designs, the matrix D 3M*3 for:
[0040]
[0041] Where d1 is the direction vector of the first ray, d2 is the direction vector of the second ray, ..., d M Let M be the direction vector of the Mth ray;
[0042] The matrix E2 3*N for:
[0043]
[0044] in, Let e2 be the vector projection of the second edge e2 of the first grid onto the x-axis. Let e2 be the vector projection of the second edge e2 of the first grid onto the y-axis. Let e2 be the vector projection of the second edge e2 of the first grid onto the z-axis, ... Let e2 be the vector projection of the second edge e2 of the Nth grid onto the x-axis. Let e2 be the vector projection of the second edge e2 of the Nth grid onto the y-axis. Let e2 be the vector projection of the second edge e2 of the Nth grid onto the z-axis;
[0045] The matrix E1 N*3 for:
[0046]
[0047] in, Let e1 be the vector projection of the first edge e1 of the first grid onto the x-axis. Let e1 be the vector projection of the first edge e1 of the first grid onto the y-axis. Let e1 be the projection of the vector of the first edge e1 of the first grid onto the z-axis, ... Let e1 be the vector projection of the first edge e1 of the Nth grid onto the x-axis. Let e1 be the vector projection of the second edge e1 of the Nth grid onto the y-axis. Let e1 be the vector projection of the second edge e1 of the Nth grid onto the z-axis.
[0048] The matrix S 3MN*3 for:
[0049]
[0050] Among them, S 11 Let S be the vector from the origin of the first ray and the vertex V0 of the first grid, ..., S 1N S is the vector from the origin of the first ray to the vertex V0 of the Nth grid; 21 Let S be the vector from the origin of the second ray to the vertex V0 of the first grid, ..., S 2N The vector from the origin of the second ray to the vertex V0 of the Nth grid; ...; S M1 Let S be the vector from the origin of the Mth ray to the vertex V0 of the first grid, ..., S MN Let V be the vector connecting the starting point of the Mth ray and the vertex V0 of the Nth grid.
[0051] The matrix E1' 3*N for:
[0052]
[0053] in, Let e1 be the vector projection of the first edge e1 of the first grid onto the x-axis. Let e1 be the vector projection of the first edge e1 of the first grid onto the y-axis. Let e1 be the projection of the vector of the first edge e1 of the first grid onto the z-axis, ... Let e1 be the vector projection of the first edge e1 of the Nth grid onto the x-axis. Let e1 be the vector projection of the first edge e1 of the Nth grid onto the y-axis. Let e1 be the vector of the first edge e1 of the Nth grid, projected onto the z-axis.
[0054] The matrix E2' N*3 for:
[0055]
[0056] in, Let e2 be the vector projection of the second edge of the first triangle's mesh onto the x-axis. Let e2 be the vector projection of the second edge of the first triangle's mesh onto the y-axis. Let e2 be the projection of the vector of the second side e2 of the first triangle onto the z-axis, ... Let e2 be the vector projection of the second edge e2 of the Nth grid onto the x-axis. Let e2 be the vector projection of the second edge e2 of the Nth grid onto the y-axis. Let e2 be the projection of the vector of the second edge e2 of the Nth grid onto the z-axis.
[0057] In some possible designs, the matrix operation is as follows:
[0058]
[0059] Thirdly, a rendering method is provided for use in a rendering system, the rendering system including a rendering application server, a rendering application client, and a rendering engine, wherein the rendering application client is deployed on a terminal device, and the rendering application server and the rendering engine are deployed on a remote computing node.
[0060] The rendering application client generates a rendering request, wherein the rendering request is used to indicate the direction vectors of M rays and the position information of N grids;
[0061] The rendering application server receives the rendering request, calls the rendering engine to construct multiple matrices according to the direction vectors of the M rays indicated by the rendering request and the position information of the N grids, performs matrix operations on the multiple matrices to obtain the intersection result of the M rays and the N grids, and generates a rendered image based on the intersection result of the M rays and the N grids.
[0062] The rendering application client receives the rendered image.
[0063] In some possible designs, the mesh is a triangle obtained by segmenting a 3D model of the target scene.
[0064] In some possible designs, the position information of the N grids includes: the vertex coordinates of the N grids, or the vectors of each edge of the N grids.
[0065] In some possible designs, the plurality of matrices includes: matrix D 3M*3 Matrix E2 3*N Matrix E1 N*3 Matrix S 3MN*3 Matrix E1' 3*N and matrix E2' N*3 , wherein, the D 3M*3 E2 is a matrix composed of the direction vectors of the M rays. 3*N E1 is a 3*N matrix composed of the vectors of the second edge e2 of N grids. N*3 S is a matrix of size N*3 composed of the vectors of the first edge e1 of the N grids. 3MN*3 The matrix E1' is composed of the vectors of the starting points of the M rays and the vertices V0 of the N grids; 3*N E2' is a 3*N matrix composed of the vectors of the first edge e1 of the N grids. N*3 It is a matrix of size N*3 composed of the vectors of the second edge e2 of the N grids.
[0066] In some possible designs, the matrix D 3M*3 for:
[0067]
[0068] Where d1 is the direction vector of the first ray, d2 is the direction vector of the second ray, ..., d M Let M be the direction vector of the Mth ray;
[0069] The matrix E2 3*N for:
[0070]
[0071] in, Let e2 be the vector projection of the second edge e2 of the first grid onto the x-axis. Let e2 be the vector projection of the second edge e2 of the first grid onto the y-axis. Let e2 be the vector projection of the second edge e2 of the first grid onto the z-axis, ... Let e2 be the vector projection of the second edge e2 of the Nth grid onto the x-axis. Let e2 be the vector projection of the second edge e2 of the Nth grid onto the y-axis. Let e2 be the vector projection of the second edge e2 of the Nth grid onto the z-axis;
[0072] The matrix E1 N*3 for:
[0073]
[0074] in, Let e1 be the vector projection of the first edge e1 of the first grid onto the x-axis. Let e1 be the vector projection of the first edge e1 of the first grid onto the y-axis. Let e1 be the projection of the vector of the first edge e1 of the first grid onto the z-axis, ... Let e1 be the vector projection of the first edge e1 of the Nth grid onto the x-axis. Let e1 be the vector projection of the second edge e1 of the Nth grid onto the y-axis. Let e1 be the vector projection of the second edge e1 of the Nth grid onto the z-axis.
[0075] The matrix S 3MN*3 for:
[0076]
[0077] Among them, S 11 Let S be the vector from the origin of the first ray and the vertex V0 of the first grid, ..., S 1N S is the vector from the origin of the first ray to the vertex V0 of the Nth grid; 21 Let S be the vector from the origin of the second ray to the vertex V0 of the first grid, ..., S 2N The vector from the origin of the second ray to the vertex V0 of the Nth grid; ...; S M1 Let S be the vector from the origin of the Mth ray to the vertex V0 of the first grid, ..., S MN Let V be the vector connecting the starting point of the Mth ray and the vertex V0 of the Nth grid.
[0078] The matrix E1' 3*N for:
[0079]
[0080] in, Let e1 be the vector projection of the first edge e1 of the first grid onto the x-axis. Let e1 be the vector projection of the first edge e1 of the first grid onto the y-axis. Let e1 be the projection of the vector of the first edge e1 of the first grid onto the z-axis, ... Let e1 be the vector projection of the first edge e1 of the Nth grid onto the x-axis. Let e1 be the vector projection of the first edge e1 of the Nth grid onto the y-axis. Let e1 be the vector of the first edge e1 of the Nth grid, projected onto the z-axis.
[0081] The matrix E2' N*3 for:
[0082]
[0083] in, Let e2 be the vector projection of the second edge of the first triangle's mesh onto the x-axis. Let e2 be the vector projection of the second edge of the first triangle's mesh onto the y-axis. Let e2 be the projection of the vector of the second side e2 of the first triangle onto the z-axis, ... Let e2 be the vector projection of the second edge e2 of the Nth grid onto the x-axis. Let e2 be the vector projection of the second edge e2 of the Nth grid onto the y-axis. Let e2 be the projection of the vector of the second edge e2 of the Nth grid onto the z-axis.
[0084] In some possible designs, the matrix operation is as follows:
[0085]
[0086] Fourthly, a rendering method is provided for use in a rendering system, the rendering system including a management device, a rendering application server, a rendering application client, and a rendering engine, wherein the rendering application client is deployed on a terminal device, and the management device, the rendering application server, and the rendering engine are deployed on a remote computing node;
[0087] The management device generates a rendering request, wherein the rendering request is used to indicate the direction vectors of M rays and the position information of N grids; and sends the rendering request to the rendering application server;
[0088] The rendering application server receives the rendering request, calls the rendering engine to construct multiple matrices based on the direction vectors of the M rays indicated by the rendering request and the position information of the N grids, performs matrix operations on the multiple matrices to obtain the intersection result of the M rays and the N grids, and generates a rendered image based on the intersection result of the M rays and the N grids.
[0089] The rendering application client receives the rendered image.
[0090] In some possible designs, the mesh is a triangle obtained by segmenting a 3D model of the target scene.
[0091] In some possible designs, the position information of the N grids includes: the vertex coordinates of the N grids, or the vectors of each edge of the N grids.
[0092] In some possible designs, the plurality of matrices includes: matrix D 3M*3 Matrix E2 3*N Matrix E1 N*3 Matrix S 3MN*3 Matrix E1' 3*N and matrix E2' N*3 , wherein, the D 3M*3 E2 is a matrix composed of the direction vectors of the M rays. 3*N E1 is a 3*N matrix composed of the vectors of the second edge e2 of N grids. N*3 S is a matrix of size N*3 composed of the vectors of the first edge e1 of the N grids. 3MN*3 The matrix E1' is composed of the vectors of the starting points of the M rays and the vertices V0 of the N grids; 3*N E2' is a 3*N matrix composed of the vectors of the first edge e1 of the N grids. N*3 It is a matrix of size N*3 composed of the vectors of the second edge e2 of the N grids.
[0093] In some possible designs, the matrix D 3M*3 for:
[0094]
[0095] Where d1 is the direction vector of the first ray, d2 is the direction vector of the second ray, ..., d M Let M be the direction vector of the Mth ray;
[0096] The matrix E2 3*N for:
[0097]
[0098] in, Let e2 be the vector projection of the second edge e2 of the first grid onto the x-axis. Let e2 be the vector projection of the second edge e2 of the first grid onto the y-axis. Let e2 be the vector projection of the second edge e2 of the first grid onto the z-axis, ... Let e2 be the vector projection of the second edge e2 of the Nth grid onto the x-axis. Let e2 be the vector projection of the second edge e2 of the Nth grid onto the y-axis. Let e2 be the vector projection of the second edge e2 of the Nth grid onto the z-axis;
[0099] The matrix E1 N*3 for:
[0100]
[0101] in, Let e1 be the vector projection of the first edge e1 of the first grid onto the x-axis. Let e1 be the vector projection of the first edge e1 of the first grid onto the y-axis. Let e1 be the projection of the vector of the first edge e1 of the first grid onto the z-axis, ... Let e1 be the vector projection of the first edge e1 of the Nth grid onto the x-axis. Let e1 be the vector projection of the second edge e1 of the Nth grid onto the y-axis. Let e1 be the vector projection of the second edge e1 of the Nth grid onto the z-axis.
[0102] The matrix S 3MN*3 for:
[0103]
[0104] Among them, S 11 Let S be the vector from the origin of the first ray and the vertex V0 of the first grid, ..., S 1N S is the vector from the origin of the first ray to the vertex V0 of the Nth grid; 21 Let S be the vector from the origin of the second ray to the vertex V0 of the first grid, ..., S 2N The vector from the origin of the second ray to the vertex V0 of the Nth grid; ...; S M1 Let S be the vector from the origin of the Mth ray to the vertex V0 of the first grid, ..., S MN Let V be the vector connecting the starting point of the Mth ray and the vertex V0 of the Nth grid.
[0105] The matrix E1' 3*N for:
[0106]
[0107] in, Let e1 be the vector projection of the first edge e1 of the first grid onto the x-axis. Let e1 be the vector projection of the first edge e1 of the first grid onto the y-axis. Let e1 be the projection of the vector of the first edge e1 of the first grid onto the z-axis, ... Let e1 be the vector projection of the first edge e1 of the Nth grid onto the x-axis. Let e1 be the vector projection of the first edge e1 of the Nth grid onto the y-axis. Let e1 be the vector of the first edge e1 of the Nth grid, projected onto the z-axis.
[0108] The matrix E2' N*3 for:
[0109]
[0110] in, Let e2 be the vector projection of the second edge of the first triangle's mesh onto the x-axis. Let e2 be the vector projection of the second edge of the first triangle's mesh onto the y-axis. Let e2 be the projection of the vector of the second side e2 of the first triangle onto the z-axis, ... Let e2 be the vector projection of the second edge e2 of the Nth grid onto the x-axis. Let e2 be the vector projection of the second edge e2 of the Nth grid onto the y-axis. Let e2 be the projection of the vector of the second edge e2 of the Nth grid onto the z-axis.
[0111] In some possible designs, the matrix operation is as follows:
[0112]
[0113] Fifthly, a rendering method is provided, which is applied to a rendering application server of a rendering system. The rendering system also includes a rendering application client and a rendering engine. The rendering application client is deployed on a terminal device, and the rendering application server and the rendering engine are deployed on a remote computing node.
[0114] The rendering application server receives a rendering request, wherein the rendering request is used to indicate the direction vectors of M rays and the position information of N grids;
[0115] The rendering application server calls the rendering engine to construct multiple matrices based on the direction vectors of the M rays indicated by the rendering request and the position information of the N grids;
[0116] The rendering application server performs matrix operations on the multiple matrices to obtain the intersection results of the M rays and the N grids;
[0117] The rendering application server generates a rendered image based on the intersection results of the M rays and the N grids.
[0118] In some possible designs, the mesh is a triangle obtained by segmenting a 3D model of the target scene.
[0119] In some possible designs, the position information of the N grids includes: the vertex coordinates of the N grids, or the vectors of each edge of the N grids.
[0120] In some possible designs, the plurality of matrices includes: matrix D 3M*3 Matrix E2 3*N Matrix E1 N*3 Matrix S 3MN*3 Matrix E1' 3*N and matrix E2' N*3 , wherein, the D 3M*3 E2 is a matrix composed of the direction vectors of the M rays. 3*N E1 is a 3*N matrix composed of the vectors of the second edge e2 of N grids. N*3 S is a matrix of size N*3 composed of the vectors of the first edge e1 of the N grids. 3MN*3 The matrix E1' is composed of the vectors of the starting points of the M rays and the vertices V0 of the N grids; 3*N E2' is a 3*N matrix composed of the vectors of the first edge e1 of the N grids. N*3 It is a matrix of size N*3 composed of the vectors of the second edge e2 of the N grids.
[0121] In some possible designs, the matrix D 3M*3 for:
[0122]
[0123] Where d1 is the direction vector of the first ray, d2 is the direction vector of the second ray, ..., d M Let M be the direction vector of the Mth ray;
[0124] The matrix E2 3*N for:
[0125]
[0126] in, Let e2 be the vector projection of the second edge e2 of the first grid onto the x-axis. Let e2 be the vector projection of the second edge e2 of the first grid onto the y-axis. Let e2 be the vector projection of the second edge e2 of the first grid onto the z-axis, ... Let e2 be the vector projection of the second edge e2 of the Nth grid onto the x-axis. Let e2 be the vector projection of the second edge e2 of the Nth grid onto the y-axis. Let e2 be the vector projection of the second edge e2 of the Nth grid onto the z-axis;
[0127] The matrix E1 N*3 for:
[0128]
[0129] in, Let e1 be the vector projection of the first edge e1 of the first grid onto the x-axis. Let e1 be the vector projection of the first edge e1 of the first grid onto the y-axis. Let e1 be the projection of the vector of the first edge e1 of the first grid onto the z-axis, ... Let e1 be the vector projection of the first edge e1 of the Nth grid onto the x-axis. Let e1 be the vector projection of the second edge e1 of the Nth grid onto the y-axis. Let e1 be the vector projection of the second edge e1 of the Nth grid onto the z-axis.
[0130] The matrix S 3MN*3 for:
[0131]
[0132] Among them, S 11 Let S be the vector from the origin of the first ray and the vertex V0 of the first grid, ..., S 1N S is the vector from the origin of the first ray to the vertex V0 of the Nth grid; 21 Let S be the vector from the origin of the second ray to the vertex V0 of the first grid, ..., S 2N The vector from the origin of the second ray to the vertex V0 of the Nth grid; ...; S M1 Let S be the vector from the origin of the Mth ray to the vertex V0 of the first grid, ..., S MN Let V be the vector connecting the starting point of the Mth ray and the vertex V0 of the Nth grid.
[0133] The matrix E1' 3*N for:
[0134]
[0135] in, Let e1 be the vector projection of the first edge e1 of the first grid onto the x-axis. Let e1 be the vector projection of the first edge e1 of the first grid onto the y-axis. Let e1 be the projection of the vector of the first edge e1 of the first grid onto the z-axis, ... Let e1 be the vector projection of the first edge e1 of the Nth grid onto the x-axis. Let e1 be the vector projection of the first edge e1 of the Nth grid onto the y-axis. Let e1 be the vector of the first edge e1 of the Nth grid, projected onto the z-axis.
[0136] The matrix E2' N*3 for:
[0137]
[0138] in, Let e2 be the vector projection of the second edge of the first triangle's mesh onto the x-axis. Let e2 be the vector projection of the second edge of the first triangle's mesh onto the y-axis. Let e2 be the projection of the vector of the second side e2 of the first triangle onto the z-axis, ... Let e2 be the vector projection of the second edge e2 of the Nth grid onto the x-axis. Let e2 be the vector projection of the second edge e2 of the Nth grid onto the y-axis. Let e2 be the projection of the vector of the second edge e2 of the Nth grid onto the z-axis.
[0139] In some possible designs, the matrix operation is as follows:
[0140]
[0141] Sixthly, a rendering application server is provided, the rendering application server including: a communication module and a rendering module.
[0142] The communication module is used to receive rendering requests, wherein the rendering requests are used to indicate the direction vectors of M rays and the position information of N grids;
[0143] The rendering module is used to invoke the rendering engine to construct multiple matrices based on the direction vectors of the M rays indicated by the rendering request and the position information of the N grids; perform matrix operations on the multiple matrices to obtain the intersection results of the M rays and the N grids; and generate a rendered image based on the intersection results of the M rays and the N grids.
[0144] In some possible designs, the mesh is a triangle obtained by segmenting a 3D model of the target scene.
[0145] In some possible designs, the position information of the N grids includes: the vertex coordinates of the N grids, or the vectors of each edge of the N grids.
[0146] In some possible designs, the plurality of matrices includes: matrix D 3M*3 Matrix E2 3*N Matrix E1 N*3 Matrix S 3MN*3 Matrix E1' 3*N and matrix E2' N*3 , wherein, the D 3M*3 E2 is a matrix composed of the direction vectors of the M rays. 3*N E1 is a 3*N matrix composed of the vectors of the second edge e2 of N grids. N*3 S is a matrix of size N*3 composed of the vectors of the first edge e1 of the N grids. 3MN*3 The matrix E1' is composed of the vectors of the starting points of the M rays and the vertices V0 of the N grids; 3*N E2' is a 3*N matrix composed of the vectors of the first edge e1 of the N grids. N*3 It is a matrix of size N*3 composed of the vectors of the second edge e2 of the N grids.
[0147] In some possible designs, the matrix D 3M*3 for:
[0148]
[0149] Where d1 is the direction vector of the first ray, d2 is the direction vector of the second ray, ..., d M Let M be the direction vector of the Mth ray;
[0150] The matrix E2 3*N for:
[0151]
[0152] in, Let e2 be the vector projection of the second edge e2 of the first grid onto the x-axis. Let e2 be the vector projection of the second edge e2 of the first grid onto the y-axis. Let e2 be the vector projection of the second edge e2 of the first grid onto the z-axis, ... Let e2 be the vector projection of the second edge e2 of the Nth grid onto the x-axis. Let e2 be the vector projection of the second edge e2 of the Nth grid onto the y-axis. Let e2 be the vector projection of the second edge e2 of the Nth grid onto the z-axis;
[0153] The matrix E1 N*3 for:
[0154]
[0155] in, Let e1 be the vector projection of the first edge e1 of the first grid onto the x-axis. Let e1 be the vector projection of the first edge e1 of the first grid onto the y-axis. Let e1 be the projection of the vector of the first edge e1 of the first grid onto the z-axis, ... Let e1 be the vector projection of the first edge e1 of the Nth grid onto the x-axis. Let e1 be the vector projection of the second edge e1 of the Nth grid onto the y-axis. Let e1 be the vector projection of the second edge e1 of the Nth grid onto the z-axis.
[0156] The matrix S 3MN*3 for:
[0157]
[0158] Among them, S 11 Let S be the vector from the origin of the first ray and the vertex V0 of the first grid, ..., S 1N S is the vector from the origin of the first ray to the vertex V0 of the Nth grid; 21 Let S be the vector from the origin of the second ray to the vertex V0 of the first grid, ..., S 2N The vector from the origin of the second ray to the vertex V0 of the Nth grid; ...; S M1 Let S be the vector from the origin of the Mth ray to the vertex V0 of the first grid, ..., S MN Let V be the vector connecting the starting point of the Mth ray and the vertex V0 of the Nth grid.
[0159] The matrix E1' 3*N for:
[0160]
[0161] in, Let e1 be the vector projection of the first edge e1 of the first grid onto the x-axis. Let e1 be the vector projection of the first edge e1 of the first grid onto the y-axis. Let e1 be the projection of the vector of the first edge e1 of the first grid onto the z-axis, ... Let e1 be the vector projection of the first edge e1 of the Nth grid onto the x-axis. Let e1 be the vector projection of the first edge e1 of the Nth grid onto the y-axis. Let e1 be the vector of the first edge e1 of the Nth grid, projected onto the z-axis.
[0162] The matrix E2' N*3 for:
[0163]
[0164] in, Let e2 be the vector projection of the second edge of the first triangle's mesh onto the x-axis. Let e2 be the vector projection of the second edge of the first triangle's mesh onto the y-axis. Let e2 be the projection of the vector of the second side e2 of the first triangle onto the z-axis, ... Let e2 be the vector projection of the second edge e2 of the Nth grid onto the x-axis. Let e2 be the vector projection of the second edge e2 of the Nth grid onto the y-axis. Let e2 be the projection of the vector of the second edge e2 of the Nth grid onto the z-axis.
[0165] In some possible designs, the matrix operation is as follows:
[0166]
[0167] A seventh aspect provides a computing node, characterized in that the computing node includes a processor and a memory, the processor executing a program in the memory to perform the method as described in any of the fifth aspects.
[0168] Eighthly, a computer-readable storage medium is provided, characterized in that it includes instructions that, when executed on a computing node, cause the computing node to perform the method as described in any of the fifth aspects.
[0169] In the above scheme, the operation of M rays intersecting with N triangle meshes can be transformed into matrix operations between multiple matrices. This makes the number of steps in the operation of M rays intersecting with N triangle meshes much smaller than the number of M*N steps, which can effectively reduce the time required for ray tracing rendering. Attached Figure Description
[0170] To more clearly illustrate the technical solutions in the embodiments of this application or the background art, the accompanying drawings used in the embodiments of this application or the background art will be described below.
[0171] Figure 1A-Figure 1B These are schematic diagrams of the structures of some rendering systems involved in this application;
[0172] Figures 2A-2B These are schematic diagrams of the structure of some meshes provided in this application;
[0173] Figure 3This is a schematic diagram of ray tracing rendering provided in this application;
[0174] Figure 4 This is a schematic diagram of the intersection of light rays and a mesh provided in this application;
[0175] Figures 5A-5B This is a schematic diagram of the sampling rate of some pixels;
[0176] Figure 6 This is a flowchart of a rendering method provided in this application;
[0177] Figure 7 This is a flowchart of another rendering method provided in this application;
[0178] Figure 8 This is a schematic diagram of the structure of a rendering application server provided in this application. Detailed Implementation
[0179] See Figure 1A , Figure 1A This is a schematic diagram of a rendering system according to this application. The rendering system of this application is used to render a 2D image, i.e., a rendered image, from a 3D model of a target scene using rendering methods. The rendering methods may include rasterization rendering and ray tracing rendering, etc. Figure 1A The provided rendering system may include: multiple terminal devices 110, network devices 120, and a remote rendering platform 130. The remote rendering platform 130 may be deployed on a public cloud. The remote rendering platform 130 and the terminal devices are generally deployed in different data centers or even geographical regions.
[0180] Terminal device 110 can be a device that needs to display rendered images, such as a virtual reality (VR) device for flight training, a computer for virtual games, or a smartphone for virtual shopping malls, etc., without specific limitations. Terminal device can be a high-configuration, high-performance device (e.g., multi-core, high clock speed, large memory, etc.) or a low-configuration, low-performance device (e.g., single-core, low clock speed, small memory, etc.). In a specific embodiment, terminal device 110 runs an operating system and a rendering application client.
[0181] Network device 120 is used to transmit data between terminal device 110 and remote rendering platform 130 via a communication network using any communication mechanism / standard. The communication network can be a wide area network (WAN), local area network (LAN), point-to-point connection, or any combination thereof.
[0182] The remote rendering platform 130 includes multiple rendering nodes, each of which, from bottom to top, comprises rendering hardware, an operating system, a rendering engine, and a rendering application server. The rendering hardware includes computing resources, storage resources, and network resources.
[0183] Computing resources can employ heterogeneous computing architectures, such as a central processing unit (CPU) + graphics processing unit (GPU) architecture, a CPU + AI chip architecture, a CPU + GPU + AI chip architecture, etc., without specific limitations here. Storage resources can include memory, etc. Here, computing resources can be divided into multiple computing units, storage resources can be divided into multiple storage units, and network resources can be divided into multiple network units. Therefore, the remote rendering platform 130 can freely combine resources based on unit resources according to the user's resource requirements, thereby providing resources to the user's needs. For example, through virtualization services, independent resources can be flexibly isolated according to the user's needs to run the rendering engine and / or rendering application server. Commonly, virtualization services can isolate independent computing resources such as virtual machine (VM) services, bare metal server (BMS) services, and containers. The rendering engine can be used to implement image rendering algorithms. The rendering engine allows rendering applications to call the rendering engine's built-in rendering algorithms (pipelines) according to its interface to complete image rendering. The rendering application server can be used to call the rendering engine to complete the rendering of the image.
[0184] The rendering application client running on terminal device 110 and the rendering application server running on remote rendering platform 130 constitute the front-end and back-end of the rendering application, respectively. Common rendering applications can include: game applications, VR applications, movie special effects, and animations, etc. The rendering application can obtain rendered images by calling the rendering engine to perform real-time image rendering.
[0185] In one specific implementation, the rendering application server and rendering application client can be provided by a rendering application provider, while the rendering engine can be provided by a cloud service provider. For example, the rendering application can be a game application. The game developer installs the game application server on a remote rendering platform provided by the cloud service provider, and the game developer provides the game application client to users for download via the internet and installs it on the user's terminal device. Furthermore, the cloud service provider also provides a rendering engine, which provides computing power for the game application. In another specific implementation, the rendering application client, rendering application server, and rendering engine can all be provided by a cloud service provider.
[0186] exist Figure 1B The cloud rendering system shown also includes a management device 140. The management device 140 can be a third-party device other than the user's terminal device and the cloud service provider's remote rendering platform 130, or it can be deployed together with the remote rendering platform 130 on a public cloud. For example, the management device 140 can be provided by a rendering application provider. The rendering application provider can manage the rendering application through the management device 140; for example, the rendering application provider can specify the quality parameters of the initial rendered image provided by the rendering application server to the rendering application client through the management device 140.
[0187] Ray tracing rendering is a rendering method that produces an image by tracing the path of light rays emitted from the camera's (or the viewpoint of the human eye) point towards each pixel of the rendered image. The core idea of ray tracing rendering is to trace the propagation of light rays in reverse from the camera's (or the viewpoint of the human eye) through the target scene. Since only the rays that ultimately reach the camera (or the human eye) are useful, tracing rays in reverse effectively reduces the amount of data.
[0188] The target scene typically includes a light source and a 3D model, where the light emitted by the light source illuminates the 3D model. The light source can be a natural light source, a point light source, a line light source, or a surface light source, etc. The 3D model can be a sphere, cuboid, cube, cone, or even an irregular object.
[0189] A mesh is a polygon obtained by dividing the surface of a 3D model in a target scene; that is, a mesh is a partial region of the surface of the 3D model in the target scene. The mesh shape can be different for 3D models with different shapes; for example, the mesh shape of a sphere and the mesh shape of a curved object can be completely different. Each mesh can have a unique mesh identifier. The following will describe meshes with specific examples.
[0190] like Figure 2A As shown, taking a 3D model as a sphere as an example, the mesh can be represented as the center point. and center point The neighborhood points form a slightly bulging cube on the surface of a sphere. A three-dimensional orthogonal coordinate system is constructed with the center of the sphere as the origin, including the x-axis, y-axis, and z-axis. In the coordinates of the center point P, r represents the length of the line segment OP from the center O to the center point P, and θ represents the angle between the line segment OP and the positive z-axis. This is represented as the angle between the projection of line segment OP onto the xoy plane and the x-axis. In a specific embodiment, n center points P1, P2, ..., P can be uniformly set on the sphere. nIf the non-center point Q j With center point P i If the distance is shortest, then the non-center point Q is the closest. j With center point P i They belong to the same grid.
[0191] like Figure 2B As shown, taking a 3D model as a curved surface object as an example, the mesh can be represented as triangles on the surface represented by P(u,t). A two-dimensional orthogonal coordinate system is constructed with a defined origin on the surface, where the coordinate system includes the u-axis and the t-axis. u represents the offset in one direction from the defined origin on the surface, t represents the offset in another orthogonal direction, and P(u,t) represents... Figure 2B The triangle formed by the three vertices in the (u,t) coordinate system shown.
[0192] It is understood that the grid shape described above is merely an example. In practical applications, the grid may have other shapes, such as hexagons, etc., which are not specifically limited here. Furthermore, the grid size can be set as needed. Higher precision requirements allow for smaller grid sizes, and lower precision requirements allow for larger grid sizes. For ease of understanding, the following explanation will use a triangular grid as an example.
[0193] The following sections will provide a detailed explanation of how light propagates in the target scene during the ray tracing rendering process, using specific examples.
[0194] like Figure 3 As shown, assume the target scene has only one light source 311 and one opaque sphere 312. A ray of light is emitted from viewpoint E of camera 313, projected onto pixel O1 of rendered image 314, and then continues to point P1 on a grid of opaque sphere 312. It is then reflected back to light source L. At this point, the light intensity and color of the grid containing point P1 determine the light intensity and color of pixel O1. Another ray of light is emitted from viewpoint E of camera 311, projected onto another pixel O2 in rendered image 314, and then continues to point P2 on a grid of opaque sphere 312. It is then reflected back to light source L. An opaque sphere 312 exists between point P2 and light source L. At this point, point P2 is in the shadow of opaque sphere 312, and the light intensity of pixel O2 is zero, with a black color.
[0195] From above Figure 3 As can be seen from the ray tracing rendering process shown, finding the intersection of rays and mesh is the most basic operation.
[0196] The intersection of a ray and a mesh can be calculated using the following formula (1):
[0197]
[0198] Among them, such as Figure 4 As shown, t is the distance between the starting point O of the ray and the intersection point P of the ray and the grid, S is the vector from the starting point O of the ray to the vertex V0 of the grid, e1 is the vector from vertex V1 of the grid to vertex V0 of the grid, and e2 is the vector from vertex V2 of the grid to vertex V0 of the grid.
[0199] As can be seen from the above statement, in ray tracing rendering, the variables affecting the number of intersections between rays and the mesh include: the number of pixels in the rendered image and the sampling rate per pixel. The number of pixels in the rendered image depends on the number of pixels in the width and height of the rendered image. Assuming the width of the rendered image is `width` pixels and the height is `height` pixels, then the number of pixels in the rendered image is `width * height`. The sampling rate per pixel is defined as the number of rays sampled per pixel. Figure 5A For example, if each pixel samples one ray of light, then the sampling rate for each pixel is 1. Figure 5B Taking the example shown, each pixel samples 9 rays, so the sampling rate for each pixel is 9. Here, the more pixels in the rendered image, the more intersections are performed between the rays and the mesh; the higher the sampling rate per pixel, the more intersections are performed between the rays and the mesh. Assuming the rendered image 114 has a width of `width` pixels and a height of `height` pixels, with a sampling rate of `SPP` per pixel, and N meshes in the scene, then during ray tracing rendering, the number of rays M = `width * height * SPP`, requiring at least M * N intersections between the rays and the mesh. Here, M can be in the millions or even tens of millions, and N can also be in the millions or even tens of millions. The cloud platform can calculate the intersections of M rays and N meshes in the following order:
[0200] The intersection of the first ray and the first grid is calculated using formula (1), the intersection of the second ray and the first grid is calculated using formula (1), ..., the intersection of the Mth ray and the first grid is calculated using formula (1);
[0201] The intersection of the first ray and the second grid is calculated using formula (1), the intersection of the second ray and the second grid is calculated using formula (1), ..., the intersection of the Mth ray and the second grid is calculated using formula (1);
[0202] …;
[0203] The intersection of the first ray and the Nth grid is calculated using formula (1), the intersection of the second ray and the Nth grid is calculated using formula (1), ..., the intersection of the Mth ray and the Nth grid is calculated using formula (1).
[0204] Therefore, when using the above method to find the intersection of M rays with N grids, it takes a relatively long time.
[0205] To address the aforementioned problems, this application proposes a method, apparatus, and system for intersection operations, which can perform intersection operations in batches, thereby effectively reducing the computation time required.
[0206] The following will combine Figure 4 This section explains how to transform the M*N intersection operations performed using formula (1) on M rays and N grids into a matrix operation using formula (2), aiming to calculate the intersection results of as many rays and grids as possible in one operation. Here, M and N are both positive integers, and 1 < M, 1 < N.
[0207]
[0208] Wherein, the D 3M*3 E2 is a matrix composed of the direction vectors of the M rays. 3*N E1 is a 3*N matrix composed of the vectors of the second edge e2 of N grids. N*3 S is a matrix of size N*3 composed of the vectors of the first edge e1 of the N grids. 3MN*3 The matrix E1' is composed of the vectors of the starting points of the M rays and the vertices V0 of the N grids; 3*N E2' is a 3*N matrix composed of the vectors of the first edge e1 of the N grids. N*3 It is a matrix of size N*3 composed of the vectors of the second edge e2 of the N grids.
[0209] For the denominator:
[0210] First, construct a matrix D consisting of the direction vectors of M rays. 3M*3 Among them, D 3M*3 It can be:
[0211]
[0212] Where d1 is the direction vector of the first ray, d2 is the direction vector of the second ray, ..., d M Let be the direction vector of the Mth ray. Where d is the direction vector of the i-th ray. i This can be expressed as 1≤i≤M:
[0213]
[0214] Where, x i Let y be the projection of the i-th ray onto the x-axis. i Let z be the projection of the i-th ray onto the y-axis. i Let be the projection of the i-th ray onto the z-axis.
[0215] Then, construct a 3*N matrix E2 composed of the vectors of the second edge e2 of the N grids. 3*N Among them, E2 3*N It can be:
[0216]
[0217] in, Let e2 be the vector projection of the second edge e2 of the first grid onto the x-axis. Let e2 be the vector projection of the second edge e2 of the first grid onto the y-axis. Let e2 be the vector projection of the second edge e2 of the first grid onto the z-axis, ... Let e2 be the vector projection of the second edge e2 of the Nth grid onto the x-axis. Let e2 be the vector projection of the second edge e2 of the Nth grid onto the y-axis. Let e2 be the projection of the vector of the second edge e2 of the Nth grid onto the z-axis.
[0218] Finally, construct a matrix E1 of size N*3 composed of the vectors of the first edge e1 of the N grids. N*3 Among them, E1 N*3 It could be:
[0219]
[0220] in, Let e1 be the vector projection of the first edge e1 of the first grid onto the x-axis. Let e1 be the vector projection of the first edge e1 of the first grid onto the y-axis. Let e1 be the projection of the vector of the first edge e1 of the first grid onto the z-axis, ... Let e1 be the vector projection of the first edge e1 of the Nth grid onto the x-axis. Let e1 be the vector projection of the second edge e1 of the Nth grid onto the y-axis. Let e1 be the vector of the second edge e1 of the Nth grid, projected onto the z-axis.
[0221] For molecules:
[0222] First, construct a matrix S consisting of the vectors of the starting points O of the M rays and the vertices V0 of the N grids. 3MN*3 Among them, S 3MN*3 It can be:
[0223]
[0224] Among them, S 11 Let S be the vector from the origin O of the first ray and the vertex V0 of the first grid, ..., S 1N S is the vector from the origin O of the first ray to the vertex V0 of the Nth grid; 21 Let S be the vector from the starting point O of the second ray and the vertex V0 of the first grid. 2N The vectors of the starting point O of the second ray and the vertex V0 of the Nth grid; ...; S M1 Let S be the vector from the starting point O of the Mth ray and the vertex V0 of the first grid, ..., S MN Let S be the vector between the starting point O of the Mth ray and the vertex V0 of the Nth grid. The vector between the starting point O of the i-th ray and the vertex V0 of the j-th grid can be represented as S. ij , 1≤i≤M, 1≤j≤N:
[0225]
[0226] Where, x ij Let y be the projection of the vector from the origin O of the i-th ray and the vertex V0 of the j-th grid onto the x-axis. ij Let z be the projection of the vector from the origin O of the i-th ray and the vertex V0 of the j-th grid onto the y-axis. ij Let V be the projection of the vector of the origin O of the i-th ray and the vertex V0 of the j-th grid onto the z-axis.
[0227] Then, construct a 3*N matrix E1' composed of the vectors of the second edge e1 of the N grids. 3*N Among them, E1' 3*N It can be:
[0228]
[0229] in, Let e1 be the vector projection of the first edge e1 of the first grid onto the x-axis. Let e1 be the vector projection of the first edge e1 of the first grid onto the y-axis. Let e1 be the projection of the vector of the first edge e1 of the first grid onto the z-axis, ... Let e1 be the vector projection of the first edge e1 of the Nth grid onto the x-axis. Let e1 be the vector projection of the first edge e1 of the Nth grid onto the y-axis. Let e1 be the projection of the vector of the first edge e1 of the Nth grid onto the z-axis.
[0230] Finally, construct a matrix E2' of size N*3, consisting of the vectors of the second edge e2 of the N grids. N*3 Among them, E2' N*3 It could be:
[0231]
[0232] in, Let e2 be the vector projection of the second edge of the first triangle's mesh onto the x-axis. Let e2 be the vector projection of the second edge of the first triangle's mesh onto the y-axis. Let e2 be the projection of the vector of the second side e2 of the first triangle onto the z-axis, ... Let e2 be the vector projection of the second edge e2 of the Nth grid onto the x-axis. Let e2 be the vector projection of the second edge e2 of the Nth grid onto the y-axis. Let e2 be the projection of the vector of the second edge e2 of the Nth grid onto the z-axis.
[0233] It is understandable that S in the above example 3MN*3 The explanation assumes that all M light rays originate from point O. However, in practical applications, the origins of the M light rays can be different. For example, the origin of the light ray can be point O or other points in the scene. No specific restrictions are made here.
[0234] matrix D 3M*3 Sum matrix E2 3*N Multiply to obtain matrix R 3M*N Among them, matrix R 3M*N It can be represented as:
[0235]
[0236] Due to matrix R 3M*N Each three rows in the matrix represent the d×e² value of a ray interacting with the grid of all triangles. Therefore, matrix R can be... 3M*N Separate into M 3*N submatrices SR1, SR2, ..., SR M Among them, SR1, SR2, ..., SR M They can be represented as follows:
[0237]
[0238] Submatrices SR1, SR2, ..., SR M and E1 respectively N*3Perform multiplication. Using the i-th submatrix SR... i For example, when conducting SR i and E1 N*3 During the operation, only the matrix SR needs to be calculated. i The j-th row sum matrix E1 N*3 We only need to calculate the j-th column, which means we only need to calculate the matrix SR. i* E1 N*3 The values on the diagonal are sufficient, where 1 ≤ i ≤ M and 1 ≤ j ≤ N. Thus, for each SR... i Each can obtain N values, and the final results form an M*N matrix R1. M*N .
[0239] matrix S 3MN*3 Sum matrix E1' 3*N Multiply to obtain matrix T 3MN*N Among them, matrix T 3MN*N It can be represented as:
[0240]
[0241] For T 3MN*N For example, each three rows represent the result of a ray passing through a grid of all triangles, S×e1. Since S and e1 are only meaningful if they originate from the same triangle, therefore T 3MN*N It can be divided into M submatrices ST 3N*N Each matrix represents the S×e1 value of a ray and all triangles; therefore, matrix T can be used to... 3MN*N Separate into M 3N*N submatrices ST1, ST2, ..., ST in sequence. M Among them, ST1, ST2, ..., ST M They can be represented as follows:
[0242]
[0243]
[0244] Submatrices ST1, ST2, ..., ST M and E2' respectively N*3 Perform multiplication. For ST i Since only the values on the three middle diagonals are meaningful, we can keep only ST. i The values on the three diagonals are then reassembled into a (NT) i ) 3*N Then, M submatrices ST1, ST2, ..., ST M It can be reassembled into M submatrices (NT1). 3*N (NT2) 3*N, ..., (NT) M ) 3*N . M submatrices (NT1) 3*N (NT2) 3*N , ..., (NT) M ) 3*N Composed of N 3M*N Then, N 3M*N and R 3M*N Having the same meaning, therefore it can be adopted with R. 3M*N and E1 N*3 A method similar to multiplication is used to transform matrix N 3M*N and E2' N*3 Multiplying them together yields an M*N matrix R2. M*N .
[0245] Using R1 M*N and R2 M*N The matrix R3 is used to obtain the final result matrix of the intersection of the ray and the triangle. Specifically, in the MT algorithm, if the denominator is less than or equal to 0, it indicates that the ray and the triangle do not intersect, and the corresponding position in the result matrix can be directly set to the default maximum value. Therefore, the values in the i-th row and j-th column of R3 can be represented as follows:
[0246]
[0247] The above calculation process can be performed in the following order to effectively reduce the calculation time.
[0248] First step, calculate R 3M*N =D 3M*3 *E2 3*N .
[0249] The second step is to split matrix R. 3M*N For M submatrices SM i , 1≤i≤M.
[0250] The third step is to calculate the SM of each submatrix. i and E1 N*3 And retain the diagonal, to obtain matrix R1. M*N .
[0251] Fourth step, calculate T 3MN*N =S 3MN*3 *E1' 3*N .
[0252] Step 5: Split matrix T 3MN*3 For M submatrices ST i , 1≤i≤M.
[0253] Step 6, transform the M submatrix ST iRetain its three diagonals to form M submatrices (NT). i ) 3*N And will recombine to generate N 3M*N .
[0254] Step 7: Split matrix N 3M*N For M submatrices SN i , 1≤i≤M.
[0255] Step 8: Calculate SN for each submatrix i and E2' N*3 And retain the diagonal, to obtain matrix R2. M*N .
[0256] Step 9: Calculate the matrix of intersections between M rays and the N triangular meshes.
[0257] The above calculation process only requires 9 steps to determine the intersection of M light rays with N triangular meshes, significantly reducing time compared to the existing technology which requires M*N steps. It is understandable that the above steps can be improved; for example, steps one and four can be performed simultaneously, as can steps two and five, further reducing the time required.
[0258] See Figure 6 , Figure 6 This is a flowchart illustrating the rendering method provided in this application. For example... Figure 6 As shown, the rendering method of this application is able to Figure 1A The rendering system shown includes the following steps:
[0259] S101: The rendering application client on the terminal device generates a rendering request, wherein the rendering request is used to indicate the direction vectors of M rays and the position information of N grids.
[0260] Throughout the various embodiments of this application, a rendering request can refer to either a network packet transmitted on a network device or a program instruction used within a rendering application client.
[0261] In a specific embodiment of this application, the rendering request may carry the identifier of the target scene and the angle from which the user observes the target scene. In this way, the remote rendering platform can generate the direction vectors of M rays and the position information of N grids based on the identifier of the target scene and the angle from which the user observes the target scene.
[0262] In a specific embodiment of this application, the rendering request may carry the direction vectors of M rays and the position information of N grids. In this case, the direction vectors of the M rays and the position information of the N grids can be calculated by the rendering application client on the terminal device based on the identifier of the target scene and the angle from which the user observes the target scene.
[0263] S102: The rendering application client on the terminal device sends a rendering request to the network device. Correspondingly, the network device receives the rendering request sent by the rendering application client on the terminal device.
[0264] S103: The network device sends a rendering request to the remote rendering platform. Correspondingly, the remote rendering platform receives the rendering request sent by the network device.
[0265] S104: The remote rendering platform calls the rendering engine to construct multiple matrices based on the direction vectors of the M rays indicated by the rendering request and the position information of the N grids.
[0266] S105: The remote rendering platform performs matrix operations on the multiple matrices to obtain the intersection results of the M rays and the N meshes.
[0267] In a specific embodiment of this application, the multiple matrices constructed by the remote rendering platform may include matrix D. 3M*3 Matrix E2 3*N Matrix E1 N*3 Matrix S 3MN*3 Matrix E1' 3*N Matrix E2' N*3 For the definitions of each matrix, please refer to the above description; they will not be elaborated upon here.
[0268] In specific embodiments of this application, matrix operations can be:
[0269]
[0270] It should be understood that the above matrix is merely a specific example. In other embodiments, the matrix can be other matrices, such as performing row transformations, column transformations, or transposing the above matrix. Of course, when the matrix changes, the matrix operations will also change accordingly.
[0271] S106: The remote rendering platform generates a rendered image based on the intersection results of the M rays and the N grids.
[0272] S107: The remote rendering platform sends the rendered image to the network device. Correspondingly, the network device receives the rendered image sent by the remote rendering platform.
[0273] S108: The network device sends a rendered image to the terminal device. Correspondingly, the terminal device receives the rendered image sent by the network device.
[0274] For the sake of simplicity, Figure 6 The rendering method shown does not provide a detailed explanation of how to construct multiple matrices or the matrix operation process. Please refer to the above description for details, which will not be elaborated here.
[0275] See Figure 7 , Figure 7 This is a flowchart illustrating another rendering method provided in this application. For example... Figure 7 As shown, the rendering method of this application is able to Figure 1B The rendering system shown includes the following steps:
[0276] S201: The management device generates a rendering request, wherein the rendering request is used to indicate the direction vectors of M rays and the position information of N grids.
[0277] S202: The management device sends a rendering request to the network device. Correspondingly, the network device receives the rendering request sent by the management device.
[0278] S203: The network device sends a rendering request to the remote rendering platform. Correspondingly, the remote rendering platform receives the rendering request sent by the network device.
[0279] S204: The remote rendering platform calls the rendering engine to construct multiple matrices based on the direction vectors of the M rays indicated by the rendering request and the position information of the N grids.
[0280] S205: The remote rendering platform performs matrix operations on the multiple matrices to obtain the intersection results of the M rays and the N meshes.
[0281] S206: The remote rendering platform generates a rendered image based on the intersection results of the M rays and the N grids.
[0282] S207: The remote rendering platform sends a rendered image to the network device. Correspondingly, the network device receives the rendered image sent by the remote rendering platform.
[0283] S208: The network device sends a rendered image to the terminal device. Correspondingly, the terminal device receives the rendered image sent by the network device.
[0284] For the sake of simplicity, Figure 7 The rendering method shown does not provide a detailed explanation of how to construct multiple matrices or the matrix operation process. Please refer to the above description for details, which will not be elaborated here.
[0285] See Figure 8 , Figure 8 This is a schematic diagram of the structure of a rendering application server provided in this application. The rendering application server in this embodiment includes: a communication module 410 and a rendering module 420.
[0286] The communication module 410 is used to receive a rendering request, wherein the rendering request is used to indicate the direction vectors of M rays and the position information of N grids.
[0287] The rendering module 420 is used to invoke the rendering engine to construct multiple matrices according to the direction vectors of the M rays indicated by the rendering request and the position information of the N grids; perform matrix operations on the multiple matrices to obtain the intersection result of the M rays and the N grids; and generate a rendered image based on the intersection result of the M rays and the N grids.
[0288] For the sake of simplicity, Figure 8 The rendering application server shown does not provide a detailed description of the construction methods of multiple matrices or the matrix operation process. Please refer to the above description for details, which will not be elaborated here.
[0289] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, storage disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
Claims
1. A rendering system, characterized in that, It includes a rendering application server, a rendering application client, and a rendering engine. The rendering application client is deployed on a terminal device, and the rendering application server and the rendering engine are deployed on a remote computing node. The rendering application server is used to receive rendering requests, wherein the rendering requests are used to indicate the direction vectors of M rays and the position information of N grids. Based on the direction vectors of the M rays and the position information of the N grids, the rendering engine is invoked to construct multiple matrices, matrix operations are performed on the multiple matrices to obtain the intersection result of the M rays and the N grids, and a rendered image is generated based on the intersection result of the M rays and the N grids. The rendering application client is used to generate the rendering request and receive the rendered image. Perform matrix operations on the multiple matrices to obtain the intersection results of the M rays and the N grids, including: The matrix formed by multiplying the vectors of the starting points of the M rays and the vertices V0 of the N grids by the vectors of the first edge e1 of the N grids results in a value of 3. The size of the matrix N multiplied by the vector of the second edge e2 of the N grids is N. The first product is obtained from a matrix of 3; The matrix formed by multiplying the direction vectors of the M rays by the vectors formed by the second edge e2 of the N grids has a size of 3. The size of the matrix N multiplied by the vector of the first edge e1 of the N grids is N. The matrix of 3 yields the second product; The intersection result is obtained by dividing the first product by the second product.
2. The system according to claim 1, characterized in that, The mesh is a triangle obtained by segmenting the three-dimensional model of the target scene.
3. The system according to claim 1 or 2, characterized in that, The position information of the N grids includes: the vertex coordinates of the N grids, or the vectors of each edge of the N grids.
4. The system according to claim 3, characterized in that, The plurality of matrices includes: matrix ,matrix ,matrix ,matrix ,matrix and matrix , wherein The matrix is composed of the direction vectors of the M rays. The size of the vector formed by the second edge e2 of N grids is 3 A matrix of N, the matrix The size of the vector group formed by the first edge e1 of the N grids is N A matrix of 3, the matrix The matrix is composed of the vectors of the starting points of the M rays and the vertices V0 of the N grids; the matrix The size of the vector composition of the first edge e1 of the N grids is 3 The matrix of N, the The size of the vector composition of the second edge e2 of the N grids is N A matrix of size 3.
5. The system according to claim 4, characterized in that, The matrix for: in, Let be the direction vector of the first ray. Let be the direction vector of the second ray, ... Let M be the direction vector of the Mth ray; The matrix for: in, Let e2 be the vector projection of the second edge e2 of the first grid onto the x-axis. Let e2 be the vector projection of the second edge e2 of the first grid onto the y-axis. Let e2 be the vector projection of the second edge e2 of the first grid onto the z-axis, ... Let e2 be the vector projection of the second edge e2 of the Nth grid onto the x-axis. Let e2 be the vector projection of the second edge e2 of the Nth grid onto the y-axis. Let e2 be the vector projection of the second edge e2 of the Nth grid onto the z-axis; The matrix for: in, Let e1 be the vector projection of the first edge e1 of the first grid onto the x-axis. Let e1 be the vector projection of the first edge e1 of the first grid onto the y-axis. Let e1 be the projection of the vector of the first edge e1 of the first grid onto the z-axis, ... Let e1 be the vector projection of the first edge e1 of the Nth grid onto the x-axis. Let e1 be the vector projection of the second edge e1 of the Nth grid onto the y-axis. Let e1 be the vector projection of the second edge e1 of the Nth grid onto the z-axis. The matrix for: in, Let V be the vector of the origin of the first ray and the vertex V0 of the first grid, ... The vector connecting the origin of the first ray and the vertex V0 of the Nth grid. Let V be the vector from the origin of the second ray to the vertex V0 of the first grid, ... The vector from the origin of the second ray to the vertex V0 of the Nth grid; ...; Let V be the vector connecting the origin of the Mth ray and the vertex V0 of the first grid, ... Let V be the vector connecting the starting point of the Mth ray and the vertex V0 of the Nth grid. The matrix for: in, Let e1 be the vector projection of the first edge e1 of the first grid onto the x-axis. Let e1 be the vector projection of the first edge e1 of the first grid onto the y-axis. Let e1 be the projection of the vector of the first edge e1 of the first grid onto the z-axis, ... Let e1 be the vector projection of the first edge e1 of the Nth grid onto the x-axis. Let e1 be the vector projection of the first edge e1 of the Nth grid onto the y-axis. Let e1 be the vector of the first edge e1 of the Nth grid, projected onto the z-axis. The matrix for: in, Let e2 be the vector projection of the second edge of the first triangle's mesh onto the x-axis. Let e2 be the vector projection of the second edge of the first triangle's mesh onto the y-axis. Let e2 be the projection of the vector of the second side e2 of the first triangle onto the z-axis, ... Let e2 be the vector projection of the second edge e2 of the Nth grid onto the x-axis. Let e2 be the vector projection of the second edge e2 of the Nth grid onto the y-axis. Let e2 be the projection of the vector of the second edge e2 of the Nth grid onto the z-axis.
6. A rendering system, characterized in that, It includes a management device, a rendering application server, a rendering application client, and a rendering engine. The rendering application client is deployed on a terminal device, while the management device, the rendering application server, and the rendering engine are deployed on a remote computing node. The management device is used to generate a rendering request, wherein the rendering request is used to indicate the direction vectors of M rays and the position information of N grids, and the rendering request is sent to the rendering application server. The rendering application server is used to receive the rendering request, call the rendering engine to construct multiple matrices according to the direction vectors of the M rays indicated by the rendering request and the position information of the N grids, perform matrix operations on the multiple matrices to obtain the intersection result of the M rays and the N grids, and generate a rendered image according to the intersection result of the M rays and the N grids. The rendering application client is used to receive the rendered image; The rendering application server is used to multiply the matrix composed of the vectors of the starting points of the M rays and the vertices V0 of the N grids by the vector of the first edge e1 of the N grids, which has a size of 3. The size of the matrix N multiplied by the vector of the second edge e2 of the N grids is N. The first product is obtained from a matrix of 3; The matrix formed by multiplying the direction vectors of the M rays by the vectors formed by the second edge e2 of the N grids has a size of 3. The size of the matrix N multiplied by the vector of the first edge e1 of the N grids is N. The matrix of 3 yields the second product; The intersection result is obtained by dividing the first product by the second product.
7. A rendering method, characterized in that, The rendering system is applied to a rendering system, which includes a rendering application server, a rendering application client, and a rendering engine. The rendering application client is deployed on a terminal device, and the rendering application server and the rendering engine are deployed on a remote computing node. The rendering application client generates a rendering request, wherein the rendering request is used to indicate the direction vectors of M rays and the position information of N grids; The rendering application server receives the rendering request, calls the rendering engine to construct multiple matrices according to the direction vectors of the M rays indicated by the rendering request and the position information of the N grids, performs matrix operations on the multiple matrices to obtain the intersection result of the M rays and the N grids, and generates a rendered image based on the intersection result of the M rays and the N grids. The rendering application client receives the rendered image; The rendering application server multiplies the matrix composed of the starting points of the M rays and the vectors of the vertices V0 of the N grids by the vectors of the first edge e1 of the N grids, resulting in a value of 3. The size of the matrix N multiplied by the vector of the second edge e2 of the N grids is N. The first product is obtained by multiplying the matrix of 3 by the matrix composed of the direction vectors of the M rays by the vector of the second edge e2 of the N grids, which has a size of 3. The size of the matrix N multiplied by the vector of the first edge e1 of the N grids is N. The matrix of 3 is used to obtain the second product; the first product is divided by the second product to obtain the intersection result.
8. A rendering method, characterized in that, The system is applied to a rendering system, which includes a management device, a rendering application server, a rendering application client, and a rendering engine. The rendering application client is deployed on a terminal device, and the management device, the rendering application server, and the rendering engine are deployed on a remote computing node. The management device generates a rendering request, wherein the rendering request is used to indicate the direction vectors of M rays and the position information of N grids; and sends the rendering request to the rendering application server; The rendering application server receives the rendering request, calls the rendering engine to construct multiple matrices based on the direction vectors of the M rays indicated by the rendering request and the position information of the N grids, performs matrix operations on the multiple matrices to obtain the intersection result of the M rays and the N grids, and generates a rendered image based on the intersection result of the M rays and the N grids. The rendering application client receives the rendered image; The rendering application server multiplies the matrix composed of the starting points of the M rays and the vectors of the vertices V0 of the N grids by the vectors of the first edge e1 of the N grids, resulting in a value of 3. The size of the matrix N multiplied by the vector of the second edge e2 of the N grids is N. The first product is obtained by multiplying the matrix of 3 by the matrix composed of the direction vectors of the M rays by the vector of the second edge e2 of the N grids, which has a size of 3. The size of the matrix N multiplied by the vector of the first edge e1 of the N grids is N. The matrix of 3 is used to obtain the second product; the first product is divided by the second product to obtain the intersection result.
9. A rendering method, characterized in that, The rendering system includes a rendering application server and a rendering application client. The rendering system also includes a rendering application client and a rendering engine. The rendering application client is deployed on a terminal device, and the rendering application server and the rendering engine are deployed on a remote computing node. The rendering application server receives a rendering request, wherein the rendering request is used to indicate the direction vectors of M rays and the position information of N grids; The rendering application server calls the rendering engine to construct multiple matrices based on the direction vectors of the M rays indicated by the rendering request and the position information of the N grids; The rendering application server performs matrix operations on the multiple matrices to obtain the intersection results of the M rays and the N meshes; The rendering application server generates a rendered image based on the intersection results of the M rays and the N grids; The rendering application server multiplies the matrix composed of the starting points of the M rays and the vectors of the vertices V0 of the N grids by the vectors of the first edge e1 of the N grids, resulting in a value of 3. The size of the matrix N multiplied by the vector of the second edge e2 of the N grids is N. The first product is obtained by multiplying the matrix of 3 by the matrix composed of the direction vectors of the M rays by the vector of the second edge e2 of the N grids, which has a size of 3. The size of the matrix N multiplied by the vector of the first edge e1 of the N grids is N. The matrix of 3 is used to obtain the second product; the first product is divided by the second product to obtain the intersection result.
10. A rendering application server, characterized in that, The rendering application server includes a communication module and a rendering module. The communication module is used to receive rendering requests, wherein the rendering requests are used to indicate the direction vectors of M rays and the position information of N grids; The rendering module is used to invoke the rendering engine to construct multiple matrices based on the direction vectors of the M rays indicated by the rendering request and the position information of the N grids; perform matrix operations on the multiple matrices to obtain the intersection result of the M rays and the N grids; and generate a rendered image based on the intersection result of the M rays and the N grids. The rendering module is used to multiply the matrix composed of the vectors of the starting points of the M rays and the vertices V0 of the N grids by the vector of the first edge e1 of the N grids, which has a size of 3. The size of the matrix N multiplied by the vector of the second edge e2 of the N grids is N. The first product is obtained by multiplying the matrix of 3 by the matrix composed of the direction vectors of the M rays by the vector of the second edge e2 of the N grids, which has a size of 3. The size of the matrix N multiplied by the vector of the first edge e1 of the N grids is N. The matrix of 3 is used to obtain the second product; the first product is divided by the second product to obtain the intersection result.
11. A computing node, characterized in that, The computing node includes a processor and a memory, the processor executing a program in the memory to perform the method as described in claim 9.
12. A computer-readable storage medium, characterized in that, Includes instructions that, when executed on a computing node, cause the computing node to perform the method as described in claim 9.
Citation Information
Patent Citations
Method and system for rendering mobile computer graphic
KR1020100075351A
Method and an apparatus for encoding a signal transporting data for reconstructing a sparse matrix
US20180165251A1
