WO2022105641A1 - Rendering method, device and system - Google Patents

Rendering method, device and system Download PDF

Info

Publication number
WO2022105641A1
WO2022105641A1 PCT/CN2021/129464 CN2021129464W WO2022105641A1 WO 2022105641 A1 WO2022105641 A1 WO 2022105641A1 CN 2021129464 W CN2021129464 W CN 2021129464W WO 2022105641 A1 WO2022105641 A1 WO 2022105641A1
Authority
WO
WIPO (PCT)
Prior art keywords
rendering
viewing angle
grid
rendering application
valid
Prior art date
Application number
PCT/CN2021/129464
Other languages
French (fr)
Chinese (zh)
Inventor
王新猴
李力
Original Assignee
华为云计算技术有限公司
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 华为云计算技术有限公司 filed Critical 华为云计算技术有限公司
Publication of WO2022105641A1 publication Critical patent/WO2022105641A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/10Geometric effects
    • G06T15/20Perspective computation
    • G06T15/205Image-based rendering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/10Geometric effects
    • G06T15/20Perspective computation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/20Finite element generation, e.g. wire-frame surface description, tesselation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/20Finite element generation, e.g. wire-frame surface description, tesselation
    • G06T17/205Re-meshing

Definitions

  • the present application relates to the 3D field, and in particular, to a rendering method, device, and system.
  • Rendering refers to the process of using software to generate images from a 3D model, where a 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 images are digital images or bitmap images. Rendering is a term similar to "an artist's rendering of a scene", and is also used to describe "the process of computing effects in a video editing file to produce the final video output".
  • the present application provides a rendering method, device and system, which can effectively reduce the consumption of computing resources.
  • a rendering method which is applied to a rendering application server of a rendering system, the rendering system further includes a rendering application client, the rendering application client is deployed on a terminal device, and the rendering application server is deployed For remote rendering nodes, the method includes:
  • the rendering application server receives the first perspective
  • the rendering application server calls the rendering engine according to the first viewing angle to search for the valid grid corresponding to the first viewing angle in the valid grid set, and generates a rendered image according to the light intensity of the valid grid corresponding to the first viewing angle , wherein the valid grid set is a set of valid grids corresponding to a preset viewing angle set, and the first viewing angle belongs to the viewing angle set;
  • the rendering application server sends the rendering image to the rendering application client.
  • the light intensity of the effective mesh is pre-computed and stored in the rendering application server.
  • the valid grid corresponding to the first viewing angle is specifically: a grid that can be observed from a viewpoint corresponding to the first viewing angle, wherein the grid is a 3D model of the target scene obtained by dividing the surface.
  • the valid grid set is a set composed of valid grids corresponding to each viewing angle in the viewing angle set.
  • the perspective set is preset by the user on the rendering application server; the perspective set is obtained by the rendering application server according to historical perspective statistics of the rendering application; the perspective set is all It is predicted by the rendering application server based on the historical perspective of the rendering application.
  • the material of the effective mesh includes a diffuse reflection material and an optical material
  • the light intensity of the effective mesh includes a The ray intensity obtained by performing forward ray tracing on the grid; when the material of the effective grid is an optical material, the ray intensity of the effective grid includes the backward ray from the same specific angle as the angle of the first viewing angle Trace the resulting ray intensity.
  • a rendering application server includes: a receiving module, a rendering module, and a sending module;
  • the receiving module is configured to receive the first perspective sent by the rendering application client;
  • the rendering module is configured to call the rendering engine according to the first viewing angle to search for the valid grid corresponding to the first viewing angle in the valid grid set, and generate a rendered image according to the light intensity of the valid grid corresponding to the first viewing angle , wherein the valid grid set is a set of valid grids corresponding to a preset viewing angle set, and the first viewing angle belongs to the viewing angle set;
  • the sending module is configured to send the rendered image to the rendering application client.
  • the valid grid corresponding to the first viewing angle is specifically: a grid that can be observed from a viewpoint corresponding to the first viewing angle, wherein the grid is a 3D model of the target scene obtained by dividing the surface.
  • the valid grid set is a set composed of valid grids corresponding to each viewing angle in the viewing angle set.
  • the perspective set is preset by the user on the rendering application server; the perspective set is obtained by the rendering application server according to historical perspective statistics of the rendering application; the perspective set is all It is predicted by the rendering application server based on the historical perspective of the rendering application.
  • the material of the effective mesh includes a diffuse reflection material and an optical material
  • the light intensity of the effective mesh includes a The ray intensity obtained by performing forward ray tracing on the grid; when the material of the effective grid is an optical material, the ray intensity of the effective grid includes the backward ray from the same specific angle as the angle of the first viewing angle Trace the resulting ray intensity.
  • a rendering method which is applied to a rendering system, where the rendering system includes a rendering application client and a rendering application server, the rendering application client is deployed on a terminal device, and the rendering application server is deployed on A remote rendering node, the method includes:
  • the rendering application client sends the first perspective
  • the rendering application server receives the first viewing angle; according to the first viewing angle, the rendering engine is called to search for the valid grid corresponding to the first viewing angle in the valid grid set, and the valid grid corresponding to the first viewing angle is based on the first viewing angle. generating a rendered image based on the light intensity of the grid; sending the rendered image; wherein, the valid grid set is a set of valid grids corresponding to a preset viewing angle set, and the first viewing angle belongs to the viewing angle set;
  • the rendering application client receives the rendered image.
  • the valid grid corresponding to the first viewing angle is specifically: a grid that can be observed from a viewpoint corresponding to the first viewing angle, wherein the grid is a 3D model of the target scene obtained by dividing the surface.
  • the valid grid set is a set composed of valid grids corresponding to each viewing angle in the viewing angle set.
  • the perspective set is preset by the user on the rendering application server; the perspective set is obtained by the rendering application server according to historical perspective statistics of the rendering application; the perspective set is all It is predicted by the rendering application server based on the historical perspective of the rendering application.
  • the material of the effective mesh includes a diffuse reflection material and an optical material
  • the light intensity of the effective mesh includes a The ray intensity obtained by performing forward ray tracing on the grid; when the material of the effective grid is an optical material, the ray intensity of the effective grid includes the backward ray from the same specific angle as the angle of the first viewing angle Trace the resulting ray intensity.
  • a rendering system including 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 render node;
  • the rendering application server is used to receive a first view angle; according to the first view angle, the rendering engine is called to search for the valid grid corresponding to the first view angle in the valid grid set, and the valid grid corresponding to the first view angle is called according to the first view angle. generating a rendered image based on the light intensity of the grid; sending the rendered image; wherein, the valid grid set is a set of valid grids corresponding to a preset viewing angle set, and the first viewing angle belongs to the viewing angle set;
  • the rendering application client is configured to send the first viewing angle and receive the rendered image.
  • the valid grid corresponding to the first viewing angle is specifically: a grid that can be observed from a viewpoint corresponding to the first viewing angle, wherein the grid is a 3D model of the target scene obtained by dividing the surface.
  • the valid grid set is a set composed of valid grids corresponding to each viewing angle in the viewing angle set.
  • the perspective set is preset by the user on the rendering application server; the perspective set is obtained by the rendering application server according to historical perspective statistics of the rendering application; the perspective set is all It is predicted by the rendering application server based on the historical perspective of the rendering application.
  • the material of the effective mesh includes a diffuse reflection material and an optical material
  • the light intensity of the effective mesh includes a The ray intensity obtained by performing forward ray tracing on the grid; when the material of the effective grid is an optical material, the ray intensity of the effective grid includes the backward ray from the same specific angle as the angle of the first viewing angle Trace the resulting ray intensity.
  • a computing node in a fifth aspect, includes a processor and a memory, and the processor executes a program in the memory, thereby performing the method according to any one of the first aspects.
  • a computer-readable storage medium characterized by comprising instructions, when the instructions are executed on a computing node, the computing node causes the computing node to execute the method according to any one of the first aspects.
  • the rendering application server finds the corresponding valid grid from the valid grid set according to the first viewing angle, and calculates the rendered image according to the light intensity of the valid grid, which can effectively save more than traditional ray tracing rendering. computing resources.
  • FIGS. 1A-1B are schematic structural diagrams of some rendering systems provided by the present application.
  • FIG. 2 is a schematic structural diagram of observing a target scene from different angles involved in the present application
  • FIG. 3 is a schematic diagram of reverse ray tracing provided by the present application.
  • FIGS. 4A-4B are schematic diagrams of some grids provided by this application.
  • FIG. 5 is a schematic diagram of a viewing angle of an observation target scene provided by the present application.
  • FIG. 6 is a schematic diagram of N rays emitted by viewpoint E provided by the present application and M grids in the target scene for intersection;
  • FIGS. 7A-7D are schematic diagrams of some forward ray tracings provided by this application.
  • FIG. 8 is a schematic diagram of the number of rays obtained by sampling per unit area provided by the present application.
  • 9A-9B are schematic diagrams of reverse ray tracing rendering provided by the present application.
  • FIG. 10 is a schematic diagram of the angle of reverse ray tracing rendering provided by the present application.
  • FIG. 11 is a schematic diagram of the intersection of a light ray emitted from a viewpoint E and a three-dimensional model provided by the present application;
  • FIG. 12 is a flow interaction diagram of a rendering method provided by the present application.
  • FIG. 13 is a flow interaction diagram of another rendering method provided by the present application.
  • FIG. 14 is a schematic structural diagram of a rendering application server provided by the present application.
  • FIG. 1A is a schematic structural diagram of a rendering system involved in the present application.
  • the rendering system of the present application is used for a 2D image obtained by rendering a 3D model of a target scene through a rendering method, that is, a rendered image.
  • the rendering method may include rasterization rendering, ray tracing rendering, and the like.
  • the rendering system provided in FIG. 1A may include: a plurality of terminal devices 110 , a network device 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 terminal devices are generally deployed in different data centers or even geographic areas.
  • the terminal device 110 may be a device that needs to display a rendered image, for example, a virtual reality device (virtual reality, VR) used for flight training, a computer used for virtual games, a smart phone used in a virtual mall, and the like, There is no specific limitation here.
  • the terminal device can be a device with high configuration and high performance (for example, multi-core, high frequency, large memory, etc.), or a device with low configuration and low performance (for example, single core, low frequency, small memory, etc.) equipment.
  • the terminal device 110 runs an operating system and a rendering application client.
  • the network device 120 is used to transmit data between the terminal device 110 and the remote rendering platform 130 through a communication network of any communication mechanism/communication standard.
  • the communication network may be a wide area network, a local area network, a point-to-point connection, etc., or any combination thereof.
  • the remote rendering platform 130 includes a plurality of rendering nodes, and each rendering node includes rendering hardware, an operating system, a rendering engine, and a rendering application server from bottom to top.
  • the rendering hardware includes computing resources, storage resources, and network resources.
  • the computing resources can adopt a heterogeneous computing architecture, for example, a central processing unit (CPU) + graphics processing unit (GPU) architecture, CPU+AI chip, CPU+GPU+AI chip architecture, etc. , which is not specifically limited here.
  • Storage resources can include memory and so on.
  • computing resources may be divided into multiple computing unit resources, storage resources may be divided into multiple storage unit resources, and network resources may be divided into multiple network unit resources. Therefore, the remote rendering platform 130 can freely combine resources according to the user's resource requirements on the basis of unit resources, so as to provide resources according to the user's needs.
  • the virtualized service can flexibly isolate mutually independent resources according to the user's needs to run the rendering engine and/or the rendering application server.
  • virtualization services can isolate independent computing resources such as virtual machine (VM) services, bare metal server (BMS) services, and containers (containers).
  • a rendering engine can be used to implement image rendering algorithms.
  • the rendering engine allows the rendering application to call the rendering algorithm (pipeline) built into the rendering engine according to its interface to complete the image rendering.
  • the rendering application server can be used to call the rendering engine to complete the rendering of the rendered image.
  • the rendering application client running on the terminal device 110 and the rendering application server running on the remote rendering platform 130 respectively constitute the front end and the back end of the rendering application.
  • common rendering applications may include: game applications, VR applications, movie special effects, animation, and so on.
  • the rendering application can perform real-time image rendering by invoking the rendering engine, thereby obtaining the rendered image.
  • the rendering application server and the rendering application client may be provided by a rendering application provider, and the rendering engine may be provided by a cloud service provider.
  • the rendering application can be a game application.
  • the game application developer installs the game application server on the remote rendering platform provided by the cloud service provider, and the game application game developer provides the game application client through the Internet. Download it to the user and install it on the user's terminal device.
  • cloud service providers also provide rendering engines, which can provide computing power for game applications.
  • the rendering application client, the rendering application server and the rendering engine may all be provided by a cloud service provider.
  • a management device 140 is also included.
  • the management device 140 may be a user's terminal device and a device provided by a third party other than the remote rendering platform 130 of the cloud service provider, or may be deployed on a public cloud together with the remote rendering platform 130 .
  • the management device 140 may be provided by a rendering application provider.
  • the rendering application provider may manage the rendering application through the management device 140.
  • the rendering application provider may specify, through the management device 140, the quality parameters of the initial rendered image provided by the rendering application server to the rendering application client, and so on.
  • the terminal device 1 sends a first rendering request to the remote rendering platform 130 through the network device 120, and the remote rendering platform 130 invokes the rendering engine to independently perform ray tracing on the target scene using ray tracing rendering from the perspective of the first user according to the first rendering request, thereby A rendered image of the target scene generated from the perspective of the first user is obtained.
  • the terminal device 2 sends a second rendering request to the remote rendering platform 130 through the network device 120, and the remote rendering platform 130 invokes the rendering engine to independently perform ray tracing on the target scene using ray tracing rendering from the perspective of the second user according to the second rendering request, thereby A rendered image of the target scene generated from the second user's perspective is obtained.
  • Ray-traced rendering is a rendering method that produces a rendered image by tracing the path of light entering a target scene along the path of light emitted from a camera's (or human eye's) viewpoint toward each pixel of the rendered image.
  • the target scene includes a light source and a three-dimensional model.
  • the core idea of ray tracing rendering is to trace rays backward from the viewpoint of the camera (or human eye) (when the viewpoint is determined, the angle of view is naturally determined). Since only the rays that finally enter the camera (or the human eye) are useful, backtracing rays can effectively reduce the amount of data.
  • the target scene has only one light source 311 and one opaque sphere 312 .
  • a ray of light is emitted from the viewpoint E of the camera 313, projected on the pixel point O 1 of the rendered image 314, and then continues to be emitted to a point P 1 of the opaque sphere 312, and then reflected to the light source L, at this time, the point P 1
  • the light intensity and color of pixel O 1 determine the light intensity and color.
  • Another ray from the viewpoint E of the camera 311 is projected to another pixel point O 2 in the rendered image 314 , and then continues to a point P 2 of the opaque sphere 312 , and is then reflected to the light source L, and the point There is an obstacle opaque sphere 312 between P 2 and the light source L.
  • the point P 2 is located in the shadow of the opaque sphere 312, the light intensity of the pixel point O 2 is zero, and the color is black.
  • the rendering system only includes the terminal device 1 and the terminal device 2 as an example for description, but in practical applications, the number of terminal devices is far more than two, and the user's The viewing angles are often different. Therefore, as the number of users increases, the number of rendered images of different viewing angles that need to be generated also increases, and the amount of calculation is very large.
  • the light produced by the light source strikes the 3D model.
  • the light source may be a point light source, a line light source, or a surface light source, or the like.
  • the shape of the three-dimensional model can be various, for example, it can be a sphere, a cone, a curved object, a plane object, an object with irregular surface, and so on.
  • the mesh is a partial area of the surface of the three-dimensional model in the scene.
  • the shapes of the meshes of the three-dimensional models with different shapes may be different, for example, the shapes of the meshes of the sphere and the meshes of the curved objects may be completely different.
  • Grids can have unique grid IDs. The grid will be described below with reference to specific embodiments.
  • the grid can be represented as the center point P(r, ⁇ , ) and the center point P(r, ⁇ , ) is an approximate square with slightly bulging sides on the surface of the sphere formed by the points in the neighborhood.
  • a three-dimensional orthogonal coordinate system is constructed with the center of the sphere as the origin, wherein the three-dimensional orthogonal coordinate system includes an x-axis, a y-axis and a z-axis.
  • r represents the length of the line segment OP from the center of the sphere O to the center point P
  • represents the angle between the line segment OP and the positive z-axis, Expressed as the angle between the projection of the line segment OP on the xoy plane and the x-axis.
  • n center points P 1 , P 2 , . . . , P n can be uniformly set on the sphere . j and the center point P i belong to the same grid.
  • the mesh can be represented as a square on the curved surface represented by P(u, t).
  • a two-dimensional orthogonal coordinate system is constructed with a set origin of the surface, wherein the coordinate system includes the u-axis and the t-axis.
  • u represents the offset in one direction of the origin set for the surface
  • t represents the offset in another orthogonal direction
  • P(u, t) represents the four vertices in the (u, t) coordinate system as shown in Figure 4B composed of blocks.
  • the above-mentioned shapes of the meshes are only used as specific examples, and in practical applications, the meshes may also have other shapes, such as hexagons, etc., which are not specifically limited here.
  • the size of the grid can be set as required. When the accuracy requirement is higher, the grid size can be set smaller, and when the accuracy requirement is lower, the grid size can be set larger.
  • the perspective set may include one perspective or multiple perspectives.
  • the viewing angle of the viewpoint E can be expressed as (P, ⁇ ), where P is the vertical distance from the viewpoint E to the rendered image, and ⁇ is the viewpoint E to the center of the rendered image
  • P is the vertical distance from the viewpoint E to the rendered image
  • is the viewpoint E to the center of the rendered image
  • the perspectives in the perspective set may be various perspectives of the same user at different moments, various perspectives of different users at the same moment, various perspectives of multiple users at different moments, and so on.
  • the method for determining the view set includes at least the following:
  • the set of views may be preset. That is to say, each view angle in the view angle set is preset by the user.
  • the remote rendering platform can collect various perspectives of users of different terminal devices at the same time, and set them as a perspective set in advance.
  • the rendering application is a game application
  • the game application provides a specific game path
  • the remote rendering platform can collect various perspectives of the user in the specific game path, and preset them as a perspective set.
  • the set of views may be statistically derived. For example, a plurality of historical perspectives may be counted, and historical perspectives whose occurrence probability is greater than a preset threshold may be set as a perspective set.
  • a normal distribution, a Poisson distribution, etc. may be used to perform statistics on multiple historical perspectives.
  • the set of views can be predicted.
  • the subsequent game path can be predicted by a prediction algorithm according to the existing game path given by the game application, and the possible viewing angles of the predicted game path can be set as the viewing angle set.
  • the prediction algorithm may include: decision tree algorithm, artificial neural network, support vector machine and so on.
  • the above method for determining the perspective set is only a specific example.
  • the perspective set can also be determined in an iterative manner. For example, when the rendering application is a game application, if the game scene is switched, each The perspective of each game scene changes, so each game scene's perspective collection is iterated over each game scene switch.
  • K valid grids corresponding to the viewing angle set are determined from the plurality of grids.
  • the valid grid corresponding to the viewing angle is specifically the grid that can be observed by the viewpoint corresponding to the viewing angle.
  • the j-th grid is a valid grid, where 1 ⁇ i ⁇ N, 1 ⁇ j ⁇ M, i, j, N, M are all positive integers . Conversely, if the rays generated by any viewing angle in the viewing angle set do not intersect the jth grid, then the jth grid is an invalid grid. To reduce the amount of data, valid grids only need to be stored once.
  • the j-th grid only needs to be stored once. It needs to be stored once, and invalid meshes do not need to be stored.
  • the valid grid only the grid ID of the valid grid and the ID of the 3D model where the valid grid is located can be stored, or the grid ID of the valid grid and the ID of the 3D model where the valid grid is located can be stored. , the spatial coordinates of the effective grid, the direction of rays entering the effective grid, and so on.
  • Materials for effective meshes can include diffusely reflective materials as well as optical materials.
  • the diffuse reflection material is usually a material with a relatively rough surface, such as cloth, paper, wood, and rock.
  • Optical materials are usually materials with relatively smooth surfaces, or transparent materials, such as lake surfaces, mirror surfaces, and dewdrops.
  • Forward ray tracing refers to starting from the light source and forward tracing the transfer process of rays in the target scene. There are mainly four scenarios in forward ray tracing: reflection, refraction, transmission, and direct illumination, which will be described below with reference to FIGS. 7A-7D and specific embodiments, respectively.
  • the target scene is a reflection scene
  • the target scene has only one light source 411 , an opaque sphere 412 and an opaque sphere 413 .
  • a ray of light is emitted from the light source 411, projected onto a point P1 of the opaque sphere 412, and then reflected onto an effective grid whose center point is the point Q1 of the opaque sphere 413. Therefore, the light intensity generated by the light source 411 on the point P 1 of the opaque sphere 412 can be calculated by the local light illumination model, and then, after the light is reflected by the opaque sphere 412, the center point of the opaque sphere 413 is the point Q 1 The intensity of light produced on the effective mesh of .
  • the target scene is a refraction scene
  • the target scene has only one light source 421 , a transparent sphere 422 and an opaque sphere 423 .
  • a ray of light from light source 421 is projected onto a point P2 of transparent sphere 422, and then refracted onto an effective grid of opaque sphere 423 whose center is point Q2 . Therefore, the intensity of the light generated by the light source 421 at the point P 2 of the transparent sphere 422 can be calculated through the local light illumination model, and then, after the light is refracted by the transparent sphere 422, the center point of the opaque sphere 423 is the point Q 2 The intensity of light produced on the effective mesh of .
  • the target scene when the target scene is assumed to be a transmissive scene, it is assumed that the target scene has only one light source 431 , a transparent thin body 432 and an opaque sphere 433 .
  • a ray of light is emitted from the light source 421, projected to a point P3 of the thin transparent body 432, and then transmitted to an effective grid having a center point of the opaque sphere 433 at point Q3 .
  • the light intensity of the light generated by the light source 431 at the point P3 of the transparent thin body 432 can be calculated by the local light illumination model, and then, after the light is transmitted by the transparent thin body 432, the center point of the opaque sphere 433 is set as a point The intensity of light produced on the effective grid of Q 3 .
  • the target scene when it is assumed that the target scene is a direct scene, it is assumed that the target scene has only one light source 441 and an opaque sphere 443 .
  • a ray of light is emitted from light source 441 and projected onto an effective grid of opaque sphere 443 centered at point Q4 . Therefore, the light intensity generated by the light source 441 on the effective grid whose center point is the point Q4 of the opaque sphere 443 can be calculated by the local light illumination model.
  • the reflection scene in FIG. 7A the refraction scene in FIG. 7B
  • the transmission scene in FIG. 7C the direct scene in FIG. 7D are the simplest scenes. 7D is more complicated. For example, there may be multiple opaque objects and multiple transparent objects in the target scene at the same time. Therefore, the light will be reflected, refracted and transmitted multiple times. In addition, there may be more than one light source, but two or more.
  • the parameters involved in the sampling mainly include the number of samples per unit space and the number of ray bounces (Bounce) and so on.
  • the following will take the sample per unit area (SPUA) and the number of light bounces as examples for a detailed introduction.
  • SPUA can be defined as the number of rays sampled per unit area. Taking the light source L as an example, a spherical surface S is constructed with the light source L as the center, and the spherical surface S is divided into a plurality of unit areas. Then, SPUA is equal to the amount of light generated by the light source L that passes through the unit area A. In theory, the number of rays generated by the light source L passing through a unit area is infinite. However, in the actual tracking process, it is impossible to trace all the rays, and only part of the limited rays can be traced.
  • the larger the number of SPUAs the higher the number of rays traced, and the better the image quality, however, the greater the amount of computation. Conversely, the smaller the number of SPUAs, the lower the number of rays traced and the poorer the image quality, however, the less computation.
  • the number of ray bounces is the sum of the maximum number of reflections and refractions traced to the ray before the ray's forward tracing is terminated. Because in complex scenes, rays will be reflected and refracted multiple times. In theory, the number of times the rays are reflected and refracted can be infinite. However, in the actual tracking process, it is impossible to trace the rays infinitely. Therefore, some tracking termination conditions need to be given. In the application, there can be the following termination conditions: the light will decay after many times of reflection and refraction, and the light contribution to the light intensity of the viewpoint is very small; or, the number of ray bounces, that is, the tracking depth is greater than a certain value.
  • the more times the ray bounces the more effective rays that can be tracked, the better the refraction effect between multiple transparent objects, the more realistic, and the better the image quality, but the greater the amount of computation.
  • the less the number of ray bounces the less effective rays that can be traced, the worse the refraction effect between multiple transparent objects, the more distorted, and the worse the image quality, but the less computation.
  • sampling parameters are only used as specific examples. In practical applications, other sampling parameters may also be used, which are not specifically limited here.
  • rays may be passed to valid meshes or to invalid meshes. For example, a ray might pass from a valid mesh to an invalid mesh, and then from invalid mesh to valid mesh; or, a ray might pass from valid mesh to invalid mesh. If it is passed to a valid grid, the ray intensity generated by the ray in the valid grid needs to be counted; if it is passed to an invalid grid, there is no need to count the ray intensity generated by the ray in the invalid grid. .
  • Reverse ray-traced rendering is the process of passing rays into the target scene to light sources by tracing rays entering a valid mesh of a 3D model from a specific angle.
  • the above-mentioned light rays obtained by reverse tracing from a specific angle can only be viewed by the human eye or the camera at the specific angle. Therefore, in order to achieve a full field of view, it is necessary to perform reverse ray tracing from multiple specific angles.
  • the core idea of reverse ray traced rendering is to trace rays backward from the rays entering the valid mesh. There are mainly two scenarios of reflection and refraction in reverse ray tracing rendering, which will be described below with reference to specific embodiments.
  • the target scene when the target scene is a reflective scene, it is assumed that the target scene has only one light source 511 and one opaque sphere 512 .
  • a ray of light is emitted from a specific angle, projected onto a point P 1 of a valid grid of opaque sphere 512 , and then reflected to light source 511 .
  • the light intensity of the light generated by the light source 511 on the effective grid of the opaque sphere 512 can be calculated by the local light illumination model.
  • the target scene when the target scene is a refraction scene, it is assumed that the target scene has only one light source 521 and one transparent sphere 522 .
  • a ray is emitted from a specific angle, projected to a point P 2 on an effective grid of the transparent sphere 522, then refracted to another point Q 2 of the transparent sphere 522, and then refracted to the light source L.
  • it can be Calculate the intensity of the light generated by the light source 521 at point Q 2 through the local light illumination model, and then calculate the light generated on the effective grid with the center point P 2 when the light is refracted from point Q 2 to point P 2 strength.
  • the reflection scene in Fig. 9A and the refraction scene in Fig. 9B are the simplest scenes.
  • Fig. 9A assumes that there is only one opaque sphere in the target scene
  • Fig. 9B assumes that there is only one transparent sphere in the target scene.
  • the target scene is far more complex than Figure 9A to Figure 9B.
  • each effective grid has an open hemispherical space facing its normal direction, and rays entering this hemispherical space can be expressed as taking the effective grid center P as the end point and taking any point O on the spherical surface of the hemispherical space (for example, O 1 , O 2 or O 3 ) as the starting point.
  • the space is continuous, but we can perform reverse ray tracing for different direction angles of each effective grid according to the computing power and accuracy requirements.
  • the direction angle here refers to the ( ⁇ , ⁇ ), where 0 ⁇ 180, 0 ⁇ 360.
  • the above-mentioned specific angle can be any direction angle in the hemispherical space. Since the number of rays is infinite and the computing resources are limited, it is usually impossible to perform reverse ray tracing on all rays, so some rays need to be sampled. When sampling the rays of reverse ray tracing, the parameters involved in the sampling mainly include the number of samples per effective grid and the number of ray bounces, etc.
  • the set of effective meshes in the target scene includes a effective meshes T 1 , T 2 ,...,T a for diffuse reflective materials, and b effective meshes T 1 ,T 2 ,...,T b for optical materials
  • the forward ray tracing is performed on the effective grids T 1 , T 2 ,...,T a of a diffuse reflection materials
  • the effective grids T 1 , T 2 , ... of b optical materials are respectively from k specific angles.
  • T b performs reverse ray tracing.
  • the effective grid T 1 of the b optical materials from the first specific angle can be obtained.
  • T 2 ,...,T b respectively the first reverse ray intensities obtained by reverse ray tracing
  • the effective grid T 1 of the b optical materials from the second specific angle can be obtained.
  • T 2 ,...,T b are the second reverse ray intensities obtained by reverse ray tracing respectively
  • the effective grid T 1 of the b optical materials from the k-th specific angle can be obtained.
  • T 2 ,...,T b are the k-th reverse ray intensities obtained by reverse ray tracing respectively
  • the forward light intensity F 1 , F 2 ,...,F a the first reverse light intensity second reverse ray intensity
  • the k-th reverse ray intensity Stored as effective surface light emission field storage.
  • the effective surface light emission field may be stored in a sparse matrix manner.
  • forward ray tracing can also be performed on b optical materials, and the forward ray tracing obtained by the forward ray tracing can be performed.
  • the light intensities F 1 , F 2 ,...,F b and the first reverse light intensity respectively second reverse ray intensity
  • the k-th reverse ray intensity Superposition is performed to obtain an effective surface light emission field and so on.
  • the projected intersection method can be used to propose the corresponding data from the pre-calculated effective surface light emission field, so as to quickly obtain the effective grid set that can be observed from the perspective, and finally Generate the desired rendered image.
  • the following will describe in detail how to obtain the set of object surfaces that can be observed by the user with reference to FIG. 9 and related specific embodiments.
  • the camera 611 (or the human eye) observes the target scene from the perspective corresponding to the viewpoint E, and the rendered image 612 generated by the observation has m pixels.
  • a ray is emitted from the viewpoint E and projected onto the first pixel of the rendered image 612, and then continues to be projected onto the first grid of the 3D model in the target scene, if the first grid is diffuse If the reflective material is used, the forward light intensity of the first grid is used as the light intensity of the first pixel. If the first grid is an optical material, the first incident angle at which the light enters the first grid is determined, The light intensity corresponding to the matching specific angle of the first grid is searched according to the first incident angle, and the corresponding light intensity is used as the light intensity of the first pixel point.
  • a ray is emitted from the viewpoint E, projected on the second pixel of the rendered image 612, and then continues to be projected on the second grid of the three-dimensional model in the target scene, if the second grid is diffuse
  • the reflective material is used, the forward light intensity of the second grid is used as the light intensity of the second pixel point, and if the second grid is an optical material, the second incident angle at which the light enters the second grid is determined, And according to the second incident angle, the light intensity corresponding to the matching specific angle of the second grid is searched, and the corresponding light intensity is used as the light intensity of the second pixel point.
  • a ray is emitted from the viewpoint E and projected to the mth pixel of the rendered image 612, and then continues to be emitted to the mth grid of the 3D model in the target scene, if the mth grid is diffuse
  • the forward light intensity of the m-th grid is taken as the light intensity of the m-th pixel
  • the m-th grid is an optical material
  • the m-th incident angle of the light entering the m-th grid is determined, And according to the mth incident angle, the light intensity corresponding to the matching specific angle of the mth grid is searched, and the corresponding light intensity is used as the light intensity of the mth pixel point.
  • the matching of the first incident angle with the specific angle of the first grid includes: the first incident angle is the same as the specific angle of the first grid, or the difference between the first incident angle and the specific angle of the first grid The difference is smaller than the preset threshold, which is not specifically limited here.
  • the matching between the second incident angle and the specific angle of the second grid is also similar to the matching of the m-th incident angle with the specific angle of the m-th grid, which will not be described here.
  • SPP sample per pixel
  • the upper limit of the effective network T i of each optical material needs to be calculated.
  • an effective network of b optical materials requires 64800b rays, that is, 64800b reverse ray tracings are required.
  • each optical material network needs to emit more fine-grained rays, that is, each ray material network may emit more than 64800 rays. In this case, the proposed scheme emits at most k rays for each effective network of optical materials, thus greatly reducing the amount of data computation.
  • FIG. 12 is a flowchart interaction diagram of a rendering method provided by the present application.
  • the rendering method of this embodiment can be applied to the rendering system shown in FIG. 1A , and the method includes:
  • S101 The rendering application client of the terminal device sends the first view angle to the network device.
  • the network device receives the first view angle sent by the rendering application client of the terminal device.
  • the first viewing angle may be a single viewing angle or multiple viewing angles.
  • the first viewing angle may be the angle at which the user of the rendering application client is currently viewing the game, or the viewing angle of the rendering application client. Multiple angles of the game path the user is playing, etc.
  • the network device sends the first perspective to the rendering application server of the remote rendering platform.
  • the rendering application server of the remote rendering platform receives the first perspective sent by the network device.
  • the rendering application server of the remote rendering platform invokes the rendering engine according to the first view angle to search for the valid grid corresponding to the first view angle in the valid grid set.
  • the valid grid set is a subset formed by valid grids corresponding to each viewing angle in the viewing angle set in the grid set. That is, the effective grid set is generally smaller than the grid set.
  • the grid set is a set composed of the grids.
  • the grid is obtained by dividing the surface of the 3D model in the target scene.
  • the definition of the grid please refer to the above. 4A-4B and related descriptions are not further described here.
  • the effective grid corresponding to the first viewing angle is specifically: a grid that can be observed from a viewpoint corresponding to the first viewing angle.
  • the remote rendering platform determines that the first viewing angle belongs to the viewing angle set.
  • the remote rendering platform has pre-stored the correspondence between each viewing angle in the viewing angle set and the valid grid.
  • the remote rendering platform can quickly obtain a valid mesh set observable from the first viewing angle by using a projective intersection method.
  • a projective intersection method For the content of the projective intersection method, reference may be made to FIG. 11 and related descriptions, which will not be described here again.
  • the rendering application server of the remote rendering platform invokes the rendering engine to generate a rendered image according to the light intensity of the effective grid corresponding to the first viewing angle.
  • the remote rendering platform has previously stored the light intensity of the effective grid corresponding to each viewing angle.
  • the material of the effective grid includes a diffuse reflection material and an optical material, and in the case where the material of the effective grid is a diffuse reflection material, the light intensity of the effective grid includes forwarding the effective grid.
  • forward ray tracing and reverse ray tracing please refer to the relevant content of forward ray tracing involved in FIGS. 7A-7D above, and the introduction of the relevant content of reverse ray tracing involved in FIGS. 9A-9B above. , which will not be described here.
  • the remote rendering platform acquires the light intensity of the effective grid corresponding to the first viewing angle according to the first viewing angle.
  • the effective grids corresponding to the first viewing angle include at least three cases: In the first case, the materials of the effective grids corresponding to the first viewing angle are all diffuse reflection materials. The ray intensity obtained by ray tracing is sufficient. In the second case, the materials of the effective grids corresponding to the first viewing angle are all optical materials. In this case, it is only necessary to obtain these effective grids and perform reverse ray tracing through the first viewing angle to obtain the light intensity. In the third case, the materials of the effective grid corresponding to the first viewing angle include both diffuse reflective materials and optical materials. In this case, it is necessary to obtain the effective grids whose materials are diffuse reflective materials through forward ray tracing. Light intensity, obtains the light intensity by performing reverse ray tracing from the first viewing angle of an effective grid whose material is an optical material.
  • S105 The rendering application server of the remote rendering platform sends the rendered image to the network device.
  • the network device receives the rendered image sent by the rendering application server of the remote rendering platform.
  • the network device sends the rendered image to the rendering application client of the terminal device.
  • the rendering application client of the terminal device receives the rendered image sent by the network device.
  • FIG. 12 For the sake of simplicity, the embodiment shown in FIG. 12 is not described in detail.
  • FIG. 13 is a flowchart interaction diagram of a rendering method provided by the present application.
  • the rendering method of this embodiment can be applied to the rendering system shown in FIG. 1B , and the method includes:
  • S201 The management device sends the first view angle to the network device.
  • the network device receives the first view angle sent by the management device.
  • the first viewing angle may be a single viewing angle or multiple viewing angles.
  • the first viewing angle may be the current viewing angle of the game by the user of the rendering application client of the terminal device, or the terminal The device's rendering of multiple angles of the game path played by the user of the application client, etc.
  • S202 The network device sends the first perspective to the rendering application server of the remote rendering platform.
  • the rendering application server of the remote rendering platform receives the first perspective sent by the network device.
  • the rendering application server of the remote rendering platform invokes the rendering engine according to the first view angle to search for the valid grid corresponding to the first view angle in the valid grid set.
  • the rendering application server of the remote rendering platform invokes the rendering engine to generate a rendered image according to the light intensity of the effective grid corresponding to the first viewing angle.
  • S205 The rendering application server of the remote rendering platform sends the rendered image to the network device.
  • the network device receives the rendered image sent by the rendering application server of the remote rendering platform.
  • the network device sends the rendered image to the rendering application client of the terminal device.
  • the rendering application client of the terminal device receives the rendered image sent by the network device.
  • FIG. 12 For the sake of simplicity, the embodiment shown in FIG. 12 is not described in detail.
  • FIG. 14 is a schematic structural diagram of a rendering application server provided by the present application.
  • the rendering application server in this embodiment includes: a receiving module 710 , a rendering module 720 and a sending module 730 .
  • the receiving module 710 is configured to receive the first viewing angle.
  • the rendering module 720 is configured to call the rendering engine according to the first viewing angle to search for the valid grid corresponding to the first viewing angle in the valid grid set, and generate a rendering according to the light intensity of the valid grid corresponding to the first viewing angle.
  • the image wherein the valid grid set is a set of valid grids corresponding to a preset viewing angle set, and the first viewing angle belongs to the viewing angle set.
  • the sending module 730 is configured to send the rendered image to the rendering application client.
  • FIG. 12 For the sake of simplicity, the embodiment shown in FIG. 12 is not described in detail.
  • the above-mentioned embodiments it may be implemented in whole or in part by software, hardware, firmware or any combination thereof.
  • software it can be implemented in whole or in part 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 the present application are generated.
  • the computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server, or data center Transmission to another website site, computer, server, or data center by wire (eg, coaxial cable, optical fiber, digital subscriber line) or wireless (eg, infrared, wireless, microwave, etc.).
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes an integration of one or more available media.
  • the usable media may be magnetic media (eg, floppy disks, storage disks, magnetic tapes), optical media (eg, DVD), or semiconductor media (eg, Solid State Disk (SSD)), among others.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Graphics (AREA)
  • Databases & Information Systems (AREA)
  • Geometry (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Image Generation (AREA)

Abstract

Provided are a rendering method, device and system. The rendering system comprises a rendering application serving end which is applied to the rendering system, and the rendering system further comprises a rendering application client, wherein the rendering application client is deployed on a terminal device, and the rendering application serving end is deployed on a remote rendering node. The method comprises: the rendering application serving end receiving a first angle of view; the rendering application serving end calling, according to the first angle of view, a rendering engine to search a valid grid set for a valid grid corresponding to the first angle of view; generating a rendering image according to the light intensity of the valid grid corresponding to the first angle of view, wherein the valid grid set is a set of valid grids corresponding to a preset set of angles of view, and the first angle of view belongs to the set of angles of view; and the rendering application serving end sending the rendering image to the rendering application client. By means of the method, the resources required for calculation can be effectively reduced.

Description

渲染方法、设备以及系统Rendering method, device and system 技术领域technical field
本申请涉及3D领域,尤其涉及一种渲染方法、设备以及系统。The present application relates to the 3D field, and in particular, to a rendering method, device, and system.
背景技术Background technique
渲染是指用软件从三维模型生成图像的过程,其中,三维模型是用严格定义的语言或者数据结构对于三维物体的描述,它包括几何、视点、纹理以及照明信息。图像是数字图像或者位图图像。渲染这个术语类似于“艺术家对于场景的渲染”,另外,渲染也用于描述“计算视频编辑文件中的效果,以生成最终视频输出的过程”。Rendering refers to the process of using software to generate images from a 3D model, where a 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 images are digital images or bitmap images. Rendering is a term similar to "an artist's rendering of a scene", and is also used to describe "the process of computing effects in a video editing file to produce the final video output".
但是,现有技术中,渲染需要的计算量非常大,需要消耗非常多的计算资源。However, in the prior art, rendering requires a very large amount of computation and consumes a lot of computing resources.
发明内容SUMMARY OF THE INVENTION
为了解决上述问题,本申请提供了一种渲染方法、设备以及系统,能够有效减少计算资源的消耗。In order to solve the above problems, the present application provides a rendering method, device and system, which can effectively reduce the consumption of computing resources.
第一方面,提供了一种渲染方法,应用于渲染系统的渲染应用服务端,所述渲染系统还包括渲染应用客户端,所述渲染应用客户端部署于终端设备,所述渲染应用服务端部署于远程渲染节点,所述方法包括:In a first aspect, a rendering method is provided, which is applied to a rendering application server of a rendering system, the rendering system further includes a rendering application client, the rendering application client is deployed on a terminal device, and the rendering application server is deployed For remote rendering nodes, the method includes:
所述渲染应用服务端接收第一视角;The rendering application server receives the first perspective;
所述渲染应用服务端根据第一视角调用所述渲染引擎在有效网格集合中查找所述第一视角对应的有效网格,根据所述第一视角对应的有效网格的光线强度生成渲染图像,其中,所述有效网格集合为预设的视角集合对应的有效网格的集合,所述第一视角属于所述视角集合;The rendering application server calls the rendering engine according to the first viewing angle to search for the valid grid corresponding to the first viewing angle in the valid grid set, and generates a rendered image according to the light intensity of the valid grid corresponding to the first viewing angle , wherein the valid grid set is a set of valid grids corresponding to a preset viewing angle set, and the first viewing angle belongs to the viewing angle set;
所述渲染应用服务端向所述渲染应用客户端发送所述渲染图像。The rendering application server sends the rendering image to the rendering application client.
在一些可能的设计中,有效网格的光线强度是预先计算得到,并存储在所述渲染应用服务端中的。In some possible designs, the light intensity of the effective mesh is pre-computed and stored in the rendering application server.
在一些可能的设计中,所述第一视角对应的有效网格具体为:从所述第一视角对应的视点能够观察到的网格,其中,所述网格为对目标场景中的三维模型的表面进行划分得到的。In some possible designs, the valid grid corresponding to the first viewing angle is specifically: a grid that can be observed from a viewpoint corresponding to the first viewing angle, wherein the grid is a 3D model of the target scene obtained by dividing the surface.
在一些可能的设计中,所述有效网格集合为所述视角集合中的每个视角对应的有效网格构成的集合。In some possible designs, the valid grid set is a set composed of valid grids corresponding to each viewing angle in the viewing angle set.
在一些可能的设计中,所述视角集合是用户预先设置在所述渲染应用服务端的;所述视角集合是所述渲染应用服务端根据渲染应用的历史视角统计得到的;所述视角集合是所述渲染应用服务端根据渲染应用的历史视角预测得到的。In some possible designs, the perspective set is preset by the user on the rendering application server; the perspective set is obtained by the rendering application server according to historical perspective statistics of the rendering application; the perspective set is all It is predicted by the rendering application server based on the historical perspective of the rendering application.
在一些可能的设计中,所述有效网格的材料包括漫反射材料以及光学材料,在有效网格的材料为漫反射材料的情况下,所述有效网格的光线强度包括对所述有效网格进行正向光线跟踪得到的光线强度;在有效网格的材料为光学材料的情况下,所述有效网格的光线强度包括从与所述第一视角的角度相同的特定角度进行反向光线跟踪得到的光线强度。In some possible designs, the material of the effective mesh includes a diffuse reflection material and an optical material, and in the case where the material of the effective mesh is a diffuse reflection material, the light intensity of the effective mesh includes a The ray intensity obtained by performing forward ray tracing on the grid; when the material of the effective grid is an optical material, the ray intensity of the effective grid includes the backward ray from the same specific angle as the angle of the first viewing angle Trace the resulting ray intensity.
第二方面,提供了一种渲染应用服务端,所述渲染应用服务端包括:接收模块、渲染模块以及发送模块;In a second aspect, a rendering application server is provided, and the rendering application server includes: a receiving module, a rendering module, and a sending module;
所述接收模块用于接收所述渲染应用客户端发送的第一视角;The receiving module is configured to receive the first perspective sent by the rendering application client;
所述渲染模块用于根据第一视角调用所述渲染引擎在有效网格集合中查找所述第一视角对应的有效网格,根据所述第一视角对应的有效网格的光线强度生成渲染图像,其中,所述有效网格集合为预设的视角集合对应的有效网格的集合,所述第一视角属于所述视角集合;The rendering module is configured to call the rendering engine according to the first viewing angle to search for the valid grid corresponding to the first viewing angle in the valid grid set, and generate a rendered image according to the light intensity of the valid grid corresponding to the first viewing angle , wherein the valid grid set is a set of valid grids corresponding to a preset viewing angle set, and the first viewing angle belongs to the viewing angle set;
所述发送模块用于向所述渲染应用客户端发送所述渲染图像。The sending module is configured to send the rendered image to the rendering application client.
在一些可能的设计中,所述第一视角对应的有效网格具体为:从所述第一视角对应的视点能够观察到的网格,其中,所述网格为对目标场景中的三维模型的表面进行划分得到的。In some possible designs, the valid grid corresponding to the first viewing angle is specifically: a grid that can be observed from a viewpoint corresponding to the first viewing angle, wherein the grid is a 3D model of the target scene obtained by dividing the surface.
在一些可能的设计中,所述有效网格集合为所述视角集合中的每个视角对应的有效网格构成的集合。In some possible designs, the valid grid set is a set composed of valid grids corresponding to each viewing angle in the viewing angle set.
在一些可能的设计中,所述视角集合是用户预先设置在所述渲染应用服务端的;所述视角集合是所述渲染应用服务端根据渲染应用的历史视角统计得到的;所述视角集合是所述渲染应用服务端根据渲染应用的历史视角预测得到的。In some possible designs, the perspective set is preset by the user on the rendering application server; the perspective set is obtained by the rendering application server according to historical perspective statistics of the rendering application; the perspective set is all It is predicted by the rendering application server based on the historical perspective of the rendering application.
在一些可能的设计中,所述有效网格的材料包括漫反射材料以及光学材料,在有效网格的材料为漫反射材料的情况下,所述有效网格的光线强度包括对所述有效网格进行正向光线跟踪得到的光线强度;在有效网格的材料为光学材料的情况下,所述有效网格的光线强度包括从与所述第一视角的角度相同的特定角度进行反向光线跟踪得到的光线强度。In some possible designs, the material of the effective mesh includes a diffuse reflection material and an optical material, and in the case where the material of the effective mesh is a diffuse reflection material, the light intensity of the effective mesh includes a The ray intensity obtained by performing forward ray tracing on the grid; when the material of the effective grid is an optical material, the ray intensity of the effective grid includes the backward ray from the same specific angle as the angle of the first viewing angle Trace the resulting ray intensity.
第三方面,提供了一种渲染方法,应用于渲染系统,所述渲染系统包括渲染应用客户端、渲染应用服务端,所述渲染应用客户端部署于终端设备,所述渲染应用服务端部署于远程渲染节点,所述方法包括:In a third aspect, a rendering method is provided, which is applied to a rendering system, where the rendering system includes a rendering application client and a rendering application server, the rendering application client is deployed on a terminal device, and the rendering application server is deployed on A remote rendering node, the method includes:
所述渲染应用客户端发送第一视角The rendering application client sends the first perspective
所述渲染应用服务端接收所述第一视角;根据第一视角调用所述渲染引擎在有效网格集合中查找所述第一视角对应的有效网格,根据所述第一视角对应的有效网格的光线强度生成渲染图像;发送所述渲染图像;其中,所述有效网格集合为预设的视角集合对应的有效网格的集合,所述第一视角属于所述视角集合;The rendering application server receives the first viewing angle; according to the first viewing angle, the rendering engine is called to search for the valid grid corresponding to the first viewing angle in the valid grid set, and the valid grid corresponding to the first viewing angle is based on the first viewing angle. generating a rendered image based on the light intensity of the grid; sending the rendered image; wherein, the valid grid set is a set of valid grids corresponding to a preset viewing angle set, and the first viewing angle belongs to the viewing angle set;
所述渲染应用客户端接收所述渲染图像。The rendering application client receives the rendered image.
在一些可能的设计中,所述第一视角对应的有效网格具体为:从所述第一视角对应的视点能够观察到的网格,其中,所述网格为对目标场景中的三维模型的表面进行划分得到的。In some possible designs, the valid grid corresponding to the first viewing angle is specifically: a grid that can be observed from a viewpoint corresponding to the first viewing angle, wherein the grid is a 3D model of the target scene obtained by dividing the surface.
在一些可能的设计中,所述有效网格集合为所述视角集合中的每个视角对应的有效网格构成的集合。In some possible designs, the valid grid set is a set composed of valid grids corresponding to each viewing angle in the viewing angle set.
在一些可能的设计中,所述视角集合是用户预先设置在所述渲染应用服务端的;所述视角集合是所述渲染应用服务端根据渲染应用的历史视角统计得到的;所述视角集合是所述渲染应用服务端根据渲染应用的历史视角预测得到的。In some possible designs, the perspective set is preset by the user on the rendering application server; the perspective set is obtained by the rendering application server according to historical perspective statistics of the rendering application; the perspective set is all It is predicted by the rendering application server based on the historical perspective of the rendering application.
在一些可能的设计中,所述有效网格的材料包括漫反射材料以及光学材料,在有效网格的材料为漫反射材料的情况下,所述有效网格的光线强度包括对所述有效网格进行正向光线跟踪得到的光线强度;在有效网格的材料为光学材料的情况下,所述有效网格的光线强度包括从与所述第一视角的角度相同的特定角度进行反向光线跟踪得到的光线强度。In some possible designs, the material of the effective mesh includes a diffuse reflection material and an optical material, and in the case where the material of the effective mesh is a diffuse reflection material, the light intensity of the effective mesh includes a The ray intensity obtained by performing forward ray tracing on the grid; when the material of the effective grid is an optical material, the ray intensity of the effective grid includes the backward ray from the same specific angle as the angle of the first viewing angle Trace the resulting ray intensity.
第四方面,提供了一种渲染系统,包括渲染应用服务端、渲染应用客户端、渲染引擎,所述渲染应用客户端部署于终端设备,所述渲染应用服务端和所述渲染引擎部署于远程渲染 节点;In a fourth aspect, a rendering system is provided, including 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 render node;
所述渲染应用服务端,用于接收第一视角;根据第一视角调用所述渲染引擎在有效网格集合中查找所述第一视角对应的有效网格,根据所述第一视角对应的有效网格的光线强度生成渲染图像;发送所述渲染图像;其中,所述有效网格集合为预设的视角集合对应的有效网格的集合,所述第一视角属于所述视角集合;The rendering application server is used to receive a first view angle; according to the first view angle, the rendering engine is called to search for the valid grid corresponding to the first view angle in the valid grid set, and the valid grid corresponding to the first view angle is called according to the first view angle. generating a rendered image based on the light intensity of the grid; sending the rendered image; wherein, the valid grid set is a set of valid grids corresponding to a preset viewing angle set, and the first viewing angle belongs to the viewing angle set;
所述渲染应用客户端,用于发送所述第一视角以及接收所述渲染图像。The rendering application client is configured to send the first viewing angle and receive the rendered image.
在一些可能的设计中,所述第一视角对应的有效网格具体为:从所述第一视角对应的视点能够观察到的网格,其中,所述网格为对目标场景中的三维模型的表面进行划分得到的。In some possible designs, the valid grid corresponding to the first viewing angle is specifically: a grid that can be observed from a viewpoint corresponding to the first viewing angle, wherein the grid is a 3D model of the target scene obtained by dividing the surface.
在一些可能的设计中,所述有效网格集合为所述视角集合中的每个视角对应的有效网格构成的集合。In some possible designs, the valid grid set is a set composed of valid grids corresponding to each viewing angle in the viewing angle set.
在一些可能的设计中,所述视角集合是用户预先设置在所述渲染应用服务端的;所述视角集合是所述渲染应用服务端根据渲染应用的历史视角统计得到的;所述视角集合是所述渲染应用服务端根据渲染应用的历史视角预测得到的。In some possible designs, the perspective set is preset by the user on the rendering application server; the perspective set is obtained by the rendering application server according to historical perspective statistics of the rendering application; the perspective set is all It is predicted by the rendering application server based on the historical perspective of the rendering application.
在一些可能的设计中,所述有效网格的材料包括漫反射材料以及光学材料,在有效网格的材料为漫反射材料的情况下,所述有效网格的光线强度包括对所述有效网格进行正向光线跟踪得到的光线强度;在有效网格的材料为光学材料的情况下,所述有效网格的光线强度包括从与所述第一视角的角度相同的特定角度进行反向光线跟踪得到的光线强度。In some possible designs, the material of the effective mesh includes a diffuse reflection material and an optical material, and in the case where the material of the effective mesh is a diffuse reflection material, the light intensity of the effective mesh includes a The ray intensity obtained by performing forward ray tracing on the grid; when the material of the effective grid is an optical material, the ray intensity of the effective grid includes the backward ray from the same specific angle as the angle of the first viewing angle Trace the resulting ray intensity.
第五方面,提供了一种计算节点,所述计算节点包括处理器以及存储器,所述处理器执行所述存储器中的程序,从而执行如第一方面任一项所述的方法。In a fifth aspect, a computing node is provided, the computing node includes a processor and a memory, and the processor executes a program in the memory, thereby performing the method according to any one of the first aspects.
第六方面,提供了一种计算机可读存储介质,其特征在于,包括指令,当所述指令在计算节点上运行时,使得所述计算节点执行如第一方面任一项所述的方法。In a sixth aspect, a computer-readable storage medium is provided, characterized by comprising instructions, when the instructions are executed on a computing node, the computing node causes the computing node to execute the method according to any one of the first aspects.
上述方案中,所述渲染应用服务端根据第一视角从有效网格集合中查找到对应的有效网格,并根据有效网格的光线强度计算得到渲染图像,能够比传统的光线跟踪渲染有效节约计算资源。In the above solution, the rendering application server finds the corresponding valid grid from the valid grid set according to the first viewing angle, and calculates the rendered image according to the light intensity of the valid grid, which can effectively save more than traditional ray tracing rendering. computing resources.
附图说明Description of drawings
为了更清楚地说明本申请实施例或背景技术中的技术方案,下面将对本申请实施例或背景技术中所需要使用的附图进行说明。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the accompanying drawings required in the embodiments or the background technology of the present application will be described below.
图1A-图1B是本申请提供的一些渲染系统的结构示意图;1A-1B are schematic structural diagrams of some rendering systems provided by the present application;
图2是本申请涉及的从不同角度观察目标场景的结构示意图;2 is a schematic structural diagram of observing a target scene from different angles involved in the present application;
图3是本申请提供的逆向光线跟踪的示意图;3 is a schematic diagram of reverse ray tracing provided by the present application;
图4A-图4B是本申请提供的一些网格的示意图;4A-4B are schematic diagrams of some grids provided by this application;
图5是本申请提供的观察目标场景的视角的示意图;5 is a schematic diagram of a viewing angle of an observation target scene provided by the present application;
图6是本申请提供的视点E发出的N条光线与目标场景中的M个网格进行求交的示意图;6 is a schematic diagram of N rays emitted by viewpoint E provided by the present application and M grids in the target scene for intersection;
图7A-图7D是本申请提供的一些正向光线跟踪的示意图;7A-7D are schematic diagrams of some forward ray tracings provided by this application;
图8是本申请提供的每个单位面积采样得到的光线的数量的示意图;8 is a schematic diagram of the number of rays obtained by sampling per unit area provided by the present application;
图9A-图9B是本申请提供的反向光线追踪渲染的示意图;9A-9B are schematic diagrams of reverse ray tracing rendering provided by the present application;
图10是本申请提供的反向光线追踪渲染的角度的示意图;10 is a schematic diagram of the angle of reverse ray tracing rendering provided by the present application;
图11是本申请提供的从视点E发出的光线与三维模型相交的示意图;11 is a schematic diagram of the intersection of a light ray emitted from a viewpoint E and a three-dimensional model provided by the present application;
图12是本申请提供的一种渲染方法的流程交互图;FIG. 12 is a flow interaction diagram of a rendering method provided by the present application;
图13是本申请提供的另一种渲染方法的流程交互图;FIG. 13 is a flow interaction diagram of another rendering method provided by the present application;
图14是本申请提供的一种渲染应用服务端的结构示意图。FIG. 14 is a schematic structural diagram of a rendering application server provided by the present application.
具体实施方式Detailed ways
参见图1A,图1A是本申请涉及的一种渲染系统的结构示意图。本申请的渲染系统用于通过渲染方法对目标场景的3D模型进行渲染得到的2D图像,即渲染图像。其中,渲染方法可以包括光栅化渲染以及光线跟踪渲染等等。图1A提供的渲染系统可以包括:多个终端设备110、网络设备120以及远程渲染平台130。远程渲染平台130具体可以部署在公有云上。远程渲染平台130和终端设备一般部署在不同的数据中心乃至地理区域内。Referring to FIG. 1A , FIG. 1A is a schematic structural diagram of a rendering system involved in the present application. The rendering system of the present application is used for a 2D image obtained by rendering a 3D model of a target scene through a rendering method, that is, a rendered image. The rendering method may include rasterization rendering, ray tracing rendering, and the like. The rendering system provided in FIG. 1A may include: a plurality of terminal devices 110 , a network device 120 and a remote rendering platform 130 . Specifically, the remote rendering platform 130 may be deployed on a public cloud. The remote rendering platform 130 and terminal devices are generally deployed in different data centers or even geographic areas.
终端设备110可以是需要显示渲染图像的设备,例如,可以是用于飞行训练的虚拟现实设备(virtual reality,VR),可以是用于虚拟游戏的电脑以及用于虚拟商城的智能手机等等,此处不作具体限定。终端设备可以是高配置、高性能(例如,多核、高主频、内存大等等)的设备,也可以是低配置,低性能(例如,单核、低主频、内存小等等)的设备。在一具体的实施例中,终端设备110上运行有操作系统以及渲染应用客户端。The terminal device 110 may be a device that needs to display a rendered image, for example, a virtual reality device (virtual reality, VR) used for flight training, a computer used for virtual games, a smart phone used in a virtual mall, and the like, There is no specific limitation here. The terminal device can be a device with high configuration and high performance (for example, multi-core, high frequency, large memory, etc.), or a device with low configuration and low performance (for example, single core, low frequency, small memory, etc.) equipment. In a specific embodiment, the terminal device 110 runs an operating system and a rendering application client.
网络设备120用于在终端设备110通过任何通信机制/通信标准的通信网络与远程渲染平台130之间传输数据。其中,通信网络可以是广域网、局域网、点对点连接等方式,或它们的任意组合。The network device 120 is used to transmit data between the terminal device 110 and the remote rendering platform 130 through a communication network of any communication mechanism/communication standard. The communication network may be a wide area network, a local area network, a point-to-point connection, etc., or any combination thereof.
远程渲染平台130包括多个渲染节点,每个渲染节点自下而上包括渲染硬件、操作系统、渲染引擎以及渲染应用服务端。其中,渲染硬件包括计算资源、存储资源以及网络资源。The remote rendering platform 130 includes a plurality of rendering nodes, and each rendering node includes rendering hardware, an operating system, a rendering engine, and a rendering application server from bottom to top. The rendering hardware includes computing resources, storage resources, and network resources.
计算资源可以采用异构计算架构,例如,可以采用中央处理器(central processing unit,CPU)+图形处理器(graphics processing unit,GPU)架构,CPU+AI芯片,CPU+GPU+AI芯片架构等等,此处不作具体限定。存储资源可以包括内存等等。这里,计算资源可以被分成多个计算单位资源,存储资源可以被分成多个存储单位资源,网络资源可以被分成多个网络单位资源。因此,远程渲染平台130可以按照用户的资源需求以单位资源为基础进行自由组合,从而用户的需要提供资源。例如,通过虚拟化服务按照用户的需要灵活地隔离出相互独立的资源以运行渲染引擎和/或渲染应用服务端。常见地,虚拟化服务可以隔离出虚拟机(virtual machine,VM)服务、裸金属服务器(bare metal server,BMS)服务以及容器(container)等独立的计算资源。渲染引擎可以用于实现图像渲染算法。渲染引擎允许渲染应用按照其接口调用渲染引擎内置的渲染算法(管道)来完成图像渲染。渲染应用服务端可以用于调用渲染引擎以完成渲染图像的渲染。The computing resources can adopt a heterogeneous computing architecture, for example, a central processing unit (CPU) + graphics processing unit (GPU) architecture, CPU+AI chip, CPU+GPU+AI chip architecture, etc. , which is not specifically limited here. Storage resources can include memory and so on. Here, computing resources may be divided into multiple computing unit resources, storage resources may be divided into multiple storage unit resources, and network resources may be divided into multiple network unit resources. Therefore, the remote rendering platform 130 can freely combine resources according to the user's resource requirements on the basis of unit resources, so as to provide resources according to the user's needs. For example, the virtualized service can flexibly isolate mutually independent resources according to the user's needs to run the rendering engine and/or the rendering application server. Generally, virtualization services can isolate independent computing resources such as virtual machine (VM) services, bare metal server (BMS) services, and containers (containers). A rendering engine can be used to implement image rendering algorithms. The rendering engine allows the rendering application to call the rendering algorithm (pipeline) built into the rendering engine according to its interface to complete the image rendering. The rendering application server can be used to call the rendering engine to complete the rendering of the rendered image.
终端设备110上运行的渲染应用客户端和远程渲染平台130上运行的渲染应用服务端分别构成了渲染应用的前端和后端。其中,常见的渲染应用可以包括:游戏应用、VR应用、电影特效以及动画等等。渲染应用可以通过调用渲染引擎进行实时图像渲染,从而得到渲染图像。The rendering application client running on the terminal device 110 and the rendering application server running on the remote rendering platform 130 respectively constitute the front end and the back end of the rendering application. Among them, common rendering applications may include: game applications, VR applications, movie special effects, animation, and so on. The rendering application can perform real-time image rendering by invoking the rendering engine, thereby obtaining the rendered image.
在一具体的实施方式中,渲染应用服务端和渲染应用客户端可以是渲染应用提供商提供的,渲染引擎可以是云服务提供商提供的。举个例子说明,渲染应用可以是游戏应用,游戏应用的游戏开发商将游戏应用服务端安装在云服务提供商提供的远程渲染平台上,游戏应用的游戏开发商将游戏应用客户端通过互联网提供给用户下载,并安装在用户的终端设备上。 此外,云服务提供商还提供了渲染引擎,渲染引擎可以为游戏应用提供计算能力。在另一种具体的实施方式中,渲染应用客户端、渲染应用服务端和渲染引擎可以均是云服务提供商提供的。In a specific implementation manner, the rendering application server and the rendering application client may be provided by a rendering application provider, and the rendering engine may be provided by a cloud service provider. For example, the rendering application can be a game application. The game application developer installs the game application server on the remote rendering platform provided by the cloud service provider, and the game application game developer provides the game application client through the Internet. Download it to the user and install it on the user's terminal device. In addition, cloud service providers also provide rendering engines, which can provide computing power for game applications. In another specific implementation, the rendering application client, the rendering application server and the rendering engine may all be provided by a cloud service provider.
在图1B所示的云渲染系统中,还包括管理设备140。管理设备140上可以是用户的终端设备和云服务提供商的远程渲染平台130之外的第三方提供的设备,也可以部署和远程渲染平台130一起部署在公有云上。例如,管理设备140可以是渲染应用提供商提供的。渲染应用提供商可以通过管理设备140对渲染应用进行管理,例如,渲染应用提供商可以通过管理设备140指定渲染应用服务端向渲染应用客户端提供的初始的渲染图像的质量参数等等。In the cloud rendering system shown in FIG. 1B , a management device 140 is also included. The management device 140 may be a user's terminal device and a device provided by a third party other than the remote rendering platform 130 of the cloud service provider, or may be deployed on a public cloud together with the remote rendering platform 130 . For example, the management device 140 may be provided by a rendering application provider. The rendering application provider may manage the rendering application through the management device 140. For example, the rendering application provider may specify, through the management device 140, the quality parameters of the initial rendered image provided by the rendering application server to the rendering application client, and so on.
在多用户参与的虚拟场景中,为了能够让每个用户都产生置身其中的真实感,往往不同的用户需要的是从不同的角度生成的同一个目标场景的渲染图像。如图2所示,假设目标场景如图2中的(a)所示,当使用终端设备1的第一用户从第一视角进行观察时,需要生成的渲染图像如图2中的(b)所示,当使用终端设备2的第二用户从第二视角进行观察时,需要生成的渲染图像如图2中的(c)所示。那么,终端设备1和终端设备2可以分别独立地对目标场景进行光线跟踪渲染(ray tracing render),从而得到不同角度的渲染图像。具体地,In a virtual scene in which multiple users participate, in order to make each user feel realistic, different users often need rendered images of the same target scene generated from different angles. As shown in FIG. 2 , assuming that the target scene is shown in (a) of FIG. 2 , when the first user using the terminal device 1 observes from the first perspective, the rendered image that needs to be generated is shown in (b) of FIG. 2 As shown, when a second user using the terminal device 2 observes from a second perspective, a rendered image that needs to be generated is shown in (c) of FIG. 2 . Then, the terminal device 1 and the terminal device 2 can independently perform ray tracing rendering on the target scene, thereby obtaining rendered images from different angles. specifically,
终端设备1通过网络设备120向远程渲染平台130发出第一渲染请求,远程渲染平台130调用渲染引擎根据第一渲染请求从第一用户的视角出发采用光线跟踪渲染单独对目标场景进行光线跟踪,从而得到第一用户的视角生成的该目标场景的渲染图像。The terminal device 1 sends a first rendering request to the remote rendering platform 130 through the network device 120, and the remote rendering platform 130 invokes the rendering engine to independently perform ray tracing on the target scene using ray tracing rendering from the perspective of the first user according to the first rendering request, thereby A rendered image of the target scene generated from the perspective of the first user is obtained.
终端设备2通过网络设备120向远程渲染平台130发出第二渲染请求,远程渲染平台130调用渲染引擎根据第二渲染请求从第二用户的视角出发采用光线跟踪渲染单独对目标场景进行光线跟踪,从而得到第二用户的视角生成的该目标场景的渲染图像。The terminal device 2 sends a second rendering request to the remote rendering platform 130 through the network device 120, and the remote rendering platform 130 invokes the rendering engine to independently perform ray tracing on the target scene using ray tracing rendering from the perspective of the second user according to the second rendering request, thereby A rendered image of the target scene generated from the second user's perspective is obtained.
但是,从第一用户的视角生成的渲染图像和从第二用户的视角生成的渲染图像存在大量的重复计算,从而导致大量的计算资源被浪费。However, there are a lot of repeated computations between the rendered image generated from the perspective of the first user and the rendered image generated from the perspective of the second user, thereby causing a lot of wasted computing resources.
下面将详细对终端设备1以及终端设备2采用的光线跟踪渲染方法进行详细的介绍。光线跟踪渲染是通过跟踪沿从相机(或者人眼)的视点朝着渲染图像的每个像素发射的光线入射目标场景的光的路径来产生渲染图像的渲染方法。其中,目标场景包括光源以及三维模型。光线追踪渲染的核心思想在于,从相机(或者人眼)的视点(当视点确定时,视角自然也确定了)出发,逆向跟踪光线。由于只有最后能够进入相机(或者人眼)的光线才是有用的,因此,逆向跟踪光线能够有效减少数据量。The ray tracing rendering method adopted by the terminal device 1 and the terminal device 2 will be described in detail below. Ray-traced rendering is a rendering method that produces a rendered image by tracing the path of light entering a target scene along the path of light emitted from a camera's (or human eye's) viewpoint toward each pixel of the rendered image. The target scene includes a light source and a three-dimensional model. The core idea of ray tracing rendering is to trace rays backward from the viewpoint of the camera (or human eye) (when the viewpoint is determined, the angle of view is naturally determined). Since only the rays that finally enter the camera (or the human eye) are useful, backtracing rays can effectively reduce the amount of data.
如图3所示,假设目标场景只有一个光源311以及一个不透明球体312。从相机313的视点E发出一条光线,投射到渲染图像314的像素点O 1上,然后,继续出射到不透明球体312的一个点P 1,然后,被反射到光源L,此时,点P 1的光线强度和颜色决定了像素点O 1的光线强度和颜色。从相机311的视点E发出另一条光线,投射到渲染图像314中的另一个像素点O 2,然后,继续出射到不透明球体312的一个点P 2,然后,被反射到光源L,并且,点P 2和光源L之间存在障碍物不透明球体312,此时,点P 2位于不透明球体312的阴影中,像素点O 2的光线强度为零,颜色为黑色。 As shown in FIG. 3 , it is assumed that the target scene has only one light source 311 and one opaque sphere 312 . A ray of light is emitted from the viewpoint E of the camera 313, projected on the pixel point O 1 of the rendered image 314, and then continues to be emitted to a point P 1 of the opaque sphere 312, and then reflected to the light source L, at this time, the point P 1 The light intensity and color of pixel O 1 determine the light intensity and color. Another ray from the viewpoint E of the camera 311 is projected to another pixel point O 2 in the rendered image 314 , and then continues to a point P 2 of the opaque sphere 312 , and is then reflected to the light source L, and the point There is an obstacle opaque sphere 312 between P 2 and the light source L. At this time, the point P 2 is located in the shadow of the opaque sphere 312, the light intensity of the pixel point O 2 is zero, and the color is black.
可以理解,图3中假设目标场景中仅仅存在一个不透明球体,在实际应用中,目标场景远远比图3要复杂,例如,目标场景中可能同时存在多个不透明物体以及多个透明物体,因此,光线会被多次反射、折射和透射,从而导致光线的跟踪变得非常复杂,对计算资源的消 耗非常大。并且,在上述实施例中,是以渲染系统只包括终端设备1以及终端设备2为例进行说明的,但是,在实际应用中,终端设备的数量远远不止两个,不同终端设备的用户的视角往往都是不一样的,因此,随着用户数量的增多,需要生成的不同视角的渲染图像的数量也随之增多,计算量会非常庞大。It can be understood that in Figure 3, it is assumed that there is only one opaque sphere in the target scene. In practical applications, the target scene is far more complicated than Figure 3. For example, there may be multiple opaque objects and multiple transparent objects in the target scene at the same time. Therefore, , the ray will be reflected, refracted and transmitted multiple times, which makes the ray tracing very complicated and consumes a lot of computing resources. Moreover, in the above-mentioned embodiment, the rendering system only includes the terminal device 1 and the terminal device 2 as an example for description, but in practical applications, the number of terminal devices is far more than two, and the user's The viewing angles are often different. Therefore, as the number of users increases, the number of rendered images of different viewing angles that need to be generated also increases, and the amount of calculation is very large.
假设目标场景中存在一个或者多个光源,以及,一个或者多个三维模型。光源产生的光线照射到三维模型上。其中,光源可以是点光源、线光源或者面光源等等。三维模型的形状可以是多种多样的,例如,可以是球体、锥体、曲面物体、平面物体以及表面不规则物体等等。It is assumed that there are one or more light sources and one or more three-dimensional models in the target scene. The light produced by the light source strikes the 3D model. The light source may be a point light source, a line light source, or a surface light source, or the like. The shape of the three-dimensional model can be various, for example, it can be a sphere, a cone, a curved object, a plane object, an object with irregular surface, and so on.
将目标场景中的三维模型的表面分割成大量的网格。即,网格是场景中的三维模型的表面的部分区域。其中,形状不同的三维模型的网格的形状可以是不同的,例如,球体的网格和曲面物体的网格的形状可以完全不同。网格可以具有唯一的网格标识。下面将分别结合具体的实施例对网格进行说明。Divide the surface of the 3D model in the target scene into a large number of meshes. That is, the mesh is a partial area of the surface of the three-dimensional model in the scene. The shapes of the meshes of the three-dimensional models with different shapes may be different, for example, the shapes of the meshes of the sphere and the meshes of the curved objects may be completely different. Grids can have unique grid IDs. The grid will be described below with reference to specific embodiments.
如图4A所示,以三维模型为球体为例,网格可以表示为中心点P(r,θ,
Figure PCTCN2021129464-appb-000001
)以及中心点P(r,θ,
Figure PCTCN2021129464-appb-000002
)邻域的点构成的球体表面上的四边略鼓的近似方块。以球体的球心作为原点构建三维正交坐标系,其中,三维正交坐标系包括x轴,y轴以及z轴。中心点P的各个坐标中,r表示为球心O至中心点P的线段OP的长度,θ表示为线段OP与正z轴之间的夹角,
Figure PCTCN2021129464-appb-000003
表示为线段OP在xoy平面上的投影与x轴之间的夹角。在一具体的实施例中,可以在球体上均匀地设置n个中心点P 1,P 2,…,P n,如果非中心点Q j与中心点P i的距离最短,则非中心点Q j与中心点P i属于同一个网格。
As shown in Figure 4A, taking the 3D model as a sphere as an example, the grid can be represented as the center point P(r, θ,
Figure PCTCN2021129464-appb-000001
) and the center point P(r, θ,
Figure PCTCN2021129464-appb-000002
) is an approximate square with slightly bulging sides on the surface of the sphere formed by the points in the neighborhood. A three-dimensional orthogonal coordinate system is constructed with the center of the sphere as the origin, wherein the three-dimensional orthogonal coordinate system includes an x-axis, a y-axis and a z-axis. Among the coordinates of the center point P, r represents the length of the line segment OP from the center of the sphere O to the center point P, and θ represents the angle between the line segment OP and the positive z-axis,
Figure PCTCN2021129464-appb-000003
Expressed as the angle between the projection of the line segment OP on the xoy plane and the x-axis. In a specific embodiment, n center points P 1 , P 2 , . . . , P n can be uniformly set on the sphere . j and the center point P i belong to the same grid.
如图4B所示,以三维模型为曲面物体为例,网格可以表示为P(u,t)所代表的曲面表面上的方块。以曲面的一个设定原点构建二维正交坐标系,其中,坐标系包括u轴,t轴。u表示为曲面设定原点一个方向的偏移量,t表示另一个正交方向的偏移量,P(u,t)表示如图4B所示的(u,t)坐标系中四个顶点所组成的方块。As shown in FIG. 4B , taking the 3D model as a curved object as an example, the mesh can be represented as a square on the curved surface represented by P(u, t). A two-dimensional orthogonal coordinate system is constructed with a set origin of the surface, wherein the coordinate system includes the u-axis and the t-axis. u represents the offset in one direction of the origin set for the surface, t represents the offset in another orthogonal direction, and P(u, t) represents the four vertices in the (u, t) coordinate system as shown in Figure 4B composed of blocks.
可以理解,上述的网格的形状仅仅是作为具体的举例,在实际应用中,网格还可能是其他的形状,例如,六边形等等,此处不作具体限定。另外,网格的大小可以根据需要进行设置,当精度要求越高,网格的大小可以设置得越小,当精度要求越低,网格的大小可以设置得越大。It can be understood that the above-mentioned shapes of the meshes are only used as specific examples, and in practical applications, the meshes may also have other shapes, such as hexagons, etc., which are not specifically limited here. In addition, the size of the grid can be set as required. When the accuracy requirement is higher, the grid size can be set smaller, and when the accuracy requirement is lower, the grid size can be set larger.
确定用户观察目标场景的视角集合。其中,视角集合中可以包括一个视角或者多个视角。如图5所示,对于单个视点E来说,该视点E的视角可以表示为(P,θ),其中,P为视点E到渲染图像的垂直距离,θ为该视点E到渲染图像的中心点O的连线与水平线的夹角。视角集合中的视角可以是同一个用户在不同时刻的各个视角,可以是不同用户在同一时刻的各个视角,可以是多个用户在不同时刻的各个视角等等。其中,视角集合的确定方法至少包括如下几种:Determine the set of viewpoints from which the user observes the target scene. The perspective set may include one perspective or multiple perspectives. As shown in Figure 5, for a single viewpoint E, the viewing angle of the viewpoint E can be expressed as (P, θ), where P is the vertical distance from the viewpoint E to the rendered image, and θ is the viewpoint E to the center of the rendered image The angle between the line connecting point O and the horizontal line. The perspectives in the perspective set may be various perspectives of the same user at different moments, various perspectives of different users at the same moment, various perspectives of multiple users at different moments, and so on. Among them, the method for determining the view set includes at least the following:
在第一种方式中,视角集合可以是预先设置的。也就是说,视角集合中的每个视角均是用户预先设置的。例如,远程渲染平台可以收集不同终端设备的用户在同一时刻的各个视角,并预先设置为视角集合。或者,渲染应用为游戏应用时,游戏应用给出了特定的游戏路径,远程渲染平台可以收集用户在该特定的游戏路径中的各个视角,并预先设置为视角集合。In the first way, the set of views may be preset. That is to say, each view angle in the view angle set is preset by the user. For example, the remote rendering platform can collect various perspectives of users of different terminal devices at the same time, and set them as a perspective set in advance. Alternatively, when the rendering application is a game application, the game application provides a specific game path, and the remote rendering platform can collect various perspectives of the user in the specific game path, and preset them as a perspective set.
在第二种方式中,视角集合可以是统计得到的。例如,可以对多个历史视角进行统计, 并将出现概率大于预设阈值的历史视角设置为视角集合。这里,对多个历史视角进行统计可以采用正态分布、泊松分布等等。In the second approach, the set of views may be statistically derived. For example, a plurality of historical perspectives may be counted, and historical perspectives whose occurrence probability is greater than a preset threshold may be set as a perspective set. Here, a normal distribution, a Poisson distribution, etc. may be used to perform statistics on multiple historical perspectives.
在第三种方式中,视角集合可以是预测得到的。例如,渲染应用为游戏应用时,可以根据游戏应用给出的已有游戏路径通过预测算法预测之后的游戏路径,并将预测得到的游戏路径的可能出现的视角设置为视角集合。这里,预测算法可以包括:决策树算法、人工神经网络以及支持向量机等等。In a third approach, the set of views can be predicted. For example, when the rendering application is a game application, the subsequent game path can be predicted by a prediction algorithm according to the existing game path given by the game application, and the possible viewing angles of the predicted game path can be set as the viewing angle set. Here, the prediction algorithm may include: decision tree algorithm, artificial neural network, support vector machine and so on.
应理解,上述视角集合的确定方法仅仅是作为具体的实施例,在实际应用中,视角集合还可以通过迭代的方式确定的,例如,渲染应用为游戏应用时,如果游戏场景发生切换,则每个游戏场景的视角都会发生变化,因此,每次游戏场景发生切换时,每个游戏场景的视角集合都会产生迭代。It should be understood that the above method for determining the perspective set is only a specific example. In practical applications, the perspective set can also be determined in an iterative manner. For example, when the rendering application is a game application, if the game scene is switched, each The perspective of each game scene changes, so each game scene's perspective collection is iterated over each game scene switch.
在所述多个网格中确定所述视角集合对应的K个有效网格。以视角集合中的一个视角为例,该视角对应的有效网格具体该视角对应的视点能够观察到的网格。如图6所示,从该视角对应的视点E出发,向渲染图像的每个像素点发射每单位像素的采样数的光线。也就是说,从该视点E发出的总光线数N=渲染图像的宽度像素*渲染图像的高度像素*每单位像素的采样数的光线。需要说明的是,为了便于观察,图6仅仅示出了从该视点E向渲染图像的四个角像素点发出的一条光线,其他光线均被省略。将从该视点E发出的N条光线与目标场景中的M个网格进行求交。如果第i条光线和第j个网格相交,则该第j个网格为有效网格,其中,1≤i≤N,1≤j≤M,i,j,N,M均为正整数。相反,如果视角集合中任意一个视角产生的光线都没和第j个网格相交,那么,该第j个网格为无效网格。为了减少数据量,有效网格只需存储一次,例如,如果第i条光线和第j个网格相交,第i+1条光线也和第j个网格相交,那么第j个网格只需要被存储一次即可,而,无效网格不需要被存储。在对有效网格进行存储时,可以只存储有效网格的网格标识以及有效网格所在的三维模型的标识,也可以存储有效网格的网格标识、有效网格所在的三维模型的标识、有效网格的空间坐标、入射有效网格的光线的方向等等。K valid grids corresponding to the viewing angle set are determined from the plurality of grids. Taking a viewing angle in the viewing angle set as an example, the valid grid corresponding to the viewing angle is specifically the grid that can be observed by the viewpoint corresponding to the viewing angle. As shown in FIG. 6 , starting from the viewpoint E corresponding to the viewing angle, light rays with the number of samples per unit pixel are emitted to each pixel of the rendered image. That is, the total number of rays emitted from this viewpoint E = the width pixels of the rendered image * the height pixels of the rendered image * the rays of the number of samples per unit pixel. It should be noted that, for the convenience of observation, FIG. 6 only shows one ray emitted from the viewpoint E to the four corner pixels of the rendered image, and other rays are omitted. N rays emanating from this viewpoint E are intersected with M meshes in the target scene. If the i-th ray intersects the j-th grid, the j-th grid is a valid grid, where 1≤i≤N, 1≤j≤M, i, j, N, M are all positive integers . Conversely, if the rays generated by any viewing angle in the viewing angle set do not intersect the jth grid, then the jth grid is an invalid grid. To reduce the amount of data, valid grids only need to be stored once. For example, if the i-th ray intersects the j-th grid, and the i+1-th ray also intersects the j-th grid, then the j-th grid only needs to be stored once. It needs to be stored once, and invalid meshes do not need to be stored. When storing the valid grid, only the grid ID of the valid grid and the ID of the 3D model where the valid grid is located can be stored, or the grid ID of the valid grid and the ID of the 3D model where the valid grid is located can be stored. , the spatial coordinates of the effective grid, the direction of rays entering the effective grid, and so on.
有效网格的材料可以包括漫反射材料以及光学材料。其中,漫反射材料通常是表面比较粗糙的材料,例如,布料、纸张、木材以及岩石等等。光学材料通常是表面比较光滑的材料,或者,透明的材料,例如,湖面、镜面以及露珠等等。以第k个有效网格为例,如果第k个有效网格为漫反射材料,那么从目标场景中的光源出发,向该有效网格发射光线,并对光线进行正向光线跟踪;如果第k个有效网格为光学材料,则从多个角度对该第k个有效网格进行反向光线跟踪。其中,Materials for effective meshes can include diffusely reflective materials as well as optical materials. Among them, the diffuse reflection material is usually a material with a relatively rough surface, such as cloth, paper, wood, and rock. Optical materials are usually materials with relatively smooth surfaces, or transparent materials, such as lake surfaces, mirror surfaces, and dewdrops. Taking the kth effective mesh as an example, if the kth effective mesh is a diffuse material, then from the light source in the target scene, light is emitted to the effective mesh, and forward ray tracing is performed on the light; The k-th effective meshes are optical materials, and reverse ray tracing is performed on the k-th effective meshes from multiple angles. in,
正向光线跟踪是指从光源出发,正向跟踪光线在目标场景中的传递过程。正向光线跟踪主要存在反射、折射、透射以及直射四种场景,下面将分别结合图7A-图7D以及具体的实施例进行说明。Forward ray tracing refers to starting from the light source and forward tracing the transfer process of rays in the target scene. There are mainly four scenarios in forward ray tracing: reflection, refraction, transmission, and direct illumination, which will be described below with reference to FIGS. 7A-7D and specific embodiments, respectively.
如图7A所示,假设目标场景为反射场景时,假设目标场景只有一个光源411、不透明球体412以及不透明球体413。从光源411发出一条光线,投射到不透明球体412的一个点P 1上,然后,被反射到不透明球体413的一个中心点为点Q 1的有效网格上。因此,可以通过局部光照明模型计算光源411产生的光线在不透明球体412的点P 1上产生的光线强度,然后,继续跟踪光线被不透明球体412反射之后在不透明球体413的中心点为点Q 1的有效网格上产生的 光线强度。 As shown in FIG. 7A , when it is assumed that the target scene is a reflection scene, it is assumed that the target scene has only one light source 411 , an opaque sphere 412 and an opaque sphere 413 . A ray of light is emitted from the light source 411, projected onto a point P1 of the opaque sphere 412, and then reflected onto an effective grid whose center point is the point Q1 of the opaque sphere 413. Therefore, the light intensity generated by the light source 411 on the point P 1 of the opaque sphere 412 can be calculated by the local light illumination model, and then, after the light is reflected by the opaque sphere 412, the center point of the opaque sphere 413 is the point Q 1 The intensity of light produced on the effective mesh of .
如图7B所示,假设目标场景为折射场景时,假设目标场景只有一个光源421、透明球体422以及不透明球体423。从光源421发出一条光线,投射到透明球体422的一个点P 2上,然后,被折射到不透明球体423的一个中心点为点Q 2的有效网格上。因此,可以通过局部光照明模型计算光源421产生的光线在透明球体422的点P 2上产生的光线强度,然后,继续跟踪光线被透明球体422折射之后在不透明球体423的中心点为点Q 2的有效网格上产生的光线强度。 As shown in FIG. 7B , when it is assumed that the target scene is a refraction scene, it is assumed that the target scene has only one light source 421 , a transparent sphere 422 and an opaque sphere 423 . A ray of light from light source 421 is projected onto a point P2 of transparent sphere 422, and then refracted onto an effective grid of opaque sphere 423 whose center is point Q2 . Therefore, the intensity of the light generated by the light source 421 at the point P 2 of the transparent sphere 422 can be calculated through the local light illumination model, and then, after the light is refracted by the transparent sphere 422, the center point of the opaque sphere 423 is the point Q 2 The intensity of light produced on the effective mesh of .
如图7C所示,假设目标场景为透射场景时,假设目标场景只有一个光源431、透明薄体432以及不透明球体433。从光源421发出一条光线,投射到透明薄体432的一个点P 3,然后,被透射到不透明球体433的一个中心点为点Q 3的有效网格。因此,可以通过局部光照明模型计算光源431产生的光线在透明薄体432的点P 3上产生的光线强度,然后,继续跟踪光线被透明薄体432透射之后在不透明球体433的中心点为点Q 3的有效网格上产生的光线强度。 As shown in FIG. 7C , when the target scene is assumed to be a transmissive scene, it is assumed that the target scene has only one light source 431 , a transparent thin body 432 and an opaque sphere 433 . A ray of light is emitted from the light source 421, projected to a point P3 of the thin transparent body 432, and then transmitted to an effective grid having a center point of the opaque sphere 433 at point Q3 . Therefore, the light intensity of the light generated by the light source 431 at the point P3 of the transparent thin body 432 can be calculated by the local light illumination model, and then, after the light is transmitted by the transparent thin body 432, the center point of the opaque sphere 433 is set as a point The intensity of light produced on the effective grid of Q 3 .
如图7D所示,假设目标场景为直射场景时,假设目标场景只有一个光源441以及不透明球体443。从光源441发出一条光线,投射到不透明球体443的一个中心点为点Q 4的有效网格上。因此,可以通过局部光照明模型计算光源441产生的光线在不透明球体443的中心点为点Q 4的有效网格上产生的光线强度。 As shown in FIG. 7D , when it is assumed that the target scene is a direct scene, it is assumed that the target scene has only one light source 441 and an opaque sphere 443 . A ray of light is emitted from light source 441 and projected onto an effective grid of opaque sphere 443 centered at point Q4 . Therefore, the light intensity generated by the light source 441 on the effective grid whose center point is the point Q4 of the opaque sphere 443 can be calculated by the local light illumination model.
但是,上述图7A中的反射场景、图7B中的折射场景、图7C中的透射场景以及图7D的直射场景都是最简单的场景,在实际应用中,目标场景远远比图7A至图7D要复杂,例如,目标场景中可能同时存在多个不透明物体以及多个透明物体,因此,光线会被多次反射、折射和透射,另外光源可以可能不止一个,而是两个或者更多。However, the reflection scene in FIG. 7A , the refraction scene in FIG. 7B , the transmission scene in FIG. 7C and the direct scene in FIG. 7D are the simplest scenes. 7D is more complicated. For example, there may be multiple opaque objects and multiple transparent objects in the target scene at the same time. Therefore, the light will be reflected, refracted and transmitted multiple times. In addition, there may be more than one light source, but two or more.
由于光线的数量是无限的,计算资源是有限的,通常情况下,不可能对所有的光线进行正向光线跟踪,于是,需要对部分光线进行采样。Since the number of rays is infinite and computing resources are limited, it is usually impossible to perform forward ray tracing on all rays, so some rays need to be sampled.
在对正向光线跟踪的光线进行采样时,采样涉及的参数主要包括每单位空间的采样数以及光线反弹次数(Bounce)等等。下面将分别以每单位面积的采样数(sample per unit area,SPUA)以及光线反弹次数为例,进行详细的介绍。When sampling the rays of forward ray tracing, the parameters involved in the sampling mainly include the number of samples per unit space and the number of ray bounces (Bounce) and so on. The following will take the sample per unit area (SPUA) and the number of light bounces as examples for a detailed introduction.
SPUA可以定义为每个单位面积采样得到的光线的数量。以图8所示为例,以光源L为中心,构建球面S,并将球面S划分为多个单位面积,那么,SPUA等于光源L产生的光线中透过单位面积A的数量。理论上来说,单位面积通过的光源L产生的光线的数量是无穷的,但是,在实际的跟踪进行过程中,不可能对所有光线进行跟踪,只能对部分的,有限的光线进行跟踪。这里,SPUA的数量越大,跟踪的光线数量越多,图像质量也就越好,但是,计算量越大。相反,SPUA的数量越小,跟踪的光线数量越少,图像质量也就越差,但是,计算量越小。SPUA can be defined as the number of rays sampled per unit area. Taking the light source L as an example, a spherical surface S is constructed with the light source L as the center, and the spherical surface S is divided into a plurality of unit areas. Then, SPUA is equal to the amount of light generated by the light source L that passes through the unit area A. In theory, the number of rays generated by the light source L passing through a unit area is infinite. However, in the actual tracking process, it is impossible to trace all the rays, and only part of the limited rays can be traced. Here, the larger the number of SPUAs, the higher the number of rays traced, and the better the image quality, however, the greater the amount of computation. Conversely, the smaller the number of SPUAs, the lower the number of rays traced and the poorer the image quality, however, the less computation.
光线返弹次数为在光线的正向跟踪终止前,对光线进行跟踪的最大反射次数和折射次数之和。因为在复杂场景中,光线会被多次反射和折射,理论上来说,光线被反射和折射的次数可以是无限次,但是,在实际的跟踪进行过程中,不可能对光线进行无穷的跟踪,因而需要给出一些跟踪的终止条件。在应用中,可以有以下的终止条件:光线在经过许多次反射和折射以后,就会产生衰减,光线对于视点的光强贡献很小;或者,光线返弹次数即跟踪深度大于一定值。这里,光线返弹次数越多,可以被跟踪到的有效光线越多,多个透明物体之间的折射效果越好,越逼真,图像质量也就越好,但是,计算量越大。相反,光线返弹次数越少,可以被跟踪到的有效光线越少,多个透明物体之间的折射效果越差,越失真,图像质量 也就越差,但是,计算量越少。The number of ray bounces is the sum of the maximum number of reflections and refractions traced to the ray before the ray's forward tracing is terminated. Because in complex scenes, rays will be reflected and refracted multiple times. In theory, the number of times the rays are reflected and refracted can be infinite. However, in the actual tracking process, it is impossible to trace the rays infinitely. Therefore, some tracking termination conditions need to be given. In the application, there can be the following termination conditions: the light will decay after many times of reflection and refraction, and the light contribution to the light intensity of the viewpoint is very small; or, the number of ray bounces, that is, the tracking depth is greater than a certain value. Here, the more times the ray bounces, the more effective rays that can be tracked, the better the refraction effect between multiple transparent objects, the more realistic, and the better the image quality, but the greater the amount of computation. On the contrary, the less the number of ray bounces, the less effective rays that can be traced, the worse the refraction effect between multiple transparent objects, the more distorted, and the worse the image quality, but the less computation.
可以理解,上述采样参数仅仅是作为具体的示例,在实际应用中,还可以采用其他的采样参数,此处不作具体限定。It can be understood that the above sampling parameters are only used as specific examples. In practical applications, other sampling parameters may also be used, which are not specifically limited here.
在正向光线跟踪过程中,光线可能被传递至有效网格,也可能被传递至无效网格。举例子说明,光线可能先从有效网格传递至无效网格,然后,从无效网格传递至有效网格;或者,光线可能从有效网格传递至无效网格。如果被传递至有效网格,则需要对该光线在该有效网格产生的光线强度进行统计;如果被传递至无效网格,则不需要对该光线在该无效网格产生的光线强度进行统计。During forward ray tracing, rays may be passed to valid meshes or to invalid meshes. For example, a ray might pass from a valid mesh to an invalid mesh, and then from invalid mesh to valid mesh; or, a ray might pass from valid mesh to invalid mesh. If it is passed to a valid grid, the ray intensity generated by the ray in the valid grid needs to be counted; if it is passed to an invalid grid, there is no need to count the ray intensity generated by the ray in the invalid grid. .
反向光线追踪渲染是通过跟踪从特定角度进入三维模型的有效网格的光线,在目标场景中的传递至光源的过程。上述从特定角度进行反向跟踪得到的光线只有人眼或者相机处于该特定角度才能观看得到,因此,为了能够实现全视野,需要从多个特定角度进行反向光线跟踪。反向光线追踪渲染的核心思想在于,从进入有效网格的光线出发,逆向跟踪光线。反向光线追踪渲染中主要存在反射以及折射两种场景,下面将分别结合具体的实施例进行说明。Reverse ray-traced rendering is the process of passing rays into the target scene to light sources by tracing rays entering a valid mesh of a 3D model from a specific angle. The above-mentioned light rays obtained by reverse tracing from a specific angle can only be viewed by the human eye or the camera at the specific angle. Therefore, in order to achieve a full field of view, it is necessary to perform reverse ray tracing from multiple specific angles. The core idea of reverse ray traced rendering is to trace rays backward from the rays entering the valid mesh. There are mainly two scenarios of reflection and refraction in reverse ray tracing rendering, which will be described below with reference to specific embodiments.
如图9A所示,在目标场景为反射场景时,假设目标场景只有一个光源511以及一个不透明球体512。从特定角度发出一条光线,投射到不透明球体512的一个有效网格的点P 1上,然后,被反射到光源511。此时,可以通过局部光照明模型计算光源511产生的光线在不透明球体512的该有效网格上产生的光线强度。 As shown in FIG. 9A , when the target scene is a reflective scene, it is assumed that the target scene has only one light source 511 and one opaque sphere 512 . A ray of light is emitted from a specific angle, projected onto a point P 1 of a valid grid of opaque sphere 512 , and then reflected to light source 511 . At this time, the light intensity of the light generated by the light source 511 on the effective grid of the opaque sphere 512 can be calculated by the local light illumination model.
如图9B所示,在目标场景为折射场景时,假设目标场景只有一个光源521以及一个透明球体522。从特定角度发出一条光线,投射到透明球体522的一个有效网格上的点P 2,然后,被折射到透明球体522的另一个点Q 2,然后,被折射到光源L,此时,可以通过局部光照明模型计算光源521产生的光线在点Q 2上产生的光线强度,然后,再计算光线从点Q 2折射到点P 2时在中心点为P 2的有效网格上产生的光线强度。 As shown in FIG. 9B , when the target scene is a refraction scene, it is assumed that the target scene has only one light source 521 and one transparent sphere 522 . A ray is emitted from a specific angle, projected to a point P 2 on an effective grid of the transparent sphere 522, then refracted to another point Q 2 of the transparent sphere 522, and then refracted to the light source L. At this time, it can be Calculate the intensity of the light generated by the light source 521 at point Q 2 through the local light illumination model, and then calculate the light generated on the effective grid with the center point P 2 when the light is refracted from point Q 2 to point P 2 strength.
但是,上述图9A中的反射场景以及图9B中的折射场景都是最简单的场景,图9A中假设目标场景中仅仅存在一个不透明球体,图9B中假设目标场景中仅仅存在一个透明球体,在实际应用中,目标场景远远比图9A至图9B要复杂,例如,目标场景中可能同时存在多个不透明物体以及多个透明物体,因此,光线会被多次反射、折射和透射,从而导致光线的跟踪变得非常复杂,对计算资源的消耗非常大。However, the reflection scene in Fig. 9A and the refraction scene in Fig. 9B are the simplest scenes. Fig. 9A assumes that there is only one opaque sphere in the target scene, and Fig. 9B assumes that there is only one transparent sphere in the target scene. In practical applications, the target scene is far more complex than Figure 9A to Figure 9B. For example, there may be multiple opaque objects and multiple transparent objects in the target scene at the same time. Therefore, the light will be reflected, refracted and transmitted multiple times, resulting in Ray tracing becomes very complex and consumes a lot of computing resources.
如图10所示,同一个有效网格上不同角度所汇聚的光线也是存在差异的,特别是对于光学材料而言,差异会非常明显。每个有效网格都存在一个朝向其法线方向的开放半球空间,进入该半球空间光线可以表达为以有效网格中心P为终点,以半球空间的球面上任意一点O(例如,O 1,O 2或者O 3)为起点。空间是连续的,但我们可以根据算力和精度要求,对每个有效网格的不同方向角分别进行反向光线跟踪,这里说的方向角是指光线OP在半球坐标系中的(θ,π),其中,0<θ<180,0<π<360。因此,上述特定角度可以是该半球空间中的任意一个方向角。由于光线的数量是无限的,计算资源是有限的,通常情况下,不可能对所有的光线进行反向光线跟踪,于是,需要对部分光线进行采样。在对反向光线跟踪的光线进行采样时,采样涉及的参数主要包括每个有效网格的采样数以及光线反弹次数等等。 As shown in Figure 10, there are also differences in the light converged by different angles on the same effective grid, especially for optical materials, the difference will be very obvious. Each effective grid has an open hemispherical space facing its normal direction, and rays entering this hemispherical space can be expressed as taking the effective grid center P as the end point and taking any point O on the spherical surface of the hemispherical space (for example, O 1 , O 2 or O 3 ) as the starting point. The space is continuous, but we can perform reverse ray tracing for different direction angles of each effective grid according to the computing power and accuracy requirements. The direction angle here refers to the (θ, π), where 0<θ<180, 0<π<360. Therefore, the above-mentioned specific angle can be any direction angle in the hemispherical space. Since the number of rays is infinite and the computing resources are limited, it is usually impossible to perform reverse ray tracing on all rays, so some rays need to be sampled. When sampling the rays of reverse ray tracing, the parameters involved in the sampling mainly include the number of samples per effective grid and the number of ray bounces, etc.
假设目标场景中的有效网格集合包括a个漫反射材料的有效网格T 1,T 2,…,T a,以及,b个光学材料的有效网格T 1,T 2,…,T b,则对a个漫反射材料的有效网格T 1,T 2,…,T a进行正向光线跟 踪以及分别从k个特定角度对b个光学材料的有效网格T 1,T 2,…,T b进行反向光线跟踪。 Assume that the set of effective meshes in the target scene includes a effective meshes T 1 , T 2 ,...,T a for diffuse reflective materials, and b effective meshes T 1 ,T 2 ,...,T b for optical materials , then the forward ray tracing is performed on the effective grids T 1 , T 2 ,...,T a of a diffuse reflection materials, and the effective grids T 1 , T 2 , ... of b optical materials are respectively from k specific angles. , T b performs reverse ray tracing.
在进行正向光线跟踪之后,a个漫反射材料的有效网格T 1,T 2,…,T a分别可以得到正向光线强度F 1,F 2,…,F aAfter the forward ray tracing is performed , the forward ray intensities F 1 , F 2 , .
对b个光学材料的有效网格T 1,T 2,…,T b分别从第一特定角度进行反向光线跟踪之后,可以得到从第一特定角度对b个光学材料的有效网格T 1,T 2,…,T b分别进行反向光线跟踪得到的第一反向光线强度
Figure PCTCN2021129464-appb-000004
After performing reverse ray tracing on the effective grids T 1 , T 2 ,...,T b of the b optical materials respectively from the first specific angle, the effective grid T 1 of the b optical materials from the first specific angle can be obtained. ,T 2 ,...,T b respectively the first reverse ray intensities obtained by reverse ray tracing
Figure PCTCN2021129464-appb-000004
对b个光学材料的有效网格T 1,T 2,…,T b分别从第二特定角度进行反向光线跟踪之后,可以得到从第二特定角度对b个光学材料的有效网格T 1,T 2,…,T b分别进行反向光线跟踪得到的第二反向光线强度
Figure PCTCN2021129464-appb-000005
After performing reverse ray tracing on the effective grids T 1 , T 2 ,..., T b of the b optical materials respectively from the second specific angle, the effective grid T 1 of the b optical materials from the second specific angle can be obtained. ,T 2 ,…,T b are the second reverse ray intensities obtained by reverse ray tracing respectively
Figure PCTCN2021129464-appb-000005
…;…;
对b个光学材料的有效网格T 1,T 2,…,T b分别从第k特定角度进行反向光线跟踪之后,可以得到从第k特定角度对b个光学材料的有效网格T 1,T 2,…,T b分别进行反向光线跟踪得到的第k反向光线强度
Figure PCTCN2021129464-appb-000006
After performing reverse ray tracing on the effective grids T 1 , T 2 ,...,T b of the b optical materials from the k-th specific angle, the effective grid T 1 of the b optical materials from the k-th specific angle can be obtained. ,T 2 ,…,T b are the k-th reverse ray intensities obtained by reverse ray tracing respectively
Figure PCTCN2021129464-appb-000006
将正向光线强度F 1,F 2,…,F a,第一反向光线强度
Figure PCTCN2021129464-appb-000007
第二反向光线强度
Figure PCTCN2021129464-appb-000008
第k反向光线强度
Figure PCTCN2021129464-appb-000009
作为有效表面光发射场存储进行存储。为了降低存储有效表面光发射场所需要的空间,可以采用稀疏矩阵的方式对有效表面光发射场进行存储。
The forward light intensity F 1 , F 2 ,...,F a , the first reverse light intensity
Figure PCTCN2021129464-appb-000007
second reverse ray intensity
Figure PCTCN2021129464-appb-000008
The k-th reverse ray intensity
Figure PCTCN2021129464-appb-000009
Stored as effective surface light emission field storage. In order to reduce the space required for storing the effective surface light emission field, the effective surface light emission field may be stored in a sparse matrix manner.
可以理解,上述有效表面光发射场仅仅作为具体的实施例,在实际应用中,在上述例子的基础上,还可以对b个光学材料进行正向光线跟踪,并将正向光线跟踪得到的正向光线强度F 1,F 2,…,F b分别和第一反向光线强度
Figure PCTCN2021129464-appb-000010
第二反向光线强度
Figure PCTCN2021129464-appb-000011
第k反向光线强度
Figure PCTCN2021129464-appb-000012
进行叠加,从而得到有效表面光发射场等等。
It can be understood that the above-mentioned effective surface light emission field is only a specific example. In practical applications, on the basis of the above example, forward ray tracing can also be performed on b optical materials, and the forward ray tracing obtained by the forward ray tracing can be performed. The light intensities F 1 , F 2 ,...,F b and the first reverse light intensity respectively
Figure PCTCN2021129464-appb-000010
second reverse ray intensity
Figure PCTCN2021129464-appb-000011
The k-th reverse ray intensity
Figure PCTCN2021129464-appb-000012
Superposition is performed to obtain an effective surface light emission field and so on.
当从不同的视角观察目标场景时,可以采用投射式求交方法,从预先计算好的有效表面光发射场中提出相应的数据,从而快速获取从该视角可观察到的有效网格集合,并最终生成所需要的渲染图像。下面将结合图9以及相关具体实施例对如何获取用户可观察到的物体表面集合进行详细的介绍。When observing the target scene from different perspectives, the projected intersection method can be used to propose the corresponding data from the pre-calculated effective surface light emission field, so as to quickly obtain the effective grid set that can be observed from the perspective, and finally Generate the desired rendered image. The following will describe in detail how to obtain the set of object surfaces that can be observed by the user with reference to FIG. 9 and related specific embodiments.
如图11所示,假设相机611(或者人眼)从视点E对应的视角出发对目标场景进行观察,并且,观察生成的渲染图像612具有m个像素点。As shown in FIG. 11 , it is assumed that the camera 611 (or the human eye) observes the target scene from the perspective corresponding to the viewpoint E, and the rendered image 612 generated by the observation has m pixels.
首先,从视点E发出一条光线,投射到渲染图像612的第一个像素点上,然后,继续出射到目标场景中的三维模型的其中第一网格上,如果该被第一网格是漫反射材料,则将该第一网格的正向光线强度作为第一像素点的光线强度,如果该第一网格是光学材料,则确定该光线入射该第一网格的第一入射角度,并根据第一入射角度查找该第一网格的相匹配的特定角度对应的光线强度,并将该对应的光线强度作为第一像素点的光线强度。First, a ray is emitted from the viewpoint E and projected onto the first pixel of the rendered image 612, and then continues to be projected onto the first grid of the 3D model in the target scene, if the first grid is diffuse If the reflective material is used, the forward light intensity of the first grid is used as the light intensity of the first pixel. If the first grid is an optical material, the first incident angle at which the light enters the first grid is determined, The light intensity corresponding to the matching specific angle of the first grid is searched according to the first incident angle, and the corresponding light intensity is used as the light intensity of the first pixel point.
然后,从视点E发出一条光线,投射到渲染图像612的第二个像素点上,然后,继续出射到目标场景中的三维模型的其中第二网格上,如果该被第二网格是漫反射材料,则将该第二网格的正向光线强度作为第二像素点的光线强度,如果该第二网格是光学材料,则确定该光线入射该第二网格的第二入射角度,并根据第二入射角度查找该第二网格的相匹配的特定角度对应的光线强度,并将该对应的光线强度作为第二像素点的光线强度。Then, a ray is emitted from the viewpoint E, projected on the second pixel of the rendered image 612, and then continues to be projected on the second grid of the three-dimensional model in the target scene, if the second grid is diffuse If the reflective material is used, the forward light intensity of the second grid is used as the light intensity of the second pixel point, and if the second grid is an optical material, the second incident angle at which the light enters the second grid is determined, And according to the second incident angle, the light intensity corresponding to the matching specific angle of the second grid is searched, and the corresponding light intensity is used as the light intensity of the second pixel point.
…;…;
最后,从视点E发出一条光线,投射到渲染图像612的第m个像素点上,然后,继续出 射到目标场景中的三维模型的其中第m网格上,如果该被第m网格是漫反射材料,则将该第m网格的正向光线强度作为第m像素点的光线强度,如果该第m网格是光学材料,则确定该光线入射该第m网格的第m入射角度,并根据第m入射角度查找该第m网格的相匹配的特定角度对应的光线强度,并将该对应的光线强度作为第m像素点的光线强度。Finally, a ray is emitted from the viewpoint E and projected to the mth pixel of the rendered image 612, and then continues to be emitted to the mth grid of the 3D model in the target scene, if the mth grid is diffuse If the reflective material is used, the forward light intensity of the m-th grid is taken as the light intensity of the m-th pixel; if the m-th grid is an optical material, the m-th incident angle of the light entering the m-th grid is determined, And according to the mth incident angle, the light intensity corresponding to the matching specific angle of the mth grid is searched, and the corresponding light intensity is used as the light intensity of the mth pixel point.
至此,m个像素点的光线强度都已经确定了,渲染图像612已经可以确定出来了。So far, the light intensities of m pixels have been determined, and the rendered image 612 has been determined.
需要说明的是,第一入射角度和第一网格的特定角度相匹配包括:第一入射角度和第一网格的特定角度相同,或者,第一入射角度和第一网格的特定角度的差值小于预设阈值,此处不作具体限定。第二入射角度和第二网格的特定角度相匹配至第m入射角度和第m网格的特定角度相匹配也相类似,此处不再展开描述。It should be noted that the matching of the first incident angle with the specific angle of the first grid includes: the first incident angle is the same as the specific angle of the first grid, or the difference between the first incident angle and the specific angle of the first grid The difference is smaller than the preset threshold, which is not specifically limited here. The matching between the second incident angle and the specific angle of the second grid is also similar to the matching of the m-th incident angle with the specific angle of the m-th grid, which will not be described here.
为了简便起见,上述图11对应的实施例是以每像素采样数(Sample per pixel,Spp)等于1为例进行说明,其中,SPP可以定义为每个像素采样得到的光线的数量,但是,在实际应用中,为了提高渲染图像的画质,通常令SPP的数值更大。For the sake of simplicity, the above-mentioned embodiment corresponding to FIG. 11 is described by taking the number of samples per pixel (Sample per pixel, Spp) equal to 1 as an example, wherein, SPP can be defined as the number of rays obtained by sampling each pixel, but, in In practical applications, in order to improve the quality of the rendered image, the value of SPP is usually made larger.
上述方案中,对于b个光学材料的有效网格T 1,T 2,…,T b,如果不采用本方案基于视角位置的渲染方案,那么需要对每一个光学材料的有效网络T i的上半球都发射光线进行反向追踪,假设放射光线的角度(θ,π),其中,0<θ<180,0<π<360,每隔1度发射一条光线,总共需要θ*π=64800条光线,b个光学材料的有效网络需要64800b条光线,也就是需要做64800b次反向光线追踪。但是如果采用本方案基于视角位置的渲染方案,假设视角位置数为k个,每个光学材料最多需要发射k条不同的光学,那么b个光学材料的有效网络最多只需要k*b条光线,也就是需要做kb次反向光线追踪。当k<<64800时,可以有效减少反向光线追踪的次数。而且,为了渲染图像更加精确,每一个光学材料网络需要发射更细精度的光线,也就是每个光线材料网络可能发射大于64800条光线。在这种情况下,本方案对每个光学材料的有效网络最多发射k条光线,从而大大减少了数据的计算量。 In the above scheme, for the effective grids T 1 , T 2 ,...,T b of b optical materials, if the viewing angle position-based rendering scheme of this scheme is not adopted, then the upper limit of the effective network T i of each optical material needs to be calculated. The hemisphere emits rays for reverse tracing, assuming the angle of the emitted rays (θ, π), where 0<θ<180, 0<π<360, a ray is emitted every 1 degree, and a total of θ*π=64800 is required. Rays, an effective network of b optical materials requires 64800b rays, that is, 64800b reverse ray tracings are required. However, if the rendering scheme based on the viewing angle position of this scheme is adopted, assuming that the number of viewing angle positions is k, and each optical material needs to emit at most k different optics, then the effective network of b optical materials only needs k*b rays at most, That is, you need to do kb reverse ray tracing. When k<<64800, the number of reverse ray tracing can be effectively reduced. Moreover, in order to render the image more accurately, each optical material network needs to emit more fine-grained rays, that is, each ray material network may emit more than 64800 rays. In this case, the proposed scheme emits at most k rays for each effective network of optical materials, thus greatly reducing the amount of data computation.
参见图12,图12是本申请提供的一种渲染方法的流程交互图。本实施方式的渲染方法可以应用于图1A所示的渲染系统中,所述方法包括:Referring to FIG. 12, FIG. 12 is a flowchart interaction diagram of a rendering method provided by the present application. The rendering method of this embodiment can be applied to the rendering system shown in FIG. 1A , and the method includes:
S101:终端设备的渲染应用客户端向网络设备发送第一视角。相应地,网络设备接收终端设备的渲染应用客户端发送的第一视角。S101: The rendering application client of the terminal device sends the first view angle to the network device. Correspondingly, the network device receives the first view angle sent by the rendering application client of the terminal device.
在本申请具体的实施例中,第一视角可以是单个视角,也可以是多个视角,例如,第一视角可以是渲染应用客户端的用户当前观看游戏的角度,也可以是,渲染应用客户端的用户所玩的游戏路径的多个角度等等。In a specific embodiment of the present application, the first viewing angle may be a single viewing angle or multiple viewing angles. For example, the first viewing angle may be the angle at which the user of the rendering application client is currently viewing the game, or the viewing angle of the rendering application client. Multiple angles of the game path the user is playing, etc.
S102:网络设备向远程渲染平台的渲染应用服务端发送第一视角。相应地,远程渲染平台的渲染应用服务端接收网络设备发送的第一视角。S102: The network device sends the first perspective to the rendering application server of the remote rendering platform. Correspondingly, the rendering application server of the remote rendering platform receives the first perspective sent by the network device.
S103:远程渲染平台的渲染应用服务端根据第一视角调用所述渲染引擎在有效网格集合中查找所述第一视角对应的有效网格。S103: The rendering application server of the remote rendering platform invokes the rendering engine according to the first view angle to search for the valid grid corresponding to the first view angle in the valid grid set.
在本申请具体的实施例中,所述有效网格集合为网格集合中视角集合中的每个视角对应的有效网格构成的子集。即,有效网格集合通常小于网格集合。所述网格集合为所述网格组成的集合。其中,视角集合的内容可以参见上文中关于视角集合的介绍,此处不再展开描述,所述网格为对目标场景中的三维模型的表面进行划分得到的,网格的定义可以参见上文中图4A-图4B以及相关描述,此处不再展开描述。In a specific embodiment of the present application, the valid grid set is a subset formed by valid grids corresponding to each viewing angle in the viewing angle set in the grid set. That is, the effective grid set is generally smaller than the grid set. The grid set is a set composed of the grids. For the content of the perspective set, please refer to the introduction about the perspective set above, which will not be described here. The grid is obtained by dividing the surface of the 3D model in the target scene. For the definition of the grid, please refer to the above. 4A-4B and related descriptions are not further described here.
在本申请具体的实施例中,所述第一视角对应的有效网格具体为:从所述第一视角对应 的视点能够观察到的网格。远程渲染平台在接收到第一视角之后,确定第一视角属于视角集合。这里,远程渲染平台预先已经存储了视角集合中的各个视角与有效网格的对应关系,具体请参见上文中在所述多个网格中确定所述视角集合对应的K个有效网格中的陈述。因此,远程渲染平台在确定第一视角属于视角集合之后,远程渲染平台可以采用投射式求交方法快速获取从该第一视角可观察到的有效网格集合。其中,投射式求交方法的内容可以参见图11以及相关描述,此处不再展开描述。In a specific embodiment of the present application, the effective grid corresponding to the first viewing angle is specifically: a grid that can be observed from a viewpoint corresponding to the first viewing angle. After receiving the first viewing angle, the remote rendering platform determines that the first viewing angle belongs to the viewing angle set. Here, the remote rendering platform has pre-stored the correspondence between each viewing angle in the viewing angle set and the valid grid. For details, please refer to the above Determining the K valid grids corresponding to the viewing angle set from the multiple grids above. statement. Therefore, after the remote rendering platform determines that the first viewing angle belongs to the viewing angle set, the remote rendering platform can quickly obtain a valid mesh set observable from the first viewing angle by using a projective intersection method. For the content of the projective intersection method, reference may be made to FIG. 11 and related descriptions, which will not be described here again.
S104:远程渲染平台的渲染应用服务端调用所述渲染引擎根据所述第一视角对应的有效网格的光线强度生成渲染图像。S104: The rendering application server of the remote rendering platform invokes the rendering engine to generate a rendered image according to the light intensity of the effective grid corresponding to the first viewing angle.
在本申请具体的实施例中,远程渲染平台预先已经存储了各个视角对应的有效网格的光线强度。明显地,所述有效网格的材料包括漫反射材料以及光学材料,在有效网格的材料为漫反射材料的情况下,所述有效网格的光线强度包括对所述有效网格进行正向光线跟踪得到的光线强度;在有效网格的材料为光学材料的情况下,所述有效网格的光线强度包括从各个特定角度进行反向光线跟踪得到的光线强度。这里,正向光线跟踪和反向光线跟踪的内容可以参见上文中图7A-图7D涉及的正向光线跟踪的相关内容,以及上文中图9A-图9B涉及的反向光线的相关内容的介绍,此处不再展开描述。In a specific embodiment of the present application, the remote rendering platform has previously stored the light intensity of the effective grid corresponding to each viewing angle. Obviously, the material of the effective grid includes a diffuse reflection material and an optical material, and in the case where the material of the effective grid is a diffuse reflection material, the light intensity of the effective grid includes forwarding the effective grid. The light intensity obtained by ray tracing; when the material of the effective mesh is an optical material, the light intensity of the effective mesh includes the light intensity obtained by reverse ray tracing from each specific angle. Here, for the content of forward ray tracing and reverse ray tracing, please refer to the relevant content of forward ray tracing involved in FIGS. 7A-7D above, and the introduction of the relevant content of reverse ray tracing involved in FIGS. 9A-9B above. , which will not be described here.
在本申请具体的实施例中,远程渲染平台根据第一视角获取第一视角对应的有效网格的光线强度。所述第一视角对应的有效网格至少包括三种情况:第一种情况,第一视角对应的有效网格的材料均为漫反射材料,此时,只需要获取这些有效网格通过正向光线跟踪得到的光线强度即可。第二种情况,第一视角对应的有效网格的材料均为光学材料,此时,只需要获取这些有效网格通过第一视角进行反向光线跟踪得到光线强度即可。第三种情况,所述第一视角对应的有效网格的材料中即包括漫反射材料,也包括光学材料,此时,需要获取材料为漫反射材料的有效网格通过正向光线跟踪得到的光线强度,获取材料为光学材料的有效网格通过第一视角进行反向光线跟踪得到光线强度。In a specific embodiment of the present application, the remote rendering platform acquires the light intensity of the effective grid corresponding to the first viewing angle according to the first viewing angle. The effective grids corresponding to the first viewing angle include at least three cases: In the first case, the materials of the effective grids corresponding to the first viewing angle are all diffuse reflection materials. The ray intensity obtained by ray tracing is sufficient. In the second case, the materials of the effective grids corresponding to the first viewing angle are all optical materials. In this case, it is only necessary to obtain these effective grids and perform reverse ray tracing through the first viewing angle to obtain the light intensity. In the third case, the materials of the effective grid corresponding to the first viewing angle include both diffuse reflective materials and optical materials. In this case, it is necessary to obtain the effective grids whose materials are diffuse reflective materials through forward ray tracing. Light intensity, obtains the light intensity by performing reverse ray tracing from the first viewing angle of an effective grid whose material is an optical material.
S105:远程渲染平台的渲染应用服务端向网络设备发送渲染图像。相应地,网络设备接收远程渲染平台的渲染应用服务端发送的渲染图像。S105: The rendering application server of the remote rendering platform sends the rendered image to the network device. Correspondingly, the network device receives the rendered image sent by the rendering application server of the remote rendering platform.
S106:网络设备向终端设备的渲染应用客户端发送渲染图像。相应地,终端设备的渲染应用客户端接收网络设备发送的渲染图像。S106: The network device sends the rendered image to the rendering application client of the terminal device. Correspondingly, the rendering application client of the terminal device receives the rendered image sent by the network device.
为了简便起见,图12所示的实施例并没有进行详细的介绍,具体请参见上文中图1A-图1B、图2-图3、图4A-图4B、图5-图6、图7A-图7D、图8、图9A-图9B、图10-图11以及相关描述,此处不再展开描述。For the sake of simplicity, the embodiment shown in FIG. 12 is not described in detail. For details, please refer to FIGS. 1A-1B, 2-3, 4A-4B, 5-6, and 7A- Fig. 7D, Fig. 8, Fig. 9A-Fig. 9B, Fig. 10-Fig. 11 and related descriptions, which are not further described here.
参见图13,图13是本申请提供的一种渲染方法的流程交互图。本实施方式的渲染方法可以应用于图1B所示的渲染系统中,所述方法包括:Referring to FIG. 13 , FIG. 13 is a flowchart interaction diagram of a rendering method provided by the present application. The rendering method of this embodiment can be applied to the rendering system shown in FIG. 1B , and the method includes:
S201:管理设备向网络设备发送第一视角。相应地,网络设备接收管理设备发送的第一视角。S201: The management device sends the first view angle to the network device. Correspondingly, the network device receives the first view angle sent by the management device.
在本申请具体的实施例中,第一视角可以是单个视角,也可以是多个视角,例如,第一视角可以是终端设备的渲染应用客户端的用户当前观看游戏的角度,也可以是,终端设备的渲染应用客户端的用户所玩的游戏路径的多个角度等等。In a specific embodiment of the present application, the first viewing angle may be a single viewing angle or multiple viewing angles. For example, the first viewing angle may be the current viewing angle of the game by the user of the rendering application client of the terminal device, or the terminal The device's rendering of multiple angles of the game path played by the user of the application client, etc.
S202:网络设备向远程渲染平台的渲染应用服务端发送第一视角。相应地,远程渲染平台的渲染应用服务端接收网络设备发送的第一视角。S202: The network device sends the first perspective to the rendering application server of the remote rendering platform. Correspondingly, the rendering application server of the remote rendering platform receives the first perspective sent by the network device.
S203:远程渲染平台的渲染应用服务端根据第一视角调用所述渲染引擎在有效网格集合中查找所述第一视角对应的有效网格。S203: The rendering application server of the remote rendering platform invokes the rendering engine according to the first view angle to search for the valid grid corresponding to the first view angle in the valid grid set.
S204:远程渲染平台的渲染应用服务端调用所述渲染引擎根据所述第一视角对应的有效网格的光线强度生成渲染图像。S204: The rendering application server of the remote rendering platform invokes the rendering engine to generate a rendered image according to the light intensity of the effective grid corresponding to the first viewing angle.
S205:远程渲染平台的渲染应用服务端向网络设备发送渲染图像。相应地,网络设备接收远程渲染平台的渲染应用服务端发送的渲染图像。S205: The rendering application server of the remote rendering platform sends the rendered image to the network device. Correspondingly, the network device receives the rendered image sent by the rendering application server of the remote rendering platform.
S206:网络设备向终端设备的渲染应用客户端发送渲染图像。相应地,终端设备的渲染应用客户端接收网络设备发送的渲染图像。S206: The network device sends the rendered image to the rendering application client of the terminal device. Correspondingly, the rendering application client of the terminal device receives the rendered image sent by the network device.
为了简便起见,图12所示的实施例并没有进行详细的介绍,具体请参见上文中图1A-图1B、图2-图3、图4A-图4B、图5-图6、图7A-图7D、图8、图9A-图9B、图10-图11以及相关描述,此处不再展开描述。For the sake of simplicity, the embodiment shown in FIG. 12 is not described in detail. For details, please refer to FIGS. 1A-1B, 2-3, 4A-4B, 5-6, and 7A- Fig. 7D, Fig. 8, Fig. 9A-Fig. 9B, Fig. 10-Fig. 11 and related descriptions, which are not further described here.
参见图14,图14是本申请提供的一种渲染应用服务端的结构示意图。本实施方式的渲染应用服务端,包括:接收模块710、渲染模块720以及发送模块730。Referring to FIG. 14, FIG. 14 is a schematic structural diagram of a rendering application server provided by the present application. The rendering application server in this embodiment includes: a receiving module 710 , a rendering module 720 and a sending module 730 .
所述接收模块710用于接收第一视角。The receiving module 710 is configured to receive the first viewing angle.
所述渲染模块720用于根据第一视角调用所述渲染引擎在有效网格集合中查找所述第一视角对应的有效网格,根据所述第一视角对应的有效网格的光线强度生成渲染图像,其中,所述有效网格集合为预设的视角集合对应的有效网格的集合,所述第一视角属于所述视角集合。The rendering module 720 is configured to call the rendering engine according to the first viewing angle to search for the valid grid corresponding to the first viewing angle in the valid grid set, and generate a rendering according to the light intensity of the valid grid corresponding to the first viewing angle. The image, wherein the valid grid set is a set of valid grids corresponding to a preset viewing angle set, and the first viewing angle belongs to the viewing angle set.
所述发送模块730用于向所述渲染应用客户端发送所述渲染图像。The sending module 730 is configured to send the rendered image to the rendering application client.
为了简便起见,图12所示的实施例并没有进行详细的介绍,具体请参见上文中图1A-图1B、图2-图3、图4A-图4B、图5-图6、图7A-图7D、图8、图9A-图9B、图10-图11以及相关描述,此处不再展开描述。For the sake of simplicity, the embodiment shown in FIG. 12 is not described in detail. For details, please refer to FIGS. 1A-1B, 2-3, 4A-4B, 5-6, and 7A- Fig. 7D, Fig. 8, Fig. 9A-Fig. 9B, Fig. 10-Fig. 11 and related descriptions, which are not further described here.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、存储盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态存储盘Solid State Disk(SSD))等。In the above-mentioned embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented in software, it can be implemented in whole or in part 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 the present application are generated. The computer may be a general purpose computer, special purpose computer, computer network, or other programmable device. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server, or data center Transmission to another website site, computer, server, or data center by wire (eg, coaxial cable, optical fiber, digital subscriber line) or wireless (eg, infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes an integration of one or more available media. The usable media may be magnetic media (eg, floppy disks, storage disks, magnetic tapes), optical media (eg, DVD), or semiconductor media (eg, Solid State Disk (SSD)), among others.

Claims (10)

  1. 一种渲染方法,其特征在于,应用于渲染系统的渲染应用服务端,所述渲染系统还包括渲染应用客户端,所述渲染应用客户端部署于终端设备,所述渲染应用服务端部署于远程渲染节点,所述方法包括:A rendering method, characterized in that it is applied to a rendering application server of a rendering system, the rendering system further includes a rendering application client, the rendering application client is deployed on a terminal device, and the rendering application server is deployed on a remote rendering a node, the method includes:
    所述渲染应用服务端接收第一视角;The rendering application server receives the first perspective;
    所述渲染应用服务端根据第一视角调用所述渲染引擎在有效网格集合中查找所述第一视角对应的有效网格,根据所述第一视角对应的有效网格的光线强度生成渲染图像,其中,所述有效网格集合为预设的视角集合对应的有效网格的集合,所述第一视角属于所述视角集合;The rendering application server calls the rendering engine according to the first viewing angle to search for the valid grid corresponding to the first viewing angle in the valid grid set, and generates a rendered image according to the light intensity of the valid grid corresponding to the first viewing angle , wherein the valid grid set is a set of valid grids corresponding to a preset viewing angle set, and the first viewing angle belongs to the viewing angle set;
    所述渲染应用服务端向所述渲染应用客户端发送所述渲染图像。The rendering application server sends the rendering image to the rendering application client.
  2. 根据权利要求1所述的方法,其特征在于,所述第一视角对应的有效网格具体为:从所述第一视角对应的视点能够观察到的网格,其中,所述网格为对目标场景中的三维模型的表面进行划分得到的。The method according to claim 1, wherein the effective grid corresponding to the first viewing angle is specifically: a grid that can be observed from a viewpoint corresponding to the first viewing angle, wherein the grid is a pair of It is obtained by dividing the surface of the 3D model in the target scene.
  3. 根据权利要求2所述的方法,其特征在于,所述有效网格集合为所述视角集合中的每个视角对应的有效网格构成的集合。The method according to claim 2, wherein the valid grid set is a set composed of valid grids corresponding to each view in the view set.
  4. 根据权利要求1至3任一权利要求所述的方法,其特征在于,The method according to any one of claims 1 to 3, characterized in that:
    所述视角集合是用户预先设置在所述渲染应用服务端的;The perspective set is preset by the user on the rendering application server;
    所述视角集合是所述渲染应用服务端根据渲染应用的历史视角统计得到的;The perspective set is obtained by the rendering application server according to historical perspective statistics of the rendering application;
    所述视角集合是所述渲染应用服务端根据渲染应用的历史视角预测得到的。The perspective set is predicted and obtained by the rendering application server according to historical perspectives of the rendering application.
  5. 根据权利要求1至4任一权利要求所述的方法,其特征在于,所述有效网格的材料包括漫反射材料以及光学材料,The method according to any one of claims 1 to 4, wherein the material of the effective grid comprises a diffuse reflection material and an optical material,
    在有效网格的材料为漫反射材料的情况下,所述有效网格的光线强度包括对所述有效网格进行正向光线跟踪得到的光线强度;In the case where the material of the effective mesh is a diffuse reflection material, the light intensity of the effective mesh includes the light intensity obtained by performing forward ray tracing on the effective mesh;
    在有效网格的材料为光学材料的情况下,所述有效网格的光线强度包括从与所述第一视角的角度相同的特定角度进行反向光线跟踪得到的光线强度。In the case where the material of the effective grid is an optical material, the light intensity of the effective grid includes the light intensity obtained by reverse ray tracing from a specific angle that is the same as the angle of the first viewing angle.
  6. 一种渲染应用服务端,其特征在于,所述渲染应用服务端包括:接收模块、渲染模块以及发送模块;A rendering application server, characterized in that the rendering application server comprises: a receiving module, a rendering module and a sending module;
    所述接收模块用于接收所述渲染应用客户端发送的第一视角;The receiving module is configured to receive the first perspective sent by the rendering application client;
    所述渲染模块用于根据第一视角调用所述渲染引擎在有效网格集合中查找所述第一视角对应的有效网格,根据所述第一视角对应的有效网格的光线强度生成渲染图像,其中,所述有效网格集合为预设的视角集合对应的有效网格的集合,所述第一视角属于所述视角集合;The rendering module is configured to call the rendering engine according to the first viewing angle to search for the valid grid corresponding to the first viewing angle in the valid grid set, and generate a rendered image according to the light intensity of the valid grid corresponding to the first viewing angle , wherein the valid grid set is a set of valid grids corresponding to a preset viewing angle set, and the first viewing angle belongs to the viewing angle set;
    所述发送模块用于向所述渲染应用客户端发送所述渲染图像。The sending module is configured to send the rendered image to the rendering application client.
  7. 一种渲染方法,其特征在于,应用于渲染系统,所述渲染系统包括渲染应用客户端、渲染应用服务端,所述渲染应用客户端部署于终端设备,所述渲染应用服务端部署于远程渲染节点,所述方法包括:A rendering method, characterized in that it is applied to a rendering system, the rendering system includes a rendering application client and a rendering application server, the rendering application client is deployed on a terminal device, and the rendering application server is deployed in a remote rendering node, the method includes:
    所述渲染应用客户端发送第一视角The rendering application client sends the first perspective
    所述渲染应用服务端接收所述第一视角;根据第一视角调用所述渲染引擎在有效网格集合中查找所述第一视角对应的有效网格,根据所述第一视角对应的有效网格的光线强度生成渲染图像;发送所述渲染图像;其中,所述有效网格集合为预设的视角集合对应的有效网格的集合,所述第一视角属于所述视角集合;The rendering application server receives the first viewing angle; according to the first viewing angle, the rendering engine is called to search for the valid grid corresponding to the first viewing angle in the valid grid set, and the valid grid corresponding to the first viewing angle is based on the first viewing angle. generating a rendered image based on the light intensity of the grid; sending the rendered image; wherein, the valid grid set is a set of valid grids corresponding to a preset viewing angle set, and the first viewing angle belongs to the viewing angle set;
    所述渲染应用客户端接收所述渲染图像。The rendering application client receives the rendered image.
  8. 一种渲染系统,其特征在于,包括渲染应用服务端、渲染应用客户端、渲染引擎,所述渲染应用客户端部署于终端设备,所述渲染应用服务端和所述渲染引擎部署于远程渲染节点;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 rendering node ;
    所述渲染应用服务端,用于接收第一视角;根据第一视角调用所述渲染引擎在有效网格集合中查找所述第一视角对应的有效网格,根据所述第一视角对应的有效网格的光线强度生成渲染图像;发送所述渲染图像;其中,所述有效网格集合为预设的视角集合对应的有效网格的集合,所述第一视角属于所述视角集合;The rendering application server is used to receive a first view angle; according to the first view angle, the rendering engine is called to search for the valid grid corresponding to the first view angle in the valid grid set, and the valid grid corresponding to the first view angle is called according to the first view angle. generating a rendered image based on the light intensity of the grid; sending the rendered image; wherein, the valid grid set is a set of valid grids corresponding to a preset viewing angle set, and the first viewing angle belongs to the viewing angle set;
    所述渲染应用客户端,用于发送所述第一视角以及接收所述渲染图像。The rendering application client is configured to send the first viewing angle and receive the rendered image.
  9. 一种计算节点,其特征在于,所述计算节点包括处理器以及存储器,所述处理器执行所述存储器中的程序,从而执行如权利要求1至5任一所述的方法。A computing node, characterized in that, the computing node includes a processor and a memory, and the processor executes a program in the memory, thereby executing the method according to any one of claims 1 to 5.
  10. 一种计算机可读存储介质,其特征在于,包括指令,当所述指令在计算节点上运行时,使得所述计算节点执行如权利要求1至5任一所述的方法。A computer-readable storage medium, characterized by comprising instructions, which when executed on a computing node, cause the computing node to execute the method according to any one of claims 1 to 5.
PCT/CN2021/129464 2020-11-20 2021-11-09 Rendering method, device and system WO2022105641A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011312546.2A CN114596401A (en) 2020-11-20 2020-11-20 Rendering method, device and system
CN202011312546.2 2020-11-20

Publications (1)

Publication Number Publication Date
WO2022105641A1 true WO2022105641A1 (en) 2022-05-27

Family

ID=81708352

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/129464 WO2022105641A1 (en) 2020-11-20 2021-11-09 Rendering method, device and system

Country Status (2)

Country Link
CN (1) CN114596401A (en)
WO (1) WO2022105641A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116977556A (en) * 2023-07-18 2023-10-31 广东国地规划科技股份有限公司 Rendering method, device and storage medium of CIM system

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115239869B (en) * 2022-09-22 2023-03-24 广州简悦信息科技有限公司 Shadow processing method, shadow rendering method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6362817B1 (en) * 1998-05-18 2002-03-26 In3D Corporation System for creating and viewing 3D environments using symbolic descriptors
CN107564098A (en) * 2017-08-17 2018-01-09 中山大学 A kind of Fast rendering method of big Local Area Network three-dimensional noise map
CN107578477A (en) * 2017-09-11 2018-01-12 南京大学 A kind of automatic testing method of threedimensional model part
CN109493431A (en) * 2017-09-12 2019-03-19 阿里巴巴集团控股有限公司 3D model data processing method, apparatus and system
CN109523622A (en) * 2018-11-15 2019-03-26 奥本未来(北京)科技有限责任公司 A kind of non-structured light field rendering method
CN110796725A (en) * 2019-08-28 2020-02-14 腾讯科技(深圳)有限公司 Data rendering method, device, terminal and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6362817B1 (en) * 1998-05-18 2002-03-26 In3D Corporation System for creating and viewing 3D environments using symbolic descriptors
CN107564098A (en) * 2017-08-17 2018-01-09 中山大学 A kind of Fast rendering method of big Local Area Network three-dimensional noise map
CN107578477A (en) * 2017-09-11 2018-01-12 南京大学 A kind of automatic testing method of threedimensional model part
CN109493431A (en) * 2017-09-12 2019-03-19 阿里巴巴集团控股有限公司 3D model data processing method, apparatus and system
CN109523622A (en) * 2018-11-15 2019-03-26 奥本未来(北京)科技有限责任公司 A kind of non-structured light field rendering method
CN110796725A (en) * 2019-08-28 2020-02-14 腾讯科技(深圳)有限公司 Data rendering method, device, terminal and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116977556A (en) * 2023-07-18 2023-10-31 广东国地规划科技股份有限公司 Rendering method, device and storage medium of CIM system
CN116977556B (en) * 2023-07-18 2024-02-06 广东国地规划科技股份有限公司 Rendering method, device and storage medium of CIM system

Also Published As

Publication number Publication date
CN114596401A (en) 2022-06-07

Similar Documents

Publication Publication Date Title
WO2021228031A1 (en) Rendering method, apparatus and system
CN108090947B (en) Ray tracing optimization method for 3D scene
CN113781626B (en) Techniques to traverse data used in ray tracing
WO2022105641A1 (en) Rendering method, device and system
US11295508B2 (en) Hardware-based techniques applicable for ray tracing for efficiently representing and processing an arbitrary bounding volume
US11816783B2 (en) Enhanced techniques for traversing ray tracing acceleration structures
JPH10510074A (en) Image composition
WO2022063260A1 (en) Rendering method and apparatus, and device
US11373358B2 (en) Ray tracing hardware acceleration for supporting motion blur and moving/deforming geometry
CN113808241B (en) Hardware acceleration of ray traced primitives sharing vertices
US11232628B1 (en) Method for processing image data to provide for soft shadow effects using shadow depth information
CN112184873B (en) Fractal graph creation method, fractal graph creation device, electronic equipment and storage medium
US11854141B2 (en) Early release of resources in ray tracing hardware
CN111739142A (en) Scene rendering method and device, electronic equipment and computer readable storage medium
WO2023142607A1 (en) Image rendering method and apparatus, and device and medium
CN113674389A (en) Scene rendering method and device, electronic equipment and storage medium
CN116758208A (en) Global illumination rendering method and device, storage medium and electronic equipment
WO2023005631A1 (en) Rendering method and apparatus, and storage medium
KR20230013099A (en) Geometry-aware augmented reality effects using real-time depth maps
WO2023029424A1 (en) Method for rendering application and related device
CN114581588A (en) Rendering method, device and system
WO2023088047A1 (en) Rendering method and apparatus
Nery et al. Two alternative parallel implementations for ray tracing: Openmp and mpi
KR20240074815A (en) 3D model rendering method and apparatus, electronic device, and storage medium
CN117876572A (en) Illumination rendering method, device, equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21893788

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21893788

Country of ref document: EP

Kind code of ref document: A1