A method and system for simulating the lighting effects of an interior design scheme
By performing sparse voxel octree partitioning and local geometric curvature optimization on indirect lighting sampling of 3D indoor scenes, combined with hybrid importance sampling of material properties and pre-computed information, the problem of balancing rendering speed and quality in traditional lighting effect simulation algorithms is solved, improving the realism and detail of lighting effects.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-20
- Publication Date
- 2026-03-24
AI Technical Summary
In existing technologies, lighting effect simulation algorithms for interior decoration schemes struggle to balance rendering speed and image quality. Traditional irradiance caching techniques suffer from visual defects such as insufficient or redundant sampling, light leakage, and color spots, affecting realism and detail.
By performing sparse voxel octree partitioning on the 3D indoor scene, combining local geometric curvature and material properties, optimizing indirect lighting sampling, adopting a hybrid importance sampling strategy, constructing a hybrid probability density function, and performing ray tracing and irradiance cache interpolation, the efficiency of lighting calculation and realism are improved.
While ensuring computational efficiency, it enhances the realism and visual detail of lighting simulation, reduces light leakage and color spots in corners, improves sampling efficiency, and optimizes resource allocation.
Smart Images

Figure CN121168083B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to a method and system for simulating lighting effects of an indoor decoration scheme. BACKGROUND
[0002] In the field of indoor decoration, in order to enable customers to intuitively preview the design effect, it is usually necessary to generate a three-dimensional effect drawing by using computer graphics technology. The realism of lighting effects is a core indicator for measuring the quality of effect drawings. Among them, global lighting simulation, especially the calculation of indirect lighting, plays a decisive role in achieving a high degree of realism. Indirect lighting refers to the part of light that reaches the observation point after being reflected or refracted one or more times on the surface of other objects in the scene after being emitted from the light source. It can greatly enhance the realism and immersion of the scene, and is the basis for forming key visual phenomena such as soft shadows and color overflow. Although traditional global lighting algorithms (such as path tracing) can produce physically accurate rendering results, they must track a large number of light rays in order to converge to a noise-free clear image, which has a very high computational cost. Therefore, such algorithms are difficult to meet the interactive needs of indoor decoration schemes for fast feedback during planning and modification.
[0003] In order to seek a balance between rendering speed and image quality, the industry has proposed a variety of indirect lighting acceleration algorithms, among which "radiosity caching" is a classic and widely used technology. This technology takes advantage of the fact that indirect lighting on diffuse surfaces is usually low-frequency, so it is not necessary to perform expensive hemispherical integration calculations at each pixel point. Its core idea is: only calculate the indirect lighting value at a part of the shading points in the scene and store it in the cache; for other adjacent shading points, the indirect lighting value is quickly estimated by interpolating the surrounding effective cache records. However, the traditional radiosity caching technology has several shortcomings: first, when determining the number of sampling light rays, it lacks awareness of local geometric complexity, which can easily lead to loss of details in detail areas such as corners due to insufficient sampling, while causing sampling redundancy in flat areas. Second, when generating sampling light ray directions, it is usually based only on the importance sampling of the diffuse reflection properties of the material, which is inefficient when the main indirect lighting comes from a specific direction. Finally, in the interpolation reconstruction phase, the weight calculation mainly depends on the similarity of spatial positions and normal vectors, which can easily cause visual defects such as lighting leakage, color spots or contact shadow blur in areas with dramatic geometric changes or large lighting gradients, thereby damaging the realism of the final effect drawing. SUMMARY
[0004] The present application provides a method and system for simulating lighting effects of an indoor decoration scheme to solve the problem of poor visual detail performance and poor realism of simulating lighting effects in the prior art.
[0005] In a first aspect, the method for simulating illumination effect of an indoor decoration scheme comprises the following steps:
[0006] obtaining a preset three-dimensional indoor scene model, material properties and light source information; performing sparse voxel octree division on the three-dimensional indoor scene model, and precomputing and storing indirect illumination information received by each voxel node based on light source positions and geometric occlusion relationships; emitting a primary ray from a viewpoint to obtain an intersection point with the scene model; obtaining material properties of the intersection point and decomposing the material properties into a diffuse reflection component and a specular reflection component; when there is no valid irradiance cache record around the intersection point, calculating local geometric curvature at the intersection point, and determining a number of indirect illumination sampling rays based on the local geometric curvature; combining importance sampling based on the diffuse reflection component and importance sampling guided based on the indirect illumination information to construct a hybrid probability density function to generate the number of indirect illumination sampling rays, trace the indirect illumination sampling rays to calculate an indirect illumination value, and store the indirect illumination value, a position of the intersection point, a normal vector of the intersection point and the local geometric curvature as a record in an irradiance cache; when there is a valid irradiance cache record around the intersection point, weighting and interpolating indirect illumination values of the valid cache record points according to differences in spatial positions, normal vectors and local geometric curvatures of the intersection point and the valid cache record points to obtain an indirect illumination value of the intersection point; combining a direct illumination calculation result, a ray tracing result of the specular reflection component and the indirect illumination value to calculate a final color value of a pixel according to a rendering equation, and until the simulation of the illumination effect of the entire indoor decoration scheme is completed.
[0007] Preferably, the sparse voxel octree division on the three-dimensional indoor scene model comprises:
[0008] placing the entire three-dimensional indoor scene model in a root cuboid bounding box;
[0009] recursively dividing the root cuboid bounding box, when a number of triangular facets contained in the root cuboid bounding box exceeds 16 and a current tree depth is less than 10, uniformly dividing the root cuboid bounding box into 8 child cuboid bounding boxes, until the number of triangular facets in all bounding boxes is not more than 16 or the tree depth reaches 10, thereby constructing a sparse voxel octree.
[0010] Preferably, the calculation of the local geometric curvature at the intersection point comprises:
[0011] taking the intersection point p as a center, emitting 4 probe rays forward and backward along orthogonal tangent vectors and binormal vectors in a tangent plane respectively with a step size of ;
[0012] obtaining a normal vector of the intersection point p and the normal vectors of 4 adjacent sample points ;
[0013] The local geometric curvature C at the intersection point p is calculated by the following formula:
[0014] .
[0015] Preferably, the number of indirect illumination sampling rays is determined based on the local geometric curvature, comprising:
[0016] Setting the lower limit of the number of indirect illumination sampling rays as , and setting the upper limit of the number of indirect illumination sampling rays as , and setting the upper limit of the normalized curvature as ;
[0017] The number of indirect illumination sampling rays is calculated according to the following formula :
[0018] ;
[0019] Where C is the local geometric curvature at the current intersection point.
[0020] Preferably, the number of indirect illumination sampling rays is determined based on the local geometric curvature, comprising: 32,
[0021] Preferably, the number of indirect illumination sampling rays is determined based on the local geometric curvature, comprising:
[0022] The first probability density function is constructed, based on the cosine weighted diffuse reflection BRDF, for generating indirect illumination sampling rays in the hemisphere space;
[0023] The second probability density function is constructed by querying the pre-computed indirect illumination information of the voxel node where the current intersection point is located, obtaining the dominant illumination direction and constructing the probability distribution, for guiding the rays to sample towards the indirect light source direction;
[0024] N / 2 indirect illumination sampling rays are generated according to , and the other N / 2 indirect illumination sampling rays are generated according to .
[0025] Preferably, the indirect illumination value of the intersection point is obtained by weighted interpolation of the indirect illumination values of the effective cache record points according to the differences in spatial position, normal vector and local geometric curvature between the intersection point and the effective cache record points, comprising:
[0026] In the irradiance cache, find K spatial locations with the nearest record points to the intersection point, and record points satisfying the following three conditions are determined as valid cache record points i:
[0027] (a) The world space distance between the record point and the intersection point p is less than a preset radius threshold R;
[0028] (b) The dot product of the normal vector of the record point and the normal vector of the intersection point is greater than 0.9;
[0029] (c) The absolute value of the difference between the local geometric curvature of the record point and the local geometric curvature C of the intersection point is less than a preset curvature threshold ;
[0030] The weight of all filtered valid cache record points i is calculated by the following formula :
[0031] ;
[0032] Wherein, represents the position of the current intersection point, represents the position of the valid cache record point, represents the Euclidean distance between the current intersection point and the valid cache record point , R is the preset radius threshold, is the normal vector of the current intersection point , and is the normal vector of the valid cache record point ;
[0033] The indirect illumination value of the current intersection point is calculated by weighted average of the indirect illumination values of all valid cache record points , which is calculated by the following formula:
[0034] .
[0035] Preferably, the pre-computed and stored indirect illumination information received by each voxel node includes:
[0036] A large number of photons are emitted from the scene light source, and the propagation path of the photons in the scene is tracked;
[0037] Whenever a photon interacts with a diffuse reflection surface in the scene, a Russian roulette is used to determine whether the photon is absorbed or continues to scatter; if the photon is absorbed, the incident direction and energy of the photon are stored in the sparse voxel octree leaf node where the photon hits, as a sample of the indirect illumination information received by the voxel.
[0038] Preferably, the obtaining of the preset three-dimensional indoor scene model, material attribute and light source information comprises:
[0039] An indoor scene containing geometric shapes, surface textures and material attributes is created by 3dsMax or SketchUp.
[0040] In a second aspect, the indoor decoration scheme lighting effect simulation system of the present application comprises a memory and a processor, the memory stores computer instructions, and the processor executes the computer instructions to realize the indoor decoration scheme lighting effect simulation method described above.
[0041] The present application has the following beneficial effects: The present application improves the realism of indoor decoration lighting simulation by inputting local geometric curvature as a key basis when calculating indirect lighting. When determining the number of sampling light rays, the number is associated with the local geometric curvature, so that in areas with rich geometric details such as corners and decorative lines, more sufficient sampling and detection of lighting details can be performed, while on flat surfaces, unnecessary computational overhead is reduced, optimizing the allocation of computing resources. When performing interpolation reconstruction of irradiance cache, local geometric curvature is used as a new weight factor to ensure that interpolation is only performed between cache points with similar geometric characteristics, thereby suppressing visual defects such as corner light leakage, color spots and contact shadow blur commonly seen in traditional methods. In addition, by combining material attributes with precomputed indirect lighting information for mixed importance sampling, the sampling efficiency is improved, and the convergence of lighting calculation is accelerated. The present application ensures high computational efficiency while enhancing the physical realism and visual detail performance of the rendering result. BRIEF DESCRIPTION OF DRAWINGS
[0042] Figure 1 A flowchart of the indoor decoration scheme lighting effect simulation method provided by the embodiments of the present application is shown. DETAILED DESCRIPTION
[0043] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings. The embodiments described below by reference to the accompanying drawings are exemplary and are intended to explain the present application, and cannot be understood as limiting the present application.
[0044] As Figure 1 shown, the embodiments of the indoor decoration scheme lighting effect simulation method provided by the present application comprise the following steps:
[0045] S1, obtaining a preset three-dimensional indoor scene model, material attribute and light source information.
[0046] Specifically, an indoor scene containing geometry, surface texture and material definition is created by a three-dimensional modeling software such as 3dsMax or SketchUp, and light source types, positions and intensity parameters such as point light, area light or spotlight are set. Then, it is exported to a general three-dimensional file format such as FBX or OBJ, and the program loads and parses the file to read the scene data into the memory data structure.
[0047] S2, the three-dimensional indoor scene model is divided by sparse voxel octree, and indirect lighting information received by each voxel node is pre-calculated and stored based on light source position and geometric occlusion relationship; a primary light ray is emitted from the viewpoint to obtain the intersection with the scene model; the intersection point is obtained, and the material attribute is decomposed into diffuse reflection component and specular reflection component.
[0048] Specifically, the axis-aligned bounding box of the entire scene is calculated, and the bounding box is taken as the root node of the octree. Then the root node is recursively divided, and if a node contains a scene geometry, it is uniformly divided into eight sub-nodes, and the process continues until the preset maximum tree depth is reached or the number of triangular patches contained in the voxel does not exceed the preset threshold. The node that does not contain the geometry is empty, thereby constructing the sparse voxel octree. A large number of photons are emitted from the primary light source to the scene, and their reflection paths in the scene are tracked. Each time the photon interacts with the diffuse reflection surface of the object, the energy and direction of the photon are stored in the voxel node where the photon is located, and the indirect lighting information of all voxel nodes is pre-calculated through the propagation and collection of photons. The information is usually stored in the form of spherical harmonic function coefficients or directional irradiance samples.
[0049] According to the position and orientation of the virtual camera, a primary light ray is generated for each pixel on the screen, which passes through the center of the pixel. The intersection of the primary light ray and the triangular patches in the scene is calculated using acceleration structures such as bounding box hierarchy, and the nearest intersection point is taken as the shading point. The material data of the shading point is read, and the specular reflection and diffuse reflection energy proportion of the light ray at the point is calculated through the Fresnel equation according to the physical rendering parameters such as base color, metallicity and roughness, thereby obtaining the specular reflection component and the diffuse reflection component.
[0050] S3, when there is no valid irradiance cache record around the intersection point, the local geometric curvature at the intersection point is calculated, and the number of indirect lighting sampling rays is determined based on the local geometric curvature; a mixed probability density function is constructed by combining importance sampling based on the diffuse reflection component and importance sampling based on indirect lighting information guidance to generate the number of indirect lighting sampling rays, and the indirect lighting value is calculated by tracing the indirect lighting sampling rays. The indirect lighting value, the intersection position, the normal vector of the intersection point and the local geometric curvature are stored as a record in the irradiance cache.
[0051] Specifically, search the K-dimensional tree structure of irradiance cache for records adjacent to the current intersection. If no valid record is found that satisfies the spatial position and normal direction similarity threshold, start the calculation of a new record. Estimate the local geometric curvature by analyzing the rate of change of the normal of the vertices around the intersection, for example, the normal of a high-curvature corner area changes dramatically. Set a minimum sampling number and a maximum sampling number, and linearly interpolate the specific sampling ray number of the current point according to the curvature value. Use a multiple importance sampling strategy to generate the rays: the ray direction follows a cosine-weighted hemisphere distribution, and the directions that contribute more to diffuse reflection are preferentially sampled; the ray direction is sampled according to the indirect lighting direction information stored in the corresponding voxel in the pre-computation step, and preferentially towards the indirect lighting source direction. Trace each sampling ray and calculate the direct lighting contribution of the hit point. The average value of all sampling ray contributions is the indirect lighting value of the current intersection. Pack this indirect lighting value together with the three-dimensional coordinates of the intersection, the surface normal, and the calculated curvature value into a new record, and insert it into the K-dimensional tree of the irradiance cache.
[0052] S4, when there are valid irradiance cache records around the intersection, the indirect lighting value of the effective cache record points is weighted and interpolated according to the differences in spatial position, normal vector and local geometric curvature between the intersection and the surrounding effective cache record points, to obtain the indirect lighting value of the intersection; combine the direct lighting calculation result, the ray tracing result of the specular reflection component and the indirect lighting value, and calculate the final color value of the pixel according to the rendering equation, until the lighting effect simulation of the entire indoor decoration scheme is completed.
[0053] Specifically, if a number of valid adjacent cache records are found in the K-dimensional tree of the irradiance cache, a weight is calculated for each valid record. In one embodiment, the weight is the product of multiple factors: the first factor is the inverse of the spatial distance between the current intersection and the cache point, the closer the distance, the higher the weight; the second factor is the dot product of the normal vectors of the two points, the closer the direction, the higher the weight; the third factor is the inverse of the difference in local geometric curvature between the two points, the more similar the curvature, the higher the weight. Multiply the indirect lighting value stored by each valid record by the corresponding total weight, add all the weighted lighting values, and divide by the sum of all weights, to calculate the interpolated indirect lighting value of the current intersection through this weighted average process.
[0054] A shadow ray is cast from the intersection point to each light source in the scene, and the path is checked for occlusion. If there is no occlusion, the direct lighting contribution of the light source to the intersection point is calculated. The contributions of all light sources are accumulated to obtain the total direct lighting. One or more specular reflection rays are generated according to the specular reflection direction, and the rays are recursively traced to obtain the lighting contribution from the specular reflection path. The calculated direct lighting is combined with the indirect lighting value obtained from the irradiance buffer or calculated, multiplied by the diffuse reflection color of the material, and added to the result of the specular reflection ray tracing. The three are added together to obtain the final color of the intersection point. This process is repeated for all pixels on the screen to synthesize a complete indoor lighting effect diagram.
[0055] In an optional embodiment, the sparse voxel octree partitioning of the three-dimensional indoor scene model comprises:
[0056] The entire three-dimensional indoor scene model is placed in a root cuboid bounding box;
[0057] The root cuboid bounding box is recursively partitioned. When the number of triangular patches contained in the root cuboid bounding box exceeds 16 and the current tree depth is less than 10, the root cuboid bounding box is uniformly divided into 8 sub-cuboid bounding boxes. The partitioning continues until the number of triangular patches in all bounding boxes is not more than 16 or the tree depth reaches 10, thereby constructing a sparse voxel octree.
[0058] For example, the partitioning process first determines the boundary of the entire three-dimensional indoor scene and creates a minimum cuboid that can accommodate all geometric bodies. The cuboid is the root node of the octree with a depth of 0. Then the root node is recursively partitioned. Assume that the root node contains all 500,000 triangular patches in the scene. Since 500,000 is much larger than the threshold of 16 and the depth of 0 is less than 10, the root cuboid is cut along the midpoints of the X, Y, and Z axes to divide it into eight sub-cuboids of equal size. The sub-cuboids become new nodes with a depth of 1. Each of the eight sub-nodes is independently checked. The sub-node that is completely in the empty space stops partitioning because it does not contain any triangular patches. If another sub-node contains a part of a table with 2000 triangular patches, since 2000 is still greater than 16 and the current depth of 1 is less than 10, the sub-node will be divided again into eight smaller cuboids.
[0059] The recursive partitioning step is repeated continuously. For areas in the scene with complex geometric structures, such as carved chair legs, the partitioning continues to a very deep level until the number of triangular patches in a cuboid is less than or equal to 16 or the tree depth reaches the preset upper limit of 10 layers. When the upper limit is reached, the partitioning is forced to stop even if the number of triangular patches in the cuboid is still more than 16. The resulting data structure has a high node density in areas with rich geometric details and a low node density in empty areas, effectively organizing the scene space.
[0060] In an alternative embodiment, said calculating the local geometric curvature at the intersection point comprises:
[0061] With the intersection point p as the center, four neighboring sampling points are obtained by respectively sending out four short light rays along the orthogonal tangent vector and binormal vector directions on the tangent plane with a step size of ;
[0062] The normal vector of the intersection point p and the normal vectors of the four neighboring sampling points are obtained ;
[0063] The local geometric curvature C at the intersection point p is calculated by the following formula:
[0064] .
[0065] For example, when a light ray intersects with a scene surface at a point p, the surface normal vector N(p) and the tangent plane at the point p are first calculated. On the tangent plane, two mutually perpendicular direction vectors, i.e., the tangent vector T and the binormal vector B, are determined. A very small step size , for example, 0.01 meters, is set. From the point p, a light ray is projected along the T direction for 0.01 meters to obtain a neighboring sampling point ; a light ray is projected along the -T direction for 0.01 meters to obtain a neighboring sampling point ; and neighboring sampling points and are obtained along the B and -B directions, respectively. The four short light rays are used to detect the small geometric changes around the point p.
[0066] After the point p and the four neighboring sampling points are obtained, the surface normal vectors of the five points are calculated, respectively. The essence of curvature is to represent the degree of change of the normal vectors. The change is represented by calculating the dot product of the normal vector N(p) of the point p and the normal vector N( ) of each neighboring sampling point. If the surface is flat, all the normal directions are consistent, and the dot product is close to 1, then the value obtained by subtracting the dot product from 1 is close to 0. Conversely, if the surface is curved, the normal directions differ greatly, and the dot product result is less than 1, and the value obtained by subtracting the dot product from 1 becomes large. The absolute values of the four difference values are calculated, and then the average value is taken to obtain the local geometric curvature C at the point p. For example, if the four difference values are 0.8, 0.7, 0.8, and 0.7, respectively, then the curvature C is 0.75, indicating a high curvature area, such as the edge of an object. If the four values are close to 0, it indicates a flat surface.
[0067] In an alternative embodiment, said determining the number of indirect light sampling light rays based on the local geometric curvature comprises:
[0068] Set the lower limit for the number of indirect illumination sampling rays to be [value]. The upper limit for the number of indirect illumination sampling rays is set to... Set the upper limit of normalized curvature to ;
[0069] The number of indirect illumination sampling rays can be calculated using the following formula. :
[0070] ;
[0071] Where C is the local geometric curvature at the current intersection point.
[0072] Specifically, setting It is 32. It is 256.
[0073] For example, a minimum of 32 indirect lighting sample rays and a maximum of 256 indirect lighting sample rays are emitted. Even on the flattest surface, at least 32 samples will be taken to ensure basic rendering quality; while in the most complex areas, the number of samples will not exceed 256 to control computational overhead. A normalized curvature upper limit is set. It is set to 0.8, which serves as a reference point, indicating that the maximum number of samples should be used when the curvature reaches 0.8.
[0074] When calculating indirect lighting at a point, obtain the calculated local geometric curvature C of that point. Then, compare this curvature C with the upper limit of curvature. That is, divide by 0.8 to get a ratio. For example, if a point is located on a flat wall, the curvature C might only be 0.1, then the ratio is 0.125. This ratio is used for linear interpolation between 32 and 256. The resulting number of rays is approximately 60.
[0075] If a point is located at the corner of a table, the curvature C reaches 0.9. At this point, C / The ratio is 1.125. Due to the presence of a minimum function (min) in the formula, this ratio is limited to 1.0. The interpolation factor used in the calculation is 1.0, resulting in 256 rays. This method concentrates more computational resources on areas with rich geometric details and more complex lighting variations.
[0076] To improve efficiency, a two-pronged strategy is employed to determine the emission direction of the sampling rays. In one optional embodiment, the construction of the mixed probability density function to generate the number of indirect illumination sampling rays includes:
[0077] Constructing the first probability density function cosine-weighted diffuse BRDF for sampling indirect light rays in the hemisphere space;
[0078] constructing a second probability density function by querying the pre-computed indirect light information of the voxel node where the current intersection point lies, and constructing a probability distribution for guiding the light rays to sample towards the direction of the indirect light source;
[0079] N / 2 indirect light sampling rays are generated according to and the other N / 2 indirect light sampling rays are generated according to .
[0080] Specifically, the first strategy is based on the reflection characteristics of the physical surface. For a diffuse surface, the light from directly above contributes the most, and the contribution attenuates with the decrease of the cosine value of the incident angle. Therefore, the first probability density function will generate light rays near the surface normal with a higher probability, which conforms to the physical law and can quickly detect the contribution of the local environment. In an optional embodiment, , is the included angle between the sampling direction and the normal.
[0081] The second strategy utilizes the pre-computed global light data. Before rendering, the information of the main directions from which the indirect light comes is stored in each octree voxel of the scene by methods such as photon tracing. When calculating the light of a point, the data stored in the voxel where the point lies is queried to identify the dominant direction that contributes most of the energy, such as from a bright window or a wall illuminated by the sun. The second probability density function is constructed based on the dominant direction, which will guide the light rays to be emitted more towards the known bright area. More specifically, the construction process of the second probability density function is to distribute photons into pre-defined K spatial regions according to the direction, calculate the total energy of each region k, and select the probability of region k as When sampling, a region is first randomly selected according to , and then a direction ω is randomly generated in the solid angle of the region, uniformly or in a certain way.
[0082] In actual generation of light rays, the above two strategies are combined. Assuming that 128 light rays need to be emitted at the current point in the last step. The 128 light rays are allocated half and half. Among them, 64 light rays will be generated according to the function, which will perform cosine-weighted sampling in the hemisphere space above the point to handle the local light. The other 64 light rays are generated according to Function generation, they will have the purpose of the main source of indirect lighting in the scene direction. By mixing two sampling methods, both to ensure physical correctness, and improve the probability of finding important light contribution, so that less light to obtain higher quality rendering results.
[0083] In an optional embodiment, the indirect lighting value of the intersection point is obtained by weighted interpolation of the indirect lighting values of the effective cache record points according to the differences of the intersection points and the effective cache record points in spatial position, normal vector and local geometric curvature, comprising:
[0084] In the irradiance cache, find K record points closest to the intersection point in space, and the record points satisfying the following three conditions are determined as effective cache record points i:
[0085] (a) The world space distance between the record point and the intersection point p is less than the preset radius threshold R;
[0086] (b) The dot product of the normal vector of the record point and the normal vector of the intersection point is greater than 0.9;
[0087] (c) The absolute value of the difference between the local geometric curvature of the record point and the local geometric curvature C of the intersection point is less than the preset curvature threshold ;
[0088] The weight of all filtered effective cache record points i is calculated by the following formula :
[0089] ;
[0090] Where, represents the position of the current intersection point, represents the position of the effective cache record point, represents the Euclidean distance between the current intersection point and the effective cache record point , R is the preset radius threshold, is the normal vector of the current intersection point , and is the normal vector of the effective cache record point ;
[0091] The indirect lighting value of the current intersection point is calculated by weighted average of the indirect lighting values of all effective cache record points , , which is calculated by the following formula:
[0092] .
[0093] Specifically, when indirect lighting of a shading point p needs to be computed, an attempt is made to interpolate the result from the existing irradiance cache to reduce ray tracing computation. First, find the K nearest points in space to the point p in the cache, for example, K is set to 8. Screen the 8 points according to a decision condition. Suppose only 3 points are determined to be valid cache points after screening, calculate a weight for each of the 3 valid cache points. The weight is not only based on the spatial distance, but also combines the difference in normal direction. The closer the valid cache point is to the point p, and the more consistent the normal direction is with the point p, the higher the weight. Weighted average of the indirect lighting values of all valid cache points The most relevant and reliable cache data contributes the most to the result.
[0094] In an optional embodiment, the pre-computed and stored indirect lighting information received by each voxel node includes:
[0095] A large number of photons are emitted from the scene light source, and the propagation path of the photons in the scene is tracked;
[0096] Each time the photon interacts with a diffuse reflection surface in the scene, a Russian roulette is used to determine whether the photon is absorbed or continues to scatter; if the photon is absorbed, the incident direction and energy of the photon are stored in the sparse voxel octree leaf node where the photon hits the point, as a sample of the indirect lighting information received by the voxel.
[0097] For example, before the formal rendering begins, a pre-computation step is performed to collect the indirect lighting distribution information in the scene. The process emits a large number of particles representing light energy, i.e. photons, from all light sources in the scene, such as light bulbs or outdoor ambient light. For example, one million photons are emitted from a surface light source, and the initial direction of each photon is random, and the energy is set according to the intensity of the light source. The flight path of each photon in the three-dimensional scene is tracked. When a photon hits an object surface, the material properties of the surface are checked. A Russian roulette random algorithm is used to determine the next behavior of the photon. According to the diffuse reflectivity of the surface material, for example, the reflectivity of a gray wall is 0.6, then the photon has a 60% probability of scattering and continuing to propagate, and the energy will be attenuated accordingly; at the same time, there is a 40% probability of being absorbed by the surface, and its tracking ends. If the Russian roulette determines that the photon scatters, record the impact event before the photon is given a new scattering direction. Determine which leaf node of the sparse voxel octree the impact point is located in, and then store the incident direction vector and the energy value carried by the photon when it reaches the impact point as a data sample in the data list of the leaf node. After multiple bounce tracking of millions of photons, a large number of samples will accumulate in many leaf nodes of the octree, and thus the direction and intensity distribution diagram of the indirect lighting received by the space region is obtained.
[0098] The implementation principle of the interior decoration scheme light effect simulation method of the embodiment is as follows: the present application aims to improve the realism of interior decoration light simulation, and the core is to introduce "local geometric curvature" as a key basis for calculating indirect light. The present application utilizes curvature information in two key stages: first, when determining the number of sampling light rays, the sampling number is associated with the local geometric curvature. This enables the system to automatically increase the sampling in areas with rich geometric details such as corners and decorative lines to capture lighting details, while reducing unnecessary computational overhead on flat surfaces, thereby optimizing the allocation of computing resources. Secondly, when performing interpolation reconstruction of irradiance cache, the present application uses local geometric curvature as a new basis for judgment to ensure that interpolation is only performed between cache points with similar geometric characteristics. This effectively suppresses the visual defects such as corner light leakage, color spots and contact shadow blur commonly seen in traditional methods. In addition, the present application also combines material attribute-based sampling and pre-computed indirect light information-based guided sampling to construct a hybrid importance sampling strategy, which improves the sampling efficiency and speeds up the convergence of light calculation. In summary, while ensuring high computational efficiency, the present application significantly enhances the physical realism and visual detail performance of the rendering results.
[0099] The embodiment of the interior decoration scheme light effect simulation system provided by the present application comprises a memory and a processor, the memory stores computer instructions, and the processor executes the computer instructions to realize the interior decoration scheme light effect simulation method in the above embodiment.
[0100] Although the embodiments of the present application have been shown and described above, it should be understood that the above embodiments are exemplary and should not be construed as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the present application.
Claims
1. A method for simulating the lighting effects of an interior decoration scheme, characterized in that, The process includes the following steps: acquiring a preset 3D indoor scene model, material properties, and light source information; performing sparse voxel octree partitioning on the 3D indoor scene model, and pre-calculating and storing the indirect lighting information received by each voxel node based on the light source position and geometric occlusion relationship; emitting a main ray from the viewpoint and obtaining the intersection point with the scene model. For the intersection point, the material properties are obtained and decomposed into diffuse reflection components and specular reflection components. When there is no effective irradiance cache record around the intersection point, the local geometric curvature at the intersection point is calculated, and the number of indirect lighting sampling rays is determined based on the local geometric curvature. Combining importance sampling based on diffuse reflection components and importance sampling guided by indirect lighting information, a hybrid probability density function is constructed to generate the number of indirect lighting sampling rays. The indirect lighting value is calculated by tracking the indirect lighting sampling rays, and the indirect lighting value, intersection point position, intersection point normal vector, and local geometric curvature are stored as a record in the irradiance cache. When there are effective irradiance buffer records around the intersection point, the indirect irradiance value of the effective buffer record points is weighted and interpolated based on the differences between the intersection point and the surrounding effective buffer record points in terms of spatial position, normal vector and local geometric curvature, so as to obtain the indirect irradiance value of the intersection point. By combining the direct lighting calculation results, the ray tracing results of the specular reflection component, and the indirect lighting values, the final color value of the pixel is calculated according to the rendering equation, until the lighting effect simulation of the entire interior decoration scheme is completed. Calculating the local geometric curvature at the intersection point includes: taking the intersection point p as the center, and along the directions of the orthogonal tangent vector and the bitangent vector on the tangent plane, respectively, with a step size... Four probe rays are emitted forward and backward to acquire four adjacent sampling points. ; Obtain the normal vector of the intersection point p and the normal vectors of the four adjacent sampling points ; The local geometric curvature C at the intersection point p is calculated using the following formula: .
2. The method for simulating the lighting effect of an interior decoration scheme according to claim 1, characterized in that, The sparse voxel octree partitioning of the 3D indoor scene model includes: The entire 3D indoor scene model is placed within a root cube bounding box; The root cube bounding box is recursively divided. When the number of triangular faces contained in the root cube bounding box exceeds 16 and the current tree depth is less than 10, the root cube bounding box is evenly divided into 8 sub-cube bounding boxes until the number of triangular faces in all bounding boxes is no more than 16 or the tree depth reaches 10, thereby constructing a sparse voxel octree.
3. The method for simulating the lighting effect of an interior decoration scheme according to claim 1, characterized in that, The determination of the number of indirect illumination sampling rays based on local geometric curvature includes: Set the lower limit for the number of indirect illumination sampling rays to be [value]. The upper limit for the number of indirect illumination sampling rays is set to... Set the upper limit of normalized curvature to ; The number of indirect illumination sampling rays can be calculated using the following formula. : ; Where C is the local geometric curvature at the current intersection point.
4. The method for simulating the lighting effect of an interior decoration scheme according to claim 3, characterized in that, set up It is 32. It is 256.
5. The method for simulating the lighting effect of an interior decoration scheme according to claim 4, characterized in that, The process of constructing the hybrid probability density function to generate the number of indirect illumination sample rays includes: Constructing the first probability density function Based on cosine-weighted diffuse BRDF, it is used to generate indirect illumination sampling rays in hemispherical space; Constructing the second probability density function By querying the pre-calculated indirect lighting information of the voxel node where the current intersection point is located, the dominant lighting direction is statistically obtained and a probability distribution is constructed to guide the light to sample towards the indirect light source direction; N / 2 indirect illumination sampling rays according to Generate, and additional N / 2 indirect illumination sampling rays according to generate.
6. The method for simulating the lighting effect of an interior decoration scheme according to claim 1, characterized in that, The indirect illumination value of the intersection point is obtained by weighted interpolation of the indirect illumination values of the effective buffered recording points based on the differences in spatial position, normal vector, and local geometric curvature between the intersection point and the surrounding effective buffered recording points. This includes: In the irradiance cache, find the K spatially nearest records to the intersection point. A record that simultaneously meets the following three conditions is determined to be a valid cache record i: (a) The world space distance between the recording point and the intersection point p is less than the preset radius threshold R; (b) The dot product of the normal vector of the recording point and the normal vector of the intersection point is greater than 0.9; (c) The absolute value of the difference between the local geometric curvature of the recording point and the local geometric curvature C of the intersection point is less than the preset curvature threshold. ; The weights of all selected valid cache record points i are calculated using the following formula. : ; in, This represents the current position of the intersection. Represents the location of a valid cache record. Represents the current intersection point With valid cache record points The Euclidean distance between them, where R is a preset radius threshold. The current intersection point The normal vector, For effective cached record points The normal vector; By checking all valid cached record points Indirect illumination value The indirect illumination value at the current intersection point is calculated by performing a weighted average. , Calculated using the following formula: 。 7. The method for simulating the lighting effect of an interior decoration scheme according to claim 1, characterized in that, The pre-calculation and storage of indirect illumination information received by each voxel node includes: A large number of photons are emitted from the scene's light source, and the propagation path of the photons in the scene is tracked; Whenever a photon interacts with a diffuse surface in the scene, Russian roulette is used to determine whether the photon is absorbed or continues to scatter. If the photon is absorbed, the incident direction and energy of the photon are stored in the sparse voxel octagonal leaf node where the photon hits, as a sample of the indirect lighting information received by the voxel.
8. The method for simulating the lighting effect of an interior decoration scheme according to claim 1, characterized in that, The acquisition of the preset 3D indoor scene model, material properties, and light source information includes: Create interior scenes with geometry, surface textures, and material properties using 3ds Max or SketchUp.
9. A lighting effect simulation system for interior decoration schemes, characterized in that, It includes a memory and a processor. The memory stores computer instructions. When the processor executes the computer instructions, it implements the method for simulating the lighting effect of an interior decoration scheme as described in any one of claims 1-8.
Citation Information
Patent Citations
Virtual reality building roaming method and system based on scene rendering
CN119888041A