Image rendering method, device, equipment and medium

By using random variables to update rendering coordinates based on noise textures and times, the method enhances the realism of water flow simulations in image rendering, addressing the regularity issues of trigonometric-based methods.

JP7609517B2Active Publication Date: 2025-01-07DOUYIN VISION CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2024520628
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2021-10-13
Filing Date
2022-09-29
Publication Date
2025-01-07
Estimated Expiration
2042-09-29

AI Technical Summary

Technical Problem

Existing image rendering methods using trigonometric functions to simulate water waves result in regular patterns that lack realism, failing to accurately represent the irregular motion of natural water flows.

Method used

An image rendering method that incorporates random variables to determine noise amounts and update rendering coordinates based on preset noise textures and rendering times, enhancing the irregularity and realism of water flow simulations.

Benefits of technology

The method improves the realism of water flow simulations by introducing random disturbances, making the rendered water waves appear more natural and realistic.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007609517000011
    Figure 0007609517000011
  • Figure 0007609517000012
    Figure 0007609517000012
  • Figure 0007609517000013
    Figure 0007609517000013
Patent Text Reader

Abstract

The embodiments of the present disclosure relate to an image rendering method, device, equipment, and medium, the method including: determining an initial rendering video stream of a background image captured in advance, obtaining initial rendering coordinates of each rendering pixel point in the initial rendering image of each frame in the video stream, obtaining a rendering time in the initial rendering video stream of the initial rendering image of each frame, determining a noise amount at the rendering time of each rendering pixel point according to the initial rendering coordinates, a preset noise texture, and the rendering time, obtaining a target rendering coordinate of each rendering pixel point according to the noise amount, updating the initial rendering coordinate of each rendering pixel point according to the target rendering coordinate to obtain a target rendering image, and rendering a background image according to the target rendering video stream composed of all the target rendering images, thereby generating a noise amount according to the noise texture and the rendering time of the rendering image, and determining the rendering coordinates using the noise amount as a random variable, thereby improving the realism of the image rendering effect.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] This application claims priority to a Chinese patent application filed on October 13, 2021, bearing application number 202111193061.0 and title "Image rendering method, apparatus, device and medium," the entire contents of which are incorporated herein by reference.

[0002] The present disclosure relates to the technical field of image processing, and in particular to an image rendering method, apparatus, device and medium. [Background technology]

[0003] With the advancement of image processing technology, rendering special effects on captured images has become a common image processing method, for example, rendering a special effect of flowing water waves on a captured image of the ground to create the effect of water flowing on the ground.

[0004] In a related technology, when adding water flow to the ground, a water surface texture map of a natural water surface such as an ocean or a lake is obtained, the time-varying coordinate positions of each pixel point in the water surface texture are calculated based on a time-varying trigonometric function, and a water flow effect is generated based on the coordinate positions.

[0005] However, since the above-mentioned method of adding water waves is realized based on trigonometric functions, the changes in the water waves become more regular. For example, as shown in FIG. 1, when adding a special water flow effect, although the pixel points in the water flow model visually flow with a regular trigonometric function waveform, the water waves in an actual environment cannot change regularly, so the rendering becomes less realistic. Summary of the Invention [Means for solving the problem]

[0006] In order to solve the above technical problem or at least partially solve the above technical problem, the present disclosure provides an image rendering method, the method including the steps of: determining an initial rendering video stream of a background image captured in advance, the initial rendering video stream including initial rendering images of a plurality of frames, and the initial rendering image of each frame being generated based on a reflection texture and a map texture; obtaining initial rendering coordinates of each rendering pixel point in the initial rendering image of each frame, and obtaining a rendering time of the initial rendering image of each frame in the initial rendering video stream; determining a noise amount at the rendering time of each rendering pixel point based on the initial rendering coordinates, a predetermined noise texture, and the rendering time, and calculating the noise amount based on a predetermined algorithm to obtain target rendering coordinates of each rendering pixel point; updating the initial rendering coordinates of each rendering pixel point in the initial rendering image of each frame based on the target rendering coordinates to obtain a target rendering image, and rendering the background image based on the target rendering video stream composed of all the target rendering images.

[0007] An embodiment of the present disclosure further provides an image rendering device, the device including: a first acquisition module for determining an initial rendering video stream of a pre-captured background image, where the initial rendering video stream includes initial rendering images of a plurality of frames, and the initial rendering image of each frame is generated based on a reflection texture and a map texture; a second acquisition module for acquiring initial rendering coordinates of each rendering pixel point in the initial rendering image of each frame and acquiring a rendering time in the initial rendering video stream of the initial rendering image of each frame; a determination module for determining a noise amount at the rendering time of each rendering pixel point based on the initial rendering coordinates, a predetermined noise texture and the rendering time; a third acquisition module for calculating the noise amount based on a predetermined algorithm and obtaining target rendering coordinates of each rendering pixel point; and a rendering module for updating the initial rendering coordinates of each rendering pixel point in the initial rendering image of each frame based on the target rendering coordinates to obtain a target rendering image, and rendering the background image based on the target rendering video stream composed of all the target rendering images.

[0008] An embodiment of the present disclosure further provides an electronic device, the electronic device including a processor and a memory for storing the processor-executable instructions, the processor being adapted to read the executable instructions from the memory and execute the instructions to realize an image rendering method according to an embodiment of the present disclosure.

[0009] An embodiment of the present disclosure further provides a computer-readable storage medium, in which a computer program is stored, the computer program being used to perform the image rendering method according to the embodiment of the present disclosure.

[0010] The technical solutions according to the embodiments of the present disclosure have the following advantages over the prior art:

[0011] The image rendering method according to the embodiment of the present disclosure includes determining an initial rendering video stream of a pre-recorded background image, the initial rendering video stream including initial rendering images of multiple frames, the initial rendering image of each frame being generated according to a reflection texture and a map texture, obtaining initial rendering coordinates of each rendering pixel point in the initial rendering image of each frame, obtaining a rendering time in the initial rendering video stream of the initial rendering image of each frame, determining a noise amount at the rendering time of each rendering pixel point according to the initial rendering coordinates, a preset noise texture and the rendering time, calculating the noise amount according to a preset algorithm to obtain a target rendering coordinate of each rendering pixel point, and finally updating the initial rendering coordinate of each rendering pixel point in the initial rendering image of each frame according to the target rendering coordinate to obtain a target rendering image, and rendering a background image according to the target rendering video stream composed of all the target rendering images, thereby generating a noise amount according to the noise texture and the rendering time of the rendering image, and determining the rendering coordinates using the noise amount as a random variable to improve the realism of the image rendering effect.

[0012] The above and other features, advantages and aspects of each embodiment of the present disclosure will become more apparent with reference to the following specific embodiments in conjunction with the drawings, in which like or similar reference numerals represent like or similar elements throughout the drawings. It is understood that the drawings are schematic, and that elements and components are not necessarily drawn to scale. [Brief description of the drawings]

[0013] [Figure 1] FIG. 1 is a diagram showing a flow scene of a water flow model according to an embodiment of the present disclosure. [Diagram 2] FIG. 2 is a flow chart of an image rendering method according to an embodiment of the present disclosure. [Diagram 3] FIG. 3 is a diagram illustrating another water flow model according to an embodiment of the present disclosure. [Figure 4] FIG. 4 is a schematic diagram of a surface normal vector of an object according to an embodiment of the present disclosure. [Diagram 5] FIG. 5 is a schematic diagram showing the relationship between a normal vector and a light source according to an embodiment of the present disclosure. [Figure 6] FIG. 6 is a schematic diagram of a binormal vector according to an embodiment of the present disclosure. [Figure 7] FIG. 7 is a schematic diagram of a noise texture according to an embodiment of the present disclosure. [Figure 8] FIG. 8 is a flowchart of another image rendering method according to an embodiment of the present disclosure. [Figure 9] FIG. 9 is a schematic diagram of the Fresnel effect according to an embodiment of the present disclosure. [Figure 10] FIG. 10 is a flowchart of another image rendering method according to an embodiment of the present disclosure. [Figure 11] FIG. 11 is a schematic diagram of a map texture according to an embodiment of the present disclosure. [Figure 12] FIG. 12 is a schematic diagram of tangent vector directions according to an embodiment of the present disclosure. [Figure 13] FIG. 13 is a flowchart of another image rendering method according to an embodiment of the present disclosure. [Figure 14] FIG. 14 is a flowchart of another image rendering method according to an embodiment of the present disclosure. [Figure 15] FIG. 15 is a flowchart of another image rendering method according to an embodiment of the present disclosure. [Figure 16] FIG. 16 is a structural schematic diagram of an image rendering device according to an embodiment of the present disclosure. [Figure 17] FIG. 17 is a structural schematic diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0014] Hereinafter, the embodiments of the present disclosure will be described in more detail with reference to the drawings. Although the drawings show some embodiments of the present disclosure, it should be understood that the present disclosure can be realized in various forms and should not be construed as being limited to the embodiments described herein, but rather these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are merely illustrative and are not intended to limit the scope of protection of the present disclosure.

[0015] It will be understood that the steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. Also, method embodiments may include additional steps and / or steps that are illustrated as being omitted from the execution. The scope of the present disclosure is not limited in this respect.

[0016] As used herein, the term "comprising" and variations thereof are intended to be open inclusive, i.e., meaning "including, but not limited to." The term "based on" means "based at least in part on." The term "one embodiment" refers to "at least one embodiment," the term "another embodiment" refers to "at least one other embodiment," and the term "some embodiments" refers to "at least some embodiments." Relevant definitions of other terms are provided below.

[0017] It should be noted that concepts such as "first" and "second" referred to in this disclosure are merely intended to distinguish different devices, modules or units, and are not intended to limit the order or interdependence of functions performed by these devices, modules or units.

[0018] It should be noted that the modifications "one" and "multiple" referred to in the present disclosure are exemplary rather than limiting, and should be understood as "one or more" unless the context indicates otherwise, as would be understood by one of ordinary skill in the art.

[0019] The names of messages or information exchanged between multiple devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of these messages or information.

[0020] In order to solve the above problems, the embodiment of the present disclosure provides an image rendering method, in which a background image is rendered by combining random variables, so that the rendering coordinates in the rendered image change irregularly to better simulate random conditions in a natural environment, such as the wavy motion of water flow under natural conditions, and the naturalness of the water flow wavy motion is enhanced. Hereinafter, the method will be described with reference to a specific embodiment.

[0021] 2 is a flowchart of an image rendering method according to an embodiment of the present disclosure, which may be performed by an image rendering device, which may be realized in software and / or hardware, and may be generally integrated into electronic equipment. As shown in FIG. 2, the method includes the following steps 201 to 204.

[0022] Step 201: determining a pre-rendered video stream of a pre-captured background image, the pre-rendered video stream including a plurality of frames of pre-rendered images, where the pre-rendered image of each frame is generated based on a reflection texture and a map texture.

[0023] The background image is a background texture captured by any camera to which you want to add special effects; it could be, for example, an indoor floor image, allowing you to render things like flowing water on the floor image, or it could be, for example, a sky image, allowing you to render things like snowflakes on the sky image.

[0024] In this embodiment, an initial rendering video stream is added to the background image, the initial rendering video stream includes a plurality of frames of initial rendering images corresponding to an initial model of the special effect to be added, the initial rendering image of each frame includes an initial model image, and the coordinate positions of the rendering pixel points of the initial model images corresponding to different initial rendering images are different, so that the initial rendering images of the plurality of frames are continuously played to form a rendering effect such as water flow, the initial rendering video stream may be any video stream having a relatively regular coordinate position change generated based on a generating function, such as a water flow model generated based on a trigonometric sine function, or even a snowflake model generated based on a linear function, and the initial rendering image of each frame generated only based on the corresponding function is only used to control the position change of the rendering pixel points corresponding to the initial rendering image of each frame, therefore, in order to further improve the reality, the color of the rendering pixel is further generated based on a reflection texture and a map texture, and the map texture may be a sea surface map, etc., and the reflection texture may be preset, and is used to simulate the water surface effect of the waves sparkling after being reflected on the sea surface together with the map texture.

[0025] In order for those skilled in the art to more clearly understand the process of adding an initial rendering image of each frame to a background image, the following takes as an example that when the added initial rendering video stream is a water flow, the initial model generated based on trigonometric functions is a water flow model, and describes the process of generating an initial rendering image of each frame illustratively as follows.

[0026] In this example, if we want to simulate a real wave effect, we first need to offset the y coordinate of the vertex of the initial model corresponding to the water wave, and it is desirable to change the y coordinate smoothly with the change in time to form a wave curve. Naturally, the effect can be realized by using a trigonometric function (sin or cos function), but the ordinary sine wave cannot fully reflect the undulation of the water surface, and cannot explain the effect of the water surface moving forward and backward with the wave. Here, the x coordinate of the vertex of the initial model corresponding to the water wave can be changed, and the effect achieved is shown in Figure 3, which allows us to intuitively see the effect of the wave flowing with the change in time, and the image corresponding to the wave flow effect is the rendering image mentioned above.

[0027] In addition, in order to reflect the uneven details on the water surface when the water waves flow, a corresponding map texture is added to the water surface. During the actual addition, the direction of the surface normal of the water surface can be recorded in the normal map texture. As shown in FIG. 4, the surface normal of an object is a vector perpendicular to the tangent plane. In simple terms, the surface normal is a vector perpendicular to the network of vertices of a particular vertex, the rendering pixel point. Referring to FIG. 5, each normal vector is directed outward from the light source and follows the completely curved shape of the lattice of the object surface. Normal mapping can be performed based on the map texture to simulate such light illumination.

[0028] By using these normal vectors to calculate the light irradiation on each rendering pixel point during shading, the unevenness details of the water surface can be increased without increasing the number of vertices of the initial model. Furthermore, in the fragment shader, the normal vectors on each rendering pixel point are converted to the world coordinate system using the TBN matrix or the like, and then shading calculation is performed to realize the expression of the unevenness details of the water surface. In this embodiment, in order to simulate the effect of diffuse reflection when the actual water surface flows, the reflection and surface color of the water surface are also expressed by mapping the reflection texture, and it can also be understood that the reflection texture expresses the color and intensity of the water surface when it is illuminated by a light source. In this embodiment, the reflection texture is pre-rendered by changing the color and brightness, and the change in color and brightness of the water surface can be simulated based on the addition of the reflection texture.

[0029] Step 202: obtain the initial rendering coordinates of each rendering pixel point in the initial rendering image of each frame, and obtain the rendering time in the initial rendering video stream of the initial rendering image of each frame.

[0030] In this embodiment, the initial coordinate points of the rendered initial model are the initial rendering coordinates of each rendering pixel point, and in this embodiment, the initial rendering coordinates of each rendering pixel point in the initial rendering image of each frame are obtained based on a generating function of the initial model, etc.

[0031] The rendering time in this embodiment can be understood as the change time corresponding to the initially rendered image of each frame when the initially rendered video stream undergoes a coordinate change according to the time parameter.

[0032] Step 203: determine a noise amount at the rendering time of each rendering pixel point according to the initial rendering coordinate, the preset noise texture and the rendering time, and calculate the noise amount according to a preset algorithm to obtain a target rendering coordinate of each rendering pixel point.

[0033] In this embodiment, a pre-set noise texture is obtained, and the noise texture is generated by a random variable, for example, the noise texture is composed of 256 random directional unit vectors, which is one possible implementation, and the noise texture is shown in FIG. 7, where the noise texture provides a random variable and is used to add a random disturbance effect to the initial rendered image of each frame.

[0034] As described above, the rendering time can be understood as the change time corresponding to the initial rendering image of each frame when the initial rendering video stream undergoes coordinate change along with the time parameter, and in this embodiment, it is used as another random variable based on the rendering time to further improve the realism of the initial rendering image of each frame.

[0035] In this embodiment, the noise amount at the rendering time of each rendering pixel point is determined based on the initial rendering coordinates, a preset noise texture, and the rendering time, and the coordinates of each rendering pixel point are further updated based on the noise amount.

[0036] As is necessary to explain, in different application scenarios, the manner of determining the noise amount at the rendering time of each rendering pixel point is different according to the initial rendering coordinate, the preset noise texture and the rendering time, which is exemplified as follows:

[0037] Example 1

[0038] In this example, a random noise amount is obtained by randomly sampling one point of the noise texture based on a random algorithm, and an addition calculation is performed based on the rendering time and the initial rendering coordinates, and the product of the addition result and the random noise amount is used as the noise amount.

[0039] Example 2

[0040] In this example, the fifth sampling coordinates are determined based on the initial rendering coordinates and the rendering time, and the noise texture vector corresponding to the fifth sampling coordinates in the noise texture is determined as the noise amount.

[0041] For example, an addition is performed based on the initial rendering coordinate and the rendering time, and the addition result is normalized to obtain the fifth sampling coordinate.

[0042] Further, for example, the fifth sampling coordinate is obtained according to the following formula (1): U1 is the fifth sampling coordinate, U0 is the initial rendering coordinate, U0 is a vector containing two elements of image coordinates u and v, and t is the rendering time, and formula (1) is as follows:

number

[0043] Furthermore, the amount of noise is calculated based on a preset algorithm to obtain target rendering coordinates for each rendering pixel point, and the target rendering coordinates take into account two random disturbance factors, namely, the rendering time and the noise texture, making the changes in the model represented by the target rendering coordinates more natural.

[0044] As is necessary to explain, in different application scenarios, the manners of calculating the noise amount and obtaining the target rendering coordinates of each rendering pixel point according to the preset algorithm are different, which are exemplified as follows:

[0045] In one embodiment of the present disclosure, a preset noise coefficient is obtained, a product value of the noise coefficient and a noise amount is calculated, and a sum value of the product value and a corresponding rendering pixel point is calculated to obtain a target rendering coordinate of each rendering pixel point.

[0046] In another embodiment of the present disclosure, the target rendering coordinates of each rendering pixel point are determined based on the initial rendering coordinates, the first direction vector, the second direction vector, the binormal vector and the noise amount.

[0047] In this embodiment, a predetermined first direction vector for each rendering pixel point that simulates the emission of a light ray, a second direction vector between each rendering pixel point and a camera that captures a background image, and a binormal vector in global space for each rendering pixel point are obtained.

[0048] In order to simulate the illumination of a light source when performing normal mapping, in this embodiment, when generating an initial rendering image corresponding to the initial rendering video stream, in order to improve realism, a light source is further added by simulating the light ray emission direction, therefore, in this embodiment, a first direction vector is further obtained to simulate the emission of a light ray at each rendering pixel point, and the first direction vector can be understood as the direction vector of light ray emission, and the first direction vectors corresponding to the light sources of different rendering pixel points may be the same or different, and in some possible embodiments, it can be completed by a fragment rendering shader, etc., when generating an initial rendering image of each frame, therefore the first direction vector can be read into the fragment rendering shader.

[0049] In addition, in order to simulate changes in color and brightness when mapping reflective textures, it is necessary to simulate the viewing direction of the human eye with respect to the initial model corresponding to the initial rendering video stream; since the viewing direction of the human eye is different, the brightness and color of the corresponding rendering pixel points in the viewed initial model will be different. In this embodiment, the viewing direction of the user is simulated based on a second direction vector between the camera with which the background image was captured and the initial rendering coordinates of each rendering pixel point in the initial rendering image of each frame.

[0050] When adding a map texture, as shown in Fig. 6, the normal vector is determined according to the tangent surface of the initial model, and when the normal vector is determined according to the tangent surface, the binormal vector is determined according to the tangent surface, and the binormal vector is a straight line perpendicular to the tangent surface of the initial model. In this embodiment, the binormal vector in the global space of each rendering pixel point is further obtained, and the binormal vector may be preset or read from the corresponding fragment shader.

[0051] In this embodiment, after obtaining the amount of noise generated based on two random variables, the target rendering coordinates of each rendering pixel point are further determined based on the initial rendering coordinates, the first direction vector, the second direction vector, the binormal vector and the noise amount, and the first direction vector, the second direction vector and the binormal vector are used to ensure that the target rendering coordinates take into account the effect of light.

[0052] As is necessary to explain, in different application scenarios, the manner of determining the target rendering coordinates of each rendering pixel point according to the initial rendering coordinates, the first direction vector, the second direction vector, the binormal vector and the noise amount is different, which is exemplified as follows:

[0053] Example 1

[0054] In this example, the product of the binormal vector and the first direction vector, and the product of the second direction vector and the first direction vector are calculated, and the moduli of these two products are added together and then used as input parameters of the generation function for the initial rendering image of each frame to obtain the corresponding function value. Furthermore, the product of the function value and the noise amount is calculated, and the sum of the product and the initial rendering coordinates is used as the target rendering coordinates.

[0055] Example 2

[0056] In this example, as shown in FIG. 8, the step of determining the target rendering coordinates of each rendering pixel point based on the initial rendering coordinates, the first direction vector, the second direction vector, the binormal vector, and the noise amount includes the following steps 801 to 804.

[0057] Step 801, calculate the seventh and eighth products of the binormal vector and the first and second direction vectors, respectively.

[0058] In this embodiment, a seventh product value of the binormal vector and the first direction vector, and an eighth product value of the binormal vector and the second direction vector are calculated.

[0059] Step 802: Calculate a first modulus value and a second modulus value of the seventh product value and the eighth product value, respectively, and add the first modulus value and the second modulus value to obtain a third added value.

[0060] In this embodiment, a first modulus value and a second modulus value of the seventh product value and the eighth product value are calculated, and the first modulus value and the second modulus value are added to obtain a third added value.

[0061] Step 803: Obtain a function value corresponding to the third sum according to a generating function of the initial rendering image of each frame.

[0062] In this embodiment, the generating function of the initial rendering image of each frame may be any function, for example, when the initial rendering image of each frame corresponds to a video stream of flowing water, the generating function may be a sin trigonometric function, or a cos trigonometric function, etc.

[0063] In this embodiment, the third additive value is used as an input parameter of the generating function to obtain the corresponding function value, so that the subsequent target rendering coordinates are calculated based on the generating function in which the coordinates of the initial rendering image of each frame change, and the changes in the target rendering coordinates are not too random, which would make the rendering effect appear unrealistic.

[0064] Step 804: Calculate a ninth product value between the trigonometric function value, the noise amount, and the preset seventh parameter value, and add the ninth product value and the initial rendering coordinate to obtain the target rendering coordinate.

[0065] In this embodiment, a ninth product value of the trigonometric function value, the noise amount, and a preset seventh parameter value is calculated, and the ninth product value and the initial rendering coordinate are added to obtain the target rendering coordinate.

[0066] For example, when the generating function of the initial rendering image of each frame is a sine trigonometric function, the calculation formula of the target rendering coordinate in this embodiment is shown in the following formula (2), in which U is the target rendering coordinate, S1 is the seventh parameter value pre-calibrated based on experimental data, N1 is the noise amount, U0 is the initial rendering coordinate, B is the binormal vector, L is the first direction vector, and V is the second direction vector.

number

[0067] Step 204: update the initial rendering coordinates of each rendering pixel point in the initial rendering image of each frame according to the target rendering coordinates to obtain a target rendering image, and render a background image according to the target rendering video stream composed of all the target rendering images.

[0068] In this embodiment, after obtaining the target rendering coordinates, the initial rendering coordinates of each rendering pixel point in the initial rendering image of each frame are updated according to the target rendering coordinates to obtain the target rendering image, thereby realizing the update of the u, v coordinates of each rendering pixel point, and rendering the background image according to the target rendering video stream composed of all the target rendering images, in which multidimensional random disturbance factors are added, and when the rendered related model is a water flow model, a random disturbance factor of noise amount is added to form a natural rippling effect, which is more realistic.

[0069] From the above, the image rendering method of the embodiment of the present disclosure determines an initial rendering video stream of a background image captured in advance, the initial rendering video stream includes initial rendering images of multiple frames, the initial rendering image of each frame is generated based on a reflection texture and a map texture, obtains initial rendering coordinates of each rendering pixel point in the initial rendering image of each frame, a preset noise texture, and a rendering time in the initial rendering video stream of the initial rendering image of each frame, further determines the noise amount at the rendering time of each rendering pixel point, calculates the noise amount according to a preset algorithm to determine the target rendering coordinates of each rendering pixel point, and finally updates the initial rendering coordinates of each rendering pixel point in the initial rendering image of each frame according to the target rendering coordinates to obtain a target rendering image, and renders a background image based on the target rendering video stream composed of all the target rendering images, thereby generating the noise amount according to the noise texture and the rendering time of the rendering image, and determining the rendering coordinates using the noise amount as a random variable to improve the realism of the image rendering effect.

[0070] In the actual implementation process, when adding rendering effects to the background image, in order to make the added effect more realistic, the Fresnel effect should also be taken into consideration. Fresnel refers to a certain material showing different reflective effects at different distances. Take the added rendered initial model as an example, as shown in Figure 9, which is a water flow. The Fresnel effect refers to the light emitted from the observer's eye (which can be a camera) and projected onto a certain object. The acute angle formed by the tangent at the intersection of this light with the horizontal plane is the incident angle. The incident angle has two important characteristics: first, it changes with the change in observation distance. The closer the distance, the larger the incident angle, and the farther the distance, the smaller the incident angle. Second, the magnitude of the incident angle affects the reflective effect. The larger the incident angle, the weaker the reflective effect, and the smaller the incident angle, the stronger the reflective effect.

[0071] When reflected in real water flow, for rendering pixel points closer to the camera, the larger the angle of incidence, the weaker the reflective effect, and for rendering pixel points farther from the camera, the smaller the angle of incidence, the stronger the reflective effect. The weaker the reflective effect, the more transparent the water appears, like air, and the stronger the reflective effect, the smoother the water appears, like a mirror. This change in reflection effect / resolution with distance is the Fresnel effect.

[0072] Of course, in the real environment, the light entering the human eye is not only affected by the emitted light, but also by the refracted light, and the reflected light includes diffuse reflection and highlight reflection, and the diffuse reflection refers to the fact that when the surface of the rendered initial model is rough, the surface of the initial model is regarded as a number of tiny mirrors with different directions, and the directions of the light reflected by these mirrors are all different, which is the diffuse reflection, and the highlight reflection refers to the fact that when the surface of the rendered initial model is smooth and there is only one mirror, all the light is reflected in the same direction (in reality, only the phase of the light with the shortest time is similar), which is the highlight reflection. Therefore, in this embodiment, in order to exhibit the real Fresnel effect, the refracted light, the reflected light and the highlight are combined to perform Fresnel fusion to determine the color of each rendering pixel point, so that the initial model with the color rendered is more realistic, and the rendering effect shows that it is clear near and blurred far away, and when it is water waves that are rendered, the reality of the wavy motion of the water surface can be further improved.

[0073] FIG. 10 is a flowchart of an image rendering method according to one embodiment of the present disclosure. As shown in FIG.

[0074] Step 1001: obtain the tangent vector in global space of each rendering pixel point in the initial rendering image of each frame.

[0075] Step 1002: calculate the map texture, the target rendering coordinate, the rendering time, the binormal vector and the tangent vector to obtain the first normal vector in the global space of each rendering pixel point.

[0076] In this embodiment, as described above, the map texture simulates the unevenness of the object surface based on the normal vector, thereby simulating the reflection of the light source irradiated onto the initial model, and as shown in FIG. 11, when the initial model of the target rendering video stream is a water flow, the corresponding map texture can reflect the unevenness of the light irradiated onto the water surface, and the coordinate system in which the vector representing the normal direction in the map texture is located is the X-axis direction (1,0,0), the Y-axis direction (0,1,0), and the Z-axis direction (0,0,1), which can also be understood as the tangent coordinate system of the texture.

[0077] In other words, the normal vector in the normal texture map is in the tangent coordinate system. The advantage of this is that when the texture is pasted onto the initial model and rendered, no matter how the initial model corresponding to the special effect is rotated, the normal vector is not transformed because the normal texture map is expressed in the tangent coordinate system of the texture. Otherwise, if the normal vector is expressed in the world coordinate system, the information of the normal direction will change depending on the difference in the orientation of the initial model, and one normal texture map alone cannot represent the normal vectors corresponding to all the initial model directions.

[0078] The normal vector is expressed in the tangent coordinate system, and the normal needs to be transformed from the tangent coordinate system to the world coordinate system during shading. However, the directions of the x-axis, y-axis, and z-axis of the tangent coordinate system during rendering may not be (1,0,0), (0,1,0), and (0,0,1), except that the initial model itself is a plane, the normal direction of the initial model is the positive direction of the z-axis, and the directions of the two sides of the initial model also overlap with the x-axis and y-axis. In other words, the tangent coordinate system in which the normal vector of the pixel on the map texture is located changes after the map is pasted onto the initial model. Therefore, it is necessary to find the tangent coordinate system in which the pixel is currently located.

[0079] Therefore, in this embodiment, it is necessary to obtain the tangent vector in global space of each rendering pixel point in the initial rendering image of each frame, and since the tangent vector of each rendering pixel point in the initial model changes less than the tangent vector of each rendering pixel point in the initial rendering image of each frame, in this embodiment, the tangent vector of each rendering pixel point in the initial rendering image of each frame is used as the tangent vector of each rendering pixel point in the target rendering image.

[0080] The coordinate space in which the normal vector of the map texture is located can be considered as a coordinate system, and any point in the coordinate space can be defined as long as there are three orthogonal coordinate axes xyz as the base axes. The tangent space is a space located on the surface of the initial model, and the xyz axes in the tangent space are the T axis (tangent direction), the B axis (bitangent direction), and the N axis, respectively. The N axis represents the normal vector direction of the point, so it is determined that the positive direction of the z axis of the tangent space is the same direction as the normal n. Since there is only one tangent to a point on a curve, and there is a tangent plane at a point on a surface, any line that passes through the point on the plane is a tangent to the point, and therefore there are an infinite number of tangents. There are multiple different combinations of x and y axes, and the point normal vectors generated by each combination are not consistent. In this embodiment, when calculating the tangent vector T in the tangential direction, the same direction as the uv expansion direction is selected as the tangent direction. As shown in FIG. 12, when the initial model corresponding to the target rendering video stream is a sphere, the tangent vector T is shown in the figure.

[0081] In this embodiment, the tangent vector in the tangent direction of each rendering pixel point may be read by a fragment shader or the like, and may be pre-calibrated based on a generation tool of the initial model.

[0082] Furthermore, as mentioned above, the normal vector is expressed in the tangent coordinate system, and the normal needs to be transformed from the tangent coordinate system to world coordinates during shading; therefore, a first normal vector in global space of each rendering pixel point is further obtained, and the first normal vector can be understood as the shading normal vector of the map texture in global space.

[0083] As is necessary to explain, in different application scenarios, the methods of calculating the binormal vector and tangent vector in the map texture, target rendering coordinate, rendering time and global space, and obtaining the first normal vector in the global space of each rendering pixel point are different, which are exemplified as follows:

[0084] Example 1

[0085] In this example, sampling coordinates are obtained based on the target rendering coordinates and the rendering time, random texture vectors in the map texture are collected based on the sampling coordinates, and a world coordinate transformation is performed based on the random texture vectors and the tangent vector to obtain the corresponding first normal vector.

[0086] In this example, a world coordinate transformation model is constructed in advance, and the first normal vector corresponding to the random texture vector and the tangent vector can be obtained based on the transformation of the transformation model.

[0087] Example 2

[0088] In this example, as shown in FIG. 13, the method for obtaining the first normal vector is as follows.

[0089] Step 1301: obtain a first sampling coordinate and a second sampling coordinate according to a target rendering coordinate and a rendering time.

[0090] In this embodiment, the first sampling coordinates and the second sampling coordinates are obtained based on the target rendering coordinates and the rendering time, and sampling is performed on the map texture based on the sampling coordinates.

[0091] In some possible implementations, the first sampling coordinate and the second sampling coordinate can be calculated using the following formula (3) and formula (4), where the parameter values ​​such as 0.46 / 1.0 in formula (3) and formula (4) are effective parameter values ​​obtained based on experimental data, and other parameter values ​​can also achieve the effects of the present disclosure, and are not exemplified here. In formula (3) and formula (4), U2 is the first sampling coordinate, U3 is the second sampling coordinate, U is the target rendering coordinate, and t is the rendering time.

number

number

[0092] In some other implementations, the product of the target rendering coordinate and the rendering time is calculated, the sum of the product and two different preset parameter values ​​is calculated, and the two resulting sums are normalized to obtain the corresponding first sampling coordinate and second sampling coordinate.

[0093] Step 1302: obtain a first map texture vector and a second map texture vector at the first sampling coordinate and the second sampling coordinate of the map texture, respectively.

[0094] In this embodiment, a first mapped texture vector corresponding to a first sampling coordinate in the map texture is obtained, and a second mapped texture vector corresponding to a second sampling coordinate in the map texture is obtained.

[0095] Step 1303: obtain a first normal vector in the global space of each rendering pixel point according to the binormal vector, the tangent vector, the first map texture vector and the second map texture vector.

[0096] In some possible implementations, the average value of the first mapped texture vector and the second mapped texture vector is calculated to obtain a second normal vector in tangent space, for example, when the first mapped texture vector is N1 and the second mapped texture vector is N2, (N1+N2)*0.5 is used as the second normal vector.

[0097] Furthermore, a normalization calculation is performed based on the binormal vector and the tangent vector to obtain a third normal vector in the global space. For example, when the binormal vector is B, the tangent vector is T, and G() is a preset normalization calculation algorithm, the value of G(B*T) can be used as the third normal vector.

[0098] In this embodiment, a vector transformation matrix M=(T,B, ) is obtained based on the binormal vector, the tangent vector and the third normal vector. After obtaining the vector transformation matrix, the product of the vector transformation matrix and the second normal vector is calculated to obtain the first normal vector, that is, the first normal vector is calculated using the following formula (5), where the first normal vector is the normal vector in the global space, and N s is the first normal vector, M is the vector transformation matrix, and N s is the second normal vector.

number

[0099] Step 1003: Calculate a rendering color vector of each rendering pixel point according to the first normal vector, the first direction vector and the second direction vector.

[0100] Step 1004, render the color of the corresponding rendering pixel point in the target rendering image according to the rendering color vector.

[0101] In this embodiment, a rendering color vector of each rendering pixel point is calculated based on a first normal vector, a first direction vector, and a second direction vector, where the first normal vector reflects the unevenness of the light irradiation in the map texture, and the first direction vector and the second direction vector reflect the viewing direction and the light ray direction, so that the rendering color vector reflects the presented color of the corresponding rendering pixel point after the light source is reflected, refracted, and highlighted.

[0102] In some possible implementations, a deep learning model is pre-trained based on deep learning techniques, and a first normal vector, a first direction vector, and a second direction vector are input into the deep learning model to obtain a rendering color vector of each rendering pixel point.

[0103] In some possible embodiments, as shown in FIG. 14, calculating a rendering color vector for each rendering pixel point based on a first normal vector, a first direction vector, and a second direction vector includes the following steps 1401 to 1404.

[0104] Step 1401: determine a first color vector that simulates a highlight based on the second direction vector and the first direction vector.

[0105] For example, after adding the first direction vector and the second direction vector, the result based on the added normalized value is used as the first color vector.

[0106] Further, for example, a vector sum of the second direction vector and the first direction vector is calculated, the vector sum is normalized, and then a first calculation value of a first predetermined power of the normalization result is calculated, and a product of the first calculation value and a first predetermined parameter value is calculated to obtain a first color vector, and both the first predetermined parameter value and the first predetermined power may be calibrated based on experimental data.

[0107] For example, when the first parameter value is 800 and the preset power is 600, the first color vector can be calculated using the following formula (6), where C2 is the first color component, L is the first direction vector, V is the second direction vector, and G() is the preset vector normalization processing function.

number

[0108] Step 1402: determine a second color vector simulating a reflected light based on the second direction vector, the first normal vector and the reflection texture.

[0109] The reflection texture is a preset arbitrary texture image that matches the background image. For example, if the background image is a white ground, the preset reflection texture may be a preset texture image in which white light is reflected. That is, the corresponding reflection texture is obtained by matching with the database based on the color of the background image.

[0110] In some possible implementations, a refracted light direction vector in a global space is calculated according to the first normal vector and the second direction vector according to the Fresnel transform theorem, and then a coordinate value is normalized according to the refracted light direction vector, and the normalized value is used as a sampling coordinate value to sample in the reflection texture to obtain a texture vector in the reflection texture, and the texture vector in the reflection texture is used as a second color vector.

[0111] In some other possible implementations, a third direction vector is determined based on the first normal vector and the second direction vector, and according to the Fresnel transformation theorem, the third direction vector can be understood as the refracted light direction in global space. Since the color of reflected light is affected by the refracted light, in this embodiment, a third sampling coordinate is determined based on the third direction vector, and the texture vector at the third sampling coordinate of the reflected texture is obtained as the second color vector.

[0112] In this embodiment, the third direction vector can be directly used to generate the corresponding third sampling coordinate according to the coordinate normalization function, and when the generating function of the initial rendering image of each frame is a sine trigonometric function, the corresponding second color component can be obtained by the following formula (7), where U4 is the third sampling coordinate, D1 is the third direction vector, D1.x is the x component taken from D1, and D1.z is the z component taken from D1. In addition, 0.32 and 0.16 are effective parameter values ​​calibrated according to experimental data, and in practical applications, they can be replaced with other parameter values ​​according to specific scenes.

number

[0113] Step 1403: determine a third color vector for simulating refraction light according to the initial rendering coordinate, the second direction vector, the first normal vector and the background image.

[0114] In this embodiment, the background image is used as a background texture to generate the corresponding third color component since the background image is also relevant for refracted light.

[0115] In some possible embodiments, a shooting distance between each rendering pixel point and the camera can be determined, and the shooting distance is a corresponding depth value obtained after performing a conversion between image coordinates and world coordinates based on the internal parameters, external parameters, and image coordinates of each rendering pixel point in the background image of the camera, and the depth value is used as the corresponding shooting distance, and the conversion between image coordinates and world coordinates is a conventional technology, and detailed description is omitted here.

[0116] In addition, a fourth normal vector is obtained by calculating the product of the second direction vector and the first normal vector, whereby the fourth normal vector is determined together with the viewing direction and the light direction, and the reality of the color of the refraction light determined later based on the fourth normal vector is ensured. In addition, since the highlight is reflected on the tangent plane of the target model after the initial model updates the rendering coordinate, a component value on a preset plane of the fourth normal vector is obtained, for example, a component value on the xy plane is obtained.

[0117] Furthermore, the fourth normal vector is added to a preset second parameter value to obtain a first sum, and a first product value of the first sum and the shooting distance is calculated, and the second parameter value may be marked based on experimental results and is not limited here. In this embodiment, the shooting distance, that is, the distance between the line of sight and the rendering pixel point, is further introduced into the first product value to further ensure the reality of the third color component.

[0118] After obtaining the first product value, calculate the ratio between the preset third parameter value and the first product value, and the third parameter value may be marked according to experimental effects, and is not limited here; further, calculate the second product value between the ratio and the component value, and further perform the conversion of the related vector according to the coordinate space. After obtaining the second product value, add the second product value and the initial rendering coordinate to obtain the fourth sampling coordinate, and obtain the color vector at the fourth sampling coordinate of the background image as the third color vector, thereby combining the background image, the viewing direction, the realization distance and the ray direction to jointly determine the third color vector that simulates the refraction light.

[0119] In some possible implementations of this embodiment, the corresponding third color vector can be calculated and obtained using the following formula (8), where U5 is the third color vector, d is the shooting distance, and N s is the first normal vector, V is the second direction vector, U0 is the initial rendering coordinate, the third parameter value is 0.55, and the second parameter value is 0.3.

number

[0120] Step 1404, perform blending calculation on the first color vector, the second color vector and the third color vector to obtain a rendering color vector of each rendering pixel point.

[0121] The first color vector simulates the highlight reflected light, the second color vector simulates the reflected light, and the third color vector simulates the refracted light. Therefore, a mixed calculation is performed on the first color vector, the second color vector, and the third color vector to obtain the rendering color vector of each rendering pixel point, thereby realizing color rendering through the Fresnel effect, and further improving the realism after rendering.

[0122] In some possible implementations, as shown in FIG. 15, performing a blending calculation on the first color vector, the second color vector, and the third color vector to obtain a rendering color vector for each rendering pixel point includes the following steps 1501 to 1504.

[0123] Step 1501, obtain a mixing coefficient according to a second direction vector and a first normal vector.

[0124] A blending coefficient is obtained based on the second direction vector and the first normal vector, which can be understood as a Fresnel blending coefficient.

[0125] In some possible implementations, calculate the product value of the second direction vector and the first normal vector, obtain the power of the product value as the blending coefficient, i.e. blend the line of sight direction and the light ray direction to generate the corresponding blending coefficient, and determine the Fresnel blending coefficient together according to the large influence factors of line of sight and light ray in Fresnel effect. The power can be calibrated according to experimental effect, and can be any number.

[0126] In some possible implementations, calculate a third product value between the second direction vector and the first normal vector, calculate a first difference value between a fourth parameter value preset and the third product value, the fourth parameter value may be marked based on experimental effects and is not limited here, further calculate a second operation value between the first difference value and a second preset power, obtain a fourth product value between a fifth parameter value preset and the second preset power, the second preset power and the fifth parameter value may both be marked based on experimental effects and is not limited here, and add the fourth product value and a sixth parameter value preset to obtain a blending coefficient, the sixth parameter value may both be marked based on experimental effects and is not limited here.

[0127] In some possible embodiments of the present implementation, the calculation method of the blending coefficient can be based on the following formula (9), where 1 is the fourth parameter value, 0.91 is the fifth parameter value, the second preset power is 5, the sixth parameter value is 0.09, F is the blending coefficient, V is the second direction vector, and N s is the first normal vector.

number

[0128] Step 1502, perform blending calculation on the first color vector, the second color vector and the third color vector according to the blending coefficient to obtain a rendering color vector of each rendering pixel point.

[0129] In this embodiment, a mixing calculation is performed on the first color vector, the second color vector and the third color vector based on the mixing coefficient, and a rendering color vector of each rendering pixel point is obtained. The rendering color vector integrates the effects of disturbance factors such as highlight reflection, refracted light reflection and reflected light, thereby improving the realism of the rendering color.

[0130] In some possible implementations, the first color vector, the second color vector, and the third color vector are added together, and the product of the added value and a blending coefficient is used as the corresponding rendering color vector.

[0131] In some other possible implementations, calculate the second difference value between the preset seventh parameter value and the mixing coefficient, calculate the product of the second difference value and the third color vector, obtain the fifth product value, add the first color vector and the second color vector, obtain the second sum, calculate the sixth product value between the second sum and the mixing coefficient, and add the fifth product value and the sixth product value to obtain the rendering color vector of each rendering pixel point, and the seventh parameter value in this embodiment can be marked according to the experimental effect, and is not limited here.Therefore, in this embodiment, the rendering color vector is calculated by comprehensively considering the mixing weight of different color vectors.

[0132] In some possible implementations of this embodiment, the rendering color vector can be calculated based on the following equation (10), where F is a blending coefficient, C3 is a third color vector, C1 is a second color vector, C2 is a first color vector, the seventh parameter value is 1, and C is a blending color vector.

number

[0133] Therefore, based on the above embodiment, in this embodiment, Fresnel mixing is realized for refracted light, reflected light and highlights based on the mixing coefficient, and the rendering effect is realized to show clear up close and blurred far away, etc., so that when water waves are rendered, the reflection is not obvious near the water waves and is visually clear, and the reflection is obvious in the distance and is visually blurred, thereby further improving the realism of the wavy motion on the water surface.

[0134] From the above, the image rendering method of the embodiment of the present disclosure combines the Fresnel effect to determine the rendering color of each rendering pixel point, and simulates the color of the rendering pixel point under the effects of refraction light, reflection light and highlights, thereby further improving the realism of the rendering.

[0135] 16 is a structural schematic diagram of an image rendering device according to an embodiment of the present disclosure, which may be realized by software and / or hardware and generally integrated into electronic equipment. As shown in FIG. 16, the device includes a first acquisition module 1610, a second acquisition module 1620, a determination module 1630, a third acquisition module 1640, and a rendering module 1650.

[0136] The first acquisition module 1610 is used to determine an initial-rendered video stream of a pre-captured background image, where the initial-rendered video stream includes initial-rendered images of multiple frames, and the initial-rendered image of each frame is generated based on a reflection texture and a map texture.

[0137] The second acquisition module 1620 is used for acquiring the initial rendering coordinates of each rendering pixel point in the initial rendering image of each frame, and acquiring the rendering time in the initial rendering video stream of the initial rendering image of each frame.

[0138] The determination module 1630 is used for determining the noise amount at the rendering time of each of the rendering pixel points according to the initial rendering coordinate, the preset noise texture and the rendering time.

[0139] The third obtaining module 1640 is used for calculating the noise amount according to a preset algorithm and obtaining the target rendering coordinates of each of the rendering pixel points.

[0140] The rendering module 1650 is used to update the initial rendering coordinates of each rendering pixel point in the initial rendering image of each frame based on the target rendering coordinates to obtain a target rendering image, and render a background image based on the target rendering video stream composed of all the target rendering images.

[0141] The image rendering device according to the embodiments of the present disclosure can execute the image rendering method according to any embodiment of the present disclosure, and has corresponding functional modules for executing the method and beneficial effects.

[0142] To achieve the above embodiment, the present disclosure further provides a computer program product, including computer programs / instructions, which, when executed by a processor, achieve the image rendering method of the above embodiment.

[0143] FIG. 17 is a structural schematic diagram of an electronic device according to an embodiment of the present disclosure.

[0144] 17, a structural schematic diagram of an electronic device 1700 configured to realize an embodiment of the present disclosure is shown. The electronic device 1700 in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. The electronic device shown in FIG. 17 is merely an example and does not limit the functions and scope of use of the embodiment of the present disclosure in any way.

[0145] 17, the electronic device 1700 may include a processing unit (e.g., a central processor, a graphic processor, etc.) 1701, which can execute various suitable operations and processes based on programs stored in a read-only memory (ROM) 1702 or programs uploaded from a storage device 1708 to a random access memory (RAM) 1703. The RAM 1703 further stores various programs and data necessary for the operation of the electronic device 1700. The processing unit 1701, the ROM 1702, and the RAM 1703 are connected to each other via a bus 1704. An input / output (I / O) interface 1705 is also connected to the bus 1704.

[0146] Typically, devices such as input devices 1706 including a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc., output devices 1707 including a liquid crystal display (LCD), speakers, vibrators, etc., storage devices 1708 including magnetic tape, hard disks, etc., and communication devices 1709 may be connected to the I / O interface 1705. The communication devices 1709 may enable the electronic device 1700 to communicate wirelessly or via wires with other devices to exchange data. Although FIG. 17 shows electronic device 1700 having various devices, it will be understood that it is not required to implement or include all of the devices shown. More or fewer devices may alternatively be implemented or included.

[0147] In particular, according to an embodiment of the present disclosure, the above processes described with reference to the flowcharts may be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product including a computer program stored on a non-transitory computer-readable medium, the computer program including program code for performing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from a network by the communication device 1709, or may be installed from the storage device 1708, or may be installed from the ROM 1702. When the computer program is executed by the processing device 1701, it performs the above functions defined in the image rendering method of the embodiment of the present disclosure.

[0148] As needs to be explained, the computer-readable medium of the present disclosure may be a computer-readable signal medium, or a computer-readable storage medium, or any combination of both. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium may include, but are not limited to, an electrical connection having one or more conductors, a portable computer magnetic disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact magnetic disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program, which may be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, and the computer-readable program code is carried. The data signal thus propagated may take a number of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may be any computer-readable medium other than a computer-readable storage medium, such as a program for use with or in conjunction with an instruction-executing system, apparatus, or device that may be used to emit, propagate, or transmit the computer-readable signal medium. The program code contained in the computer-readable medium may be transmitted over any suitable medium, including, but not limited to, wire, cable, RF (radio frequency), or the like, or any suitable combination of the above.

[0149] In some embodiments, clients and servers may communicate using any network protocol now known or later developed, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communications networks include a local area network ("LAN"), a wide area network ("WAN"), the World Wide Web (e.g., the Internet), and an end-to-end network (e.g., an ad hoc end-to-end network), and any network now known or later developed.

[0150] The computer-readable medium may be included in the electronic device, or may exist separately from the electronic device.

[0151] The computer-readable medium holds one or more programs, and when the one or more programs are executed by the electronic device, the electronic device executes the following: determining an initial rendering video stream of a background image captured in advance, the initial rendering video stream includes initial rendering images of multiple frames, the initial rendering image of each frame is generated according to a reflection texture and a map texture, obtaining initial rendering coordinates of each rendering pixel point in the initial rendering image of each frame, obtaining a rendering time in the initial rendering video stream of the initial rendering image of each frame, determining a noise amount at the rendering time of each rendering pixel point according to the initial rendering coordinates, a preset noise texture and the rendering time, calculating the noise amount according to a preset algorithm to obtain a target rendering coordinate of each rendering pixel point, and finally updating the initial rendering coordinate of each rendering pixel point in the initial rendering image of each frame according to the target rendering coordinate to obtain a target rendering image, and rendering a background image according to the target rendering video stream composed of all the target rendering images, thereby generating a noise amount according to the noise texture and the rendering time of the rendering image, and determining the rendering coordinates using the noise amount as a random variable to improve the realism of the image rendering effect.

[0152] Computer program code for carrying out the operations of the present disclosure may be written in one or more programming languages ​​or combinations thereof, including, but not limited to, object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computer, partially on the user computer, as an independent software package, partially on the user computer and partially on the remote computer, or entirely on the remote computer or server. When referring to a remote computer, the remote computer may be connected to the user computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet Service Provider).

[0153] The flowcharts and block diagrams in the drawings illustrate possible system architectures, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowcharts or block diagrams may represent a module, program section or part of code, which includes one or more executable instructions for implementing a certain logical function. It should be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order from the order marked in the drawings. For example, two blocks shown in succession may actually be executed substantially in parallel, or may be executed in the opposite order, depending on the functions involved. Also, each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts may be implemented using a dedicated system based on hardware that executes a certain function or operation, or may be implemented using a combination of dedicated hardware and computer instructions.

[0154] Such units described in the embodiments of the present disclosure may be implemented in a form of software or hardware. In some cases, the names of the units do not limit the units themselves.

[0155] The functionality described herein may be performed at least in part by one or more hardware logic components, such as, but not limited to, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip (SOCs), and complex programmable logic devices (CPLDs).

[0156] In the context of this disclosure, a machine-readable medium may be a tangible medium, and may contain or store a program for use in or in combination with an instruction execution system, device, or apparatus. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or apparatus, or any suitable combination of the above. More specific examples of machine-readable storage media include one or more wire-based electrical connections, portable computer disks, hard disks, random access memories (RAMs), read-only memories (ROMs), erasable programmable read-only memories (EPROMs or flash memories), optical fibers, portable compact disk read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the above.

[0157] According to one or more embodiments of the present disclosure, the present disclosure provides a method for rendering an image, comprising: determining a pre-rendered video stream of a pre-captured background image, the pre-rendered video stream including a plurality of frames of pre-rendered images, the pre-rendered image of each frame being generated based on a reflection texture and a map texture; obtaining initial rendering coordinates of each rendering pixel point in the initial rendering image of each frame, and obtaining a rendering time in the initial rendering video stream of the initial rendering image of each frame; determining a noise amount at the rendering time of each of the rendering pixel points based on the initial rendering coordinates, a preset noise texture, and the rendering time, and calculating the noise amount based on a preset algorithm to obtain a target rendering coordinate of each of the rendering pixel points; The method includes a step of updating initial rendering coordinates of each rendering pixel point in the initial rendering image of each frame based on the target rendering coordinates to obtain a target rendering image, and rendering the background image based on a target rendering video stream composed of all of the target rendering images.

[0158] According to one or more embodiments of the present disclosure, the image rendering method according to the present disclosure further comprises, prior to the step of rendering the background image based on a target-rendered video stream consisting of all the target-rendered images, obtaining a tangent vector in global space for each rendering pixel point in the initial rendering image of each frame; calculating the map texture, the target rendering coordinates, the rendering time, the binormal vector and the tangent vector to obtain a first normal vector in a global space for each of the rendering pixel points; calculating a rendering color vector for each of the rendering pixel points based on the first normal vector, the first direction vector, and the second direction vector; and rendering a color of a corresponding rendering pixel point in the target rendering image based on the rendering color vector.

[0159] According to one or more embodiments of the present disclosure, in the image rendering method according to the present disclosure, the step of calculating the map texture, the target rendering coordinates, the rendering time, the binormal vector, and the tangent vector, and obtaining a first normal vector in a global space for each rendering pixel point includes: obtaining first and second sampling coordinates based on the target rendering coordinates and the rendering time; obtaining a first mapped texture vector and a second mapped texture vector at the first sampling coordinate and the second sampling coordinate of the mapped texture, respectively; and obtaining a first normal vector in a global space for each of the rendering pixel points based on the binormal vector, the tangent vector, the first map texture vector and the second map texture vector.

[0160] According to one or more embodiments of the present disclosure, in the image rendering method according to the present disclosure, the step of obtaining a first normal vector in a global space of each of the rendering pixel points based on the binormal vector, the tangent vector, the first map texture vector, and the second map texture vector includes the steps of: calculating an average of the first and second mapped texture vectors to obtain a second normal vector in tangent space of the mapped texture; performing a predetermined normalization calculation on the binormal vector and the tangent vector to obtain a third normal vector in a global space; obtaining a vector transformation matrix based on the binormal vector, the tangent vector, and the third normal vector; and calculating a product of the vector transformation matrix and the second normal vector to obtain the first normal vector.

[0161] According to one or more embodiments of the present disclosure, in the image rendering method according to the present disclosure, the step of calculating a rendering color vector for each of the rendering pixel points based on the first normal vector, the first direction vector, and the second direction vector includes: determining a first color vector simulating a highlight based on the second directional vector and the first directional vector; determining a second color vector simulating a reflected light based on the second direction vector, the first normal vector and the reflection texture; determining a third color vector simulating a refractive light according to the initial rendering coordinate, the second direction vector, the first normal vector, and the background image; performing a blending calculation on the first color vector, the second color vector and the third color vector to obtain a rendering color vector for each of the rendering pixel points.

[0162] According to one or more embodiments of the present disclosure, in the image rendering method according to the present disclosure, the step of determining a first color vector simulating a highlight based on the second direction vector and the first direction vector includes the steps of: calculating a vector sum of the second direction vector and the first direction vector; performing a predetermined normalization calculation on the vector sum, and then calculating a first predetermined power of the normalization calculation result to obtain a first calculation value; and calculating a product of the first calculation value and a preset first parameter value to obtain the first color vector.

[0163] According to one or more embodiments of the present disclosure, in the image rendering method according to the present disclosure, the step of determining a second color vector simulating a reflected light based on the second direction vector, the first normal vector, and the reflection texture includes: determining a third direction vector based on the first normal vector and the second direction vector; determining a third sampling coordinate based on the third direction vector, and obtaining a texture vector at the third sampling coordinate of the reflective texture as the second color vector.

[0164] According to one or more embodiments of the present disclosure, in the image rendering method of the present disclosure, the step of determining a third color vector simulating refracted light based on the initial rendering coordinates, the second direction vector, the first normal vector, and the background image includes: determining a shooting distance between each of the rendering pixel points and the camera; calculating a product of the second direction vector and the first normal vector to obtain a fourth normal vector, and obtaining a component value of the fourth normal vector in a preset plane; adding the fourth normal vector and a preset second parameter value to obtain a first sum, and calculating a first product of the first sum and the shooting distance; calculating a ratio between a preset third parameter value and the first product value, and calculating a second product value between the ratio and the component value; The method includes a step of adding the second product value and the initial rendering coordinate to obtain a fourth sampling coordinate, and obtaining a color vector at the fourth sampling coordinate of the background image as the third color vector.

[0165] According to one or more embodiments of the present disclosure, in the image rendering method of the present disclosure, the step of performing a blending calculation on the first color vector, the second color vector, and the third color vector to obtain a rendering color vector for each rendering pixel point includes: obtaining a mixing coefficient based on the second direction vector and the first normal vector; performing a blending calculation on the first color vector, the second color vector and the third color vector based on the blending coefficient to obtain a rendering color vector of each of the rendering pixel points.

[0166] According to one or more embodiments of the present disclosure, in the image rendering method according to the present disclosure, the step of obtaining a blending coefficient based on the second direction vector and the first normal vector includes: obtaining a third product value of the second direction vector and the first normal vector, and calculating a first difference value between a preset fourth parameter value and the third product value; calculating a second calculation value of a second predetermined power of the first difference value to obtain a fourth product value of a fifth predetermined parameter value and the second calculation value; and adding the fourth product value and a preset sixth parameter value to obtain the mixing coefficient.

[0167] According to one or more embodiments of the present disclosure, in the image rendering method of the present disclosure, the step of performing blending calculation on the first color vector, the second color vector, and the third color vector based on the blending coefficient to obtain a rendering color vector for each rendering pixel point includes: Calculating a second difference value between a preset seventh parameter value and the mixing coefficient; calculating a product of the second difference value and the third color vector to obtain a fifth product value; adding the first color vector and the second color vector to obtain a second sum, and calculating a sixth product value of the second sum and the blending coefficient; adding the fifth product value and the sixth product value to obtain a rendering color vector for each of the rendering pixel points.

[0168] According to one or more embodiments of the present disclosure, in the image rendering method according to the present disclosure, the step of determining a noise amount at the rendering time of each of the rendering pixel points based on the initial rendering coordinates, a preset noise texture, and the rendering time includes: determining a fifth sampling coordinate based on the initial rendering coordinate and the rendering time; determining a noise texture vector corresponding to the fifth sampling coordinate in the noise texture as the noise amount.

[0169] According to one or more embodiments of the present disclosure, the step of calculating the noise amount based on a preset algorithm to obtain target rendering coordinates of each of the rendering pixel points includes: Obtaining a first direction vector simulating the emission of a light ray, a second direction vector between each of the rendering pixel points and a camera capturing the background image, and a binormal vector in a global space of each of the rendering pixel points; and calculating, based on the initial rendering coordinates, the first direction vector, the second direction vector, the binormal vector, and the noise amount, to obtain target rendering coordinates of each of the rendering pixel points.

[0170] According to one or more embodiments of the present disclosure, in the image rendering method according to the present disclosure, the step of determining target rendering coordinates of each rendering pixel point based on the initial rendering coordinates, the first direction vector, the second direction vector, the binormal vector, and the noise amount includes: calculating a seventh product value and an eighth product value of the binormal vector with the first direction vector and the second direction vector, respectively; calculating a first modulus value and a second modulus value of the seventh product value and the eighth product value, respectively, and adding the first modulus value and the second modulus value to obtain a third sum; obtaining a function value corresponding to the third sum based on a generating function of an initial rendering image of each of the frames; calculating a ninth product value between the function value, the noise amount and a preset seventh parameter value; and adding the ninth product value and the initial rendering coordinate to obtain the target rendering coordinate.

[0171] According to one or more embodiments of the present disclosure, the present disclosure provides an image rendering apparatus, comprising: A first acquisition module for determining an initial rendering video stream of a pre-captured background image, the initial rendering video stream including a plurality of frames of initial rendering images, the initial rendering image of each frame being generated based on a reflection texture and a map texture; a second acquisition module for acquiring initial rendering coordinates of each rendering pixel point in the initial rendering image of each frame, and acquiring a rendering time in the initial rendering video stream of the initial rendering image of each frame; a determination module for determining a noise amount at the rendering time of each of the rendering pixel points based on the initial rendering coordinates, a preset noise texture, and the rendering time; a third acquisition module for calculating the noise amount based on a preset algorithm to acquire a target rendering coordinate of each of the rendering pixel points; and a rendering module for updating initial rendering coordinates of each rendering pixel point in an initial rendering image of each frame based on the target rendering coordinates to obtain a target rendering image, and rendering the background image based on a target rendering video stream composed of all of the target rendering images.

[0172] According to one or more embodiments of the present disclosure, an image rendering device according to the present disclosure includes: a fourth acquisition module for acquiring a tangent vector in a global space of each rendering pixel point in the initial rendering image of each frame; a fifth acquisition module for calculating the map texture, the target rendering coordinates, the rendering time, the binormal vector and the tangent vector to acquire a first normal vector in a global space of each of the rendering pixel points; a calculation module for calculating a rendering color vector for each of the rendering pixel points based on the first normal vector, the first direction vector, and the second direction vector; The rendering module is further used for rendering a color of a corresponding rendering pixel point in the target rendering image according to the rendering color vector.

[0173] According to one or more embodiments of the present disclosure, in the image rendering device of the present disclosure, the fifth acquisition module specifically includes: obtaining first and second sampling coordinates based on the target rendering coordinates and the rendering time; obtaining a first mapped texture vector and a second mapped texture vector at the first sampling coordinate and the second sampling coordinate, respectively, of the map texture; The first normal vector in the global space of each of the rendering pixel points is obtained according to the binormal vector, the tangent vector, the first map texture vector and the second map texture vector.

[0174] According to one or more embodiments of the present disclosure, in the image rendering device of the present disclosure, the fifth acquisition module specifically includes: A predetermined normalization calculation is performed on the binormal vector and the tangent vector to obtain a third normal vector in a global space; Obtaining a vector transformation matrix based on the binormal vector, the tangent vector, and the third normal vector; It is used to calculate the product of the vector transformation matrix and the second normal vector to obtain the first normal vector.

[0175] According to one or more embodiments of the present disclosure, in the image rendering device of the present disclosure, the calculation module specifically includes: determining a first color vector simulating a highlight based on the second directional vector and the first directional vector; determining a second color vector simulating a reflected light based on the second direction vector, the first normal vector, and the reflection texture; determining a third color vector simulating refracted light based on the initial rendering coordinates, the second direction vector, the first normal vector, and the background image; A blending calculation is performed on the first color vector, the second color vector and the third color vector to obtain a rendering color vector of each of the rendering pixel points.

[0176] According to one or more embodiments of the present disclosure, in the image rendering device of the present disclosure, the calculation module specifically includes: According to one or more embodiments of the present disclosure, in the image rendering device of the present disclosure, the calculation module specifically includes: calculating a vector sum of the second direction vector and the first direction vector; performing a predetermined normalization calculation on the vector sum, and then calculating a first predetermined power of the normalization calculation result to obtain a first calculation value; The first color vector is obtained by multiplying the first calculation value by a first parameter value that is preset.

[0177] According to one or more embodiments of the present disclosure, in the image rendering device of the present disclosure, the calculation module specifically includes: determining a third direction vector based on the first normal vector and the second direction vector; A third sampling coordinate is determined based on the third direction vector, and a texture vector at the third sampling coordinate of the reflective texture is obtained as the second color vector.

[0178] determining a shooting distance between each of the rendering pixel points and the camera; A fourth normal vector is obtained by calculating a product of the second direction vector and the first normal vector, and a component value of the fourth normal vector in a preset plane is obtained; adding the fourth normal vector and a preset second parameter value to obtain a first sum, and calculating a first product of the first sum and the shooting distance; Calculating a ratio between a preset third parameter value and the first product value, and calculating a second product value between the ratio and the component value; The second product value is added to the initial rendering coordinate to obtain a fourth sampling coordinate, and the color vector at the fourth sampling coordinate of the background image is obtained as the third color vector.

[0179] According to one or more embodiments of the present disclosure, in the image rendering device of the present disclosure, the calculation module specifically includes: obtaining a mixing coefficient based on the second direction vector and the first normal vector; The blending coefficient is used to perform blending calculation on the first color vector, the second color vector and the third color vector according to the blending coefficient, so as to obtain a rendering color vector of each of the rendering pixel points.

[0180] According to one or more embodiments of the present disclosure, in the image rendering device of the present disclosure, the calculation module specifically includes: obtaining a third product value between the second direction vector and the first normal vector, and calculating a first difference value between a preset fourth parameter value and the third product value; Calculating a second calculation value of a second predetermined power of the first difference value to obtain a fourth product value of a fifth predetermined parameter value and the second calculation value; The fourth product value is added to a preset sixth parameter value to obtain the mixing coefficient.

[0181] According to one or more embodiments of the present disclosure, in the image rendering device of the present disclosure, the calculation module specifically includes: Calculating a second difference value between a preset seventh parameter value and the mixing coefficient; calculating a product of the second difference value and the third color vector to obtain a fifth product value; adding the first color vector and the second color vector to obtain a second sum, and calculating a sixth product value of the second sum and the blending coefficient; The fifth product value and the sixth product value are added to obtain a rendering color vector of each of the rendering pixel points.

[0182] According to one or more embodiments of the present disclosure, in the image rendering device of the present disclosure, the determination module specifically comprises: determining a fifth sampling coordinate based on the initial rendering coordinate and the rendering time; A noise texture vector corresponding to the fifth sampling coordinate in the noise texture is used to determine the noise amount.

[0183] According to one or more embodiments of the present disclosure, in the image rendering device of the present disclosure, the determination module specifically comprises: Obtaining a first direction vector simulating the emission of a light ray, a second direction vector between each of the rendering pixel points and a camera that captures the background image, and a binormal vector in a global space of each of the rendering pixel points, which are preset for each of the rendering pixel points; The target rendering coordinates of each of the rendering pixel points are calculated based on the initial rendering coordinates, the first direction vector, the second direction vector, the binormal vector and the noise amount.

[0184] According to one or more embodiments of the present disclosure, in the image rendering device of the present disclosure, the determination module specifically comprises: Calculating a seventh product value and an eighth product value of the binormal vector with the first direction vector and the second direction vector, respectively; calculating a first modulus value and a second modulus value of the seventh product value and the eighth product value, respectively, and adding the first modulus value and the second modulus value to obtain a third sum; obtaining a function value corresponding to the third added value based on a generating function of an initial rendering image of each of the frames; The function value is used to calculate a ninth product value between the noise amount and a preset seventh parameter value, and add the ninth product value and the initial rendering coordinate to obtain the target rendering coordinate.

[0185] According to one or more embodiments of the present disclosure, the present disclosure provides an electronic device, A processor; and a memory for storing said processor-executable instructions; The processor is adapted to read the executable instructions from the memory and execute the instructions to implement any of the image rendering methods of the present disclosure.

[0186] According to one or more embodiments of the present disclosure, the present disclosure provides a computer-readable storage medium having a computer program stored therein, the computer program being adapted to perform any of the image rendering methods of the present disclosure.

[0187] The above description is merely a description of the preferred embodiments of the present disclosure and the technical principles applied thereto. As can be understood by those skilled in the art, the disclosure scope of the present disclosure is not limited to the technical solutions consisting of the specific combinations of the above technical features, but should also include other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the concept of the above disclosure. For example, the technical solutions formed by replacing the above features with technical features having similar functions disclosed in the present disclosure (but not limited thereto).

[0188] Also, although operations are described in a particular order, this should not be understood as requiring that these operations be performed in the particular order or sequence shown. In certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although the above description includes several specific implementation details, these should not be construed as limiting the scope of the disclosure. Some features that are described in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment may also be implemented in multiple embodiments separately or in any suitable subcombination manner.

[0189] Although the present subject matter has been described in language specific to structural features and / or logical operations of a method, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or operations described above. Rather, the specific features and operations described above are merely example forms for implementing the claims.

Claims

1. 1. A method for rendering an image, comprising: determining a pre-rendered video stream of a pre-captured background image, the pre-rendered video stream including a plurality of frames of pre-rendered images, the pre-rendered image of each frame being generated based on a reflection texture and a map texture; obtaining initial rendering coordinates of each rendering pixel point in the initial rendering image of each frame, and obtaining a rendering time in the initial rendering video stream of the initial rendering image of each frame; determining a noise amount at the rendering time of each of the rendering pixel points based on the initial rendering coordinates, a preset noise texture, and the rendering time, and calculating the noise amount based on a preset algorithm to obtain a target rendering coordinate of each of the rendering pixel points; and updating initial rendering coordinates of each rendering pixel point in the initial rendering image of each frame based on the target rendering coordinates to obtain a target rendering image, and rendering the background image based on a target rendering video stream composed of all of the target rendering images.

2. prior to the step of rendering the background image based on a target-rendered video stream consisting of all of the target-rendered images, obtaining a tangent vector and a binormal vector in global space for each rendering pixel point in the initial rendering image of each frame; calculating the map texture, the target rendering coordinates, the rendering time, the binormal vector and the tangent vector to obtain a first normal vector in a global space for each rendering pixel point; obtaining a first direction vector simulating a light ray emission for each of the rendering pixel points and a second direction vector between each of the rendering pixel points and a camera capturing a background image; calculating a rendering color vector for each of the rendering pixel points based on the first normal vector, the first direction vector, and the second direction vector; 2. The method of claim 1, further comprising the step of: rendering a color of a corresponding rendering pixel point in the target rendering image based on the rendering color vector.

3. The step of calculating the map texture, the target rendering coordinates, the rendering time, the binormal vector, and the tangent vector to obtain a first normal vector in a global space for each rendering pixel point includes: obtaining first and second sampling coordinates based on the target rendering coordinates and the rendering time; obtaining a first mapped texture vector and a second mapped texture vector at the first sampling coordinate and the second sampling coordinate of the map texture, respectively; and obtaining a first normal vector in global space for each of the rendering pixel points based on the binormal vector, the tangent vector, the first map texture vector, and the second map texture vector.

4. The step of obtaining a first normal vector in a global space of each of the rendering pixel points based on the binormal vector, the tangent vector, the first map texture vector, and the second map texture vector, further comprises: calculating an average of the first and second mapped texture vectors to obtain a second normal vector in tangent space of the mapped texture; performing a predetermined normalization calculation on the binormal vector and the tangent vector to obtain a third normal vector in a global space; obtaining a vector transformation matrix based on the binormal vector, the tangent vector, and the third normal vector; 4. The method of claim 3, further comprising calculating a product of the vector transformation matrix and the second normal vector to obtain the first normal vector.

5. The step of calculating a rendering color vector for each rendering pixel point based on the first normal vector, the first direction vector, and the second direction vector comprises: determining a first color vector based on the second directional vector and the first directional vector, the first color vector simulating a highlight; determining a second color vector based on the second direction vector, the first normal vector and the reflective texture, the second color vector simulating a reflective light; determining a third color vector simulating refractive light based on the initial rendering coordinate, the second direction vector, the first normal vector, and the background image; 3. The method of claim 2, further comprising: performing a blending calculation on the first color vector, the second color vector, and the third color vector to obtain a rendering color vector for each rendering pixel point.

6. determining a first color vector simulating a highlight based on the second directional vector and the first directional vector, calculating a vector sum of the second direction vector and the first direction vector; performing a predetermined normalization calculation on the vector sum, and then calculating a first predetermined power of the normalization calculation result to obtain a first calculation value; 6. The method of claim 5, further comprising: calculating a product of the first operation value and a first preset parameter value to obtain the first color vector.

7. determining a second color vector simulating a reflected light based on the second direction vector, the first normal vector, and the reflection texture, determining a third direction vector based on the first normal vector and the second direction vector; 6. The method of claim 5, further comprising determining a third sampling coordinate based on the third direction vector, and obtaining a texture vector at the third sampling coordinate of the reflective texture as the second color vector.

8. determining a third color vector simulating refractive light based on the initial rendering coordinates, the second direction vector, the first normal vector, and the background image; determining a shooting distance between each of the rendering pixel points and the camera; calculating a product of the second direction vector and the first normal vector to obtain a fourth normal vector, and obtaining a component value of the fourth normal vector in a preset plane; adding the fourth normal vector and a preset second parameter value to obtain a first sum, and calculating a first product value of the first sum and the shooting distance; calculating a ratio between a third preset parameter value and the first product value, and calculating a second product value between the ratio and the component value; 6. The method of claim 5, further comprising: adding the second product value and the initial rendering coordinate to obtain a fourth sampling coordinate; and obtaining a color vector at the fourth sampling coordinate of the background image as the third color vector.

9. performing blending calculations on the first color vector, the second color vector, and the third color vector to obtain a rendering color vector for each rendering pixel point; obtaining a mixing coefficient based on the second direction vector and the first normal vector; 6. The method of claim 5, further comprising: performing a blending calculation on the first color vector, the second color vector, and the third color vector based on the blending coefficient to obtain a rendering color vector for each rendering pixel point.

10. The step of obtaining a mixing coefficient based on the second direction vector and the first normal vector includes: obtaining a third product value of the second direction vector and the first normal vector, and calculating a first difference value between a preset fourth parameter value and the third product value; calculating a second calculation value of a second predetermined power of the first difference value to obtain a fourth product value of a fifth predetermined parameter value and the second calculation value; 10. The method of claim 9, further comprising: adding the fourth product value and a sixth preset parameter value to obtain the mix coefficient.

11. performing blending calculations on the first color vector, the second color vector, and the third color vector based on the blending coefficients to obtain a rendering color vector for each rendering pixel point, calculating a second difference value between a seventh preset parameter value and the mixing coefficient; calculating a product of the second difference value and the third color vector to obtain a fifth product value; adding the first color vector and the second color vector to obtain a second sum, and calculating a sixth product value of the second sum and the blending coefficient; 10. The method of claim 9, further comprising adding the fifth product value and the sixth product value to obtain a rendering color vector for each of the rendering pixel points.

12. The step of determining a noise amount at the rendering time of each of the rendering pixel points based on the initial rendering coordinates, a preset noise texture, and the rendering time includes: determining a fifth sampling coordinate based on the initial rendering coordinate and the rendering time; 2. The method of claim 1, further comprising determining a noise texture vector corresponding to the fifth sampling coordinate in the noise texture as the noise amount.

13. The step of calculating the noise amount based on a preset algorithm to obtain the target rendering coordinates of each of the rendering pixel points includes: obtaining a first direction vector simulating the emission of a light ray, a second direction vector between each of the rendering pixel points and a camera capturing the background image, and a binormal vector in a global space of each of the rendering pixel points; and calculating target rendering coordinates for each of the rendering pixel points based on the initial rendering coordinates, the first direction vector, the second direction vector, the binormal vector, and the noise amount to obtain target rendering coordinates for each of the rendering pixel points.

14. An electronic device, A processor; and a memory for storing processor-executable instructions; The electronic device is characterized in that the processor is used to read the executable instructions from the memory and execute the executable instructions to realize the image rendering method described in any one of claims 1 to 13.

15. A computer-readable storage medium having a computer program stored therein, the computer program being adapted to execute the image rendering method according to any one of claims 1 to 13.

Citation Information

Patent Citations

  • Sea ice data visualization method and device for realistic drawing

    CN112907720A