Image rendering method, device, storage medium and electronic device

By generating target noise images and performing multiple sampling and noise superposition, the problem of periodic repetition and insufficient resolution of texture maps is solved, the realism and three-dimensionality of image rendering are improved, and natural simulation of fluid motion is achieved.

CN115018968BActive Publication Date: 2024-09-24LIJIE SHANGHAI INFORMATION TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210652062.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-09
Publication Date
2024-09-24
Estimated Expiration
2042-06-09

AI Technical Summary

Technical Problem

When the existing technology simulates the movement of fluids such as water, smoke, and clouds, the periodic repetition and fixed resolution of texture maps lead to poor image authenticity and three-dimensionality, and cannot effectively simulate the randomness and deformation of fluids.

Method used

By generating a target noise image and determining the target sampling method based on the rendering material, multiple sampling and noise superposition are performed to improve the randomness and resolution of the texture and synchronously deform it into the rendering model to enhance the realism and three-dimensionality of the image.

Benefits of technology

It improves the realism and three-dimensionality of image rendering, avoids monotonous repetition of texture maps and image amplification distortion, and enhances the naturalness and accuracy of rendering results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115018968B
    Figure CN115018968B
Patent Text Reader

Abstract

The present disclosure relates to an image rendering method, device, storage medium and electronic device. The method comprises: determining a target noise image; determining a target sampling method for the target noise image according to a target rendering material to be rendered, the target sampling method comprising a sampling number and sampling parameters for each sampling; sampling the target noise image multiple times according to the sampling number and sampling parameters for each sampling to obtain noise sampling; performing image rendering according to the noise sampling to obtain a rendered target image. Thus, using the target noise image as a texture for rendering improves texture randomness, can improve the realism of rendering, and can effectively avoid the problem of image magnification distortion caused by insufficient resolution of fixed texture maps. At the same time, the deformation that meets the target rendering material can be synchronized to the rendering model during rendering, causing deformation of the rendering model, which is beneficial to improving the realism and stereoscopic sense of the rendering result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to an image rendering method, device, storage medium and electronic device. Background Art

[0002] In scenes such as movie special effects, games, AR (Augmented Reality), VR (Virtual Reality), etc., it is usually necessary for the rendering engine to generate realistic images and animations, such as simulating the dynamic effects of water, smoke, clouds, etc. However, strict physical calculations (such as fluid simulation) have high computational complexity and usually cannot be run in real time. In the related technology, the solution usually adopted is to use static texture mapping, and cooperate with UV (i.e., U, V texture mapping coordinates) animation to perform translation, rotation, superposition and other actions to approximately simulate the corresponding dynamic effects. However, in the above method, the texture periodicity generated by the UV animation is obviously repeated, which does not conform to the randomness of the movement of fluids such as water, smoke, and clouds. In addition, the static texture map has a fixed resolution, and there is a problem of image magnification distortion, and the texture map has a fixed resolution. Figure 1 Generally, it is attached to the surface of the rendered mesh and does not cause any changes to the spatial geometry of the mesh, resulting in poor realism of the generated images and animations and poor simulation effects. Summary of the invention

[0003] The purpose of the present disclosure is to provide an image rendering method, device, storage medium and electronic device, which are conducive to improving the three-dimensional sense and realism of image rendering.

[0004] In order to achieve the above objective, according to a first aspect of the present disclosure, an image rendering method is provided, the method comprising:

[0005] determining a target noise image;

[0006] Determining a target sampling method for the target noise image according to a target rendering material to be rendered, wherein the target sampling method includes a sampling number and sampling parameters for each sampling;

[0007] According to the sampling times and sampling parameters of each sampling, the target noise image is sampled multiple times to obtain noise samples;

[0008] Image rendering is performed according to the noise sampling to obtain a rendered target image.

[0009] Optionally, determining the target noise image includes:

[0010] In response to identifying an image rendering request, generating an initial noise image;

[0011] The initial noise image is processed continuously to obtain the target noise image.

[0012] Optionally, generating an initial noise image includes:

[0013] Generate a noise grid, and generate a random number at each node in the noise grid to obtain the initial noise image;

[0014] The step of performing continuous processing on the initial noise image to obtain the target noise image includes:

[0015] Based on the random numbers corresponding to the nodes in the initial noise image, the non-node parts in the noise grid are interpolated to obtain the target noise image.

[0016] Optionally, determining a target sampling method for the target noise image according to a target rendering material to be rendered includes:

[0017] According to the predefined correspondence between the rendering material and the sampling mode, a sampling mode corresponding to the target rendering material is determined as the target sampling mode, wherein the sampling parameters at least include a sampling frequency.

[0018] Optionally, performing image rendering according to the noise sampling to obtain a rendered target image includes:

[0019] Determine a rendering model for image rendering, wherein the rendering model is composed of a plurality of model meshes;

[0020] According to the predefined correspondence between the rendering material and the noise superposition mode, determining the noise superposition mode corresponding to the target rendering material as the target superposition mode, wherein the target superposition mode is used to indicate the superposition order and / or superposition direction for the noise sampling;

[0021] According to the target superposition method, the noise samples are sequentially superimposed on the mesh vertices of the rendering model to obtain rendering parameters of the rendering model;

[0022] Image rendering is performed according to the rendering parameters to obtain the target image.

[0023] Optionally, the target superposition method includes a first noise superposition method for model mesh vertices in the rendering model and a second noise superposition method for pixel points in the rendering model;

[0024] The step of sequentially superimposing the noise samples onto the mesh vertices of the rendering model in accordance with the target superposition method to obtain rendering parameters of the rendering model includes:

[0025] According to the first noise superposition mode, the noise samples indicated by the first noise superposition mode are superimposed on the model mesh vertices in the rendering model to obtain a first superposition result, wherein the first superposition result is at least used to indicate a first position of each model mesh vertex in the rendering model;

[0026] According to the second noise superposition mode, the noise sample indicated by the second noise superposition mode is superimposed on the pixel point in the first superposition result to obtain a second superposition result, wherein the second superposition result is at least used to indicate a second position of the pixel point in the rendering model;

[0027] Performing illumination calculation on the pixel points in the second superposition result to obtain pixel values ​​of the pixel points in the rendering model;

[0028] The second position and pixel value of the pixel point in the rendering model are used as the rendering parameters.

[0029] Optionally, the target rendering material is water, and the first noise superposition method is used to simulate large waves of water, and the second noise superposition method is used to simulate large waves and small waves of water.

[0030] According to a second aspect of the present disclosure, there is provided an image rendering device, the device comprising:

[0031] A first determination module, used to determine a target noise image;

[0032] A second determination module is used to determine a target sampling method for the target noise image according to a target rendering material to be rendered, wherein the target sampling method includes a sampling number and a sampling parameter of each sampling;

[0033] A sampling module, used for sampling the target noise image multiple times according to the sampling times and sampling parameters of each sampling to obtain noise samples;

[0034] The rendering module is used to perform image rendering according to the noise sampling to obtain a rendered target image.

[0035] Optionally, the first determining module includes:

[0036] A generating submodule, for generating an initial noise image in response to identifying an image rendering request;

[0037] The processing submodule is used to continuously process the initial noise image to obtain the target noise image.

[0038] Optionally, the generating submodule is used to generate a noise grid, and generate a random number at each node in the noise grid to obtain the initial noise image;

[0039] The processing submodule is used to perform interpolation processing on non-node parts in the noise grid based on random numbers corresponding to nodes in the initial noise image to obtain the target noise image.

[0040] Optionally, the second determination module is used to determine a sampling method corresponding to the target rendering material as the target sampling method according to a predefined correspondence between rendering materials and sampling methods, wherein the sampling parameters at least include a sampling frequency.

[0041] Optionally, the rendering module includes:

[0042] A first determination submodule is used to determine a rendering model for image rendering, wherein the rendering model is composed of a plurality of model grids;

[0043] A second determination submodule is used to determine the noise superposition mode corresponding to the target rendering material according to the predefined correspondence between the rendering material and the noise superposition mode as the target superposition mode, wherein the target superposition mode is used to indicate the superposition order and / or superposition direction for the noise sampling;

[0044] A first superposition submodule, used for superimposing the noise samples to the mesh vertices of the rendering model in sequence according to the target superposition mode, so as to obtain rendering parameters of the rendering model;

[0045] The rendering submodule is used to perform image rendering according to the rendering parameters to obtain the target image.

[0046] Optionally, the target superposition method includes a first noise superposition method for model mesh vertices in the rendering model and a second noise superposition method for pixel points in the rendering model;

[0047] The first superposition submodule includes:

[0048] a second superposition submodule, configured to superimpose the noise samples indicated by the first noise superposition mode onto the model mesh vertices in the rendering model according to the first noise superposition mode, to obtain a first superposition result, wherein the first superposition result is at least used to indicate a first position of each model mesh vertex in the rendering model;

[0049] a third superposition submodule, configured to superimpose the noise sample indicated by the second noise superposition mode onto the pixel point in the first superposition result according to the second noise superposition mode, so as to obtain a second superposition result, wherein the second superposition result is at least used to indicate a second position of the pixel point in the rendering model;

[0050] A calculation submodule, used for performing illumination calculation on the pixel points in the second superposition result to obtain the pixel values ​​of the pixel points in the rendering model;

[0051] The third determining submodule is used to use the second position and pixel value of the pixel point in the rendering model as the rendering parameter.

[0052] Optionally, the target rendering material is water, and the first noise superposition method is used to simulate large waves of water, and the second noise superposition method is used to simulate large waves and small waves of water.

[0053] According to a third aspect of the present disclosure, a non-temporary computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the steps of the method described in the first aspect of the present disclosure are implemented.

[0054] According to a fourth aspect of the present disclosure, there is provided an electronic device, including:

[0055] a memory having a computer program stored thereon;

[0056] A processor is used to execute the computer program in the memory to implement the steps of the method described in the first aspect of the present disclosure.

[0057] Through the above technical solution, a target noise image is determined, and a target sampling method for the target noise image is determined according to the target rendering material to be rendered, wherein the target sampling method includes the number of samplings and the sampling parameters of each sampling, and the target noise image is sampled multiple times according to the number of samplings and the sampling parameters of each sampling to obtain noise sampling, and the image is rendered according to the noise sampling to obtain the rendered target image. Thus, by generating a target noise image, the target noise image is used as a texture for rendering, which improves the randomness of the texture, and the rendered image is no longer a monotonous repetition or translation of the texture map, which can improve the realism of the rendering. And, by sampling from the target noise image, the problem of image magnification distortion caused by insufficient resolution of the fixed texture map can be effectively avoided. At the same time, the noise sampled for the target rendering material can synchronize the deformation that meets the target rendering material to the rendering model when rendering the image, causing the deformation of the rendering model, which is conducive to improving the realism and stereoscopic sense of the rendering result.

[0058] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the present disclosure but do not constitute a limitation of the present disclosure. In the accompanying drawings:

[0060] Figure 1is a flowchart of an image rendering method provided according to an embodiment of the present disclosure;

[0061] Figure 2 is a block diagram of an image rendering device provided according to an embodiment of the present disclosure;

[0062] Figure 3 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0063] The specific implementation of the present disclosure is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described herein is only used to illustrate and explain the present disclosure, and is not used to limit the present disclosure.

[0064] Figure 1 FIG. 1 is a flowchart of an image rendering method provided according to an embodiment of the present disclosure. Figure 1 As shown, the method may include steps 11 to 14.

[0065] In step 11, a target noise image is determined.

[0066] The target noise image can be obtained using the currently commonly used noise generation technology. At the same time, since the materials in nature (such as water, smoke, and clouds) are random but not completely chaotic, in order to improve the realism of image rendering, the target noise image should be continuous. For example, the target noise image can be obtained using value noise, gradient noise, perlin noise, and other technologies.

[0067] In a possible implementation, step 11 may include the following steps:

[0068] In response to identifying an image rendering request, generating an initial noise image;

[0069] The initial noise image is processed continuously to obtain the target noise image.

[0070] In order to improve the authenticity of image rendering, when an image rendering request is recognized, a target noise image used in this rendering can be generated in real time. That is, whenever an image rendering request is recognized, a noise image is generated using a certain algorithm as the target noise image for this rendering.

[0071] For example, generating an initial noise image can be achieved as follows:

[0072] Generate a noise grid and generate a random number at each node in the noise grid to obtain an initial noise image.

[0073] Typically, an initial noise grid (i.e., lattice) may be generated. The structure of the noise grid may be set according to actual needs. For example, in two-dimensional image rendering, a two-dimensional grid may be generated as a noise grid, and in three-dimensional image rendering, a three-dimensional grid may be generated as a noise grid.

[0074] After generating the noise grid, a pseudo-random number can be generated at each grid node of the noise grid to obtain the initial noise image. The initial noise image is similar to the snowflake image displayed on an old-fashioned TV. The image has a high frequency, strong randomness, and no continuity. It cannot be directly used as a target noise image. Therefore, it needs to be processed continuously.

[0075] After obtaining the initial noise image, the initial noise image can be processed using a continuous processing method to obtain a continuous target noise image. Different continuous processing methods can obtain target noise images with different characteristics. Therefore, the continuous processing method can be set according to actual needs, and the present disclosure does not limit this.

[0076] For example, the initial noise image is processed continuously to obtain the target noise image, which can be achieved in the following way:

[0077] Based on the random numbers corresponding to the nodes in the initial noise image, the non-node parts in the noise grid are interpolated to obtain the target noise image.

[0078] After obtaining the initial noise image, the initial noise image can be continuously processed by interpolation processing to obtain the target noise image. Among them, different interpolation methods can be used to obtain target noise images with different characteristics. The interpolation method can be freely selected according to actual needs, and the present disclosure does not limit this. For example, a relatively smooth target noise image can be obtained by using a cubic spline interpolation method.

[0079] In step 12, a target sampling method for a target noise image is determined according to a target rendering material to be rendered.

[0080] The target noise image is a fixed noise image. In order to obtain richer noise forms for rendering, multiple sampling superpositions can be performed based on the target noise image.

[0081] Therefore, for the target rendering material to be rendered, a target sampling method for the target noise image can be determined for later sampling and superposition. The target sampling method may include the number of sampling times and sampling parameters of each sampling.

[0082] For example, the sampling parameters may include but are not limited to sampling frequency, sampling position, etc. For example, the target noise image may be sampled multiple times, and the sampling position of each sampling may be offset according to a certain rule. In a possible embodiment, a spectrum synthesis method may be adopted, that is, the frequency of this sampling is twice the frequency of the previous sampling, and the intensity of the sampling result is attenuated by half.

[0083] Different materials have different structures. Accordingly, different rendering materials use noise in different ways during the rendering process. Therefore, for different rendering materials, it is necessary to set the way to use noise specifically to add noise data harmoniously.

[0084] For example, for water material, assuming that water waves are composed of waves of different frequencies, high-frequency waves appear as small waves (for example, ripples) with small amplitudes and more frequent changes in direction, and low-frequency waves appear as large waves (for example, waves) with large amplitudes and basically no changes in direction. Based on this characteristic of water material, the sampling method corresponding to the water material can be adaptively set so that the sampled data can restore the large waves and small waves of water. For example, the sampling method can be set to sample N times, and M of them are sampled at a frequency lower than the preset frequency (for restoring large waves), and NM of them are sampled at a frequency higher than the preset frequency (for restoring small waves), where M and N are both positive integers, and M <N。

[0085] In a possible implementation, step 12 may include the following steps:

[0086] According to the predefined correspondence between the rendering material and the sampling method, a sampling method corresponding to the target rendering material is determined as the target sampling method.

[0087] As mentioned above, the sampling parameters may at least include a sampling frequency.

[0088] As described above, the sampling method of the rendering material can be set according to the characteristics of the rendering material itself. Based on this, a correspondence between the rendering material and the sampling method can be further formed. For example, if the rendering material includes water, smoke, and cloud, each of the three corresponds to a sampling method. Therefore, based on the target rendering material, the sampling method corresponding to the target rendering material can be obtained from the above correspondence as the target sampling method.

[0089] In step 13, the target noise image is sampled multiple times according to the sampling times and the sampling parameters of each sampling to obtain noise samples.

[0090] After the target sampling mode is determined, the target noise image can be sampled multiple times according to the sampling times indicated by the target sampling mode and the sampling parameters of each sampling, so as to obtain noise samples obtained by each sampling.

[0091] In step 14, image rendering is performed according to the noise sampling to obtain a rendered target image.

[0092] In a possible implementation, step 14 may include the following steps:

[0093] Determine a rendering model for image rendering, the rendering model being composed of a plurality of model meshes;

[0094] According to the predefined correspondence between the rendering material and the noise superposition method, a noise superposition method corresponding to the target rendering material is determined as the target superposition method;

[0095] According to the target superposition method, the noise samples are sequentially superimposed on the mesh vertices of the rendering model to obtain the rendering parameters of the rendering model;

[0096] The image is rendered according to the rendering parameters to obtain the target image.

[0097] The target stacking mode may be used to indicate a stacking order and / or stacking direction for noise sampling. For example, the stacking order may be determined according to a sampling frequency corresponding to the noise sampling (for example, setting the stacking order to be from low frequency to high frequency). For another example, the stacking direction may be a fixed direction, or may vary with frequency (for example, rotate as the frequency increases).

[0098] Image rendering is usually completed based on a rendering model, which is composed of multiple model meshes. The model meshes can be triangular facets, quadrilateral facets, etc. In the present disclosure, in order to improve rendering accuracy, triangular model meshes are usually used. The rendering model can change according to the rendering scene. For example, if it is in a scene of rendering a two-dimensional image, the rendering model is a two-dimensional model, and if it is in a scene of rendering a three-dimensional graphic, the rendering model is a three-dimensional model.

[0099] In a possible implementation, the target superposition method may include a first noise superposition method for model mesh vertices in the rendering model and a second noise superposition method for pixel points in the rendering model. Accordingly, according to the target superposition method, superimposing noise samples to mesh vertices of the rendering model in sequence to obtain rendering parameters of the rendering model may include the following steps:

[0100] According to the first noise superposition method, the noise samples indicated by the first noise superposition method are superimposed on the model mesh vertices in the rendering model to obtain a first superposition result;

[0101] According to the second noise superposition method, the noise samples indicated by the second noise superposition method are superimposed on the pixel points in the first superposition result to obtain a second superposition result;

[0102] Performing illumination calculation on the pixel points in the second superposition result to obtain the pixel values ​​of the pixel points in the rendering model;

[0103] The second position and pixel value of the pixel point in the rendering model are used as rendering parameters.

[0104] The first noise superposition method is for each vertex of the model mesh in the rendering model, and does not consider the non-vertex part. Therefore, the first superposition result obtained by processing is relatively rough. After processing according to the first noise superposition method, it will be further processed according to the second noise superposition method. The second noise superposition method is for each pixel point in the rendering model, which includes not only the above-mentioned vertex part but also the non-vertex part. Therefore, the second superposition result obtained by processing is relatively detailed, which is conducive to the accuracy and authenticity of the rendering.

[0105] The first superposition result can be obtained in a vertex shader, and the second superposition result and the result of the illumination calculation for the second superposition result can be obtained in a fragment shader.

[0106] The vertex shader obtains the position coordinates of the model mesh vertices from the rendering model, and superimposes the corresponding noise samples on the model mesh vertices through a first noise superposition method to obtain a first superposition result, wherein the first superposition result is at least used to indicate the first position of each model mesh vertex in the rendering model.

[0107] The fragment shader obtains the first position of each model mesh vertex and the position coordinates of the pixels near the vertex from the first superposition result, and superimposes the corresponding noise samples on the model mesh vertex and the pixels near the vertex through a second noise superposition method to obtain a second superposition result. The second superposition result is at least used to indicate the second position of the pixel (the model mesh vertex and the pixels near the vertex) in the rendering model.

[0108] For example, if the target rendering material is water, it can be seen from the above that water has two forms: large waves and small waves. Therefore, the first noise superposition method can be used to simulate large waves of water, and the second noise superposition method can be used to simulate large waves and small waves of water. In other words, firstly, large waves are superimposed on the model mesh vertices of the rendering model, and then large waves and small waves are further superimposed on the model mesh vertices of the rendering model and their adjacent pixels, which is conducive to improving the authenticity and naturalness of the rendering results.

[0109] Afterwards, the fragment shader can perform illumination calculation based on the second superposition result to obtain the pixel value of the pixel point in the rendering model. For example, the illumination calculation can use PBR (Physically-Based Rendering) or Blinn-Phong illumination model.

[0110] Based on the above steps, the second positions of multiple pixel points in the rendering model and the pixel values ​​corresponding to each of these pixel points are obtained. Therefore, these data can be used as rendering parameters required for image rendering, so that the rendering engine can perform image rendering based on the rendering parameters to obtain the rendered target image.

[0111] Through the above technical solution, a target noise image is determined, and a target sampling method for the target noise image is determined according to the target rendering material to be rendered, wherein the target sampling method includes the number of samplings and the sampling parameters of each sampling, and the target noise image is sampled multiple times according to the number of samplings and the sampling parameters of each sampling to obtain noise sampling, and the image is rendered according to the noise sampling to obtain the rendered target image. Thus, by generating a target noise image, the target noise image is used as a texture for rendering, which improves the randomness of the texture, and the rendered image is no longer a monotonous repetition or translation of the texture map, which can improve the realism of the rendering. And, by sampling from the target noise image, the problem of image magnification distortion caused by insufficient resolution of the fixed texture map can be effectively avoided. At the same time, the noise sampled for the target rendering material can synchronize the deformation that meets the target rendering material to the rendering model when rendering the image, causing the deformation of the rendering model, which is conducive to improving the realism and stereoscopic sense of the rendering result.

[0112] Figure 2 is a block diagram of an image rendering device provided according to an embodiment of the present disclosure. Figure 2 As shown, the device 20 comprises:

[0113] A first determination module 21, used to determine a target noise image;

[0114] A second determination module 22 is used to determine a target sampling method for the target noise image according to a target rendering material to be rendered, wherein the target sampling method includes a sampling number and a sampling parameter of each sampling;

[0115] A sampling module 23, configured to perform multiple sampling on the target noise image according to the sampling times and sampling parameters of each sampling to obtain noise samples;

[0116] The rendering module 24 is used to perform image rendering according to the noise sampling to obtain a rendered target image.

[0117] Optionally, the first determining module 21 includes:

[0118] A generating submodule, for generating an initial noise image in response to identifying an image rendering request;

[0119] The processing submodule is used to continuously process the initial noise image to obtain the target noise image.

[0120] Optionally, the generating submodule is used to generate a noise grid, and generate a random number at each node in the noise grid to obtain the initial noise image;

[0121] The processing submodule is used to perform interpolation processing on non-node parts in the noise grid based on random numbers corresponding to nodes in the initial noise image to obtain the target noise image.

[0122] Optionally, the second determination module 22 is used to determine a sampling method corresponding to the target rendering material as the target sampling method according to a predefined correspondence between rendering materials and sampling methods, wherein the sampling parameters at least include a sampling frequency.

[0123] Optionally, the rendering module 24 includes:

[0124] A first determination submodule is used to determine a rendering model for image rendering, wherein the rendering model is composed of a plurality of model grids;

[0125] A second determination submodule is used to determine the noise superposition mode corresponding to the target rendering material according to the predefined correspondence between the rendering material and the noise superposition mode as the target superposition mode, wherein the target superposition mode is used to indicate the superposition order and / or superposition direction for the noise sampling;

[0126] A first superposition submodule, used for superimposing the noise samples to the mesh vertices of the rendering model in sequence according to the target superposition mode, so as to obtain rendering parameters of the rendering model;

[0127] The rendering submodule is used to perform image rendering according to the rendering parameters to obtain the target image.

[0128] Optionally, the target superposition method includes a first noise superposition method for model mesh vertices in the rendering model and a second noise superposition method for pixel points in the rendering model;

[0129] The first superposition submodule includes:

[0130] a second superposition submodule, configured to superimpose the noise samples indicated by the first noise superposition mode onto the model mesh vertices in the rendering model according to the first noise superposition mode, to obtain a first superposition result, wherein the first superposition result is at least used to indicate a first position of each model mesh vertex in the rendering model;

[0131] a third superposition submodule, configured to superimpose the noise sample indicated by the second noise superposition mode onto the pixel point in the first superposition result according to the second noise superposition mode, so as to obtain a second superposition result, wherein the second superposition result is at least used to indicate a second position of the pixel point in the rendering model;

[0132] A calculation submodule, used for performing illumination calculation on the pixel points in the second superposition result to obtain the pixel values ​​of the pixel points in the rendering model;

[0133] The third determining submodule is used to use the second position and pixel value of the pixel point in the rendering model as the rendering parameter.

[0134] Optionally, the target rendering material is water, and the first noise superposition method is used to simulate large waves of water, and the second noise superposition method is used to simulate large waves and small waves of water.

[0135] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0136] Figure 3 FIG. 7 is a block diagram of an electronic device 700 according to an exemplary embodiment. Figure 3 As shown, the electronic device 700 may include: a processor 701 and a memory 702. The electronic device 700 may also include one or more of a multimedia component 703, an input / output (I / O) interface 704, and a communication component 705.

[0137] The processor 701 is used to control the overall operation of the electronic device 700 to complete all or part of the steps in the above-mentioned image rendering method. The memory 702 is used to store various types of data to support the operation of the electronic device 700, which may include instructions for any application or method used to operate on the electronic device 700, and application-related data, such as contact data, messages sent and received, pictures, audio, video, etc. The memory 702 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, referred to as EPROM), programmable read-only memory (Programmable Read-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, disk or optical disk. The multimedia component 703 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may be further stored in the memory 702 or sent through the communication component 705. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 704 provides an interface between the processor 701 and other interface modules, and the other interface modules may be keyboards, mice, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 705 is used for wired or wireless communication between the electronic device 700 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more of them, is not limited here. Therefore, the corresponding communication component 705 may include: Wi-Fi module, Bluetooth module, NFC module, etc.

[0138] In an exemplary embodiment, the electronic device 700 can be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned image rendering method.

[0139] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the steps of the above-mentioned image rendering method are implemented. For example, the computer-readable storage medium can be the above-mentioned memory 702 including program instructions, and the above-mentioned program instructions can be executed by the processor 701 of the electronic device 700 to complete the above-mentioned image rendering method.

[0140] The preferred embodiments of the present disclosure are described in detail above in conjunction with the accompanying drawings; however, the present disclosure is not limited to the specific details in the above embodiments. Within the technical concept of the present disclosure, a variety of simple modifications can be made to the technical solution of the present disclosure, and these simple modifications all fall within the protection scope of the present disclosure.

[0141] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present disclosure will not further describe various possible combinations.

[0142] In addition, various embodiments of the present disclosure may be arbitrarily combined, and as long as they do not violate the concept of the present disclosure, they should also be regarded as the contents disclosed by the present disclosure.

Claims

1. An image rendering method, characterized in that: The method comprises: determining a target noise image; Determining a target sampling method for the target noise image according to a target rendering material to be rendered, wherein the target sampling method includes a sampling number and sampling parameters for each sampling; According to the sampling times and sampling parameters of each sampling, the target noise image is sampled multiple times to obtain noise samples; Perform image rendering according to the noise sampling to obtain a rendered target image; The performing image rendering according to the noise sampling to obtain a rendered target image includes: Determine a rendering model for image rendering, wherein the rendering model is composed of a plurality of model meshes; According to the predefined correspondence between the rendering material and the noise superposition mode, determining the noise superposition mode corresponding to the target rendering material as the target superposition mode, wherein the target superposition mode is used to indicate the superposition order and / or superposition direction for the noise sampling; According to the target superposition method, the noise samples are sequentially superimposed on the mesh vertices of the rendering model to obtain rendering parameters of the rendering model; Image rendering is performed according to the rendering parameters to obtain the target image.

2. The method according to claim 1, characterized in that The step of determining a target noise image comprises: In response to identifying an image rendering request, generating an initial noise image; The initial noise image is processed continuously to obtain the target noise image.

3. The method according to claim 2, characterized in that The generating of the initial noise image comprises: Generate a noise grid, and generate a random number at each node in the noise grid to obtain the initial noise image; The step of performing continuous processing on the initial noise image to obtain the target noise image includes: Based on the random numbers corresponding to the nodes in the initial noise image, the non-node parts in the noise grid are interpolated to obtain the target noise image.

4. The method according to claim 1, characterized in that: The step of determining a target sampling method for the target noise image according to a target rendering material to be rendered includes: According to the predefined correspondence between the rendering material and the sampling mode, a sampling mode corresponding to the target rendering material is determined as the target sampling mode, wherein the sampling parameters at least include a sampling frequency.

5. The method according to claim 1, characterized in that The target superposition method includes a first noise superposition method for model mesh vertices in the rendering model and a second noise superposition method for pixel points in the rendering model; The step of sequentially superimposing the noise samples onto the mesh vertices of the rendering model in accordance with the target superposition method to obtain rendering parameters of the rendering model includes: According to the first noise superposition mode, the noise samples indicated by the first noise superposition mode are superimposed on the model mesh vertices in the rendering model to obtain a first superposition result, wherein the first superposition result is at least used to indicate a first position of each model mesh vertex in the rendering model; According to the second noise superposition mode, the noise sample indicated by the second noise superposition mode is superimposed on the pixel point in the first superposition result to obtain a second superposition result, wherein the second superposition result is at least used to indicate a second position of the pixel point in the rendering model; Performing illumination calculation on the pixel points in the second superposition result to obtain pixel values ​​of the pixel points in the rendering model; The second position and pixel value of the pixel point in the rendering model are used as the rendering parameters.

6. The method according to claim 5, characterized in that The target rendering material is water, and the first noise superposition method is used to simulate large waves of water, and the second noise superposition method is used to simulate large waves and small waves of water.

7. An image rendering device, characterized in that: The device comprises: A first determination module, used to determine a target noise image; A second determination module is used to determine a target sampling method for the target noise image according to a target rendering material to be rendered, wherein the target sampling method includes a sampling number and a sampling parameter of each sampling; A sampling module, used for sampling the target noise image multiple times according to the sampling times and sampling parameters of each sampling to obtain noise samples; A rendering module, used for performing image rendering according to the noise sampling to obtain a rendered target image; The rendering module includes: A first determination submodule is used to determine a rendering model for image rendering, wherein the rendering model is composed of a plurality of model grids; A second determination submodule is used to determine the noise superposition mode corresponding to the target rendering material according to the predefined correspondence between the rendering material and the noise superposition mode as the target superposition mode, wherein the target superposition mode is used to indicate the superposition order and / or superposition direction for the noise sampling; A first superposition submodule, used for superimposing the noise samples to the mesh vertices of the rendering model in sequence according to the target superposition mode, so as to obtain rendering parameters of the rendering model; The rendering submodule is used to perform image rendering according to the rendering parameters to obtain the target image.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented.

9. An electronic device, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 6.