Rendering method and device, electronic equipment and readable storage medium

By storing the rendering information of the sampling points in the 2D rendering target and performing height modulation during the rendering process, the problem of high memory consumption and high computational cost of 3D noise textures is solved, achieving efficient rendering effects that are suitable for highly immersive visual experiences in fields such as games, simulation, and film preview.

CN121883689APending Publication Date: 2026-04-17GUANGZHOU BOGUAN TELECOMM TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-24
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

In the current rendering process, 3D noise textures consume a lot of video memory and have high computational costs, resulting in low rendering efficiency. Furthermore, 3D noise requires cumbersome pre-baking and art adjustments, which limits the flexibility of customized effects and makes it difficult to maintain high frame rate real-time rendering in complex scenes and on low-end and mid-range devices.

Method used

The rendering information of each sampling point is stored in the 2D rendering target. During the rendering process, the information in the 2D rendering target is read and the 3D effect is restored by height modulation. This reduces the steps of reading multiple 3D noise information multiple times. The volumetric Raymarching scheme is used for step sampling and height modulation.

Benefits of technology

While ensuring realistic rendering, it reduces the amount of data processing and improves rendering efficiency, making it suitable for high frame rate real-time rendering in complex scenes and on low- to mid-range devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121883689A_ABST
    Figure CN121883689A_ABST
Patent Text Reader

Abstract

The invention provides a rendering method and device, electronic equipment and a readable storage medium, and the rendering method and device, the electronic equipment and the readable storage medium are characterized in that step sampling is carried out on a to-be-rendered target model according to a preset sight line direction, and a target sampling point corresponding to the current step is determined; for the target sampling point, reading rendering information corresponding to the target sampling point from a pre-created two-dimensional rendering target; performing height modulation on the rendering information according to a preset height distribution function to obtain target rendering information, and determining a rendering result of the current step for the to-be-rendered target model based on the target rendering information; updating an accumulated rendering result in a preset sight line direction based on the target rendering information; and obtaining a rendered target rendering model in response to the cumulative rendering result meeting a preset rendering ending condition. In this way, the data processing amount in the rendering process can be reduced, and the rendering efficiency can be improved while the rendering verisimilitude is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of rendering technology, and in particular to a rendering method, apparatus, electronic device and readable storage medium. Background Technology

[0002] In fields such as games, simulations, and film previews that require a highly immersive visual experience, the design process involves rendering the models in the scene. Specifically, this can be done by first determining the target model to be rendered, and then using a pixel shader to color the corresponding pixels in the target model to vividly represent the image of the virtual elements.

[0003] In related technologies, a volumetric ray-marching approach can be used to perform pixel shading on the target model to be rendered. Specifically, in the pixel shader, ray-marching is performed along the view ray direction. At each step, 3D noise textures (such as Perlin or Worley noise) or multiple layers of 2D / 3D noise are sampled to obtain the "density" value of the current sampling point. By accumulating density and performing lighting calculations (often including secondary lighting step-by-step calculations of self-shadows), the scattering and absorption of light within the model are simulated, and finally, the pixel color is synthesized.

[0004] However, 3D noise textures, especially high-resolution 3D texture maps, consume a significant amount of video memory. Sampling on the Graphics Processing Unit (GPU) is computationally much more expensive than sampling 2D textures. Furthermore, 3D noise typically requires pre-baking, and re-baking is necessary after artists adjust parameters, resulting in a cumbersome workflow, high iteration costs, and limited flexibility in customizing effects. If realistically simulating the dynamic form of the object to be rendered is required, even more 3D noise textures need to be layered, leading to a large amount of GPU data processing and consequently impacting rendering efficiency. Summary of the Invention

[0005] In view of this, the purpose of this disclosure is to provide a rendering method, apparatus, electronic device and readable storage medium, which stores the rendering information corresponding to each sampling point in a two-dimensional rendering target, reads the rendering information in the two-dimensional rendering target during the rendering process, and restores the three-dimensional effect through height modulation, thereby reducing the steps of reading multiple three-dimensional noise information multiple times, thereby reducing the amount of data processing in the rendering process, and improving rendering efficiency while ensuring the realism of the rendering.

[0006] In a first aspect, embodiments of this disclosure provide a rendering method, the rendering method comprising: Perform step sampling on the target model to be rendered according to the preset viewing direction, and determine the target sampling point corresponding to the current step; For the target sampling point, the rendering information corresponding to the target sampling point is read from the pre-created two-dimensional rendering target; The rendering information is height modulated according to a preset height distribution function to obtain target rendering information, and the rendering result of the current step for the target model to be rendered is determined based on the target rendering information. The cumulative rendering result in the preset viewing direction is updated based on the target rendering information; In response to the cumulative rendering result satisfying the preset rendering end condition, the target rendering model that has been rendered is obtained.

[0007] Secondly, embodiments of this disclosure also provide a rendering apparatus, the rendering apparatus comprising: The sampling point determination module is used to perform step sampling on the target model to be rendered according to the preset viewing direction, and determine the target sampling point corresponding to the current step. The rendering information reading module is used to read the rendering information corresponding to the target sampling point from a pre-created two-dimensional rendering target. The height modulation module is used to perform height modulation on the rendering information according to a preset height distribution function to obtain target rendering information, and to determine the rendering result of the current step for the target model to be rendered based on the target rendering information; The rendering result update module is used to update the cumulative rendering result in the preset viewing direction based on the target rendering information; The model rendering module is used to obtain the target rendering model after rendering is completed in response to the cumulative rendering results meeting the preset rendering end conditions.

[0008] Thirdly, embodiments of this disclosure also provide an electronic device, including: a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the rendering method as described in the first aspect.

[0009] Fourthly, embodiments of this disclosure also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the rendering method as described in the first aspect.

[0010] The rendering method, apparatus, electronic device, and readable storage medium provided in this disclosure perform step sampling on the target model to be rendered according to a preset viewing direction to determine the target sampling point corresponding to the current step. For each target sampling point, rendering information corresponding to the target sampling point is read from a pre-created two-dimensional rendering target. The rendering information is height-modulated according to a preset height distribution function to obtain target rendering information, and the rendering result for the target model to be rendered for the current step is determined based on the target rendering information. The cumulative rendering result in the preset viewing direction is updated based on the target rendering information. In response to the cumulative rendering result satisfying a preset rendering termination condition, the rendered target model is obtained. In this way, by storing the rendering information corresponding to each sampling point in a two-dimensional rendering target, reading the rendering information in the two-dimensional rendering target during the rendering process, and restoring the three-dimensional effect through height modulation, the steps of reading multiple three-dimensional noise information are reduced, thereby reducing the amount of data processing during the rendering process. This ensures the realism of the rendering while improving rendering efficiency.

[0011] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0012] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of this disclosure and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 A flowchart illustrating a rendering method provided in an embodiment of this disclosure; Figure 2 A schematic diagram illustrating the effect of rendering two-dimensional rendering information onto a volumetric cloud model before height modulation, as provided in an embodiment of this disclosure. Figure 3 This is one of the schematic diagrams illustrating the effect of the height modulation process provided in the embodiments of this disclosure; Figure 4 This is the second schematic diagram illustrating the effect of the height modulation process provided in the embodiments of this disclosure; Figure 5 One of the schematic diagrams illustrating the effect of rendering three-dimensional rendering information onto a volumetric cloud model after height modulation, as provided in the embodiments of this disclosure; Figure 6 The second schematic diagram illustrates the effect of rendering three-dimensional rendering information onto a volumetric cloud model after height modulation, as provided in the embodiments of this disclosure. Figure 7This is a schematic diagram of shadow offset provided for an embodiment of the present disclosure; Figure 8 This is a schematic diagram of the volumetric cloud rendering effect provided in the embodiments of this disclosure; Figure 9 This is a schematic diagram of the structure of a rendering apparatus provided in an embodiment of the present disclosure; Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0014] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. The components of the embodiments of this disclosure described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but merely represents selected embodiments of this disclosure. Based on the embodiments of this disclosure, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this disclosure.

[0015] First, the technical background of this disclosure will be introduced: In fields requiring highly immersive visual experiences, such as games, simulations, and film previews, rendering models within a scene is necessary during the design process. For example, this could involve rendering a large cloud formation in a game scene. Specifically, this can be achieved by first determining the target model to be rendered, then using pixel shaders to color the corresponding pixels within that model, thereby vividly representing the image of the virtual element.

[0016] In related technologies, particle systems can be used to render the target model. Specifically, a large number of textured two-dimensional blocks (Billboard) or simple geometric particles are manually placed by artists or procedurally generated to simulate clouds. The shape of the cloud sea is represented by controlling parameters such as particle position, size, and transparency.

[0017] However, rendering schemes for particle systems are essentially discrete stacks of planar fragments, making it difficult to represent the continuous, fluffy, three-dimensional volume of clouds. When the number of particles is insufficient for dense coverage, the edges and internal gaps of the cloud body will reveal obvious flatness, resulting in poor volume representation of the target model being rendered. Particle movement is usually limited to simple translation, rotation, or size changes, making it difficult to simulate the complex continuous dynamic behavior of the target model (taking a volumetric cloud sea as an example), such as natural flow, merging and dissipation, and turbulent undulations. To achieve dense coverage and reduce the flatness, a large number of particles are usually stacked. This leads to multiple particles overlapping and overdrawing in the same pixel area of ​​the screen, causing a surge in the number of pixel shader executions, consuming a large amount of fill rate and bandwidth. The performance overhead increases linearly with the number of particles, limiting expressiveness and making it difficult to produce complex lighting changes (such as volumetric self-shadowing) and subtle shape changes, resulting in poor rendering realism and efficiency.

[0018] Based on this, the target model can be rendered using a volumetric ray-marching approach. Specifically, in the pixel shader, ray-marching is performed along the view ray direction. At each step, 3D noise textures (such as Perlin or Worley noise) or multiple layers of 2D / 3D noise are sampled to obtain the "density" value of the current sampling point. By accumulating density and performing lighting calculations (often including secondary lighting step-by-step calculations of self-shadows), the scattering and absorption of light within the cloud are simulated, ultimately synthesizing the pixel color.

[0019] However, 3D noise textures (especially high-resolution ones) consume a significant amount of video memory. Sampling on the GPU is computationally much more expensive than sampling 2D textures, meaning higher memory access latency and computational cost. Extensive sampling of 3D textures in the main loop is one of the main performance bottlenecks. Furthermore, 3D noise typically requires pre-baking, and re-baking is necessary after artists adjust parameters (such as shape and scale), resulting in a cumbersome workflow, high iteration costs, and limited customization flexibility. To achieve realistic light absorption (i.e., self-shadowing and light attenuation), a secondary step needs to be initiated along the lighting direction for each step of the main ray. In each step of the secondary loop, multiple superimposed 3D / 2D noise samples are also required to calculate occlusion. This leads to a dramatic increase in computational complexity from O(N) (N steps in the main loop) to O(N*(1+M)) (N steps in the main loop + N steps in the main loop * M steps of the lighting direction), becoming the primary bottleneck in performance overhead and severely impacting real-time performance. To simulate the dynamic flow of the target model to be rendered (taking a volumetric cloud as an example), it is usually necessary to perform UV animation (translation, rotation, scaling) on ​​multiple noise maps with different directions and speeds, and then sample these noise maps in each step of the main loop and superimpose / blend the results. Each additional layer of dynamic noise means one or more additional sampling and computational overheads in the main loop. The overhead of multi-layer superposition increases significantly, and the dynamic effect and performance overhead are highly contradictory. Nested self-shadow calculation, multi-layer dynamic noise superposition, and other factors together lead to excessive performance overhead in traditional high-quality volumetric Raymarching, making it extremely difficult to maintain high frame rate real-time rendering on complex scenes and mainstream hardware devices, such as mobile devices or low-to-mid-range PCs, thus affecting rendering efficiency.

[0020] Based on this, the present disclosure provides a rendering method to reduce the amount of data processing during the rendering process, thereby improving rendering efficiency while ensuring the realism of the rendering.

[0021] Please see Figure 1 , Figure 1 This is a flowchart illustrating a rendering method provided in an embodiment of this disclosure. Figure 1 As shown in the embodiments of this disclosure, the rendering method includes: S101. Perform step sampling on the target model to be rendered according to the preset viewing direction, and determine the target sampling point corresponding to the current step.

[0022] S102. For the target sampling point, read the rendering information corresponding to the target sampling point from the pre-created two-dimensional rendering target.

[0023] S103. The rendering information is height modulated according to a preset height distribution function to obtain target rendering information, and the rendering result of the current step for the target model to be rendered is determined based on the target rendering information.

[0024] S104. Update the cumulative rendering result in the preset viewing direction based on the target rendering information.

[0025] S105. In response to the cumulative rendering result satisfying the preset rendering end condition, the target rendering model that has been rendered is obtained.

[0026] The rendering method provided in this embodiment stores the rendering information corresponding to each sampling point in a two-dimensional rendering target, reads the rendering information in the two-dimensional rendering target during the rendering process, and restores the three-dimensional effect through height modulation. This reduces the steps of reading multiple three-dimensional noise information multiple times, thereby reducing the amount of data processing during the rendering process. It can improve rendering efficiency while ensuring the realism of the rendering.

[0027] The exemplary steps of the embodiments of this disclosure are described below: S101. Perform step sampling on the target model to be rendered according to the preset viewing direction, and determine the target sampling point corresponding to the current step.

[0028] In fields requiring highly immersive visual experiences, such as games, simulations, and film previews, the design process necessitates rendering models within the scene. For example, this could involve rendering a large cloud formation in a game scene. Specifically, this can be achieved by first determining the target model to be rendered, then using pixel shaders to color the corresponding pixels within that model, thereby vividly representing the virtual element's image.

[0029] In related technologies, a volumetric ray-marching approach can be used to perform pixel shading on the target model to be rendered. Specifically, in the pixel shader, ray-marching is performed along the view ray direction. At each step, 3D noise textures (such as Perlin or Worley noise) or multiple layers of 2D / 3D noise are sampled to obtain the "density" value of the current sampling point. By accumulating density and performing lighting calculations (often including secondary lighting step-by-step calculations of self-shadows), the scattering and absorption of light within the cloud are simulated, ultimately synthesizing the pixel color.

[0030] However, 3D noise textures, especially high-resolution 3D texture maps, consume a significant amount of video memory. Sampling on the Graphics Processing Unit (GPU) is computationally much more expensive than sampling 2D textures. Furthermore, 3D noise typically requires pre-baking, and re-baking is necessary after artists adjust parameters, resulting in a cumbersome workflow, high iteration costs, and limited flexibility in customizing effects. If realistically simulating the dynamic form of the object to be rendered is required, even more 3D noise textures need to be layered, leading to a large amount of GPU data processing and consequently impacting rendering efficiency.

[0031] Based on this, in this embodiment of the disclosure, by storing the rendering information corresponding to each sampling point in a two-dimensional rendering target, reading the rendering information in the two-dimensional rendering target during the rendering process, and restoring the three-dimensional effect through height modulation, the amount of data processing during the rendering process can be reduced, and the rendering efficiency can be improved while ensuring the realism of the rendering.

[0032] In one alternative implementation, during the rendering of the target model by the pixel shader, the volumetric raymarching scheme is still followed, and the target sampling points on the target model to be rendered are determined along the line of sight according to a preset sampling interval. The rendering information of the target sampling points is then determined from the pre-created two-dimensional rendering target.

[0033] S102. For the target sampling point, read the rendering information corresponding to the target sampling point from the pre-created two-dimensional rendering target.

[0034] In this embodiment of the disclosure, in order to ensure that the rendering information corresponding to the target sampling point is accurately determined, it is necessary to accurately construct the two-dimensional rendering target. The rendering process of the two-dimensional rendering target will be described below.

[0035] Specifically, the rendering method further includes: a1: Determine at least one sampling point located on the target model to be rendered.

[0036] a2: For each sampling point, based on the rendering effect information of the target model to be rendered at the sampling point, determine the main body rendering information and offset rendering information corresponding to the sampling point.

[0037] a3: After storing the main rendering information and offset rendering information corresponding to all sampling points into the corresponding positions in the pre-constructed initial two-dimensional rendering target, the two-dimensional rendering target is obtained.

[0038] The rendering effect information may include at least one of the following: model rotation information, flow direction, velocity vector, and lighting direction.

[0039] In this embodiment of the disclosure, when the pixel shader performs pixel shading processing on the target model to be rendered according to the volume raymarching scheme, the rendering information along the viewing direction can be the main body rendering information. In order to display the rendered effect, for example, to achieve a realistic light absorption (i.e., self-shadowing, light attenuation) effect, in the process of stepping according to the viewing direction, it is also necessary to start a secondary step according to the set lighting direction. The rendering information on this secondary step can be determined as offset rendering information.

[0040] In one optional implementation, at least one sampling point on the target model to be rendered is determined by performing pixel shading processing on the target model to be rendered in the pixel shader according to the volume Raymarching scheme, based on the preset sampling distance interval information, determining the precise mathematical intersection between the preset line of sight and all objects (spheres, triangles, etc.) in the scene, finding the nearest intersection point, and determining it as the sampling point. For different target models to be rendered, the sampling distance interval information is different, and the number of sampling points is also different.

[0041] Here, a Signed Distance Field (SDF) function can be preset to determine the preset sampling distance interval information based on the volume of the target model to be rendered.

[0042] In one alternative implementation, during the rendering process, the model rotation information, flow direction, and velocity vector of the target model at the sampling point can be determined according to the rendering requirements and rendering effect. Therefore, the main rendering information can be determined based on the determined model rotation information, flow direction, and velocity vector.

[0043] Specifically, for each sampling point, the main rendering information corresponding to the sampling point is determined through the following steps: b1: For each sampling point, based on the rendering effect information of the target model to be rendered on the sampling point, determine the two-dimensional noise map corresponding to the sampling point.

[0044] b2: Perform UV transformation and blending on the two-dimensional noise map corresponding to the sampling point to obtain the main body rendering information corresponding to the sampling point.

[0045] In one alternative implementation, for each sampling point, a two-dimensional noise map can be determined based on the model rotation information, flow direction, and velocity vector of the sampling space corresponding to the sampling point.

[0046] Furthermore, UV transformation and blending can be performed based on the obtained 2D sampled texture, and the blended dynamic noise result can be determined as the main rendering information corresponding to the sampling point.

[0047] Here, the mixed dynamic noise result characterizes the dynamic flow and basic density fluctuations at the sampling point.

[0048] In one alternative implementation, UV coordinates, typically ranging from [0, 1], define how a 2D texture map is mapped onto the surface of a 3D model. UV transformation uses mathematical operations to change these coordinates, thereby achieving translation, rotation, and scaling of the texture; here, the mathematical operations can be matrix operations. UV blending refers to merging multiple textures together according to different rules and weights to form a final output color, that is, the pixel color information that the pixel shader colors for that sample point. Through UV transformation and blending, the main rendering information corresponding to each sample point can be determined.

[0049] Furthermore, as mentioned earlier, in order to ensure the realistic effect of the rendering, it is also necessary to start a secondary step according to the set lighting direction. The rendering information in this secondary step can be determined as offset rendering information. Specifically, it can be determined according to the preset lighting direction to obtain the corresponding offset rendering information.

[0050] Specifically, for each sampling point, the offset rendering information corresponding to the sampling point is determined through the following steps: c1: For each sampling point, based on the rendering effect information and the height distribution of the target model to be rendered, the main body rendering information is offset sampled in two dimensions along the lighting direction indicated by the rendering effect information to obtain the simulated shadow intensity, and the simulated shadow intensity is determined as the offset rendering information corresponding to the sampling point.

[0051] Here, the offset rendering information corresponding to the sampling point can be determined by calculating the lighting direction and the model's rotation vector in the rendering effect information, combined with the height distribution.

[0052] In one alternative implementation, the determined subject rendering information can be sampled in two dimensions along the lighting direction based on the lighting direction, the model's rotation vector, and the model's height distribution to obtain simulated shadow intensity, and the simulated shadow intensity can be determined as the offset rendering information corresponding to the sampling point.

[0053] Here, the rotation vector of the model represents the orientation of the real-world scene space.

[0054] The height distribution of the model affects the offset of the two-dimensional offset sampling. The height distribution of the model is determined based on the preset height distribution function and the relative height position of the sampling point in the target model to be rendered. The preset height distribution function is used to characterize the density distribution pattern of the target model to be rendered within the local height range of the sampling space corresponding to the target sampling point. It can be used to perform height modulation by using the preset height distribution function and the relative height position of the sampling point inside the target model to be rendered.

[0055] Here, for different sampling points, since the corresponding model height distribution may be different, the offset used when performing two-dimensional offset sampling may be different when determining the offset rendering information at each sampling point.

[0056] In one alternative implementation, occlusion information caused by the thickness of the target model when light passes through it is simulated by two-dimensional offset sampling. For example, taking the target model to be rendered as a volumetric cloud, the occlusion information caused by light passing through cloud layers of different thicknesses can be simulated by two-dimensional offset sampling.

[0057] Furthermore, after determining the main rendering information and offset rendering information for each sampling point, the sampling points can be divided, and the main rendering information and offset rendering information for each sampling point can be stored in the corresponding position in the pre-constructed initial two-dimensional rendering target to obtain the two-dimensional rendering target.

[0058] In one optional implementation, taking a two-dimensional image as the two-dimensional rendering target, each sampling point corresponds to each pixel in the two-dimensional image, and the main rendering information and offset rendering information corresponding to each sampling point are stored in different channels of each pixel. The color of each pixel represents the main rendering information and offset rendering information corresponding to each sampling point.

[0059] Specifically, for each sampling point, the step "storing the main rendering information and offset rendering information corresponding to the sampling point to the corresponding position in the pre-constructed initial two-dimensional rendering target" includes: d1: For each sampling point, store the subject rendering information corresponding to the sampling point into the first target channel of the pixel corresponding to the sampling point in the two-dimensional image.

[0060] d2: Store the offset rendering information corresponding to the sampling point into the second target channel of the pixel corresponding to the sampling point in the two-dimensional image.

[0061] In one optional implementation, for each sampling point, the main rendering information corresponding to the sampling point can be converted into a pixel value in the range of [0, 255], and then the converted pixel value is stored in the first target channel.

[0062] Specifically, the first target channel can be the R / G channel of the pixel corresponding to the sampling point.

[0063] In another optional implementation, for each sampling point, the offset rendering information corresponding to the sampling point can be converted into a pixel value in the range of [0, 255], and then the pixel value converted from the offset rendering information can be stored in the second target channel.

[0064] Specifically, the second target channel can be the B / A channel of the pixel corresponding to the sampling point.

[0065] For example, there are currently two sampling points A and B. The two-dimensional image can be a two-image with one row and two columns. The main rendering information of sampling point A is stored in the R channel of the pixels in the first row and first column, and the main rendering information of sampling point A is stored in the B channel of the pixels in the first row and first column. The main rendering information of sampling point B is stored in the R channel of the pixels in the first row and second column, and the main rendering information of sampling point B is stored in the B channel of the pixels in the first row and second column.

[0066] Furthermore, taking a two-dimensional image as the two-dimensional rendering target, after determining the constructed two-dimensional rendering target, the target pixel of the current target sampling point in the two-dimensional image can be determined, and the rendering information corresponding to the target sampling point can be determined according to the pixel values ​​of different color channels of the target pixel. Here, the rendering information can include the main rendering information and offset rendering information of the target sampling point.

[0067] Furthermore, since the determined rendering information is in the form of two-dimensional rendering information, in order to ensure the realistic rendering effect of the target model to be rendered, the rendering information needs to be highly modulated. By highly modulating, the density information and shadow distribution information in the vertical direction are reshaped, and then the shape and light absorption (self-shadow) effect of the target model to be rendered with a three-dimensional feel are reconstructed from the two-dimensional rendering information to ensure the realistic rendering effect.

[0068] S103. The rendering information is height modulated according to a preset height distribution function to obtain target rendering information, and the rendering result of the current step for the target model to be rendered is determined based on the target rendering information.

[0069] In one alternative implementation, the height modulation of the rendering information is the modulation of the two-dimensional rendering information in the vertical direction to adjust the rendering density, thereby achieving a three-dimensional shape and light absorption (self-shadow) effect of the target model to be rendered, ensuring a realistic rendering effect.

[0070] Specifically, the step "modulating the rendering information according to a preset height distribution function to obtain target rendering information" includes: e1: Based on the relative height position of the target sampling point in the target model to be rendered, the rendering information is adjusted in the vertical direction of the target model to be rendered according to a preset height distribution function to obtain the target rendering information.

[0071] Here, as mentioned earlier, the height modulation of rendering information is the modulation of density and shadow distribution information. The adjustment process of density information and shadow distribution information will be described below.

[0072] In an optional implementation, when the target rendering information includes density information, the step "adjusting the rendering information in the vertical direction of the target model to be rendered to obtain the target rendering information" includes: f1: Normalize the coordinates of each pixel in the target model to be rendered. Based on the normalized coordinates of each pixel in the target model to be rendered, fit the normalized coordinates of each pixel in the target model to be rendered to obtain the density change information of the target model to be rendered in the vertical height.

[0073] f2: Multiply the rendering information with the density change information corresponding to the target sampling point to obtain the target rendering information.

[0074] In one optional implementation, since the determined 2D rendering information lacks the density information in the vertical direction represented by the 3D noise map, directly replacing the 3D texture map in the Raymarching scheme with the 2D rendering information cannot reflect the volume of the target model to be rendered, resulting in poor rendering effect. The coordinates of each pixel in the target model to be rendered are normalized. Based on the normalized coordinates of each pixel in the target model to be rendered, the normalized coordinates of each pixel in the target model to be rendered are fitted to obtain the density change information of the target model in the vertical height, simulate the density change of the target model in the vertical direction, and multiply the density change information with the corresponding 2D rendering information to obtain the corresponding 3D target rendering information.

[0075] Here, density change information reflects the density change of the target model to be rendered in the vertical direction. For example, taking the target model to be rendered as a volumetric cloud sea, density change information can indicate that the cloud density of the volumetric cloud sea gradually decreases from low to high in the vertical direction.

[0076] Specifically, the density information change processing can be implemented using the following code information: / / pos is the normalized coordinate of each pixel in the volume; noise is the sampling result of the 2D texture; float GetHeightModifiedSample(float3 pos, float noise) { float z_term = pow(pos.z, heightGradient); / / z_term can also be replaced with a custom curve. / / float z_term = sample(custom_curve, pos.z); return saturate(noise * z_term); }; In one alternative implementation, after rendering the target model based on the two-dimensional rendering information, the density of the target model may be uniform from top to bottom, making it impossible to reflect density change information. After multiplying the density change information with the two-dimensional rendering information, the density change of the target model from top to bottom can be reflected, thereby obtaining a more realistic rendering effect.

[0077] For example, please refer to Figures 2 to 6 Taking the target model to be rendered as a volumetric cloud sea as an example, Figure 2 This is a schematic diagram illustrating the effect of rendering two-dimensional rendering information onto a volumetric cloud model before height modulation, as provided in an embodiment of this disclosure. Figure 3 This is one of the schematic diagrams illustrating the effect of the height modulation process provided in the embodiments of this disclosure; Figure 4 This is the second schematic diagram illustrating the effect of the height modulation process provided in the embodiments of this disclosure; Figure 5 One of the schematic diagrams illustrating the effect of rendering three-dimensional rendering information onto a volumetric cloud model after height modulation, as provided in the embodiments of this disclosure; Figure 6 This is the second schematic diagram illustrating the effect of rendering 3D rendering information onto a volumetric cloud model after height modulation, as provided in the embodiments of this disclosure; Figure 2 As shown, when the 2D rendering information is rendered to the volumetric cloud model before height modulation, the volumetric cloud distribution is relatively uniform. After such... Figure 3 as well as Figure 4After high modulation, such as Figure 5 As shown, the density of the volumetric cloud sea is compared to Figure 2 The density changes from top to bottom to different values, such as... Figure 6 As shown, the density of the volumetric cloud sea is compared to Figure 2 The density is relatively low, and a more realistic effect is achieved through high-level modulation.

[0078] In another optional implementation, when the target rendering information includes shadow distribution information, the step "adjusting the rendering information in the vertical direction of the target model to be rendered to obtain the target rendering information" includes: g1: The rendering information is height modulated according to a preset height distribution function to obtain the main rendering volume and the offset rendering volume.

[0079] g2: The overlapping part of the main rendering volume and the offset rendering volume is determined as the shadow part, and the shadow distribution information is determined based on the location of the shadow part.

[0080] In one optional implementation, when modulating the rendering information according to a preset height distribution function for the same sampling position, the main rendering information and the offset rendering information are modulated separately. Therefore, after the modulation is completed, the main rendering volume before offset and the offset rendering volume after offset according to the lighting direction are obtained. The overlapping part of the main rendering volume and the offset rendering volume is determined as the shadow part, and then the shadow distribution information is determined based on the shadow part.

[0081] For example, please refer to Figure 7 , Figure 7 This is a schematic diagram of shadow offset provided for an embodiment of the present disclosure, such as... Figure 7 As shown, there is an overlap 730 between the main rendering volume 710 and the offset rendering volume 720, and the overlap 730 is the shadow area.

[0082] In one alternative implementation, for the same sampling point, there may be multiple layers of 2D rendering information, and each layer of rendering information may be determined by different scaling factors. Therefore, in order to ensure the rendering effect, additional processing is required during the height modulation process for multiple layers of rendering information.

[0083] Specifically, when the rendering information includes multi-layer rendering information, the step "modulating the rendering information according to a preset height distribution function to obtain target rendering information" includes: h1: According to the preset height distribution function, the multi-layer rendering information is layered and mixed to obtain the target rendering information.

[0084] In this embodiment of the disclosure, for multi-layer rendering information with multiple layers of detail, layer-by-layer mixing processing can be performed after height modulation to obtain more accurate target rendering information.

[0085] Furthermore, after determining the target rendering information, the sampling space corresponding to the target sampling point can be rendered according to the target rendering information. The rendering result of the current step for the target model to be rendered can be determined based on the target rendering information, and the cumulative rendering result in the preset viewing direction can be updated according to the rendering result of the current step.

[0086] S104. Update the cumulative rendering result in the preset viewing direction based on the target rendering information.

[0087] In this embodiment of the disclosure, the cumulative rendering result at the current step sampling point can be determined based on the target rendering information of the current step sampling point. For example, the rendering color, transparency, etc. are accumulated with the rendering color, transparency, etc. of the sampling points that have been processed in the preset viewing direction, and the cumulative rendering result in the preset viewing direction is updated.

[0088] In one alternative implementation, the rendering process for the target model to be rendered can be determined based on the cumulative rendering results, thereby obtaining the rendered target model.

[0089] S105. In response to the cumulative rendering result satisfying the preset rendering end condition, the target rendering model that has been rendered is obtained.

[0090] In this embodiment of the disclosure, during the process of the pixel shader shading the target model to be rendered according to the Raymarching algorithm, it is necessary to determine the contribution of the density of the current sampling point to the physical properties such as light absorption and scattering for each step, that is, to accumulate the rendering results. If it is determined that the accumulated effect reaches a certain level, it will be combined with the rendering process to obtain the rendered target model.

[0091] Specifically, the step "in response to the cumulative rendering result satisfying the preset rendering end condition, obtaining the rendered target rendering model" includes: i1: In response to the cumulative density of the cumulative rendering result being greater than a preset cumulative density threshold, the target rendering model that has been rendered is obtained.

[0092] In one alternative implementation, if the cumulative density is determined to be greater than a preset cumulative density threshold based on the cumulative information of the target sampling points, it is determined that no further steps are needed, rendering is completed, and the rendered target rendering model is obtained.

[0093] For example, the target rendering model can be a target volume cloud.

[0094] The preset cumulative density threshold can be determined based on the model volume of the target model to be rendered and the rendering requirements, and no specific restrictions are imposed here.

[0095] Here, a cumulative density greater than a preset cumulative density threshold can also be used to determine that the target model to be rendered is opaque. That is, after determining that the target model to be rendered is opaque, it is determined that no further steps are needed, rendering is completed, and the rendered target model is obtained.

[0096] In another optional implementation, if the cumulative density is determined to be less than the preset cumulative density threshold based on the cumulative information of the target sampling point, that is, it is in a low density area, then it is necessary to continue to step, determine the next sampling point, and continue to execute the rendering process according to the above process until the cumulative density at a certain sampling point is greater than the preset cumulative density threshold. At this point, it is determined that there is no need to continue stepping, the rendering is completed, and the rendered target rendering model is obtained.

[0097] For example, please refer to Figure 8 , Figure 8 This is a schematic diagram of the volumetric cloud rendering effect provided in the embodiments of this disclosure, such as... Figure 8 As shown, the rendered volumetric cloud sea has a strong sense of volume and rich dynamic effects such as flow and undulation, achieving a realistic effect.

[0098] In this embodiment of the disclosure, by mixing high-overhead dynamic noise and pre-computing self-shadow calculations and baking them to the 2D rendering target, combined with innovative height distribution function modulation based on local height position, only one sampling from the pre-built 2D rendering target texture is required within the Raymarching main loop to obtain a dynamic, three-dimensional complex volumetric cloud effect with self-shadow hierarchy that is close to that obtained by multiple nested samplings in traditional schemes, thereby improving rendering efficiency.

[0099] For example, taking 64 density steps, 32 main light step steps, and 16 ambient light step steps as an example, the traditional Raymarching scheme requires sampling 643 + 64323 + 64163 times, totaling 15552 3D textures. In contrast, the scheme in the application embodiment only requires sampling 4 + 641 and 64*1 times, totaling 68 samplings of 2D textures and 64 samplings of 3D textures. Therefore, compared to the traditional Raymarching scheme, the computational load, memory, and bandwidth costs are significantly reduced, while maintaining rich visual effects and dynamic expressiveness.

[0100] The rendering method provided in this embodiment performs step sampling on the target model to be rendered according to a preset viewing direction to determine the target sampling point corresponding to the current step. For the target sampling point, the rendering information corresponding to the target sampling point is read from a pre-created two-dimensional rendering target. The rendering information is height modulated according to a preset height distribution function to obtain target rendering information, and the rendering result of the current step for the target model to be rendered is determined based on the target rendering information. The cumulative rendering result in the preset viewing direction is updated based on the target rendering information. In response to the cumulative rendering result satisfying the preset rendering termination condition, the rendered target model is obtained. In this way, by storing the rendering information corresponding to each sampling point in the two-dimensional rendering target, reading the rendering information in the two-dimensional rendering target during the rendering process, and restoring the three-dimensional effect through height modulation, the steps of reading multiple three-dimensional noise information are reduced, thereby reducing the amount of data processing during the rendering process. This improves rendering efficiency while ensuring the realism of the rendering.

[0101] Based on the same inventive concept, this disclosure also provides a rendering device corresponding to the rendering method. Since the principle of the device in this disclosure for solving the problem is similar to the rendering method described above, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0102] Please see Figure 9 , Figure 9 This is a schematic diagram of the structure of a rendering apparatus provided in an embodiment of this disclosure. Figure 9 As shown, the rendering apparatus 900 includes: The sampling point determination module 910 is used to perform step sampling on the target model to be rendered according to the preset viewing direction, and determine the target sampling point corresponding to the current step. The rendering information reading module 920 is used to read the rendering information corresponding to the target sampling point from a pre-created two-dimensional rendering target for the target sampling point; The height modulation module 930 is used to perform height modulation on the rendering information according to a preset height distribution function to obtain target rendering information, and to determine the rendering result of the current step for the target model to be rendered based on the target rendering information; The rendering result update module 940 is used to update the cumulative rendering result in the preset viewing direction based on the target rendering information; The model rendering module 950 is used to obtain the target rendering model after rendering is completed in response to the cumulative rendering result meeting the preset rendering end condition.

[0103] In an optional embodiment, the rendering apparatus 900 further includes a two-dimensional rendering target construction module (not shown in the figure), the two-dimensional rendering target construction module being used for: Determine at least one sampling point located on the target model to be rendered; For each sampling point, based on the rendering effect information of the target model to be rendered at the sampling point, the main body rendering information and offset rendering information corresponding to the sampling point are determined; After storing the main rendering information and offset rendering information corresponding to all sampling points into the corresponding positions in the pre-constructed initial two-dimensional rendering target, the two-dimensional rendering target is obtained.

[0104] In one optional implementation, for each sampling point, the 2D rendering target construction module is used to determine the main rendering information corresponding to the sampling point through the following steps: For each sampling point, based on the rendering effect information of the target model to be rendered at the sampling point, the corresponding two-dimensional noise map is determined; The two-dimensional noise map corresponding to the sampling point is subjected to UV transformation and blending to obtain the main body rendering information corresponding to the sampling point.

[0105] In one optional implementation, for each sampling point, the 2D rendering target construction module determines the offset rendering information corresponding to that sampling point through the following steps: For each sampling point, based on the rendering effect information and the height distribution of the target model to be rendered, the main body rendering information is offset sampled in two dimensions along the lighting direction indicated by the rendering effect information to obtain the simulated shadow intensity, and the simulated shadow intensity is determined as the offset rendering information corresponding to the sampling point; The height distribution of the model affects the offset of the two-dimensional offset sampling. The height distribution of the model is determined based on the preset height distribution function and the relative height position of the sampling point in the target model to be rendered.

[0106] In an optional implementation, when the height modulation module 930 is used to perform height modulation on the rendering information according to a preset height distribution function to obtain target rendering information, the height modulation module 930 is used to: Based on the relative height position of the target sampling point in the target model to be rendered, the rendering information is adjusted in the vertical direction of the target model to be rendered according to a preset height distribution function to obtain the target rendering information.

[0107] In an optional implementation, when the target rendering information includes density information, the height modulation module 930, when adjusting the rendering information in the vertical direction of the target model to be rendered to obtain the target rendering information, is used to: The coordinates of each pixel in the target model to be rendered are normalized. Based on the normalized coordinates of each pixel in the target model to be rendered, the normalized coordinates of each pixel in the target model to be rendered are fitted to obtain the density change information of the target model to be rendered in the vertical height. The target rendering information is obtained by multiplying the rendering information with the density change information corresponding to the target sampling point.

[0108] In an optional implementation, when the target rendering information includes shadow distribution information, the height modulation module 930, when adjusting the rendering information in the vertical direction of the target model to be rendered to obtain the target rendering information, is used to: The rendering information is height modulated according to a preset height distribution function to obtain the main rendering volume and the offset rendering volume; The overlapping portion of the main rendering volume and the offset rendering volume is determined as the shadow portion, and the shadow distribution information is determined based on the location of the shadow portion.

[0109] In an optional implementation, when the rendering information includes multi-layer rendering information, the height modulation module 930, when used to perform height modulation on the rendering information according to a preset height distribution function to obtain target rendering information, is used to: The target rendering information is obtained by layering and mixing the multi-layer rendering information according to the preset height distribution function.

[0110] In an optional implementation, when the two-dimensional rendering target is a two-dimensional image, for each sampling point, the two-dimensional rendering target construction module, when storing the main body rendering information and offset rendering information corresponding to the sampling point into the corresponding position in the pre-constructed initial two-dimensional rendering target, is configured to: For each sampling point, the main rendering information corresponding to the sampling point is stored in the first target channel of the pixel corresponding to the sampling point in the two-dimensional image; The offset rendering information corresponding to the sampling point is stored in the second target channel of the pixel corresponding to the sampling point in the two-dimensional image.

[0111] In an optional implementation, when the model rendering module 950 obtains a rendered target model in response to the cumulative rendering result satisfying a preset rendering end condition, the model rendering module 950 is configured to: In response to the cumulative density of the cumulative rendering result being greater than a preset cumulative density threshold, the target rendering model that has been rendered is obtained.

[0112] In one optional implementation, the preset height distribution function is used to characterize the density distribution pattern of the target model to be rendered within the local height range of the sampling space corresponding to the target sampling point.

[0113] The rendering apparatus provided in this embodiment performs step sampling on the target model to be rendered according to a preset viewing direction to determine the target sampling point corresponding to the current step. For each target sampling point, rendering information corresponding to the target sampling point is read from a pre-created two-dimensional rendering target. The rendering information is height-modulated according to a preset height distribution function to obtain target rendering information, and the rendering result for the target model to be rendered for the current step is determined based on the target rendering information. The cumulative rendering result in the preset viewing direction is updated based on the target rendering information. In response to the cumulative rendering result satisfying a preset rendering termination condition, the rendered target model is obtained. In this way, by storing the rendering information corresponding to each sampling point in a two-dimensional rendering target, reading the rendering information in the two-dimensional rendering target during the rendering process, and restoring the three-dimensional effect through height modulation, the steps of reading multiple three-dimensional noise information are reduced, thereby reducing the amount of data processing during the rendering process. This ensures the realism of the rendering while improving rendering efficiency.

[0114] Please see Figure 10 , Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Figure 10 As shown, the electronic device 1000 includes a processor 1010, a memory 1020, and a bus 1030.

[0115] The memory 1020 stores machine-readable instructions executable by the processor 1010. When the electronic device 1000 is running, the processor 1010 communicates with the memory 1020 via the bus 1030, causing the processor 1010 to execute the following instructions during operation: Perform step sampling on the target model to be rendered according to the preset viewing direction, and determine the target sampling point corresponding to the current step; For the target sampling point, the rendering information corresponding to the target sampling point is read from the pre-created two-dimensional rendering target; The rendering information is height modulated according to a preset height distribution function to obtain target rendering information, and the rendering result of the current step for the target model to be rendered is determined based on the target rendering information. The cumulative rendering result in the preset viewing direction is updated based on the target rendering information; In response to the cumulative rendering result satisfying the preset rendering end condition, the target rendering model that has been rendered is obtained.

[0116] In one optional implementation, the instructions executed by the processor 1010 further include: Determine at least one sampling point located on the target model to be rendered; For each sampling point, based on the rendering effect information of the target model to be rendered at the sampling point, the main body rendering information and offset rendering information corresponding to the sampling point are determined; After storing the main rendering information and offset rendering information corresponding to all sampling points into the corresponding positions in the pre-constructed initial two-dimensional rendering target, the two-dimensional rendering target is obtained.

[0117] In one optional implementation, the instructions executed by the processor 1010 determine the main rendering information corresponding to each sampling point through the following steps: For each sampling point, based on the rendering effect information of the target model to be rendered at the sampling point, the corresponding two-dimensional noise map is determined; The two-dimensional noise map corresponding to the sampling point is subjected to UV transformation and blending to obtain the main body rendering information corresponding to the sampling point.

[0118] In one optional implementation, the instructions executed by the processor 1010 determine the offset rendering information corresponding to each sampling point through the following steps: For each sampling point, based on the rendering effect information and the height distribution of the target model to be rendered, the main body rendering information is offset sampled in two dimensions along the lighting direction indicated by the rendering effect information to obtain the simulated shadow intensity, and the simulated shadow intensity is determined as the offset rendering information corresponding to the sampling point; The height distribution of the model affects the offset of the two-dimensional offset sampling. The height distribution of the model is determined based on the preset height distribution function and the relative height position of the sampling point in the target model to be rendered.

[0119] In one optional implementation, the instructions executed by the processor 1010, wherein the step of height-modulating the rendering information according to a preset height distribution function to obtain target rendering information, includes: Based on the relative height position of the target sampling point in the target model to be rendered, the rendering information is adjusted in the vertical direction of the target model to be rendered according to a preset height distribution function to obtain the target rendering information.

[0120] In one optional implementation, when the target rendering information includes density information, the step of adjusting the rendering information in the vertical direction of the target model to be rendered to obtain the target rendering information includes: The coordinates of each pixel in the target model to be rendered are normalized. Based on the normalized coordinates of each pixel in the target model to be rendered, the normalized coordinates of each pixel in the target model to be rendered are fitted to obtain the density change information of the target model to be rendered in the vertical height. The target rendering information is obtained by multiplying the rendering information with the density change information corresponding to the target sampling point.

[0121] In one optional implementation, when the target rendering information includes shadow distribution information, the step of adjusting the rendering information in the vertical direction of the target model to be rendered to obtain the target rendering information includes: The rendering information is height modulated according to a preset height distribution function to obtain the main rendering volume and the offset rendering volume; The overlapping portion of the main rendering volume and the offset rendering volume is determined as the shadow portion, and the shadow distribution information is determined based on the location of the shadow portion.

[0122] In one optional implementation, when the rendering information includes multi-layer rendering information, the step of height-modulating the rendering information according to a preset height distribution function to obtain target rendering information includes: The target rendering information is obtained by layering and mixing the multi-layer rendering information according to the preset height distribution function.

[0123] In one optional implementation, when the two-dimensional rendering target is a two-dimensional image, the instruction executed by the processor 1010, for each sampling point, includes storing the main rendering information and offset rendering information corresponding to the sampling point into the corresponding position in the pre-constructed initial two-dimensional rendering target, comprising: For each sampling point, the main rendering information corresponding to the sampling point is stored in the first target channel of the pixel corresponding to the sampling point in the two-dimensional image; The offset rendering information corresponding to the sampling point is stored in the second target channel of the pixel corresponding to the sampling point in the two-dimensional image.

[0124] In one optional implementation, the instruction executed by the processor 1010, in response to the cumulative rendering result satisfying a preset rendering end condition, to obtain the rendered target rendering model, includes: In response to the cumulative density of the cumulative rendering result being greater than a preset cumulative density threshold, the target rendering model that has been rendered is obtained.

[0125] In one optional implementation, the preset height distribution function is used to characterize the density distribution pattern of the target model to be rendered within the local height range of the sampling space corresponding to the target sampling point.

[0126] By storing the rendering information corresponding to each sampling point in a 2D rendering target and reading the rendering information from the 2D rendering target during the rendering process, and restoring the 3D effect through height modulation, the steps of reading multiple 3D noise information are reduced, thereby reducing the amount of data processing during the rendering process. This ensures the realism of the rendering while improving rendering efficiency. At the same time, by reshaping the density information and shadow distribution information in the vertical direction through height modulation, the shape and light absorption (self-shadow) effect of the target model to be rendered with a sense of three-dimensionality can be reconstructed from the 2D rendering information, ensuring the realism of the rendering effect. In addition, for the same sampling point, there may be multiple layers of 2D rendering information, and each layer of rendering information may be determined by different scaling factors. Therefore, in order to ensure the rendering effect, additional processing is required for multiple layers of rendering information during height modulation.

[0127] This disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the following instructions: Perform step sampling on the target model to be rendered according to the preset viewing direction, and determine the target sampling point corresponding to the current step; For the target sampling point, the rendering information corresponding to the target sampling point is read from the pre-created two-dimensional rendering target; The rendering information is height modulated according to a preset height distribution function to obtain target rendering information, and the rendering result of the current step for the target model to be rendered is determined based on the target rendering information. The cumulative rendering result in the preset viewing direction is updated based on the target rendering information; In response to the cumulative rendering result satisfying the preset rendering end condition, the target rendering model that has been rendered is obtained.

[0128] In one optional implementation, the instructions executed by the computer-readable storage medium further include: Determine at least one sampling point located on the target model to be rendered; For each sampling point, based on the rendering effect information of the target model to be rendered at the sampling point, the main body rendering information and offset rendering information corresponding to the sampling point are determined; After storing the main rendering information and offset rendering information corresponding to all sampling points into the corresponding positions in the pre-constructed initial two-dimensional rendering target, the two-dimensional rendering target is obtained.

[0129] In one optional implementation, the instructions executed by the computer-readable storage medium determine the main rendering information corresponding to each sampling point through the following steps: For each sampling point, based on the rendering effect information of the target model to be rendered at the sampling point, the corresponding two-dimensional noise map is determined; The two-dimensional noise map corresponding to the sampling point is subjected to UV transformation and blending to obtain the main body rendering information corresponding to the sampling point.

[0130] In one optional implementation, the instructions executed by the computer-readable storage medium determine the offset rendering information corresponding to each sampling point through the following steps: For each sampling point, based on the rendering effect information and the height distribution of the target model to be rendered, the main body rendering information is offset sampled in two dimensions along the lighting direction indicated by the rendering effect information to obtain the simulated shadow intensity, and the simulated shadow intensity is determined as the offset rendering information corresponding to the sampling point; The height distribution of the model affects the offset of the two-dimensional offset sampling. The height distribution of the model is determined based on the preset height distribution function and the relative height position of the sampling point in the target model to be rendered.

[0131] In one optional implementation, the instructions executed by the computer-readable storage medium, wherein the step of height-modulating the rendering information according to a preset height distribution function to obtain target rendering information, includes: Based on the relative height position of the target sampling point in the target model to be rendered, the rendering information is adjusted in the vertical direction of the target model to be rendered according to a preset height distribution function to obtain the target rendering information.

[0132] In one optional implementation, in the instructions executable by the computer-readable storage medium, when the target rendering information includes density information, adjusting the rendering information in the vertical direction of the target model to be rendered to obtain the target rendering information includes: The coordinates of each pixel in the target model to be rendered are normalized. Based on the normalized coordinates of each pixel in the target model to be rendered, the normalized coordinates of each pixel in the target model to be rendered are fitted to obtain the density change information of the target model to be rendered in the vertical height. The target rendering information is obtained by multiplying the rendering information with the density change information corresponding to the target sampling point.

[0133] In one optional implementation, in the instructions executable by the computer-readable storage medium, when the target rendering information includes shadow distribution information, adjusting the rendering information in the vertical direction of the target model to be rendered to obtain the target rendering information includes: The rendering information is height modulated according to a preset height distribution function to obtain the main rendering volume and the offset rendering volume; The overlapping portion of the main rendering volume and the offset rendering volume is determined as the shadow portion, and the shadow distribution information is determined based on the location of the shadow portion.

[0134] In one optional implementation, in the instructions executable by the computer-readable storage medium, when the rendering information includes multi-layer rendering information, the step of height-modulating the rendering information according to a preset height distribution function to obtain target rendering information includes: The target rendering information is obtained by layering and mixing the multi-layer rendering information according to the preset height distribution function.

[0135] In one optional implementation, in the instructions executed by the computer-readable storage medium, when the two-dimensional rendering target is a two-dimensional image, for each sampling point, storing the main rendering information and offset rendering information corresponding to the sampling point into the corresponding position in the pre-constructed initial two-dimensional rendering target includes: For each sampling point, the main rendering information corresponding to the sampling point is stored in the first target channel of the pixel corresponding to the sampling point in the two-dimensional image; The offset rendering information corresponding to the sampling point is stored in the second target channel of the pixel corresponding to the sampling point in the two-dimensional image.

[0136] In one optional implementation, the instructions executed by the computer-readable storage medium, wherein the step of obtaining the rendered target model in response to the cumulative rendering result satisfying a preset rendering end condition, includes: In response to the cumulative density of the cumulative rendering result being greater than a preset cumulative density threshold, the target rendering model that has been rendered is obtained.

[0137] In one optional implementation, the preset height distribution function is used to characterize the density distribution pattern of the target model to be rendered within the local height range of the sampling space corresponding to the target sampling point.

[0138] By storing the rendering information corresponding to each sampling point in a 2D rendering target and reading the rendering information from the 2D rendering target during the rendering process, and restoring the 3D effect through height modulation, the steps of reading multiple 3D noise information are reduced, thereby reducing the amount of data processing during the rendering process. This ensures the realism of the rendering while improving rendering efficiency. At the same time, by reshaping the density information and shadow distribution information in the vertical direction through height modulation, the shape and light absorption (self-shadow) effect of the target model to be rendered with a sense of three-dimensionality can be reconstructed from the 2D rendering information, ensuring the realism of the rendering effect. In addition, for the same sampling point, there may be multiple layers of 2D rendering information, and each layer of rendering information may be determined by different scaling factors. Therefore, in order to ensure the rendering effect, additional processing is required for multiple layers of rendering information during height modulation.

[0139] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0140] In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0141] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0142] In addition, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0143] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0144] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.

Claims

1. A rendering method, characterized by, The rendering method includes: Perform step sampling on the target model to be rendered according to the preset viewing direction, and determine the target sampling point corresponding to the current step; For the target sampling point, the rendering information corresponding to the target sampling point is read from the pre-created two-dimensional rendering target; The rendering information is height modulated according to a preset height distribution function to obtain target rendering information, and the rendering result of the current step for the target model to be rendered is determined based on the target rendering information. The cumulative rendering result in the preset viewing direction is updated based on the target rendering information; In response to the cumulative rendering result satisfying the preset rendering end condition, the target rendering model that has been rendered is obtained.

2. The rendering method of claim 1, wherein, The rendering method also includes: Determine at least one sampling point located on the target model to be rendered; For each sampling point, based on the rendering effect information of the target model to be rendered at the sampling point, the main body rendering information and offset rendering information corresponding to the sampling point are determined; After storing the main rendering information and offset rendering information corresponding to all sampling points into the corresponding positions in the pre-constructed initial two-dimensional rendering target, the two-dimensional rendering target is obtained.

3. The rendering method according to claim 2, characterized in that, For each sampling point, the main rendering information corresponding to the sampling point is determined through the following steps: For each sampling point, based on the rendering effect information of the target model to be rendered at the sampling point, the corresponding two-dimensional noise map is determined; The two-dimensional noise map corresponding to the sampling point is subjected to UV transformation and blending to obtain the main body rendering information corresponding to the sampling point.

4. The rendering method according to claim 2, characterized in that, For each sampling point, the offset rendering information corresponding to the sampling point is determined through the following steps: For each sampling point, based on the rendering effect information and the height distribution of the target model to be rendered, the main body rendering information is offset sampled in two dimensions along the lighting direction indicated by the rendering effect information to obtain the simulated shadow intensity, and the simulated shadow intensity is determined as the offset rendering information corresponding to the sampling point; The height distribution of the model affects the offset of the two-dimensional offset sampling. The height distribution of the model is determined based on the preset height distribution function and the relative height position of the sampling point in the target model to be rendered.

5. The rendering method according to claim 1, characterized in that, The step of height modulating the rendering information according to a preset height distribution function to obtain target rendering information includes: Based on the relative height position of the target sampling point in the target model to be rendered, the rendering information is adjusted in the vertical direction of the target model to be rendered according to a preset height distribution function to obtain the target rendering information.

6. The rendering method according to claim 5, characterized in that, When the target rendering information includes density information, adjusting the rendering information in the vertical direction of the target model to be rendered to obtain the target rendering information includes: The coordinates of each pixel in the target model to be rendered are normalized. Based on the normalized coordinates of each pixel in the target model to be rendered, the normalized coordinates of each pixel in the target model to be rendered are fitted to obtain the density change information of the target model to be rendered in the vertical height. The target rendering information is obtained by multiplying the rendering information with the density change information corresponding to the target sampling point.

7. The rendering method according to claim 5, characterized in that, When the target rendering information includes shadow distribution information, adjusting the rendering information in the vertical direction of the target model to be rendered to obtain the target rendering information includes: The rendering information is height modulated according to a preset height distribution function to obtain the main rendering volume and the offset rendering volume; The overlapping portion of the main rendering volume and the offset rendering volume is determined as the shadow portion, and the shadow distribution information is determined based on the location of the shadow portion.

8. The rendering method according to claim 5, characterized in that, When the rendering information includes multi-layer rendering information, the step of height-modulating the rendering information according to a preset height distribution function to obtain the target rendering information includes: The target rendering information is obtained by layering and mixing the multi-layer rendering information according to the preset height distribution function.

9. The rendering method according to claim 2, characterized in that, When the two-dimensional rendering target is a two-dimensional image, for each sampling point, storing the main rendering information and offset rendering information corresponding to the sampling point into the corresponding position in the pre-constructed initial two-dimensional rendering target includes: For each sampling point, the main rendering information corresponding to the sampling point is stored in the first target channel of the pixel corresponding to the sampling point in the two-dimensional image; The offset rendering information corresponding to the sampling point is stored in the second target channel of the pixel corresponding to the sampling point in the two-dimensional image.

10. The rendering method according to claim 1, characterized in that, The step of obtaining the rendered target model in response to the cumulative rendering result satisfying the preset rendering end condition includes: In response to the cumulative density of the cumulative rendering result being greater than a preset cumulative density threshold, the target rendering model that has been rendered is obtained.

11. The rendering method according to claim 1, characterized in that, The preset height distribution function is used to characterize the density distribution pattern of the target model to be rendered within the local height range of the sampling space corresponding to the target sampling point.

12. A rendering apparatus, characterized in that, The rendering device includes: The sampling point determination module is used to perform step sampling on the target model to be rendered according to the preset viewing direction, and determine the target sampling point corresponding to the current step. The rendering information reading module is used to read the rendering information corresponding to the target sampling point from a pre-created two-dimensional rendering target. The height modulation module is used to perform height modulation on the rendering information according to a preset height distribution function to obtain target rendering information, and to determine the rendering result of the current step for the target model to be rendered based on the target rendering information; The rendering result update module is used to update the cumulative rendering result in the preset viewing direction based on the target rendering information; The model rendering module is used to obtain the target rendering model after rendering is completed in response to the cumulative rendering result meeting the preset rendering end condition.

13. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the steps of the rendering method as described in any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the rendering method according to any one of claims 1 to 11.