Image processing method and related equipment
By generating energy field maps and collecting point cloud and photon information to determine scene lighting information, the problem of low rendering efficiency of existing ray tracing technology is solved, achieving the effect of improving rendering efficiency while ensuring image quality.
Patent Information
- Application Number
- CN202410057592.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-15
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-01-15
AI Technical Summary
Existing ray tracing technology cannot render efficiently while ensuring image quality, resulting in heavy rendering processing load and poor operability and responsiveness.
By obtaining the target three-dimensional space to be rendered, the energy field map is generated, and the light fluctuation parameters are determined based on the preset light source and camera information, thereby collecting point cloud and photon information, determining the scene lighting information, and rendering, to generate the target image to be displayed.
It improves rendering efficiency while ensuring image quality. By collecting point cloud and photon information at the same time, it can determine the lighting situation more efficiently, reduce the computing load, and increase the speed of image rendering.
Smart Images

Figure CN117876564B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an image processing method and related equipment. Background Art
[0002] With the development of computer graphics technology, ray tracing technology has been widely used in games, animations, film and television dramas and other products. Ray tracing technology is a rendering algorithm in computer graphics. It specifically refers to projecting light through a certain point to the scene and tracing the light to determine whether the light intersects with an object in the scene.
[0003] As the clarity of the image increases and the displayed content becomes more complex, the rendering processing load increases, and the operability and responsiveness issues become more obvious, current ray tracing technology cannot render efficiently while ensuring image quality. Summary of the invention
[0004] The embodiments of the present application provide an image processing method and related devices for improving rendering efficiency while ensuring image quality.
[0005] In a first aspect, an image processing method is provided, comprising: acquiring a target three-dimensional space to be rendered; generating an energy field map according to a scattering result of an energy field in the target three-dimensional space, wherein the energy field is formed by a point cloud and photons; determining light fluctuation parameters according to a preset light source and camera information of the target three-dimensional space, and collecting point cloud information and photon information from the energy field map based on the light fluctuation parameters; determining scene illumination information of the target three-dimensional space based on the collected point cloud information and photon information, and rendering the target three-dimensional space based on the scene illumination information to generate a target image to be displayed.
[0006] In some embodiments, determining the scene lighting information of the target three-dimensional space based on the collected point cloud information and the photon information includes: determining at least one of the radiance information, shadow information, and ambient occlusion information of each pixel in the target three-dimensional space based on the point cloud information and the photon information; determining the scene lighting information based on at least one of the radiance information, the shadow information, and the ambient occlusion information.
[0007] In some embodiments, determining the scene lighting information based on at least one of the radiance information, the shadow information, and the ambient occlusion information includes: determining direct lighting data, indirect lighting data, albedo data, and light pressure data based on at least one of the radiance information, the shadow information, and the ambient occlusion information; determining the scene lighting information based on the direct lighting data, the indirect lighting data, the albedo data, and the light pressure data.
[0008] In some embodiments, the method further includes: if there is polarized light in the target three-dimensional space, adjusting the direct illumination data and the indirect illumination data according to illumination data of the polarized light after double refraction.
[0009] In some embodiments, it also includes: if there is a target object that meets preset attributes in the target three-dimensional space, the preset attributes include prism and / or lens attributes; adjusting the scene illumination information according to the wavelength change data and amplitude change data caused by the target object.
[0010] In some embodiments, collecting the point cloud information and the photon information from the energy field map based on the light fluctuation parameters includes: determining a low-brightness area in the energy field map based on the light fluctuation parameters; collecting the point cloud information and the photon information from the low-brightness area based on a first collection rate; collecting the point cloud information and the photon information from areas other than the low-brightness area in the energy field map based on a second collection rate; wherein the first collection rate is lower than the second collection rate.
[0011] In some embodiments, obtaining the target three-dimensional space to be rendered includes: obtaining viewpoint movement instructions and / or object movement instructions; determining the target position according to the viewpoint movement instructions and / or the object movement instructions, and constructing the target three-dimensional space based on the target position.
[0012] In a second aspect, an image processing device is provided, comprising: an acquisition module for acquiring a target three-dimensional space to be rendered; a generation module for generating an energy field map according to a scattering result of the energy field in the target three-dimensional space, wherein the energy field is formed by a point cloud and photons; a collection module for determining light fluctuation parameters according to a preset light source and camera information of the target three-dimensional space, and collecting point cloud information and photon information from the energy field map based on the light fluctuation parameters; a rendering module for determining scene illumination information of the target three-dimensional space based on the collected point cloud information and photon information, and rendering the target three-dimensional space based on the scene illumination information to generate a target image to be displayed.
[0013] According to a third aspect, an electronic device is provided, comprising a processor and a memory, wherein an executable program is stored in the memory, and the processor executes the executable program to perform the method according to the first aspect.
[0014] According to a fourth aspect, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method according to the first aspect is implemented.
[0015] By applying the above technical scheme, a target three-dimensional space to be rendered is obtained; an energy field map is generated according to the scattering result of the energy field in the target three-dimensional space, wherein the energy field is formed by point clouds and photons; light fluctuation parameters are determined according to a preset light source and camera information of the target three-dimensional space, and point cloud information and photon information are collected from the energy field map based on the light fluctuation parameters; scene lighting information of the target three-dimensional space is determined based on the collected point cloud information and photon information, and the target three-dimensional space is rendered based on the scene lighting information to generate a target image to be displayed, and by simultaneously collecting point cloud information and photon information in the energy field map, it is possible to more efficiently determine scene lighting information that meets the lighting conditions in the three-dimensional space to be rendered, thereby improving image rendering efficiency while ensuring image quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A flowchart of an image processing method according to an embodiment of the present application;
[0017] Figure 2 A flowchart for determining scene illumination information of a target three-dimensional space in an embodiment of the present application;
[0018] Figure 3 A flow chart of collecting point cloud information and photon information from an energy field map in an embodiment of the present application;
[0019] Figure 4 A flowchart of obtaining a target three-dimensional space in an embodiment of the present application;
[0020] Figure 5 Schematic diagram of the principle of the image processing method in the embodiment of the present application;
[0021] Figure 6 This is an overall flow chart of an image processing method in another embodiment of the present application;
[0022] Figure 7 This is a flowchart of the rendering pipeline in an embodiment of the present application;
[0023] Figure 8 This is a structural block diagram of an image processing device according to an embodiment of the present application;
[0024] Fig. 9 A structural block diagram of an electronic device according to an embodiment of the present application;
[0025] Fig.10 This is a structural block diagram of an electronic device according to another embodiment of the present application. DETAILED DESCRIPTION
[0026] Various aspects and features of the present application are described herein with reference to the accompanying drawings.
[0027] It should be understood that various modifications may be made to the embodiments of the present application. Therefore, the above description should not be considered as limiting, but only as an example of an embodiment. Other modifications within the scope and spirit of the present application will occur to those skilled in the art.
[0028] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.
[0029] These and other characteristics of the present application will become apparent from the following description of a preferred form of embodiment given as a non-limiting example with reference to the accompanying drawings.
[0030] It should also be understood that although the present application has been described with reference to some specific examples, those skilled in the art will be able to readily implement many other equivalent forms of the present application.
[0031] The above and other aspects, features and advantages of the present application will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.
[0032] Specific embodiments of the present application are described hereinafter with reference to the accompanying drawings; however, it should be understood that the embodiments applied for are merely examples of the present application, which may be implemented in a variety of ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that obscure the present application. Therefore, the specific structural and functional details applied for herein are not intended to be limiting, but merely serve as a basis and representative basis for the claims to teach those skilled in the art to use the present application in a variety of ways with substantially any suitable detailed structure.
[0033] This specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," all of which may refer to one or more of the same or different embodiments according to the present application.
[0034] An image processing method in an embodiment of the present application can improve rendering efficiency while ensuring image quality. The method can be applied to electronic devices such as computers, and the image processing is implemented by the electronic devices.
[0035] like Figure 1 As shown, the method comprises the following steps:
[0036] Step S101, obtaining a target three-dimensional space to be rendered.
[0037] The target 3D space is a virtual 3D space, which includes one or more preset light sources and one or more objects. Each object may include a static object, such as a static geometric object, or a dynamic object, such as a running object, a character, etc. The preset light source may be a natural light source, such as sunlight, moonlight, etc., or an artificial light source, such as an electric light, etc. The target 3D space may be acquired according to the instructions input by the user, or the acquisition of the target 3D space may be automatically triggered when the preset conditions are met.
[0038] Step S102, generating an energy field map according to the scattering result of the energy field in the target three-dimensional space, wherein the energy field is formed by a point cloud and photons.
[0039] There is an energy field in the target three-dimensional space. The energy field includes point clouds and photons. The energy field is scattered in the target three-dimensional space. The scattering process includes the scattering of photons and the scattering of point clouds. Among them, photons are virtual particles formed after light modeling, and point clouds are volume point clouds that can characterize the light-receiving performance of the object material. The volume point cloud can be determined by the point cloud generator. An energy field map is generated based on the scattering results of the energy field in the target three-dimensional space. The energy field map records the parameters such as the incident position, radiation flux, and incident direction of all photons that propagate from the light source to the final absorption by the surface of the object, and the corresponding point cloud data. The generated energy field map is stored in the energy field map memory, and the energy field map can be called from the energy field map memory later as needed.
[0040] The point cloud is created by generating a point cloud with the pixel distribution accuracy corresponding to the current screen resolution according to the user screen resolution and scene size information. The radius of the point cloud is the current pixel information, and the point cloud structure is determined by the following formula:
[0041] ,
[0042] Where n is the resolution size, L is the screen pixel ratio (DPI), is the scene pixel information, Point cloud structure.
[0043] The point cloud generator constructs a virtual 3D space from a specified position and then radiates the point cloud from a predetermined light source to generate a dynamic point cloud of corresponding accuracy to represent the illumination of the object material. The point cloud radiation information is determined by the following formula:
[0044] ,
[0045] in, is the point cloud radiation information, is the scene lighting radiance distribution information, dx is the scene information, n is the radius of the point cloud, and j is the number of point clouds.
[0046] Step S103, determining light fluctuation parameters according to a preset light source and camera information of the target three-dimensional space, and collecting point cloud information and photon information from the energy field map based on the light fluctuation parameters.
[0047] The target three-dimensional space includes a camera, the camera information is the position information of the camera, the light wave parameter is determined according to the position of the preset light source and the camera information, and the point cloud information and photon information are collected from the energy field map based on the light wave parameter. Specifically, the light wave parameter can be a parameter of the light wave equation, and the light wave equation is established through the light wave parameter, and the point cloud information and photon information are collected from the energy field map based on the light wave equation. The specific form of the light wave equation is the prior art and will not be repeated here.
[0048] Optionally, multiple preset positions can be set from the energy field map to collect point cloud information and photon information at each preset position. Point cloud information and photon information within a preset range centered on the preset position can also be collected according to a preset search algorithm, and the preset search algorithm can be, for example, a kd-tree algorithm.
[0049] Step S104: determining scene illumination information of the target three-dimensional space based on the collected point cloud information and the photon information, and rendering the target three-dimensional space based on the scene illumination information to generate a target image to be displayed.
[0050] In this embodiment, the scene illumination information of the target three-dimensional space is determined by the collected point cloud information and photon information, and then the target three-dimensional space is rendered based on the scene illumination information, and the target image to be displayed is generated after the rendering is completed. Specifically, after determining the scene illumination information, the radiance of each pixel in the target three-dimensional space can be determined based on the scene illumination information, and then the pixel value of each pixel can be determined according to the radiance, and finally, rendering is performed according to each pixel value based on a preset rendering process to generate the target image to be displayed.
[0051] In some embodiments of the present application, before rendering the target three-dimensional space based on the scene lighting information, the scene lighting information of each frame is cached, and the cached scene lighting information of each frame is streamed into a preset rendering process for rendering, so that a video composed of target images can be displayed on a display device.
[0052] The image processing method in the embodiment of the present application obtains a target three-dimensional space to be rendered; generates an energy field map according to the scattering result of the energy field in the target three-dimensional space, wherein the energy field is formed by a point cloud and photons; determines light fluctuation parameters according to a preset light source and camera information of the target three-dimensional space, and collects point cloud information and photon information from the energy field map based on the light fluctuation parameters; determines scene lighting information of the target three-dimensional space based on the collected point cloud information and photon information, and renders the target three-dimensional space based on the scene lighting information to generate a target image to be displayed. By simultaneously collecting point cloud information and photon information in the energy field map, it is possible to more efficiently determine scene lighting information that meets the lighting conditions in the three-dimensional space to be rendered, thereby improving image rendering efficiency while ensuring image quality.
[0053] Based on any embodiment of the present application, the scene illumination information of the target three-dimensional space is determined based on the collected point cloud information and the photon information, such as Figure 2 As shown, the following steps are included:
[0054] Step S21, determining at least one of the radiosity information, shadow information and ambient occlusion information of each pixel in the target three-dimensional space based on the point cloud information and the photon information.
[0055] In this embodiment, the radiosity information represents the distribution of light energy on the surface of an object in a closed environment. The shadow information represents the shadow cast by the object. It determines whether the point is in the shadow by tracing the light from the point to the light source. If the light hits an opaque object along the way, the object is in the shadow. Ambient occlusion information (AO) is used to depict the effect of blocking the surrounding diffuse light when objects intersect or approach each other. It can solve or improve problems such as light leakage, floating and unrealistic shadows, as well as solve or improve the unclear performance of gaps, folds and corners, corner lines and small objects in the scene.
[0056] Optionally, the radiosity information, shadow information and ambient occlusion information of each pixel in the target three-dimensional space can be determined separately in a preset order based on the point cloud information and photon information, or the radiosity information, shadow information and ambient occlusion information can be determined simultaneously based on a parallel process to improve processing efficiency.
[0057] Step S22: determining the scene lighting information based on at least one of the radiance information, the shadow information, and the ambient occlusion information.
[0058] At least one of the radiosity information, shadow information and ambient occlusion information reflects the lighting conditions in the target three-dimensional space. The scene lighting information can be determined based on at least one of the three, thereby improving the accuracy of the scene lighting information.
[0059] In some embodiments of the present application, determining the scene lighting information based on at least one of the radiance information, the shadow information, and the ambient occlusion information includes:
[0060] determining direct lighting data, indirect lighting data, albedo data, and light pressure data based on at least one of the radiance information, the shadow information, and the ambient occlusion information;
[0061] The scene lighting information is determined based on the direct lighting data, the indirect lighting data, the albedo data, and the light pressure data.
[0062] In this embodiment, direct illumination data refers to the light from the light source directly irradiating the surface of the object. It is a kind of local illumination that can simulate the effect of the sun, lamps and other light sources directly irradiating the surface of the object. Indirect illumination information is a combination of one or more of reflection, refraction, caustics, diffraction, transmission, dispersion, polarization, distortion and other information. Albedo, also known as reflectivity, is a physical quantity that represents the degree of reflection of light by an object. It is the ratio of the energy of light reflected on the surface of the object to the energy of light incident on the surface of the object. Albedo can be used to represent the optical properties of the surface of the object, such as the color of the object, the degree of diffuse reflection and the degree of specular reflection. Light pressure data refers to the pressure exerted on the surface of the object by light irradiating on the object.
[0063] The scene lighting information is determined by direct lighting data, indirect lighting data, albedo data and light pressure data, thereby further improving the accuracy of the scene lighting information.
[0064] Optionally, direct illumination data, indirect illumination data, albedo data and light pressure data may be determined separately in a preset order, or may be determined simultaneously based on a parallel process to improve processing efficiency.
[0065] In some embodiments of the present application, the method further includes:
[0066] If polarized light exists in the target three-dimensional space, the direct illumination data and the indirect illumination data are adjusted according to illumination data of the polarized light after birefringence.
[0067] Polarized light refers to a light wave whose vibration direction of the light vector remains unchanged or changes in a certain regular manner. According to its properties, polarized light can be divided into plane polarized light (linear polarized light), circular polarized light, elliptically polarized light, and partially polarized light. If polarized light exists in the target three-dimensional space, the illumination data of the polarized light after birefringence is determined, and the direct illumination data and indirect illumination data are adjusted based on the illumination data, thereby further improving the accuracy of the direct illumination data and the indirect illumination data.
[0068] In some embodiments of the present application, the method further includes:
[0069] If there is a target object in the target three-dimensional space that meets preset attributes, the preset attributes include prism and / or lens attributes;
[0070] The scene illumination information is adjusted according to the wavelength change data and the amplitude change data caused by the target object.
[0071] In this embodiment, the presence of prisms and lenses will cause changes in the wavelength and amplitude of light. If there is a target object with prism and / or lens attributes in the target three-dimensional space, the wavelength change data and amplitude change data caused by the target object are determined, and the scene lighting information is adjusted based on the wavelength change data and the amplitude change data, thereby further improving the accuracy of the scene lighting information.
[0072] Based on any embodiment of the present application, the point cloud information and photon information are collected from the energy field map based on the light fluctuation parameters, such as Figure 3 As shown, the following steps are included:
[0073] Step S31, determining a low brightness area in the energy field map based on the light fluctuation parameters.
[0074] In this embodiment, the low brightness area is an area where the average brightness of each pixel in the area is lower than the first preset threshold, or it can be an area where the maximum brightness of the pixels in the area is lower than the second preset threshold. The low brightness area in the energy field map is determined based on the light fluctuation parameter.
[0075] Specifically, a variety of methods can be used to determine the low-brightness area. In some embodiments, the positional relationship between the light source and the object in the virtual three-dimensional space is determined based on the light fluctuation parameters, and the shadow area generated by the direct light is obtained based on the positional relationship, so as to identify the low-brightness area. In some embodiments, the brightness value of the color represented by the object texture is determined based on the light fluctuation parameters, and the low-brightness area is identified based on the brightness value.
[0076] Step S32: collecting the point cloud information and the photon information from the low brightness area based on a first collection rate.
[0077] The collection rate is the ratio of the number of point clouds and photons collected in the region to the total number of point clouds and photons in the region. For low brightness regions, point cloud information and photon information are collected based on a first collection rate.
[0078] Step S33, collecting the point cloud information and the photon information from the area other than the low brightness area in the energy field map based on the second collection rate.
[0079] For areas other than low brightness areas in the energy field map, point cloud information and photon information are collected based on a second collection rate, wherein the first collection rate is lower than the second collection rate.
[0080] Optionally, the second collection rate may be 100% or less than 100%. The first collection rate may be zero or greater than zero, for example, the first collection rate is set to zero in some low-brightness areas and is set to greater than zero in other low-brightness areas.
[0081] By collecting point cloud information and photon information in low-brightness areas at a smaller collection rate, local simplified calculations are performed only on low-brightness areas, which reduces the computational load and improves the speed of rendering processing without reducing the overall image quality.
[0082] In some embodiments, if the low-brightness region is a target low-brightness region with caustics, the point cloud information and the photon information are collected from the target low-brightness region based on a second collection rate.
[0083] In this embodiment, if the light passing through the transparent object is gathered by refraction and the light shines in the shadow, it is determined that there is caustic. If the collection rate in the target low-brightness area is reduced, the caustic may disappear or the brightness difference may occur at the boundary with the originally continuous caustic outside the low-brightness area. Therefore, point cloud information and photon information are still collected from the target low-brightness area based on the second collection rate, and sufficient cloud information and photon information are collected to achieve a more accurate representation of the caustic phenomenon in the target low-brightness area.
[0084] In some embodiments of the present application, the target three-dimensional space to be rendered is obtained, such as Figure 4 As shown, including:
[0085] Step S41, obtaining a viewpoint movement instruction and / or an object movement instruction.
[0086] In this embodiment, the viewpoint movement instruction and / or the object movement instruction may be input by a user through an input device, and the input device may be, for example, a touch screen, a mouse, a keyboard, etc.
[0087] Step S42: determining a target position according to the viewpoint movement instruction and / or the object movement instruction, and constructing the target three-dimensional space based on the target position.
[0088] The target position may include the target position of the viewpoint and / or the target position of the object. Accordingly, the target position of the viewpoint can be determined according to the viewpoint movement instruction, and the target position of the object can be determined according to the object movement instruction. The target three-dimensional space is constructed according to the target position, so that the target three-dimensional space matches the viewpoint position and / or the object position, thereby improving the accuracy of the target three-dimensional space.
[0089] The following describes this solution in conjunction with the specific application scenarios of this application.
[0090] The present application embodiment provides an image processing method, such as Figure 5 As shown in the figure, it includes 4 algorithm branches. In the first branch, the energy field is established, the energy field and the light and dark distribution information of the whole scene are solved and updated in turn. In the second branch, the scene photon information is created, the photon illumination information is calculated, and the photon map of the whole scene is generated in turn. In the third branch, the volume point cloud is created, the point cloud radiance is calculated, and the screen pixel information is updated in turn. In the fourth branch, the volatility is initialized, the scene light characteristics are calculated, and the scene illumination information is updated. Among them, the four algorithm branches are asynchronous parallel calculations.
[0091] like Figure 6 The overall flow chart of the image processing method is shown, which includes the following processes:
[0092] First, the octonion system is initialized, and then it is divided into two branches for processing. One branch calculates the energy field and the volume point cloud and atmospheric information factors, and the other branch determines the parameters of the light wave equation. Based on the results obtained by the two branches, the radiation, shadow and ambient light occlusion of the photon mapping part are calculated, and then the light pressure, albedo and indirect lighting are calculated. The indirect lighting calculation includes the calculation of one or more combinations of reflection, refraction, caustics, diffraction, transmission, dispersion and other information. The indirect lighting calculation also includes the adaptive calculation of transparency and translucency. Finally, the scene lighting information is updated through direct lighting data, indirect lighting data, albedo data and light pressure data, and the calculation results of each frame are determined and cached, and then input into the rendering pipeline for rendering. In addition, if there are prisms and lenses, the properties of the prisms and lenses are calculated, and the scene lighting information is adjusted according to the calculated wavelength change data and amplitude change data.
[0093] like Figure 7 The flowchart of the rendering pipeline in the embodiment of the present application is shown, which includes the following process: obtaining a real-time ray tracing data stream (ie Figure 6 The calculation results of each frame in the scene are collected, rendering starts, and it is drawn to the G-buffer (Geometric Buffer), followed by rendering queue and occlusion, updating real-time ray tracing data, updating real-time ray tracing physical rendering information, delayed rendering, updating the scene, Solid post-processing, updating the screen, UI rendering, and finally outputting the rendering results.
[0094] Based on the same inventive concept, the present application also proposes an image processing device, such as Figure 8As shown, the device includes: an acquisition module, used to acquire a target three-dimensional space to be rendered; a generation module, used to generate an energy field map according to a scattering result of the energy field in the target three-dimensional space, wherein the energy field is formed by a point cloud and photons; a collection module, used to determine light fluctuation parameters according to a preset light source and camera information of the target three-dimensional space, and to collect point cloud information and photon information from the energy field map based on the light fluctuation parameters; a rendering module, used to determine scene illumination information of the target three-dimensional space based on the collected point cloud information and photon information, and to render the target three-dimensional space based on the scene illumination information to generate a target image to be displayed.
[0095] In a specific application scenario, the rendering module is specifically used to: determine at least one of the radiosity information, shadow information and ambient occlusion information of each pixel in the target three-dimensional space based on the point cloud information and the photon information; determine the scene lighting information based on at least one of the radiosity information, the shadow information and the ambient occlusion information.
[0096] In a specific application scenario, the rendering module is also specifically used to: determine direct lighting data, indirect lighting data, albedo data and light pressure data based on at least one of the radiance information, the shadow information and the ambient occlusion information; determine the scene lighting information based on the direct lighting data, the indirect lighting data, the albedo data and the light pressure data.
[0097] In a specific application scenario, the rendering module is further used to: if there is polarized light in the target three-dimensional space, adjust the direct illumination data and the indirect illumination data according to illumination data of the polarized light after double refraction.
[0098] In a specific application scenario, the rendering module is also used to: if there is a target object in the target three-dimensional space that meets preset attributes, the preset attributes include prism and / or lens attributes; adjust the scene lighting information according to the wavelength change data and amplitude change data caused by the target object.
[0099] In a specific application scenario, the collection module is specifically used to: determine the low-brightness area in the energy field map based on the light fluctuation parameters; collect the point cloud information and the photon information from the low-brightness area based on a first collection rate; collect the point cloud information and the photon information from the area other than the low-brightness area in the energy field map based on a second collection rate; wherein the first collection rate is lower than the second collection rate.
[0100] In a specific application scenario, the acquisition module is specifically used to: acquire viewpoint movement instructions and / or object movement instructions; determine the target position according to the viewpoint movement instructions and / or the object movement instructions, and construct the target three-dimensional space based on the target position.
[0101] The image processing device in the embodiment of the present application includes: an acquisition module, which is used to acquire a target three-dimensional space to be rendered; a generation module, which is used to generate an energy field map according to the scattering result of the energy field in the target three-dimensional space, and the energy field is formed by point clouds and photons; a collection module, which is used to determine light fluctuation parameters according to a preset light source and camera information of the target three-dimensional space, and collect point cloud information and photon information from the energy field map based on the light fluctuation parameters; a rendering module, which is used to determine the scene lighting information of the target three-dimensional space based on the collected point cloud information and photon information, and render the target three-dimensional space based on the scene lighting information to generate a target image to be displayed, and by simultaneously collecting point cloud information and photon information in the energy field map, it is possible to more efficiently determine the scene lighting information that meets the lighting conditions in the three-dimensional space to be rendered, thereby improving the image rendering efficiency while ensuring the image quality.
[0102] Based on the same inventive concept, the embodiment of the present application also provides an electronic device, such as Fig. 9 As shown, it includes a processor and a memory, wherein an executable program is stored in the memory, and the processor executes the executable program to perform the image processing method as described above.
[0103] In some embodiments of the present application, Fig.10 As shown, the processor of the electronic device is a CPU 10, the memory is a main memory 12, and the electronic device further includes a GPU 11. The CPU 10 controls signal processing and internal components based on programs such as an operating system, applications, etc. The GPU 11 performs image processing.
[0104] These parts are interconnected with each other via a bus 13. The bus 13 is also connected to an input-output interface 19. The input-output interface 19 is connected to a communication part 14 including a peripheral device for USB, IEEE 1394, etc. and a network interface for a wired or wireless LAN, a storage part 15 such as a hard disk drive, a nonvolatile memory, etc., an output part 16 that outputs data to an output device such as a display device, a speaker, etc., an input part 17 that receives data from an input device such as a keyboard, a mouse, a game controller, a microphone, a camera, etc., and a recording medium drive part 18 that drives a removable recording medium such as a magnetic disk, an optical disk, a semiconductor memory, etc.
[0105] The CPU 10 controls the entire electronic device by executing the operating system stored in the storage section 15. The CPU 10 also executes various programs read from a removable recording medium and loaded into the main memory 12, or downloaded via the communication section 14. The GPU 11 has the function of a geometry transfer engine and the function of a rendering processor. The GPU 11 performs rendering processing according to a rendering instruction from the CPU 10, and stores a display image in a frame memory not shown in the figure. Then, the GPU 11 converts the display image stored in the frame memory into a video signal, and outputs the video signal to the output section 16, etc.
[0106] The above embodiments are only exemplary embodiments of the present application and are not intended to limit the present application. The protection scope of the present application is defined by the claims. Those skilled in the art may make various modifications or equivalent substitutions to the present application within the essence and protection scope of the present application, and such modifications or equivalent substitutions shall also be deemed to fall within the protection scope of the present application.
Claims
1. An image processing method, It is characterized in that The method comprises: Get the target three-dimensional space to be rendered; Generate an energy field map according to the scattering result of the energy field in the three-dimensional space of the target, wherein the energy field is formed by a point cloud and photons, wherein photons are virtual particles formed after light is modeled, and point clouds are volume point clouds representing the light-receiving performance of the object material; Determine light fluctuation parameters according to a preset light source and camera information of the target three-dimensional space, and collect point cloud information and photon information from the energy field map based on the light fluctuation parameters; Determining scene illumination information of the target three-dimensional space based on the collected point cloud information and the photon information, and rendering the target three-dimensional space based on the scene illumination information to generate a target image to be displayed; The determining of scene illumination information of the target three-dimensional space based on the collected point cloud information and the photon information includes: Determine at least one of radiosity information, shadow information, and ambient occlusion information of each pixel in the target three-dimensional space based on the point cloud information and the photon information; determining the scene lighting information based on at least one of the radiance information, the shadow information, and the ambient occlusion information; The collecting point cloud information and photon information from the energy field map based on the light fluctuation parameters includes: Determining a low brightness area in the energy field map based on the light fluctuation parameter; collecting the point cloud information and the photon information from the low brightness area based on a first collection rate; Collecting the point cloud information and the photon information from the area other than the low brightness area in the energy field map based on a second collection rate; Among them, the low brightness area is an area where the average brightness of each pixel in the area is lower than a first preset threshold, or an area where the highest brightness of the pixels in the area is lower than a second preset threshold, and the first collection rate is lower than the second collection rate.
2. The method according to claim 1, It is characterized in that The determining the scene lighting information based on at least one of the radiance information, the shadow information, and the ambient occlusion information comprises: determining direct lighting data, indirect lighting data, albedo data, and light pressure data based on at least one of the radiance information, the shadow information, and the ambient occlusion information; The scene lighting information is determined based on the direct lighting data, the indirect lighting data, the albedo data, and the light pressure data.
3. The method according to claim 2, It is characterized in that Also includes: If polarized light exists in the target three-dimensional space, the direct illumination data and the indirect illumination data are adjusted according to illumination data of the polarized light after birefringence.
4. The method according to claim 2, It is characterized in that Also includes: If there is a target object in the target three-dimensional space that meets preset attributes, the preset attributes include prism and / or lens attributes; The scene illumination information is adjusted according to the wavelength change data and the amplitude change data caused by the target object.
5. The method according to claim 1, It is characterized in that The step of obtaining a target three-dimensional space to be rendered includes: Obtaining a viewpoint movement instruction and / or an object movement instruction; A target position is determined according to the viewpoint movement instruction and / or the object movement instruction, and the target three-dimensional space is constructed based on the target position.
6. An image processing device, It is characterized in that The device comprises: An acquisition module, used to acquire a target three-dimensional space to be rendered; A generation module, used to generate an energy field map according to the scattering result of the energy field in the target three-dimensional space, wherein the energy field is formed by a point cloud and photons, wherein the photons are virtual particles formed after light modeling, and the point cloud is a volume point cloud representing the light-receiving performance of the object material; A collection module, used to determine light fluctuation parameters according to a preset light source and camera information of the target three-dimensional space, and to collect point cloud information and photon information from the energy field map based on the light fluctuation parameters; A rendering module, used to determine scene illumination information of the target three-dimensional space based on the collected point cloud information and the photon information, and render the target three-dimensional space based on the scene illumination information to generate a target image to be displayed; A rendering module is specifically used to: determine at least one of the radiosity information, shadow information and ambient occlusion information of each pixel in the target three-dimensional space based on the point cloud information and the photon information; determine the scene lighting information based on at least one of the radiosity information, the shadow information and the ambient occlusion information; A collection module, specifically used to: determine a low-brightness area in the energy field map based on the light fluctuation parameters; collect the point cloud information and the photon information from the low-brightness area based on a first collection rate; collect the point cloud information and the photon information from areas other than the low-brightness area in the energy field map based on a second collection rate; wherein the low-brightness area is an area where the average brightness of each pixel in the area is lower than a first preset threshold, or an area where the highest brightness of pixels in the area is lower than a second preset threshold, and the first collection rate is lower than the second collection rate.
7. An electronic device, It is characterized in that It comprises a processor and a memory, wherein an executable program is stored in the memory, and the processor executes the executable program to perform the image processing method according to any one of claims 1 to 5.
8. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the image processing method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Systems and methods for rendering data from a 3D environment
CN112074782A
Rendering method and device based on liquid level, equipment, medium and program product
CN114092621A
Light source sampling weight determination method for multi-light source scene rendering and related equipment
CN114549730A
Image processing device, image processing method, computer program, and recording medium
US20150348314A1
Fine grained interleaved rendering applications in path tracing for cloud computing environments
US20200372699A1
