Rendering method and apparatus

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 noise problem and low rendering efficiency of image-based lighting in the existing technology in indoor scenes, and achieves high efficiency and accuracy. Real-time rendering and adaptability to different viewing angles.

WO2024179201A1PCT designated stage expired Publication Date: 2024-09-06HUAWEI TECH CO LTD

Patent Information

Application Number
PCT/CN2024/072352
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-02
Filing Date
2024-01-15
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

In the existing technology, image-based lighting in indoor scenes results in large noise, poor accuracy, low real-time rendering efficiency due to occlusion problems, and is difficult to 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 greatly saves computing power, improves rendering quality and the convergence speed of the rendering engine, and enables efficient and accurate real-time rendering under different viewing angles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024072352_06092024_PF_FP
    Figure CN2024072352_06092024_PF_FP
Patent Text Reader

Abstract

The present application relates to a rendering method and apparatus. The method comprises: acquiring a point to be rendered, the point to be rendered being any one point requiring rendering in a target scene picture requiring loading; determining, from among a plurality of first sounding points of an environment map, a second sounding point corresponding to the point to be rendered; according to window information of the second sounding point, determining a sampling direction corresponding to the point to be rendered; sampling the environment map according to the sampling direction to obtain sampling information; and according to the sampling information, rendering the point to be rendered. An adaptive ambient light sampling algorithm unrelated to the position of a camera is provided, so that an effective sampling direction range corresponding to each position can be recorded, which greatly improves rendering quality and the convergence speed of a rendering engine while reducing computing power.
Need to check novelty before this filing date? Find Prior Art

Description

Rendering method and device

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on March 2, 2023, with application number 202310237545.3 and invention name “Rendering Method and Device”, the entire contents of which are incorporated by reference into this application. Technical Field

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

[0003] Image-based lighting (IBL) is an indispensable tool in production rendering. It typically uses an environment map as one of the light sources to illuminate the scene, referred to as ambient light. For indoor scenes, image lighting is often the primary source of noise due to occlusion, especially in scenes with small windows or numerous objects. To better reduce the noise introduced by image lighting, existing solutions have suffered from poor accuracy, low real-time rendering efficiency, and difficulty adapting to rendering requirements from different perspectives.

[0004] Summary of the Invention

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

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

[0007] 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;

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

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

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

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

[0012] Through the first aspect, an adaptive ambient light sampling algorithm is provided that is independent of the camera position. It 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.

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

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

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

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

[0017] Determining a target detection light having a direction of hitting the environment map among a plurality of detection rays at each of the first detection points;

[0018] Window information of the corresponding first detection point is determined according to the target detection light corresponding to each first detection point.

[0019] 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 adapt to rendering requirements of any viewing angle.

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

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

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

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

[0024] Dividing the bounding box into a plurality of detection blocks with preset sizes;

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

[0026] 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.

[0027] 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

[0028] Dividing the bounding box into a plurality of detection blocks with a preset size includes: dividing the bounding box into a plurality of detection blocks with a preset size, 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.

[0029] In this way, it can be ensured that the triangles used in the rendering stage can be surrounded by the cut detection blocks.

[0030] 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:

[0031] 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;

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

[0033] In a possible implementation, determining, based on 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:

[0034] 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.

[0035] In a possible implementation, determining, based on 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 further includes:

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

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

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

[0039] generating 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

[0040] A cumulative distribution function is calculated based on 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 based on the generated random number and the cumulative distribution function table of the second detection point.

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

[0042] 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.

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

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

[0045] If, based on the identification information of the target scene image, it is determined 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. In this way, the existing detection information can be directly utilized, further improving rendering efficiency.

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

[0047] 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 the target scene image to be loaded;

[0048] A detection point determination module, 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;

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

[0050] a sampling information determination module, configured to sample the environment map according to the sampling direction to obtain sampling information;

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

[0052] 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.

[0053] In a possible implementation, the apparatus further includes:

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

[0055] a light emitting module configured to emit a plurality of detection lights outwardly with each of the first detection points as a center, wherein the plurality of detection lights emitted from each of the first detection points are distributed in a spherical shape;

[0056] A light determination module, configured to determine a target detection light whose direction hits the environment map among the multiple detection lights of each of the first detection points;

[0057] The window information determining module is configured 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.

[0058] In a possible implementation, the apparatus further includes:

[0059] The calculation module is configured to calculate a 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.

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

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

[0062] Dividing the bounding box into a plurality of detection blocks with preset sizes;

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

[0064] 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

[0065] Dividing the bounding box into a plurality of detection blocks with a preset size includes: dividing the bounding box into a plurality of detection blocks with a preset size, 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.

[0066] 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:

[0067] 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;

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

[0069] In a possible implementation, determining, based on 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:

[0070] 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.

[0071] In a possible implementation, determining, based on 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 further includes:

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

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

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

[0075] generating 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

[0076] A cumulative distribution function is calculated based on 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 based on the generated random number and the cumulative distribution function table of the second detection point.

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

[0078] 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.

[0079] In a possible implementation, the apparatus further includes:

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

[0081] 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 to avoid redundancy.

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

[0083] processor;

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

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

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

[0087] 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, the processor in the electronic device executes the rendering method of the first aspect or one or more of the multiple possible implementations of the first aspect.

[0088] 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 the rendering method of the above-mentioned first aspect or one or more of the multiple possible implementation methods of the first aspect.

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

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

[0091] FIG1 is a schematic diagram showing the working process of the related art 1.

[0092] FIG2 is a schematic diagram showing sampling results of some related technologies.

[0093] FIG3A shows a schematic diagram of splitting an environment map in the second related art.

[0094] FIG3B is a schematic diagram showing the splitting of the camera field of view in the second related art.

[0095] 4A and 4B are schematic diagrams showing the learning phase and the rendering phase in the second related art.

[0096] FIG5 is a schematic diagram showing a flow chart of a pre-calculation stage in a rendering method according to an embodiment of the present application.

[0097] FIG6 is a schematic diagram showing a first detection point in a rendering method according to an embodiment of the present application.

[0098] 7A and 7B are schematic flowcharts illustrating a rendering phase in a rendering method according to an embodiment of the present application.

[0099] FIG8 is a schematic diagram showing determination of candidate detection points in the rendering phase of a rendering method according to an embodiment of the present application.

[0100] FIG9 is a schematic flow chart showing step S205 of the rendering phase in the rendering method according to an embodiment of the present application.

[0101] FIG10 is a schematic flow chart showing a rendering method according to an embodiment of the present application.

[0102] FIG11 shows a structural block diagram of a rendering device according to an embodiment of the present application.

[0103] FIG12 shows a schematic structural diagram of an electronic device 100 according to an embodiment of the present application. DETAILED DESCRIPTION

[0104] 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 indicated.

[0105] 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.

[0106] In addition, numerous specific details are provided in the detailed description below to better illustrate the present application. Those skilled in the art will appreciate that the present application can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art are not described in detail in order to highlight the main purpose of the present application.

[0107] To facilitate understanding of the technical solutions provided in this application, some of the terms involved are explained below:

[0108] Offline Rendering: Usually refers to a concept that is opposite to real-time rendering and interactive rendering. That is, the rendering time of 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.

[0109] Real-time rendering: This generally refers to a short single-frame rendering time, with a frame rate of 30fps (frames per second) or higher. This is typically used in scenarios with high real-time requirements, such as gaming.

[0110] Ray tracing is a specialized rendering algorithm in 3D computer graphics used to generate images visible in a 3D computer graphics environment. This method works by reversely tracing the path of light that intersects with an imaginary camera lens, calculating the amount of light energy at the intersection of that light path and the scene, and ultimately recursively projecting all that light energy onto the image to achieve realistic rendering. Images rendered using ray tracing generally appear more realistic than those rendered using rasterization algorithms.

[0111] Direct Illumination: Light comes directly from the light source without any photon bounces. Direct illumination is the lighting effect produced by the light source shining directly on the surface of the scene.

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

[0113] 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.

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

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

[0116] Image-based lighting (IBL), also referred to herein as image-based lighting, is a lighting technique that allows you to illuminate a scene using an image. It is a collection of lighting techniques. IBL's light source is not a decomposable direct light source, but rather treats the surrounding environment as a single, large light source.

[0117] 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 often the main source of noise due to occlusion issues, especially in scenes with small windows (windows can refer to openings such as windows and doors through which ambient light enters the image scene) or numerous objects. To better reduce the noise caused by image lighting, related technologies use different methods to handle it, which are explained below.

[0118] Related technology 1:

[0119] Manually marking portals (also referred to as windows in this article) P (as shown in Figure 1) improves rendering quality and efficiency by guiding the direction S of light rays used to sample the environment map. However, this method requires manual image preprocessing (i.e., marking the windows P), which increases the rendering cost.

[0120] For example, for the ambient light sampling of an indoor scene shown in Figure 2, Figure 2 shows the sampling results of four different sampling methods, as well as a schematic diagram of the rendering results. Env refers to the Environment sampling method without guidance information, with a sampling result of 0.592. S.Angle refers to the sampling method based on solid angles, with a sampling result of 0.7358. MIS refers to Multiple Importance Sampling (MIS), with a sampling result of 0.6075. Ours is a sampling method based on manually marked portals, with a sampling result of 0.3391. Ref is the true value (reference). As shown in Figure 2, the portal-based environment map sampling algorithm improves the sampling efficiency of ambient light by manually marking portal positions P and combining them with an importance map to perform targeted sampling of the environment map, thereby enhancing the final rendering results of the indoor scene (as shown in Figure 2). The main idea of ​​this solution is to use the information of manually marked portal positions P to guide the direction of ambient light sampling.

[0121] However, there are several issues: Related technology 1 requires manual labeling of each window's position, which can vary between labelers. Furthermore, the shape of the labeled windows can also complicate manual labeling. The labeling of each window directly impacts model training and application, and inaccurate labeling can negatively impact rendering quality.

[0122] Related technology 2:

[0123] Also 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 (split the environment map into multiple grid units as shown in Figure 3A) and the camera field of view (as shown in Figure 3B, where the grid units are not shown in Figure 3B, 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.

[0124] The scheme is mainly divided into two stages, the learning stage (as shown in Figure 4A) and the rendering stage (as shown in Figure 4B). Among them, the learning stage shown in Figure 4A mainly calculates the contribution of each environment map sub-block to each viewing unit, mainly by projecting the vertex back to the center of the camera to determine its corresponding grid unit. Importance sampling is performed on the environment map map, and the contribution of the sample is determined, and these contributions 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. In the rendering stage shown in Figure 4B, for each rendering point in the scene, the corresponding grid cell is found by back-projecting to the center of the camera. Then one of the samples is sampled using the pre-calculated probability distribution, and finally a sampling point is selected from the sample for sampling. For example, for a rendering point x, the light direction c[x] and / or c[y] can be selected for sampling.

[0125] However, the second related technique has the following drawbacks: The weights learned for cameras in different positions vary, and the approach is only effective for fixed positions. Since changing the viewpoint requires relearning, it is not suitable for real-time rendering, where the viewpoint and position can change rapidly.

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

[0127] 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. It can record the effective sampling direction range corresponding to each position, and can adapt to rendering requirements of different perspectives, greatly saving computing power while improving the rendering quality and the convergence speed of the rendering engine.

[0128] The rendering method provided in this application includes a pre-calculation phase and a rendering phase. The pre-calculation phase is performed before the rendering phase. The pre-calculation phase and the rendering phase are described below. The method provided in this application can be applied to electronic devices, cloud servers, and the like.

[0129] As shown in Figures 5 and 6, the pre-calculation stage includes steps S101 to S104. By pre-determining the window information of each first detection point of the environment map, the subsequent rendering process is not affected by the camera position and can adapt to rendering requirements of any perspective.

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

[0131] 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 impose any restrictions on 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 M×N×Q cube detection blocks as shown in Figure 6 according to a preset size, and then determining 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 (the shared detection point as shown in Figure 6). 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 is 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 this application does not impose any restrictions on this. The shape of the detection block can be a cube, a cuboid, etc., and this application does not impose any restrictions on 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 this application does not impose any restrictions on this.

[0132] In some embodiments, in step S101, when determining the bounding box of the environment map, 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 multiple detection blocks of predetermined sizes, and the range enclosed by the multiple detection blocks may be expanded so that the bounding box is within the range enclosed by the multiple detection blocks. This ensures that the triangular facets used in the rendering phase can be enclosed by the segmented detection blocks.

[0133] As shown in FIG5 , in step S102 , a plurality of detection beams are emitted outwards with each first detection point as the center, wherein the plurality of detection beams emitted from each first detection point are distributed in a spherical shape.

[0134] In this embodiment, the number and direction information of the detection light emitted outward from each first detection point can be set according to actual needs, wherein the direction information of the detection light can be represented by the longitude and latitude of the detection light in the spherical coordinate system, the position coordinates of other points on the detection light except the first detection point in the three-dimensional space, etc., and this application does not impose any restrictions on this. For example, as shown in Figure 6, for the first detection point D among 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, 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.

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

[0136] As shown in FIG. 5 , 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.

[0137] 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) for storage.

[0138] In one possible implementation, as shown in FIG5 , the method may further include step S105 . In step S105 , a cumulative distribution function (CDF) is calculated based on the window information of each first detection point to obtain a CDF table for each first detection point, for use in a subsequent rendering stage.

[0139] In a possible implementation, 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.

[0140] As shown in FIG. 7A , the rendering stage may include steps S201 to S205 .

[0141] As shown in FIG7A , in step S201 , a point to be rendered is determined. The point to be rendered can be any point to be rendered in the target scene image to be loaded. The point to be rendered can also be referred to as a shading point to be colored.

[0142] In some embodiments, as shown in FIG9 , step S201 may include step S501 and step S502. First, the direction of the emitted light is determined based on the sampling direction and the position of the camera, and then the light for sampling is generated (such as S501). Then, in step S502, the point to be rendered that is 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. The 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.

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

[0144] In one possible implementation, as shown in FIG8 , step S202 may include: determining, based on 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; and selecting a second detection point from the candidate detection points. In another possible implementation, step S202 may further include: determining, as candidate detection points, the plurality of first detection points on the detection block where the mutated triangular facet of the point to be rendered is located; wherein the mutated point to be rendered is determined by mutating the position of the point to be rendered using a random number.

[0145] In some embodiments, as shown in FIG8 , 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 that are in the positive direction of the triangle can be used for subsequent rendering, so the 6 first detection points in the 8 vertices that are in the positive direction of the triangle are determined as alternative detection points.

[0146] In some embodiments, the variation processing of the target rendering point may include: first generating two random numbers to mutate the target position coordinate value. After the target rendering point is concentrated by the two random numbers, it will move slightly upward. The mutated target rendering point can be used to select more first detection points as candidate detection points. The purpose of the variation processing is to prevent the occurrence of large discrepancies in the sampling results of the detection block edge.

[0147] 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.

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

[0149] In one possible implementation, 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.

[0150] 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.

[0151] As shown in FIG7A , 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 positional 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. The transformation parameters depend on the position of the second detection point.

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

[0153] In this embodiment, as shown in FIG9 , 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. Because the light rays emitted in step S501 are constantly bouncing, the computational complexity of the entire rendering process is very large. Furthermore, as the light rays are bouncing and transmitting in the scene, the energy of the light rays gradually decreases. Therefore, the points hit by relatively late bouncing rays are effectively worthless due to their low energy. Therefore, in fact, it is unnecessary to continue bouncing relatively late rays. Therefore, roulette (S504) is used to terminate the process. In step S504, a random number is generated and compared with the equivalent energy of the current light ray. If the equivalent energy of the current light ray is less than or equal to the random number, the ray ray is stopped, and the process returns to step S501 to continue generating new rays and executing subsequent steps. If the equivalent energy of the current light ray is greater than the random number, the ray ray is continued to be bouncing 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.

[0154] 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, each time the 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 can be performed directly without the need to execute 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 random sampling of the ambient light, thereby improving the rendering quality.

[0155] In one possible implementation, as shown in FIG7B , the method may further include, before step S202 , step S206 . In step S206 , it is first determined whether the stored detection file includes detection information corresponding to the target scene image. If it is determined that the detection file stores detection information corresponding to the point to be rendered, 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 performed. If it is determined that the detection file does not store detection information corresponding to the point to be rendered, the steps of the pre-calculation stage are first performed and then step S202 is performed (the steps of the pre-calculation stage are not shown in the figure). That is, as shown in FIG10 , after the point to be rendered is determined, step S206 is first performed. If it is determined that the detection file stores detection information corresponding to the point to be rendered, the stored detection is directly used to enter the rendering stage. If it is determined that the detection file does not store detection information corresponding to the point to be rendered, the steps of the pre-calculation stage are first performed and then the remaining steps of the rendering stage are performed.

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

[0157] Application scenario example 1:

[0158] 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 within the scene, and the engine performs real-time rendering according to the camera position. Since most indoor scenes have openings such as windows that are connected to the outside, previous engines need to perform more cumulative renderings to properly sample the external 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.

[0159] Application scenario example 2:

[0160] 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 results 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 bounces 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 so that most of the sampled light is effective light, thereby improving the rendering results and speed.

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

[0162] As shown in FIG11 , an embodiment of the present application provides a rendering device, comprising:

[0163] 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;

[0164] A detection point determination module 62 is 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;

[0165] A first direction determining module 63 is configured to determine a sampling direction corresponding to the point to be rendered based on the window information of the second detection point;

[0166] a sampling information determining module 64, configured to sample the environment map according to the sampling direction to obtain sampling information;

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

[0168] 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.

[0169] In a possible implementation, the apparatus further includes:

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

[0171] a light emitting module configured to emit a plurality of detection lights outwardly with each of the first detection points as a center, wherein the plurality of detection lights emitted from each of the first detection points are distributed in a spherical shape;

[0172] A light determination module, configured to determine a target detection light whose direction hits the environment map among the multiple detection lights of each of the first detection points;

[0173] The window information determining module is configured 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.

[0174] In a possible implementation, the apparatus further includes:

[0175] The calculation module is configured to calculate a 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.

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

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

[0178] Dividing the bounding box into a plurality of detection blocks with preset sizes;

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

[0180] 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

[0181] Dividing the bounding box into a plurality of detection blocks with a preset size includes: dividing the bounding box into a plurality of detection blocks with a preset size, 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.

[0182] 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:

[0183] 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;

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

[0185] In a possible implementation, determining, based on 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:

[0186] 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.

[0187] In a possible implementation, determining, based on 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 further includes:

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

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

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

[0191] generating 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

[0192] A cumulative distribution function is calculated based on 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 based on the generated random number and the cumulative distribution function table of the second detection point.

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

[0194] 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.

[0195] In a possible implementation, the apparatus further includes:

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

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

[0198] The rendering method and apparatus provided in the present application can be executed by an electronic device 100 as shown in FIG12 . 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.

[0199] 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.

[0200] It should be understood that the structures illustrated in the embodiments of the present application do 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, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0201] 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 processing unit (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). The different processing units may be independent devices or integrated into one or more processors.

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

[0203] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 may be a cache memory. This memory can store instructions or data that have been used or are frequently used by processor 110. When processor 110 needs to use the instruction or data, it can directly access it from this memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0204] In some embodiments, the processor 110 may include one or more interfaces. The interfaces 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. The processor 110 may be connected to modules such as a touch sensor, an audio module, a wireless communication module, a display, and a camera through at least one of the above interfaces.

[0205] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative 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 from the above embodiments, or a combination of multiple interface connection methods.

[0206] Electronic device 100 can implement display functions using a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0207] 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 this application.

[0208] 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.

[0209] The camera module 193 can be used to collect color image data and depth data of the subject. 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 light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then transmitted to the ISP for processing and converted into an image visible to the naked eye. The ISP can also perform algorithmic optimization on image noise, brightness, and skin color. The ISP can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be provided in the camera module 193.

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

[0211] In some embodiments, the photosensitive element of the camera of the color camera module can be a charge coupled device (CCD) or complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then transmitted to the ISP for conversion 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 format such as RGB or YUV.

[0212] In some embodiments, the 3D sensing module can be a time of flight (TOF) 3D sensing module or a structured light 3D sensing module. Structured light 3D sensing is an active depth sensing technology, and its basic components may include an infrared emitter, an IR camera module, and the like. The operating principle of a structured light 3D sensing module is to first emit a specific pattern of light spots at the object being photographed, then receive the light spot pattern coding on the object's surface, compare the similarities and differences with the original projected light spot, and calculate the object's three-dimensional coordinates using triangulation principles. These three-dimensional coordinates include the distance between the electronic device 100 and the object being photographed. TOF 3D sensing can be an active depth sensing technology, and its basic components may include an infrared emitter, an IR camera module, and the like. The operating principle of a TOF 3D sensing module is to calculate the distance (i.e., depth) between the TOF 3D sensing module and the object being photographed based on the time it takes for the infrared light to return, thereby generating a 3D depth map.

[0213] Structured light 3D sensing modules can also be used in facial recognition, motion-sensing game consoles, industrial machine vision inspection, and other fields. Time-of-flight 3D sensing modules can also be used in game consoles, augmented reality (AR) and virtual reality (VR).

[0214] 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 object being photographed. The two or more cameras may use stereo vision technology to collect depth data of the object being photographed. 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 calculations are performed to obtain distance information between the electronic device 100 and the object being photographed, that is, depth information.

[0215] 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 capture color image data and depth data of the photographer facing the display screen 194, while the rear camera module may be used to capture color image data and depth data of the subject (e.g., a person, scenery, etc.) facing the photographer.

[0216] 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.

[0217] An embodiment of the present application provides a non-volatile computer-readable storage medium having computer program instructions stored thereon, wherein the computer program instructions implement the above method when executed by a processor.

[0218] 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.

[0219] A computer-readable storage medium may be a tangible device that can hold and store instructions for use 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 thereof. More specific examples (a non-exhaustive list) of computer-readable storage media 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 thereof.

[0220] 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, fiber optic transmission, wireless transmission, 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 to be stored in the computer-readable storage medium in each computing / processing device.

[0221] The computer program instructions for performing the operations of the present application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent 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++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely 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., via the Internet using an Internet service provider). 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, thereby implementing various aspects of the present application.

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

[0223] 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 is generated that implements the functions / actions specified in one or more blocks in the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, where these instructions cause the computer, programmable data processing device, and / or other device to operate in a specific manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowchart and / or block diagram.

[0224] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational 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 blocks in the flowchart and / or block diagram.

[0225] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, systems, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a part for a module, program segment or instruction, and the part for the module, program segment or instruction comprises one or more executable instructions for realizing the logical function of the specification. In some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous boxes can actually be performed substantially in parallel, and they can sometimes also be performed in the opposite order, depending on the function involved.

[0226] 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.

[0227] 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 can understand and implement other variations of the disclosed embodiments by reviewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple situations. A single processor or other unit can 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.

[0228] The embodiments of the present application have been described above. The above description is illustrative and not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, their practical applications, or improvements to the technology in the market, or to enable other persons skilled 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.

Citation Information

Patent Citations

  • Game scene rendering method and device

    CN110193193A

  • Illumination rendering method and device, computer readable medium and electronic equipment

    CN111915712A

  • Ambient light reflection simulation method and device based on physical principle and storage medium

    CN112381915A

  • Transparent polyhedron rendering method and device

    CN113947656A

  • Scene rendering method and device, electronic equipment and storage medium

    CN115115767A

Cited By

  • Image rendering method, device, equipment and chip

    CN121170102A