WO2023029424A1 - Method for rendering application and related device - Google Patents

Method for rendering application and related device Download PDF

Info

Publication number
WO2023029424A1
WO2023029424A1 PCT/CN2022/079498 CN2022079498W WO2023029424A1 WO 2023029424 A1 WO2023029424 A1 WO 2023029424A1 CN 2022079498 W CN2022079498 W CN 2022079498W WO 2023029424 A1 WO2023029424 A1 WO 2023029424A1
Authority
WO
WIPO (PCT)
Prior art keywords
patch
rendering
rendering result
result
intermediate rendering
Prior art date
Application number
PCT/CN2022/079498
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 WO2023029424A1 publication Critical patent/WO2023029424A1/en

Links

Images

Classifications

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

Definitions

  • the present application relates to the technical field of image processing, and in particular to a method for rendering an application and related devices.
  • Computer rendering technology refers to the output of real images that simulate the same model and lighting conditions in the real world through computer calculation based on 3D model data and light data.
  • Ray tracing technology is one of the effective ways for modern computers to render realistic computer-rendered images based on scene information such as 3D models and lighting information.
  • the more commonly used rendering methods have a large amount of calculation in the rendering process and a long rendering time.
  • the method of reducing the number of ray tracing samples is usually adopted to reduce the amount of calculation and shorten the rendering time.
  • the rendered image obtained by the above-mentioned rendering method of reducing the number of ray tracing samples has too much noise and low image precision. Therefore, how to improve the precision of the rendered image has become an important research topic for technical personnel.
  • the embodiment of the present application provides a method and a related device for rendering an application. According to the intermediate rendering result of the first patch and the intermediate rendering result of the second patch whose distance from the first patch is smaller than the distance threshold, the second patch is obtained.
  • the rendering result of one patch can reduce the noise of the rendered image obtained based on the rendering result of the first patch, and improve the precision of the rendered image.
  • the embodiment of the present application provides a method for rendering an application, where the application includes at least one model, and the model includes multiple meshes, and the method includes:
  • a method for rendering an application is provided.
  • the rendering method relates to the field of image processing technology.
  • the intermediate rendering result of the adjacent patch of the patch and the intermediate rendering result of the target patch to obtain the rendering result of the target patch, wherein the distance between the adjacent patch of the target patch and the target patch is smaller than the distance threshold.
  • ray-tracing rendering is performed on the first and second patches among the multiple patches to obtain the intermediate rendering results of the first patch and the intermediate rendering results of the second patch, and then according to the The intermediate rendering result and the intermediate rendering result of the first patch, to obtain the rendering result of the first patch, wherein the second patch is the adjacent patch of the first patch, that is, the difference between the second patch and the first patch The distance between them is less than the distance threshold.
  • the distance threshold is not a fixed value and can vary according to different rendering models and rendering scenarios. It can be a system preset value or a user configured value, which is not limited here. Through the embodiments of the present application, the noise of the rendered image obtained based on the rendering result of the first patch can be reduced, and the accuracy of the rendered image can be improved.
  • the degree of association between the first patch and the second patch is greater than a threshold of association degree, wherein the degree of association is used to indicate that the degree of association between the first patch and the second The degree of relatedness of the patches.
  • the correlation degree between the first patch and the second patch is greater than the correlation threshold, that is, the correlation degree between the first patch and the second patch is greater than the correlation threshold, wherein the correlation threshold is not a fixed
  • the value of can vary according to different model rendering application scenarios. It can be a system preset value or a user configured value, which is not limited here.
  • the correlation degree between the first patch and the second patch is greater than the threshold value of the correlation degree, it can be ensured that the second patch is an adjacent patch with a high degree of correlation with the first patch, so that The rendering result of the first patch obtained according to the intermediate rendering result of the second patch and the intermediate rendering result of the first patch has higher accuracy.
  • the method also includes:
  • a possible implementation method of determining the degree of association between the first patch and the second patch is also provided, specifically, according to the intermediate rendering result of the first patch and the second patch.
  • the auxiliary information includes information about the surface area of the model corresponding to the patch, such as the material of the surface area of the model, the pre-stored normal information for ray tracing the model, the world coordinate information of the surface area of the model, and the like.
  • obtaining the rendering result of the first patch according to the intermediate rendering result of the first patch and the intermediate rendering result of the second patch includes:
  • the summation result is determined as the rendering result of the first patch.
  • a possible specific implementation manner of obtaining the rendering result of the first patch according to the intermediate rendering result of the second patch and the intermediate rendering result of the first patch is provided, specifically, the first patch
  • the intermediate rendering result of the patch and the intermediate rendering result of the second patch are summed, and the summation result is determined as the rendering result of the first patch, wherein the second patch has a corresponding relationship with the first patch, that is
  • the second patch is a patch determined according to the first patch.
  • the result of the summation can be made more consistent with the rendering result obtained by ray tracing rendering of the first patch, reducing the The noise of the rendered image corresponding to the first patch improves the accuracy of the rendered image.
  • summing the intermediate rendering result of the first patch and the intermediate rendering result of the second patch includes:
  • a possible specific implementation method of summing the intermediate rendering result of the first patch and the intermediate rendering result of the second patch is provided, specifically, firstly, according to the assistance of the first patch information, the auxiliary information of the second patch, and the weight recommendation model to obtain the first weight corresponding to the first patch and the second weight corresponding to the second patch, and then compare the intermediate rendering result of the first patch with the The product of the first weight is added to the intermediate rendering result of the second patch and the product of the second weight to obtain the rendering result of the first patch.
  • the first weight corresponding to the above-mentioned first patch and the second weight corresponding to the second patch can be specifically inputted into the above-mentioned weight by the auxiliary information of the first patch and the auxiliary information of the second patch
  • the weight recommendation model can be obtained by training the sample information of a large number of model patches.
  • the auxiliary information of the first patch includes one or more of the following:
  • the auxiliary information of the first mesh includes one or more of the following: the material of the first mesh, the normal information of the first mesh, the world coordinate information of the first mesh, etc.
  • the normal information of the first patch is used to indicate the orientation of the first patch.
  • the content of the auxiliary information of the second patch is similar to the content of the auxiliary information of the first patch. Based on the auxiliary information of the first patch and the auxiliary information of the second patch, the calculated correlation between the first patch and the second patch can be more accurate, and the first The weight and the second weight are more accurate.
  • the embodiment of the present application provides a device for rendering an application, where the application includes at least one model, and the model includes a plurality of patches, and the device includes:
  • an acquiring unit configured to perform ray tracing rendering on a first patch among the plurality of patches, and obtain an intermediate rendering result of the first patch
  • the acquiring unit is further configured to perform ray-tracing rendering on a second patch among the plurality of patches, and obtain an intermediate rendering result of the second patch, and the first patch and the second patch
  • the distance between slices is less than the distance threshold
  • the determination unit is configured to obtain the rendering result of the first patch according to the intermediate rendering result of the first patch and the intermediate rendering result of the second patch.
  • the degree of association between the first patch and the second patch is greater than a threshold of association degree, wherein the degree of association is used to indicate that the degree of association between the first patch and the second The degree of relatedness of the patches.
  • the device also includes:
  • a calculating unit configured to calculate a degree of association between the first patch and the second patch according to the auxiliary information of the first patch and the auxiliary information of the second patch.
  • the calculation unit is further configured to sum the intermediate rendering result of the first patch and the intermediate rendering result of the second patch;
  • the determining unit is specifically configured to determine the summation result as the rendering result of the first patch.
  • the calculation unit is specifically configured to input the auxiliary information of the first patch and the auxiliary information of the second patch into the weight recommendation model to obtain the first weight and the second Two weights;
  • the calculation unit is further configured to calculate the product of the intermediate rendering result of the first patch and the first weight, and the product of the intermediate rendering result of the second patch and the second weight add up.
  • the auxiliary information of the first patch includes one or more of the following:
  • an embodiment of the present application provides an electronic device, the electronic device includes a processor and a memory; the memory is used to store computer-executable instructions; the processor is used to execute the computer-executable instructions stored in the memory, The electronic device is configured to execute the method according to the above first aspect and any possible implementation manner.
  • the electronic device further includes a transceiver, configured to receive signals or send signals.
  • an embodiment of the present application provides a computer-readable storage medium for storing instructions or computer programs; when the instructions or the computer programs are executed, the first aspect and the The method described in any one of the possible embodiments is implemented.
  • the embodiment of the present application provides a computer program product, the computer program product includes instructions or computer programs; when the instructions or the computer programs are executed, the first aspect and any possible implementation The method described in the manner is implemented.
  • an embodiment of the present application provides a chip, the chip includes a processor, the processor is configured to execute instructions, and when the processor executes the instructions, the chip executes the first aspect and any possible The method described in the embodiment.
  • the chip further includes a communication interface, and the communication interface is used for receiving signals or sending signals.
  • an embodiment of the present application provides a system, the system comprising at least one device for rendering an application as described in the second aspect, or the electronic device as described in the third aspect, or the chip as described in the sixth aspect.
  • the process of sending information and/or receiving information in the above method can be understood as the process of outputting information by the processor, And/or, the process by which the processor receives input information.
  • the processor may output information to a transceiver (or a communication interface, or a sending module) for transmission by the transceiver. After the information is output by the processor, additional processing may be required before reaching the transceiver.
  • the transceiver or communication interface, or sending module
  • the information may require other processing before being input to the processor.
  • the sending information mentioned in the foregoing method can be understood as the processor outputting information.
  • receiving information may be understood as the processor receiving input information.
  • the above-mentioned processor may be a processor specially used to execute these methods, or may be executed by a computer in the memory instructions to perform these methods, such as a general-purpose processor.
  • the above-mentioned memory can be a non-transitory (non-transitory) memory, such as a read-only memory (Read Only Memory, ROM), which can be integrated with the processor on the same chip, or can be respectively arranged on different chips.
  • ROM read-only memory
  • the embodiment does not limit the type of the memory and the arrangement of the memory and the processor.
  • the above at least one memory is located outside the device.
  • the at least one memory is located within the device.
  • part of the memory of the at least one memory is located inside the device, and another part of the memory is located outside the device.
  • processor and the memory may also be integrated into one device, that is, the processor and the memory may also be integrated together.
  • Fig. 1a is a schematic diagram of the architecture of a rendering system provided by an embodiment of the present application.
  • FIG. 1b is a schematic diagram of the architecture of a rendering system provided by an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of a rendering method provided by an embodiment of the present application
  • FIG. 3 is a schematic diagram of a rendering scene model provided by an embodiment of the present application.
  • Fig. 4a is a schematic diagram of the effect of a three-dimensional model grid provided by the embodiment of the present application.
  • Fig. 4b is a schematic diagram of the effect of a three-dimensional model grid provided by the embodiment of the present application.
  • Fig. 5a is a schematic diagram of the effect of ray tracing rendering provided by the embodiment of the present application.
  • Fig. 5b is a schematic diagram of the effect of ray tracing rendering provided by the embodiment of the present application.
  • Fig. 5c is a schematic diagram of the effect of ray tracing rendering provided by the embodiment of the present application.
  • FIG. 6 is a schematic flowchart of a rendering method provided by an embodiment of the present application.
  • FIG. 7 is a schematic flowchart of a rendering method provided by an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a rendering device provided by an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • an embodiment means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application.
  • the occurrences of this phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is understood explicitly and implicitly by those skilled in the art that the embodiments described herein can be combined with other embodiments.
  • At least one (item) means one or more
  • “multiple” means two or more
  • at least two (items) means two or three And three or more
  • "and/or” is used to describe the association relationship of associated objects, indicating that there can be three types of relationships, for example, "A and/or B” can mean: only A exists, only B exists, and A exists at the same time and B, where A and B can be singular or plural.
  • the character “/” generally indicates that the contextual objects are an "or” relationship.
  • “At least one of the following” or similar expressions refer to any combination of these items, including any combination of single or plural items.
  • At least one item (piece) of a, b or c can mean: a, b, c, "a and b", “a and c", “b and c", or "a and b and c ", where a, b, c can be single or multiple.
  • Tile refers to the smallest plane constituting unit in two-dimensional or three-dimensional space. Usually in rendering, it is necessary to divide the model in space into countless tiny planes. These planes are also called patches, and they can be any polygon, commonly used are triangles and quadrilaterals. The intersection points of the edges of these patches are the vertices of each patch. The patches can be randomly divided according to the material or color of the model. Also, consider that every patch has a front and a back, and usually only one side is visible. Therefore, in some cases, it is necessary to perform backface culling operations on the patches.
  • the number of rays traced per mesh (sample per mesh, SPM):
  • the number of rays traced per mesh refers to the number of rays passing through each mesh.
  • a patch is the smallest unit in three-dimensional space.
  • the screen we see is made up of pixels arranged one by one, and each pixel corresponds to one or more patches in the space.
  • the color of a pixel is calculated from the color (red, green, blue, RGB) of its corresponding patch.
  • the number of rays traced per patch can affect the rendering result. The higher the number of traced rays per patch, the more rays will be cast on the model in 3D space from the viewpoint. The more rays are cast on each patch, the more accurate the calculation of the rendering result of each patch can be.
  • Ray tracing also known as ray tracing or ray tracing, is a general technique from geometric optics, which obtains a model of the path of light by tracing rays that interact with optical surfaces. It is used in the design of optical systems such as camera lenses, microscopes, telescopes, and binoculars.
  • the mathematical model of the choreographed scene emerges through a technique that traces the rays emanating from the eye rather than from the light source.
  • the results obtained are similar to those of ray casting and scanline rendering methods, but this method has better optical effects. For example, reflection and refraction have more accurate simulation effects, and the efficiency is very high, so this method is often used when pursuing such high-quality results.
  • Computer rendering technology refers to the output of real images that simulate the same model and lighting conditions in the real world through computer calculation based on 3D model data and light data.
  • ray tracing technology is one of the effective ways for modern computers to render realistic computer-rendered images based on scene information such as 3D models and lighting information.
  • the more commonly used rendering methods require a large amount of calculations during the rendering process, and the rendering time is relatively long.
  • the number of rays required to be calculated is: the number of meshes of the model*on the meshes
  • the number of rays is traced, therefore, its calculation process takes more time.
  • the method of reducing the number of ray tracing samples is usually adopted to reduce the amount of calculation and shorten the rendering time.
  • this application proposes a new rendering architecture, and proposes a new rendering method based on the architecture.
  • the rendering method proposed in this application is based on the intermediate rendering results of the target patch , and the intermediate rendering result of the adjacent patch whose distance from the target patch is less than the distance threshold, the rendering result of the target patch is obtained, which can reduce the noise of the rendered image based on the rendering result of the target patch and improve the accuracy of the rendered image.
  • the rendering method in this application achieves the removal of the noise problem caused by reducing the number of ray tracing samples at a lower computing cost, reduces the amount of rendering calculations, shortens the rendering time, and improves the accuracy of the rendered image .
  • FIG. 1a is a schematic diagram of an architecture of a rendering system provided by an embodiment of the present application.
  • the rendering system in the embodiment of the present application is used to render a 3D model of a virtual scene through a rendering method to obtain a 2D image, that is, a rendered image.
  • the rendering system in this embodiment of the present application may include: one or more terminal devices 10 , network devices 20 and a remote rendering platform 30 .
  • the remote rendering platform 30 can be deployed on a public cloud.
  • the remote rendering platform 30 and the terminal device 10 are generally deployed in different data centers.
  • the terminal device 10 can be a device that needs to display rendered images in real time, for example, it can be a virtual reality device (virtual reality, VR) for flight training, it can be a computer for virtual games and a smart phone for virtual shopping malls, etc. , not specifically limited here.
  • the terminal device 10 may 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.) device of.
  • the terminal device 10 may include hardware, an operating system, and a rendering application client.
  • the network device 20 is used to transmit data between the terminal device 10 and the remote rendering platform 30 through any communication mechanism/communication standard communication network.
  • 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 30 includes one or more remote rendering devices, and each remote rendering device includes rendering hardware, virtualization service, rendering engine and rendering application server from bottom to top.
  • rendering hardware includes computing resources, storage resources, and network resources.
  • Computing resources can adopt heterogeneous computing architecture, for example, central processing unit (central processing unit, CPU) + graphics processing unit (graphics processing unit, GPU) architecture, CPU+AI chip, CPU+GPU+AI chip architecture, etc. , not specifically limited here.
  • Storage resources may include storage devices such as internal memory and video memory.
  • Network resources may include network cards, port resources, address resources, and so on.
  • the virtualization service is a service that virtualizes the resources of the rendering device into vCPUs and other resources through virtualization technology, and flexibly isolates independent resources according to the user's needs to run the user's application program.
  • virtualization services may include virtual machine (virtual machine, VM) services and container (container) services, and VMs and containers can run rendering engines and rendering application servers.
  • Rendering engines are used to implement rendering algorithms.
  • the rendering application server is used to call the rendering engine to complete the rendering of the rendered image.
  • the rendering application client on the terminal device 10 and the rendering application server of the remote rendering platform 30 are collectively referred to as a rendering application.
  • Common rendering applications may include: game applications, VR applications, movie special effects, animation, and so on.
  • the user inputs an operation instruction through the rendering application client, and the rendering application client sends the operation instruction to the rendering application server, and the rendering application server invokes the rendering engine to generate a rendering result, and sends the rendering result to the rendering application client. Then the rendering application client converts the rendering result into an image and presents it to the user.
  • the rendering application server and the rendering application client may be provided by the rendering application provider, and the rendering engine may be provided by the cloud service provider.
  • the rendering application can be a game application.
  • the game developer of the game application installs the game application server on the remote rendering platform provided by the cloud service provider, and the game developer of the game application provides the game application client through the Internet. Download it to the user and install it on the user's terminal device.
  • the cloud service provider also provides a rendering engine, 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.
  • FIG. 1b is a schematic diagram of an architecture of a rendering system provided by an embodiment of the present application.
  • the rendering system in this embodiment of the present application may further include a management device 40 .
  • the management device 40 may be a device provided by a third party other than the user's terminal device 10 and the cloud service provider's remote rendering platform 30 .
  • the management device 40 may be a device provided by a game developer. Game developers can manage rendering applications through the management device 40 . It can be understood that the management device 40 can be set on the remote rendering platform 30, or can be set outside the remote rendering platform 30, which is not specifically limited here.
  • Figure 2 is a rendering method provided by the embodiment of the present application Flow diagram of the rendering method.
  • the SPM of the model is sampled lower than the normal value, and the sampled SPM and some other configurations are input into the renderer, and the model is rendered to obtain a model with noisy intermediate render results and intermediate render aid results.
  • the above conventional value is a commonly used SPM value in the field of ray tracing rendering. It can be understood that the conventional value can also be an adjustable value set by the system or the user according to different rendering scenarios, which is not specifically limited here.
  • the above-mentioned renderer is an electronic device capable of executing a rendering method, specifically, it may be a rendering device in the remote rendering platform 30 shown in FIG. 1a or FIG. 1b.
  • the above-mentioned other configurations may include but not limited to model materials and other information related to the model, and the above-mentioned intermediate rendering auxiliary results may include but not limited to the world coordinates of the model, the depth of the world from each angle of each patch information etc.
  • the above-mentioned denoiser based on adjacent patches belongs to a part of the rendering architecture, specifically, it may be the rendering device in the remote rendering platform 30 shown in FIG. 1a or FIG. 1b.
  • the number of adjacent patches can be configured by the user, or it can be configured by the system according to the specific rendering model, and the edge stop function used to denoise the intermediate rendering results with noise based on the rendering results of the adjacent patches , can be configured by the user, or configured by the system according to a specific rendering model.
  • adjacent patch in the embodiment of the present application can be that two adjacent patches are called adjacent patches, or two patches whose position distance is less than a certain distance threshold are mutually called adjacent patches. It is called an adjacent patch, and the distance threshold is not a fixed value. It can be different according to different rendering models and rendering scenarios. It can be a system preset value or a user configured value, which is not limited here.
  • the key step in the embodiment of the present application is to denoise the intermediate rendering result with noise based on the rendering result of adjacent patches.
  • the SPM of the model sampling is lower than the normal value, which may cause the intermediate rendering result to be noisy, or it may be due to the hardware condition limitation of the rendering device itself that causes the intermediate rendering result to be noisy.
  • This application does not constitute a limitation to this.
  • FIG. 3 is a schematic diagram of a rendering scene model provided by an embodiment of the present application.
  • 301 represents a 3D model of a "rabbit".
  • the 3D model is composed of multiple triangular planes. These planes may also be quadrilaterals or arbitrary polygons. The intersection points of the sides of each plane are the vertices of each plane.
  • Each plane on the 3D model is composed of several patches.
  • the patch here refers to the smallest plane constituting unit in two-dimensional or three-dimensional space.
  • Each patch stores a hemisphere, and 302 represents one of the patches storage hemisphere.
  • Each hemisphere stores the color of the outgoing light that takes the center of the hemisphere as a virtual viewpoint and looks out of the hemisphere in different directions, that is, the RGB value corresponding to the patch.
  • the larger the SPM of each patch means that more light will be projected into the three-dimensional space from the virtual viewpoint of the 3D model. The more rays cast on each patch, the more accurate the calculation of its rendering result.
  • the light sources can be point light sources, line light sources, or surface light sources, etc.
  • the remote rendering platform will render the scene.
  • the surface of the 3D model is divided into multiple meshes.
  • the shapes of the grids corresponding to different shapes of the 3D model may be different.
  • the grids of the sphere part and the grids of the curved object part may be completely different in shape.
  • the grids will be combined with specific embodiments below Be explained.
  • FIG. 4a is a schematic diagram of the effect of a three-dimensional model grid provided by the embodiment of the present application.
  • the grid can be expressed as a center point and the center point An approximate square with slightly bulging sides on the surface of a sphere formed by the points in the neighborhood.
  • a three-dimensional orthogonal coordinate system is constructed with the center of the sphere as an 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 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 evenly set on the sphere. If the distance between the non-central point Q i and the central point P i is the shortest, then the non-central point Q i and the center point P i belong to the same grid.
  • the grid obtained by dividing the three-dimensional model is the smallest plane component unit, which is the surface patch that constitutes the three-dimensional model . Therefore, the mesh of the model can be obtained by the mesh division method in Fig. 4a.
  • FIG. 4b is a schematic diagram of the effect of a three-dimensional model mesh provided by the embodiment of the present application.
  • the grid can be represented as a square on the curved surface represented by P(u,t).
  • u represents the offset in one direction for setting the origin of the surface
  • t represents the offset in the other 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 shape of the grid is only used as a specific example, and in practical applications, the grid may also have other shapes, which are not specifically limited here.
  • the size of the grid can be set as required, and the smaller the size of the grid can be set, the higher the accuracy of the rendered image is required.
  • the material of the above mesh can be smooth or rough.
  • the smooth material is a material with specular reflection or transmission, for example, a mirror, a metal surface, water drops, and the like.
  • Rough materials are materials with diffuse reflection, for example, natural wood and cloth.
  • FIG. 5 a is a schematic diagram of a ray tracing rendering effect provided by an embodiment of the present application.
  • a three-dimensional orthogonal coordinate system is established for the hemisphere 302 stored in any patch of the "rabbit" model 301 in Figure 3, wherein the three-dimensional orthogonal coordinate system includes the origin O (i.e. the center of the hemisphere 302), x-axis, y-axis and z-axis.
  • the outgoing light is projected in any direction outside the hemisphere in different directions, and passes through any point on the spherical surface of the hemispherical space (for example, P 1 , P 2 , P 3 , etc.), and the RGB value corresponding to the outgoing light is obtained. Therefore, the RGB values corresponding to each outgoing light of the SPM of the patch are stored in the hemisphere, that is, the RGB values corresponding to the patch.
  • FIG. 5b is a schematic diagram of a ray tracing rendering effect provided by an embodiment of the present application.
  • n rays are projected from the virtual viewpoint to multiple angle directions of different polar angles and azimuth angles outside the hemisphere, passing through multiple angle points on the surface of the hemisphere, and then projected on the opaque object 1 or opaque object 2 respectively
  • the n light intensities in the patch can be determined respectively according to the light intensities of the grids where the n projected points are located, and finally, the n light intensities are averaged to obtain The rendering result of this patch. It can be seen that the larger the number of SPMs of the patch, the better the anti-aliasing effect of the rendering result, the lower the noise index, and the higher the quality of the rendered image based on the rendering result.
  • FIG. 6 is a schematic flowchart of a rendering method provided by an embodiment of the present application.
  • the rendering method is used for rendering applications.
  • the rendering application includes at least one model, and each model includes a plurality of patches.
  • the rendering method Including but not limited to the following steps:
  • Step 601 Perform ray tracing rendering on the first patch and the second patch among the plurality of patches, and obtain an intermediate rendering result of the first patch and an intermediate rendering result of the second patch.
  • the electronic device performs ray tracing rendering on the first facet and the second facet among the plurality of faces, and obtains an intermediate rendering result of the first facet and an intermediate rendering result of the second facet.
  • the above-mentioned intermediate rendering result includes light information (such as light intensity, RGB value, etc.) corresponding to each patch.
  • light information such as light intensity, RGB value, etc.
  • the above-mentioned second surface is the adjacent surface of the first surface.
  • adjacent in the embodiment of the present application can be that two adjacent surfaces are called adjacent surfaces, or It may be that two patches whose position distance is smaller than a certain distance threshold are called adjacent patches.
  • the distance threshold is not a fixed value, it can be different according to different rendering models and rendering scenarios, it can be configured by the user, or the system can configure it according to the specific rendering model, which is not limited here.
  • the electronic device in the embodiment of the present application is a device that is equipped with a processor that can be used to execute instructions executed by a computer, and may be a network device (such as a server) or a terminal device (such as a computer).
  • the rendering device in the shown remote rendering platform is used to execute the rendering method in the embodiment of the present application, so as to improve the accuracy of the rendered image.
  • Step 602 Obtain the rendering result of the first patch according to the intermediate rendering result of the first patch and the intermediate rendering result of the second patch.
  • the electronic device obtains the rendering result of the first patch according to the intermediate rendering result of the first patch and the intermediate rendering result of the second patch.
  • the intermediate rendering result of the first patch and the intermediate rendering result of the second patch are weighted and summed, and the summed result is determined as the rendering result of the first patch.
  • the second patch has a corresponding relationship with the first patch, that is, the second patch is a patch determined according to the first patch.
  • the result of the weighted sum can be made more consistent with the rendering result obtained by ray tracing rendering of the first patch, reducing the The noise of the rendered image corresponding to the first patch improves the accuracy of the rendered image.
  • weighted summation of the intermediate rendering result of the first patch and the intermediate rendering result of the second patch can be done in the following manner:
  • the auxiliary information of the first patch the auxiliary information of the second patch and the weight recommendation model, the first weight corresponding to the first patch and the second weight corresponding to the second patch are obtained, and then the first The product of the intermediate rendering result of the patch and the first weight, and the product of the intermediate rendering result of the second patch and the second weight are added to obtain the rendering result of the first patch.
  • the first weight corresponding to the above-mentioned first patch and the second weight corresponding to the second patch can be specifically inputted into the above-mentioned weight by the auxiliary information of the first patch and the auxiliary information of the second patch obtained in the recommendation model.
  • the auxiliary information includes information about the surface area of the model corresponding to the patch, such as the material of the patch, the normal information of the patch, the world coordinate information of the patch, etc., where the normal information of the patch is used to indicate the The orientation of the piece.
  • the weight recommendation model can be obtained through training on sample information of a large number of model patches.
  • the calculation formula of the above weighted summation can be expressed as follows:
  • X 1 represents the intermediate rendering data of the first patch
  • i 1 represents the first weight corresponding to the first patch
  • X 2 represents the intermediate rendering data of the second patch
  • i 2 represents the first weight corresponding to the second patch
  • the result of weighted summation can be made more consistent with the rendering result obtained by ray tracing rendering of the first patch, the noise of the rendered image corresponding to the first patch can be reduced, and the precision of the rendered image can be improved.
  • the number of adjacent patches of the first patch in this embodiment is likely to be more than one, and the above-mentioned second patch is only an exemplary adjacent patch.
  • the intermediate rendering result of the first patch and the intermediate rendering result of the first patch are determined to be the rendering result of the first patch for illustration, which should not limit this embodiment.
  • the intermediate rendering result of the first patch and the corresponding intermediate rendering result on each adjacent patch are weighted and summed, and the summed result is determined as the rendering result of the first patch.
  • the second patch, the third patch, and the nth patch have a corresponding relationship with the first patch, that is, the second patch is a patch determined according to the first patch, and the third patch is determined according to the first patch.
  • a patch determined by a patch, and the nth patch is a patch determined according to the first patch.
  • weighted summation of the intermediate rendering result of the first patch and the corresponding intermediate rendering results on each adjacent patch can be done in the following manner:
  • the auxiliary information of the first patch and the auxiliary information of each adjacent patch are input into the weight recommendation model to obtain the first weight corresponding to the first patch and the weights corresponding to each adjacent patch, and then the first surface Add the product of the intermediate rendering result of the slice and the first weight, and the product of the corresponding intermediate rendering result on each adjacent patch and the weight corresponding to the adjacent patch.
  • the calculation formula of the weighted sum can be expressed as follows:
  • X 1 represents the intermediate rendering data of the first patch
  • i 1 represents the first weight corresponding to the first patch
  • X 2 represents the intermediate rendering data of the second patch
  • i 2 represents the first weight corresponding to the second patch
  • X 3 represents the intermediate rendering data of the third facet
  • i 3 represents the third weight corresponding to the third facet
  • X n represents the intermediate rendering data of the nth facet
  • i n represents the corresponding value of the nth facet
  • a method for determining the corresponding relationship is also provided, that is, the second patch is determined according to the first patch Methods. The method will be described below with reference to FIG. 5c.
  • FIG. 5c is a schematic diagram of a ray tracing rendering effect provided by an embodiment of the present application.
  • the left hemisphere 501 is the hemisphere stored on the first patch
  • the right hemisphere 502 is the hemisphere stored on the second patch (the adjacent patch of the first patch).
  • the second patch and the first patch there is the following corresponding relationship between the second patch and the first patch:
  • the point of intersection with the light field and the point of intersection between the second straight line and the light field are the same point.
  • the light field in this embodiment describes the spatial and directional distribution of the radiance of light in three-dimensional space, specifically, it can be the light generated by the light source, or it can be the light emitted from the virtual viewpoint of the model and reflected by the external opaque objects , is not limited here.
  • Multiple facets in the embodiment of the present application share a central point (such as the aforementioned central points O 1 and/or O 2 ).
  • the following methods can be used to determine the second surface according to the first surface:
  • a ray is emitted from the center point O 1 of the hemisphere 501 in any direction outward, and intersects the light field at a light field intersection point, denoted as G(x, y, z).
  • the patch where the ray passes through the first angle point on the surface of the hemisphere 501 is determined as the first patch, and the first angle point is denoted as
  • a ray is emitted in a specific direction from the center point O2 of the hemisphere 502, so that the ray passes through the intersection point G(x, y, z) of the above-mentioned light field.
  • the ray passes through the surface of the hemisphere 502
  • the patch where the second angle point is located is determined as the second patch, and the second angle point is denoted as The second patch is the corresponding patch of the first patch.
  • the method in this embodiment may further include:
  • the above auxiliary information includes one or more of the following: the material of the patch, the normal information of the patch, the world coordinate information of the patch, etc.
  • the normal information of the patch is used to indicate the orientation of the patch .
  • the calculated correlation degree between the first mesh and the second mesh can be more accurate.
  • the above correlation threshold is not a fixed value, it can be different according to different model rendering application scenarios, it can be the value preset by the system, or it can be the value configured by the user, which is not limited here.
  • the correlation degree between the first patch and the second patch is greater than the threshold value of the correlation degree, it can be ensured that the second patch is an adjacent patch with a high degree of correlation with the first patch, so that The accuracy of the rendering result of the first patch determined according to the intermediate rendering result of the second patch and the intermediate rendering result of the first patch is higher.
  • FIG. 7 is a schematic flowchart of another rendering method provided by an embodiment of the present application, which can also be understood as a modification or supplement to the flowchart of the rendering method in FIG. 6 above.
  • this rendering method is implemented on the basis of the rendering system shown in Figure 1a or Figure 1b above, including but not limited to the following steps:
  • the terminal device sends a rendering request to a remote rendering platform through a network device.
  • the remote rendering platform receives the rendering request sent by the terminal device through the network device, and the rendering request includes the mesh information of the model to be rendered.
  • the remote rendering platform performs ray tracing rendering on the first patch and the second patch, and obtains an intermediate rendering result of the first patch and an intermediate rendering result of the second patch.
  • the intermediate rendering result includes light information corresponding to each patch (such as light intensity, RGB value, etc.), and the second patch is an adjacent patch of the first patch. Specifically, it can be two adjacent patches. The patches are called adjacent patches to each other, and two patches whose position distance is smaller than a certain distance threshold can also be called adjacent patches.
  • the specific rendering process reference may be made to the description of ray tracing rendering in FIG. 5a and FIG. 5b above, which will not be repeated here.
  • ray tracing rendering can be performed on all patches of the model to be rendered to obtain an intermediate rendering result of each patch.
  • S703 Determine to obtain a rendering result of the first patch according to the intermediate rendering result of the first patch and the intermediate rendering result of the second patch.
  • the intermediate rendering result of the first patch and the intermediate rendering result of the second patch are weighted and summed, and the summed result is determined as the rendering result of the first patch.
  • the second patch has a corresponding relationship with the first patch, that is, the second patch is a patch determined according to the first patch.
  • the rendering result of each patch of the model to be rendered can be determined to obtain the rendering result of the model to be rendered, and based on the model to be rendered The rendering result of , get its corresponding rendered image.
  • the remote rendering platform sends the rendered image to the terminal device through the network device.
  • the terminal device receives the rendered image sent by the remote rendering platform through the network device, and displays the rendered image.
  • FIG. 8 is a schematic structural diagram of a rendering device provided by an embodiment of the present application.
  • the rendering device 80 may include an acquisition unit 801 and a determination unit 802, where each unit is described as follows:
  • An acquisition unit 801 configured to perform ray-tracing rendering on a first patch among the plurality of patches, and obtain an intermediate rendering result of the first patch;
  • the obtaining unit 801 is further configured to perform ray tracing rendering on the second patch among the plurality of patches, and obtain an intermediate rendering result of the second patch, and the first patch and the second patch The distance between patches is less than the distance threshold;
  • the determining unit 802 is configured to obtain the rendering result of the first patch according to the intermediate rendering result of the first patch and the intermediate rendering result of the second patch.
  • a method for rendering an application is provided.
  • the rendering method relates to the field of image processing technology.
  • the intermediate rendering result of the adjacent patch of the patch and the intermediate rendering result of the target patch to obtain the rendering result of the target patch, wherein the distance between the adjacent patch of the target patch and the target patch is smaller than the distance threshold.
  • ray-tracing rendering is performed on the first and second patches among the multiple patches to obtain the intermediate rendering results of the first patch and the intermediate rendering results of the second patch, and then according to the The intermediate rendering result and the intermediate rendering result of the first patch, to obtain the rendering result of the first patch, wherein the second patch is the adjacent patch of the first patch, that is, the difference between the second patch and the first patch The distance between them is less than the distance threshold.
  • the distance threshold is not a fixed value and can vary according to different rendering models and rendering scenarios. It can be a system preset value or a user configured value, which is not limited here. Through the embodiments of the present application, the noise of the rendered image obtained based on the rendering result of the first patch can be reduced, and the accuracy of the rendered image can be improved.
  • the degree of association between the first patch and the second patch is greater than a threshold of association degree, wherein the degree of association is used to indicate that the degree of association between the first patch and the second The degree of relatedness of the patches.
  • the correlation degree between the first patch and the second patch is greater than the correlation threshold, that is, the correlation degree between the first patch and the second patch is greater than the correlation threshold, wherein the correlation threshold is not a fixed
  • the value of can vary according to different model rendering application scenarios. It can be a system preset value or a user configured value, which is not limited here.
  • the correlation degree between the first patch and the second patch is greater than the threshold value of the correlation degree, it can be ensured that the second patch is an adjacent patch with a high degree of correlation with the first patch, so that The rendering result of the first patch obtained according to the intermediate rendering result of the second patch and the intermediate rendering result of the first patch has higher accuracy.
  • the device also includes:
  • a calculating unit 803 configured to calculate a degree of association between the first patch and the second patch according to the auxiliary information of the first patch and the auxiliary information of the second patch.
  • a possible implementation method of determining the degree of association between the first patch and the second patch is also provided, specifically, according to the intermediate rendering result of the first patch and the second patch.
  • the auxiliary information includes information about the surface area of the model corresponding to the patch, such as the material of the surface area of the model, the pre-stored normal information for ray tracing the model, the world coordinate information of the surface area of the model, and the like.
  • the calculation unit 803 is further configured to sum the intermediate rendering result of the first patch and the intermediate rendering result of the second patch;
  • the determining unit 802 is specifically configured to determine the summation result as the rendering result of the first patch.
  • a possible specific implementation manner of obtaining the rendering result of the first patch according to the intermediate rendering result of the second patch and the intermediate rendering result of the first patch is provided, specifically, the first patch
  • the intermediate rendering result of the patch and the intermediate rendering result of the second patch are summed, and the summation result is determined as the rendering result of the first patch, wherein the second patch has a corresponding relationship with the first patch, that is
  • the second patch is a patch determined according to the first patch.
  • the result of the summation can be made more consistent with the rendering result obtained by ray tracing rendering of the first patch, reducing the The noise of the rendered image corresponding to the first patch improves the accuracy of the rendered image.
  • the calculation unit 803 is specifically configured to input the auxiliary information of the first patch and the auxiliary information of the second patch into the weight recommendation model to obtain the first weight and second weight;
  • the calculation unit 803 is further configured to calculate the product of the intermediate rendering result of the first patch and the first weight, and the product of the intermediate rendering result of the second patch and the second weight The products are added.
  • a possible specific implementation method of summing the intermediate rendering result of the first patch and the intermediate rendering result of the second patch is provided, specifically, firstly, according to the assistance of the first patch information, the auxiliary information of the second patch, and the weight recommendation model to obtain the first weight corresponding to the first patch and the second weight corresponding to the second patch, and then compare the intermediate rendering result of the first patch with the The product of the first weight is added to the intermediate rendering result of the second patch and the product of the second weight to obtain the rendering result of the first patch.
  • the first weight corresponding to the above-mentioned first patch and the second weight corresponding to the second patch can be specifically inputted into the above-mentioned weight by the auxiliary information of the first patch and the auxiliary information of the second patch
  • the weight recommendation model can be obtained by training the sample information of a large number of model patches.
  • the auxiliary information of the first patch includes one or more of the following:
  • the auxiliary information of the first mesh includes one or more of the following: the material of the first mesh, the normal information of the first mesh, the world coordinate information of the first mesh, etc.
  • the normal information of the first patch is used to indicate the orientation of the first patch.
  • the content of the auxiliary information of the second patch is similar to the content of the auxiliary information of the first patch. Based on the auxiliary information of the first patch and the auxiliary information of the second patch, the calculated correlation between the first patch and the second patch can be more accurate, and the first The weight and the second weight are more accurate.
  • each unit in the device shown in FIG. 8 can be separately or all combined into one or several other units to form, or one (some) units can be further divided into more functional units. It is composed of multiple small units, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application.
  • the above-mentioned units are divided based on logical functions. In practical applications, the functions of one unit may also be realized by multiple units, or the functions of multiple units may be realized by one unit. In other embodiments of the present application, the electronic device may also include other units. In practical applications, these functions may also be assisted by other units, and may be implemented cooperatively by multiple units.
  • the rendering result of the first patch is obtained according to the intermediate rendering result of the first patch and the intermediate rendering result of the second patch whose distance from the first patch is smaller than the distance threshold,
  • the noise of the rendered image obtained based on the rendering result of the first patch can be reduced, and the accuracy of the rendered image can be improved.
  • FIG. 9 is a schematic structural diagram of an electronic device 90 provided in an embodiment of the present application.
  • the electronic device 90 may include a memory 901 and a processor 902 .
  • a communication interface 903 and a bus 904 may also be included, wherein the memory 901 , the processor 902 and the communication interface 903 are connected to each other through the bus 904 .
  • the communication interface 903 is used for data interaction with the above-mentioned rendering device 80 .
  • the memory 901 is used to provide a storage space, in which data such as operating systems and computer programs can be stored.
  • Memory 901 includes, but is not limited to, random access memory (random access memory, RAM), read-only memory (read-only memory, ROM), erasable programmable read-only memory (erasable programmable read only memory, EPROM), or Portable read-only memory (compact disc read-only memory, CD-ROM).
  • the processor 902 is a module for performing arithmetic operations and logic operations, and may be in a processing module such as a central processing unit (central processing unit, CPU), a graphics processing unit (graphics processing unit, GPU) or a microprocessor (microprocessor unit, MPU). one or a combination of more.
  • a processing module such as a central processing unit (central processing unit, CPU), a graphics processing unit (graphics processing unit, GPU) or a microprocessor (microprocessor unit, MPU). one or a combination of more.
  • a computer program is stored in the memory 901, and the processor 902 calls the computer program stored in the memory 901 to execute the rendering methods shown in the above-mentioned Figures 6 and 7:
  • the processor 902 calls the computer program stored in the memory 901, which can also be used to execute the method steps performed by the various units in the rendering device 80 shown in FIG. No longer.
  • the rendering result of the first patch is obtained according to the intermediate rendering result of the first patch and the intermediate rendering result of the second patch whose distance from the first patch is smaller than the distance threshold,
  • the noise of the rendered image obtained based on the rendering result of the first patch can be reduced, and the accuracy of the rendered image can be improved.
  • the embodiment of the present application also provides a computer-readable storage medium.
  • the above-mentioned computer-readable storage medium stores a computer program.
  • the above-mentioned computer program is run on one or more processors, the above-mentioned FIG. 6 and FIG. 7 can be realized. method shown.
  • An embodiment of the present application further provides a computer program product, where the computer program product includes a computer program, and when the computer program product runs on a processor, the methods shown in FIG. 6 and FIG. 7 above can be implemented.
  • the embodiment of the present application also provides a chip, the chip includes a processor, and the processor is configured to execute instructions, and when the processor executes the instructions, the above methods shown in FIG. 6 and FIG. 7 can be implemented.
  • the chip also includes a communication interface, which is used for inputting signals or outputting signals.
  • the embodiment of the present application also provides a system, which includes at least one rendering device 80 or electronic device 90 or chip as described above.
  • the processes can be completed by hardware related to computer programs, and the computer programs can be stored in computer-readable storage media.
  • the computer programs When executed, , may include the processes of the foregoing method embodiments.
  • the aforementioned storage medium includes: various media capable of storing computer program codes such as read-only memory ROM or random access memory RAM, magnetic disk or optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The present application relates to the technical field of image processing, and discloses a method for rendering an application and a related device. The application comprises at least one model, the model having a plurality of patches. The rendering method comprises: performing ray tracing rendering on a first patch among a plurality of patches, and obtaining an intermediate rendering result of the first patch; performing ray tracing rendering on a second patch among the plurality of patches, and obtaining an intermediate rendering result of the second patch, the distance between the first patch and the second patch being less than a distance threshold; and, according to the intermediate rendering result of the first patch and the intermediate rendering result of the second patch, obtaining a rendering result of the first patch. In the present method, the rendering result of the first patch is obtained according to the intermediate rendering result of the first patch and the intermediate rendering result of the second patch, for which the distance to the first patch is less than the distance threshold, thus noise points in a rendered image obtained on the basis of the rendering result of the first patch are reduced, and the accuracy of the rendered image is improved.

Description

一种对应用进行渲染的方法及相关装置A method and related device for rendering an application
本申请要求于2021年08月30日提交中国专利局、申请号为2021110056234、申请名称为“一种对应用进行渲染的方法及相关装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 2021110056234 and the application title "A Method for Rendering Applications and Related Devices" filed with the China Patent Office on August 30, 2021, the entire contents of which are incorporated by reference in this application.
技术领域technical field
本申请涉及图像处理技术领域,尤其涉及一种对应用进行渲染的方法及相关装置。The present application relates to the technical field of image processing, and in particular to a method for rendering an application and related devices.
背景技术Background technique
计算机渲染技术是指根据三维模型数据和光线数据,通过计算机的计算,输出模拟真实世界中相同模型和光照条件下的真实图像。光线追踪技术是现代计算机根据三维模型和光照信息等场景信息,渲染出逼真的计算机渲染图像的有效方式之一。Computer rendering technology refers to the output of real images that simulate the same model and lighting conditions in the real world through computer calculation based on 3D model data and light data. Ray tracing technology is one of the effective ways for modern computers to render realistic computer-rendered images based on scene information such as 3D models and lighting information.
目前,较为常用的渲染方法在渲染过程中的计算量较大,渲染时间较长,为解决该问题,通常采取降低光线追踪采样数的方法,减少计算量,缩短渲染时长。At present, the more commonly used rendering methods have a large amount of calculation in the rendering process and a long rendering time. To solve this problem, the method of reducing the number of ray tracing samples is usually adopted to reduce the amount of calculation and shorten the rendering time.
但是,上述采取降低光线追踪采样数的渲染方法得到的渲染图像的噪点过多,图像精度较低,因此,如何提高渲染图像的精度成为了技术领域人员重要的研究课题。However, the rendered image obtained by the above-mentioned rendering method of reducing the number of ray tracing samples has too much noise and low image precision. Therefore, how to improve the precision of the rendered image has become an important research topic for technical personnel.
发明内容Contents of the invention
本申请实施例提供了一种对应用进行渲染的方法及相关装置,根据第一面片的中间渲染结果,以及与第一面片距离小于距离阈值的第二面片的中间渲染结果,得到第一面片的渲染结果,可以使得基于第一面片的渲染结果得到的渲染图像的噪点减少,提高渲染图像精度。The embodiment of the present application provides a method and a related device for rendering an application. According to the intermediate rendering result of the first patch and the intermediate rendering result of the second patch whose distance from the first patch is smaller than the distance threshold, the second patch is obtained. The rendering result of one patch can reduce the noise of the rendered image obtained based on the rendering result of the first patch, and improve the precision of the rendered image.
第一方面,本申请实施例提供了一种对应用进行渲染的方法,该应用包括至少一个模型,该模型包括多个面片,该方法包括:In the first aspect, the embodiment of the present application provides a method for rendering an application, where the application includes at least one model, and the model includes multiple meshes, and the method includes:
对所述多个面片中的第一面片进行光线追踪渲染,获得所述第一面片的中间渲染结果;performing ray-tracing rendering on a first patch among the plurality of patches, and obtaining an intermediate rendering result of the first patch;
对所述多个面片中的第二面片进行光线追踪渲染,获得所述第二面片的中间渲染结果,所述第一面片与所述第二面片之间的距离小于距离阈值;performing ray-tracing rendering on a second patch among the plurality of patches to obtain an intermediate rendering result of the second patch, and the distance between the first patch and the second patch is smaller than a distance threshold ;
根据所述第一面片的中间渲染结果以及所述第二面片的中间渲染结果,获得所述第一面片的渲染结果。Obtain the rendering result of the first patch according to the intermediate rendering result of the first patch and the intermediate rendering result of the second patch.
在本申请实施例中,提供了一种对应用进行渲染的方法,该渲染方法涉及图像处理技术领域,首先对各个面片进行光线追踪渲染,得到各个面片的中间渲染结果,然后根据目标面片的邻接面片的中间渲染结果和该目标面片的中间渲染结果,得到该目标面片的渲染结果,其中,目标面片的邻接面片与目标面片的距离小于距离阈值。具体为,对多个面片中的第一面片和第二面片进行光线追踪渲染,得到第一面片的中间渲染结果和第二面片的中间渲染结果,然后根据第二面片的中间渲染结果和第一面片的中间渲染结果,得到第一面片的渲染结果,其中,上述第二面片为第一面片的邻接面片,即第二面片与第一面片之间的距离小于距离阈值,该距离阈值不是一个固定的值,可以根据不同的渲染模型和渲染场景而不同,可以是***预设的值,也可以是用户配置的值,此处不做限定。通过本申请实施例,可以使得基于第一面片的渲染结果得到的渲染图像的噪点减少,提高渲染图像精度。In the embodiment of the present application, a method for rendering an application is provided. The rendering method relates to the field of image processing technology. The intermediate rendering result of the adjacent patch of the patch and the intermediate rendering result of the target patch to obtain the rendering result of the target patch, wherein the distance between the adjacent patch of the target patch and the target patch is smaller than the distance threshold. Specifically, ray-tracing rendering is performed on the first and second patches among the multiple patches to obtain the intermediate rendering results of the first patch and the intermediate rendering results of the second patch, and then according to the The intermediate rendering result and the intermediate rendering result of the first patch, to obtain the rendering result of the first patch, wherein the second patch is the adjacent patch of the first patch, that is, the difference between the second patch and the first patch The distance between them is less than the distance threshold. The distance threshold is not a fixed value and can vary according to different rendering models and rendering scenarios. It can be a system preset value or a user configured value, which is not limited here. Through the embodiments of the present application, the noise of the rendered image obtained based on the rendering result of the first patch can be reduced, and the accuracy of the rendered image can be improved.
在一种可能的实施方式中,所述第一面片与所述第二面片的关联度大于关联度阈值,其 中,所述关联度用于指示所述第一面片与所述第二面片的相关程度。In a possible implementation manner, the degree of association between the first patch and the second patch is greater than a threshold of association degree, wherein the degree of association is used to indicate that the degree of association between the first patch and the second The degree of relatedness of the patches.
在本申请实施例中,第一面片与第二面片的关联度大于关联度阈值,即第一面片与第二面片的相关程度大于关联度阈值,其中,关联度阈值不是一个固定的值,可以根据不同的模型渲染应用场景而不同,可以是***预设的值,也可以是用户配置的值,此处不做限定。通过本申请实施例,基于第一面片和第二面片的关联度大于关联度阈值的前提下,可以确保第二面片为与第一面片关联程度较高的邻接面片,从而使得根据该第二面片的中间渲染结果和第一面片的中间渲染结果得到的第一面片的渲染结果的准确性更高。In the embodiment of the present application, the correlation degree between the first patch and the second patch is greater than the correlation threshold, that is, the correlation degree between the first patch and the second patch is greater than the correlation threshold, wherein the correlation threshold is not a fixed The value of can vary according to different model rendering application scenarios. It can be a system preset value or a user configured value, which is not limited here. Through the embodiment of the present application, based on the premise that the correlation degree between the first patch and the second patch is greater than the threshold value of the correlation degree, it can be ensured that the second patch is an adjacent patch with a high degree of correlation with the first patch, so that The rendering result of the first patch obtained according to the intermediate rendering result of the second patch and the intermediate rendering result of the first patch has higher accuracy.
在一种可能的实施方式中,方法还包括:In a possible implementation manner, the method also includes:
根据所述第一面片的辅助信息和所述第二面片的辅助信息,计算所述第一面片和所述第二面片的关联度。Calculate the degree of association between the first patch and the second patch according to the auxiliary information of the first patch and the auxiliary information of the second patch.
在本申请实施例中,还提供了一种确定第一面片和第二面片的关联度的可能的具体实施方式,具体为,在根据第一面片的中间渲染结果和第二面片的中间渲染结果得到第一面片的渲染结果之前,先根据第一面片的辅助信息和第二面片的辅助信息,计算得到第一面片和第二面片之间的相关程度,即第一面片和第二面片的关联度。其中,上述辅助信息包括面片对应的模型的表面区域的相关信息,比如,模型的表面区域的材质,对模型进行光线追踪的预存法线信息,模型的表面区域的世界坐标信息等。通过本申请实施例,基于第一面片的辅助信息和第二面片的辅助信息,可以使计算得到的第一面片和第二面片的关联度更为准确。In the embodiment of the present application, a possible implementation method of determining the degree of association between the first patch and the second patch is also provided, specifically, according to the intermediate rendering result of the first patch and the second patch Before getting the rendering result of the first patch, first calculate the degree of correlation between the first patch and the second patch according to the auxiliary information of the first patch and the auxiliary information of the second patch, that is The degree of association between the first patch and the second patch. Wherein, the auxiliary information includes information about the surface area of the model corresponding to the patch, such as the material of the surface area of the model, the pre-stored normal information for ray tracing the model, the world coordinate information of the surface area of the model, and the like. Through the embodiment of the present application, based on the auxiliary information of the first mesh and the auxiliary information of the second mesh, the calculated correlation degree between the first mesh and the second mesh can be more accurate.
在一种可能的实施方式中,根据所述第一面片的中间渲染结果以及所述第二面片的中间渲染结果,获得所述第一面片的渲染结果,包括:In a possible implementation manner, obtaining the rendering result of the first patch according to the intermediate rendering result of the first patch and the intermediate rendering result of the second patch includes:
将所述第一面片的中间渲染结果和所述第二面片的中间渲染结果进行求和;summing the intermediate rendering result of the first patch and the intermediate rendering result of the second patch;
将所述求和结果确定为所述第一面片的渲染结果。The summation result is determined as the rendering result of the first patch.
在本申请实施例中,提供了一种根据第二面片的中间渲染结果和第一面片的中间渲染结果得到第一面片的渲染结果的可能的具体实施方式,具体为,将第一面片的中间渲染结果和第二面片的中间渲染结果进行求和,并将求和结果确定为第一面片的渲染结果,其中,第二面片与第一面片具有对应关系,即第二面片是根据第一面片确定的一个面片。通过本申请实施例,基于第一面片的中间渲染结果和第二面片的中间渲染结果求和,可以使得求和的结果更符合第一面片的光线追踪渲染得到的渲染结果,减少该第一面片对应的渲染图像的噪点,提高渲染图像精度。In the embodiment of the present application, a possible specific implementation manner of obtaining the rendering result of the first patch according to the intermediate rendering result of the second patch and the intermediate rendering result of the first patch is provided, specifically, the first patch The intermediate rendering result of the patch and the intermediate rendering result of the second patch are summed, and the summation result is determined as the rendering result of the first patch, wherein the second patch has a corresponding relationship with the first patch, that is The second patch is a patch determined according to the first patch. Through the embodiment of the present application, based on the sum of the intermediate rendering results of the first patch and the intermediate rendering results of the second patch, the result of the summation can be made more consistent with the rendering result obtained by ray tracing rendering of the first patch, reducing the The noise of the rendered image corresponding to the first patch improves the accuracy of the rendered image.
在一种可能的实施方式中,将所述第一面片的中间渲染结果和所述第二面片的中间渲染结果进行求和,包括:In a possible implementation manner, summing the intermediate rendering result of the first patch and the intermediate rendering result of the second patch includes:
将所述第一面片的辅助信息和所述第二面片的辅助信息输入权值推荐模型,获得第一权值和第二权值;inputting the auxiliary information of the first patch and the auxiliary information of the second patch into a weight recommendation model to obtain a first weight and a second weight;
将所述第一面片的中间渲染结果与所述第一权值的乘积,和所述第二面片的中间渲染结果与所述第二权值的乘积相加。Adding the product of the intermediate rendering result of the first patch and the first weight, and the product of the intermediate rendering result of the second patch and the second weight.
在本申请实施例中,提供了一种将第一面片的中间渲染结果和第二面片的中间渲染结果进行求和的可能的具体实施方式,具体为,首先根据第一面片的辅助信息、第二面片的辅助信息以及权值推荐模型,得到第一面片对应的第一权值和第二面片对应的第二权值,再将第一面片的中间渲染结果与该第一权值的乘积,和第二面片的中间渲染结果与该第二权值的乘积进行相加,得到第一面片的渲染结果。其中,上述第一面片对应的第一权值和第二面片对应的第二权值,具体可以是通过将第一面片的辅助信息和第二面片的辅助信息输入至上述权值推荐模型中得到的,该权值推荐模型可以是通过大量模型的面片的样本信息训练得到。通 过本申请实施例,可以使得加权求和的结果更符合第一面片光线追踪渲染得到的渲染结果,减少该第一面片对应的渲染图像的噪点,提高渲染图像精度。In the embodiment of the present application, a possible specific implementation method of summing the intermediate rendering result of the first patch and the intermediate rendering result of the second patch is provided, specifically, firstly, according to the assistance of the first patch information, the auxiliary information of the second patch, and the weight recommendation model to obtain the first weight corresponding to the first patch and the second weight corresponding to the second patch, and then compare the intermediate rendering result of the first patch with the The product of the first weight is added to the intermediate rendering result of the second patch and the product of the second weight to obtain the rendering result of the first patch. Wherein, the first weight corresponding to the above-mentioned first patch and the second weight corresponding to the second patch can be specifically inputted into the above-mentioned weight by the auxiliary information of the first patch and the auxiliary information of the second patch The weight recommendation model can be obtained by training the sample information of a large number of model patches. Through the embodiment of the present application, the result of weighted summation can be made more consistent with the rendering result obtained by ray tracing rendering of the first patch, the noise of the rendered image corresponding to the first patch can be reduced, and the accuracy of the rendered image can be improved.
在一种可能的实施方式中,所述第一面片的辅助信息包括下述一个或多个:In a possible implementation manner, the auxiliary information of the first patch includes one or more of the following:
所述第一面片的材质,所述第一面片的法线信息,所述第一面片的世界坐标信息,其中,所述第一面片的法线信息用于指示所述第一面片的朝向。The material of the first patch, the normal information of the first patch, and the world coordinate information of the first patch, wherein the normal information of the first patch is used to indicate that the first The orientation of the patch.
在本申请实施例中,第一面片的辅助信息包括下述中的一项或多项:第一面片的材质,第一面片的法线信息,第一面片的世界坐标信息等,该第一面片的法线信息用于指示第一面片的朝向。同理,第二面片的辅助信息内容与第一面片的辅助信息的内容类似。基于第一面片的辅助信息和第二面片的辅助信息,可以使计算得到的第一面片和第二面片的关联度更为准确,并且,使输入权值推荐模型得到的第一权值和第二权值更为准确。In this embodiment of the application, the auxiliary information of the first mesh includes one or more of the following: the material of the first mesh, the normal information of the first mesh, the world coordinate information of the first mesh, etc. , the normal information of the first patch is used to indicate the orientation of the first patch. Similarly, the content of the auxiliary information of the second patch is similar to the content of the auxiliary information of the first patch. Based on the auxiliary information of the first patch and the auxiliary information of the second patch, the calculated correlation between the first patch and the second patch can be more accurate, and the first The weight and the second weight are more accurate.
第二方面,本申请实施例提供了一种对应用进行渲染的装置,该应用包括至少一个模型,该模型包括多个面片,该装置包括:In the second aspect, the embodiment of the present application provides a device for rendering an application, where the application includes at least one model, and the model includes a plurality of patches, and the device includes:
获取单元,用于对所述多个面片中的第一面片进行光线追踪渲染,获得所述第一面片的中间渲染结果;an acquiring unit, configured to perform ray tracing rendering on a first patch among the plurality of patches, and obtain an intermediate rendering result of the first patch;
所述获取单元,还用于对所述多个面片中的第二面片进行光线追踪渲染,获得所述第二面片的中间渲染结果,所述第一面片与所述第二面片之间的距离小于距离阈值;The acquiring unit is further configured to perform ray-tracing rendering on a second patch among the plurality of patches, and obtain an intermediate rendering result of the second patch, and the first patch and the second patch The distance between slices is less than the distance threshold;
确定单元,用于根据所述第一面片的中间渲染结果以及所述第二面片的中间渲染结果,获得所述第一面片的渲染结果。The determination unit is configured to obtain the rendering result of the first patch according to the intermediate rendering result of the first patch and the intermediate rendering result of the second patch.
在一种可能的实施方式中,所述第一面片与所述第二面片的关联度大于关联度阈值,其中,所述关联度用于指示所述第一面片与所述第二面片的相关程度。In a possible implementation manner, the degree of association between the first patch and the second patch is greater than a threshold of association degree, wherein the degree of association is used to indicate that the degree of association between the first patch and the second The degree of relatedness of the patches.
在一种可能的实施方式中,所述装置还包括:In a possible implementation manner, the device also includes:
计算单元,用于根据所述第一面片的辅助信息和所述第二面片的辅助信息,计算所述第一面片和所述第二面片的关联度。A calculating unit, configured to calculate a degree of association between the first patch and the second patch according to the auxiliary information of the first patch and the auxiliary information of the second patch.
在一种可能的实施方式中,所述计算单元,还用于将所述第一面片的中间渲染结果和所述第二面片的中间渲染结果进行求和;In a possible implementation manner, the calculation unit is further configured to sum the intermediate rendering result of the first patch and the intermediate rendering result of the second patch;
所述确定单元,具体用于将所述求和结果确定为所述第一面片的渲染结果。The determining unit is specifically configured to determine the summation result as the rendering result of the first patch.
在一种可能的实施方式中,所述计算单元,具体用于将所述第一面片的辅助信息和所述第二面片的辅助信息输入权值推荐模型,获得第一权值和第二权值;In a possible implementation manner, the calculation unit is specifically configured to input the auxiliary information of the first patch and the auxiliary information of the second patch into the weight recommendation model to obtain the first weight and the second Two weights;
所述计算单元,具体还用于将所述第一面片的中间渲染结果与所述第一权值的乘积,和所述第二面片的中间渲染结果与所述第二权值的乘积相加。The calculation unit is further configured to calculate the product of the intermediate rendering result of the first patch and the first weight, and the product of the intermediate rendering result of the second patch and the second weight add up.
在一种可能的实施方式中,所述第一面片的辅助信息包括下述一个或多个:In a possible implementation manner, the auxiliary information of the first patch includes one or more of the following:
所述第一面片的材质,所述第一面片的法线信息,所述第一面片的世界坐标信息,其中,所述第一面片的法线信息用于指示所述第一面片的朝向。The material of the first patch, the normal information of the first patch, and the world coordinate information of the first patch, wherein the normal information of the first patch is used to indicate that the first The orientation of the patch.
关于第二方面以及任一项可能的实施方式所带来的技术效果,可参考对应于第一方面以及相应的实施方式的技术效果的介绍。Regarding the technical effect brought about by the second aspect and any possible implementation manner, reference may be made to the introduction corresponding to the technical effect of the first aspect and the corresponding implementation manner.
第三方面,本申请实施例提供一种电子设备,所述电子设备包括处理器和存储器;所述存储器用于存储计算机执行指令;所述处理器用于执行所述存储器所存储的计算机执行指令,以使所述电子设备执行如上述第一方面以及任一项可能的实施方式的方法。可选的,所述电子设备还包括收发器,所述收发器,用于接收信号或者发送信号。In a third aspect, an embodiment of the present application provides an electronic device, the electronic device includes a processor and a memory; the memory is used to store computer-executable instructions; the processor is used to execute the computer-executable instructions stored in the memory, The electronic device is configured to execute the method according to the above first aspect and any possible implementation manner. Optionally, the electronic device further includes a transceiver, configured to receive signals or send signals.
第四方面,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质用于存储指令或计算机程序;当所述指令或所述计算机程序被执行时,使得第一方面以及任一项 可能的实施方式所述的方法被实现。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium for storing instructions or computer programs; when the instructions or the computer programs are executed, the first aspect and the The method described in any one of the possible embodiments is implemented.
第五方面,本申请实施例提供一种计算机程序产品,所述计算机程序产品包括指令或计算机程序;当所述指令或所述计算机程序被执行时,使得第一方面以及任一项可能的实施方式所述的方法被实现。In the fifth aspect, the embodiment of the present application provides a computer program product, the computer program product includes instructions or computer programs; when the instructions or the computer programs are executed, the first aspect and any possible implementation The method described in the manner is implemented.
第六方面,本申请实施例提供一种芯片,该芯片包括处理器,所述处理器用于执行指令,当该处理器执行所述指令时,使得该芯片执行如第一方面以及任一项可能的实施方式所述的方法。可选的,该芯片还包括通信接口,所述通信接口用于接收信号或发送信号。In a sixth aspect, an embodiment of the present application provides a chip, the chip includes a processor, the processor is configured to execute instructions, and when the processor executes the instructions, the chip executes the first aspect and any possible The method described in the embodiment. Optionally, the chip further includes a communication interface, and the communication interface is used for receiving signals or sending signals.
第七方面,本申请实施例提供一种***,所述***包括至少一个如第二方面所述的对应用进行渲染的装置或第三方面所述的电子设备或第六方面所述的芯片。In a seventh aspect, an embodiment of the present application provides a system, the system comprising at least one device for rendering an application as described in the second aspect, or the electronic device as described in the third aspect, or the chip as described in the sixth aspect.
此外,在执行上述第一方面以及任一项可能的实施方式所述的方法的过程中,上述方法中有关发送信息和/或接收信息等的过程,可以理解为由处理器输出信息的过程,和/或,处理器接收输入的信息的过程。在输出信息时,处理器可以将信息输出给收发器(或者通信接口、或发送模块),以便由收发器进行发射。信息在由处理器输出之后,还可能需要进行其他的处理,然后才到达收发器。类似的,处理器接收输入的信息时,收发器(或者通信接口、或发送模块)接收信息,并将其输入处理器。更进一步的,在收发器收到该信息之后,该信息可能需要进行其他的处理,然后才输入处理器。In addition, in the process of executing the method described in the above first aspect and any possible implementation manner, the process of sending information and/or receiving information in the above method can be understood as the process of outputting information by the processor, And/or, the process by which the processor receives input information. When outputting information, the processor may output information to a transceiver (or a communication interface, or a sending module) for transmission by the transceiver. After the information is output by the processor, additional processing may be required before reaching the transceiver. Similarly, when the processor receives input information, the transceiver (or communication interface, or sending module) receives the information and inputs it to the processor. Furthermore, after the transceiver receives the information, the information may require other processing before being input to the processor.
基于上述原理,举例来说,前述方法中提及的发送信息可以理解为处理器输出信息。又例如,接收信息可以理解为处理器接收输入的信息。Based on the above principles, for example, the sending information mentioned in the foregoing method can be understood as the processor outputting information. For another example, receiving information may be understood as the processor receiving input information.
可选的,对于处理器所涉及的发射、发送和接收等操作,如果没有特殊说明,或者,如果未与其在相关描述中的实际作用或者内在逻辑相抵触,则均可以更加一般性的理解为处理器输出和接收、输入等操作。Optionally, for operations such as transmitting, sending, and receiving involved in the processor, if there is no special description, or if it does not conflict with its actual function or internal logic in the relevant description, it can be understood more generally as Processor output and receive, input and other operations.
可选的,在执行上述第一方面以及任一项可能的实施方式所述的方法的过程中,上述处理器可以是专门用于执行这些方法的处理器,也可以是通过执行存储器中的计算机指令来执行这些方法的处理器,例如通用处理器。上述存储器可以为非瞬时性(non-transitory)存储器,例如只读存储器(Read Only Memory,ROM),其可以与处理器集成在同一块芯片上,也可以分别设置在不同的芯片上,本申请实施例对存储器的类型以及存储器与处理器的设置方式不做限定。Optionally, during the process of executing the method described in the above first aspect and any possible implementation manner, the above-mentioned processor may be a processor specially used to execute these methods, or may be executed by a computer in the memory instructions to perform these methods, such as a general-purpose processor. The above-mentioned memory can be a non-transitory (non-transitory) memory, such as a read-only memory (Read Only Memory, ROM), which can be integrated with the processor on the same chip, or can be respectively arranged on different chips. The embodiment does not limit the type of the memory and the arrangement of the memory and the processor.
在一种可能的实施方式中,上述至少一个存储器位于装置之外。In a possible implementation manner, the above at least one memory is located outside the device.
在又一种可能的实施方式中,上述至少一个存储器位于装置之内。In yet another possible implementation manner, the at least one memory is located within the device.
在又一种可能的实施方式之中,上述至少一个存储器的部分存储器位于装置之内,另一部分存储器位于装置之外。In yet another possible implementation manner, part of the memory of the at least one memory is located inside the device, and another part of the memory is located outside the device.
本申请中,处理器和存储器还可能集成于一个器件中,即处理器和存储器还可以被集成在一起。In this application, the processor and the memory may also be integrated into one device, that is, the processor and the memory may also be integrated together.
附图说明Description of drawings
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例中所需要使用的附图作简单地介绍,显而易见地,下面所描述的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the accompanying drawings that need to be used in the embodiments of the present application. Obviously, the accompanying drawings described below are only some embodiments of the present application. Those of ordinary skill in the art can also obtain other drawings based on these drawings without making creative efforts.
图1a为本申请实施例提供的一种渲染***的架构示意图;Fig. 1a is a schematic diagram of the architecture of a rendering system provided by an embodiment of the present application;
图1b为本申请实施例提供的一种渲染***的架构示意图;FIG. 1b is a schematic diagram of the architecture of a rendering system provided by an embodiment of the present application;
图2为本申请实施例提供的一种渲染方法的流程示意图;FIG. 2 is a schematic flowchart of a rendering method provided by an embodiment of the present application;
图3为本申请实施例提供的一种渲染场景的模型示意图;FIG. 3 is a schematic diagram of a rendering scene model provided by an embodiment of the present application;
图4a为本申请实施例提供的一种三维模型网格的效果示意图;Fig. 4a is a schematic diagram of the effect of a three-dimensional model grid provided by the embodiment of the present application;
图4b为本申请实施例提供的一种三维模型网格的效果示意图;Fig. 4b is a schematic diagram of the effect of a three-dimensional model grid provided by the embodiment of the present application;
图5a为本申请实施例提供的一种光线追踪渲染的效果示意图;Fig. 5a is a schematic diagram of the effect of ray tracing rendering provided by the embodiment of the present application;
图5b为本申请实施例提供的一种光线追踪渲染的效果示意图;Fig. 5b is a schematic diagram of the effect of ray tracing rendering provided by the embodiment of the present application;
图5c为本申请实施例提供的一种光线追踪渲染的效果示意图;Fig. 5c is a schematic diagram of the effect of ray tracing rendering provided by the embodiment of the present application;
图6为本申请实施例提供的一种渲染方法的流程示意图;FIG. 6 is a schematic flowchart of a rendering method provided by an embodiment of the present application;
图7为本申请实施例提供的一种渲染方法的流程示意图;FIG. 7 is a schematic flowchart of a rendering method provided by an embodiment of the present application;
图8为本申请实施例提供的一种渲染装置的结构示意图;FIG. 8 is a schematic structural diagram of a rendering device provided by an embodiment of the present application;
图9为本申请实施例提供的一种电子设备的结构示意图。FIG. 9 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
为了使本申请的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图对本申请实施例进行描述。In order to make the purpose, technical solution and advantages of the present application clearer, the following will describe the embodiments of the present application in conjunction with the accompanying drawings in the embodiments of the present application.
本申请的说明书、权利要求书及附图中的术语“第一”和“第二”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们的任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、***、产品或设备等,没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元等,或可选地还包括对于这些过程、方法、产品或设备等固有的其它步骤或单元。The terms "first" and "second" in the specification, claims and drawings of the present application are used to distinguish different objects, rather than to describe a specific order. Furthermore, the terms "comprising" and "having", as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally It also includes other steps or units inherent to these processes, methods, products, or devices.
在本文中提及的“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员可以显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The occurrences of this phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is understood explicitly and implicitly by those skilled in the art that the embodiments described herein can be combined with other embodiments.
应当理解,在本申请中,“至少一个(项)”是指一个或者多个,“多个”是指两个或两个以上,“至少两个(项)”是指两个或三个及三个以上,“和/或”,用于描述关联对象的关联关系,表示可以存在三种关系,例如,“A和/或B”可以表示:只存在A,只存在B以及同时存在A和B三种情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b或c中的至少一项(个),可以表示:a,b,c,“a和b”,“a和c”,“b和c”,或“a和b和c”,其中a,b,c可以是单个,也可以是多个。It should be understood that in this application, "at least one (item)" means one or more, "multiple" means two or more, and "at least two (items)" means two or three And three or more, "and/or", is used to describe the association relationship of associated objects, indicating that there can be three types of relationships, for example, "A and/or B" can mean: only A exists, only B exists, and A exists at the same time and B, where A and B can be singular or plural. The character "/" generally indicates that the contextual objects are an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one item (piece) of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c ", where a, b, c can be single or multiple.
本申请提供了一种渲染方法,为了更清楚地描述本申请的方案,下面先介绍一些与渲染相关的知识。This application provides a rendering method. In order to describe the solution of this application more clearly, some knowledge related to rendering will be introduced below.
面片(tile):面片是指二维或三维空间中最小的平面构成单元。通常在渲染中,需要将空间中的模型划分成无数个微小的平面。这些平面又被称为面片,它们可以是任意多边形,常用的是三角形和四边形。这些面片各条边的交点则是各个面片的顶点。面片可以是根据模型的材质或颜色等信息随机划分的。此外,考虑到每一个面片都有正反两面,而通常只有一面是可以被看到的。因此,在一些情况下需要对面片进行背面剔除的操作。Tile: Tile refers to the smallest plane constituting unit in two-dimensional or three-dimensional space. Usually in rendering, it is necessary to divide the model in space into countless tiny planes. These planes are also called patches, and they can be any polygon, commonly used are triangles and quadrilaterals. The intersection points of the edges of these patches are the vertices of each patch. The patches can be randomly divided according to the material or color of the model. Also, consider that every patch has a front and a back, and usually only one side is visible. Therefore, in some cases, it is necessary to perform backface culling operations on the patches.
每面片追踪光线数(sample per mesh,SPM):每面片追踪光线数是指每一个面片中通过的光线数量。其中,面片是在三维空间中的最小单元。通常我们看到的屏幕是由一个个的像 素排列而成的,每一个像素对应空间中的一个或多个面片。像素的颜色是根据其对应面片的颜色(red,green,blue,RGB)计算得到的。在光线追踪中,每面片追踪光线数的大小可以影响渲染的结果。每面片追踪光线数越大,意味着从视点会有更多的光线投向三维空间中的模型。每一面片上被投射的光线数越多,各个面片的渲染结果计算就可以更为准确。The number of rays traced per mesh (sample per mesh, SPM): The number of rays traced per mesh refers to the number of rays passing through each mesh. Among them, a patch is the smallest unit in three-dimensional space. Usually the screen we see is made up of pixels arranged one by one, and each pixel corresponds to one or more patches in the space. The color of a pixel is calculated from the color (red, green, blue, RGB) of its corresponding patch. In ray tracing, the number of rays traced per patch can affect the rendering result. The higher the number of traced rays per patch, the more rays will be cast on the model in 3D space from the viewpoint. The more rays are cast on each patch, the more accurate the calculation of the rendering result of each patch can be.
光线追踪(ray tracing):光线追踪又称为光迹跟踪或光线追迹,来自于几何光学的一项通用技术,它通过跟踪与光学表面发生交互作用的光线从而得到光线经过路径的模型。它用于光学***设计,如照相机镜头、显微镜、望远镜以及双目镜等。当用于渲染时,跟踪从眼睛发出的光线而不是光源发出的光线,通过这样一项技术生成编排好的场景的数学模型显现出来。这样得到的结果类似于光线投射与扫描线渲染方法的结果,但是这种方法有更好的光学效果。例如对于反射与折射有更准确的模拟效果,并且效率非常高,所以当追求这样高质量结果时候经常使用这种方法。具体地,光线追踪方法首先计算一条光线在被介质吸收,或者改变方向前,光线在介质中传播的距离、方向以及到达的新位置。然后从这个新的位置产生出一条新的光线,使用同样的处理方法,最终计算出一个完整的光线在介质中传播的路径。由于该算法是成像***的完全模拟,所以可以模拟生成复杂的图片。Ray tracing (ray tracing): Ray tracing, also known as ray tracing or ray tracing, is a general technique from geometric optics, which obtains a model of the path of light by tracing rays that interact with optical surfaces. It is used in the design of optical systems such as camera lenses, microscopes, telescopes, and binoculars. When used for rendering, the mathematical model of the choreographed scene emerges through a technique that traces the rays emanating from the eye rather than from the light source. The results obtained are similar to those of ray casting and scanline rendering methods, but this method has better optical effects. For example, reflection and refraction have more accurate simulation effects, and the efficiency is very high, so this method is often used when pursuing such high-quality results. Specifically, the ray tracing method first calculates the distance, direction, and new position that a ray travels in a medium before it is absorbed by the medium or changes direction. Then a new ray is generated from this new position, and the same processing method is used to finally calculate a complete path of the ray in the medium. Since the algorithm is a complete simulation of the imaging system, complex pictures can be simulated.
计算机渲染技术:是指根据三维模型数据和光线数据,通过计算机的计算,输出模拟真实世界中相同模型和光照条件下的真实图像。其中,光线追踪技术是现代计算机根据三维模型和光照信息等场景信息,渲染出逼真的计算机渲染图像的有效方式之一。Computer rendering technology: refers to the output of real images that simulate the same model and lighting conditions in the real world through computer calculation based on 3D model data and light data. Among them, ray tracing technology is one of the effective ways for modern computers to render realistic computer-rendered images based on scene information such as 3D models and lighting information.
目前,较为常用的渲染方法在渲染过程中的计算量较大,渲染时间较长,以一个3D场景下的模型渲染为例,其所需计算的光线数量为:模型的面片数*面片上追踪光线数,因此,其计算过程耗时较多。为解决该问题,通常采取降低光线追踪采样数的方法,以减少计算量,缩短渲染时长。At present, the more commonly used rendering methods require a large amount of calculations during the rendering process, and the rendering time is relatively long. Taking the model rendering in a 3D scene as an example, the number of rays required to be calculated is: the number of meshes of the model*on the meshes The number of rays is traced, therefore, its calculation process takes more time. To solve this problem, the method of reducing the number of ray tracing samples is usually adopted to reduce the amount of calculation and shorten the rendering time.
但是,上述采取降低光线追踪采样数的渲染方法得到的渲染图像的噪点过多,图像精度较低,因此,如何提高渲染图像的精度是一个亟待解决的技术问题,也可以理解为,如何以较低运算成本去除因降低光线追踪采样数所带来的噪点是一个亟待解决的技术问题。However, the above-mentioned rendering method of reducing the number of ray tracing samples results in too much noise in the rendered image, and the image accuracy is low. Therefore, how to improve the accuracy of the rendered image is a technical problem that needs to be solved urgently. It is an urgent technical problem to remove the noise caused by reducing the number of ray tracing samples with low computing cost.
基于目前渲染方法中存在的技术问题,本申请提出一种新的渲染架构,并基于该架构相应的提出一种新的渲染方法,本申请所提出的渲染方法,根据目标面片的中间渲染结果,以及与目标面片距离小于距离阈值的邻接面片的中间渲染结果,得到该目标面片的渲染结果,可以使得基于目标面片的渲染结果得到的渲染图像的噪点减少,提高渲染图像精度。Based on the technical problems existing in the current rendering method, this application proposes a new rendering architecture, and proposes a new rendering method based on the architecture. The rendering method proposed in this application is based on the intermediate rendering results of the target patch , and the intermediate rendering result of the adjacent patch whose distance from the target patch is less than the distance threshold, the rendering result of the target patch is obtained, which can reduce the noise of the rendered image based on the rendering result of the target patch and improve the accuracy of the rendered image.
也可以理解为,本申请中的渲染方法,实现了以较低运算成本去除因降低光线追踪采样数所带来的噪点问题,减少了渲染计算量,缩短了渲染时长,提高了渲染图像的精度。It can also be understood that the rendering method in this application achieves the removal of the noise problem caused by reducing the number of ray tracing samples at a lower computing cost, reduces the amount of rendering calculations, shortens the rendering time, and improves the accuracy of the rendered image .
本申请提供的技术方案可以应用于各种渲染***、渲染应用、渲染场景,下面将结合本申请实施例中的附图对本申请实施例进行描述。The technical solutions provided in the present application can be applied to various rendering systems, rendering applications, and rendering scenes. The embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
请参阅图1a,图1a为本申请实施例提供的一种渲染***的架构示意图。Please refer to FIG. 1a . FIG. 1a is a schematic diagram of an architecture of a rendering system provided by an embodiment of the present application.
本申请实施例中的渲染***用于通过渲染方法对虚拟场景的3D模型进行渲染得到2D图像,即渲染图像。如图1a所示,本申请实施例中的渲染***可以包括:一个或多个终端设备10、网络设备20以及远程渲染平台30。远程渲染平台30具体可以部署在公有云上。远程渲染平台30和终端设备10一般部署在不同的数据中心内。The rendering system in the embodiment of the present application is used to render a 3D model of a virtual scene through a rendering method to obtain a 2D image, that is, a rendered image. As shown in FIG. 1 a , the rendering system in this embodiment of the present application may include: one or more terminal devices 10 , network devices 20 and a remote rendering platform 30 . Specifically, the remote rendering platform 30 can be deployed on a public cloud. The remote rendering platform 30 and the terminal device 10 are generally deployed in different data centers.
终端设备10可以是需要实时显示渲染图像的设备,例如,可以是用于飞行训练的虚拟现实设备(virtual reality,VR)、可以是用于虚拟游戏的电脑以及用于虚拟商城的智能手机等等,此处不作具体限定。终端设备10可以是高配置、高性能(例如,多核、高主频、内存大等等)的设备,也可以是低配置,低性能(例如,单核、低主频、内存小等等)的设备。在一些具 体的实施例中,终端设备10可以包括硬件、操作***以及渲染应用客户端。The terminal device 10 can be a device that needs to display rendered images in real time, for example, it can be a virtual reality device (virtual reality, VR) for flight training, it can be a computer for virtual games and a smart phone for virtual shopping malls, etc. , not specifically limited here. The terminal device 10 may 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.) device of. In some specific embodiments, the terminal device 10 may include hardware, an operating system, and a rendering application client.
网络设备20用于在终端设备10通过任何通信机制/通信标准的通信网络与远程渲染平台30之间传输数据。其中,通信网络可以是广域网、局域网、点对点连接等方式,或它们的任意组合。The network device 20 is used to transmit data between the terminal device 10 and the remote rendering platform 30 through any communication mechanism/communication standard communication network. Wherein, the communication network may be a wide area network, a local area network, a point-to-point connection, etc., or any combination thereof.
远程渲染平台30包括一个或多个远程渲染装置,每个远程渲染装置自下而上包括渲染硬件、虚拟化服务、渲染引擎以及渲染应用服务端。其中,渲染硬件包括计算资源、存储资源以及网络资源。计算资源可以采用异构计算架构,例如,可以采用中央处理器(central processing unit,CPU)+图形处理器(graphics processing unit,GPU)架构,CPU+AI芯片,CPU+GPU+AI芯片架构等等,此处不作具体限定。存储资源可以包括内存、显存等存储设备。网络资源可以包括网卡、端口资源、地址资源等。虚拟化服务是通过虚拟化技术将渲染装置的资源虚拟化为vCPU等自己的,并按照用户的需求灵活地隔离出相互独立的资源以运行用户的应用程序的服务。常见的,虚拟化服务可以包括虚拟机(virtual machine,VM)服务以及容器(container)服务,VM和容器可以运行渲染引擎和渲染应用服务端。渲染引擎用于实现渲染算法。渲染应用服务端用于调用渲染引擎以完成渲染图像的渲染。The remote rendering platform 30 includes one or more remote rendering devices, and each remote rendering device includes rendering hardware, virtualization service, rendering engine and rendering application server from bottom to top. Wherein, rendering hardware includes computing resources, storage resources, and network resources. Computing resources can adopt heterogeneous computing architecture, for example, central processing unit (central processing unit, CPU) + graphics processing unit (graphics processing unit, GPU) architecture, CPU+AI chip, CPU+GPU+AI chip architecture, etc. , not specifically limited here. Storage resources may include storage devices such as internal memory and video memory. Network resources may include network cards, port resources, address resources, and so on. The virtualization service is a service that virtualizes the resources of the rendering device into vCPUs and other resources through virtualization technology, and flexibly isolates independent resources according to the user's needs to run the user's application program. Commonly, virtualization services may include virtual machine (virtual machine, VM) services and container (container) services, and VMs and containers can run rendering engines and rendering application servers. Rendering engines are used to implement rendering algorithms. The rendering application server is used to call the rendering engine to complete the rendering of the rendered image.
终端设备10上的渲染应用客户端和远程渲染平台30的渲染应用服务端合称渲染应用。常见的渲染应用可以包括:游戏应用、VR应用、电影特效以及动画等等。用户通过渲染应用客户端输入操作指令,渲染应用客户端将操作指令发送给渲染应用服务端,渲染应用服务端调用渲染引擎生成渲染结果,将渲染结果发送至渲染应用客户端。然后再由渲染应用客户端将渲染结果转换成图像呈现给用户。在一些具体的实施方式中,渲染应用服务端和渲染应用客户端可以是渲染应用提供商提供的,渲染引擎可以是云服务提供商提供的。举个例子说明,渲染应用可以是游戏应用,游戏应用的游戏开发商将游戏应用服务端安装在云服务提供商提供的远程渲染平台上,游戏应用的游戏开发商将游戏应用客户端通过互联网提供给用户下载,并安装在用户的终端设备上。此外,云服务提供商还提供了渲染引擎,渲染引擎可以为游戏应用提供计算能力。在另一种具体的实施方式中,渲染应用客户端、渲染应用服务端和渲染引擎可以均是云服务提供商提供的。The rendering application client on the terminal device 10 and the rendering application server of the remote rendering platform 30 are collectively referred to as a rendering application. Common rendering applications may include: game applications, VR applications, movie special effects, animation, and so on. The user inputs an operation instruction through the rendering application client, and the rendering application client sends the operation instruction to the rendering application server, and the rendering application server invokes the rendering engine to generate a rendering result, and sends the rendering result to the rendering application client. Then the rendering application client converts the rendering result into an image and presents it to the user. In some specific implementation manners, the rendering application server and the rendering application client may be provided by the rendering application provider, and the rendering engine may be provided by the cloud service provider. For example, the rendering application can be a game application. The game developer of the game application installs the game application server on the remote rendering platform provided by the cloud service provider, and the game developer of the game application provides the game application client through the Internet. Download it to the user and install it on the user's terminal device. In addition, the cloud service provider also provides a rendering engine, which can provide computing power for game applications. In another specific implementation manner, the rendering application client, the rendering application server, and the rendering engine may all be provided by a cloud service provider.
请参阅图1b,图1b为本申请实施例提供的一种渲染***的架构示意图。Please refer to FIG. 1b . FIG. 1b is a schematic diagram of an architecture of a rendering system provided by an embodiment of the present application.
如图1b所示,本申请实施例中的渲染***还可以包括管理设备40。管理设备40可以是用户的终端设备10和云服务提供商的远程渲染平台30之外的第三方提供的设备。例如,管理设备40可以是游戏开发商提供的设备。游戏开发商可以通过管理设备40对渲染应用进行管理。可以理解的是,管理设备40可以设置于远程渲染平台30之上,也可以设置于远程渲染平台30之外,此处不作具体限定。As shown in FIG. 1 b , the rendering system in this embodiment of the present application may further include a management device 40 . The management device 40 may be a device provided by a third party other than the user's terminal device 10 and the cloud service provider's remote rendering platform 30 . For example, the management device 40 may be a device provided by a game developer. Game developers can manage rendering applications through the management device 40 . It can be understood that the management device 40 can be set on the remote rendering platform 30, or can be set outside the remote rendering platform 30, which is not specifically limited here.
以上述图1a或图1b所示的渲染***为例,基于该渲染***的架构,本申请实施例还提供了一种渲染方法,请参阅图2,图2为本申请实施例提供的一种渲染方法的流程示意图。Taking the rendering system shown in Figure 1a or Figure 1b above as an example, based on the architecture of the rendering system, the embodiment of the present application also provides a rendering method, please refer to Figure 2, which is a rendering method provided by the embodiment of the present application Flow diagram of the rendering method.
如图2所示,为减少渲染计算量,缩短渲染时长,对模型采样低于常规值的SPM,将采样得到的SPM和一些其他配置输入至渲染器中,对该模型进行渲染,得到带有噪声的中间渲染结果和中间渲染辅助结果。其中,上述常规值为光线追踪渲染领域内常用的SPM值,可以理解的是,该常规值也可以为***或用户根据不同渲染场景进行设置的可调节值,此处不作具体限定。上述渲染器为可执行渲染方法的电子设备,具体可以是上述图1a或图1b所示的远程渲染平台30中的渲染装置。可选的,上述其他配置可以包括但不限于模型材质等一些与模型相关的信息,上述中间渲染辅助结果可以包括但不限于模型的世界坐标、从每个面片的各个角度看向世界的深度信息等。As shown in Figure 2, in order to reduce the amount of rendering calculations and shorten the rendering time, the SPM of the model is sampled lower than the normal value, and the sampled SPM and some other configurations are input into the renderer, and the model is rendered to obtain a model with Noisy intermediate render results and intermediate render aid results. Wherein, the above conventional value is a commonly used SPM value in the field of ray tracing rendering. It can be understood that the conventional value can also be an adjustable value set by the system or the user according to different rendering scenarios, which is not specifically limited here. The above-mentioned renderer is an electronic device capable of executing a rendering method, specifically, it may be a rendering device in the remote rendering platform 30 shown in FIG. 1a or FIG. 1b. Optionally, the above-mentioned other configurations may include but not limited to model materials and other information related to the model, and the above-mentioned intermediate rendering auxiliary results may include but not limited to the world coordinates of the model, the depth of the world from each angle of each patch information etc.
然后将上述得到的中间渲染结果和中间渲染辅助结果输入至基于邻接面片降噪器中,基于邻接面片的渲染结果对带有噪声的中间渲染结果进行降噪,得到无噪声的渲染结果。其中,上述基于邻接面片降噪器属于渲染架构中的一部分,具体可以是上述图1a或图1b所示的远程渲染平台30中的渲染装置。可选的,邻接面片数可以是用户配置的,也可以是***根据具体的渲染模型进行配置,基于邻接面片的渲染结果对带有噪声的中间渲染结果进行降噪所用到的边缘停止函数,可以是用户配置的,也可以是***根据具体的渲染模型进行配置。Then input the intermediate rendering results and intermediate rendering auxiliary results obtained above into the denoiser based on adjacent patches, and denoise the intermediate rendering results with noise based on the rendering results of adjacent patches to obtain noise-free rendering results. Wherein, the above-mentioned denoiser based on adjacent patches belongs to a part of the rendering architecture, specifically, it may be the rendering device in the remote rendering platform 30 shown in FIG. 1a or FIG. 1b. Optionally, the number of adjacent patches can be configured by the user, or it can be configured by the system according to the specific rendering model, and the edge stop function used to denoise the intermediate rendering results with noise based on the rendering results of the adjacent patches , can be configured by the user, or configured by the system according to a specific rendering model.
可以理解的是,本申请实施例中对“邻接”的定义,可以是两个位置相邻的面片互相称为邻接面片,也可以是两个位置距离小于某一个距离阈值的面片互相称为邻接面片,且该距离阈值不是一个固定的值,可以根据不同的渲染模型和渲染场景而不同,可以是***预设的值,也可以是用户配置的值,此处不做限定。It can be understood that the definition of "adjacency" in the embodiment of the present application can be that two adjacent patches are called adjacent patches, or two patches whose position distance is less than a certain distance threshold are mutually called adjacent patches. It is called an adjacent patch, and the distance threshold is not a fixed value. It can be different according to different rendering models and rendering scenarios. It can be a system preset value or a user configured value, which is not limited here.
需要注意的是,本申请实施例中的关键步骤在于,基于邻接面片的渲染结果对带有噪声的中间渲染结果进行降噪。至于如何导致中间渲染结果带有噪声,可以是对模型采样低于常规值的SPM导致中间渲染结果带有噪声,也可能是因渲染设备本身的硬件条件限制导致中间渲染结果带有噪声,本申请实施例对此并不构成限定。It should be noted that the key step in the embodiment of the present application is to denoise the intermediate rendering result with noise based on the rendering result of adjacent patches. As for how to cause noise in the intermediate rendering result, it may be that the SPM of the model sampling is lower than the normal value, which may cause the intermediate rendering result to be noisy, or it may be due to the hardware condition limitation of the rendering device itself that causes the intermediate rendering result to be noisy. This application The embodiment does not constitute a limitation to this.
请参阅图3,图3为本申请实施例提供的一种渲染场景的模型示意图。Please refer to FIG. 3 . FIG. 3 is a schematic diagram of a rendering scene model provided by an embodiment of the present application.
如图3所示,301表示一个“兔子”的3D模型,该3D模型由多个三角形平面构成,这些平面也可以是四边形或任意多边形,各个平面各条边的交点则是各个平面的顶点。该3D模型上的每个平面都由若干个面片组成,这里的面片是指二维或三维空间中最小的平面构成单元,每个面片都存储了一个半球,302表示其中一个面片存储的半球。在每个半球上都存储了以该半球心为虚拟视点,按照不同方向看向半球外的出射光的颜色,即该面片对应的RGB值。其中,每个面片的SPM越大,意味着从3D模型的虚拟视点会有更多的光线投向三维空间。每个面片上投射的光线数越多,其渲染结果的计算就更准确。As shown in FIG. 3 , 301 represents a 3D model of a "rabbit". The 3D model is composed of multiple triangular planes. These planes may also be quadrilaterals or arbitrary polygons. The intersection points of the sides of each plane are the vertices of each plane. Each plane on the 3D model is composed of several patches. The patch here refers to the smallest plane constituting unit in two-dimensional or three-dimensional space. Each patch stores a hemisphere, and 302 represents one of the patches storage hemisphere. Each hemisphere stores the color of the outgoing light that takes the center of the hemisphere as a virtual viewpoint and looks out of the hemisphere in different directions, that is, the RGB value corresponding to the patch. Among them, the larger the SPM of each patch means that more light will be projected into the three-dimensional space from the virtual viewpoint of the 3D model. The more rays cast on each patch, the more accurate the calculation of its rendering result.
假设在该渲染场景下存在一个或多个光源,其中,光源可以是点光源、线光源或者面光源等,光源产生的光线照射到该3D模型上,此时,远程渲染平台将渲染场景中的3D模型的表面分割成多个网格。其中,3D模型的不同形状部分对应的网格的形状可以是不同的,例如,球体部分的网格和曲面物体部分的网格的形状可以完全不同,下面将分别结合具体的实施例对网格进行说明。Assume that there are one or more light sources in the rendering scene, where the light sources can be point light sources, line light sources, or surface light sources, etc., and the light generated by the light sources shines on the 3D model. At this time, the remote rendering platform will render the scene. The surface of the 3D model is divided into multiple meshes. Wherein, the shapes of the grids corresponding to different shapes of the 3D model may be different. For example, the grids of the sphere part and the grids of the curved object part may be completely different in shape. The grids will be combined with specific embodiments below Be explained.
请参阅图4a,图4a为本申请实施例提供的一种三维模型网格的效果示意图。Please refer to FIG. 4a, which is a schematic diagram of the effect of a three-dimensional model grid provided by the embodiment of the present application.
如图4a所示,以三维模型为球体为例,网格可以表示为中心点
Figure PCTCN2022079498-appb-000001
以及中心点
Figure PCTCN2022079498-appb-000002
邻域的点构成的球体表面上的四边略鼓的近似方块。以球体的球心作为原点构建三维正交坐标系,其中,三维正交坐标系包括x轴,y轴以及z轴。中心点P的各个坐标中,r表示为球心O至中心点P的线段OP的长度,θ表示为线段OP与正z轴之间的夹角,
Figure PCTCN2022079498-appb-000003
表示为线段OP在xOy平面上的投影与x轴之间的夹角。在一些具体的实施例中,可以在球体上均匀地设置n个中心点P 1,P 2,…,P n,如果非中心点Q i与中心点P i的距离最短,则非中心点Q i与中心点P i属于同一个网格。
As shown in Figure 4a, taking the 3D model as a sphere as an example, the grid can be expressed as a center point
Figure PCTCN2022079498-appb-000001
and the center point
Figure PCTCN2022079498-appb-000002
An approximate square with slightly bulging sides on the surface of a sphere formed by the points in the neighborhood. A three-dimensional orthogonal coordinate system is constructed with the center of the sphere as an origin, wherein the three-dimensional orthogonal coordinate system includes an x-axis, a y-axis and a z-axis. In each coordinate of the center point P, r represents the length of the line segment OP from the center O to the center point P, and θ represents the angle between the line segment OP and the positive z-axis,
Figure PCTCN2022079498-appb-000003
Expressed as the angle between the projection of the line segment OP on the xOy plane and the x-axis. In some specific embodiments, n center points P 1 , P 2 ,...,P n can be evenly set on the sphere. If the distance between the non-central point Q i and the central point P i is the shortest, then the non-central point Q i and the center point P i belong to the same grid.
基于上述三维模型网格的效果示意图可以看出,当三维正交坐标的划分标准越精细,以非中心点Q i与中心点P i构成的网格也越精细。基于该网格的划分原理可以得出,当三维正交坐标的划分标准达到一定精度要求时,划分该三维模型所得到的网格为最小的平面构成单元,即是构成该三维模型的面片。因此,可以通过图4a中的网格划分方法得到模型的面片。 Based on the effect diagram of the above-mentioned 3D model grid, it can be seen that when the division standard of the 3D orthogonal coordinates is finer, the grid composed of the non-center point Q i and the center point P i is also finer. Based on the division principle of the grid, it can be concluded that when the division standard of the three-dimensional orthogonal coordinates reaches a certain accuracy requirement, the grid obtained by dividing the three-dimensional model is the smallest plane component unit, which is the surface patch that constitutes the three-dimensional model . Therefore, the mesh of the model can be obtained by the mesh division method in Fig. 4a.
请参阅图4b,图4b为本申请实施例提供的一种三维模型网格的效果示意图。Please refer to FIG. 4b. FIG. 4b is a schematic diagram of the effect of a three-dimensional model mesh provided by the embodiment of the present application.
如图4b所示,以三维模型为曲面物体为例,网格可以表示为P(u,t)所代表的曲面表面上 的方块。以曲面的一个设定原点构建二维正交坐标系,其中,坐标系包括u轴,t轴。u表示为曲面设定原点一个方向的偏移量,t表示另一个正交方向的偏移量,P(u,t)表示如图4b所示的(u,t)坐标系中四个顶点所组成的方块。As shown in Figure 4b, taking the 3D model as a curved object as an example, the grid can be represented as a square on the curved surface represented by P(u,t). Construct a two-dimensional orthogonal coordinate system with a set origin of the surface, where the coordinate system includes u-axis and t-axis. u represents the offset in one direction for setting the origin of the surface, t represents the offset in the other orthogonal direction, and P(u,t) represents the four vertices in the (u,t) coordinate system as shown in Figure 4b composed of blocks.
同理,基于上述三维模型网格的效果示意图可以看出,当二维正交坐标的划分标准越精细,P(u,t)所表示的方块也越精细。基于该网格的划分原理可以得出,当二维正交坐标的划分标准达到一定精度要求时,划分该三维模型所得到的方块为最小的平面构成单元,即是构成该三维模型的面片。因此,还可以通过图4b中的网格划分方法得到模型的面片。Similarly, based on the above schematic diagram of the effect of the 3D model grid, it can be seen that when the division standard of the 2D orthogonal coordinates is finer, the square represented by P(u,t) is also finer. Based on the principle of grid division, it can be concluded that when the division standard of two-dimensional orthogonal coordinates reaches a certain accuracy requirement, the square obtained by dividing the three-dimensional model is the smallest plane constituent unit, that is, the mesh that constitutes the three-dimensional model . Therefore, the mesh of the model can also be obtained through the mesh division method in Fig. 4b.
可以理解的是,上述的网格的形状仅仅是作为具体的举例,在实际应用中,网格还可能是其他的形状,此处不作具体限定。另外,网格的尺寸可以根据需要进行设置,对渲染出的图像的精度要求越高的情况下,网格的尺寸可以设置得越小。上述网格的材料可以是光滑的,也可以是粗糙的。其中,光滑的材料为存在镜面反射的材料或者存在透射的材料,例如,镜面、金属表面以及水珠等等。粗糙的材料为存在漫反射的材料,例如,天然的木头以及布等。It can be understood that the above-mentioned shape of the grid is only used as a specific example, and in practical applications, the grid may also have other shapes, which are not specifically limited here. In addition, the size of the grid can be set as required, and the smaller the size of the grid can be set, the higher the accuracy of the rendered image is required. The material of the above mesh can be smooth or rough. Wherein, the smooth material is a material with specular reflection or transmission, for example, a mirror, a metal surface, water drops, and the like. Rough materials are materials with diffuse reflection, for example, natural wood and cloth.
以上述图4a或图4b所示的划分三维模型网格为例,基于该三维模型网格,本申请实施例还提供了对上述图3中的模型进行光线追踪渲染的方法。具体可参阅图5a,图5a为本申请实施例提供的一种光线追踪渲染的效果示意图。Taking the division of the 3D model grid shown in FIG. 4a or FIG. 4b as an example, based on the 3D model grid, the embodiment of the present application also provides a method for performing ray tracing rendering on the model in FIG. 3 above. For details, please refer to FIG. 5 a , which is a schematic diagram of a ray tracing rendering effect provided by an embodiment of the present application.
如图5a所示,对图3中“兔子”模型301的任意一个面片存储的半球302建立三维正交坐标系,其中,三维正交坐标系包括原点O(即半球302的球心),x轴,y轴以及z轴。在xOy平面的360°视角范围内,以及直线Ox到射线Oz的90°视角范围内或直线Oy到射线Oz的90°视角范围内,以原点O为虚拟视点,按照多个极角、方位角的不同方向向半球外的任意方向投射出射光,经过半球空间的球面上任意一点(例如,P 1,P 2,P 3等),获得该出射光对应的RGB值。因此,该半球上存储了该面片的SPM的各条出射光对应的RGB值,即该面片对应的RGB值。 As shown in Figure 5a, a three-dimensional orthogonal coordinate system is established for the hemisphere 302 stored in any patch of the "rabbit" model 301 in Figure 3, wherein the three-dimensional orthogonal coordinate system includes the origin O (i.e. the center of the hemisphere 302), x-axis, y-axis and z-axis. Within the 360° viewing angle range of the xOy plane, and within the 90° viewing angle range from the straight line Ox to the ray Oz or within the 90° viewing angle range from the straight line Oy to the ray Oz, with the origin O as the virtual viewpoint, according to multiple polar angles and azimuth angles The outgoing light is projected in any direction outside the hemisphere in different directions, and passes through any point on the spherical surface of the hemispherical space (for example, P 1 , P 2 , P 3 , etc.), and the RGB value corresponding to the outgoing light is obtained. Therefore, the RGB values corresponding to each outgoing light of the SPM of the patch are stored in the hemisphere, that is, the RGB values corresponding to the patch.
请参阅图5b,图5b为本申请实施例提供的一种光线追踪渲染的效果示意图。Please refer to FIG. 5b. FIG. 5b is a schematic diagram of a ray tracing rendering effect provided by an embodiment of the present application.
如图5b所示,从虚拟视点向半球外的不同极角、方位角的多个角度方向投射出n根光线,经过半球表面的多个角度点,然后各自投射在不透明物体1或不透明物体2的n个投射点所在的网格上,从而可以根据n个投射点所在的网格的光线强度分别确定该面片内的n个光线强度,最后,对这n个光线强度求平均,从而得到该面片的渲染结果。可以看出,该面片的SPM数量越多,渲染结果的抗锯齿效果越好,噪声指标越低,基于该渲染结果得到的渲染图像的画质也越高。As shown in Figure 5b, n rays are projected from the virtual viewpoint to multiple angle directions of different polar angles and azimuth angles outside the hemisphere, passing through multiple angle points on the surface of the hemisphere, and then projected on the opaque object 1 or opaque object 2 respectively On the grid where the n projected points of the n projected points are located, the n light intensities in the patch can be determined respectively according to the light intensities of the grids where the n projected points are located, and finally, the n light intensities are averaged to obtain The rendering result of this patch. It can be seen that the larger the number of SPMs of the patch, the better the anti-aliasing effect of the rendering result, the lower the noise index, and the higher the quality of the rendered image based on the rendering result.
请参阅图6,图6为本申请实施例提供的一种渲染方法的流程示意图,该渲染方法用于渲染应用,该渲染应用包括至少一个模型,每个模型包括多个面片,该渲染方法包括但不限于如下步骤:Please refer to FIG. 6. FIG. 6 is a schematic flowchart of a rendering method provided by an embodiment of the present application. The rendering method is used for rendering applications. The rendering application includes at least one model, and each model includes a plurality of patches. The rendering method Including but not limited to the following steps:
步骤601:对多个面片中的第一面片和第二面片进行光线追踪渲染,获得第一面片的中间渲染结果和第二面片的中间渲染结果。Step 601: Perform ray tracing rendering on the first patch and the second patch among the plurality of patches, and obtain an intermediate rendering result of the first patch and an intermediate rendering result of the second patch.
电子设备对多个面片中的第一面片和第二面片进行光线追踪渲染,获得第一面片的中间渲染结果和第二面片的中间渲染结果。The electronic device performs ray tracing rendering on the first facet and the second facet among the plurality of faces, and obtains an intermediate rendering result of the first facet and an intermediate rendering result of the second facet.
其中,上述中间渲染结果包括每一面片所对应的光线信息(如光线强度、RGB值等信息),该中间渲染结果可参阅上述图5a和图5b中对光线追踪渲染的描述,此处不再赘述。Wherein, the above-mentioned intermediate rendering result includes light information (such as light intensity, RGB value, etc.) corresponding to each patch. For the intermediate rendering result, please refer to the description of ray tracing rendering in Fig. 5a and Fig. 5b above, which will not be repeated here repeat.
上述第二面片为第一面片的邻接面片,可以理解的是,本申请实施例中对“邻接”的定义,可以是两个位置相邻的面片互相称为邻接面片,也可以是两个位置距离小于某一个距离阈值的面片互相称为邻接面片。并且,该距离阈值不是一个固定的值,可以根据不同的渲染 模型和渲染场景而不同,可以是用户配置的,也可以是***根据具体的渲染模型进行配置,此处不做限定。The above-mentioned second surface is the adjacent surface of the first surface. It can be understood that the definition of "adjacent" in the embodiment of the present application can be that two adjacent surfaces are called adjacent surfaces, or It may be that two patches whose position distance is smaller than a certain distance threshold are called adjacent patches. Moreover, the distance threshold is not a fixed value, it can be different according to different rendering models and rendering scenarios, it can be configured by the user, or the system can configure it according to the specific rendering model, which is not limited here.
本申请实施例中的电子设备为搭载了可用于执行计算机执行指令的处理器的设备,可以是网络设备(如服务器)或终端设备(如电脑)等,具体可以是上述图1a或图1b所示的远程渲染平台中的渲染装置,用于执行本申请实施例中的渲染方法,以实现提高渲染图像精度的目的。The electronic device in the embodiment of the present application is a device that is equipped with a processor that can be used to execute instructions executed by a computer, and may be a network device (such as a server) or a terminal device (such as a computer). The rendering device in the shown remote rendering platform is used to execute the rendering method in the embodiment of the present application, so as to improve the accuracy of the rendered image.
步骤602:根据第一面片的中间渲染结果以及第二面片的中间渲染结果,获得第一面片的渲染结果。Step 602: Obtain the rendering result of the first patch according to the intermediate rendering result of the first patch and the intermediate rendering result of the second patch.
电子设备根据第一面片的中间渲染结果以及第二面片的中间渲染结果,获得第一面片的渲染结果。The electronic device obtains the rendering result of the first patch according to the intermediate rendering result of the first patch and the intermediate rendering result of the second patch.
具体为,将第一面片的中间渲染结果和第二面片的中间渲染结果进行加权求和,并将求和结果确定为第一面片的渲染结果。其中,第二面片与第一面片具有对应关系,即第二面片是根据第一面片确定的一个面片。Specifically, the intermediate rendering result of the first patch and the intermediate rendering result of the second patch are weighted and summed, and the summed result is determined as the rendering result of the first patch. Wherein, the second patch has a corresponding relationship with the first patch, that is, the second patch is a patch determined according to the first patch.
通过本实施例,基于第一面片的中间渲染结果和第二面片的中间渲染结果加权求和,可以使得加权求和的结果更符合第一面片光线追踪渲染得到的渲染结果,减少该第一面片对应的渲染图像的噪点,提高渲染图像精度。Through this embodiment, based on the weighted sum of the intermediate rendering results of the first patch and the intermediate rendering results of the second patch, the result of the weighted sum can be made more consistent with the rendering result obtained by ray tracing rendering of the first patch, reducing the The noise of the rendered image corresponding to the first patch improves the accuracy of the rendered image.
进一步地,将第一面片的中间渲染结果和第二面片的中间渲染结果进行加权求和,具体可以采取如下方式:Further, the weighted summation of the intermediate rendering result of the first patch and the intermediate rendering result of the second patch can be done in the following manner:
首先根据第一面片的辅助信息、第二面片的辅助信息以及权值推荐模型,得到第一面片对应的第一权值和第二面片对应的第二权值,再将第一面片的中间渲染结果与该第一权值的乘积,和第二面片的中间渲染结果与该第二权值的乘积进行相加,得到第一面片的渲染结果。First, according to the auxiliary information of the first patch, the auxiliary information of the second patch and the weight recommendation model, the first weight corresponding to the first patch and the second weight corresponding to the second patch are obtained, and then the first The product of the intermediate rendering result of the patch and the first weight, and the product of the intermediate rendering result of the second patch and the second weight are added to obtain the rendering result of the first patch.
其中,上述第一面片对应的第一权值和第二面片对应的第二权值,具体可以是通过将第一面片的辅助信息和第二面片的辅助信息输入至上述权值推荐模型中得到的。该辅助信息包括面片对应的模型的表面区域的相关信息,比如,面片的材质,面片的法线信息,面片的世界坐标信息等,其中,面片的法线信息用于指示面片的朝向。该权值推荐模型可以是通过大量模型的面片的样本信息训练得到。上述加权求和的计算公式可如下表示:Wherein, the first weight corresponding to the above-mentioned first patch and the second weight corresponding to the second patch can be specifically inputted into the above-mentioned weight by the auxiliary information of the first patch and the auxiliary information of the second patch obtained in the recommendation model. The auxiliary information includes information about the surface area of the model corresponding to the patch, such as the material of the patch, the normal information of the patch, the world coordinate information of the patch, etc., where the normal information of the patch is used to indicate the The orientation of the piece. The weight recommendation model can be obtained through training on sample information of a large number of model patches. The calculation formula of the above weighted summation can be expressed as follows:
X=i 1*X 1+i 2*X 2 X=i 1 *X 1 +i 2 *X 2
其中,X 1表示第一面片的中间渲染数据,i 1表示第一面片对应的第一权值,X 2表示第二面片的中间渲染数据,i 2表示第二面片对应的第二权值,X表示确定得到的第一面片的渲染数据;并且,i 1+i 2=1。 Among them, X 1 represents the intermediate rendering data of the first patch, i 1 represents the first weight corresponding to the first patch, X 2 represents the intermediate rendering data of the second patch, and i 2 represents the first weight corresponding to the second patch Two weights, X represents the determined rendering data of the first patch; and, i 1 +i 2 =1.
通过本申请实施例,可以使得加权求和的结果更符合第一面片光线追踪渲染得到的渲染结果,减少该第一面片对应的渲染图像的噪点,提高渲染图像精度。Through the embodiment of the present application, the result of weighted summation can be made more consistent with the rendering result obtained by ray tracing rendering of the first patch, the noise of the rendered image corresponding to the first patch can be reduced, and the precision of the rendered image can be improved.
应当理解的是,本实施例中的第一面片的邻接面片数量很有可能不止一个,上述第二面片仅作为一个示例性的邻接面片,对利用第一面片的邻接面片的中间渲染结果,以及第一面片的中间渲染结果,确定得到第一面片的渲染结果进行说明,不应以此对本实施例进行限定。It should be understood that the number of adjacent patches of the first patch in this embodiment is likely to be more than one, and the above-mentioned second patch is only an exemplary adjacent patch. The intermediate rendering result of the first patch and the intermediate rendering result of the first patch are determined to be the rendering result of the first patch for illustration, which should not limit this embodiment.
当第一面片具有n(n为大于1的整数)个邻接面片时,将第一面片的中间渲染结果和各个邻接面片上相对应的中间渲染结果(例如,第二面片的中间渲染结果,第三面片的中间渲染结果,…,第n面片的中间渲染结果)进行加权求和,并将求和结果确定为第一面片的渲染结果。其中,第二面片、第三面片、第n面片与第一面片具有对应关系,即第二面片是根据第一面片确定的一个面片,第三面片是根据第一面片确定的一个面片,第n面片是根据第一面片确定的一个面片。When the first patch has n (n is an integer greater than 1) adjacent patches, the intermediate rendering result of the first patch and the corresponding intermediate rendering result on each adjacent patch (for example, the middle of the second patch The rendering result, the intermediate rendering result of the third patch, ..., the intermediate rendering result of the nth patch) are weighted and summed, and the summed result is determined as the rendering result of the first patch. Among them, the second patch, the third patch, and the nth patch have a corresponding relationship with the first patch, that is, the second patch is a patch determined according to the first patch, and the third patch is determined according to the first patch. A patch determined by a patch, and the nth patch is a patch determined according to the first patch.
进一步地,将第一面片的中间渲染结果和各个邻接面片上相对应的中间渲染结果进行加权求和,具体可以采取如下方式:Further, the weighted summation of the intermediate rendering result of the first patch and the corresponding intermediate rendering results on each adjacent patch can be done in the following manner:
首先将第一面片的辅助信息、各个邻接面片的辅助信息输入至权值推荐模型,得到第一面片对应的第一权值和各个邻接面片对应的权值,再将第一面片的中间渲染结果与该第一权值的乘积、各个邻接面片上相对应的中间渲染结果与该邻接面片对应的权值的乘积进行相加,其加权求和的计算公式可如下表示:First, the auxiliary information of the first patch and the auxiliary information of each adjacent patch are input into the weight recommendation model to obtain the first weight corresponding to the first patch and the weights corresponding to each adjacent patch, and then the first surface Add the product of the intermediate rendering result of the slice and the first weight, and the product of the corresponding intermediate rendering result on each adjacent patch and the weight corresponding to the adjacent patch. The calculation formula of the weighted sum can be expressed as follows:
X=i 1*X 1+i 2*X 2+i 3*X 3+…+i n*X n X=i 1 *X 1 +i 2 *X 2 +i 3 *X 3 +…+i n *X n
其中,X 1表示第一面片的中间渲染数据,i 1表示第一面片对应的第一权值,X 2表示第二面片的中间渲染数据,i 2表示第二面片对应的第二权值,X 3表示第三面片的中间渲染数据,i 3表示第三面片对应的第三权值,X n表示第n面片的中间渲染数据,i n表示第n面片对应的第n权值,X表示确定得到的第一面片的渲染数据;并且,i 1+i 2+i 3+…+i n=1。 Among them, X 1 represents the intermediate rendering data of the first patch, i 1 represents the first weight corresponding to the first patch, X 2 represents the intermediate rendering data of the second patch, and i 2 represents the first weight corresponding to the second patch Two weights, X 3 represents the intermediate rendering data of the third facet, i 3 represents the third weight corresponding to the third facet, X n represents the intermediate rendering data of the nth facet, i n represents the corresponding value of the nth facet The n-th weight of X represents the rendering data of the determined first patch; and, i 1 +i 2 +i 3 +...+i n =1.
在一种可能的实施方式中,对于上述第二面片与第一面片之间的对应关系,还提供了一种确定其对应关系的方法,即根据第一面片确定得到第二面片的方法。下面将结合图5c对该方法进行说明。In a possible implementation manner, for the correspondence between the above-mentioned second patch and the first patch, a method for determining the corresponding relationship is also provided, that is, the second patch is determined according to the first patch Methods. The method will be described below with reference to FIG. 5c.
请参阅图5c,图5c为本申请实施例提供的一种光线追踪渲染的效果示意图。Please refer to FIG. 5c. FIG. 5c is a schematic diagram of a ray tracing rendering effect provided by an embodiment of the present application.
如图5c所示,左边的半球501为第一面片上存储的半球,右边的半球502为第二面片(第一面片的邻接面片)上存储的半球。其中,第二面片与第一面片之间具有如下对应关系:As shown in FIG. 5 c , the left hemisphere 501 is the hemisphere stored on the first patch, and the right hemisphere 502 is the hemisphere stored on the second patch (the adjacent patch of the first patch). Among them, there is the following corresponding relationship between the second patch and the first patch:
第一面片存储的半球501上的一个角度点(如P 1点)和第一面片存储的半球501的中心点O 1所确定的第一直线与光场相交于G点,第二面片存储的半球502上的一个角度点(如P 2点)和第二面片存储的半球502的中心点O 2所确定的第二直线与光场相交于G点,上述第一直线与光场相交的交点和第二直线与光场相交的交点为同一点。本实施例中的光场描述的是光线在三维空间中辐亮度的空间和方向分布,具体可以是光源产生的光线,也可以是从模型的虚拟视点发出的光线经过外界不透明物体反射回来的光线,此处不做限定。本申请实施例中的多个面片共用一个中心点(如上述的中心点O 1和/或O 2)。 An angle point (such as P 1 point) on the hemisphere 501 stored in the first patch and the first straight line determined by the central point O 1 of the hemisphere 501 stored in the first patch intersects the light field at point G, and the second An angle point (such as P 2 point) on the hemisphere 502 stored in the patch and the second straight line determined by the center point O 2 of the hemisphere 502 stored in the second patch intersects the light field at point G, and the above-mentioned first straight line The point of intersection with the light field and the point of intersection between the second straight line and the light field are the same point. The light field in this embodiment describes the spatial and directional distribution of the radiance of light in three-dimensional space, specifically, it can be the light generated by the light source, or it can be the light emitted from the virtual viewpoint of the model and reflected by the external opaque objects , is not limited here. Multiple facets in the embodiment of the present application share a central point (such as the aforementioned central points O 1 and/or O 2 ).
可选的,可以采取以下方法根据第一面片确定得到第二面片:Optionally, the following methods can be used to determine the second surface according to the first surface:
首先从半球501的中心点O 1向外任意方向发出一根光线,与光场相交于一个光场交点,记为G(x,y,z)。并且,将这根光线经过半球501表面的第一角度点所在的面片确定为第一面片,该第一角度点记为
Figure PCTCN2022079498-appb-000004
然后从半球502的中心点O 2向外某个特定方向发出一根光线,使这根光线经过上述光场交点G(x,y,z),此时,将这根光线经过半球502表面的第二角度点所在的面片确定为第二面片,该第二角度点记为
Figure PCTCN2022079498-appb-000005
该第二面片即为第一面片对应的面片。
First, a ray is emitted from the center point O 1 of the hemisphere 501 in any direction outward, and intersects the light field at a light field intersection point, denoted as G(x, y, z). And, the patch where the ray passes through the first angle point on the surface of the hemisphere 501 is determined as the first patch, and the first angle point is denoted as
Figure PCTCN2022079498-appb-000004
Then a ray is emitted in a specific direction from the center point O2 of the hemisphere 502, so that the ray passes through the intersection point G(x, y, z) of the above-mentioned light field. At this time, the ray passes through the surface of the hemisphere 502 The patch where the second angle point is located is determined as the second patch, and the second angle point is denoted as
Figure PCTCN2022079498-appb-000005
The second patch is the corresponding patch of the first patch.
通过本申请实施例,可以确定第一面片与第二面片之间的对应关系,从而实现根据第一面片的邻接面片的中间渲染结果以及第一面片的中间渲染结果,确定得到第一面片的渲染结果,使第一面片的渲染结果更符合对第一面片光线追踪的结果。Through the embodiment of the present application, it is possible to determine the corresponding relationship between the first patch and the second patch, so that according to the intermediate rendering result of the adjacent patches of the first patch and the intermediate rendering result of the first patch, the obtained The rendering result of the first patch, so that the rendering result of the first patch is more in line with the result of ray tracing for the first patch.
在一种可能的实施方式中,在将第一面片的中间渲染结果和第二面片的中间渲染结果进行加权求和之前,本实施例中的方法还可以包括:In a possible implementation manner, before weighting and summing the intermediate rendering result of the first patch and the intermediate rendering result of the second patch, the method in this embodiment may further include:
先根据第一面片的辅助信息和第二面片的辅助信息,计算得到第一面片和第二面片之间的相关程度,即第一面片和第二面片的关联度,并确定该关联度大于关联度阈值。First, according to the auxiliary information of the first patch and the auxiliary information of the second patch, calculate the degree of correlation between the first patch and the second patch, that is, the degree of correlation between the first patch and the second patch, and It is determined that the association degree is greater than an association degree threshold.
其中,上述辅助信息包括下述中的一项或多项:面片的材质,面片的法线信息,面片的世界坐标信息等,该面片的法线信息用于指示面片的朝向。基于第一面片的辅助信息和第二面片的辅助信息,可以使计算得到的第一面片和第二面片的关联度更为准确。上述关联度阈 值不是一个固定的值,可以根据不同的模型渲染应用场景而不同,可以是***预设的值,也可以是用户配置的值,此处不做限定。Wherein, the above auxiliary information includes one or more of the following: the material of the patch, the normal information of the patch, the world coordinate information of the patch, etc. The normal information of the patch is used to indicate the orientation of the patch . Based on the auxiliary information of the first mesh and the auxiliary information of the second mesh, the calculated correlation degree between the first mesh and the second mesh can be more accurate. The above correlation threshold is not a fixed value, it can be different according to different model rendering application scenarios, it can be the value preset by the system, or it can be the value configured by the user, which is not limited here.
通过本申请实施例,基于第一面片和第二面片的关联度大于关联度阈值的前提下,可以确保第二面片为与第一面片关联程度较高的邻接面片,从而使得根据该第二面片的中间渲染结果以及第一面片的中间渲染结果确定得到的第一面片的渲染结果的准确性更高。Through the embodiment of the present application, based on the premise that the correlation degree between the first patch and the second patch is greater than the threshold value of the correlation degree, it can be ensured that the second patch is an adjacent patch with a high degree of correlation with the first patch, so that The accuracy of the rendering result of the first patch determined according to the intermediate rendering result of the second patch and the intermediate rendering result of the first patch is higher.
请参阅图7,图7为本申请实施例提供的另一种渲染方法的流程示意图,也可以理解为是上述图6中的渲染方法流程图的变形或补充。Please refer to FIG. 7 . FIG. 7 is a schematic flowchart of another rendering method provided by an embodiment of the present application, which can also be understood as a modification or supplement to the flowchart of the rendering method in FIG. 6 above.
如图7所示,本渲染方法是在上述图1a或者图1b所示的渲染***的基础上实现的,包括但不限于如下步骤:As shown in Figure 7, this rendering method is implemented on the basis of the rendering system shown in Figure 1a or Figure 1b above, including but not limited to the following steps:
S701:终端设备通过网络设备向远程渲染平台发送渲染请求。相应地,远程渲染平台接收终端设备通过网络设备发送的渲染请求,该渲染请求包括待渲染模型的面片信息。S701: The terminal device sends a rendering request to a remote rendering platform through a network device. Correspondingly, the remote rendering platform receives the rendering request sent by the terminal device through the network device, and the rendering request includes the mesh information of the model to be rendered.
S702:远程渲染平台对第一面片和第二面片进行光线追踪渲染,获得第一面片的中间渲染结果和第二面片的中间渲染结果。S702: The remote rendering platform performs ray tracing rendering on the first patch and the second patch, and obtains an intermediate rendering result of the first patch and an intermediate rendering result of the second patch.
其中,中间渲染结果包括每一面片所对应的光线信息(如光线强度、RGB值等信息),第二面片为第一面片的邻接面片,具体的,可以是两个位置相邻的面片互相称为邻接面片,也可以是两个位置距离小于某一个距离阈值的面片互相称为邻接面片。具体的渲染过程可参阅上述图5a和图5b中对光线追踪渲染的描述,此处不再赘述。Among them, the intermediate rendering result includes light information corresponding to each patch (such as light intensity, RGB value, etc.), and the second patch is an adjacent patch of the first patch. Specifically, it can be two adjacent patches. The patches are called adjacent patches to each other, and two patches whose position distance is smaller than a certain distance threshold can also be called adjacent patches. For the specific rendering process, reference may be made to the description of ray tracing rendering in FIG. 5a and FIG. 5b above, which will not be repeated here.
可以理解的是,按照上述对第一面片和第二面片进行光线追踪渲染的方法,可以对待渲染模型的所有面片进行光线追踪渲染,得到各个面片的中间渲染结果。It can be understood that, according to the above-mentioned method of performing ray tracing rendering on the first patch and the second patch, ray tracing rendering can be performed on all patches of the model to be rendered to obtain an intermediate rendering result of each patch.
S703:根据第一面片的中间渲染结果和第二面片的中间渲染结果,确定得到第一面片的渲染结果。S703: Determine to obtain a rendering result of the first patch according to the intermediate rendering result of the first patch and the intermediate rendering result of the second patch.
具体可以是将第一面片的中间渲染结果和第二面片的中间渲染结果进行加权求和,并将求和结果确定为第一面片的渲染结果。其中,第二面片与第一面片具有对应关系,即第二面片是根据第一面片确定的一个面片。具体的确定过程可参阅上述图6中的步骤602的描述,此处不再赘述。Specifically, the intermediate rendering result of the first patch and the intermediate rendering result of the second patch are weighted and summed, and the summed result is determined as the rendering result of the first patch. Wherein, the second patch has a corresponding relationship with the first patch, that is, the second patch is a patch determined according to the first patch. For a specific determination process, reference may be made to the description of step 602 in FIG. 6 above, which will not be repeated here.
可以理解的是,按照上述确定得到第一面片的渲染结果的方法,同理,可以对待渲染模型的各个面片的渲染结果进行确定,得到待渲染模型的渲染结果,并基于该待渲染模型的渲染结果,得到其对应的渲染图像。It can be understood that, according to the above method of determining the rendering result of the first patch, similarly, the rendering result of each patch of the model to be rendered can be determined to obtain the rendering result of the model to be rendered, and based on the model to be rendered The rendering result of , get its corresponding rendered image.
S704:远程渲染平台将渲染图像通过网络设备发送给终端设备。相应地,终端设备接收远程渲染平台通过网络设备发送的渲染图像,并显示该渲染图像。S704: The remote rendering platform sends the rendered image to the terminal device through the network device. Correspondingly, the terminal device receives the rendered image sent by the remote rendering platform through the network device, and displays the rendered image.
上述详细阐述了本申请实施例的方法,下面提供本申请实施例的装置。The method of the embodiment of the present application has been described in detail above, and the device of the embodiment of the present application is provided below.
请参阅图8,图8为本申请实施例提供的一种渲染装置的结构示意图,该渲染装置80可以包括获取单元801以及确定单元802,其中,各个单元的描述如下:Please refer to FIG. 8. FIG. 8 is a schematic structural diagram of a rendering device provided by an embodiment of the present application. The rendering device 80 may include an acquisition unit 801 and a determination unit 802, where each unit is described as follows:
获取单元801,用于对所述多个面片中的第一面片进行光线追踪渲染,获得所述第一面片的中间渲染结果;An acquisition unit 801, configured to perform ray-tracing rendering on a first patch among the plurality of patches, and obtain an intermediate rendering result of the first patch;
所述获取单元801,还用于对所述多个面片中的第二面片进行光线追踪渲染,获得所述第二面片的中间渲染结果,所述第一面片与所述第二面片之间的距离小于距离阈值;The obtaining unit 801 is further configured to perform ray tracing rendering on the second patch among the plurality of patches, and obtain an intermediate rendering result of the second patch, and the first patch and the second patch The distance between patches is less than the distance threshold;
确定单元802,用于根据所述第一面片的中间渲染结果以及所述第二面片的中间渲染结果,获得所述第一面片的渲染结果。The determining unit 802 is configured to obtain the rendering result of the first patch according to the intermediate rendering result of the first patch and the intermediate rendering result of the second patch.
在本申请实施例中,提供了一种对应用进行渲染的方法,该渲染方法涉及图像处理技术 领域,首先对各个面片进行光线追踪渲染,得到各个面片的中间渲染结果,然后根据目标面片的邻接面片的中间渲染结果和该目标面片的中间渲染结果,得到该目标面片的渲染结果,其中,目标面片的邻接面片与目标面片的距离小于距离阈值。具体为,对多个面片中的第一面片和第二面片进行光线追踪渲染,得到第一面片的中间渲染结果和第二面片的中间渲染结果,然后根据第二面片的中间渲染结果和第一面片的中间渲染结果,得到第一面片的渲染结果,其中,上述第二面片为第一面片的邻接面片,即第二面片与第一面片之间的距离小于距离阈值,该距离阈值不是一个固定的值,可以根据不同的渲染模型和渲染场景而不同,可以是***预设的值,也可以是用户配置的值,此处不做限定。通过本申请实施例,可以使得基于第一面片的渲染结果得到的渲染图像的噪点减少,提高渲染图像精度。In the embodiment of the present application, a method for rendering an application is provided. The rendering method relates to the field of image processing technology. The intermediate rendering result of the adjacent patch of the patch and the intermediate rendering result of the target patch to obtain the rendering result of the target patch, wherein the distance between the adjacent patch of the target patch and the target patch is smaller than the distance threshold. Specifically, ray-tracing rendering is performed on the first and second patches among the multiple patches to obtain the intermediate rendering results of the first patch and the intermediate rendering results of the second patch, and then according to the The intermediate rendering result and the intermediate rendering result of the first patch, to obtain the rendering result of the first patch, wherein the second patch is the adjacent patch of the first patch, that is, the difference between the second patch and the first patch The distance between them is less than the distance threshold. The distance threshold is not a fixed value and can vary according to different rendering models and rendering scenarios. It can be a system preset value or a user configured value, which is not limited here. Through the embodiments of the present application, the noise of the rendered image obtained based on the rendering result of the first patch can be reduced, and the accuracy of the rendered image can be improved.
在一种可能的实施方式中,所述第一面片与所述第二面片的关联度大于关联度阈值,其中,所述关联度用于指示所述第一面片与所述第二面片的相关程度。In a possible implementation manner, the degree of association between the first patch and the second patch is greater than a threshold of association degree, wherein the degree of association is used to indicate that the degree of association between the first patch and the second The degree of relatedness of the patches.
在本申请实施例中,第一面片与第二面片的关联度大于关联度阈值,即第一面片与第二面片的相关程度大于关联度阈值,其中,关联度阈值不是一个固定的值,可以根据不同的模型渲染应用场景而不同,可以是***预设的值,也可以是用户配置的值,此处不做限定。通过本申请实施例,基于第一面片和第二面片的关联度大于关联度阈值的前提下,可以确保第二面片为与第一面片关联程度较高的邻接面片,从而使得根据该第二面片的中间渲染结果和第一面片的中间渲染结果得到的第一面片的渲染结果的准确性更高。In the embodiment of the present application, the correlation degree between the first patch and the second patch is greater than the correlation threshold, that is, the correlation degree between the first patch and the second patch is greater than the correlation threshold, wherein the correlation threshold is not a fixed The value of can vary according to different model rendering application scenarios. It can be a system preset value or a user configured value, which is not limited here. Through the embodiment of the present application, based on the premise that the correlation degree between the first patch and the second patch is greater than the threshold value of the correlation degree, it can be ensured that the second patch is an adjacent patch with a high degree of correlation with the first patch, so that The rendering result of the first patch obtained according to the intermediate rendering result of the second patch and the intermediate rendering result of the first patch has higher accuracy.
在一种可能的实施方式中,所述装置还包括:In a possible implementation manner, the device also includes:
计算单元803,用于根据所述第一面片的辅助信息和所述第二面片的辅助信息,计算所述第一面片和所述第二面片的关联度。A calculating unit 803, configured to calculate a degree of association between the first patch and the second patch according to the auxiliary information of the first patch and the auxiliary information of the second patch.
在本申请实施例中,还提供了一种确定第一面片和第二面片的关联度的可能的具体实施方式,具体为,在根据第一面片的中间渲染结果和第二面片的中间渲染结果得到第一面片的渲染结果之前,先根据第一面片的辅助信息和第二面片的辅助信息,计算得到第一面片和第二面片之间的相关程度,即第一面片和第二面片的关联度。其中,上述辅助信息包括面片对应的模型的表面区域的相关信息,比如,模型的表面区域的材质,对模型进行光线追踪的预存法线信息,模型的表面区域的世界坐标信息等。通过本申请实施例,基于第一面片的辅助信息和第二面片的辅助信息,可以使计算得到的第一面片和第二面片的关联度更为准确。In the embodiment of the present application, a possible implementation method of determining the degree of association between the first patch and the second patch is also provided, specifically, according to the intermediate rendering result of the first patch and the second patch Before getting the rendering result of the first patch, first calculate the degree of correlation between the first patch and the second patch according to the auxiliary information of the first patch and the auxiliary information of the second patch, that is The degree of association between the first patch and the second patch. Wherein, the auxiliary information includes information about the surface area of the model corresponding to the patch, such as the material of the surface area of the model, the pre-stored normal information for ray tracing the model, the world coordinate information of the surface area of the model, and the like. Through the embodiment of the present application, based on the auxiliary information of the first mesh and the auxiliary information of the second mesh, the calculated correlation degree between the first mesh and the second mesh can be more accurate.
在一种可能的实施方式中,所述计算单元803,还用于将所述第一面片的中间渲染结果和所述第二面片的中间渲染结果进行求和;In a possible implementation manner, the calculation unit 803 is further configured to sum the intermediate rendering result of the first patch and the intermediate rendering result of the second patch;
所述确定单元802,具体用于将所述求和结果确定为所述第一面片的渲染结果。The determining unit 802 is specifically configured to determine the summation result as the rendering result of the first patch.
在本申请实施例中,提供了一种根据第二面片的中间渲染结果和第一面片的中间渲染结果得到第一面片的渲染结果的可能的具体实施方式,具体为,将第一面片的中间渲染结果和第二面片的中间渲染结果进行求和,并将求和结果确定为第一面片的渲染结果,其中,第二面片与第一面片具有对应关系,即第二面片是根据第一面片确定的一个面片。通过本申请实施例,基于第一面片的中间渲染结果和第二面片的中间渲染结果求和,可以使得求和的结果更符合第一面片的光线追踪渲染得到的渲染结果,减少该第一面片对应的渲染图像的噪点,提高渲染图像精度。In the embodiment of the present application, a possible specific implementation manner of obtaining the rendering result of the first patch according to the intermediate rendering result of the second patch and the intermediate rendering result of the first patch is provided, specifically, the first patch The intermediate rendering result of the patch and the intermediate rendering result of the second patch are summed, and the summation result is determined as the rendering result of the first patch, wherein the second patch has a corresponding relationship with the first patch, that is The second patch is a patch determined according to the first patch. Through the embodiment of the present application, based on the sum of the intermediate rendering results of the first patch and the intermediate rendering results of the second patch, the result of the summation can be made more consistent with the rendering result obtained by ray tracing rendering of the first patch, reducing the The noise of the rendered image corresponding to the first patch improves the accuracy of the rendered image.
在一种可能的实施方式中,所述计算单元803,具体用于将所述第一面片的辅助信息和所述第二面片的辅助信息输入权值推荐模型,获得第一权值和第二权值;In a possible implementation manner, the calculation unit 803 is specifically configured to input the auxiliary information of the first patch and the auxiliary information of the second patch into the weight recommendation model to obtain the first weight and second weight;
所述计算单元803,具体还用于将所述第一面片的中间渲染结果与所述第一权值的乘积,和所述第二面片的中间渲染结果与所述第二权值的乘积相加。The calculation unit 803 is further configured to calculate the product of the intermediate rendering result of the first patch and the first weight, and the product of the intermediate rendering result of the second patch and the second weight The products are added.
在本申请实施例中,提供了一种将第一面片的中间渲染结果和第二面片的中间渲染结果进行求和的可能的具体实施方式,具体为,首先根据第一面片的辅助信息、第二面片的辅助信息以及权值推荐模型,得到第一面片对应的第一权值和第二面片对应的第二权值,再将第一面片的中间渲染结果与该第一权值的乘积,和第二面片的中间渲染结果与该第二权值的乘积进行相加,得到第一面片的渲染结果。其中,上述第一面片对应的第一权值和第二面片对应的第二权值,具体可以是通过将第一面片的辅助信息和第二面片的辅助信息输入至上述权值推荐模型中得到的,该权值推荐模型可以是通过大量模型的面片的样本信息训练得到。通过本申请实施例,可以使得加权求和的结果更符合第一面片光线追踪渲染得到的渲染结果,减少该第一面片对应的渲染图像的噪点,提高渲染图像精度。In the embodiment of the present application, a possible specific implementation method of summing the intermediate rendering result of the first patch and the intermediate rendering result of the second patch is provided, specifically, firstly, according to the assistance of the first patch information, the auxiliary information of the second patch, and the weight recommendation model to obtain the first weight corresponding to the first patch and the second weight corresponding to the second patch, and then compare the intermediate rendering result of the first patch with the The product of the first weight is added to the intermediate rendering result of the second patch and the product of the second weight to obtain the rendering result of the first patch. Wherein, the first weight corresponding to the above-mentioned first patch and the second weight corresponding to the second patch can be specifically inputted into the above-mentioned weight by the auxiliary information of the first patch and the auxiliary information of the second patch The weight recommendation model can be obtained by training the sample information of a large number of model patches. Through the embodiment of the present application, the result of weighted summation can be made more consistent with the rendering result obtained by ray tracing rendering of the first patch, the noise of the rendered image corresponding to the first patch can be reduced, and the precision of the rendered image can be improved.
在一种可能的实施方式中,所述第一面片的辅助信息包括下述一个或多个:In a possible implementation manner, the auxiliary information of the first patch includes one or more of the following:
所述第一面片的材质,所述第一面片的法线信息,所述第一面片的世界坐标信息,其中,所述第一面片的法线信息用于指示所述第一面片的朝向。The material of the first patch, the normal information of the first patch, and the world coordinate information of the first patch, wherein the normal information of the first patch is used to indicate that the first The orientation of the patch.
在本申请实施例中,第一面片的辅助信息包括下述中的一项或多项:第一面片的材质,第一面片的法线信息,第一面片的世界坐标信息等,该第一面片的法线信息用于指示第一面片的朝向。同理,第二面片的辅助信息内容与第一面片的辅助信息的内容类似。基于第一面片的辅助信息和第二面片的辅助信息,可以使计算得到的第一面片和第二面片的关联度更为准确,并且,使输入权值推荐模型得到的第一权值和第二权值更为准确。In this embodiment of the application, the auxiliary information of the first mesh includes one or more of the following: the material of the first mesh, the normal information of the first mesh, the world coordinate information of the first mesh, etc. , the normal information of the first patch is used to indicate the orientation of the first patch. Similarly, the content of the auxiliary information of the second patch is similar to the content of the auxiliary information of the first patch. Based on the auxiliary information of the first patch and the auxiliary information of the second patch, the calculated correlation between the first patch and the second patch can be more accurate, and the first The weight and the second weight are more accurate.
根据本申请实施例,图8所示的装置中的各个单元可以分别或全部合并为一个或若干个另外的单元来构成,或者其中的某个(些)单元还可以再拆分为功能上更小的多个单元来构成,这可以实现同样的操作,而不影响本申请的实施例的技术效果的实现。上述单元是基于逻辑功能划分的,在实际应用中,一个单元的功能也可以由多个单元来实现,或者多个单元的功能由一个单元实现。在本申请的其它实施例中,基于电子设备也可以包括其它单元,在实际应用中,这些功能也可以由其它单元协助实现,并且可以由多个单元协作实现。According to the embodiment of the present application, each unit in the device shown in FIG. 8 can be separately or all combined into one or several other units to form, or one (some) units can be further divided into more functional units. It is composed of multiple small units, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In practical applications, the functions of one unit may also be realized by multiple units, or the functions of multiple units may be realized by one unit. In other embodiments of the present application, the electronic device may also include other units. In practical applications, these functions may also be assisted by other units, and may be implemented cooperatively by multiple units.
需要说明的是,各个单元的实现还可以对应参照上述图6和图7所示的方法实施例的相应描述。It should be noted that, for implementation of each unit, reference may also be made to corresponding descriptions of the method embodiments shown in FIG. 6 and FIG. 7 above.
在图8所描述的渲染装置80中,根据第一面片的中间渲染结果,以及与第一面片距离小于距离阈值的第二面片的中间渲染结果,得到第一面片的渲染结果,可以使得基于第一面片的渲染结果得到的渲染图像的噪点减少,提高渲染图像精度。In the rendering device 80 described in FIG. 8, the rendering result of the first patch is obtained according to the intermediate rendering result of the first patch and the intermediate rendering result of the second patch whose distance from the first patch is smaller than the distance threshold, The noise of the rendered image obtained based on the rendering result of the first patch can be reduced, and the accuracy of the rendered image can be improved.
请参阅图9,图9为本申请实施例提供的一种电子设备90的结构示意图。该电子设备90可以包括存储器901、处理器902。进一步可选的,还可以包含通信接口903以及总线904,其中,存储器901、处理器902以及通信接口903通过总线904实现彼此之间的通信连接。通信接口903用于与上述渲染装置80进行数据交互。Please refer to FIG. 9 . FIG. 9 is a schematic structural diagram of an electronic device 90 provided in an embodiment of the present application. The electronic device 90 may include a memory 901 and a processor 902 . Further optionally, a communication interface 903 and a bus 904 may also be included, wherein the memory 901 , the processor 902 and the communication interface 903 are connected to each other through the bus 904 . The communication interface 903 is used for data interaction with the above-mentioned rendering device 80 .
其中,存储器901用于提供存储空间,存储空间中可以存储操作***和计算机程序等数据。存储器901包括但不限于是随机存储记忆体(random access memory,RAM)、只读存储器(read-only memory,ROM)、可擦除可编程只读存储器(erasable programmable read only memory,EPROM)、或便携式只读存储器(compact disc read-only memory,CD-ROM)。Wherein, the memory 901 is used to provide a storage space, in which data such as operating systems and computer programs can be stored. Memory 901 includes, but is not limited to, random access memory (random access memory, RAM), read-only memory (read-only memory, ROM), erasable programmable read-only memory (erasable programmable read only memory, EPROM), or Portable read-only memory (compact disc read-only memory, CD-ROM).
处理器902是进行算术运算和逻辑运算的模块,可以是中央处理器(central processing unit,CPU)、显卡处理器(graphics processing unit,GPU)或微处理器(microprocessor unit,MPU)等处理模块中的一种或者多种的组合。The processor 902 is a module for performing arithmetic operations and logic operations, and may be in a processing module such as a central processing unit (central processing unit, CPU), a graphics processing unit (graphics processing unit, GPU) or a microprocessor (microprocessor unit, MPU). one or a combination of more.
存储器901中存储有计算机程序,处理器902调用存储器901中存储的计算机程序,以 执行上述图6和图7所示的渲染方法:A computer program is stored in the memory 901, and the processor 902 calls the computer program stored in the memory 901 to execute the rendering methods shown in the above-mentioned Figures 6 and 7:
对所述多个面片中的第一面片进行光线追踪渲染,获得所述第一面片的中间渲染结果;performing ray-tracing rendering on a first patch among the plurality of patches, and obtaining an intermediate rendering result of the first patch;
对所述多个面片中的第二面片进行光线追踪渲染,获得所述第二面片的中间渲染结果,所述第一面片与所述第二面片之间的距离小于距离阈值;performing ray-tracing rendering on a second patch among the plurality of patches to obtain an intermediate rendering result of the second patch, and the distance between the first patch and the second patch is smaller than a distance threshold ;
根据所述第一面片的中间渲染结果以及所述第二面片的中间渲染结果,获得所述第一面片的渲染结果。Obtain the rendering result of the first patch according to the intermediate rendering result of the first patch and the intermediate rendering result of the second patch.
上述处理器902执行方法的具体内容可参阅上述图6和图7,此处不再赘述。For the specific content of the method executed by the processor 902, reference may be made to the above-mentioned FIG. 6 and FIG. 7 , which will not be repeated here.
相应的,处理器902调用存储器901中存储的计算机程序,还可以用于执行上述图8所示的渲染装置80中的各个单元所执行的方法步骤,其具体内容可参阅上述图8,此处不再赘述。Correspondingly, the processor 902 calls the computer program stored in the memory 901, which can also be used to execute the method steps performed by the various units in the rendering device 80 shown in FIG. No longer.
在图9所描述的电子设备90中,根据第一面片的中间渲染结果,以及与第一面片距离小于距离阈值的第二面片的中间渲染结果,得到第一面片的渲染结果,可以使得基于第一面片的渲染结果得到的渲染图像的噪点减少,提高渲染图像精度。In the electronic device 90 described in FIG. 9, the rendering result of the first patch is obtained according to the intermediate rendering result of the first patch and the intermediate rendering result of the second patch whose distance from the first patch is smaller than the distance threshold, The noise of the rendered image obtained based on the rendering result of the first patch can be reduced, and the accuracy of the rendered image can be improved.
本申请实施例还提供一种计算机可读存储介质,上述计算机可读存储介质中存储有计算机程序,当上述计算机程序在一个或多个处理器上运行时,可以实现上述图6以及图7所示的方法。The embodiment of the present application also provides a computer-readable storage medium. The above-mentioned computer-readable storage medium stores a computer program. When the above-mentioned computer program is run on one or more processors, the above-mentioned FIG. 6 and FIG. 7 can be realized. method shown.
本申请实施例还提供一种计算机程序产品,上述计算机程序产品包括计算机程序,当上述计算机程序产品在处理器上运行时,可以实现上述图6以及图7所示的方法。An embodiment of the present application further provides a computer program product, where the computer program product includes a computer program, and when the computer program product runs on a processor, the methods shown in FIG. 6 and FIG. 7 above can be implemented.
本申请实施例还提供一种芯片,该芯片包括处理器,所述处理器用于执行指令,当该处理器执行所述指令时,可以实现上述图6以及图7所示的方法。可选的,该芯片还包括通信接口,该通信接口用于输入信号或输出信号。The embodiment of the present application also provides a chip, the chip includes a processor, and the processor is configured to execute instructions, and when the processor executes the instructions, the above methods shown in FIG. 6 and FIG. 7 can be implemented. Optionally, the chip also includes a communication interface, which is used for inputting signals or outputting signals.
本申请实施例还提供了一种***,该***包括了至少一个如上述渲染装置80或电子设备90或芯片。The embodiment of the present application also provides a system, which includes at least one rendering device 80 or electronic device 90 or chip as described above.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序相关的硬件完成,该计算机程序可存储于计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:只读存储器ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储计算机程序代码的介质。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be realized. The processes can be completed by hardware related to computer programs, and the computer programs can be stored in computer-readable storage media. When the computer programs are executed, , may include the processes of the foregoing method embodiments. The aforementioned storage medium includes: various media capable of storing computer program codes such as read-only memory ROM or random access memory RAM, magnetic disk or optical disk.

Claims (15)

  1. 一种对应用进行渲染的方法,其特征在于,所述应用包括至少一个模型,所述模型包括多个面片,所述方法包括:A method for rendering an application, wherein the application includes at least one model, and the model includes a plurality of patches, and the method includes:
    对所述多个面片中的第一面片进行光线追踪渲染,获得所述第一面片的中间渲染结果;performing ray-tracing rendering on a first patch among the plurality of patches, and obtaining an intermediate rendering result of the first patch;
    对所述多个面片中的第二面片进行光线追踪渲染,获得所述第二面片的中间渲染结果,所述第一面片与所述第二面片之间的距离小于距离阈值;performing ray-tracing rendering on a second patch among the plurality of patches to obtain an intermediate rendering result of the second patch, and the distance between the first patch and the second patch is smaller than a distance threshold ;
    根据所述第一面片的中间渲染结果以及所述第二面片的中间渲染结果,获得所述第一面片的渲染结果。Obtain the rendering result of the first patch according to the intermediate rendering result of the first patch and the intermediate rendering result of the second patch.
  2. 根据权利要求1所述的方法,其特征在于,所述第一面片与所述第二面片的关联度大于关联度阈值,其中,所述关联度用于指示所述第一面片与所述第二面片的相关程度。The method according to claim 1, wherein the correlation degree between the first patch and the second patch is greater than a threshold value of correlation degree, wherein the correlation degree is used to indicate that the first patch and the second patch are related to each other. The degree of correlation of the second patch.
  3. 根据权利要求2所述的方法,其特征在于,所述方法还包括:The method according to claim 2, further comprising:
    根据所述第一面片的辅助信息和所述第二面片的辅助信息,计算所述第一面片和所述第二面片的关联度。Calculate the degree of association between the first patch and the second patch according to the auxiliary information of the first patch and the auxiliary information of the second patch.
  4. 根据权利要求1至3中任一项所述的方法,其特征在于,所述根据所述第一面片的中间渲染结果以及所述第二面片的中间渲染结果,获得所述第一面片的渲染结果,包括:The method according to any one of claims 1 to 3, wherein the first surface is obtained according to the intermediate rendering result of the first patch and the intermediate rendering result of the second patch The rendering results of slices, including:
    将所述第一面片的中间渲染结果和所述第二面片的中间渲染结果进行求和;summing the intermediate rendering result of the first patch and the intermediate rendering result of the second patch;
    将所述求和结果确定为所述第一面片的渲染结果。The summation result is determined as the rendering result of the first patch.
  5. 根据权利要求4所述的方法,其特征在于,所述将所述第一面片的中间渲染结果和所述第二面片的中间渲染结果进行求和,包括:The method according to claim 4, wherein the summing the intermediate rendering result of the first patch and the intermediate rendering result of the second patch comprises:
    将所述第一面片的辅助信息和所述第二面片的辅助信息输入权值推荐模型,获得第一权值和第二权值;inputting the auxiliary information of the first patch and the auxiliary information of the second patch into a weight recommendation model to obtain a first weight and a second weight;
    将所述第一面片的中间渲染结果与所述第一权值的乘积,和所述第二面片的中间渲染结果与所述第二权值的乘积相加。Adding the product of the intermediate rendering result of the first patch and the first weight, and the product of the intermediate rendering result of the second patch and the second weight.
  6. 根据权利要求3或5所述的方法,所述第一面片的辅助信息包括下述一个或多个:According to the method according to claim 3 or 5, the auxiliary information of the first patch includes one or more of the following:
    所述第一面片的材质,所述第一面片的法线信息,所述第一面片的世界坐标信息,其中,所述第一面片的法线信息用于指示所述第一面片的朝向。The material of the first patch, the normal information of the first patch, and the world coordinate information of the first patch, wherein the normal information of the first patch is used to indicate that the first The orientation of the patch.
  7. 一种对应用进行渲染的装置,其特征在于,所述应用包括至少一个模型,所述模型包括多个面片,所述装置包括:A device for rendering an application, wherein the application includes at least one model, the model includes a plurality of patches, and the device includes:
    获取单元,用于对所述多个面片中的第一面片进行光线追踪渲染,获得所述第一面片的中间渲染结果;an acquiring unit, configured to perform ray tracing rendering on a first patch among the plurality of patches, and obtain an intermediate rendering result of the first patch;
    所述获取单元,还用于对所述多个面片中的第二面片进行光线追踪渲染,获得所述第二面片的中间渲染结果,所述第一面片与所述第二面片之间的距离小于距离阈值;The acquiring unit is further configured to perform ray-tracing rendering on a second patch among the plurality of patches, and obtain an intermediate rendering result of the second patch, and the first patch and the second patch The distance between slices is less than the distance threshold;
    确定单元,用于根据所述第一面片的中间渲染结果以及所述第二面片的中间渲染结果,获得所述第一面片的渲染结果。The determination unit is configured to obtain the rendering result of the first patch according to the intermediate rendering result of the first patch and the intermediate rendering result of the second patch.
  8. 根据权利要求7所述的装置,其特征在于,所述第一面片与所述第二面片的关联度大于关联度阈值,其中,所述关联度用于指示所述第一面片与所述第二面片的相关程度。The device according to claim 7, wherein the degree of association between the first patch and the second patch is greater than a threshold value of association degree, wherein the degree of association is used to indicate that the degree of association between the first patch and the second patch is The degree of correlation of the second patch.
  9. 根据权利要求8所述的装置,其特征在于,所述装置还包括:The device according to claim 8, wherein the device further comprises:
    计算单元,用于根据所述第一面片的辅助信息和所述第二面片的辅助信息,计算所述第一面片和所述第二面片的关联度。A calculating unit, configured to calculate a degree of association between the first patch and the second patch according to the auxiliary information of the first patch and the auxiliary information of the second patch.
  10. 根据权利要求7至9中任一项所述的装置,其特征在于,所述计算单元,还用于将所述第一面片的中间渲染结果和所述第二面片的中间渲染结果进行求和;The device according to any one of claims 7 to 9, wherein the computing unit is further configured to perform an intermediate rendering result of the first patch and an intermediate rendering result of the second patch sum;
    所述确定单元,具体用于将所述求和结果确定为所述第一面片的渲染结果。The determining unit is specifically configured to determine the summation result as the rendering result of the first patch.
  11. 根据权利要求10所述的装置,其特征在于,所述计算单元,具体用于将所述第一面片的辅助信息和所述第二面片的辅助信息输入权值推荐模型,获得第一权值和第二权值;The device according to claim 10, wherein the calculation unit is specifically configured to input the auxiliary information of the first patch and the auxiliary information of the second patch into the weight recommendation model to obtain the first weight and second weight;
    所述计算单元,具体还用于将所述第一面片的中间渲染结果与所述第一权值的乘积,和所述第二面片的中间渲染结果与所述第二权值的乘积相加。The calculation unit is further configured to calculate the product of the intermediate rendering result of the first patch and the first weight, and the product of the intermediate rendering result of the second patch and the second weight add up.
  12. 根据权利要求9或11所述的装置,其特征在于,所述第一面片的辅助信息包括下述一个或多个:The device according to claim 9 or 11, wherein the auxiliary information of the first patch includes one or more of the following:
    所述第一面片的材质,所述第一面片的法线信息,所述第一面片的世界坐标信息,其中,所述第一面片的法线信息用于指示所述第一面片的朝向。The material of the first patch, the normal information of the first patch, and the world coordinate information of the first patch, wherein the normal information of the first patch is used to indicate that the first The orientation of the patch.
  13. 一种电子设备,其特征在于,包括:处理器和存储器;An electronic device, characterized in that it includes: a processor and a memory;
    所述存储器用于存储计算机执行指令;The memory is used to store computer-executable instructions;
    所述处理器用于执行所述存储器所存储的计算机执行指令,以使所述电子设备执行如权利要求1至6中任一项所述的方法。The processor is configured to execute the computer-executed instructions stored in the memory, so that the electronic device executes the method according to any one of claims 1-6.
  14. 一种计算机可读存储介质,其特征在于,包括:A computer-readable storage medium, comprising:
    所述计算机可读存储介质用于存储指令或计算机程序;当所述指令或所述计算机程序被执行时,使如权利要求1至6中任一项所述的方法被实现。The computer-readable storage medium is used for storing instructions or computer programs; when the instructions or the computer programs are executed, the method according to any one of claims 1 to 6 is realized.
  15. 一种计算机程序产品,其特征在于,包括:指令或计算机程序;A computer program product, characterized in that it includes: instructions or computer programs;
    所述指令或所述计算机程序被执行时,使如权利要求1至6中任一项所述的方法被实现。When the instructions or the computer programs are executed, the method according to any one of claims 1 to 6 is realized.
PCT/CN2022/079498 2021-08-30 2022-03-07 Method for rendering application and related device WO2023029424A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111005623.4 2021-08-30
CN202111005623.4A CN115731331A (en) 2021-08-30 2021-08-30 Method and related device for rendering application

Publications (1)

Publication Number Publication Date
WO2023029424A1 true WO2023029424A1 (en) 2023-03-09

Family

ID=85290861

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/079498 WO2023029424A1 (en) 2021-08-30 2022-03-07 Method for rendering application and related device

Country Status (2)

Country Link
CN (1) CN115731331A (en)
WO (1) WO2023029424A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0511537A2 (en) * 1991-04-23 1992-11-04 International Business Machines Corporation Object-based irregular-grid volume rendering
US20110012901A1 (en) * 2009-06-29 2011-01-20 Anton Kaplanyan Method, computer graphics image rendering system and computer-readable data storage medium for computing of indirect illumination in a computer graphics image of a scene
CN104050707A (en) * 2013-03-15 2014-09-17 想象技术有限公司 Rendering using point sampling and precalculated light transport information
CN112184873A (en) * 2020-10-19 2021-01-05 网易(杭州)网络有限公司 Fractal graph creating method and device, electronic equipment and storage medium
CN113079409A (en) * 2021-03-26 2021-07-06 深圳市凉屋游戏科技有限公司 Picture rendering method and picture rendering device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0511537A2 (en) * 1991-04-23 1992-11-04 International Business Machines Corporation Object-based irregular-grid volume rendering
US20110012901A1 (en) * 2009-06-29 2011-01-20 Anton Kaplanyan Method, computer graphics image rendering system and computer-readable data storage medium for computing of indirect illumination in a computer graphics image of a scene
CN104050707A (en) * 2013-03-15 2014-09-17 想象技术有限公司 Rendering using point sampling and precalculated light transport information
CN112184873A (en) * 2020-10-19 2021-01-05 网易(杭州)网络有限公司 Fractal graph creating method and device, electronic equipment and storage medium
CN113079409A (en) * 2021-03-26 2021-07-06 深圳市凉屋游戏科技有限公司 Picture rendering method and picture rendering device

Also Published As

Publication number Publication date
CN115731331A (en) 2023-03-03

Similar Documents

Publication Publication Date Title
WO2021228031A1 (en) Rendering method, apparatus and system
US10049486B2 (en) Sparse rasterization
US20230230311A1 (en) Rendering Method and Apparatus, and Device
US9508191B2 (en) Optimal point density using camera proximity for point-based global illumination
US20240096007A1 (en) Rendering Method, Device, and System
US11790594B2 (en) Ray-tracing with irradiance caches
US10325403B2 (en) Image based rendering techniques for virtual reality
US11823321B2 (en) Denoising techniques suitable for recurrent blurs
CN116758208A (en) Global illumination rendering method and device, storage medium and electronic equipment
WO2022105641A1 (en) Rendering method, device and system
WO2022156451A1 (en) Rendering method and apparatus
US20240177394A1 (en) Motion vector optimization for multiple refractive and reflective interfaces
WO2023088047A1 (en) Rendering method and apparatus
WO2023005631A1 (en) Rendering method and apparatus, and storage medium
WO2023029424A1 (en) Method for rendering application and related device
US20230206567A1 (en) Geometry-aware augmented reality effects with real-time depth map
CN116958390A (en) Image rendering method, device, equipment, storage medium and program product
WO2024109006A1 (en) Light source elimination method and rendering engine
WO2023109582A1 (en) Light ray data processing method and apparatus, device and storage medium
EP4258218A1 (en) Rendering method, device, and system
US20240203030A1 (en) 3d model rendering method and apparatus, electronic device, and storage medium
WO2024091613A1 (en) Method and system for ray tracing
Miguel et al. Real-time 3D visualization of accurate specular reflections in curved mirrors a GPU implementation
CN115761123A (en) Three-dimensional model processing method and device, electronic device and storage medium
Miguel et al. Real-Time 3D Visualization of Accurate Specular Reflections in Curved Mirrors

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: 22862573

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE