Data processing method and apparatus, computer device, computer-readable storage medium, and computer program product

By combining the first and second rendering rules, the sample volume texture is obtained and the business rendering parameters are trained, which solves the problem of time-consuming and labor-intensive rendering of atmospheric perspective effects in the existing technology and achieves an efficient atmospheric perspective effect.

WO2024198719A9PCT designated stage expired Publication Date: 2025-12-26TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/075504
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-29
Filing Date
2024-02-02
Publication Date
2025-12-26

AI Technical Summary

Technical Problem

In existing technologies, scattering simulation methods require extensive manual adjustment of rendering parameters when rendering atmospheric perspective effects, resulting in time consumption and difficulty in balancing rendering efficiency and effect.

Method used

By combining the first and second rendering rules, the sample volume texture of the sample map is obtained, the actual rendering value and reference depth data are determined, and business rendering parameters that match the sample environment configuration are trained and directly applied to the rendering of the medium scattering effect.

Benefits of technology

It reduces manual adjustment time, improves rendering efficiency and effect, and enhances rendering efficiency while ensuring rendering effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024075504_26122025_PF_FP_ABST
    Figure CN2024075504_26122025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in embodiments of the present application are a data processing method and apparatus, a computer device, a computer-readable storage medium, and a computer program product. The method comprises: obtaining rendering rules, the rendering rules comprising a first rendering rule and a second rendering rule; obtaining a sample body texture of a sample map generated according to the first rendering rule; on the basis of the sample body texture, separately determining an actual rendering value of the sample map under a sample environment configuration and reference depth data of the sample map; on the basis of an initial rendering parameter in the second rendering rule and the reference depth data, determining a predicted rendering value of the sample map under the sample environment configuration; training the initial rendering parameter on the basis of the predicted rendering value and the actual rendering value, and obtaining a service rendering parameter, the service rendering parameter being used for rendering a media scattering effect of a first map, and a service environment configuration of the first map being the sample environment configuration.
Need to check novelty before this filing date? Find Prior Art

Description

Data processing methods, apparatus, computer equipment, computer-readable storage media and computer program products

[0001] Cross-reference to related applications

[0002] This application is based on and claims priority to Chinese Patent Application No. 2023103210068, filed on March 29, 2023, the entire contents of which are incorporated herein by reference. Technical Field

[0003] This application relates to the field of computer technology, and in particular to a data processing method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Technology

[0004] Real-time scattering rendering systems in related technologies mainly include the following two phenomena when simulating atmospheric scattering: sky effect and atmospheric perspective effect. The sky effect refers to the blue sky during the day and the red horizon at dusk, which is usually achieved using a sky sphere; while the atmospheric perspective effect refers to the fog effect (also known as atmospheric fog) caused by atmospheric scattering on distant objects.

[0005] For the phenomenon of atmospheric perspective, scattering simulation methods in related technologies can use rendering rules based on simplified physical formulas (e.g., the Hoffman 02 algorithm) to simulate it. However, because these rendering rules simplify the physical algorithm, there is a problem of difficult parameter adjustment. Therefore, to achieve the desired effect, it is often necessary to manually try and fine-tune the rendering parameters in the rendering rules, which is very time-consuming and difficult for artistic creation. In other words, scattering simulation methods in related technologies require a lot of manpower and time, making it difficult to simultaneously achieve both rendering efficiency and rendering effect.

[0006] Summary of the Invention

[0007] This application provides a data processing method, apparatus, computer equipment, computer-readable storage medium, and computer program product, which can improve the rendering effect of scattering simulation while ensuring rendering efficiency.

[0008] This application provides a data processing method, including: obtaining rendering rules; the rendering rules include a first rendering rule and a second rendering rule; the first rendering rule is used to render a virtual scene containing a medium; the second rendering rule is used to render the medium scattering effect; obtaining the sample volume texture of a sample texture generated by the first rendering rule; based on the sample volume texture, determining the actual rendering value of the sample texture under the sample environment configuration and the reference depth data of the sample texture; based on the initial rendering parameters in the second rendering rule and the reference depth data, determining the predicted rendering value of the sample texture under the sample environment configuration; training the initial rendering parameters based on the predicted rendering value and the actual rendering value to obtain business rendering parameters that match the sample environment configuration; the business rendering parameters are used to render the medium scattering effect of the first texture; the business environment configuration of the first texture is the sample environment configuration.

[0009] This application provides a data processing method, including: when performing scattering simulation rendering on a first texture, obtaining a business environment configuration for the first texture; if the business environment configuration is a sample environment configuration, obtaining business rendering parameters matching the sample environment configuration; the business rendering parameters are obtained by training the initial rendering parameters in a second rendering rule based on the predicted rendering value and actual rendering value of the sample texture under the sample environment configuration; the actual rendering value of the sample texture is determined based on the sample volume texture of the sample texture; the sample volume texture of the sample texture is generated by a first rendering rule; the first rendering rule is used to render a virtual scene containing a medium; the second rendering rule is used to render the medium scattering effect; based on the business rendering parameters and the second rendering rule, rendering the medium scattering effect of the first texture to obtain a second texture.

[0010] This application provides a data processing apparatus, including: a rule acquisition module configured to acquire rendering rules; the rendering rules include a first rendering rule and a second rendering rule; the first rendering rule is used to render a virtual scene containing a medium; the second rendering rule is used to render the medium scattering effect; a sample reference module configured to acquire the sample volume texture of a sample texture generated by the first rendering rule, and based on the sample volume texture, determine the actual rendering value of the sample texture under a sample environment configuration and the reference depth data of the sample texture; a sample prediction module configured to determine the predicted rendering value of the sample texture under a sample environment configuration based on the initial rendering parameters in the second rendering rule and the reference depth data; and a training module configured to train the initial rendering parameters based on the predicted rendering value and the actual rendering value to obtain business rendering parameters that match the sample environment configuration; the business rendering parameters are used to render the medium scattering effect of the first texture; the business environment configuration of the first texture is the sample environment configuration.

[0011] This application provides a data processing apparatus, including: a configuration acquisition module configured to acquire a business environment configuration for a first texture when performing scattering simulation rendering on a first texture; a business parameter acquisition module configured to acquire business rendering parameters matching a sample environment configuration if the business environment configuration is a sample environment configuration; the business rendering parameters are obtained by training initial rendering parameters in a second rendering rule based on the predicted rendering value and actual rendering value of the sample texture under the sample environment configuration; the actual rendering value of the sample texture is determined based on the sample volume texture of the sample texture; the sample volume texture of the sample texture is generated by a first rendering rule; the first rendering rule is used to render a virtual scene containing a medium; the second rendering rule is used to render the medium scattering effect; and a rendering module configured to render the medium scattering effect of the first texture based on the business rendering parameters and the second rendering rule to obtain a second texture.

[0012] This application provides a computer device, including: a processor, a memory, and a network interface; the processor is connected to the memory and the network interface, wherein the network interface is used to provide data communication functions, the memory is used to store computer programs, and the processor is used to call the computer programs so that the computer device executes the data processing method provided in the embodiments of this application.

[0013] This application provides a computer-readable storage medium storing a computer program adapted to be loaded and executed by a processor, so that a computer device having the processor performs the data processing method provided in this application.

[0014] This application provides a computer program product, which includes a computer program stored in a computer-readable storage medium; a processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the data processing method of this application embodiment.

[0015] In this embodiment, on one hand, when a computer device with rendering capabilities simulates and renders a medium scattering effect, it acquires rendering rules. These rendering rules may include a first rendering rule for rendering a virtual scene containing a medium and a second rendering rule for rendering the medium scattering effect. When the computer device acquires a sample texture, it does not need to spend a lot of time manually adjusting the initial rendering parameters in the second rendering rule. Instead, it can directly acquire the volume texture (i.e., the sample volume texture) of the sample texture through the first rendering rule. Based on this sample volume texture, it can quickly determine the actual rendering value of the sample texture under the sample environment configuration and the reference depth data of the sample texture.

[0016] On the other hand, the computer device can determine the predicted rendering value of the sample texture under the sample environment configuration using the initial rendering parameters (i.e., the rendering parameters before training) in the second rendering rule and the reference depth data. Then, the computer device can train the initial rendering parameters based on the predicted rendering value and the actual rendering value to obtain business rendering parameters that match the sample environment configuration. Here, the business rendering parameters are the trained rendering parameters, which can be used to render the medium scattering effect of the first texture, and the business environment configuration of the first texture is the sample environment configuration. Therefore, the embodiments of this application do not require manual adjustment of the initial rendering parameters in the second rendering rule, but can directly derive the difficult-to-adjust rendering parameters in the second rendering rule by obtaining the intermediate data of the physical algorithm of the first rendering rule, i.e., the sample volume texture. This means that when rendering the medium scattering effect, the embodiments of this application do not directly use the second rendering rule, but instead train the business rendering parameters by combining the first and second rendering rules. This allows for faster and more accurate acquisition of the business rendering parameters. Consequently, when rendering the medium scattering effect of the first texture, not only can the rendering effect be ensured, but the rendering efficiency can also be improved. In other words, the scattering simulation method used in the embodiments of this application can simultaneously take into account both rendering effect and rendering efficiency. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 is a schematic diagram of a network architecture provided in an embodiment of this application;

[0019] Figure 2 is a schematic diagram of a framework for training rendering parameters provided in an embodiment of this application;

[0020] Figure 3 is a flowchart illustrating a data processing method provided in an embodiment of this application;

[0021] Figure 4 is a flowchart illustrating a training parameter provided in an embodiment of this application;

[0022] Figure 5 is a flowchart illustrating another data processing method provided in an embodiment of this application;

[0023] Figure 6 is a schematic diagram of a scene for rendering medium scattering effects according to an embodiment of this application;

[0024] Figure 7 is a schematic diagram of the structure of a data processing device provided in an embodiment of this application;

[0025] Figure 8 is a schematic diagram of another data processing device provided in an embodiment of this application;

[0026] Figure 9 is a schematic diagram of a computer device provided in an embodiment of this application;

[0027] Figure 10 is a schematic diagram of the structure of a data processing system provided in an embodiment of this application. Detailed Implementation

[0028] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0029] Light scattering refers to the phenomenon where, when a beam of light passes through a non-uniform medium, part of the beam deviates from its original direction and disperses, resulting in light visible from the side. Light scattering occurs when it passes through dusty air or colloidal solutions, or when solar radiation encounters air molecules, dust particles, and cloud droplets as it passes through the atmosphere. For example, a beam of light appears white when passing through diluted milk, but appears light blue when viewed from the side or above. The medium can include gaseous media (e.g., air), liquid media (e.g., water, milk, oil), and solid media (e.g., glass); these are not limited here. It is understood that if the medium is air, the virtual scene containing the medium rendered by the first rendering rule can have a sky effect, while the medium scattering effect rendered by the second rendering rule can have an atmospheric perspective effect. The sky effect can be a blue sky during the day and a red horizon at dusk; the atmospheric perspective effect can be a fog effect caused by atmospheric scattering on distant objects.

[0030] Atmospheric scattering refers to the scattering phenomenon that occurs when light passes through substances such as gas molecules and aerosol particles in the atmosphere. It is also the main reason why the sky appears blue during the day and red at dusk on Earth. In computer graphics, an atmospheric scattering system generally includes simulations of three physical phenomena: Rayleigh scattering, Mie scattering, and the absorption of light energy by the air (e.g., ozone absorption).

[0031] It is understood that the embodiments of this application can use the scattering coefficient to represent the scattering ratio of light intensities of different colors (i.e., different wavelengths). Since scattering occurs in all directions, the phase function can be used to represent the proportion of light scattered at different angles. The following is a simulation of several common physical phenomena in atmospheric scattering systems:

[0032] Physical Phenomenon 1: Rayleigh scattering. This scattering is caused by air molecules, and the intensity of the scattered light varies in different directions. This intensity is inversely proportional to the fourth power of the wavelength of the incident light. Therefore, Rayleigh scattering is the fundamental reason why the atmosphere appears blue during the day and the sky appears orange-red at dusk. Formulas related to Rayleigh scattering can be found in the following formulas (1) and (2):

[0033] in, λ represents the Rayleigh scattering coefficient, which indicates the ratio of light loss to scattering after a single collision; h represents the height of a pixel; λ represents the wavelength of the incident light; n represents the refractive index of air; N represents the molecular number density of standard atmosphere, i.e., the number of molecules per cubic meter; H R This indicates parameters related to altitude.

[0034] It is understood that, when simulating Rayleigh scattering, the scattering coefficient in the embodiments of this application can indicate the value in formula (1). The results of this part of the calculation are often expressed in β. R (i.e., the first scattering parameter). Understandably, this parameter is often calculated by the aforementioned formula based on the RGB value corresponding to the wavelength, plus reference data obtained from atmospheric measurements. Sometimes, this parameter is also exposed to business objects (e.g., users) so that they can manually adjust the final result to simulate the atmospheric effects of various environmental configurations (e.g., planets such as Mars or Earth).

[0035] Among them, P R (μ) represents the phase function of Rayleigh scattering, used to control the scattering geometry, P R (μ) represents the relative ratio of light lost in a specific direction. This coefficient is used as a normalization factor, so the integral on a unit sphere is 1; μ = cosθ, which represents the cosine value of θ; θ can be used to represent the angle between the directional light and the current line of sight.

[0036] Physical Phenomenon 2: Mie scattering. Mie scattering is caused by ellipsoidal particles in the air, such as aerosol particles and water droplets. Mie scattering exhibits strong anisotropy, meaning that a significant portion of the light passing through these particles is scattered in a direction that is obtuse to the original direction of light propagation, or even in the opposite direction. Therefore, Mie scattering is the main cause of the white halo around the sun during the day. Formulas related to Mie scattering can be found in the following formulas (3) and (4):

[0037] in, The scattering coefficient representing Mie scattering can be used for β. M (i.e., the second scattering parameter) is represented by h and H. M Both are parameters related to altitude; λ is used to represent the wavelength of the incident light.

[0038] Among them, P M (μ) represents the Cornette-Shanks phase function commonly used in Mie scattering; g is a parameter used to control the anisotropy of Mie scattering. Of course, other phase functions (e.g., the Heyney-Greenstein phase function) can also be used in the embodiments of this application to simulate the Mie scattering phenomenon.

[0039] Physical phenomenon three: absorption of light energy by air. This absorption mainly occurs in ozone formation, but since its impact is relatively small, the simulation effect of this physical phenomenon is temporarily ignored in the embodiments of this application.

[0040] The data processing method provided in the embodiments of this application will be described below in conjunction with the simulation of the above physical phenomena. Here, the network architecture of the embodiments of this application will be described first.

[0041] Please refer to Figure 1, which is a schematic diagram of a network architecture provided in an embodiment of this application. As shown in Figure 1, the network architecture may include a server 10F and a cluster of terminal devices. The cluster of terminal devices may include one or more terminal devices. As shown in Figure 1, the cluster of terminal devices may include terminal devices 100a, 100b, 100c, ..., 100n. As shown in Figure 1, terminal devices 100a, 100b, 100c, ..., 100n can respectively connect to the server 10F via the network, so that each terminal device can interact with the server 10F through the network connection. The network connection method is not limited; it can be a direct or indirect connection via wired communication, a direct or indirect connection via wireless communication, or other methods. This embodiment of the application does not impose any limitations on this method.

[0042] Each terminal device in the terminal device cluster can include: smartphones, tablets, laptops, desktop computers, smart speakers, smartwatches, in-vehicle terminals, smart TVs, and other smart terminals with data processing capabilities. It should be understood that each terminal device in the terminal device cluster shown in Figure 1 can have an application client installed. When this application client runs on each terminal device, it can interact with the server 10F shown in Figure 1. This application client can include social clients, multimedia clients (e.g., video clients), entertainment clients (e.g., game clients), information stream clients, educational clients, live streaming clients, and other application clients. This application client can be a standalone client or an embedded sub-client integrated into a client (e.g., a social client, an educational client, or a multimedia client), and this is not limited here.

[0043] As shown in Figure 1, the server 10F in this embodiment can be the server corresponding to the application client. The server 10F can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. This embodiment does not limit the number of terminal devices and servers.

[0044] For ease of understanding, this embodiment of the application can select one of the multiple terminal devices shown in Figure 1 as the target terminal device. For example, this embodiment of the application can use terminal device 100a shown in Figure 1 as the target terminal device, which may integrate an application client. In this case, the target terminal device can achieve data interaction with server 10F through the business data platform corresponding to the application client. Here, the business engine (e.g., game engine, physics simulation engine, etc.) in the application client can deploy a component for scattering simulation rendering (i.e., an atmospheric rendering component). For example, the atmospheric rendering component deployed in a game engine (e.g., UE4 engine) can be a SkyAtmosphere component (also known as the SkyAtmosphere module). This atmospheric rendering component can be used to train rendering parameters that match the sample environment configuration.

[0045] The sample environment configuration here can be configured by a business object (e.g., a user) according to the actual simulation environment. This configuration can include a first configuration associated with a planet, a second configuration associated with the location information of a planet, or other types of configurations, which will not be limited here. For example, the business object can select a planet (e.g., Mars) as the first configuration from the configuration options corresponding to the first configuration (e.g., Earth, Mars, Moon, custom planet, etc.) so that the computer device can subsequently simulate the rendering effect of a texture on Mars. In some embodiments, after selecting the first configuration, the business object can also select a second configuration based on the first configuration. For example, after selecting Earth as the first configuration, the business object can also select a location information (e.g., the equator) as the second configuration from the configuration options corresponding to the second configuration (e.g., equator, North Pole, custom latitude and longitude coordinates, etc.) so that the computer device can subsequently simulate the rendering effect of a texture on the Earth's equator. In other words, the embodiments of this application can adjust various scattering systems to achieve the simulation of rendering effects for various planets, and can also customize various rendering effects, which will not be listed here.

[0046] It should be understood that the scattering simulation method involved in the embodiments of this application can be executed by a computer device with rendering function. The computer device can be the server 10F shown in FIG1, or any terminal device in the terminal device cluster shown in FIG1 above, such as terminal device 100a, which will not be limited here.

[0047] During parameter training, the computer device can acquire rendering rules. These rules can include not only first rendering rules for rendering virtual scenes containing media (e.g., the Hillairi20 algorithm) but also second rendering rules for rendering media scattering effects (e.g., the Hoffman02 algorithm). To reduce labor and time costs, the computer device can acquire intermediate data obtained through the first rendering rules (i.e., the sample volume texture of the sample map, e.g., a 3D Volume texture). Based on this sample volume texture, it can determine the actual rendering value of the sample map under the sample environment configuration and the reference depth data of the sample map. The actual rendering value and the reference depth data of the sample map are both determined based on a reference image of the sample map under the sample environment configuration. The actual rendering value refers to the rendering value of the reference image; the reference depth data refers to the initial depth data of the reference image, i.e., the distance from the current observation point (e.g., the position of a virtual character in a game scene) to the target point of the reference image (e.g., the coordinate position of a pixel to be rendered). Then, the computer device can determine the predicted rendering value of the sample texture under the sample environment configuration using the initial rendering parameters and reference depth data in the second rendering rule. Based on this predicted rendering value and the actual rendering value, the initial rendering parameters can be trained to obtain business rendering parameters that match the sample environment configuration. Here, the business rendering parameters are used to render the medium scattering effect of the first texture, and the environment configuration of the first texture (i.e., the business environment configuration) is the sample environment configuration.

[0048] The scattering simulation method involved in this application can be applied to multiple scenarios. For example, in a game scenario, the sample texture obtained by the computer device can be a game texture (e.g., a texture corresponding to an outdoor shooting scene in a competitive game). In this case, the computer device can train the initial rendering parameters in the second rendering rule by combining the first rendering rule and the second rendering rule to quickly and accurately obtain the business rendering parameters. This allows for a more accurate display of the game rendering effect when the business rendering parameters are subsequently applied, thereby improving the user's gaming experience. As another example, in a virtual reality scenario (i.e., a VR scenario), the sample texture obtained by the computer device can be a virtual texture (e.g., a texture corresponding to a forest scene in a virtual world). In this case, the computer device can train the initial rendering parameters in the second rendering rule by combining the first rendering rule and the second rendering rule to quickly and accurately obtain the business rendering parameters. This allows for a more real-time and accurate simulation of atmospheric perspective effects when the business rendering parameters are subsequently applied, giving users in the virtual world a sense of immersion and enhancing the enjoyment.

[0049] For ease of understanding, please refer to Figure 2 in some embodiments. Figure 2 is a schematic diagram of a framework for training rendering parameters provided by an embodiment of this application. As shown in Figure 2, the computer device in this embodiment can be a computer device with rendering capabilities. This computer device can be any terminal device in the terminal device cluster shown in Figure 1, for example, terminal device 100a. The computer device can also be the server 10F shown in Figure 1. Here, the computer device is not limited. In this embodiment, the medium can be air, which means that the virtual scene containing the medium can be a sky effect, and the medium scattering effect can be an atmospheric perspective effect.

[0050] It should be understood that, due to the difficulty in adjusting the parameters of the rendering rules used to render atmospheric perspective effects (i.e., the second rendering rules), the computer device needs to acquire textures (i.e., sample textures) for training the initial rendering parameters of the second rendering rules during the parameter training process. For example, texture 20P shown in Figure 2. This texture 20P can be the original texture without scattering simulation rendering, or it can be a texture obtained after simulating the sky effect of the original texture. This will not be limited here.

[0051] The rendering rules in this application embodiment can include not only a first rendering rule (i.e., the new physical algorithm) for rendering sky effects, but also a second rendering rule (i.e., the old simplified algorithm) for rendering atmospheric perspective effects. That is, this application embodiment can combine the old simplified algorithm and the new physical algorithm to quickly and accurately render atmospheric perspective effects in real time.

[0052] Understandably, the computer device can obtain multiple sample volume textures of texture 20P under a sample environment configuration (e.g., Earth) through the first rendering rule. One sample volume texture can be a volume texture obtained by the computer device for texture 20P that matches the elevation angle of a virtual light source (i.e., the elevation angle φ corresponding to the light emitted by the virtual light source). The angle range of this virtual light source elevation angle can be composed of a first angle threshold and a second angle threshold, both of which can be dynamically adjusted according to actual needs and are not limited here. The virtual light source can be a light source capable of emitting light, such as a flashlight or the sun.

[0053] When the virtual light source is the sun, the virtual light source elevation angle can be the solar elevation angle, that is, the angle between the sunlight and the horizon. For example, the first angle threshold can be -10 degrees, and the second angle threshold can be 90 degrees. In this embodiment, if the solar elevation angle is negative, the sample volume texture matching the solar elevation angle is used to simulate the sun setting below the horizon; if the solar elevation angle is 0 degrees, the sample volume texture matching the solar elevation angle is used to simulate sunset; if the solar elevation angle is positive, the sample volume texture matching the solar elevation angle is used to simulate daytime; if the solar elevation angle is 90 degrees, the sample volume texture matching the solar elevation angle is used to simulate noon.

[0054] For ease of explanation, the number of sample volume textures in this embodiment can be taken as two, which may include a volume texture T1 for simulating daytime and a volume texture T2 for simulating sunset. The virtual light source elevation angle (e.g., elevation angle φ1) corresponding to the volume texture T1 can be 10 degrees, and the virtual light source elevation angle (e.g., elevation angle φ2) corresponding to the volume texture T2 can be 0 degrees.

[0055] For volume texture T1, the computer device can determine a reference image of texture 20P at the elevation angle φ1 corresponding to volume texture T1, such as reference image H1 shown in Figure 2. Based on this reference image H1, the actual rendering value and reference depth data of texture 20P at the elevation angle φ1 configured in the sample environment can be determined. Here, the reference depth data represents the distance from the current observation point (e.g., the position of a virtual character in a game scene) to the target point (e.g., the coordinate position of a pixel to be rendered) in reference image H1. Then, the computer device can obtain the initial rendering parameters of the second rendering rule, such as rendering parameters 21U1 matching the elevation angle φ1. Furthermore, the predicted rendering value of texture 20P at the elevation angle φ1 configured in the sample environment can be determined using the second rendering rule, rendering parameters 21U1, and the reference depth data corresponding to reference image H1. At this point, the computer device can train the rendering parameters 21U1 based on the predicted and actual rendering values ​​of texture 20P at elevation angle φ1, obtaining business rendering parameters that match the elevation angle φ1 configured in the sample environment, such as rendering parameters 22U1. Similarly, for volume texture T2, the computer device can determine the reference image of texture 20P at the elevation angle φ2 corresponding to volume texture T2, such as the reference image H2 shown in Figure 2. Then, based on the reference image H2, it can determine the actual rendering value of texture 20P at the elevation angle φ2 configured in the sample environment and the reference depth data, respectively. Here, the reference depth data represents the distance from the current observation point (e.g., the position of a virtual character in a game scene) to the target point of the reference image H2 (e.g., the coordinate position of a pixel to be rendered). Then, the computer device can obtain the initial rendering parameters of the second rendering rule, such as rendering parameters 21U2 that match the elevation angle φ2. Furthermore, it can determine the predicted rendering value of texture 20P at the elevation angle φ2 configured in the sample environment using the second rendering rule, rendering parameters 21U2, and reference depth data corresponding to the reference image H2. At this point, the computer device can train rendering parameters 21U2 based on the predicted and actual rendering values ​​of texture 20P at the elevation angle φ2 to obtain business rendering parameters that match the elevation angle φ2 configured in the sample environment, such as rendering parameters 22U2.

[0056] Similarly, the computer device can also refer to the parameter training methods of rendering parameters 22U1 and 22U2 to obtain business rendering parameters that match other solar altitude angles under the sample environment configuration. This allows the business rendering parameters at each solar altitude angle to be determined as a set of business rendering parameters that match the sample environment configuration. Each business rendering parameter in this set can be used to render the atmospheric projection effect of a certain texture (i.e., the first texture) configured in the sample environment.

[0057] Therefore, since the scattering simulation (i.e. atmospheric scattering simulation) method provided in this application embodiment does not require manual intervention, but obtains the business rendering parameters of different solar altitude angles under the sample environment configuration by combining the first rendering rules and the second rendering rules, it can greatly reduce the manual and time costs when rendering the atmospheric perspective effect of the first texture in real time based on these business rendering parameters. Thus, while ensuring the rendering effect, it can also improve the rendering efficiency. That is, the atmospheric scattering simulation method can simultaneously take into account both the rendering effect and the rendering efficiency.

[0058] In this embodiment, when a computer device with rendering capabilities renders the medium scattering effect of a certain texture, it can quickly and accurately obtain business rendering parameters that match the sample environment configuration by combining a first rendering rule and a second rendering rule to train the initial rendering parameters in the second rendering rule. The implementation method of parameter training can be found in the embodiments corresponding to Figures 3 to 6.

[0059] In some embodiments, please refer to Figure 3, which is a flowchart illustrating a data processing method provided in this application embodiment. As shown in Figure 3, the method can be executed by a computer device with rendering capabilities. This computer device can be a terminal device, such as any one of the terminal devices in the terminal device cluster shown in Figure 1 above, such as terminal device 100a with parameter training capabilities, or it can be a server, such as server 10F shown in Figure 1 above, without limitation. For ease of understanding, this application embodiment uses the execution of the method by a server with rendering capabilities as an example for illustration. The method can at least include the following steps S101 to S104:

[0060] Step S101: Obtain rendering rules.

[0061] The rendering rules here can be rules used for scattering simulation rendering, and can include a first rendering rule and a second rendering rule. The first rendering rule can be used to render a virtual scene containing a medium (e.g., a sky effect), and the first rendering rule can be, for example, the Hillaire20 algorithm. The second rendering rule can be used to render medium scattering effects (e.g., atmospheric perspective effects), and the second rendering rule can be, for example, the Hoffman02 algorithm.

[0062] It should be noted that the first rendering rule in this application embodiment is a new physical algorithm compared to the rendering rules in related technologies, while the second rendering rule can be an old simplified algorithm of the rendering rules in related technologies.

[0063] Step S102: Obtain the sample volume texture of the sample texture generated by the first rendering rule, and based on the sample volume texture, determine the actual rendering value of the sample texture under the sample environment configuration and the reference depth data of the sample texture.

[0064] In this embodiment, the computer device can acquire reference attributes for the sample texture, and then, based on the virtual light source elevation angle included in the reference attributes and the sample texture, acquire a sample volume texture generated by the first rendering rule that matches the virtual light source elevation angle. Then, the computer device can acquire a preset depth data set including N initial depth data, and based on the N initial depth data and the sample volume texture, obtain slice data of the sample volume texture at the virtual light source elevation angle. Here, the slice data can include N sample sub-images; N is a positive integer, and one sample sub-image corresponds to one initial depth data. At this point, the computer device can determine a reference image of the sample texture at the virtual light source elevation angle from the N sample sub-images, and then use the rendering value of the reference image as the actual rendering value of the sample texture under the sample environment configuration, and use the initial depth data of the reference image as the reference depth data.

[0065] The reference attribute acquired by the computer device can be the virtual light source elevation angle pre-configured by the computer device, for example, the virtual light source elevation angle is configured to 0 degrees and 10 degrees by default; or it can be the virtual light source elevation angle configured by the corresponding business object (e.g., user) in the business configuration interface of the atmospheric rendering component according to actual needs. This will not be limited here. Here, the business configuration interface refers to the display interface used to configure various attributes of the scattering simulation rendering. For example, the business configuration interface may include configuration controls for configuring the virtual light source elevation angle (e.g., solar elevation angle), configuration controls for inputting rendering parameters, and configuration controls for configuring other attributes; this will not be limited here.

[0066] For ease of understanding, this application embodiment can be illustrated by taking user configuration as an example to explain the implementation method of a computer device obtaining reference attributes for a sample texture. For example, the computer device can display a service configuration interface for an atmospheric rendering component in the service engine (e.g., the SkyAtmosphere component in the UE4 engine). This service configuration interface may include configuration controls for the solar altitude angle.

[0067] The solar altitude angle range can be formed by a first angle threshold and a second angle threshold. Since scattering occurs after the sun sets below the horizon, the first angle threshold for the solar altitude angle in this embodiment can be a negative value, for example, -10 degrees; the second angle threshold can be an angle value used to simulate noon, for example, 90 degrees. Therefore, the solar altitude angle range can be [-10°, 90°]. Here, the solar altitude angle refers to the altitude angle corresponding to the direction of sunlight emitted by the sun, that is, the angle between sunlight and the horizon.

[0068] At this point, the business object corresponding to the computer device can perform an attribute addition operation on the configuration control of the reference attribute. In other words, the business object can randomly add one or more solar altitude angles within the angle range of the solar altitude angle, such as adding multiple solar altitude angles like -5 degrees, 0 degrees, 10 degrees, and 45 degrees in sequence. This is not limited here. The attribute addition operation here refers to the triggering operation for the business object to add the solar altitude angle attribute. This triggering operation can include contact operations such as clicking and long-pressing, as well as non-contact operations such as voice and gestures. This is not limited here.

[0069] In some embodiments, the computer device can respond to the attribute addition operation by obtaining a first elevation angle for exporting a first sample volume texture, i.e., obtaining a first elevation angle for exporting a volume texture simulating daytime under the sample environment configuration, and obtaining a second elevation angle for exporting a second sample volume texture, i.e., obtaining a second elevation angle for exporting a volume texture simulating sunset under the sample environment configuration. Here, both the first and second sample volume textures are sample volume textures, and the first elevation angle is greater than the second elevation angle. In some embodiments, the computer device can use both the first and second elevation angles as reference attributes for the sample texture.

[0070] Then, the computer device can also obtain sample volume textures that match the solar altitude angles generated by the first rendering rule, based on the solar altitude angles included in the reference attributes. For example, if the reference attributes include four solar altitude angles: -5 degrees, 0 degrees, 10 degrees, and 45 degrees, the computer device can obtain four sample volume textures generated by the first rendering rule, which may include a sample volume texture with a solar altitude angle of -5 degrees, for example, sample volume texture T1; a sample volume texture with a solar altitude angle of 0 degrees, for example, sample volume texture T2; a sample volume texture with a solar altitude angle of 10 degrees, for example, sample volume texture T3; and a sample volume texture with a solar altitude angle of 45 degrees, for example, sample volume texture T4. Subsequently, after combining the first and second rendering rules and training the initial rendering parameters in the second rendering rule, the computer device can obtain the business rendering parameters corresponding to these four solar altitude angles.

[0071] It is understood that the embodiments of this application can modify the atmospheric rendering component (e.g., the SkyAtmosphere component) in the business engine, that is, add the function of exporting intermediate data to the SkyAtmosphere component, for example, add the function of exporting sample volume texture to the SkyAtmosphere component. In addition, the SkyAtmosphere component also adds the function of exporting parameter g), that is, adds the function of exporting parameters used to control Mie scattering anisotropy.

[0072] For ease of understanding, this application embodiment can use a virtual light source elevation angle (e.g., a virtual light source elevation angle of 0 degrees) as an example to illustrate the parameter training process in the second rendering rule. In other words, the sample volume texture generated by the first rendering rule that matches the virtual light source elevation angle includes the sample volume texture when the virtual light source elevation angle is 0 degrees. This sample volume texture can be a 3D Volume texture obtained by a computer device performing texture sampling on the sample map using the Vertex Texture Fetch (VFT) method in the second rendering rule.

[0073] Therefore, when the computer device acquires a preset depth data set including N initial depth data points, it can obtain slice data of the sample volume texture at the virtual light source elevation angle using these N initial depth data points and the sample volume texture. The slice data can include N sample sub-images (i.e., N slices), parameter g, the directional light vector corresponding to the virtual light source, and the initial depth data corresponding to each slice. For example, the computer device can generate a texture mesh of the sample sub-image corresponding to a certain initial depth data by running a script, such as a Python script.

[0074] In some embodiments, the computer device needs to determine a reference image of the sample texture at the virtual light source elevation angle from these N sample sub-images. Understandably, the computer device can traverse the N sample sub-images, identifying the traversed sub-images as the sub-images to be processed. The texture mesh of the sub-images to be processed can then be rasterized to obtain the coordinate position of each pixel in the sub-images. At this point, the computer device can perform pixel value superposition processing based on the coordinate position of each pixel to obtain the total pixel value corresponding to the sub-image to be processed, until the traversal is complete and N total pixel values ​​are obtained. Then, the computer device can select the sample sub-image with the largest total pixel value from the N sample sub-images as the reference image of the sample texture at the virtual light source elevation angle, and use the rendered value of this reference image as the actual rendered value of the sample texture under the sample environment configuration, using the initial depth data of the reference image as the reference depth data.

[0075] For example, if the preset depth dataset contains three initial depth data points, which may include depth data S1, depth data S2, and depth data S3, the computer device can obtain a sample sub-image corresponding to depth data S1, such as sample sub-image P1, based on depth data S1 and the sample volume texture. Similarly, the computer device can also obtain a sample sub-image corresponding to depth data S2, such as sample sub-image P2, and a sample sub-image corresponding to depth data S3, such as sample sub-image P3. In some embodiments, the computer device can generate three sample sub-images and a data export file in the cache directory based on these three sample sub-images (i.e., three slices), parameter g, the directional light vector corresponding to the virtual light source, and the initial depth data corresponding to each slice. These three sample sub-images can be stored in tga format, while the data export file can be stored in json format. The data export file can include parameter g, the directional light vector corresponding to the virtual light source, and the initial depth data corresponding to each slice.

[0076] Then, the computer device can automatically run scripts through the business engine, such as Python scripts, using rasterization tools, such as NvDiffras, to rasterize the texture mesh of each sample sub-image to obtain the total pixel value corresponding to each sample sub-image. For example, the computer device can rasterize the texture mesh of sample sub-image P1 to obtain the coordinate position of each pixel in sample sub-image P1. Then, based on the coordinate position of each pixel, the pixel values ​​of each pixel are superimposed to obtain the total pixel value corresponding to sample sub-image P1. Here, the superposition process can refer to first determining the product of the color value (e.g., RGB value) and the weight of each pixel in sample sub-image P1, and then summing these products. Similarly, the computer device can also obtain the total pixel value corresponding to sample sub-image P2 and the total pixel value corresponding to sample sub-image P3.

[0077] At this point, the computer device can determine the maximum total pixel value from the total pixel values ​​corresponding to sample sub-image P1, sample sub-image P2, and sample sub-image P3. Then, the sample sub-image with the maximum total pixel value (e.g., sample sub-image P3) can be determined as the reference image of the sample texture under the virtual light source elevation angle. Then, the computer device can use the rendering value of sample sub-image P3 as the actual rendering value of the sample texture under the sample environment configuration, and use the depth data S3 as the reference depth data.

[0078] Step S103: Based on the initial rendering parameters and reference depth data in the second rendering rule, determine the predicted rendering value of the sample texture under the sample environment configuration.

[0079] The initial rendering parameters here may include a first scattering parameter, a second scattering parameter, and a brightness parameter. The first and second scattering parameters correspond to different scattering methods. The brightness parameter can be used to indicate the brightness of the virtual light source. The sample volume texture here is a volume texture generated by the first rendering rule that matches the elevation angle of the virtual light source. The computer device can obtain the initial rendering value of the sample texture, and then determine the transmittance corresponding to the sample texture based on the initial scattering coefficient of the first scattering parameter, the initial scattering coefficient of the second scattering parameter, and reference depth data. In some embodiments, the computer device can determine the internal scattering parameter of the sample texture at the elevation angle of the virtual light source based on the initial scattering coefficient of the first scattering parameter, the initial scattering coefficient of the second scattering parameter, the brightness parameter, and reference depth data, and then determine the predicted rendering value of the sample texture under the sample environment configuration based on the initial rendering value, transmittance, and internal scattering parameter.

[0080] In this embodiment of the application, the computer device determines the rendering value of a certain texture using the following formulas (5) to (9): L(s,θ)=L0F ex (s)+L in (s,θ) (5)

[0081] Where L0 represents the initial rendering value of a certain texture, that is, the color of objects in the scene, which can be defaulted to 0 during the first training; F ex (s) represents transmittance, referring to the proportion of light remaining after being scattered and propagating beyond the line of sight; L in (s, θ) represents the internal scattering parameter, which refers to the scattering of light from outside the line of sight into the line of sight, also known as inward scattering; β R β represents the first scattering parameter, i.e., the scattering coefficient of the first scattering (e.g., Rayleigh scattering); M The second scattering parameter is represented by the scattering coefficient of the second scattering (e.g., Mie scattering); s refers to the distance from the current observation point to the target point; θ represents the angle between the directional light emitted by the virtual light source and the current line of sight; E sun The parameter used to represent brightness is used to indicate the brightness of a virtual light source, such as sunlight, and can be stored in RGB color format; g is used to represent the parameter that controls the anisotropy of Mie scattering, and can be set to 0.8 by default.

[0082] In this embodiment, the computer device can set the initial values ​​of the first scattering parameter, the second scattering parameter, and the brightness parameter in the initial rendering parameters to 1, that is, the initial scattering coefficient of the first scattering parameter is 1, the initial scattering coefficient of the second scattering parameter is 1, and the initial value of the brightness parameter is 1. Therefore, when determining the predicted rendering value of the sample texture under the sample environment configuration, the computer device can first determine the transmittance corresponding to the sample texture according to the above formula (6), the initial scattering coefficient of the first scattering parameter (e.g., 1), the initial scattering coefficient of the second scattering parameter (e.g., 1), and the reference depth data. Then, since the virtual light source elevation angle refers to the elevation angle corresponding to the directional light emitted by the virtual light source, the computer device needs to determine the angle between the directional light emitted by the virtual light source and the current video. Then, based on formula (8), the initial scattering coefficient of the first scattering parameter, and the angle, the updated scattering coefficient of the first scattering parameter can be determined. Based on formula (9), the initial scattering coefficient of the second scattering parameter, and the angle, the updated scattering coefficient of the second scattering parameter can be determined. Then, the computer device can determine the internal scattering parameters of the sample texture at the virtual light source elevation angle based on the above formula (7), the initial scattering coefficient of the first scattering parameter, the updated scattering coefficient of the first scattering parameter, the initial scattering coefficient of the second scattering parameter, the updated scattering coefficient of the second scattering parameter, the brightness parameter, and the reference depth data. Finally, the computer device can determine the product between the initial rendering value and the transmittance of the sample texture based on the above formula (5), and then use the sum of the determined product and the internal scattering parameters as the predicted rendering value of the sample texture under the sample environment configuration.

[0083] Step S104: Based on the predicted rendering value and the actual rendering value, train the initial rendering parameters to obtain business rendering parameters that match the sample environment configuration.

[0084] In this embodiment, the computer device can determine the total rendering loss corresponding to the sample texture based on the predicted rendering value and the actual rendering value. Then, based on the total rendering loss, iteratively train the initial rendering parameters to obtain the parameter training result. If the parameter training result indicates that the initial rendering parameters after iterative training meet the training cutoff condition, the computer device can determine the initial rendering parameters that meet the training cutoff condition as the business rendering parameters that match the sample environment configuration. The business rendering parameters can be used to render the medium scattering effect of the first texture; the business environment configuration of the first texture is the sample environment configuration.

[0085] In this embodiment of the application, the computer device determines the total rendering loss based on the loss function of the initial rendering parameters, such as the mean squared error (MSE) function, as shown in the following formula (10):

[0086] Where M represents the total number of pixels in a certain texture, and M is a positive integer; Y i Used to represent the i-th pixel in the texture (e.g., pixel X). i The predicted rendered value of y; i This indicates that the pixel X i The actual rendered value.

[0087] If the sample texture contains M pixels, and the M pixels include pixel X... i If M is a positive integer and i is a positive integer less than or equal to M, then the computer device can first obtain pixel X from the predicted rendering values. i Predicted rendering value Y i Then obtain the pixel X from the actual rendered value. i The actual rendered value y i Then, the computer device can predict the rendered value Y. i and the actual rendered value y i The rendering difference between them is used as the pixel X. i The rendering loss is calculated until the rendering loss corresponding to each of the M pixels is obtained. At this point, the computer device can determine the total rendering loss corresponding to the sample texture based on the above formula (10) and the M rendering losses.

[0088] In the implementation process, the computer device can obtain a training cutoff condition associated with the initial rendering parameters. This training cutoff condition can be that the total rendering loss has not decreased for several rounds (e.g., 10 rounds), at which point parameter training stops. In some embodiments, the training cutoff condition can also be that the total rendering loss is less than or equal to a loss threshold in the training cutoff condition; for example, the loss threshold can be 0.01, at which point parameter training stops. Alternatively, in other embodiments, the training cutoff condition can also be that the total rendering loss is less than or equal to the loss threshold in the training cutoff condition, and the training duration is greater than a training duration threshold in the training cutoff condition, at which point parameter training stops.

[0089] Understandably, if the parameter training results indicate that the initial rendering parameters after iterative training meet the training cutoff condition, the computer device can use the initial rendering parameters that meet the training cutoff condition as the business rendering parameters that match the sample environment configuration. In some embodiments, if the parameter training results indicate that the initial rendering parameters after iterative training do not meet the training cutoff condition, the computer device can adjust the initial rendering parameters based on the total rendering loss that does not meet the training cutoff condition. In some embodiments, the computer device can use the adjusted initial rendering parameters as transitional rendering parameters, iteratively train the transitional rendering parameters until the transitional rendering parameters after iterative training meet the training cutoff condition, and then use the transitional rendering parameters that meet the training cutoff condition as the business rendering parameters that match the sample environment configuration.

[0090] In some embodiments, please refer to Figure 4, which is a flowchart illustrating a training parameter provided in an embodiment of this application. As shown in Figure 4, the flowchart in this embodiment may include steps S41 to S48. Specifically, taking a virtual light source elevation angle φ (i.e., the target virtual light source elevation angle, for example, φ is 10 degrees) in a sample configuration environment as an example, it is used to illustrate the process of training rendering parameters that match the target virtual light source elevation angle through the combination of the first rendering rule and the second rendering rule.

[0091] Step S41: Obtain the sample volume texture generated by the first rendering rule that matches the height angle of the target virtual light source through the business engine.

[0092] Step S42: Import the sample volume texture into the scripting language to obtain the slice data of the sample volume texture at the height angle of the target virtual light source.

[0093] For example, the sample volume texture is imported into a Python scripting language, and based on N initial depth data from a preset depth dataset and the sample volume texture, slice data of the sample volume texture at the elevation angle of the target virtual light source is obtained. Here, the slice data may include N sample sub-images (i.e., N slices), parameter g, the directional light vector corresponding to the virtual light source, and the initial depth data corresponding to each slice.

[0094] Step S43: Use a rasterization tool to rasterize the texture mesh of each of the N sample sub-images in the slice data.

[0095] For example, using NvDiffras, the texture mesh of N sample sub-images in the slice data is rasterized to obtain the total pixel value corresponding to each sample sub-image.

[0096] Step S44: Based on the total pixel values ​​corresponding to the N sample sub-images, determine the reference image of the sample texture at the elevation angle of the target virtual light source from the N sample sub-images.

[0097] Here, a sample sub-image with the largest total pixel value can be selected as a reference image for the sample texture at the target virtual light source elevation angle. The rendered value of this reference image can be used as the actual rendered value of the sample texture at the target virtual light source elevation angle configured in the sample environment; the initial depth data of the reference image can be used as the reference depth data of the sample texture at the target virtual light source elevation angle configured in the sample environment.

[0098] Step S45: Obtain the predicted rendering value of the sample texture through the second rendering rule, and determine the rendering loss based on the predicted rendering value and the actual rendering value of the reference image.

[0099] Here, the predicted rendering value of the sample texture can be obtained according to the above formulas (5) to (10) and the second rendering rule, and the rendering loss can be determined based on the predicted rendering value and the actual rendering value of the reference image. For example, the computer device can use the above formulas (5) to (9) and the initial rendering parameter (β) in the second rendering rule. R β M E sun The angle (θ) between the directional light and the current line of sight, and the reference depth data (s) corresponding to the reference image are used to determine the predicted rendering value of the sample texture at the height angle of the target virtual light source. Then, based on the above formula (10), the predicted rendering value and the actual rendering value, the total rendering loss corresponding to the sample texture can be determined.

[0100] Step S46: Determine whether the total rendering loss is less than or equal to the loss threshold.

[0101] If the judgment result is yes, then step S47 is executed. That is, if the total rendering loss is less than or equal to the loss threshold, the computer device can determine that the initial rendering parameters meet the training cutoff condition, and then step S47 can be executed to directly determine the initial rendering parameters as business rendering parameters that match the target virtual light source elevation angle configured in the sample environment.

[0102] If the judgment result is negative, then return to continue executing step S45. That is, if the total rendering loss is greater than the loss threshold, the computer device can adjust the initial rendering parameters and then execute step S46 again to redetermine the predicted rendering value of the sample texture. Based on the redetermined predicted rendering value and the actual rendering value, a new total rendering loss is determined to continue to be compared with the loss threshold until the new total rendering loss is less than or equal to the loss threshold. Then, continue executing the following step S47.

[0103] Step S47: Determine the current rendering parameters as business rendering parameters that match the target virtual light source elevation angle configured in the sample environment.

[0104] Step S48: Fill the business rendering parameters obtained from the training into the business configuration interface.

[0105] The business rendering parameter here is the trained β. R β M E sun It can be used to train β R β M E sun Fill in the corresponding property of the SkyAtmosphere component, that is, the trained β R β M E sun The business engine is imported so that when rendering the medium scattering effect of a certain texture under the target virtual light source elevation angle configured in the sample environment, the business rendering parameters can be directly applied. It is understood that the vertex shader engine in the SkyAtmosphere component can be modified to integrate the atmospheric perspective rendering algorithm of the second rendering rule. During the rendering process, the atmospheric perspective can be calculated efficiently in real time on a low-end device by combining the scene object color L0 and using the second rendering rule. Simultaneously, the computer device can also use its original sky rendering scheme, that is, render the sky effect using the first rendering rule.

[0106] Furthermore, the business rendering parameters here can be the rendering parameters corresponding to the target virtual light source elevation angle under the sample environment configuration, and this target virtual light source elevation angle belongs to Z virtual light source elevation angles, where Z is a positive integer greater than 1. These Z virtual light source elevation angles are obtained by the computer device in response to the attribute addition operation; this attribute addition operation is a trigger operation performed on the configuration control of the reference attribute. It can be understood that the more virtual light source elevation angles there are, the more data fitting points there are for the subsequent business distribution map, leading to a higher accuracy of the fitted business rendering distribution map. Each rendering parameter includes a first scattering parameter, a second scattering parameter, and a brightness parameter. This means that the computer device can refer to the aforementioned training method for the business rendering parameters of the target virtual light source elevation angle to obtain the rendering parameters corresponding to each of these Z virtual light source elevation angles.

[0107] In some embodiments, the computer device can determine Z scattering coefficients associated with a first scattering parameter from Z rendering parameters, and fit these Z scattering coefficients within the angular range of the virtual light source elevation angle to obtain a first rendering distribution map associated with the first scattering parameter. Similarly, the computer device can also determine Z scattering coefficients associated with a second scattering parameter from Z rendering parameters, and fit these Z scattering coefficients within the angular range of the virtual light source elevation angle to obtain a second rendering distribution map associated with the second scattering parameter. Simultaneously, the computer device can also determine Z virtual light source brightness values ​​associated with a brightness parameter from Z rendering parameters, and fit these Z virtual light source brightness values ​​within the angular range of the virtual light source elevation angle to obtain a third rendering distribution map associated with the brightness parameter. At this point, the computer device can determine the first, second, and third rendering distribution maps as a business rendering distribution map that matches the sample environment configuration.

[0108] For example, if the virtual light source elevation angle is φ1, then the rendering parameters corresponding to the virtual light source elevation angle φ1 can include the first scattering parameter (using β). R1 (represented by β), second scattering parameter (in β) M1 (represented by) and brightness parameters (in E) sun1 (represented); if the virtual light source elevation angle is φ2, then the rendering parameters corresponding to the virtual light source elevation angle φ2 can include the first scattering parameter (represented by β). R2 (represented by β), second scattering parameter (in β) M2 (represented by) and brightness parameters (in E) sun2 (represented), and so on. When fitting a first rendered distribution map associated with a first scattering parameter, the computer device can obtain Z data fitting points, which may include data fitting point 1, represented as: (φ1, β R1 The data fitting point 2 is represented as: (φ2, β) R2 ), ..., the data fitting point Z, is represented as: (φ Z ,β RZ Then, within the angular range of the virtual light source elevation angle, these Z data fitting points can be fitted to obtain the first rendering distribution map. That is, the first rendering distribution map can be a distribution map with the virtual light source elevation angle φ as the abscissa and the first scattering parameter as the ordinate.

[0109] When fitting a second rendered distribution map associated with a second scattering parameter, the computer device can obtain Z data fitting points, which may include data fitting point 1, denoted as: (φ1, β M1 The data fitting point 2 is represented as: (φ2, β) M2 ), ..., the data fitting point Z, is represented as: (φ Z ,βMZ Then, within the angular range of the virtual light source elevation angle, these Z data fitting points can be fitted to obtain the second rendering distribution map. That is, the second rendering distribution map can be a distribution map with the virtual light source elevation angle φ as the abscissa and the second scattering parameter as the ordinate.

[0110] When fitting a third rendering distribution map associated with brightness parameters, the computer device can obtain Z data fitting points, which may include data fitting point 1, denoted as: (φ1, E sun1 ), data fitting point 2, represented as: (φ2, E sun2 ), ..., the data fitting point Z, is represented as: (φ Z E sunZ Then, within the angular range of the virtual light source elevation angle, these Z data fitting points can be fitted to obtain the third rendering distribution map. That is, the third rendering distribution map can be plotted with the virtual light source elevation angle φ as the abscissa and the brightness parameter (E) as the ordinate. sun The graph shows the distribution of data with the vertical axis as the ordinate.

[0111] In some embodiments, the computer device can determine the first rendering distribution map, the second rendering distribution map, and the third rendering distribution map as business rendering distribution maps that match the sample environment configuration, so that the rendering parameters corresponding to a certain virtual light source height angle under the sample environment configuration can be quickly read in the future, thereby rendering the medium scattering effect of any texture under the sample environment configuration in real time, thereby improving rendering efficiency.

[0112] Therefore, this embodiment of the application does not require manual adjustment of the initial rendering parameters in the second rendering rule. Instead, it can directly derive the difficult-to-adjust rendering parameters in the second rendering rule by obtaining the intermediate data of the new physical algorithm of the first rendering rule, that is, by obtaining the sample volume texture of the new physical algorithm of the first rendering rule. This means that when rendering the medium scattering effect, this embodiment of the application does not directly use the second rendering rule, but combines the first and second rendering rules to obtain the business rendering parameters more quickly and accurately. In this way, when rendering the medium scattering effect of the first texture, it can not only ensure the rendering effect, but also improve the rendering efficiency. That is, the scattering simulation method used in this embodiment of the application can simultaneously take into account the rendering effect and the rendering efficiency.

[0113] In some embodiments, please refer to Figure 5, which is a flowchart illustrating another data processing method provided in this application embodiment. This method can be executed by a terminal device with rendering capabilities, for example, by any one of the terminal devices in the terminal device cluster shown in Figure 1, such as terminal device 100a; it can also be executed by a server with rendering capabilities, such as server 10F shown in Figure 1; or it can be executed interactively by a terminal device with parameter application capabilities and a server with parameter training capabilities. No limitations are imposed here. This method may include at least the following steps S201 to S207:

[0114] Step S201: Obtain rendering rules.

[0115] The rendering rules here include a first rendering rule and a second rendering rule. The first rendering rule can be used to render virtual scenes containing media; the second rendering rule can be used to render media scattering effects.

[0116] Step S202: Obtain the sample volume texture of the sample texture generated by the first rendering rule, and based on the sample volume texture, determine the actual rendering value of the sample texture under the sample environment configuration and the reference depth data of the sample texture.

[0117] In this embodiment, the computer device can acquire reference attributes for the sample texture, and then, based on the virtual light source elevation angle included in the reference attributes and the sample texture, acquire a sample volume texture generated by the first rendering rule that matches the virtual light source elevation angle. Then, the computer device can acquire a preset depth data set including N initial depth data, and based on the N initial depth data and the sample volume texture, obtain slice data of the sample volume texture at the virtual light source elevation angle. Here, the slice data can include N sample sub-images; N is a positive integer. At this point, the computer device can determine a reference image of the sample texture at the virtual light source elevation angle from the N sample sub-images, and then use the rendering value of the reference image as the actual rendering value of the sample texture under the sample environment configuration, and use the initial depth data of the reference image as the reference depth data.

[0118] Step S203: Determine the predicted rendering value of the sample texture under the sample environment configuration using the initial rendering parameters and reference depth data in the second rendering rule.

[0119] The initial rendering parameters here may include a first scattering parameter, a second scattering parameter, and a brightness parameter. The first and second scattering parameters correspond to different scattering methods. The brightness parameter can be used to indicate the brightness of the virtual light source. The actual rendering value is the rendering value corresponding to the reference image of the sample texture. In this embodiment, the computer device can obtain the initial rendering value of the sample texture, and then determine the transmittance corresponding to the sample texture based on the initial scattering coefficient of the first scattering parameter, the initial scattering coefficient of the second scattering parameter, and the reference depth data. In some embodiments, the computer device can determine the internal scattering parameter of the sample texture at the virtual light source elevation angle based on the initial scattering coefficient of the first scattering parameter, the initial scattering coefficient of the second scattering parameter, the brightness parameter, the reference depth data, and the virtual light source elevation angle corresponding to the reference image. Then, based on the initial rendering value, transmittance, and internal scattering parameter, the predicted rendering value of the sample texture under the sample environment configuration can be determined.

[0120] Step S204: Based on the predicted rendering value and the actual rendering value, train the initial rendering parameters to obtain business rendering parameters that match the sample environment configuration.

[0121] In this embodiment, the computer device can determine the total rendering loss corresponding to the sample texture based on the predicted rendering value and the actual rendering value. Then, based on the total rendering loss, iteratively train the initial rendering parameters to obtain the parameter training result. If the parameter training result indicates that the initial rendering parameters after iterative training meet the training cutoff condition, the computer device can determine the initial rendering parameters that meet the training cutoff condition as the business rendering parameters that match the sample environment configuration. The business rendering parameters can be used to render the medium scattering effect of the first texture; the business environment configuration of the first texture is the sample environment configuration.

[0122] The data processing method in this application embodiment may include a parameter training process and a parameter application process. It is understood that steps S201 to S204 describe the parameter training process, and the implementation of the parameter training process can be found in the description of steps S101 to S104 in the embodiment corresponding to Figure 3 above, which will not be repeated here.

[0123] The application process of this parameter can be found in the description of steps S205 to S207 below.

[0124] Step S205: When performing scattering simulation rendering on the first texture, obtain the business environment configuration for the first texture.

[0125] In this embodiment of the application, when the computer device performs scattering simulation rendering on the first texture, it needs to obtain the business configuration environment for the first texture. Then, it can search in the database that stores sample environment configurations to see if the business configuration environment is a sample environment configuration already stored in the database.

[0126] Step S206: If the business environment is configured as the sample environment configuration, then obtain the business rendering parameters that match the sample environment configuration.

[0127] The business rendering parameters are obtained by training the initial rendering parameters in the second rendering rule based on the predicted and actual rendering values ​​of the sample texture under the sample environment configuration. The actual rendering value of the sample texture is determined based on the sample volume texture of the sample texture. The sample volume texture of the sample texture is generated by the first rendering rule. The first rendering rule is used to render virtual scenes containing media. The second rendering rule is used to render media scattering effects. In this embodiment, when the sample environment configuration is stored in the database, if the business environment configuration is the sample environment configuration, the computer device can search for a business rendering distribution map that matches the sample environment configuration in the database based on the association relationship of the sample environment configuration. Here, the business rendering distribution map may include a first rendering distribution map associated with the first scattering parameter, a second rendering distribution map associated with the second scattering parameter, and a third rendering distribution map associated with the brightness parameter. In some embodiments, the computer device needs to determine the angle to be rendered corresponding to the first texture. Then, in the first rendering distribution map, the scattering coefficient corresponding to the angle to be rendered is determined as the first coefficient to be processed. In the second rendering distribution map, the scattering coefficient corresponding to the angle to be rendered is determined as the second coefficient to be processed. In the third rendering distribution map, the virtual light source brightness corresponding to the angle to be rendered is determined as the brightness to be processed. Thus, the first coefficient to be processed, the second coefficient to be processed, and the brightness to be processed can be determined as business rendering parameters that match the sample environment configuration.

[0128] In some embodiments, if no sample environment configuration matching the business environment configuration exists in the database, the computer device can use the business environment configuration as the updated sample configuration (i.e., the new sample environment configuration) and the first texture as the updated sample texture (i.e., the new sample texture) under the updated sample configuration. In some embodiments, the computer device can obtain the sample volume texture of the updated sample texture generated by the first rendering rule, and based on the sample volume texture of the updated sample texture, determine the actual rendering value of the updated sample texture under the updated sample configuration and the reference depth data of the updated sample texture, and then determine the predicted rendering value of the updated sample texture under the updated sample configuration using the initial rendering parameters in the second rendering rule and the reference depth data of the updated sample texture. Then, the computer device can train the initial rendering parameters based on the actual rendering value and the predicted rendering value of the updated sample texture under the updated sample configuration to obtain updated rendering parameters matching the updated sample configuration, and then store the updated sample configuration in the database based on the updated rendering parameters.

[0129] Step S207: Based on the business rendering parameters and the second rendering rules, render the medium scattering effect of the first texture to obtain the second texture.

[0130] The business rendering parameters here can include rendering parameters corresponding to multiple angles to be rendered. In this embodiment, the computer device can refer to the second rendering rules shown in formulas (5) to (9) above, and the rendering parameters under each angle to be rendered, to render the medium scattering effect of the first texture respectively, so as to obtain a second texture that matches the angle to be rendered. Among them, when the angle to be rendered changes from the first angle threshold to the second angle threshold in sequence, the computer device can obtain multiple second textures, thereby realizing real-time rendering of the medium scattering effect of the first texture.

[0131] For ease of understanding, please refer to Figure 6 in some embodiments. Figure 6 is a schematic diagram of a scene for rendering a medium scattering effect according to an embodiment of this application. As shown in Figure 6, the texture 60P can be a texture (i.e., the first texture) obtained by the computer device in this embodiment that needs to render a medium scattering effect (e.g., an atmospheric perspective effect). The texture 60P can be the original texture without scattering simulation rendering, or it can be a texture obtained after simulating and rendering a virtual scene containing a medium (e.g., a sky effect) based on the original texture. It will not be limited here.

[0132] As shown in Figure 6, the database 600K can store business rendering parameters trained by computer devices that match the sample environment configurations. For example, the database 600K can store a relational table indicating the association relationships of the sample environment configurations. This relational table can include multiple sample environment configurations. For ease of explanation, this embodiment can use two sample environment configurations as an example, which can include environment configuration 1 (e.g., Earth) and environment configuration 2 (e.g., Mars).

[0133] For ease of understanding, please refer to Table 1 in some embodiments. Table 1 is a relational table stored in a database provided in this application embodiment. This relational table may include a sample environment configuration column, an actual training column, and a business rendering distribution map column. Of course, the relational table may also include other columns, which will not be limited here. Here, the training column refers to the rendering parameters at the elevation angles of each virtual light source actually trained under the sample environment configuration. As shown in Table 1:

[0134] Table 1

[0135] Taking environment configuration 1 as an example, since the business object can add virtual light source height angles 1φ1 (e.g., -5°), 1φ2 (e.g., 0°), 1φ3 (e.g., 10°), and 1φ4 (e.g., 60°) when performing an attribute addition operation on the configuration control of the reference attribute, the computer device can obtain these four virtual light source height angles. Then, it can combine the first rendering rule and the second rendering rule to train the rendering parameters for each of these four virtual light source height angles, obtaining the rendering parameters corresponding to each virtual light source height angle. In some embodiments, the computer device can fit the four rendering parameters within the angle range of the virtual light source height angles to obtain a business rendering distribution map matching environment configuration 1, which may include rendering distribution map 10F1, rendering distribution map 10F2, and rendering distribution map 10F3. Among them, rendering distribution map 10F1 is used to represent the first rendering distribution map associated with the first scattering parameter, that is, rendering distribution map 10F1 is a rendering distribution map associated with the scattering coefficient of Rayleigh scattering; rendering distribution map 10F2 is used to represent the second rendering distribution map associated with the second scattering parameter, that is, rendering distribution map 10F2 is a rendering distribution map associated with the scattering coefficient of Mie scattering; rendering distribution map 10F3 is used to represent the third rendering distribution map associated with the brightness parameter, that is, rendering distribution map 10F3 is a rendering distribution map associated with the brightness of the virtual light source.

[0136] It is understandable that when the computer device acquires texture 60P, it can determine the business environment configuration of texture 60P, and then search in database 600K based on the business environment configuration of texture 60P. If the business environment configuration of texture 60P is a sample environment configuration included in Table 1 above (for example, environment configuration 1), then the computer device can directly obtain the business rendering parameters that match environment configuration 1 according to Table 1 above.

[0137] If the rendering angle corresponding to the first texture (e.g., 10°) belongs to the virtual light source elevation angle in the actual training column corresponding to environment configuration 1, the computer device can directly find the rendering parameters that match the rendering angle in the actual training column as the business rendering parameters. Alternatively, if the rendering angle (e.g., 20°) does not belong to the virtual light source elevation angle in the actual training column corresponding to environment configuration 1, when the rendering accuracy requirement is low, the computer device can quickly find the rendering parameters that match the rendering angle in the three rendering distribution maps of the business rendering distribution map that match environment configuration 1, respectively, as the business rendering parameters. For example, the computer device can find the scattering coefficient corresponding to the rendering angle in rendering distribution map 10F1, the scattering coefficient corresponding to the rendering angle in rendering distribution map 10F2, and the virtual light source brightness corresponding to the rendering angle in rendering distribution map 10F3, and then use these three determined parameters as the business rendering parameters that match the sample environment configuration. Of course, since the 20-degree virtual light source elevation angle is a business rendering parameter read from the business rendering distribution map, when the rendering accuracy requirement is too high, the computer device can also use the first texture as a new sample texture, and combine it with the first and second rendering rules to retrain the business rendering parameters at the 20-degree virtual light source elevation angle. Then, the computer device can update Table 1 above based on the 20-degree virtual light source elevation angle business rendering parameters.

[0138] In some embodiments, if the service environment configuration of texture 60P is environment configuration 3 (e.g., the moon), and there is no sample environment configuration matching environment configuration 3 in Table 1 stored in database 600K, it means that the computer device cannot obtain service rendering parameters matching environment configuration 3 based on Table 1. In this case, the computer device can use the first texture as a new sample texture and, in combination with the first rendering rule and the second rendering rule, retrain the service rendering parameters matching environment configuration 3.

[0139] For example, the computer device can use environment configuration 3 as the updated sample configuration (i.e., the new sample environment configuration) and the first texture as the updated sample texture (i.e., the new sample texture) under the updated sample configuration. Then, referring to the parameter training method for the sample environment configuration described above, the initial rendering parameters of the updated sample configuration are trained to obtain updated rendering parameters that match the updated sample configuration. This allows the establishment of a relationship between environment configuration 3, the rendering parameters under the actual trained virtual light source elevation angle, and the business rendering distribution map that matches environment configuration 3, and stores this relationship in Table 1 above for updating Table 1.

[0140] When the business rendering parameters matching the business environment configuration of texture 60P are obtained, for example, when rendering parameters 6U2 are obtained, the computer device can render the atmospheric perspective effect of texture 60P in real time according to the rendering parameters of the angle to be rendered included in rendering parameters 6U2, so as to obtain the second texture corresponding to the angle to be rendered, for example, texture 61P, thereby improving rendering efficiency. Since atmospheric scattering algorithms are mostly screen space rendering algorithms, the embodiments of this application do not rely on a specific differentiable renderer, and may even be implemented without a differentiable renderer. The embodiments of this application can utilize the automatic differentiation function of machine learning (e.g., PyTorch) for applications such as image recognition and language processing to render atmospheric perspective effects.

[0141] Therefore, the embodiments of this application can combine old simplified algorithms and new physical algorithms to solve the efficiency problem of real-time rendering of the medium scattering effect of textures. By using the intermediate data of the first rendering rule (i.e. 3DVolume texture) combined with differentiable rendering technology to derive the difficult-to-adjust parameters in the second rendering rule, the entire scattering rendering system can achieve a balance between correct effect, high production efficiency and rendering efficiency.

[0142] In some embodiments, please refer to FIG7, which is a schematic diagram of the structure of a data processing device provided in an embodiment of this application. As shown in FIG7, the data processing device 1 may be a computer program (including program code) running on a computer device, for example, the data processing device 1 may be an application software; the data processing device 1 may be used to execute the corresponding steps in the data processing method provided in the embodiment of this application. As shown in FIG7, the data processing device 1 may run on a computer device with rendering function, which may be the server 10F in the embodiment corresponding to FIG1 above, or any terminal device in the terminal device cluster in the embodiment corresponding to FIG1 above, for example, terminal device 100a. The data processing device 1 may include: a rule acquisition module 10, a sample reference module 20, a sample prediction module 30, and a training module 40.

[0143] The system includes a rule acquisition module 10, configured to acquire rendering rules, including a first rendering rule and a second rendering rule. The first rendering rule is used to render a virtual scene containing a medium, and the second rendering rule is used to render the medium scattering effect. A sample reference module 20 is configured to acquire the sample volume texture of the sample texture generated by the first rendering rule, and based on the sample volume texture, determine the actual rendering value of the sample texture under the sample environment configuration and the reference depth data of the sample texture. A sample prediction module 30 is configured to determine the predicted rendering value of the sample texture under the sample environment configuration based on the initial rendering parameters and reference depth data in the second rendering rule. A training module 40 is configured to train the initial rendering parameters based on the predicted rendering value and the actual rendering value to obtain business rendering parameters that match the sample environment configuration. The business rendering parameters are used to render the medium scattering effect of the first texture, and the business environment configuration of the first texture is the sample environment configuration.

[0144] In some embodiments, the sample reference module 20 is further configured to obtain reference attributes for the sample texture; and based on the virtual light source elevation angle included in the reference attributes and the sample texture, obtain a sample volume texture generated by the first rendering rule that matches the virtual light source elevation angle.

[0145] In some embodiments, the sample reference module 20 is further configured to acquire a preset depth data set including N initial depth data; determine slice data of the sample volume texture at the virtual light source elevation angle based on the N initial depth data and the sample volume texture; the slice data includes N sample sub-images; N is a positive integer; determine a reference image of the sample texture at the virtual light source elevation angle from the N sample sub-images; determine the rendering value of the reference image as the actual rendering value of the sample texture under the sample environment configuration, and determine the initial depth data of the reference image as the reference depth data.

[0146] In some embodiments, the virtual light source elevation angle includes the solar elevation angle; the sample volume texture includes a first sample volume texture and a second sample volume texture; the first sample volume texture refers to a volume texture used to simulate daytime under the sample environment configuration; the second sample volume texture refers to a volume texture used to simulate sunset under the sample environment configuration; the sample reference module 20 is further configured to display a business configuration interface for the atmospheric rendering component in the business engine; the business configuration interface includes a configuration control for the solar elevation angle; in response to an attribute addition operation for the configuration control, a first elevation angle for exporting the first sample volume texture and a second elevation angle for exporting the second sample volume texture are obtained; the first elevation angle is greater than the second elevation angle; the first elevation angle and the second elevation angle are determined as reference attributes for the sample texture.

[0147] In some embodiments, the sample reference module 20 is further configured to traverse the N sample sub-images, determine the traversed sample sub-images as sub-images to be processed; rasterize the texture mesh of the sub-images to be processed to obtain the coordinate position corresponding to each pixel in the sub-images to be processed; based on the coordinate position corresponding to each pixel, perform superposition processing on the pixel value of each pixel to obtain the total pixel value corresponding to the sub-images to be processed, until the traversal ends and N total pixel values ​​are obtained; and select the sample sub-image with the largest total pixel value from the N sample sub-images as the reference image of the sample texture under the virtual light source elevation angle.

[0148] In some embodiments, the initial rendering parameters include a first scattering parameter, a second scattering parameter, and a brightness parameter; the first scattering parameter and the second scattering parameter correspond to different scattering methods; the brightness parameter is used to indicate the brightness of the virtual light source; the sample volume texture is a volume texture generated by the first rendering rule that matches the elevation angle of the virtual light source; the sample prediction module 30 is further configured to obtain the initial rendering value of the sample texture; determine the transmittance corresponding to the sample texture based on the initial scattering coefficient of the first scattering parameter, the initial scattering coefficient of the second scattering parameter, and the reference depth data; determine the internal scattering parameter of the sample texture at the elevation angle of the virtual light source based on the initial scattering coefficient of the first scattering parameter, the initial scattering coefficient of the second scattering parameter, the brightness parameter, and the reference depth data; and determine the predicted rendering value of the sample texture under the sample environment configuration based on the initial rendering value, the transmittance, and the internal scattering parameter.

[0149] In some embodiments, the virtual light source elevation angle refers to the elevation angle corresponding to the directional light emitted by the virtual light source; the sample prediction module 30 is further configured to determine the angle between the directional light emitted by the virtual light source and the current line of sight; determine the updated scattering coefficient of the first scattering parameter based on the initial scattering coefficient of the first scattering parameter and the angle; determine the updated scattering coefficient of the second scattering parameter based on the initial scattering coefficient of the second scattering parameter and the angle; and determine the internal scattering parameters of the sample texture at the virtual light source elevation angle based on the initial scattering coefficient of the first scattering parameter, the updated scattering coefficient of the first scattering parameter, the initial scattering coefficient of the second scattering parameter, the updated scattering coefficient of the second scattering parameter, the brightness parameter, and the reference depth data.

[0150] In some embodiments, the training module 40 is further configured to determine the total rendering loss of the sample texture based on the predicted rendering value and the actual rendering value; to perform iterative training on the initial rendering parameters based on the total rendering loss to obtain parameter training results; if the parameter training results indicate that the initial rendering parameters after iterative training meet the training cutoff condition, then the initial rendering parameters that meet the training cutoff condition are determined as business rendering parameters that match the sample environment configuration.

[0151] In some embodiments, the sample texture includes M pixels; M is a positive integer; the M pixels include pixel X. i i is a positive integer less than or equal to M; the training module 40 is further configured to obtain the pixel X from the predicted rendering value. i Predicted rendering value Y i Obtain the pixel X from the actual rendered value. i The actual rendered value y i ; the predicted rendering value Y i and the actual rendered value y i The rendering difference between them is determined as the pixel X. i The rendering loss is calculated until the rendering loss corresponding to each of the M pixels is obtained; based on the M rendering losses, the total rendering loss corresponding to the sample texture is determined.

[0152] In some embodiments, the business rendering parameters are rendering parameters corresponding to the target virtual light source elevation angle under the sample environment configuration; the target virtual light source elevation angle is any one of Z virtual light source elevation angles; Z is a positive integer greater than 1; the Z virtual light source elevation angles are elevation angles obtained when responding to a trigger operation performed by a configuration control for a reference attribute; the device further includes: a rendering parameter acquisition module, configured to acquire rendering parameters corresponding to each of the Z virtual light source elevation angles; each rendering parameter includes a first scattering parameter, a second scattering parameter, and a brightness parameter; a first fitting module, configured to determine a first scattering coefficient associated with each of the Z rendering parameters to obtain Z first scattering coefficients; and to fit the determined Z first scattering coefficients within the angle range of the virtual light source elevation angle to obtain... A first rendering distribution map associated with the first scattering parameter; a second fitting module configured to determine, from Z rendering parameters, a second scattering coefficient associated with each of the second scattering parameters, to obtain Z second scattering coefficients; and to fit the determined Z second scattering coefficients within the angular range of the virtual light source elevation angle to obtain a second rendering distribution map associated with the second scattering parameter; a third fitting module configured to determine, from Z rendering parameters, a virtual light source brightness associated with each of the brightness parameters, to obtain Z virtual light source brightness; and to fit the determined Z virtual light source brightness within the angular range of the virtual light source elevation angle to obtain a third rendering distribution map associated with the brightness parameter; and a distribution map determination module configured to determine the first rendering distribution map, the second rendering distribution map, and the third rendering distribution map as a business rendering distribution map matching the sample environment configuration.

[0153] In some embodiments, please refer to FIG8, which is a schematic diagram of another data processing device provided in the embodiments of this application. The data processing device 2 can be a computer program (including program code) running on a computer device; for example, the data processing device 2 is an application software. The data processing device 2 can be used to execute the corresponding steps in the method provided in the embodiments of this application. As shown in FIG8, the data processing device 2 can run on a computer device with rendering capabilities. This computer device can be the server 10F in the embodiment corresponding to FIG1 above, or any terminal device in the terminal device cluster in the embodiment corresponding to FIG1 above, for example, terminal device 100a. The data processing device 2 may include: a configuration acquisition module 100, a business parameter acquisition module 200, and a rendering module 300.

[0154] The configuration acquisition module 100 is configured to acquire the business environment configuration for the first texture when performing scattering simulation rendering on the first texture; the business parameter acquisition module 200 is configured to acquire business rendering parameters matching the sample environment configuration if the business environment configuration is the sample environment configuration; the business rendering parameters are obtained by training the initial rendering parameters in the second rendering rule based on the predicted rendering value and the actual rendering value of the sample texture under the sample environment configuration; the actual rendering value of the sample texture is determined based on the sample volume texture of the sample texture; the sample volume texture of the sample texture is generated by the first rendering rule; the first rendering rule is used to render the virtual scene containing the medium; the second rendering rule is used to render the medium scattering effect; the rendering module 300 is configured to render the medium scattering effect of the first texture based on the business rendering parameters and the second rendering rule to obtain the second texture.

[0155] In some embodiments, the sample environment configuration is stored in a database; the service parameter acquisition module 200 is further configured to, if the service environment configuration is the sample environment configuration, search the database for a service rendering distribution map that matches the sample environment configuration based on the association relationship of the sample environment configuration; the service rendering distribution map includes a first rendering distribution map associated with a first scattering parameter, a second rendering distribution map associated with a second scattering parameter, and a third rendering distribution map associated with a brightness parameter; determine the angle to be rendered corresponding to the first texture; in the first rendering distribution map, determine the scattering coefficient corresponding to the angle to be rendered as the first coefficient to be processed; in the second rendering distribution map, determine the scattering coefficient corresponding to the angle to be rendered as the second coefficient to be processed; in the third rendering distribution map, determine the virtual light source brightness corresponding to the angle to be rendered as the brightness to be processed; and determine the first coefficient to be processed, the second coefficient to be processed, and the brightness to be processed as the service rendering parameters that match the sample environment configuration.

[0156] In some embodiments, the apparatus further includes: a sample update module configured to determine the business environment configuration as an updated sample configuration and the first texture as an updated sample texture under the updated sample configuration if no sample environment configuration matching the business environment configuration exists in the database; a reference update module configured to obtain the sample volume texture of the updated sample texture generated by the first rendering rule; and determine the actual rendering value of the updated sample texture under the updated sample configuration and the reference depth data of the updated sample texture based on the sample volume texture of the updated sample texture; a prediction update module configured to determine the predicted rendering value of the updated sample texture under the updated sample configuration based on the initial rendering parameters in the second rendering rule and the reference depth data of the updated sample texture; a training update module configured to train the initial rendering parameters based on the actual rendering value of the updated sample texture under the updated sample configuration and the predicted rendering value of the updated sample texture under the updated sample configuration to obtain updated rendering parameters matching the updated sample configuration; and a storage update module configured to store the updated sample configuration in the database based on the updated rendering parameters.

[0157] In some embodiments, please refer to FIG9, which is a schematic diagram of a computer device provided in an embodiment of this application. As shown in FIG9, the computer device 1000 can be a computer device with rendering capabilities. The computer device 1000 may include: at least one processor 1001, such as a CPU, at least one network interface 1004, a memory 1005, and at least one communication bus 1002. The communication bus 1002 is used to implement communication between these components. The network interface 1004 may include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory, such as at least one disk storage device. Optionally, the memory 1005 may also be at least one storage device located remotely from the aforementioned processor 1001. As shown in FIG9, the memory 1005, as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a device control application. In some embodiments, the computer device may also include the user interface 1003 shown in FIG9. For example, if the computer device is a terminal device with rendering function as shown in FIG1, such as terminal device 100a, the computer device may also include the user interface 1003, wherein the user interface 1003 may include a display screen, a keyboard, etc.

[0158] In the computer device 1000 shown in Figure 9, the network interface 1004 is mainly used for network communication; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve: obtaining rendering rules; the rendering rules include a first rendering rule and a second rendering rule; the first rendering rule is used to render a virtual scene containing a medium; the second rendering rule is used to render the medium scattering effect; obtaining the sample volume texture of the sample map generated by the first rendering rule, and based on the sample volume texture, determining the actual rendering value of the sample map under the sample environment configuration and the reference depth data of the sample map; determining the predicted rendering value of the sample map under the sample environment configuration based on the initial rendering parameters and the reference depth data in the second rendering rule; training the initial rendering parameters based on the predicted rendering value and the actual rendering value to obtain business rendering parameters that match the sample environment configuration; the business rendering parameters are used to render the medium scattering effect of the first map; the business environment configuration of the first map is the sample environment configuration.

[0159] The processor 1001 can also be used to call the device control application stored in the memory 1005 to: obtain the business environment configuration for the first texture when performing scattering simulation rendering on the first texture; if the business environment configuration is a sample environment configuration, obtain the business rendering parameters that match the sample environment configuration; the business rendering parameters are obtained by training the initial rendering parameters in the second rendering rule based on the predicted rendering value and the actual rendering value of the sample texture under the sample environment configuration; the actual rendering value of the sample texture is determined based on the sample volume texture of the sample texture; the sample volume texture of the sample texture is generated by the first rendering rule; the first rendering rule is used to render the virtual scene containing the medium; the second rendering rule is used to render the medium scattering effect; based on the business rendering parameters and the second rendering rule, render the medium scattering effect of the first texture to obtain the second texture.

[0160] It should be understood that the computer device 1000 described in the embodiments of this application can execute the data processing method described in the embodiments corresponding to Figures 3 and 5 above, and can also execute the data processing device 1 described in the embodiment corresponding to Figure 7 above, or the data processing device 2 described in the embodiment corresponding to Figure 8 above, which will not be repeated here. In addition, the beneficial effects of using the same method will not be repeated here either.

[0161] Furthermore, it should be noted that this application also provides a computer-readable storage medium storing a computer program executed by the aforementioned data processing device 1 or data processing device 2. This computer program includes program instructions, which, when executed by the processor, enable the execution of the data processing method described in the embodiments corresponding to Figures 3 or 5. Therefore, further details will not be repeated here. Additionally, the beneficial effects of using the same method will not be repeated. For technical details not disclosed in the embodiments of the computer-readable storage medium involved in this application, please refer to the description of the method embodiments of this application. As an example, the program instructions can be deployed to execute on a single computer device, or on multiple computer devices located in one location, or on multiple computer devices distributed across multiple locations and interconnected via a communication network. These multiple computer devices distributed across multiple locations and interconnected via a communication network can constitute a blockchain system.

[0162] This application also provides a computer-readable storage medium storing a computer program. The computer program includes program instructions, which, when executed by a processor, implement the data processing methods provided in the steps of Figures 3 and 5. Please refer to the implementation methods provided in the steps of Figures 3 and 5, which will not be repeated here.

[0163] In some embodiments, please refer to FIG10, which is a schematic diagram of the structure of a data processing system provided in an embodiment of this application. The data processing system 3 may include a data processing device 1a and a data processing device 2a. The data processing device 1a may be the data processing device 1 in the embodiment corresponding to FIG7. It is understood that the data processing device 1a may be integrated into the aforementioned computer device with rendering capabilities. This computer device may be the server 10F in the embodiment corresponding to FIG1, or any terminal device in the terminal device cluster in the embodiment corresponding to FIG1, such as terminal device 100a. Therefore, further details will not be provided here. The data processing device 2a may be the data processing device 2 in the embodiment corresponding to FIG8. It is understood that the data processing device 2a may be integrated into the aforementioned computer device with rendering capabilities. This computer device may be the server 10F in the embodiment corresponding to FIG1, or any terminal device in the terminal device cluster in the embodiment corresponding to FIG1, such as terminal device 100a. Therefore, further details will not be provided here. Furthermore, the beneficial effects of using the same method will not be described in detail. For technical details not disclosed in the embodiments of the data processing system involved in this application, please refer to the description of the method embodiments of this application.

[0164] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0165] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.

Claims

1. A data processing method, executed by a computer device, comprising: obtaining a rendering rule; the rendering rule comprising a first rendering rule and a second rendering rule; the first rendering rule being used for rendering a virtual scene containing media; the second rendering rule being used for rendering a media scattering effect; obtaining a sample volume texture of a sample map generated by the first rendering rule; determining, based on the sample volume texture, an actual rendering value of the sample map under a sample environment configuration and reference depth data of the sample map, respectively; determining, based on an initial rendering parameter in the second rendering rule and the reference depth data, a predicted rendering value of the sample map under the sample environment configuration; training, based on the predicted rendering value and the actual rendering value, the initial rendering parameter to obtain a business rendering parameter matched with the sample environment configuration; the business rendering parameter being used for rendering a media scattering effect of a first map; a business environment configuration of the first map being the sample environment configuration.

2. The method of claim 1, wherein, The obtaining of the sample volume texture of the sample map generated by the first rendering rule comprises: obtaining reference attributes for the sample map; obtaining, based on a virtual light source elevation angle included in the reference attributes and the sample map, a sample volume texture generated by the first rendering rule and matched with the virtual light source elevation angle.

3. The method of claim 2, wherein, The determining, based on the sample volume texture, of the actual rendering value of the sample map under the sample environment configuration and the reference depth data of the sample map, respectively, comprises: obtaining a preset depth data set comprising N initial depth data; determining, based on the N initial depth data and the sample volume texture, slice data of the sample volume texture under the virtual light source elevation angle; the slice data comprising N sample subgraphs; N being a positive integer; determining, from the N sample subgraphs, a reference image of the sample map under the virtual light source elevation angle; determining a rendering value of the reference image as the actual rendering value of the sample map under the sample environment configuration, and determining an initial depth data of the reference image as the reference depth data.

4. The method of claim 2 or 3, wherein, The virtual light source elevation angle comprises a solar elevation angle; the sample volume texture comprises a first sample volume texture and a second sample volume texture; the first sample volume texture refers to a volume texture used for simulating daytime under the sample environment configuration; the second sample volume texture refers to a volume texture used for simulating sunset under the sample environment configuration; The obtaining of the reference attributes for the sample map comprises: displaying a business configuration interface for an atmospheric rendering component in a business engine; the business configuration interface comprising a configuration control for the solar elevation angle; in response to an attribute adding operation on the configuration control, obtaining a first elevation angle used for exporting the first sample volume texture and a second elevation angle used for exporting the second sample volume texture; the first elevation angle being greater than the second elevation angle; determining the first elevation angle and the second elevation angle as the reference attributes for the sample map.

5. The method of claim 3, wherein, The determining the reference image of the sample map at the virtual light source elevation angle from the N sample subgraphs comprises: traversing the N sample subgraphs, and determining a traversed sample subgraph as a to-be-processed subgraph; rasterizing a texture mesh of the to-be-processed subgraph to obtain a coordinate position corresponding to each pixel point in the to-be-processed subgraph; based on the coordinate position corresponding to each pixel point, performing superposition processing on a pixel value of each pixel point, obtaining a total pixel value corresponding to the to-be-processed subgraph until the traversal ends, and obtaining N total pixel values; from the N sample subgraphs, selecting a sample subgraph with a maximum total pixel value as the reference image of the sample map at the virtual light source elevation angle.

6. The method according to any one of claims 1 to 5, wherein, The initial rendering parameters include a first scattering parameter, a second scattering parameter, and a brightness parameter; the first scattering parameter and the second scattering parameter correspond to different scattering modes respectively; and the brightness parameter is used to indicate virtual light source brightness. The sample volume texture is a volume texture generated by the first rendering rule and matched with the virtual light source elevation angle. The determining the predicted rendering value of the sample map under the sample environment configuration based on the initial rendering parameters in the second rendering rule and the reference depth data comprises: obtaining an initial rendering value of the sample map; based on an initial scattering coefficient of the first scattering parameter, an initial scattering coefficient of the second scattering parameter, and the reference depth data, determining a transmittance corresponding to the sample map; based on the initial scattering coefficient of the first scattering parameter, the initial scattering coefficient of the second scattering parameter, the brightness parameter, and the reference depth data, determining an internal scattering parameter of the sample map at the virtual light source elevation angle; based on the initial rendering value, the transmittance, and the internal scattering parameter, determining the predicted rendering value of the sample map under the sample environment configuration.

7. The method of claim 6, wherein, The virtual light source elevation angle refers to an elevation angle corresponding to a directional light emitted by a virtual light source; The determining the internal scattering parameter of the sample map at the virtual light source elevation angle based on the initial scattering coefficient of the first scattering parameter, the initial scattering coefficient of the second scattering parameter, the brightness parameter, and the reference depth data comprises: determining an included angle between the directional light emitted by the virtual light source and a current line of sight; based on the initial scattering coefficient of the first scattering parameter and the included angle, determining an updated scattering coefficient of the first scattering parameter; based on the initial scattering coefficient of the second scattering parameter and the included angle, determining an updated scattering coefficient of the second scattering parameter; based on the initial scattering coefficient of the first scattering parameter, the updated scattering coefficient of the first scattering parameter, the initial scattering coefficient of the second scattering parameter, the updated scattering coefficient of the second scattering parameter, the brightness parameter, and the reference depth data, determining the internal scattering parameter of the sample map at the virtual light source elevation angle.

8. The method according to any one of claims 1 to 7, wherein, The training the initial rendering parameters based on the predicted rendering value and the actual rendering value to obtain a service rendering parameter matched with the sample environment configuration comprises: determine a total rendering loss of the sample map based on the predicted rendering value and the actual rendering value; perform iterative training on the initial rendering parameter based on the total rendering loss to obtain a parameter training result; if the parameter training result indicates that the initial rendering parameter after iterative training meets a training stop condition, determine the initial rendering parameter meeting the training stop condition as a service rendering parameter matched with the sample environment configuration.

9. The method of claim 8, wherein, The sample map comprises M pixel points; M is a positive integer; the M pixel points comprise a pixel point X i ; i is a positive integer less than or equal to M; the determining of the total rendering loss of the sample map based on the predicted rendering value and the actual rendering value comprises: obtaining a predicted rendering value Y for the pixel point X from the predicted rendering value i obtaining an actual rendering value y for the pixel point X from the actual rendering value i i i ;​​ determining a rendering loss of the pixel point X i by a rendering difference value between the predicted rendering value Y i and the actual rendering value y i , until M pixel points respectively correspond to the rendering loss. determining the total rendering loss corresponding to the sample map based on the M rendering losses.

10. The method according to any one of claims 1 to 9, wherein, the service rendering parameter is a rendering parameter corresponding to a target virtual light source elevation angle of the sample environment configuration; the target virtual light source elevation angle is any one of Z virtual light source elevation angles; Z is a positive integer greater than 1; the Z virtual light source elevation angles are obtained when a trigger operation performed in response to a configuration control of a reference attribute is performed; the method further comprises: obtaining a rendering parameter corresponding to each of the Z virtual light source elevation angles; each rendering parameter includes a first scattering parameter, a second scattering parameter, and a brightness parameter; determining a first scattering coefficient associated with each first scattering parameter from the Z rendering parameters to obtain Z first scattering coefficients; fitting the determined Z first scattering coefficients in an angle interval of the virtual light source elevation angle to obtain a first rendering distribution map associated with the first scattering parameter; determining a second scattering coefficient associated with each second scattering parameter from the Z rendering parameters to obtain Z second scattering coefficients; fitting the determined Z second scattering coefficients in the angle interval of the virtual light source elevation angle to obtain a second rendering distribution map associated with the second scattering parameter; determining a virtual light source brightness associated with each brightness parameter from the Z rendering parameters to obtain Z virtual light source brightnesses; fitting the determined Z virtual light source brightnesses in the angle interval of the virtual light source elevation angle to obtain a third rendering distribution map associated with the brightness parameter; determining the first rendering distribution map, the second rendering distribution map, and the third rendering distribution map as service rendering distribution maps matched with the sample environment configuration.

11. A data processing method, the method being performed by a computer device, comprising: obtaining a service environment configuration for a first map when performing scattering simulation rendering on the first map; if the service environment configuration is a sample environment configuration, obtaining a service rendering parameter matched with the sample environment configuration; The business rendering parameter is obtained by training an initial rendering parameter in a second rendering rule based on a predicted rendering value and an actual rendering value of a sample map under a sample environment configuration; the actual rendering value of the sample map is determined based on a sample volume texture of the sample map; the sample volume texture of the sample map is generated by a first rendering rule; the first rendering rule is used for rendering a virtual scene containing media; and the second rendering rule is used for rendering a media scattering effect; The media scattering effect of the first map is rendered based on the business rendering parameter and the second rendering rule to obtain a second map.

12. The method of claim 11, wherein, The sample environment configuration is stored in a database; If the business environment configuration is the sample environment configuration, the business rendering parameter matched with the sample environment configuration is obtained, including: If the business environment configuration is the sample environment configuration, a business rendering distribution map matched with the sample environment configuration is searched in the database based on an association relationship of the sample environment configuration; the business rendering distribution map includes a first rendering distribution map associated with a first scattering parameter, a second rendering distribution map associated with a second scattering parameter, and a third rendering distribution map associated with a brightness parameter; A to-be-rendered angle corresponding to the first map is determined; In the first rendering distribution map, a scattering coefficient corresponding to the to-be-rendered angle is determined as a first to-be-processed coefficient; in the second rendering distribution map, a scattering coefficient corresponding to the to-be-rendered angle is determined as a second to-be-processed coefficient; and in the third rendering distribution map, a virtual light source brightness corresponding to the to-be-rendered angle is determined as a to-be-processed brightness; The first to-be-processed coefficient, the second to-be-processed coefficient, and the to-be-processed brightness are determined as the business rendering parameter matched with the sample environment configuration.

13. The method of claim 12, wherein, The method further includes: If there is no sample environment configuration matched with the business environment configuration in the database, the business environment configuration is determined as an updated sample configuration, and the first map is determined as an updated sample map under the updated sample configuration; A sample volume texture of the updated sample map generated by the first rendering rule is obtained; Actual rendering values of the updated sample map under the updated sample configuration and reference depth data of the updated sample map are respectively determined based on the sample volume texture of the updated sample map; A predicted rendering value of the updated sample map under the updated sample configuration is determined based on an initial rendering parameter in the second rendering rule and the reference depth data of the updated sample map; The initial rendering parameter is trained based on the actual rendering value of the updated sample map under the updated sample configuration and the predicted rendering value of the updated sample map under the updated sample configuration to obtain an updated rendering parameter matched with the updated sample configuration; The updated sample configuration is stored in the database based on the updated rendering parameter.

14. A data processing apparatus, comprising: a rule obtaining module, configured to obtain a rendering rule; the rendering rule comprises a first rendering rule and a second rendering rule; the first rendering rule is used for rendering a virtual scene containing media; the second rendering rule is used for rendering a media scattering effect; a sample reference module, configured to obtain a sample volume texture of a sample map generated by the first rendering rule; based on the sample volume texture, respectively determine an actual rendering value of the sample map under a sample environment configuration and reference depth data of the sample map; a sample prediction module, configured to determine a predicted rendering value of the sample map under the sample environment configuration based on an initial rendering parameter in the second rendering rule and the reference depth data; a training module, configured to train the initial rendering parameter based on the predicted rendering value and the actual rendering value, to obtain a service rendering parameter matched with the sample environment configuration; the service rendering parameter is used for rendering a media scattering effect of a first map; a service environment configuration of the first map is the sample environment configuration.

15. A data processing apparatus, comprising: a configuration obtaining module, configured to obtain a service environment configuration for a first map when performing scattering simulation rendering on the first map; a service parameter obtaining module, configured to obtain a service rendering parameter matched with the sample environment configuration if the service environment configuration is a sample environment configuration; the service rendering parameter is obtained by training an initial rendering parameter in a second rendering rule based on a predicted rendering value and an actual rendering value of a sample map under the sample environment configuration; the actual rendering value of the sample map is determined based on a sample volume texture of the sample map; the sample volume texture of the sample map is generated by a first rendering rule; the first rendering rule is used for rendering a virtual scene containing media; the second rendering rule is used for rendering a media scattering effect; a rendering module, configured to render a media scattering effect of the first map based on the service rendering parameter and the second rendering rule, to obtain a second map.

16. A computer device comprising: a processor and a memory and a network interface; the processor is connected with the memory and the network interface, wherein the network interface is used for providing data communication function, the memory is used for storing a computer program, and the processor is used for calling the computer program, so that the computer equipment executes the data processing method in any one of claims 1 to 13.

17. A computer readable storage medium, the computer readable storage medium stores a computer program, the computer program is adapted to be loaded and executed by a processor, so that a computer equipment with the processor executes the data processing method in any one of claims 1 to 13.

18. A computer program product, the computer program product comprises a computer program, the computer program is stored in a computer readable storage medium; When a processor of a computer device reads the computer program from the computer readable storage medium and executes the computer program, the data processing method of any one of claims 1 to 13 is implemented.