Rendering method and device

Through the adaptive ambient light sampling algorithm, the pre-calculated detection point window information is used to record the effective sampling direction, which solves the problem of high noise in indoor scenes based on image lighting in the existing technology, and achieves efficient and accurate real-time rendering and different viewing angles. Adaptive rendering needs.

CN118587346APending Publication Date: 2024-09-03HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310237545.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-02
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

In the existing technology, image-based lighting in indoor scenes causes high noise due to occlusion problems. Especially in scenes with small windows or numerous objects, it is difficult to achieve efficient and accurate real-time rendering, and cannot adapt to the rendering needs of different viewing angles.

Method used

An adaptive ambient light sampling algorithm is proposed that is independent of the camera position. By pre-calculating the detection point window information of the environment map, the effective sampling direction range of each position is recorded, adapting to the rendering needs of different viewing angles, and improving rendering quality and efficiency.

Benefits of technology

It achieves efficient and accurate real-time rendering, reduces computing power consumption, improves the convergence speed of the rendering engine, adapts to the rendering needs of different viewing angles, reduces noise, and improves rendering quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118587346A
    Figure CN118587346A
Patent Text Reader

Abstract

The invention relates to a rendering method and device. The method comprises the following steps: acquiring a to-be-rendered point, wherein the to-be-rendered point is any one to-be-rendered point in a to-be-loaded target scene picture; determining a second detection point corresponding to the to-be-rendered point from a plurality of first detection points of the environment map; determining a sampling direction corresponding to the to-be-rendered point according to the window information of the second detection point; sampling the environment map according to the sampling direction to obtain sampling information; and rendering the to-be-rendered point according to the sampling information. The adaptive ambient light sampling algorithm irrelevant to the camera position is provided, the effective sampling direction range corresponding to each position can be recorded, the computing power is greatly saved, and meanwhile the rendering quality and the convergence speed of a rendering engine are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a rendering method and device. Background Art

[0002] Image based lighting (IBL) is an irreplaceable tool in production rendering. Generally, an environment map is used as one of the light sources to illuminate the scene. This light source can be called ambient light. For indoor scenes, image lighting is usually the main source of noise due to occlusion problems, especially in scenes with small windows or many objects. In order to better reduce the noise caused by image lighting, the solutions provided in related technologies have problems such as poor accuracy, low real-time rendering efficiency, and difficulty in adapting to rendering requirements from different perspectives. Summary of the invention

[0003] In view of this, a rendering method and device are proposed, which can realize real-time rendering efficiently and accurately, and can be applicable to rendering requirements with different perspective changes.

[0004] In a first aspect, an embodiment of the present application provides a rendering method, the method comprising:

[0005] Obtain a point to be rendered, where the point to be rendered is any point to be rendered in the target scene image to be loaded;

[0006] Determining a second detection point corresponding to the point to be rendered from a plurality of first detection points of the environment map;

[0007] Determining a sampling direction corresponding to the point to be rendered according to the window information of the second detection point;

[0008] Sampling the environment map according to the sampling direction to obtain sampling information;

[0009] Rendering the point to be rendered according to the sampling information;

[0010] Through the first aspect, an adaptive ambient light sampling algorithm is provided that is independent of the camera position, which can record the effective sampling direction range corresponding to each position and adapt to rendering requirements of different perspectives, greatly saving computing power while improving the rendering quality and the convergence speed of the rendering engine.

[0011] In a possible implementation, the window information of the second detection point is used to record the direction information of the target detection light emitted by the second detection point that can hit the environment map.

[0012] In a possible implementation, the method further includes:

[0013] Determine a plurality of first detection points corresponding to the environment map;

[0014] emitting a plurality of detection lights outwardly with each of the first detection points as the center, wherein the plurality of detection lights emitted from each of the first detection points are distributed in a spherical shape;

[0015] Determine a target detection light in a direction of a light hitting the environment map among a plurality of detection lights at each of the first detection points;

[0016] According to the target detection light corresponding to each of the first detection points, window information of the corresponding first detection point is determined.

[0017] By predetermining the window information of each first detection point of the environment map, the subsequent rendering process can be unaffected by the camera position and can adapt to rendering requirements of any viewing angle.

[0018] In a possible implementation, the method further includes:

[0019] A cumulative distribution function is calculated according to the window information of each of the first detection points to obtain a cumulative distribution function table of each of the first detection points.

[0020] In a possible implementation, determining a plurality of first detection points corresponding to the environment map includes:

[0021] Determining a bounding box of the environment map;

[0022] Dividing the bounding box into a plurality of detection blocks having a preset size;

[0023] The vertices of the detection blocks are determined as the first detection points.

[0024] By first determining the detection block and then further determining the first detection point, the process of determining the first detection point can be simplified, and the execution efficiency of a pre-calculation stage can be improved.

[0025] In a possible implementation, determining a plurality of first detection points corresponding to the environment map further includes: after determining the bounding box of the environment map, expanding the size of the bounding box of the environment map; or

[0026] Dividing the bounding box into a plurality of detection blocks with preset sizes includes: dividing the bounding box into a plurality of detection blocks with preset sizes, and expanding the range surrounded by the plurality of detection blocks so that the bounding box is within the range surrounded by the plurality of detection blocks.

[0027] In this way, it can be ensured that the triangular facets used in the rendering stage can be surrounded by the segmented detection blocks.

[0028] In a possible implementation, determining a second detection point corresponding to the point to be rendered from a plurality of first detection points of the environment map includes:

[0029] According to the triangular face of the point to be rendered, determining, from the plurality of first detection points, a candidate detection point whose position matches the triangular face;

[0030] A second detection point is selected from the candidate detection points.

[0031] In a possible implementation, determining, according to the triangular facet of the point to be rendered, a candidate detection point whose position matches the triangular facet from the plurality of first detection points includes:

[0032] A plurality of first detection points on the detection block where the triangular facet of the point to be rendered is located are determined as candidate detection points.

[0033] In a possible implementation, according to the triangular facet of the point to be rendered, determining, from the plurality of first detection points, a candidate detection point whose position matches the triangular facet, further includes:

[0034] Determine a plurality of first detection points on the detection block where the mutated triangular facet of the point to be rendered is located as candidate detection points;

[0035] The mutated points to be rendered are determined by mutating the positions of the points to be rendered using random numbers. By means of mutation, the accuracy of determining the candidate detection points can be improved, thereby improving the accuracy of rendering.

[0036] In a possible implementation manner, determining the sampling direction corresponding to the point to be rendered according to the window information of the second detection point includes:

[0037] Generate a sampling direction corresponding to the point to be rendered according to the generated random number and the cumulative distribution function table of the second detection point; or

[0038] A cumulative distribution function is calculated according to the window information of the second detection point to obtain a cumulative distribution function table, and a sampling direction corresponding to the point to be rendered is generated according to the generated random number and the cumulative distribution function table of the second detection point.

[0039] In a possible implementation, the method further includes:

[0040] The detection information of the target scene image is marked using the identification information of the target scene image and then stored in a detection file, wherein the identification information includes a version number of the target scene image, and the detection information includes a sampling direction of each rendering point of the target scene image and window information of each first detection point.

[0041] In this way, after each rendering is completed, the detection information is stored in the detection file. When the same scene image is loaded next time, if the identification information (version number) of the scene image is equal to the version number of the detection information saved in the current detection file, it means that the previous calculation result can be reused, and the ambient light adaptive sampling can be performed directly without the need to perform the pre-calculation stage again. By reusing the detection information, the loading time is reduced, which speeds up the rendering while reducing the noise caused by random sampling of ambient light, thereby improving the rendering quality.

[0042] In a possible implementation, the method further includes:

[0043] When it is determined that the detection information corresponding to the point to be rendered is stored in the detection file according to the identification information of the target scene image, the sampling direction in the stored detection information is determined as the sampling direction corresponding to the point to be rendered. In this way, the existing detection information can be directly used to further improve the rendering efficiency.

[0044] In a second aspect, an embodiment of the present application provides a rendering device, the device comprising:

[0045] A point acquisition module is used to acquire a point to be rendered, where the point to be rendered is any point to be rendered in a target scene image to be loaded;

[0046] A detection point determination module, used to determine a second detection point corresponding to the point to be rendered from a plurality of first detection points of the environment map;

[0047] A first direction determination module, used to determine the sampling direction corresponding to the point to be rendered according to the window information of the second detection point;

[0048] A sampling information determination module, used for sampling the environment map according to the sampling direction to obtain sampling information;

[0049] A rendering module, used for rendering the points to be rendered according to the sampling information;

[0050] In a possible implementation, the window information of the second detection point is used to record the target detection light emitted by the second detection point in the direction of the light that can hit the environment map.

[0051] In a possible implementation manner, the device further includes:

[0052] A detection point marking module, used to determine a plurality of first detection points corresponding to the environment map;

[0053] A light emitting module, used for emitting a plurality of detection lights outwardly with each of the first detection points as the center, wherein the plurality of detection lights emitted from each of the first detection points are distributed in a spherical shape;

[0054] A light determination module, used to determine a target detection light in a direction of a light hitting the environment map among a plurality of detection lights of each of the first detection points;

[0055] The window information determination module is used to determine the window information of the corresponding first detection point according to the target detection light corresponding to each of the first detection points.

[0056] In a possible implementation manner, the device further includes:

[0057] A calculation module is used to calculate the cumulative distribution function according to the window information of each of the first detection points to obtain a cumulative distribution function table of each of the first detection points.

[0058] In a possible implementation, determining a plurality of first detection points corresponding to the environment map includes:

[0059] Determining a bounding box of the environment map;

[0060] Dividing the bounding box into a plurality of detection blocks having a preset size;

[0061] The vertices of the detection blocks are determined as the first detection points.

[0062] In a possible implementation, determining a plurality of first detection points corresponding to the environment map further includes: after determining the bounding box of the environment map, expanding the size of the bounding box of the environment map; or

[0063] Dividing the bounding box into a plurality of detection blocks with preset sizes includes: dividing the bounding box into a plurality of detection blocks with preset sizes, and expanding the range surrounded by the plurality of detection blocks so that the bounding box is within the range surrounded by the plurality of detection blocks.

[0064] In a possible implementation, determining a second detection point corresponding to the point to be rendered from a plurality of first detection points of the environment map includes:

[0065] According to the triangular face of the point to be rendered, determining, from the plurality of first detection points, a candidate detection point whose position matches the triangular face;

[0066] A second detection point is selected from the candidate detection points.

[0067] In a possible implementation, determining, according to the triangular facet of the point to be rendered, a candidate detection point whose position matches the triangular facet from the plurality of first detection points includes:

[0068] A plurality of first detection points on the detection block where the triangular facet of the point to be rendered is located are determined as candidate detection points.

[0069] In a possible implementation, according to the triangular facet of the point to be rendered, determining, from the plurality of first detection points, a candidate detection point whose position matches the triangular facet, further includes:

[0070] Determine a plurality of first detection points on the detection block where the mutated triangular facet of the point to be rendered is located as candidate detection points;

[0071] The mutated point to be rendered is determined by mutating the position of the point to be rendered using a random number.

[0072] In a possible implementation manner, determining the sampling direction corresponding to the point to be rendered according to the window information of the second detection point includes:

[0073] Generate a sampling direction corresponding to the point to be rendered according to the generated random number and the cumulative distribution function table of the second detection point; or

[0074] A cumulative distribution function is calculated according to the window information of the second detection point to obtain a cumulative distribution function table, and a sampling direction corresponding to the point to be rendered is generated according to the generated random number and the cumulative distribution function table of the second detection point.

[0075] In a possible implementation manner, the device further includes:

[0076] An information marking module is used to mark the detection information of the target scene image using the identification information of the target scene image and store it in a detection file, wherein the identification information includes the version number of the target scene image, and the detection information includes the sampling direction of each rendering point of the target scene image and the window information of each first detection point.

[0077] In a possible implementation manner, the device further includes:

[0078] The second direction determination module is used to determine the sampling direction in the stored detection information as the sampling direction corresponding to the point to be rendered when it is determined that the detection information corresponding to the point to be rendered is stored in the detection file according to the identification information of the target scene image.

[0079] The beneficial effects of the rendering device provided in the second aspect and various possible implementations of the second aspect are the same as those of the rendering method provided in the first aspect and various possible implementations of the first aspect, and are not described here for redundancy.

[0080] According to a third aspect, an embodiment of the present application provides a rendering device, including:

[0081] processor;

[0082] a memory for storing processor-executable instructions;

[0083] The processor is configured to implement one or more rendering methods of the above-mentioned first aspect or multiple possible implementation methods of the first aspect when executing the instruction.

[0084] In a fourth aspect, an embodiment of the present application provides a terminal device, which can execute the rendering method of the above-mentioned first aspect or one or more of the multiple possible implementations of the first aspect.

[0085] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising a computer-readable code, or a non-volatile computer-readable storage medium carrying a computer-readable code. When the computer-readable code runs in an electronic device, a processor in the electronic device executes the rendering method of the above-mentioned first aspect or one or more of the multiple possible implementation methods of the first aspect.

[0086] In a sixth aspect, an embodiment of the present application provides a non-volatile computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement a rendering method of the above-mentioned first aspect or one or more of the multiple possible implementation methods of the first aspect.

[0087] These and other aspects of the present application will become more apparent from the following description of the embodiment(s). BRIEF DESCRIPTION OF THE DRAWINGS

[0088] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the present application and, together with the description, serve to explain the principles of the present application.

[0089] Figure 1 A schematic diagram showing the working process of related technology 1 is shown.

[0090] Figure 2 A schematic diagram showing sampling results of some related technologies.

[0091] Figure 3A A schematic diagram of the splitting of the environment map in the related technology 2 is shown.

[0092] Figure 3B A schematic diagram of splitting the camera field of view in the related technology 2 is shown.

[0093] Figure 4A , Figure 4B A schematic diagram showing the learning phase and the rendering phase in the related technology 2.

[0094] Figure 5 A schematic diagram showing the flow of the pre-calculation stage in the rendering method according to an embodiment of the present application is shown.

[0095] Figure 6 A schematic diagram showing a first detection point in a rendering method according to an embodiment of the present application is shown.

[0096] Fig. 7A , Figure 7B A schematic diagram of the process of the rendering stage in the rendering method according to an embodiment of the present application is shown.

[0097] Figure 8 A schematic diagram showing determination of candidate detection points in a rendering phase in a rendering method according to an embodiment of the present application is shown.

[0098] Fig. 9 A schematic flow chart of step S205 of the rendering phase in the rendering method according to an embodiment of the present application is shown.

[0099] Fig.10 A schematic flowchart of a rendering method according to an embodiment of the present application is shown.

[0100] Fig.11 A structural block diagram of a rendering device according to an embodiment of the present application is shown.

[0101] Fig.12 A schematic structural diagram of an electronic device 100 according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0102] Various exemplary embodiments, features and aspects of the present application will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0103] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0104] In addition, in order to better illustrate the present application, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present application can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present application.

[0105] To facilitate understanding of the technical solution provided by this application, some of the terms involved are explained below:

[0106] Offline Rendering: Usually refers to a concept that is opposite to real-time rendering and interactive rendering. That is, the time for rendering a single frame is long, and the frame rate cannot meet the requirements of real-time or interactive applications. It is generally used for high-quality, high-detail simulation rendering and drawing.

[0107] Real-time Rendering: usually refers to a short single-frame rendering time, with a frame rate of 30fps (Frames Per Second) or above. It is generally used in scenes with high real-time requirements such as games.

[0108] Ray Tracing: It is a special rendering algorithm in 3D computer graphics, which is used to generate visible images in a 3D computer graphics environment. This method works by reversely tracing the light path that intersects with an imaginary camera lens, calculating the light energy at the intersection of the light path and the scene, and finally presenting all the light energy on the image in a recursive manner to achieve the purpose of realistic rendering. In general, images rendered using the ray tracing algorithm are more realistic than images rendered using the raster algorithm.

[0109] Direct Illumination: Light comes directly from the light source without being bounced by photons. Direct illumination is the lighting effect produced by the light source shining directly on the surface of the scene.

[0110] Indirect Illumination: Light comes from the reflection and refraction of other objects. Indirect illumination is the lighting effect produced when the light emitted by the light source is reflected by the object and then illuminates the surface of the scene.

[0111] Shading: In this application, it generally refers to the process of determining the color of a certain point along a certain direction on an image according to certain rules.

[0112] Voxel: Divide the scene image into squares of the same size, each of which is called a voxel.

[0113] Next Event Estimation (NEE): is a method to accelerate direct light sampling.

[0114] Image based lighting (IBL): This article also calls it image based lighting. It is a lighting technique that allows the use of images to illuminate the scene. It is a collection of lighting techniques. The light source of IBL is not a decomposable direct light source, but treats the surrounding environment as a large light source.

[0115] Image-based lighting is an irreplaceable tool in production rendering. Generally, an environment map is used as one of the light sources to illuminate the scene. This light source can be called ambient light. For indoor scenes, image lighting is usually the main source of noise due to occlusion problems, especially in scenes with small windows (windows can refer to openings such as windows and doors where ambient light enters the image scene) or many objects. In order to better reduce the noise caused by image lighting, the relevant technology uses different methods to process it, which are explained below.

[0116] Related technology 1:

[0117] The method of manually marking the portal (also called window in this article) P (such as Figure 1 As shown in FIG. 1 , this method mainly improves rendering effect and rendering efficiency by guiding the light direction S for sampling the environment map. However, this method requires artificial preprocessing of the image (i.e., marking the window P), which increases a certain rendering cost.

[0118] For example, for Figure 2 The ambient light sampling of the indoor scene shown, Figure 2 The figure shows the sampling results of four different sampling methods and the rendering results of the rendering. Among them, env refers to the Environment sampling method without guidance information, and its sampling result is 0.592. S.Angle refers to the sampling method based on solid angle, and its sampling result is 0.7358. MIS refers to Multiple Importance Sampling (MIS for short), and its sampling result is 0.6075. Ours is a sampling method based on manually marked portals, and its sampling result is 0.3391, and Ref is the true value (reference). Then combined Figure 2 It can be seen that the portal-based environment map sampling algorithm improves the sampling efficiency of ambient light and improves the final rendering results of indoor scenes (such as Figure 2 The main idea of ​​this scheme is to use the manually marked portal position P information to guide the ambient light sampling direction.

[0119] However, there are the following problems: the first related art requires manual marking of the position of each window, and the marking position may deviate for different markers. At the same time, the shape of the marked window may also increase the difficulty of manual marking. The labeling result of each window directly affects the training and application of the model, and inaccurate marking will directly affect the rendering effect.

[0120] Related technology 2:

[0121] For the ambient light sampling of indoor scenes, the algorithm used in the related technology 2 is an adaptive ambient light sampling algorithm. The principle is to split the environment map (such as Figure 3A The environment map is split into multiple grid cells as shown) and the camera field of view (as shown Figure 3B As shown, Figure 3B The grid unit is not shown in the figure, only a camera position is given schematically), so that the corresponding area of ​​each camera saves the environment map sub-block with the highest lighting contribution, and samples it through probability distribution during rendering.

[0122] The program is mainly divided into two stages: the learning stage (e.g. Figure 4A ) and the rendering phase (as shown Figure 4B ). Among them, Figure 4A The learning phase shown mainly calculates the contribution of each environment map sub-block to each view cell, mainly by projecting the vertex back to the camera center to determine its corresponding grid cell. The environment map map is importance sampled and the contribution of the samples is determined, which are accumulated in the corresponding grid cells. For example, for a scene point x belonging to a certain grid cell (light grid cell), the corresponding light direction c[x] needs to be calculated. Figure 4B In the rendering stage shown, for each rendering point in the scene, the corresponding grid cell is found by back-projecting to the camera center. Then a sample is sampled using the pre-computed probability distribution, and finally a sampling point is selected from the sample for sampling. For example, for rendering point x, the light direction c[x] and / or c[y] can be selected for sampling.

[0123] However, the second related technology has the following disadvantages: the weights learned by the solution for cameras at different positions are different, and are only valid at fixed positions. Since changing the perspective requires relearning, it is not suitable for real-time rendering, where the perspective and position change rapidly.

[0124] Therefore, there are two main problems that need to be solved for the indoor scene ambient light sampling algorithm in the real-time rendering engine. The first is how to design a sampling algorithm that is independent of the camera position, and the second is how to record the effective sampling direction range corresponding to each position.

[0125] In order to solve the above technical problems, the present application provides a rendering method and device, and provides an adaptive ambient light sampling algorithm that is independent of the camera position, which can record the effective sampling direction range corresponding to each position, can adapt to the rendering requirements of different perspectives, greatly saves computing power, and improves the rendering quality and the convergence speed of the rendering engine.

[0126] The rendering method provided in the present application includes a pre-calculation stage and a rendering stage. The pre-calculation stage is performed before the rendering stage. The pre-calculation stage and the rendering stage are described below. The method provided in the present application can be applied to electronic devices, cloud servers, etc.

[0127] like Figure 5 , Figure 6 As shown, the pre-calculation stage includes: step S101-step S104. By pre-determining the window information of each first detection point of the environment map, the subsequent rendering process can be unaffected by the camera position and adapt to the rendering requirements of any viewing angle.

[0128] like Figure 5 As shown, in step S101, a plurality of first detection points corresponding to the environment map are determined.

[0129] In this embodiment, the method for determining the first detection point in the environment map can be set according to actual needs, and this application does not limit this. In some embodiments, the method for determining multiple first detection points may include: first determining the bounding box of the environment map, and then splitting the bounding box of the environment map into the following parts according to a preset size: Figure 6 The M×N×Q cube detection blocks shown in FIG. 1 are then used to determine the vertex of each detection block as the first detection point. Among them, adjacent detection blocks share the first detection point on the same surface (such as Figure 6 The common detection points shown in the figure). In some embodiments, the bounding box of the environment map can be evenly divided into detection blocks, that is, the bounding box of the environment map can be divided into multiple detection blocks of the same size and shape. The bounding box of the environment map can also be divided into detection blocks of different sizes and shapes according to actual needs, and the present application does not limit this. The shape of the detection block can be a cube, a rectangular parallelepiped, etc., and the present application does not limit this. In some embodiments, the values ​​of M, N, and Q can be the same or different, and can be set according to actual needs, and the present application does not limit this.

[0130] In some embodiments, in step S101, in the process of determining the bounding box of the environment map, the size of the environment map may be expanded, and then the bounding box may be determined based on the expanded environment map. In some embodiments, the bounding box may be divided into a plurality of detection blocks of a preset size, and the range surrounded by the plurality of detection blocks may be expanded so that the bounding box is within the range surrounded by the plurality of detection blocks. In this way, it is ensured that the triangular facets used in the rendering stage can be surrounded by the divided detection blocks.

[0131] like Figure 5 As shown, in step S102, a plurality of detection lights are emitted outwards with each first detection point as the center, wherein the plurality of detection lights emitted from each first detection point are distributed in a spherical shape.

[0132] In this embodiment, the number and direction information of the detection light rays emitted outward from each first detection point as the center can be set according to actual needs, wherein the direction information of the detection light rays can be represented by the longitude and latitude of the detection light rays in the spherical coordinate system, the position coordinates of other points on the detection light rays except the first detection point in the three-dimensional space, etc., and this application does not limit this. Figure 6 As shown, for the first detection point D among the multiple first detection points, the direction information of a detection light emitted by the first detection point D can be expressed as (THETA, PHI), where THETA is latitude and PHI is longitude. If a detection light is emitted at intervals of "1" longitude or latitude change, the number of detection lights emitted by the first detection point D is WINDOW_THETA*WINDOW_PHI, where WINDOW_THETA represents the latitude range and WINDOW_PHI represents the longitude range.

[0133] like Figure 5 As shown, in step S103, each detection light is monitored to determine whether each detection light emitted from each first detection point hits the light direction of the environment map, and the detection light that hits the light direction of the environment map in the detection light is determined as the target detection light. In this embodiment, the direction information corresponding to the target detection light can be marked, and then the light direction of the environment map can be determined by the target detection light of each first detection point.

[0134] like Figure 5 As shown, in step S104, the direction information of the target detection light corresponding to each of the first detection points is used as the window information of the corresponding first detection point.

[0135] In some embodiments, steps S101 to S104 may be executed on a graphics processing unit (GPU). After calculating the window information of each first detection point, the GPU may send the window information of each first detection point to a central processing unit (CPU) or the like for storage.

[0136] In one possible implementation, Figure 5 As shown, the method may further include step S105. In step S105, a cumulative distribution function (CDF) is calculated according to the window information of each of the first detection points to obtain a cumulative distribution function table of each of the first detection points, so as to be used in the subsequent rendering stage.

[0137] In a possible implementation manner, the method may further include: after determining the window information of the first detection point, converting the window information into a two-dimensional matrix to facilitate subsequent storage of the window information of the first detection point.

[0138] like Fig. 7A As shown, the rendering stage may include: steps S201 to S205.

[0139] like Fig. 7A As shown, in step S201, it is determined that a point to be rendered is required. The point to be rendered may be any point to be rendered in the target scene image to be loaded. The point to be rendered may also be referred to as a shading point to be shaded.

[0140] In some embodiments, Fig. 9 As shown, step S201 may include step S501 and step S502. First, the direction of the emitted light is determined according to the sampling direction and the position of the camera, and then the light for sampling is generated (such as S501). In this way, then, in step S502, the point to be rendered hit in the scene map after the light is emitted is determined, and the G-Buffer (Geometry Buffer) of the point to be rendered is obtained. G-Buffer may include a buffer of color, normal, and world space coordinates, that is, it may refer to a texture including color, normal, and world space coordinates.

[0141] like Fig. 7A As shown, in step S202, a second detection point corresponding to the point to be rendered is determined from a plurality of first detection points of the environment map.

[0142] In one possible implementation, Figure 8As shown, the implementation of step S202 may include: according to the triangular face of the point to be rendered, determining from the multiple first detection points a candidate detection point whose position matches the triangular face; and selecting a second detection point from the candidate detection points. In a possible implementation, step S202 may also include: determining as candidate detection points a plurality of first detection points on the detection block where the triangular face of the mutated point to be rendered is located; wherein the mutated point to be rendered is determined after mutating the position of the point to be rendered using a random number.

[0143] In some embodiments, Figure 8 As shown, the triangle of the point to be rendered is in a detection block, which includes 8 vertices. According to the direction of the triangle, it can be determined that the 8 vertices in the positive direction of the triangle can be used for subsequent rendering, so the 6 first detection points in the 8 vertices in the positive direction of the triangle are determined as alternative detection points.

[0144] In some embodiments, the variation processing of the point to be rendered may include: first generating two random numbers for variation of the hit position coordinate value, the point to be rendered will move slightly upward after being concentrated by the two random numbers, and more first detection points can be selected as candidate detection points by using the mutated point to be rendered. The purpose of the variation processing is to prevent the occurrence of a problem in which the sampling results of the detection block edge have a large difference.

[0145] In some embodiments, after the candidate detection points are determined, the second detection point can be selected from the candidate detection points by random or other methods.

[0146] like Fig. 7A As shown, in step S203, the sampling direction corresponding to the point to be rendered is determined according to the window information of the second detection point. The window information of the second detection point is used to record the target detection light of the direction of the light emitted by the second detection point that can hit the environment map.

[0147] In one possible implementation method, step S203 may be implemented by: generating a sampling direction corresponding to the point to be rendered based on the generated random number and the cumulative distribution function table of the second detection point; or, performing a cumulative distribution function calculation based on the window information of the second detection point to obtain a cumulative distribution function table, and generating a sampling direction corresponding to the point to be rendered based on the generated random number and the cumulative distribution function table of the second detection point.

[0148] In this implementation, after the cumulative distribution function table of the second detection point is determined, the position of a generated random number in the environment map can be determined, and then the sampling direction can be generated.

[0149] like Fig. 7AAs shown, in step S204, the environment map is sampled according to the sampling direction to obtain sampling information. Since the currently generated sampling direction starts from the point to be rendered, and there is a position deviation between the point to be rendered and the second detection point, in order to obtain a more accurate sampling direction, the vector needs to be transformed (extended and translated) before sampling, and the transformation parameters depend on the position of the second detection point.

[0150] like Fig. 7A As shown, in step S205, the point to be rendered is rendered according to the sampling information.

[0151] In this embodiment, if Fig. 9 As shown, step S205 may include: step S503, step S504 and step S505. In step S503, the material information of the point to be rendered is determined based on the position information in the Gbuffer of the point to be rendered obtained in step S520. Since the light emitted by step S501 will be continuously ejected, the calculation amount of the entire rendering process is very large, and as the light is ejected and transmitted in the scene, the energy of the light will gradually decrease, so the point hit by the relatively late ejection is actually worthless due to the low energy, so in fact, the relatively late ejection of the light is not necessary to continue, so roulette (S504) is used to terminate. In step S504, a random number is generated and compared with the equivalent energy of the current light. If the equivalent energy of the current light is less than or equal to the random number, the ejection of the light is stopped, and the process returns to step S501 to continue to generate new light and execute subsequent steps; if the equivalent energy of the current light is greater than the random number, the ejection of the light continues and the data is accumulated. In step S505, data accumulation of the point to be rendered is completed based on the sampling information, material information, etc. corresponding to the point to be rendered obtained in step S204, and then the point to be rendered is rendered according to the accumulated data.

[0152] In a possible implementation, the method may further include: using the identification information of the target scene image to mark the detection information of the target scene image and then storing it in a detection file, the identification information includes the version number of the target scene image, and the detection information includes the sampling direction of each rendering point of the target scene image and the window information of each first detection point. In this way, after each rendering is completed, the detection information is stored in the detection file. When the same scene image is loaded next time, if the identification information (version number) of the scene image is equal to the version number of the detection information saved in the current detection file, it means that the last calculation result can be reused, and the ambient light adaptive sampling is directly performed without the need to perform the pre-calculation stage again. By reusing the detection information, the loading time is reduced, which not only speeds up the rendering, but also reduces the noise caused by the random sampling of the ambient light, thereby improving the rendering quality.

[0153] In one possible implementation, Figure 7B As shown, before step S202, the method may further include: step S206. In step S206, first determine whether the stored detection file includes detection information corresponding to the target scene image. If it is determined that the detection information corresponding to the point to be rendered is stored in the detection file, the sampling direction in the stored detection information is determined as the sampling direction corresponding to the point to be rendered, and then step S204 and subsequent steps are executed. If it is determined that the detection information corresponding to the point to be rendered is not stored in the detection file, first execute the steps of the pre-calculation stage and then execute step S202 (the steps of the pre-calculation stage are not shown in the figure). That is, Fig.10 As shown, after determining the point to be rendered, first execute step S206. If it is determined that the detection information corresponding to the point to be rendered is stored in the detection file, directly use the stored detection to enter the rendering stage; if it is determined that the detection information corresponding to the point to be rendered is not stored in the detection file, first execute the steps of the pre-calculation stage and then execute the remaining steps of the rendering stage.

[0154] To further illustrate the rendering method provided by this application, some examples are listed below for illustration.

[0155] Application scenario example 1:

[0156] In the field of interior decoration, after designing the scene, the home decoration designer packages all the scene-related files, which include information such as objects, lights and materials. The real-time rendering engine loads this information when in use and presents it on the screen. Unlike conventional offline rendering engines, the real-time rendering engine allows the camera to be moved arbitrarily in the scene, and the engine performs real-time rendering according to the camera position. Since most indoor scenes have openings such as windows connected to the outside, previous engines need to perform more cumulative renderings to properly sample the outside environment map. The rendering method based on the present application can quickly converge in a shorter time to obtain a higher quality rendering effect map. In addition, even if the objects in the scene are changed during rendering, it will not affect the segmentation of the scene. The next load can reuse the previous detection information. This operation can reduce the number of repeated operations and greatly save computing power.

[0157] Application scenario example 2:

[0158] In the field of digitalization, especially in 3D scenes, such as factories, outdoor buildings, electronic games and other scenes, it is very competitive to obtain high-quality interactive effects under free perspective. With the rapid development of technologies such as AR, 3D real-time rendering is an indispensable part. Users can move the camera and motion trajectory through the interactive interface. The rate of interaction and the rendering result directly affect the user experience. Most of the real-time interactive 3D digital scene renderings in related technologies are achieved through rasterization. Although rasterization has a faster rendering speed, its rendering results are rougher than ray tracing. In a real-time ray tracing engine, the number and direction of light ricochets have a key impact on the final rendering result. Unlike common ray tracing engines, the rendering method based on the present application can adaptively guide the sampling direction of ambient light in a directionally guided manner, so that most of the sampled light is effective light, thereby improving the rendering result and speed.

[0159] Therefore, compared with the sampling algorithm based on manual marking, the adaptive ambient light sampling algorithm has a wider range of applications.

[0160] like Fig.11 As shown, an embodiment of the present application provides a rendering device, the device comprising:

[0161] A point acquisition module 61 is used to acquire a point to be rendered, where the point to be rendered is any point to be rendered in a target scene image to be loaded;

[0162] A detection point determination module 62, configured to determine a second detection point corresponding to the point to be rendered from a plurality of first detection points of the environment map;

[0163] A first direction determining module 63, configured to determine a sampling direction corresponding to the point to be rendered according to the window information of the second detection point;

[0164] A sampling information determination module 64, configured to sample the environment map according to the sampling direction to obtain sampling information;

[0165] A rendering module 65, configured to render the point to be rendered according to the sampling information;

[0166] The window information of the second detection point is used to record the target detection light emitted by the second detection point in the direction of the light that can hit the environment map.

[0167] In a possible implementation manner, the device further includes:

[0168] A detection point marking module, used to determine a plurality of first detection points corresponding to the environment map;

[0169] A light emitting module, used for emitting a plurality of detection lights outwardly with each of the first detection points as the center, wherein the plurality of detection lights emitted from each of the first detection points are distributed in a spherical shape;

[0170] A light determination module, used to determine a target detection light in a direction of a light hitting the environment map among a plurality of detection lights of each of the first detection points;

[0171] The window information determination module is used to determine the window information of the corresponding first detection point according to the target detection light corresponding to each of the first detection points.

[0172] In a possible implementation manner, the device further includes:

[0173] A calculation module is used to calculate the cumulative distribution function according to the window information of each of the first detection points to obtain a cumulative distribution function table of each of the first detection points.

[0174] In a possible implementation, determining a plurality of first detection points corresponding to the environment map includes:

[0175] Determining a bounding box of the environment map;

[0176] Dividing the bounding box into a plurality of detection blocks having a preset size;

[0177] The vertices of the detection blocks are determined as the first detection points.

[0178] In a possible implementation, determining a plurality of first detection points corresponding to the environment map further includes: after determining the bounding box of the environment map, expanding the size of the bounding box of the environment map; or

[0179] Dividing the bounding box into a plurality of detection blocks with preset sizes includes: dividing the bounding box into a plurality of detection blocks with preset sizes, and expanding the range surrounded by the plurality of detection blocks so that the bounding box is within the range surrounded by the plurality of detection blocks.

[0180] In a possible implementation, determining a second detection point corresponding to the point to be rendered from a plurality of first detection points of the environment map includes:

[0181] According to the triangular face of the point to be rendered, determining, from the plurality of first detection points, a candidate detection point whose position matches the triangular face;

[0182] A second detection point is selected from the candidate detection points.

[0183] In a possible implementation, determining, according to the triangular facet of the point to be rendered, a candidate detection point whose position matches the triangular facet from the plurality of first detection points includes:

[0184] A plurality of first detection points on the detection block where the triangular facet of the point to be rendered is located are determined as candidate detection points.

[0185] In a possible implementation, according to the triangular facet of the point to be rendered, determining, from the plurality of first detection points, a candidate detection point whose position matches the triangular facet, further includes:

[0186] Determine a plurality of first detection points on the detection block where the mutated triangular facet of the point to be rendered is located as candidate detection points;

[0187] The mutated point to be rendered is determined by mutating the position of the point to be rendered using a random number.

[0188] In a possible implementation manner, determining the sampling direction corresponding to the point to be rendered according to the window information of the second detection point includes:

[0189] Generate a sampling direction corresponding to the point to be rendered according to the generated random number and the cumulative distribution function table of the second detection point; or

[0190] A cumulative distribution function is calculated according to the window information of the second detection point to obtain a cumulative distribution function table, and a sampling direction corresponding to the point to be rendered is generated according to the generated random number and the cumulative distribution function table of the second detection point.

[0191] In a possible implementation manner, the device further includes:

[0192] An information marking module is used to mark the detection information of the target scene image using the identification information of the target scene image and store it in a detection file, wherein the identification information includes the version number of the target scene image, and the detection information includes the sampling direction of each rendering point of the target scene image and the window information of each first detection point.

[0193] In a possible implementation manner, the device further includes:

[0194] The second direction determination module is used to determine the sampling direction in the stored detection information as the sampling direction corresponding to the point to be rendered when it is determined that the detection information corresponding to the point to be rendered is stored in the detection file according to the identification information of the target scene image.

[0195] The implementation methods and beneficial effects of each module and sub-module of the rendering device of the present application can refer to the relevant description of the corresponding steps in the above-mentioned rendering method, which will not be repeated here to avoid redundancy.

[0196] The rendering method and device provided in this application can be used by Fig.12 The electronic device 100 shown is executed. The electronic device 100 may include at least one of a mobile phone, a foldable electronic device, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, an in-vehicle device, a smart home device, or a smart city device. The embodiment of the present application does not impose any special restrictions on the specific type of the electronic device 100.

[0197] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) connector 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0198] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0199] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0200] The processor can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions. In some embodiments, the processor 110 can be used to execute the above rendering method.

[0201] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 may be a cache memory. The memory may store instructions or data that have been used or are frequently used by the processor 110. If the processor 110 needs to use the instruction or data, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0202] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc. The processor 110 may be connected to a touch sensor, an audio module, a wireless communication module, a display, a camera, and other modules through at least one of the above interfaces.

[0203] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0204] The electronic device 100 can realize the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.

[0205] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or more display screens 194. For example, the display screen 194 can display a rendered image for the user, wherein the rendered image can be an image obtained by rendering multiple points to be rendered according to the rendering method provided in the present application.

[0206] The electronic device 100 can realize the camera function through the camera module 193, ISP, video codec, GPU, display screen 194, application processor AP, neural network processor NPU, etc.

[0207] The camera module 193 can be used to collect color image data and depth data of the photographed object. The ISP can be used to process the color image data collected by the camera module 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera module 193.

[0208] In some embodiments, the camera module 193 may be composed of a color camera module and a 3D sensing module.

[0209] In some embodiments, the photosensitive element of the camera of the color camera module can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format.

[0210] In some embodiments, the 3D sensing module may be a time of flight (TOF) 3D sensing module or a structured light 3D sensing module. Among them, structured light 3D sensing is an active depth sensing technology, and the basic components of the structured light 3D sensing module may include an infrared emitter, an IR camera module, etc. The working principle of the structured light 3D sensing module is to first emit a light spot of a specific pattern to the object being photographed, and then receive the light spot pattern coding (light coding) on ​​the surface of the object, and then compare the similarities and differences with the original projected light spot, and use the triangulation principle to calculate the three-dimensional coordinates of the object. The three-dimensional coordinates include the distance between the electronic device 100 and the object being photographed. Among them, TOF 3D sensing may be an active depth sensing technology, and the basic components of the TOF 3D sensing module may include an infrared emitter, an IR camera module, etc. The working principle of the TOF 3D sensing module is to calculate the distance (i.e., depth) between the TOF 3D sensing module and the object being photographed by the time when the infrared rays return to obtain a 3D depth map.

[0211] The structured light 3D sensing module can also be applied to face recognition, somatosensory game consoles, industrial machine vision inspection and other fields. The TOF 3D sensing module can also be applied to game consoles, augmented reality (AR) / virtual reality (VR) and other fields.

[0212] In other embodiments, the camera module 193 may also be composed of two or more cameras. The two or more cameras may include a color camera, which can be used to collect color image data of the photographed object. The two or more cameras may use stereo vision technology to collect depth data of the photographed object. Stereo vision technology is based on the principle of human eye parallax. Under natural light, two or more cameras are used to capture images of the same object from different angles, and then triangulation and other operations are performed to obtain the distance information between the electronic device 100 and the photographed object, that is, depth information.

[0213] In some embodiments, the electronic device 100 may include one or more camera modules 193. Specifically, the electronic device 100 may include one front camera module 193 and one rear camera module 193. The front camera module 193 may generally be used to collect color image data and depth data of the photographer facing the display screen 194, and the rear camera module may be used to collect color image data and depth data of the subject (such as a person, scenery, etc.) facing the photographer.

[0214] An embodiment of the present application provides a rendering device, comprising: a processor and a memory for storing processor-executable instructions; wherein the processor is configured to implement the above method when executing the instructions.

[0215] An embodiment of the present application provides a non-volatile computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the above method is implemented.

[0216] An embodiment of the present application provides a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.

[0217] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disc (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing.

[0218] The computer-readable program instructions or codes described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0219] The computer program instructions for performing the operation of the present application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, by utilizing the state information of computer-readable program instructions to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA) or a programmable logic array (PLA), the electronic circuit can execute the computer-readable program instructions to implement various aspects of the present application.

[0220] Various aspects of the present application are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0221] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0222] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0223] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the device, system, method and computer program product according to multiple embodiments of the present application. In this regard, each square frame in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some alternative implementations, the functions marked in the square frame can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square frames can actually be executed substantially in parallel, and they can also be executed in reverse order sometimes, depending on the functions involved.

[0224] It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented by hardware (such as a circuit or ASIC (Application Specific Integrated Circuit)) that performs the corresponding function or action, or can be implemented by a combination of hardware and software, such as firmware.

[0225] Although the present invention is described herein in conjunction with various embodiments, in the process of implementing the claimed invention, those skilled in the art may understand and implement other variations of the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0226] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A rendering method, characterized in that: The method comprises: Obtain a point to be rendered, where the point to be rendered is any point to be rendered in the target scene image to be loaded; Determining a second detection point corresponding to the point to be rendered from a plurality of first detection points of the environment map; Determining a sampling direction corresponding to the point to be rendered according to the window information of the second detection point; Sampling the environment map according to the sampling direction to obtain sampling information; The point to be rendered is rendered according to the sampling information.

2. The method according to claim 1, characterized in that: The window information of the second detection point is used to record the direction information of the target detection light emitted by the second detection point that can hit the environment map.

3. The method according to claim 1, characterized in that The method further comprises: Determine a plurality of first detection points corresponding to the environment map; emitting a plurality of detection lights outwardly with each of the first detection points as the center, wherein the plurality of detection lights emitted from each of the first detection points are distributed in a spherical shape; Determine a target detection light in a direction of a light hitting the environment map among a plurality of detection lights at each of the first detection points; According to the target detection light corresponding to each of the first detection points, window information of the corresponding first detection point is determined.

4. The method according to claim 3, characterized in that The method further comprises: A cumulative distribution function is calculated according to the window information of each of the first detection points to obtain a cumulative distribution function table of each of the first detection points.

5. The method according to claim 3, characterized in that: Determining a plurality of first detection points corresponding to the environment map includes: Determining a bounding box of the environment map; Dividing the bounding box into a plurality of detection blocks having a preset size; The vertices of the detection blocks are determined as the first detection points.

6. The method according to claim 5, characterized in that Determining a plurality of first detection points corresponding to the environment map further includes: after determining the bounding box of the environment map, expanding the size of the bounding box of the environment map; or Dividing the bounding box into a plurality of detection blocks with preset sizes includes: dividing the bounding box into a plurality of detection blocks with preset sizes, and expanding the range surrounded by the plurality of detection blocks so that the bounding box is within the range surrounded by the plurality of detection blocks.

7. The method according to any one of claims 1 to 6, characterized in that: Determining a second detection point corresponding to the point to be rendered from a plurality of first detection points of the environment map includes: According to the triangular face of the point to be rendered, determining, from the plurality of first detection points, a candidate detection point whose position matches the triangular face; A second detection point is selected from the candidate detection points.

8. The method according to claim 7, characterized in that According to the triangular face of the point to be rendered, determining, from the plurality of first detection points, a candidate detection point whose position matches the triangular face, comprises: A plurality of first detection points on the detection block where the triangular facet of the point to be rendered is located are determined as candidate detection points.

9. The method according to claim 8, characterized in that According to the triangular face of the point to be rendered, determining a candidate detection point whose position matches the triangular face from the plurality of first detection points, further comprising: Determine a plurality of first detection points on the detection block where the mutated triangular facet of the point to be rendered is located as candidate detection points; The mutated point to be rendered is determined by mutating the position of the point to be rendered using a random number.

10. The method according to claim 8, characterized in that Determining a sampling direction corresponding to the point to be rendered according to the window information of the second detection point includes: Generate a sampling direction corresponding to the point to be rendered according to the generated random number and the cumulative distribution function table of the second detection point; or A cumulative distribution function is calculated according to the window information of the second detection point to obtain a cumulative distribution function table, and a sampling direction corresponding to the point to be rendered is generated according to the generated random number and the cumulative distribution function table of the second detection point.

11. The method according to claim 1, characterized in that: The method further comprises: The detection information of the target scene image is marked using the identification information of the target scene image and then stored in a detection file, wherein the identification information includes a version number of the target scene image, and the detection information includes a sampling direction of each rendering point of the target scene image and window information of each first detection point.

12. The method according to claim 11, characterized in that The method further comprises: When it is determined, based on the identification information of the target scene image, that detection information corresponding to the point to be rendered is stored in the detection file, the sampling direction in the stored detection information is determined as the sampling direction corresponding to the point to be rendered.

13. A rendering device, characterized in that: The device comprises: A point acquisition module is used to acquire a point to be rendered, where the point to be rendered is any point to be rendered in a target scene image to be loaded; A detection point determination module, used to determine a second detection point corresponding to the point to be rendered from a plurality of first detection points of the environment map; A first direction determination module, used to determine the sampling direction corresponding to the point to be rendered according to the window information of the second detection point; A sampling information determination module, used for sampling the environment map according to the sampling direction to obtain sampling information; A rendering module is used to render the point to be rendered according to the sampling information.

14. The device according to claim 13, characterized in that in, The window information of the second detection point is used to record the direction information of the target detection light emitted by the second detection point that can hit the environment map.

15. The device according to claim 13, characterized in that The device also includes: A detection point marking module, used to determine a plurality of first detection points corresponding to the environment map; A light emitting module, used for emitting a plurality of detection lights outwardly with each of the first detection points as the center, wherein the plurality of detection lights emitted from each of the first detection points are distributed in a spherical shape; A light determination module, used to determine a target detection light in a direction of a light hitting the environment map among a plurality of detection lights of each of the first detection points; The window information determination module is used to determine the window information of the corresponding first detection point according to the target detection light corresponding to each of the first detection points.

16. The device according to claim 15, characterized in that The device also includes: A calculation module is used to calculate the cumulative distribution function according to the window information of each of the first detection points to obtain a cumulative distribution function table of each of the first detection points.

17. The device according to claim 15, characterized in that Determining a plurality of first detection points corresponding to the environment map includes: Determining a bounding box of the environment map; Dividing the bounding box into a plurality of detection blocks having a preset size; The vertices of the detection blocks are determined as the first detection points.

18. The device according to claim 17, characterized in that Determining a plurality of first detection points corresponding to the environment map further includes: after determining the bounding box of the environment map, expanding the size of the bounding box of the environment map; or Dividing the bounding box into a plurality of detection blocks with preset sizes includes: dividing the bounding box into a plurality of detection blocks with preset sizes, and expanding the range surrounded by the plurality of detection blocks so that the bounding box is within the range surrounded by the plurality of detection blocks.

19. The device according to any one of claims 13 to 18, characterized in that: Determining a second detection point corresponding to the point to be rendered from a plurality of first detection points of the environment map includes: According to the triangular face of the point to be rendered, determining, from the plurality of first detection points, a candidate detection point whose position matches the triangular face; A second detection point is selected from the candidate detection points.

20. The device according to claim 19, characterized in that According to the triangular face of the point to be rendered, determining, from the plurality of first detection points, a candidate detection point whose position matches the triangular face, comprises: A plurality of first detection points on the detection block where the triangular facet of the point to be rendered is located are determined as candidate detection points.

21. The device according to claim 20, characterized in that According to the triangular face of the point to be rendered, determining a candidate detection point whose position matches the triangular face from the plurality of first detection points, further comprising: Determine a plurality of first detection points on the detection block where the mutated triangular facet of the point to be rendered is located as candidate detection points; The mutated point to be rendered is determined by mutating the position of the point to be rendered using a random number.

22. The device according to claim 20, characterized in that Determining a sampling direction corresponding to the point to be rendered according to the window information of the second detection point includes: Generate a sampling direction corresponding to the point to be rendered according to the generated random number and the cumulative distribution function table of the second detection point; or A cumulative distribution function is calculated according to the window information of the second detection point to obtain a cumulative distribution function table, and a sampling direction corresponding to the point to be rendered is generated according to the generated random number and the cumulative distribution function table of the second detection point.

23. The device according to claim 13, characterized in that The device also includes: An information marking module is used to mark the detection information of the target scene image using the identification information of the target scene image and store it in a detection file, wherein the identification information includes the version number of the target scene image, and the detection information includes the sampling direction of each rendering point of the target scene image and the window information of each first detection point.

24. The device according to claim 23, characterized in that The device also includes: The second direction determination module is used to determine the sampling direction in the stored detection information as the sampling direction corresponding to the point to be rendered when it is determined that the detection information corresponding to the point to be rendered is stored in the detection file according to the identification information of the target scene image.

25. A rendering device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to implement the method of any one of claims 1-12 when executing the instructions.

26. A non-volatile computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 12 is implemented.

27. A computer program product comprising computer readable code, or a non-volatile computer readable storage medium carrying computer readable code, characterized in that: When the computer readable code is executed in an electronic device, a processor in the electronic device executes the method according to any one of claims 1 to 12.