Illumination calculation method and device, electronic equipment and storage medium

By obtaining observation point and scene information, determining the line of sight and sampling points, and calculating the available light path and light source contribution, the problem of existing technologies being unable to simulate mirror reflection, highlight or transmission materials is solved, and the illumination and brightness calculation of any material is realized, thereby improving the realism and efficiency of lighting calculations.

CN120654403APending Publication Date: 2025-09-16HANGZHOU QUNHE INFORMATION TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510747952.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-05
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

Existing lighting simulation software cannot accurately simulate specular reflection, highlights or transmissive materials, and cannot calculate the illumination and brightness of any material.

Method used

By obtaining observation point information and scene information, determining line of sight information and sampling point information, calculating available light paths and light source contributions, and combining light path and material information to simulate the light behavior of complex materials such as mirror reflection, highlight, and transmission, the brightness and illumination of the sampling point are calculated.

Benefits of technology

It realizes the calculation of illumination and brightness of any material, improves the realism and efficiency of lighting calculation, and is suitable for complex materials and physical interactions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120654403A_ABST
    Figure CN120654403A_ABST
Patent Text Reader

Abstract

The invention provides an illumination calculation method and device, electronic equipment and a storage medium, relates to the technical field of image processing, in particular to the fields of computer graphics, illumination simulation and the like, and can be used for application scenes such as material modeling and rendering. The specific implementation scheme is as follows: acquiring observation point information and scene information; wherein the scene information at least comprises object geometric information and object material information; determining sight line information and sampling point information corresponding to the sampling points according to the observation point information and the scene information; determining at least one available light path and light source contribution corresponding to each available light path according to the sight line information, the sampling point information and the scene information; and according to the light source contribution, the sampling point information, the observation point information, the available light path and the scene information, brightness information and illumination information of the sampling point are calculated. According to the scheme, the illuminance and brightness of any material can be calculated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing technology, in particular to the fields of computer graphics and lighting simulation, and can be used in application scenarios such as material modeling and rendering. Specifically, it relates to a lighting calculation method, device, electronic device and storage medium. Background Art

[0002] The illuminance and brightness calculation algorithms used in existing lighting simulation software are generally radiometry algorithms. This algorithm, based on finite element principles, divides the surface of objects in a scene into multiple facets and simulates the radiant transfer of light energy between these facets based on the physical laws of energy propagation, approximating the radiant energy distribution on the object's surface. However, this algorithm assumes that all objects in the scene are diffusely reflective, making it difficult to accurately simulate specular, high-gloss, or transmissive materials, and thus unable to calculate the illuminance and brightness of any material. Summary of the Invention

[0003] The present disclosure provides a lighting calculation method, device, electronic device and storage medium.

[0004] According to a first aspect of the present disclosure, a lighting calculation method is provided, comprising: obtaining observation point information and scene information; wherein the scene information includes at least object geometry information and object material information; determining line of sight information and sampling point information corresponding to a sampling point based on the observation point information and the scene information; determining at least one available light path and a light source contribution corresponding to each available light path based on the line of sight information, the sampling point information, and the scene information; and calculating brightness information and illuminance information of the sampling point based on the light source contribution, the sampling point information, the observation point information, the available light paths, and the scene information.

[0005] According to a second aspect of the present disclosure, a lighting calculation device is provided, comprising: an information acquisition module for acquiring observation point information and scene information; wherein the scene information includes at least object geometry information and object material information; an information determination module for determining line of sight information and sampling point information based on the observation point information and scene information; a light source contribution module for determining at least one available light path and the light source contribution corresponding to each available light path based on the line of sight information, sampling point information, and scene information; and a lighting calculation module for calculating brightness information and illuminance information of the sampling point based on the light source contribution, sampling point information, observation point information, available light paths, and scene information.

[0006] According to a third aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute any method in the embodiments of the present disclosure.

[0007] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any method according to the embodiments of the present disclosure.

[0008] By adopting the solution disclosed in the present invention, the illumination and brightness of any material can be calculated.

[0009] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.

[0011] Figure 1 is a flowchart of a lighting calculation method according to an embodiment of the present disclosure;

[0012] Figure 2 is another flowchart of the illumination calculation method according to an embodiment of the present disclosure;

[0013] Figure 3 is a structural diagram of a lighting calculation device according to an embodiment of the present disclosure;

[0014] Figure 4 is a scene schematic diagram of the illumination calculation method according to an embodiment of the present disclosure;

[0015] Figure 5 3 is a structural diagram of an electronic device used to implement the illumination calculation method of an embodiment of the present disclosure. DETAILED DESCRIPTION

[0016] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be appreciated by those skilled in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0017] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The term "at least one" in this article means any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C, can mean including any one or more elements selected from the set consisting of A, B, and C. The terms "first" and "second" in this article refer to multiple similar technical terms and distinguish them, and do not mean to limit the order or to limit to only two. For example, the first feature and the second feature refer to two categories / two features. The first feature can be one or more, and the second feature can also be one or more.

[0018] In addition, numerous specific details are provided in the following detailed description to better illustrate the present disclosure. Those skilled in the art will appreciate that the present disclosure 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 points of the present disclosure.

[0019] Before introducing the technical solutions of the embodiments of the present disclosure, the following technical terms that may be used in the present disclosure are further explained:

[0020] Brightness: A physical quantity that represents the intensity of light emitted by a light source or surface in a specific direction. It describes the distribution of light per unit area and per unit solid angle. Brightness is directly related to the human eye's subjective perception of light and dark and is a key indicator of light intensity perceived by the visual system.

[0021] Illuminance: A physical quantity that represents the amount of luminous flux per unit area received by a surface when light strikes it. It reflects the intensity of light striking a surface. Illuminance is indirectly related to the brightness of a surface as perceived by the human eye; it represents the objective intensity of light, rather than direct visual brightness.

[0022] In the related art, the illumination and brightness calculation algorithms used by lighting simulation software are generally radiometry algorithms. Radiometry algorithm is a computational technology based on the finite element principle. It can divide the surface of an object in the scene into multiple facets, and simulate the radiation transfer process of light energy between these facets according to the physical laws of energy propagation, and approximate the distribution of light energy radiation on the surface of the object. However, the radiometry algorithm assumes that the materials of the objects in the scene are all diffuse reflections. Due to the line of sight-independent characteristics of ideal diffuse reflection materials, the algorithm does not require the line of sight direction to calculate the illumination and brightness distribution of diffuse reflection materials, while line of sight-dependent materials such as metal and glass cannot be calculated. That is, the technical solutions in the existing technology are difficult to accurately simulate mirror reflection, highlight or transmission materials, and cannot calculate the illumination and brightness of any material.

[0023] In order to at least partially solve the above problems and one or more of other potential problems, the present disclosure proposes a lighting calculation method that can calculate the illumination and brightness of any material.

[0024] The present disclosure provides a method for calculating illumination. Figure 1 It is a flow chart of the illumination calculation method according to an embodiment of the present disclosure, and the illumination calculation method can be applied to an illumination calculation device. The illumination calculation device is located in an electronic device. The electronic device includes but is not limited to fixed devices and / or mobile devices. For example, fixed devices include but are not limited to servers, and servers can be cloud servers or ordinary servers. For example, mobile devices include but are not limited to material modeling and rendering devices, and material modeling and rendering devices can be mobile phones, tablet computers, vehicle-mounted terminals, etc. In some possible implementations, the illumination calculation method can also be implemented by a processor calling computer-readable instructions stored in a memory. For example Figure 1 As shown, the illumination calculation method includes:

[0025] S101. Obtain observation point information and scene information; wherein the scene information at least includes object geometry information and object material information.

[0026] S102: Determine line of sight information and sampling point information corresponding to the sampling point based on the observation point information and the scene information.

[0027] S103: Determine at least one available light path and a light source contribution corresponding to each available light path according to the sight line information, the sampling point information, and the scene information.

[0028] S104: Calculate the brightness information and illumination information of the sampling point according to the light source contribution, sampling point information, observation point information, available light path and scene information.

[0029] The observation point information refers to the specific location or viewpoint in the scene that the user or observer focuses on when performing illumination calculations. In the disclosed embodiment, the observation point information may include information such as the coordinates of the observation point and the field of view range.

[0030] The scene information refers to all information that can describe the entire scene. In the embodiment of the present disclosure, the scene information may include at least the geometric shape of objects in the scene, the material properties of objects in the scene, etc.

[0031] The object geometric information describes the geometric shape of the object in the scene. In the embodiment of the present disclosure, the object geometric information may include: object position, size, shape, surface division, etc., which can be used to define the structure of the object in space.

[0032] The object's material information can describe the optical properties of the object's surface. In the disclosed embodiments, the surface optical properties of an object may include diffuse reflection, specular reflection, transmission, refraction, absorption, etc. The object's material information determines the interaction of light on the object's surface.

[0033] In the disclosed embodiment, the scene information can be determined first. Exemplarily, the object geometry information of each object in the scene can be determined based on the modeling situation, and the object geometry information includes at least the shape, size, and position of the object. Further, the object material information of each object in the scene can be determined based on the modeling situation, and the object material information includes at least the optical properties of the object, such as diffuse reflection, specular reflection, etc. Subsequently, the position, line of sight direction, and field of view of the current observation point can be determined based on the current observation point in the scene, and the above information can then be used as the observation point information. The above is only an exemplary explanation and is not intended to limit all possible situations for obtaining observation point information and scene information, but it is not exhaustive here.

[0034] The line of sight information can describe the line of sight that passes through the scene after starting from the observation point. In the embodiment of the present disclosure, the line of sight information can be used to determine the light propagation path and the sampling points or areas that can be seen from the observation point.

[0035] The sampling point refers to a point in space or on the surface of an object selected for illumination calculation in a scene. In the disclosed embodiment, the sampling point is the final target of the light calculation.

[0036] The sampling point information describes specific information of the sampling point. In the embodiment of the present disclosure, the sampling point information at least includes the position coordinates of the sampling point, which can be used to determine the interaction relationship between the light and the sampling point.

[0037] In the disclosed embodiments, the line of sight path can be first determined based on the observation point information. Subsequently, the line of sight path is traced from the observation point through the scene to obtain sampling points. Furthermore, sampling point information can be determined based on the sampling points, and their location information can be recorded and used as sampling point information. The above description is merely illustrative and does not limit all possible scenarios for determining line of sight information and sampling point information. This is not intended to be exhaustive.

[0038] The available light path refers to the path that light takes from a light source, through reflection, refraction, or other effects in a scene, to reach a sampling point or observation point. In the disclosed embodiment, the available light path is a light propagation path that complies with geometric optics and energy conservation.

[0039] The light source contribution represents the light energy contribution of the light source to a certain available light path. In the embodiment of the present disclosure, the light source contribution may be related to the intensity, direction, and attenuation of the light source along the light path.

[0040] In the disclosed embodiments, light can be traced from a sampling point to determine the propagation path of the light from the light source to the sampling point. Then, by considering the interactions along the light path, paths that conform to physical laws can be selected to obtain usable light paths. Subsequently, for each usable light path, the light source intensity and the attenuation factor along the path can be considered to calculate the light source contribution. The above is merely an example and does not limit all possible scenarios for determining usable light paths and light source contributions; this is simply not an exhaustive list.

[0041] Brightness information is a physical quantity that measures the intensity of light reflected from the surface of a light-emitting or reflective object, and is defined as the power per unit solid angle per unit projected area in a specific direction. In the disclosed embodiments, brightness information represents the luminous intensity at a sampling point and reflects the human eye's subjective perception of light.

[0042] The illuminance information is a physical quantity that describes the luminous flux received per unit area and is defined as the power per unit projected area in a specific direction. In the disclosed embodiment, the illuminance information represents the light energy density received at the sampling point, reflecting the energy at the sampling point.

[0043] In the disclosed embodiments, the light intensity emitted by a sampling point can be calculated based on the material properties of the sampling point and the contribution of the light source, thereby obtaining brightness information. The total light energy received by the sampling point can then be calculated based on the light directly or indirectly contributed by the light source to the sampling point, thereby obtaining illuminance information. The above description is merely illustrative and does not limit all possible scenarios for calculating brightness and illuminance information; however, this is not intended to be an exhaustive list.

[0044] The technical solutions of the disclosed embodiments integrate observation point information, scene information, sampling point information, and light source contributions to comprehensively consider the light propagation path and the optical properties of the object surface, improving the realism of lighting calculations. By leveraging the principle of light path reversibility, the lighting behavior of complex materials, such as specular reflection, highlights, and transmission, is simulated based on light path and material information, thus supporting complex material and physical interaction.

[0045] In some embodiments, line of sight information and sampling point information are determined based on observation point information and scene information, including: determining a line of sight endpoint based on observation point information; determining line of sight information based on the line of sight endpoint and a preset line of sight direction; and determining sampling point information based on line of sight information and scene information.

[0046] The sight line endpoint represents the starting position of the sight line. In the embodiment of the present disclosure, the sight line endpoint is the starting point of ray tracing or light path calculation.

[0047] In the embodiment of the present disclosure, the spatial coordinates of the observation point can be determined based on the observation point information, and then the coordinates are used as the line of sight endpoint. The above is only an example and does not limit all possible situations for determining the line of sight endpoint. It is just not exhaustive here.

[0048] The preset line of sight direction is the direction starting from the line of sight endpoint and represents the initial direction of light or ray propagation. In the disclosed embodiments, the preset line of sight direction can be determined by the viewing angle or field of view attributes of the observation point. In particular, the line of sight direction can be a direct observation direction based on the direction of the line of sight, or a distributed line of sight direction obtained by multi-point sampling or cone sampling.

[0049] In the disclosed embodiments, the line of sight direction can be predetermined. For example, the line of sight direction can be predetermined based on information such as the direction of the camera, the orientation of the observation point, or a specific light propagation angle. Furthermore, a ray model can be generated based on the line of sight endpoint and the line of sight direction. For example, the ray model can be a direction vector starting from the line of sight endpoint. Subsequently, line of sight information is generated based on the ray model to further interact with the scene. The above is merely an illustrative description and is not intended to limit all possible situations for determining line of sight information, but this is not intended to be exhaustive.

[0050] In the disclosed embodiment, the starting point and direction of the line of sight can be determined based on the line of sight information. A ray tracing algorithm is then used to determine the position information of the sampling points along the line of sight propagation path, and this position information is used as the sampling point information. The above description is merely illustrative and does not limit all possible scenarios for determining the sampling point information. This is not intended to be exhaustive.

[0051] By binding the viewpoint endpoint to the observation point, the starting point of ray propagation can be clearly defined, ensuring that lighting calculations begin at the correct point. By presetting the viewpoint direction as the direction of ray propagation, ray calculations are ensured to conform to the field of view of the observation point and the range of ray propagation is limited, reducing unnecessary ray tracing and scene sampling, thereby improving computational efficiency.

[0052] In some embodiments, determining sampling point information based on line of sight information and scene information includes: determining the line of sight intersection with the object based on the line of sight information and object geometry information, and using the line of sight intersection as the sampling point; and determining sampling point information based on the sampling point.

[0053] The line of sight intersection refers to the location where the line of sight intersects the surface of an object in the scene. In the disclosed embodiment, the line of sight intersection is the basis for determining the sampling point, which represents the specific location of the object surface that the user or observer can see in the current line of sight direction.

[0054] In the embodiment of the present disclosure, a mathematical model of the ray can be established based on the line of sight information. For example, the ray can be represented as a combination of a starting point and a direction vector. Subsequently, it can be determined whether the ray intersects with the surface of the object. In particular, an intersection detection algorithm or an equation solving method can be used for calculation based on the properties of the object surface. For example, if the surface of the object is a polygonal mesh, an intersection detection algorithm of rays and polygons can be used to detect whether the ray passes through the interior of the polygon, and then calculate the intersection coordinates; if the surface of the object is a curved surface, a system of equations can be constructed using the ray and surface equations, and the intersection coordinates are obtained by solving the system of equations. In particular, if the ray intersects with multiple objects or surfaces, the nearest intersection along the ray direction is selected as the sampling point. The above is only an exemplary explanation and is not intended to limit all possible situations for determining the sampling points, but it is not exhaustive here.

[0055] In the disclosed embodiments, the object's surface mesh or geometric model can be queried based on the sampling point's position coordinates to obtain the normal direction of the sampling point. The position coordinates and the discovered direction are then used as sampling point information to support subsequent lighting calculations. The above description is merely illustrative and does not limit all possible scenarios for determining sampling point information; however, this is not intended to be an exhaustive list.

[0056] In this way, by calculating the intersection of the line of sight and the object, the key points on the light propagation path can be accurately located, providing high-quality sampling data for lighting calculations. It is suitable for complex scenes, can handle different geometric structures, and expands the scope of application.

[0057] In some embodiments, the scene information also includes light source information.

[0058] The light source information is part of the scene information and can be used to describe the properties and behavior of the light source. In the disclosed embodiment, the light source information may include information such as the coordinates of the light source in the scene, the light energy intensity emitted by the light source, and the color or wavelength distribution of the light emitted by the light source.

[0059] In some embodiments, at least one available light path and the light source contribution corresponding to each available light path are determined based on line of sight information, sampling point information, and scene information, including: determining at least one available light path based on line of sight information, sampling point information, light source information, object geometry information, and object material information; determining the light source contribution corresponding to each available light path based on the light source information, object geometry information, and object material information.

[0060] In the embodiment of the present disclosure, starting from the sampling point, the light can be traced along the preset direction to calculate whether the light reaches the light source in the reverse direction. In particular, if the surface of the sampling point is a reflective material, the reflection direction of the light can be calculated based on the material information of the object, and further traced to see whether the reflected light intersects with the light source. Similarly, if the surface of the sampling point is a transmissive or refractive material, the transmission or refraction path of the light can be calculated based on the material information of the object, and it can be determined whether the path can reach the light source. Finally, each traced path can be regarded as an available light path, and the geometric information on the path of each available light path can be recorded. In particular, the available light paths include all possible light paths for the sampling point in the scene. The above is only an exemplary description and is not intended to limit all possible situations for determining the available light paths, but it is not intended to be exhaustive.

[0061] In the disclosed embodiments, the light source contribution of each light path ultimately reaching the sampling point can be calculated by combining the light source intensity, the light attenuation characteristics, and the interaction characteristics of the object material. The above is merely an example and does not limit all possible situations for determining light source contributions. This is not intended to be exhaustive.

[0062] By integrating light source information, object geometry, and material information, we can handle light propagation and multi-material interactions in complex scenes, adapting to a wide range of light sources. Available light paths can include direct, reflected, and transmitted paths, supporting a variety of light interactions and adapting to complex scenes and material models. By comprehensively considering all light paths and occlusion relationships, we can generate high-quality lighting results, enhancing the realism of the scene.

[0063] In some embodiments, at least one available light path is determined based on line of sight information, sampling point information, light source information, object geometry information, and object material information, including: determining bounce light information and bounce sampling point information based on sampling point information, bounce sampling point information, and light source information; determining direct light information based on sampling point information, bounce sampling point information, and light source information; and determining an available light path based on line of sight information, direct light information, and bounce light information.

[0064] A bounced ray refers to a ray that originates from a sampling point and continues to propagate after being reflected, refracted, or transmitted through an object's surface. In the disclosed embodiments, a bounced ray is the propagation path of a ray after it leaves the sampling point and interacts with the surrounding environment or other objects. Furthermore, bounced ray information may include the starting point and direction of the bounced ray.

[0065] The ejection sampling point is the location where the ejection ray intersects the surface of an object in the scene. In the disclosed embodiment, the ejection sampling point is the end point of any ejection ray propagation and the starting point of the next ejection ray. Furthermore, the ejection sampling point information includes at least position coordinates.

[0066] In the embodiment of the present disclosure, the normal direction of the object surface and the direction of the incident light can be used, combined with the light interaction rules, to calculate the propagation direction of the ejection light. Subsequently, the ejection light information can be generated based on the calculated direction, combined with the position of the starting point of the ejection light. Furthermore, based on the propagation direction of the ejection light, the intersection of the light and the surfaces of other objects in the scene is calculated. Exemplarily, a ray tracing algorithm can be used to find the position of the ejection sampling point. Finally, the position information of the object surface at the ejection sampling point can be extracted, and the position information can be used as the ejection sampling point information. The above is only an exemplary explanation and is not intended to limit all possible situations for determining the ejection light information and the ejection sampling point information, but it is not exhaustive here.

[0067] In this disclosure, direct light refers to light that points directly from the sampling point to the light source. In this disclosure, direct light refers to the direct light propagation path between the sampling point and the light source. Furthermore, direct light information may include a starting point, a direction, and the like.

[0068] In the disclosed embodiments, the direction from the sampling point to the light source can be directly calculated, with the line connecting the sampling point and the light source being the direct ray, i.e., the light propagation path between the sampling point and the light source. Direct ray information can then be recorded and generated based on the starting point, end point, direction, and other information of the line. The above description is merely illustrative and does not limit all possible scenarios for determining direct ray information; however, this is not intended to be an exhaustive list.

[0069] In the disclosed embodiment, all possible light paths can be combined based on line of sight information, ejected light information, and direct light information. In particular, the starting point of each available light path is an observation point, the end point is a light source, and all pass through a sampling point. Exemplarily, an available light path can be a path that starts from an observation point, passes through a sampling point, and directly reaches the light source; or it can be a path that starts from an observation point, passes through a sampling point, and then ejects to an ejection sampling point, and then indirectly reaches the light source. The above is only an illustrative explanation and is not intended to limit all possible situations for determining available light paths, but it is not intended to be exhaustive here.

[0070] In this way, the determination of bounced rays, combined with the interactive behaviors of reflection, refraction, and transmission, can fully simulate the complex light propagation paths in the scene, enhancing the realism of lighting simulation. By combining line of sight information, bounced ray information, and direct ray information, a complete light path from the light source to the sampling point and then to the observation point can be constructed, providing accurate path data for lighting calculations. By constructing a precise light path, it is possible to generate realistic and detailed lighting effects.

[0071] In some embodiments, the ejection light information and the ejection sampling point information are determined based on the sampling point information, the light source information, the object geometry information and the object material information, including: determining the ejection direction based on the sampling point information, the object geometry information and the object material information; determining the ejection intersection point between the ejection light and the object based on the ejection direction and the object geometry information, and using the ejection intersection point as the ejection sampling point; using the ejection sampling point as the sampling point, determining the next ejection light information and the next ejection sampling point until the number of ejections exceeds a preset ejection number threshold; determining the ejection light information based on each ejection light; and determining the ejection sampling point information based on each ejection sampling point.

[0072] The ejection direction refers to the direction in which the light continues to propagate after interacting with the surface of the object at the sampling point. In the disclosed embodiment, the ejection direction determines the propagation path of the ejected light and is the basis for subsequent ray tracing and intersection calculation.

[0073] In the disclosed embodiment, the material at the sampling point can be determined based on the sampling point information and the object material information. Subsequently, the surface normal direction at the sampling point is determined based on the object geometry information. Finally, the ejection direction can be calculated based on the material and the surface normal direction. For example, if the material is a reflective material, the direction of the incident light and the surface normal direction can be used to calculate the ejection direction according to the law of reflection; if the material is a refractive material, Snell's law is used to calculate the refraction direction, and the light propagation path is determined based on the refractive index of the material and the angle of incidence; if the material is a diffuse reflective material, the ejection direction can be randomly generated to simulate the roughness of the surface. The above is only an exemplary explanation and is not intended to limit all possible situations for determining the ejection direction, but it is not exhaustive here.

[0074] The ricochet intersection point refers to the intersection of the ricochet ray and the geometric surface of the object in the scene. In the disclosed embodiment, the ricochet intersection point serves as the end point of the ricochet ray propagation and is also the starting point of the next ricochet ray.

[0075] In the disclosed embodiments, a ray ejection equation can be established, using the sampling point as the starting point and the ejection direction as the direction vector. Subsequently, an intersection algorithm for ejection rays and geometric objects is used to find the intersection of the ejection ray and the object surface, and this intersection is used as the ejection sampling point. The above is merely an example and does not limit all possible scenarios for determining ejection sampling points; however, this is not intended to be an exhaustive list.

[0076] The next ejection ray refers to the ray that propagates from the current ejection sampling point in the new ejection direction. In the disclosed embodiment, the next ejection ray can be used to recursively trace the propagation path of the ray until a preset ejection threshold is reached. The next ejection ray information includes information such as the starting point and direction of the next ejection ray.

[0077] The next ejection sampling point is the location where the next ejection ray intersects the surface of the object. In the disclosed embodiment, the next ejection sampling point is a new intersection point on the ray propagation path and is also the starting point of the subsequent ejection ray.

[0078] The preset bounce count threshold is the maximum number of times a ray is allowed to bounce within a scene, and is used to limit the recursive depth of ray tracing. In the disclosed embodiments, the preset bounce count threshold can prevent infinite ray bounces, control computational costs, and improve computational efficiency. Furthermore, since more bounces result in greater energy loss, controlling the bounce count threshold can avoid inefficient computations.

[0079] In the embodiment of the present disclosure, the ejection sampling point can be first used as a new sampling point, and then a new ejection ray equation can be established. Subsequently, the intersection algorithm of the new ejection ray and the geometric object is used to find the new intersection of the new ejection ray and the surface of the object, and the new intersection is used as the next ejection sampling point. In particular, if the current number of ejections exceeds the preset ejection number threshold, the recursion is stopped; otherwise, the next ejection is continued. The above is only an exemplary explanation and is not intended to limit all possible situations for determining the next ejection ray information and the next ejection sampling point. It is just that this is not an exhaustive list.

[0080] In the disclosed embodiment, the ejection light information can be determined based on the starting point, direction, length, etc. of each ejection light. The above is only an example and does not limit all possible situations for determining the ejection light information. It is just not exhaustive here.

[0081] In the embodiment of the present disclosure, the ejection sampling point information can be determined based on the position information of each ejection sampling point. The above is only an example and does not limit all possible situations for determining the ejection sampling point information. It is just not exhaustive here.

[0082] In this way, by recursively calculating the number of bounced rays and sampling points, we can accurately simulate the multiple interactions of light in the scene and construct a complete light propagation path. Using a bounce count threshold to limit the depth of recursive ray tracing avoids infinite bounces and improves computational efficiency. Accurate ray tracing can simulate the complex lighting effects in real scenes and improve the visual quality of rendered results.

[0083] In some embodiments, the light source contribution corresponding to each available light path is determined based on the light source information, object geometric information, and object material information, including: determining whether there is occlusion in each available light path based on the object geometric information; for the first type of available light path where there is occlusion, determining the light source contribution of the first type of available light path to be 0; for the second type of available light path where there is no occlusion, determining the light source contribution based on the light source information, object geometric information, and object material information.

[0084] Occlusion refers to the blocking of light rays by objects in the scene along their propagation path, preventing them from transmitting light energy to the sampling point. In the disclosed embodiments, occlusion may occur along the path of light rays from the light source to the sampling point, such as when they are blocked by other surfaces or geometric structures.

[0085] In the disclosed embodiment, the light information in the available light path can be used to establish a light path equation, and then the light intersection detection algorithm with the geometric object can be used to determine whether the light passes through the surface of the object in the scene. Furthermore, if the light intersects with the surface of an object, and the intersection point is between the light source and the sampling point, the path is marked as a first-class available light path with occlusion. Conversely, if the light does not intersect with any object surface, the path is marked as a second-class available light path without occlusion. The above is only an exemplary explanation and is not intended to limit all possible situations for determining whether there is occlusion, but it is not exhaustive here.

[0086] The first type of available light path refers to a light path in which there is an obstruction in the light propagation path. In the embodiment of the present disclosure, the light in the first type of available light path is blocked by other objects during the propagation process and cannot reach the sampling point or observation point.

[0087] In the disclosed embodiments, for the first type of available light paths that are obstructed, the obstruction location and related light path information can be recorded. Because the obstruction prevents the propagation of light energy, the light source contribution on this path is directly set to 0, without further calculation. The above is merely an example and does not limit all possible scenarios for determining the light source contribution of the first type of available light paths. This is simply not an exhaustive list.

[0088] The second type of available light path refers to a light path in which there is no obstruction in the light propagation path. In the embodiment of the present disclosure, light in the second type of available light path can propagate from the light source to the sampling point or observation point through the path.

[0089] In the embodiment of the present disclosure, for the second type of available light path without any obstruction, the light source contribution of the second type of available light path can be determined based on the light source information, object geometry information and object material information, according to the energy emitted by the light source and the energy lost by attenuation. The above is only an exemplary explanation and is not intended to limit all possible situations for determining the light source contribution of the second type of available light path, but it is not enumerated here.

[0090] This allows us to eliminate the first type of available light paths through occlusion detection before calculating light contribution, significantly reducing ineffective calculations and improving efficiency. For the second type of available light paths, we then calculate the light contribution by combining light source properties, path attenuation, and material interaction to ensure the accuracy of the lighting data.

[0091] In some embodiments, for the second type of available light path without occlusion, the light source contribution is determined based on the light source information, object geometry information, and object material information, including: determining the initial energy and propagation loss energy based on the light source information and the second type of available light path; determining the reflection loss energy based on the second type of available light path and object material information; and determining the light source contribution based on the initial energy, propagation loss energy, and reflection loss energy.

[0092] The initial energy is the light energy emitted by the light source, representing the total light radiation intensity when the light starts from the light source. In the disclosed embodiment, the light source information provides the initial luminous intensity of the light source. In particular, the distribution of initial energy may vary for different types of light sources.

[0093] The propagation loss energy is the energy of light that is reduced in the propagation path due to distance attenuation or absorption or scattering by the propagation medium.

[0094] In the embodiment of the present disclosure, the initial energy of the light at the starting point of the path can be first calculated based on the type and properties of the light source. For example, if the light source is a point light source, the initial energy is the total luminous intensity of the light source; if the light source is a surface light source, the initial energy is related to the angle between the luminous intensity per unit area of ​​the surface light source and the direction of the light path; if the light source is a directional light source, the initial energy needs to be corrected in combination with the angle between the light direction and the luminous direction of the light source. Furthermore, the energy attenuation can be calculated based on the distance traveled by the light by applying the inverse square principle of the distance, and the calculated energy attenuation is used as the propagation loss energy. In particular, if there is a participating medium in the path, the absorption or scattering characteristics of the medium also need to be considered. The above is only an exemplary explanation and is not intended to limit all possible situations for determining the initial energy and propagation loss energy, but it is not exhaustive here.

[0095] Reflection loss energy is the energy loss caused by reflection, refraction, or absorption when light interacts with an object's surface. In the disclosed embodiments, when light interacts with an object's surface, only a portion of the energy continues to propagate, while the rest is absorbed or scattered, depending on the properties of the object's material.

[0096] In the embodiment of the present disclosure, the reflection, transmission or absorption behavior of light when interacting with an object can be determined based on the material information of the sampling points in the available light path and the object at each ejection sampling point. The energy lost by the light during the interaction is then calculated based on the reflectivity of the object, and the lost energy is used as the reflection loss energy. In particular, if the object material is transparent or translucent, it is necessary to further calculate the energy loss caused by refraction or transmission behavior. The above is only an exemplary explanation and is not intended to limit all possible situations for determining the reflection loss energy, but it is not exhaustive here.

[0097] In the embodiment of the present disclosure, for any available optical path, the energy of the light reaching the surface of the object can be obtained by subtracting the propagation loss energy from the initial energy, and then the effective energy that can continue to propagate after the light interacts can be obtained by subtracting the reflection loss energy from the energy after propagation. The above calculation process is repeated multiple times until the total effective energy from the light source to the sampling point is calculated, that is, the actual lighting effect that the light can produce on the sampling point after propagation and interaction, and the total effective energy is used as the light source contribution corresponding to the available optical path. The above is only an illustrative explanation and is not intended to limit all possible situations for determining the contribution of the light source, but it is not exhaustive here.

[0098] By separately calculating initial energy, propagation loss, and reflection loss, we can accurately simulate the energy changes of light along its propagation path, generating realistic lighting effects. This approach can also handle diverse material interactions, making it suitable for complex object materials and optical properties, enhancing the applicability of lighting simulations. By comprehensively accounting for distance attenuation, medium absorption, and material interactions, we can fully reflect the true physical properties of light along its path. By accurately calculating light source contributions, the resulting lighting effects reflect the complex light interactions in the scene, improving the visual quality of rendered results.

[0099] In some embodiments, calculating the brightness information of the sampling point includes: establishing a rendering equation based on the observation point information and the available light path; determining the radiance based on the light source contribution and the rendering equation; and calculating the brightness information based on the radiance and the sampling point information.

[0100] The rendering equation is a mathematical expression used to describe the intensity of light radiation that ultimately reaches the observation point after light interacts with objects in the scene.

[0101] In the embodiment of the present disclosure, the rendering equation can be expressed as follows:

[0102] L0(p,ω0)=L e (p,ω0)+∫f r (p,ω i ,ω0)L i (p,ω i )(ω i ·n)dω i

[0103] Where, the radiance L0(p,ω0) represents the radiance observed by the sampling point p in the line of sight direction ω0; the direct radiance L e (p,ω0), represents the radiation brightness emitted by the sampling point p itself; the indirect radiation brightness ∫f r (p,ω i ,ω0)L i (p,ω i )(ω i·n)dω i , represents all incident directions ω to the sampling point p i Integrate; where the incident direction ω i One-to-one correspondence with available optical paths; reflection contribution f r (p,ω i ,ω0), indicating that the sampling point p is from the incident direction ω i The ratio of the incident light reflected to the line of sight direction ω0; the brightness of the incident light L i (p,ω i ), indicating that the sampling point p is from the direction ω i Incident radiation brightness; effective contribution coefficient (ω i ·n), indicating the incident direction ω i The cosine of the angle with the surface normal n at the sampling point p.

[0104] In the embodiment of the present disclosure, the sight direction ω0 can be determined first by the observation point information, the surface normal n of the sampling point can be determined by the sampling point information, and then multiple incident directions ω can be determined according to the available light path. i Then, according to the line of sight direction ω0, the normal n and multiple incident directions ω i Establishing a rendering equation. The above is merely an example and does not limit all possible situations for establishing a rendering equation. This is just not an exhaustive list.

[0105] Among them, radiance is a physical quantity used to describe the radiation intensity of light in a specific direction.

[0106] In the embodiment of the present disclosure, the process of determining the radiance according to the rendering equation is the process of solving the radiance L0(p,ω0).

[0107] In the embodiment of the present disclosure, the direct radiation brightness, that is, the radiation brightness L emitted by the observation point p itself, can be determined first. e (p,ω0). Then, the incident light brightness L can be determined by i (p,ω i ), reflection contribution f r (p,ω i ,ω0) and effective contribution coefficient (ω i n), and determine the indirect radiation brightness ∫f by Monte Carlo integration r (p,ω i ,ω0)L i (p,ω i )(ω i ·n)dω i .

[0108] Specifically, for the radiance L e(p,ω0) can be determined by judging whether the observation point is a light source or a self-luminous body. For example, if the observation point p is a light source or is located on the luminous surface of a self-luminous body, its self-radiated light intensity L is directly used. e (p,ω0); if the observation point p is not on the luminous surface, this term is 0.

[0109] Furthermore, for the incident light brightness L i (p,ω i ), the light source contribution corresponding to each available light path can be calculated as the incident light brightness. Specifically, for the reflection contribution f r (p,ω i ,ω0), the reflection contribution of each incident light can be determined separately. For example, a suitable reflection model can be selected according to the material information of the sampling point p, and the incident direction ω corresponding to each available light path can be i Establish a bidirectional reflection distribution function and use it as a reflection contribution. In particular, for diffuse reflective materials, the Lambertian reflection model can be used to establish a bidirectional reflection distribution function based on the surface reflectivity; for specular reflective materials, the smooth surface reflection model can be used to establish a bidirectional reflection distribution function based on whether the reflection direction is consistent with the emission direction; for other reflective materials, other reflection models can also be used to establish a bidirectional reflection distribution function, which is not limited in this disclosure. Specifically, for the effective contribution coefficient (ω i n), can be calculated based on the incident direction ω i The angle between the sampling point p and the surface normal n is calculated, and the cosine value is used as the effective contribution coefficient.

[0110] Furthermore, the process of determining the indirect radiation brightness requires integration over all incident directions, that is, all possible incident directions ω need to be considered. i For example, a sampling method can be used to calculate the incident direction ω. i Sampling is performed, and the integral value is estimated by substituting it into the rendering equation. Then, a certain number of incident light directions are enumerated, and the contribution of each light is calculated respectively. Then, the weighted average is taken and the average value is used as the indirect radiation brightness. In particular, the Monte Carlo integration method can be used to calculate the incident direction ω i Random sampling may be performed, or importance sampling may be performed to prioritize directions that contribute more to brightness. Other sampling methods in the prior art may also be used, and this disclosure does not limit this.

[0111] The above is merely an example and is not intended to limit all possible situations for determining radiance, but is not intended to be exhaustive.

[0112] In the embodiment of the present disclosure, the spectral weighting method can be first used to convert the radiant brightness into visual brightness based on the sensitivity of the human visual system to light of different wavelengths. Specifically, the radiant brightness is based on the sum of the light energy of all wavelengths, and the visual brightness needs to take into account the sensitivity of the human eye to different wavelengths. Therefore, the radiant brightness can be first decomposed into wavelength distribution, and then the radiant brightness of each wavelength can be weighted and calculated, and finally all wavelengths can be integrated to obtain the visual brightness of the point. Exemplarily, the process of weighted calculation of the radiant brightness of each wavelength can be calculated using a standard spectral sensitivity curve as a weight. The above is only an exemplary explanation and is not intended to limit all possible situations for calculating brightness information, but it is not exhaustive here.

[0113] This allows the rendering equation to fully describe the propagation and interaction of light in a scene, including direct and indirect illumination, as well as the distribution of material reflectance, improving the accuracy of lighting calculations. Integrating indirect illumination supports global illumination simulation, resulting in more realistic and natural rendering results. Converting radiance into luminance information enables the generation of realistic and detailed scene images. By combining available light paths with the rendering equation, unnecessary light calculations can be reduced, significantly improving computational efficiency.

[0114] In some embodiments, calculating illumination information of the sampling point includes: calculating direct illumination information of the sampling point according to scene information; calculating indirect illumination information of the sampling point according to brightness information of the sampling point; and determining illumination information according to the direct illumination information and the indirect illumination information.

[0115] The direct illumination information is the luminous flux density generated by the light source directly irradiating the sampling point. In the embodiment of the present disclosure, the direct illumination information reflects the direct illumination intensity received by the sampling point and is the basis for calculating the scene illumination.

[0116] In the embodiment of the present disclosure, direct illumination information can be calculated based on the light source information in the scene information. For example, the propagation path from the light source to the sampling point can be calculated first along the direction of the light. Subsequently, a ray tracing algorithm can be used to detect whether there are any obstructions in the path. Furthermore, if there is no obstruction in the path, that is, the light from the light source can reach the sampling point, the direct illumination information is calculated; if the path is obstructed, the direct illumination information is set to 0, where the obstruction can be other geometric objects in the scene. Furthermore, for the case where there is no obstruction in the path, the direct illumination intensity received by the sampling point can be calculated based on the intensity, directionality and distance of the light source. In particular, if the light source is directional, the direct illumination intensity needs to be adjusted according to the light source directionality function in combination with the angle between the light direction and the light source direction. The above is only an exemplary explanation and is not intended to limit all possible situations for calculating direct illumination information, but it is not exhaustive here.

[0117] Indirect illumination information is the luminous flux density generated by light from a light source reaching the sampling point indirectly after being reflected, scattered, or refracted by other objects in the scene. In the disclosed embodiments, indirect illumination information reflects the contribution of global illumination in the scene and is a key component of scene lighting realism.

[0118] In the disclosed embodiments, the surfaces of other objects in the scene can be treated as indirect light sources. The positions and brightness information of the indirect light sources can be determined. Then, using a ray tracing or path tracing algorithm, the interaction between the light and the surfaces of other objects in the scene can be recursively calculated. The illumination energy of all indirect light rays is then accumulated and recorded as the indirect illumination information of the sampling point. The above is merely an example and does not limit all possible situations for calculating indirect illumination information. This is just a non-exhaustive list.

[0119] In some embodiments, the indirect illumination information can be approximately calculated using the radiance of the sampling point. For example, the process of calculating the indirect illumination using the radiance can be expressed using the following formula:

[0120] E=∫L·(ω·n)dω

[0121] Where illuminance E is the luminous flux per unit area; radiance L is the radiant intensity per unit area per unit solid angle; and the correction factor (ω·n) is the dot product of the light direction and the surface normal direction, which is used to correct for the effect of angle on illuminance.

[0122] In particular, in some cases, if the radiance at the sampling point is uniformly distributed in all directions, that is, the radiance is isotropic, and the direction of the incident light needs to cover the complete hemisphere around the sampling point, and it is assumed that the light energy reflected by the surface is completely diffuse and the reflected brightness is uniformly distributed in all directions, the process of calculating indirect illumination through radiance can be simplified. The simplified process can be expressed as follows:

[0123] E=L·∫(ω·n)dω

[0124] Furthermore, the integral result of the hemisphere where the incident light is located can be obtained:

[0125] ∫(ω·n)dω=π

[0126] Therefore, the calculation process of indirect illumination can be simplified as follows:

[0127] E=L·π

[0128] That is, the indirect illumination can be obtained by calculating the radiant brightness in the brightness information of the sampling point, and the value of the indirect illumination is used as the indirect illumination information.

[0129] In the embodiment of the present disclosure, the direct illuminance information and the indirect illuminance information can be added to obtain the total illuminance of the sampling point, and the total illuminance is used as the brightness information of the sampling point. The above is only an example and does not limit all possible situations for calculating illuminance information. It is just not an exhaustive list here.

[0130] Separately calculating direct and indirect illumination allows for a precise description of the direct and indirect contributions of light, improving the accuracy of physically simulated scene lighting. In direct illumination calculations, occlusion detection allows for rapid identification of invalid light paths, reducing redundant calculations and improving computational efficiency. Indirect illumination calculations capture the effects of multiple light bounces within a scene, enabling realistic global illumination simulation and enhancing scene realism. Combining the results of direct and indirect illumination calculations yields high-quality rendered images with rich lighting and shadow details and a balanced brightness distribution.

[0131] Figure 2 A flow chart of the illumination calculation method is shown in FIG. Figure 2 As shown, the following steps are included:

[0132] S201, send out a line of sight from the observation point;

[0133] S202, taking the closest intersection point between the sight line and the scene object as a sampling point;

[0134] S203, when calculating the illuminance, obtain the position information of the sampling point and the normal information at the sampling point, regard the sampling point as an illuminance meter, and emit a new light;

[0135] S204: When calculating brightness, obtain material information at the sampling point, calculate direct illumination of the sampling point, and obtain and update the direction of the ejected light through the material information;

[0136] S205, determining whether the preset ejection number threshold is reached; if the preset ejection number threshold is not reached, returning to S204 and performing recursive calculation;

[0137] S206: Generate an illumination value and / or a brightness value.

[0138] It should be understood that Figure 2 The schematic diagram shown is only exemplary and not restrictive, and it is scalable, and those skilled in the art can Figure 2 Various obvious changes and / or substitutions can be made to the examples, and the resulting technical solutions still fall within the scope of the disclosure of the embodiments of the present disclosure.

[0139] The present disclosure provides a lighting calculation device, such as Figure 3As shown, the device may include: an information acquisition module 301, used to acquire observation point information and scene information; wherein the scene information includes at least object geometry information and object material information; an information determination module 302, used to determine line of sight information and sampling point information based on the observation point information and scene information; a light source contribution module 303, used to determine at least one available light path and the light source contribution corresponding to each available light path based on the line of sight information, sampling point information and scene information; and an illumination calculation module 304, used to calculate the brightness information and illumination information of the sampling point based on the light source contribution, sampling point information, observation point information, available light paths and scene information.

[0140] In some embodiments, the information determination module 302 includes: a line of sight endpoint determination submodule, which is used to determine the line of sight endpoint based on the observation point information; a line of sight information determination submodule, which is used to determine the line of sight information based on the line of sight endpoint and the preset line of sight direction; and a sampling point information determination submodule, which is used to determine the sampling point information based on the line of sight information and scene information.

[0141] In some embodiments, the sampling point information determination submodule is used to: determine the intersection of the line of sight and the object based on the line of sight information and the object geometric information, and use the line of sight intersection as the sampling point; and determine the sampling point information based on the sampling point.

[0142] In some embodiments, the light source contribution module 303 includes: a light path determination submodule, which is used to determine at least one available light path based on line of sight information, sampling point information, light source information, object geometry information and object material information; and a contribution determination submodule, which is used to determine the light source contribution corresponding to each available light path based on the light source information, object geometry information and object material information.

[0143] In some embodiments, the light path determination submodule is used to: determine the ejection light information and the ejection sampling point information based on the sampling point information, the light source information, the object geometry information and the object material information; determine the direct light information based on the sampling point information, the ejection sampling point information and the light source information; determine the available light path based on the line of sight information, the direct light information and the ejection light information.

[0144] In some embodiments, the optical path determination submodule is further used to: determine the ejection direction based on the sampling point information, the object geometry information and the object material information; determine the ejection intersection point between the ejection light and the object based on the ejection direction and the object geometry information, and use the ejection intersection point as the ejection sampling point; use the ejection sampling point as the sampling point to determine the next ejection light information and the next ejection sampling point until the number of ejections exceeds a preset ejection number threshold; determine the ejection light information based on each ejection light; and determine the ejection sampling point information based on each ejection sampling point.

[0145] In some embodiments, the contribution determination submodule is used to: determine whether there is occlusion in each available light path based on the object's geometric information; for the first type of available light path where there is occlusion, determine the light source contribution of the first type of available light path to be 0; for the second type of available light path where there is no occlusion, determine the light source contribution based on the light source information, object geometric information and object material information.

[0146] In some embodiments, the contribution determination submodule is also used to: determine the initial energy and propagation loss energy based on the light source information and the second type of available light path; determine the reflection loss energy based on the second type of available light path and object material information; determine the light source contribution based on the initial energy, propagation loss energy and reflection loss energy.

[0147] In some embodiments, the illumination calculation module 304 includes: a rendering equation submodule, which is used to establish a rendering equation based on observation point information and available light paths; a radiance submodule, which is used to determine the radiance based on the light source contribution and the rendering equation; and a luminance calculation submodule, which is used to calculate luminance information based on the radiance and sampling point information.

[0148] In some embodiments, the lighting calculation module 304 further includes: a direct illumination submodule, which is used to calculate the direct illumination information of the sampling point based on the scene information; an indirect illumination submodule, which is used to calculate the indirect illumination information of the sampling point based on the brightness information of the sampling point; and an illumination calculation submodule, which is used to determine the illumination information based on the direct illumination information and the indirect illumination information.

[0149] For the description of specific functions and examples of each module and submodule of the device in the embodiment of the present disclosure, please refer to the relevant description of the corresponding steps in the above method embodiment, which will not be repeated here.

[0150] The lighting calculation device in the disclosed embodiments integrates observation point information, scene information, sampling point information, and light source contributions to comprehensively consider the light propagation path and the optical properties of the object surface, thereby improving the realism of lighting calculations. By leveraging the principle of light path reversibility, the lighting behavior of complex materials, such as specular reflection, highlights, and transmission, is simulated based on light path and material information, thus supporting complex material and physical interaction.

[0151] The embodiment of the present disclosure provides a scene schematic diagram of a lighting calculation method, such as Figure 4 shown.

[0152] As mentioned above, the illumination calculation method provided by the embodiments of the present disclosure is applied to electronic devices. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers.

[0153] Specifically, the electronic device can perform the following operations:

[0154] Obtain observation point information and scene information; wherein the scene information includes at least object geometry information and object material information; determine line of sight information and sampling point information corresponding to the sampling point based on the observation point information and the scene information; determine at least one available light path and a light source contribution corresponding to each available light path based on the line of sight information, the sampling point information, and the scene information; calculate brightness information and illumination information of the sampling point based on the light source contribution, the sampling point information, the observation point information, the available light paths, and the scene information.

[0155] It should be understood that Figure 4 The scene diagram shown is only illustrative and not restrictive. Those skilled in the art can Figure 4 Various obvious changes and / or substitutions can be made to the examples, and the resulting technical solutions still fall within the scope of the disclosure of the embodiments of the present disclosure.

[0156] In the technical solutions disclosed herein, the acquisition, storage, and application of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0157] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.

[0158] Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0159] like Figure 5As shown, the device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the device 500 can also be stored in the RAM 503. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0160] Various components in device 500 are connected to I / O interface 505, including: an input unit 506, such as a keyboard, mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a magnetic disk, optical disk, etc.; and a communication unit 509, such as a network card, modem, wireless communication transceiver, etc. The communication unit 509 allows device 500 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0161] The computing unit 501 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as the illumination calculation method. For example, in some embodiments, the illumination calculation method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the illumination calculation method described above can be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to execute the illumination calculation method in any other appropriate manner (for example, by means of firmware).

[0162] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0163] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0164] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0165] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a cathode ray tube (CRT) or a liquid crystal display (LCD) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0166] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0167] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.

[0168] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not limited herein.

[0169] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the principles of this disclosure shall be included within the scope of protection of this disclosure.

Claims

1. A lighting calculation method, characterized in that: The method comprises: Acquire observation point information and scene information; wherein the scene information includes at least object geometry information and object material information; Determining line of sight information and sampling point information corresponding to a sampling point based on the observation point information and the scene information; Determining at least one available light path and a light source contribution corresponding to each available light path according to the line of sight information, the sampling point information, and the scene information; The brightness information and the illumination information of the sampling point are calculated according to the light source contribution, the sampling point information, the observation point information, the available light path and the scene information.

2. The method according to claim 1, characterized in that The determining, based on the observation point information and the scene information, line of sight information and sampling point information corresponding to the sampling point includes: Determine the sight line endpoint according to the observation point information; Determining the sight line information according to the sight line endpoint and a preset sight line direction; The sampling point information is determined according to the line of sight information and the scene information.

3. The method according to claim 2, characterized in that The determining the sampling point information according to the line of sight information and the scene information includes: Determine, based on the line of sight information and the object's geometric information, a line of sight intersection with the object, and use the line of sight intersection as the sampling point; The sampling point information is determined according to the sampling point.

4. The method according to claim 1, wherein The scene information further includes light source information; and determining at least one available light path and a light source contribution corresponding to each available light path based on the line of sight information, the sampling point information, and the scene information includes: Determining the at least one available light path according to the line of sight information, the sampling point information, the light source information, the object geometry information, and the object material information; The light source contribution corresponding to each available light path is determined according to the light source information, the object geometry information, and the object material information.

5. The method according to claim 4, characterized in that The determining the at least one available light path according to the line of sight information, the sampling point information, the light source information, the object geometry information, and the object material information includes: Determining ejection light information and ejection sampling point information according to the sampling point information, the light source information, the object geometry information, and the object material information; Determining direct light information according to the sampling point information, the ejection sampling point information, and the light source information; The available light path is determined according to the line of sight information, the direct light information, and the bounce light information.

6. The method according to claim 5, characterized in that The determining of the ejection light information and the ejection sampling point information according to the sampling point information, the light source information, the object geometry information and the object material information includes: Determining a launching direction according to the sampling point information, the object geometry information, and the object material information; Determine the ejection intersection point between the ejection ray and the object according to the ejection direction and the object geometric information, and use the ejection intersection point as the ejection sampling point; Using the ejection sampling point as the sampling point, determining next ejection light information and next ejection sampling point until the number of ejections exceeds a preset ejection number threshold; Determining the bounce light information according to each of the bounce light rays; According to each of the ejection sampling points, the ejection sampling point information is determined.

7. The method according to claim 4, characterized in that The determining, based on the light source information, the object geometry information, and the object material information, the light source contribution corresponding to each available light path includes: Determining whether there is an obstruction in each available light path based on the object geometric information; For a first type of available light path that is blocked, determining the light source contribution of the first type of available light path to be 0; For the second type of available light paths without any occlusion, the light source contribution is determined according to the light source information, the object geometry information, and the object material information.

8. The method according to claim 7, characterized in that The determining, for the second type of available light path without any obstruction, the light source contribution according to the light source information, the object geometry information, and the object material information, includes: determining initial energy and propagation loss energy according to the light source information and the second type of available light paths; determining reflection loss energy according to the second type of available optical paths and the object material information; The light source contribution is determined according to the initial energy, the propagation loss energy, and the reflection loss energy.

9. The method according to claim 1, characterized in that Calculating the brightness information of the sampling point includes: Establishing a rendering equation according to the observation point information and the available light path; Determining radiance based on the light source contribution and the rendering equation; The brightness information is calculated according to the radiance and the sampling point information.

10. The method according to claim 1 or 6, characterized in that Calculating the illumination information of the sampling point includes: Calculating direct illumination information of the sampling point according to the scene information; Calculating indirect illumination information of the sampling point according to the brightness information of the sampling point; The illumination information is determined according to the direct illumination information and the indirect illumination information.

11. A lighting calculation device, characterized in that: The device comprises: An information acquisition module, configured to acquire observation point information and scene information; wherein the scene information includes at least object geometry information and object material information; An information determination module, configured to determine sight line information and sampling point information based on the observation point information and the scene information; a light source contribution module, configured to determine at least one available light path and a light source contribution corresponding to each available light path based on the line of sight information, the sampling point information, and the scene information; The illumination calculation module is used to calculate the brightness information and illumination information of the sampling point according to the light source contribution, the sampling point information, the observation point information, the available light path and the scene information.

12. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 10.

13. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-10.