CN114092625B - Real-time multi-scale high-frequency material rendering method and system based on normal map - Google Patents

Real-time multi-scale high-frequency material rendering method and system based on normal map Download PDF

Info

Publication number
CN114092625B
CN114092625B CN202111400846.0A CN202111400846A CN114092625B CN 114092625 B CN114092625 B CN 114092625B CN 202111400846 A CN202111400846 A CN 202111400846A CN 114092625 B CN114092625 B CN 114092625B
Authority
CN
China
Prior art keywords
frequency material
frequency
image
rendered
normal map
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111400846.0A
Other languages
Chinese (zh)
Other versions
CN114092625A (en
Inventor
王璐
谭皓文
徐延宁
朱君秋
孟祥旭
王贝贝
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong University
Original Assignee
Shandong University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong University filed Critical Shandong University
Priority to CN202111400846.0A priority Critical patent/CN114092625B/en
Publication of CN114092625A publication Critical patent/CN114092625A/en
Application granted granted Critical
Publication of CN114092625B publication Critical patent/CN114092625B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)

Abstract

The invention discloses a real-time multi-scale high-frequency material rendering method and a system based on normal map, which acquire a high-frequency material image to be rendered; acquiring a normal map of a high-frequency material image to be rendered; determining a target normal map and a mapping structure based on the normal map of the high-frequency material image to be rendered; determining a corresponding current level based on the shading point footprint and the mapping structure; screening upper and lower layer-level Gaussian lobes corresponding to the current level according to the determined current level; calculating contribution values of the screened upper and lower Gaussian lobes; interpolation is carried out on the contribution values of the upper layer and the lower layer to obtain a final total contribution value, and then a direct illumination image of the high-frequency material to be rendered is obtained; mixing the direct illumination image of the high-frequency material to be rendered and the indirect illumination result image after denoising of the non-high-frequency material to obtain a final rendered image. The direct illumination of the high-frequency material and the indirect illumination after denoising of the common material are mixed together to obtain a better rendering result.

Description

Real-time multi-scale high-frequency material rendering method and system based on normal map
Technical Field
The invention relates to the technical field of real-time micro-surface rendering based on physics, in particular to a real-time multi-scale high-frequency material rendering method and system based on normal map.
Background
The statements in this section merely relate to the background of the present disclosure and may not necessarily constitute prior art.
Physical-based rendering describes this process by simulating interactions with light by different materials in the real world, and using bi-directional reflectance distribution functions (Bidirectional Reflectance Distribution Function, BRDF). The visual appearance of real world materials with multi-scale surface features has been highly interesting for computer graphics for decades. Under classical micro-surface theory, the surface of an object is a macroscopic surface consisting of numerous irregularly distributed micro-surfaces, and objects observed by the human eye on a macroscopic scale are the result of the co-action of these micro-surfaces. However, the conventional bidirectional reflection distribution function cannot truly restore the appearance change caused by the high-frequency material by adopting a smooth normal distribution function (Normal Distribution Function, NDF). The high-frequency materials are divided into discrete high-frequency materials and structured high-frequency materials, wherein the discrete high-frequency materials comprise snowfield, scratches, wiredrawing metals, leather and the like, and the high-frequency materials are characterized by flickering phenomena which violate the rules of multi-scale materials, and the simulation of the materials cannot be realized through simple nonlinear pre-filtering and other means; whereas structured high frequency materials cause complex anisotropic highlights,
In the field of off-line rendering in recent years, normal distribution functions of materials can be accurately simulated through means such as high-precision normal mapping, high-quality results including high-frequency materials such as flickering are rendered, but the problems of overlong rendering time, overlarge data memory overhead and the like exist at the same time, and the off-line rendering method is not suitable for being directly transplanted to the field of real-time rendering.
The inventors have found that existing real-time rendering methods are not consistent, and that simple high-frequency geometric features are usually used as additional properties of materials, so that the appearance is limited to specific types of flickering (such as flickering and scratches caused by lamellar micro-surface features) or anisotropic highlighting, and even if supplemented by texture mapping or the like, good results cannot be obtained. In the practical application process, the user needs to select different methods to process the high-frequency materials according to the needs of the user, and multiple high-frequency materials cannot be used at the same time.
Disclosure of Invention
In order to solve the defects in the prior art, the invention provides a real-time multi-scale high-frequency material rendering method and a system based on normal map; the GPU is utilized to calculate the micro-surface normal distribution function in a highly parallel manner, so that the storage space can be reduced while the characteristics of the high-frequency material are maintained, and the multi-scale consistent real-time rendering of the high-frequency material is realized for the first time.
In a first aspect, the present invention provides a real-time multi-scale high-frequency material rendering method based on normal map;
A real-time multi-scale high-frequency material rendering method based on normal mapping comprises the following steps:
Acquiring a high-frequency material image to be rendered;
acquiring a normal map of a high-frequency material image to be rendered; determining a target normal map and a mapping structure based on the normal map of the high-frequency material image to be rendered; the mapping structure refers to: mapping relation of blocks between normal line mapping of the high-frequency material image to be rendered and target normal line mapping;
Acquiring a coloring point footprint; determining a corresponding current level based on the shading point footprint and the mapping structure; screening upper-level Gaussian lobes and lower-level Gaussian lobes corresponding to the current level according to the determined current level; calculating contribution values of the screened upper-level Gaussian lobe and lower-level Gaussian lobe; interpolating the contribution values of the upper layer and the lower layer to obtain a final total contribution value, and further obtaining a direct illumination image without noise of the high-frequency material to be rendered;
Mixing the direct illumination image without noise of the high-frequency material to be rendered and the indirect illumination result image after denoising of the non-high-frequency material to obtain a final rendered image.
In a second aspect, the invention provides a real-time multi-scale high-frequency material rendering system based on normal mapping;
a real-time multi-scale high frequency material rendering system based on normal mapping, comprising:
an acquisition module configured to: acquiring a high-frequency material image to be rendered;
A mapping structure determination module configured to: acquiring a normal map of a high-frequency material image to be rendered; determining a target normal map and a mapping structure based on the normal map of the high-frequency material image to be rendered; the mapping structure refers to: mapping relation of blocks between normal line mapping of the high-frequency material image to be rendered and target normal line mapping;
a computing module configured to: acquiring a coloring point footprint; determining a corresponding current level based on the shading point footprint and the mapping structure; screening upper-level Gaussian lobes and lower-level Gaussian lobes corresponding to the current level according to the determined current level; calculating contribution values of the screened upper-level Gaussian lobe and lower-level Gaussian lobe; interpolating the contribution values of the upper layer and the lower layer to obtain a final total contribution value, and further obtaining a direct illumination image without noise of the high-frequency material to be rendered;
a mixing module configured to: mixing the direct illumination image without noise of the high-frequency material to be rendered and the indirect illumination result image after denoising of the non-high-frequency material to obtain a final rendered image.
In a third aspect, the present invention also provides an electronic device, including:
A memory for non-transitory storage of computer readable instructions; and
A processor for executing the computer-readable instructions,
Wherein the computer readable instructions, when executed by the processor, perform the method of the first aspect described above.
In a fourth aspect, the invention also provides a storage medium storing non-transitory computer readable instructions, wherein the instructions of the method of the first aspect are executed when the non-transitory computer readable instructions are executed by a computer.
In a fifth aspect, the invention also provides a computer program product comprising a computer program for implementing the method of the first aspect described above when run on one or more processors.
Compared with the prior art, the invention has the beneficial effects that:
The invention calculates the high-frequency material in real time, realizes the coloring with anti-aliasing and time sequence stability by using multi-scale material clustering, has stronger expression capability, can realize consistent rendering on discrete and structured high-frequency materials, has stable storage space without linear growth along with the improvement of the complexity of the material by directly synthesizing Gaussian lobes required by an algorithm, and can simultaneously obtain complex anisotropic high light brought by the structured high-frequency material and flickering phenomenon brought by the discrete high-frequency material by real-time rendering.
The real-time rendering method of the high-frequency material can be suitable for different types of high-frequency materials, can render and obtain complex anisotropic high light caused by the structured high-frequency material, scratches, flickering and other phenomena caused by the discrete high-frequency material, and can also obtain the mixed result of the discrete high-frequency material and the structured high-frequency material.
The four-dimensional position-normal lobe generation method is suitable for micro-surface structures with various sizes. The present invention uses these lobes to generate more lobes and uses these lobes to describe the micro-surface structure by taking a fixed size normal map as input, discretizing and generating four-dimensional gaussian lobes.
According to the invention, the MIP-mapped data structure of the four-dimensional Gaussian lobe is introduced into the GPU, the parallel computing capability of the GPU can be fully utilized, the four-dimensional Gaussian lobe can be quickly searched in the GPU within the footprint range corresponding to the colored point, and the corresponding normal distribution function can be quickly obtained through calculation.
The invention provides real-time high-frequency material rendering with global illumination effect, and a better rendering result is obtained by mixing direct illumination of the high-frequency material and indirect illumination after denoising of the common material.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention.
FIG. 1 is a schematic diagram of four-dimensional Gaussian lobes corresponding to query color points according to an embodiment of the invention;
FIG. 2 is a flow chart of a rendering result of a high-frequency material under a global illumination effect according to an embodiment of the present invention;
Fig. 3 (a) and fig. 3 (b) are graphs comparing the results of the rendering method and other methods according to the embodiment of the present invention in a complex vehicle scene with multiple high-frequency materials;
Fig. 4 (a) and fig. 4 (b) are graphs showing rendering results of two high-frequency materials, namely scratch and anisotropy, in a ball scene according to the first embodiment of the present invention;
Fig. 5 (a) to 5 (f) are graphs of rendering results of three high-frequency materials, namely scratch, structuring and a mixture of the scratch and structuring, provided in the first embodiment of the present invention, under the rendering method of the present embodiment;
Fig. 6 (a) to fig. 6 (c) are graphs of rendering results of three high-frequency materials, i.e. isotropic noise, wire drawing metal and structuring, in a teapot scene by using the rendering method according to the first embodiment of the present invention;
Fig. 7 (a) to 7 (d) are graphs comparing the results of the rendering method according to the first embodiment of the present invention with those of other methods.
Detailed Description
It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the invention. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular forms also are intended to include the plural forms, and furthermore, it is to be understood that the terms "comprises" and "comprising" and any variations thereof are intended to cover non-exclusive inclusions, such as, for example, processes, methods, systems, products or devices that comprise a series of steps or units, are not necessarily limited to those steps or units that are expressly listed, but may include other steps or units that are not expressly listed or inherent to such processes, methods, products or devices.
Embodiments of the invention and features of the embodiments may be combined with each other without conflict.
All data acquisition in the embodiment is legal application of the data on the basis of meeting laws and regulations and agreements of users.
Example 1
The embodiment provides a real-time multi-scale high-frequency material rendering method based on normal map;
A real-time multi-scale high-frequency material rendering method based on normal mapping comprises the following steps:
s101: acquiring a high-frequency material image to be rendered;
s102: acquiring a normal map of a high-frequency material image to be rendered; determining a target normal map and a mapping structure based on the normal map of the high-frequency material image to be rendered; the mapping structure refers to: mapping relation of blocks between normal line mapping of the high-frequency material image to be rendered and target normal line mapping;
S103: acquiring a coloring point footprint; determining a corresponding current level based on the shading point footprint and the mapping structure; screening upper-level Gaussian lobes and lower-level Gaussian lobes corresponding to the current level according to the determined current level; calculating contribution values of the screened upper-level Gaussian lobe and lower-level Gaussian lobe; interpolating the contribution values of the upper layer and the lower layer to obtain a final total contribution value, and further obtaining a direct illumination image without noise of the high-frequency material to be rendered;
s104: mixing the direct illumination image without noise of the high-frequency material to be rendered and the indirect illumination result image after denoising of the non-high-frequency material to obtain a final rendered image.
Further, the step S101: acquiring a high-frequency material image to be rendered; the high-frequency material image is a rendering result image in which materials in a scene display high-frequency characteristics such as anisotropic high light and scratches after being lighted by a strong light source such as a point light source.
Further, the step S102: acquiring a normal map of a high-frequency material image to be rendered; the method specifically comprises the following steps:
obtaining geometric characteristic data required by a high-frequency material image to be rendered;
and extracting a plurality of normal maps with fixed sizes of the high-frequency material image to be rendered from the geometric characteristic data of the high-frequency material image to be rendered.
Further, the step S102: determining a target normal map based on the normal map of the high-frequency material image to be rendered; the method specifically comprises the following steps:
s1021: dividing a normal map I of a high-frequency material image to be rendered into a plurality of blocks; each block is considered as a set of several four-dimensional gaussian lobes;
S1022: randomly extracting a block from a normal map I of a high-frequency material image to be rendered, placing the block in the upper left corner of a target normal map H, and naming the block in the upper left corner of the target normal map as P0;
s1023: for the blocks Pi which are already placed on the target normal map, traversing the normal map I of the high-frequency material image to be rendered, and selecting a new block Pj; in the selection process, calculating the overlapping area error of four-dimensional Gaussian lobes contained in the overlapping area of the new block Pj and the block Pi, randomly selecting a block meeting the overlapping area error constraint, and if the block meeting the overlapping area error constraint is not available, selecting the block with the smallest overlapping area error;
s1024: calculating the overlapping area of the new block Pj and the block Pi, and finding the path of the minimum joint error between the two blocks;
s1025: fixing the new block Pj to the target normal map H, while also being fixed with the path of minimum joint error;
S1026: and repeating S1023-S1025 until the target normal map H is filled by the blocks.
Further, the step S1021: dividing a normal map I of a high-frequency material image to be rendered into a plurality of blocks; each block is considered as a set of several four-dimensional gaussian lobes; the method specifically comprises the following steps:
Firstly, gaussian lobes on I are divided into n space grids, then, for each grid, a K-Means clustering method is used for clustering four-dimensional Gaussian lobes in each grid into K new four-dimensional Gaussian lobes, and in the clustering process, the positions and normal information of the lobes are considered at the same time, and the same K value is used for different space grids, so that storage is stable.
Further, the mapping structure refers to: mapping relation of blocks between a normal map I of a high-frequency material image to be rendered and a target normal map H.
By taking a fixed-size normal map as input, extracting corresponding four-dimensional Gaussian lobes by discretizing the texture, and according to the similarity of the extracted four-dimensional Gaussian lobes, similar to the idea of texture synthesis, implicitly generating a fixed-size MIP-mapped normal map and a corresponding Lookup Table (LUT), wherein the Lookup Table is a mapping structure instead of explicitly generating a large-scale high-precision normal map. The generated MIP-map structure may be reused in the rendering phase of rendering. The Gaussian lobes of different MIP-map levels are organized by combining similar Gaussian lobes into one large Gaussian lobe according to different clustering coefficients by adopting a K-means clustering algorithm.
The present embodiment provides a method for generating a MIP-mapped normal map, first, using a normal map I of a fixed size as input, generating a target large-scale normal map H, where H is divided into a plurality of blocks (patches), which are square areas in texture space, whose size is defined by a user and smaller than the input texture I, the blocks are understood to be a set of a plurality of four-dimensional gaussian lobes, and the generation algorithm of the target large-scale normal map specifically includes:
(1): four-dimensional gaussian lobes are extracted from the blocks Pi in the input normal map I, where the attributes describing gaussian lobes of the present invention include: two-dimensional position information u of lobes in textures, two-dimensional normal information s at the positions, corresponding two-dimensional standard deviation sigma h, corresponding 2X2 Jacobian determinant J and other information used for representing the curvature of a plane;
(2): randomly extracting a block from I, placing the block in the upper left corner of H, and naming the block on H as P0;
(3): for the blocks Pi already placed on H, traversing I to select a new block Pj, for each block Pi, calculating the error of the four-dimensional gaussian lobe contained in the overlapping area of the newly selected block Pj and Pi, randomly selecting a block satisfying the error constraint, and if no block satisfying the error constraint, selecting a new block having the smallest error;
(4): calculating the overlapping area of the selected new block and the original block, and finding a joint path with minimum error between the two blocks;
(5): fixing this new block to the target map H, while also fixing the minimum error seam path determined by S104;
(6): repeating the steps (3) to (5) until the target normal map H is completely filled by the blocks;
The key step of the above synthesis method is (3), namely, find the adjacent block Pj corresponding to the minimum overlap region error from the input normal map for one block Pi. The invention firstly randomly selects Pi from I, then randomly selects an area with the same size from I, finds an area meeting the error constraint of the overlapped area, names the area as Pj, and then finds the minimum joint path between two blocks through (4).
Both the overlap region error and the minimum joint error are evaluated by the similarity of the four-dimensional gaussian lobes, which can give the four-dimensional gaussian lobes a continuity over H. The similarity of two adjacent lobes is expressed by equation (1):
Distij=α||ni-nj||2+(1-α)||Σij||2; (1)
Wherein Dist ij is i, the joint error of two gaussian lobes of j, n i,nj is the normal corresponding to the two four-dimensional lobes, Σ ij is the corresponding jacobian matrix, α is used to balance the similarity of the normal and the similarity of the jacobian matrix, α is taken as 0.9 in this embodiment, and the method of this embodiment explicitly derives the normal map and compares it with other texture synthesis methods. For the scratch material with stronger structure and the leather material with weaker structure, the results obtained by the embodiment can obtain better continuous texture characteristics without the occurrence of blurring and texture characteristic loss.
The present invention further defines a mapping structure LUT to preserve the mapping relationship between I and H, the preserved data including the index of the block and the lobe index of the boundary region of the block. Since only the four-dimensional lobe information and LUT of the input normal map are saved, the memory overhead is mainly determined by the resolution of the input sample map, which is also suitable for the storage of the GPU.
Since four-dimensional lobes on the spatial domain often have similar normal direction information, the LOD MIP-map model is utilized to organize the original four-dimensional Gaussian lobes, which also accords with the characteristic of GPU streaming and information acquisition at the same time.
Firstly, gaussian lobes on I are divided into n space grids, then, for each grid, a K-Means clustering method is used for clustering four-dimensional Gaussian lobes in each grid into K new four-dimensional Gaussian lobes, and in the clustering process, the positions and normal information of the lobes are considered at the same time, and the same K value is used for different space grids, so that storage is stable.
For the target large-scale normal map H, the invention always uses the bottom lobe of the MIP-map to process boundary conditions (usually 2 to 4 lobes) in the rendering process, wherein the bottom data of the MIP-map is data of the original four-dimensional Gaussian lobes which are not clustered, and the invention finds internal lobes in blocks under different MIP-map levels through index information in the LUT.
This implementation counts the memory overhead for different types of materials, as can be seen from table 1. In this embodiment, the size of the input normal map is 256×256 or 512×512, the size of the block is set to 64×64 or 128×128 in the process of generating the large-scale normal map algorithm, and for the material with strong discrete features, such as the material with scratches, the size of the block is set to 128×128, and the size of the overlapping area is set to 2, so that the time overhead of the generating algorithm is between 10 minutes and 35 minutes.
Table 1 different material memory overhead statistics
Material of material Input size Target size MIP-mapped size (MB) LUT size (MB)
Leather 256*256 4K*4K 14.3 13.1
Isotropic material 256*256 4K*4K 14.3 13.1
Anisotropic material 256*256 4K*4K 14.3 13.1
Scratch mark 512*512 7K*7K 37.3 38.5
Structured material 256*256 2K*2K 14.3 4.3
Wire drawing metal 256*256 4K*4K 14.3 13.1
Mixed material 512*512 7K*7K 37.3 38.5
The present embodiment provides a method for quickly searching and obtaining gaussian lobes within a footprint range of a coloring point in a GPU so as to quickly evaluate and calculate a normal distribution function, in which the gaussian lobes within the footprint range corresponding to the coloring point need to be obtained in the coloring process, so as to evaluate the normal distribution function, as shown in fig. 1, specifically including:
Further, the step S103: acquiring a coloring point footprint; the footprint refers to the queried area in the texture space of the normal map corresponding to the color point.
Further, the step S103: determining a corresponding current level based on the shading point footprint and the mapping structure; the method specifically comprises the following steps:
According to the footprint size corresponding to the coloring point, the level of the MIP-map is directly positioned according to a formula (2):
Where lambda is the MIP-map level of direct localization, Is the size of the footprint,/>Is the scaling factor used to control the size of the footprint of the query, and is fixed to 0.5 in this embodiment.
Further, the step S103: screening upper-level Gaussian lobes and lower-level Gaussian lobes corresponding to the current level according to the determined current level; the method specifically comprises the following steps:
querying Gaussian lobes meeting the condition of half-vector retrieval range on two adjacent MIP-map levels according to the determined MIP-mapped levels, using Representing upper and lower adjacent MIP-map levels, respectively. The half vector refers to an intermediate vector between the direction of the light source and the direction of the viewing angle, and the calculation of the gaussian participation contribution in the specified direction range, namely the half vector search range, can be measured by defining the included angle between the half vector corresponding to the color point and the normal of the gaussian lobe.
It will be appreciated that if only one MIP-mapped level is used for rendering with corresponding gaussian lobes, it is apparent that the adjacent pixels rendered are prone to significant discontinuities, whereas interpolation at two different levels in the practice of the present invention can better address discontinuities.
Further, the step S103: calculating contribution values of the screened upper-level Gaussian lobe and lower-level Gaussian lobe; the method specifically comprises the following steps:
And calculating the contribution values of the screened upper-level Gaussian lobe and lower-level Gaussian lobe by adopting a normal distribution function term.
According to Gaussian lobes meeting the conditions obtained by inquiry, performing evaluation calculation on normal distribution function items;
Wherein use is made of Representing lobes from two adjacent levels of queries, respectively, which are used to model complex normal distribution functions, the numbers of which are represented as τ, φ,/>, respectivelyIs a Gaussian distribution function for the position u, used to represent the range of footprints corresponding to coloring points,/>Is footprint/>And querying a normal distribution function term with half vector s, wherein the normal distribution function term is used for representing the energy distribution condition of the material in different directions. And (3) defining calculation of contribution to single Gaussian lobe meeting the condition according to a formula (3), and finally accumulating to obtain a normal distribution function term.
Further, when one footprint spans more than one block, dividing the footprint into a plurality of sub-footprint areas, respectively calculating contribution values of all sub-footprints, and then accumulating the contribution values;
when the sub-footprint area still spans more than one block, queries will be conducted using MIP-map underlayers that do not participate in K-means clustering.
When a certain MIP-map level is queried, the invention can quickly obtain the lobes in the footprint range on the GPU through the rectangle defined by the footprint and the bounding box of the lobes, and obtain all the lobes meeting the condition on the level by eliminating the lobes which do not accord with the half vector query range in the normal space, thereby the query process is quick and efficient due to the parallel processing performance of the GPU.
The implementation counts the rendering time of different types of high-frequency materials under different scenes and the complexity of the scenes, and the complexity is listed in table 2. Real-time rendering (> = 30 fps) under 1920 x 1080 screen space is achieved in the test scene.
Table 2 different scene rendering time statistics results
It will be appreciated that in making an estimate of the normal distribution function term, a footprint may span multiple blocks, and if this problem is ignored, the result may be discontinuities at the boundaries of the blocks.
Further, the step S104: mixing a direct illumination image without noise of the high-frequency material to be rendered and an indirect illumination result image after denoising of the non-high-frequency material to obtain a final rendered image; the method specifically comprises the following steps:
and obtaining a noise-removed image from the indirect illumination result of the noisy non-high frequency material through a denoising algorithm, and then mixing the noise-removed image with the direct illumination result of the non-noise high frequency material to obtain a final rendered image with a global illumination effect.
The rendering system is built by utilizing the rendering engine kernel Optix based on the GPU, basic operations such as scene reading, ray traversing, rendering result outputting and the like can be realized, and the high-frequency materials are accelerated and the rendering is more efficiently completed by utilizing a heterogeneous computing framework combining GPU-end parallel computing and CPU-end serial computing.
A method for quickly retrieving gaussian lobes within a range of a coloring point footprint (Footprint) in a GPU to quickly evaluate a computed normal distribution function, comprising:
For each shading point, according to the size of its footprint, the MIP-mapped level is determined directly according to equation (4), where λ represents the MIP-map level obtained by direct query, For the size of the footprint corresponding to the color point,/>In practice, we usually set 0.5 for controlling the size of footprint for the scaling factor, and perform Gaussian lobe query meeting the half-vector search range under footprint corresponding to color point on two adjacent levels, and the query for the lobe can stop at any one MIP-map level, so as to reduce the query time of algorithm, query to obtain two levels of Gaussian lobes, respectively calculate the contribution values of the two levels under the designated half-vector, and combine the contribution values of the two levels according to the weight.
The high-frequency material rendering algorithm of the invention can be divided into three main stages: a pretreatment stage, a coloring stage and a post-treatment stage.
In the first stage, the input normal map with fixed size is discretized, four-dimensional Gaussian lobes and corresponding mapping structure structures are generated, and large-scale normal maps and corresponding MIP-map structures are implicitly generated according to the similarity of the four-dimensional Gaussian and the generation algorithm.
In the second stage, the MIP-mapped level is positioned and inquired to obtain four-dimensional Gaussian lobes meeting the requirements, the contribution of the lobes of the adjacent level is calculated, a final normal distribution function item is estimated and calculated in an interpolation mode, and the normal distribution function item obtained through the estimation is more truly restored to the bidirectional reflection distribution function of the material, so that a rendering result of the high-frequency material without noise and under direct illumination is obtained.
In the third stage, the complete global illumination is obtained by mixing the direct illumination of the high-frequency material and the indirect illumination of the common material after denoising. The spatial filtering method is adopted in the denoising method, characteristic information such as depth, color, normal and the like of a scene is collected in the ray tracing process, and then Edge-avoiding Wavelet Transform (EAW) denoising is carried out.
In this embodiment, as shown in fig. 2, the flowchart of the algorithm is subjected to three steps or modules of preprocessing, coloring and post-processing from left to right to obtain a rendering result of the high-frequency material with the global illumination effect. The platform used in this embodiment is a personal computer, the graphics processor is an ambidax TITAN, the CPU is Intel (R) i9-9900K with a dominant frequency of 3.6GHz, the memory is 32GB, and all rendering results in this embodiment are tested in 1920 x 1080 screen space.
The rendering method of the embodiment is suitable for a scene model with multiple high-frequency materials, and as shown in fig. 3 (a) and 3 (b), three rendering results of different high-frequency materials are shown in a complex vehicle scene, and the isotropic metal of the vehicle hood, the flickering phenomenon caused by scratch materials on the bumper and the structured high light caused by structured materials on the tire are shown. Fig. 4 (a) and 4 (b) show the results of using the rendering method of the present embodiment for the scratch material and the anisotropic material, respectively, in the ball scene. The method of the present embodiment can process different types of high-frequency materials, including discrete types of high-frequency materials such as scratches, structured high-frequency materials, and mixed materials thereof, and the results thereof can be represented as rendering results of fig. 5 (a) to 5 (f). Fig. 6 (a) to 6 (c) show that the rendering method of the present embodiment can process different types of high-frequency materials, and the results of fig. 6 (a) to 6 (c) show the rendering results of three different types of high-frequency materials, i.e., isotropic noise, wire drawing metal, and structured material.
Extracting four-dimensional Gaussian lobes in the map through discretization texture, describing the lobes according to the positions, normal directions, shapes, sizes and Jacobian matrixes of the lobes, and implicitly generating a large-scale normal map according to the similarity of the extracted lobes, wherein three attributes of the normal directions, the positions and the Jacobian matrixes of the lobes are mainly considered in the generation process;
And in the process of generating the large-scale normal map texture, gaussian lobes are organized in a block mode, the large-scale texture is formed by splicing blocks organized by Gaussian lobes extracted from the original input texture, and the selection of adjacent blocks and the joint treatment between the blocks are carried out according to the minimum error principle. The principle of minimum error is mainly to consider the difference of the position, direction and Jacobian matrix between the Gaussian lobes.
And organizing the generated large-scale map in the form of MIP-map, and generating a mapping structure LUT in the generation process at the same time to realize the mapping relation between the original Gaussian lobe and each MIP-map level lobe, wherein the LUT data structure stores the index of the original block and the index of the joint between the blocks.
In performing the organization of the MIP-map level, the downsampling of the texture is accomplished by a filtering operation of the texture space, unlike conventional MIP-maps.
The Gaussian lobes of different MIP-map levels are combined into large Gaussian lobes by adopting a K-Means clustering algorithm according to different clustering coefficients, so that the organization of the structure is completed.
According to the method, the corresponding Gaussian lobes in the coloring point footprint range are quickly retrieved in the GPU in the rendering based on physics in ray tracing, so that the normal distribution function item is quickly evaluated, and the bidirectional reflection distribution function of the material is more truly restored. Directly obtaining the footprint size of the color point through light differentiation, and determining the MIP-map level through the footprint size;
According to the invention, the Gaussian lobes obtained in the upper and lower layers are searched, and the Gaussian lobes meeting the conditions are required to meet the position limit of the bounding box in the footprint range and the direction limit of the normal direction in the query half vector at the same time, so that contribution calculation is respectively carried out on the Gaussian lobes obtained in the upper and lower layers, and the continuity between the layers is ensured in an interpolation mode;
the invention processes special conditions in the query process, and the footprint range corresponding to the coloring point spans a plurality of blocks, so that the solving strategy is as follows: dividing the footprint into four sub-footprint areas, calculating the sub-footprints respectively, and then accumulating their contributions, and when the sub-footprint areas still span more than one block, using MIP-map bottom lobes without K-means clustering for query and contribution calculation.
The invention provides high-frequency material rendering with global illumination effect, which obtains better rendering results by mixing direct illumination of high-frequency materials and indirect illumination after denoising of common materials, and obtains characteristic information such as normal, depth, color and the like by collecting scene information by light in the rendering process;
The invention uses the ray tracing algorithm to divide the direct illumination and the indirect illumination of the rendering result into channels, and the direct illumination of the high-frequency material is not processed, the indirect illumination of the high-frequency material and the common material in the scene are processed by spatial filtering, the data collected before the spatial filtering process is utilized, and the filtering algorithm of edge preservation is adopted, so that the geometric edge information of the rendering result is preserved to the greatest extent.
The invention is applicable to different high-frequency materials, and the implementation effects comprise the effect of the scintillation phenomenon caused by the discrete high-frequency materials and the anisotropic highlight and the mixing effect caused by the structured high-frequency materials, and the data structure and the internal memory are organized, the preprocessing data are generated, the Gaussian lobe inquiry calculation is carried out, and the normal distribution function item and the bidirectional reflection distribution function are evaluated and calculated; setting up a rendering system based on a rendering engine kernel of the GPU, and performing parallel computation through the GPU end; the heterogeneous computing framework with serial combination of the CPU ends accelerates the computation of high-frequency materials to realize delay hiding, and achieves real-time frame rate.
The invention can generate the appearance of different high-frequency materials such as flickering and scratches, and is different from the prior method in that the high-precision normal line mapping is required to be additionally defined so as to generate high storage and calculation cost. The method of the invention uses a small-size normal map sample with a fixed size as input, implicitly generates a high-precision normal map from the normal map sample, constructs MIP-map structure mapping four-dimensional position-normal Gaussian, and simultaneously provides a method for quickly inquiring and evaluating and calculating a corresponding normal distribution function in the rendering process based on the MIP-mapped four-dimensional Gaussian lobe and LUT data structure, which reduces the storage cost to a lower level, as shown in fig. 7 (a) to 7 (d).
Example two
The embodiment provides a real-time multi-scale high-frequency material rendering system based on normal map;
a real-time multi-scale high frequency material rendering system based on normal mapping, comprising:
an acquisition module configured to: acquiring a high-frequency material image to be rendered;
A mapping structure determination module configured to: acquiring a normal map of a high-frequency material image to be rendered; determining a target normal map and a mapping structure based on the normal map of the high-frequency material image to be rendered; the mapping structure refers to: mapping relation of blocks between normal line mapping of the high-frequency material image to be rendered and target normal line mapping;
a computing module configured to: acquiring a coloring point footprint; determining a corresponding current level based on the shading point footprint and the mapping structure; screening upper-level Gaussian lobes and lower-level Gaussian lobes corresponding to the current level according to the determined current level; calculating contribution values of the screened upper-level Gaussian lobe and lower-level Gaussian lobe; interpolating the contribution values of the upper layer and the lower layer to obtain a final total contribution value, and further obtaining a direct illumination image without noise of the high-frequency material to be rendered;
a mixing module configured to: mixing the direct illumination image without noise of the high-frequency material to be rendered and the indirect illumination result image after denoising of the non-high-frequency material to obtain a final rendered image.
It should be noted that the above-mentioned obtaining module, mapping structure determining module, calculating module and mixing module correspond to steps S101 to S104 in the first embodiment, and the above-mentioned modules are the same as examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the first embodiment. It should be noted that the modules described above may be implemented as part of a system in a computer system, such as a set of computer-executable instructions.
The foregoing embodiments are directed to various embodiments, and details of one embodiment may be found in the related description of another embodiment.
The proposed system may be implemented in other ways. For example, the system embodiments described above are merely illustrative, such as the division of the modules described above, are merely a logical function division, and may be implemented in other manners, such as multiple modules may be combined or integrated into another system, or some features may be omitted, or not performed.
Example III
The embodiment also provides an electronic device, including: one or more processors, one or more memories, and one or more computer programs; wherein the processor is coupled to the memory, the one or more computer programs being stored in the memory, the processor executing the one or more computer programs stored in the memory when the electronic device is running, to cause the electronic device to perform the method of the first embodiment.
Example IV
The present embodiment also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, perform the method of embodiment one.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. The real-time multi-scale high-frequency material rendering method based on the normal map is characterized by comprising the following steps of:
Acquiring a high-frequency material image to be rendered; the high-frequency materials are divided into discrete high-frequency materials and structured high-frequency materials, wherein the discrete high-frequency materials comprise snowfield, scratches, wiredrawing metals and leather; the structured high frequency material can cause anisotropic highlighting; the high-frequency material image is a rendering result image which shows high-frequency characteristics after materials in a scene are lightened by a strong light source; the intense light source is a pointing light source; the high frequency features include: anisotropic highlights or scratches;
acquiring a normal map of a high-frequency material image to be rendered; determining a target normal map and a mapping structure based on the normal map of the high-frequency material image to be rendered; the mapping structure refers to: mapping relation of blocks between normal line mapping of the high-frequency material image to be rendered and target normal line mapping;
Acquiring a coloring point footprint; determining a corresponding current level based on the shading point footprint and the mapping structure; screening upper-level Gaussian lobes and lower-level Gaussian lobes corresponding to the current level according to the determined current level; calculating contribution values of the screened upper-level Gaussian lobe and lower-level Gaussian lobe; interpolating the contribution values of the upper layer and the lower layer to obtain a final total contribution value, and further obtaining a direct illumination image without noise of the high-frequency material to be rendered; wherein the footprint refers to the queried area in the texture space of the normal map corresponding to the color point;
Mixing the direct illumination image without noise of the high-frequency material to be rendered and the indirect illumination result image after denoising of the non-high-frequency material to obtain a final rendered image.
2. The method for rendering a real-time multi-scale high-frequency material based on a normal map according to claim 1, wherein the target normal map is determined based on the normal map of the high-frequency material image to be rendered; the method specifically comprises the following steps:
(1): dividing a normal map I of a high-frequency material image to be rendered into a plurality of blocks; each block is considered as a set of several four-dimensional gaussian lobes;
(2): randomly extracting a block from a normal map I of a high-frequency material image to be rendered, placing the block in the upper left corner of a target normal map H, and naming the block in the upper left corner of the target normal map as P0;
(3): for the blocks Pi which are already placed on the target normal map, traversing the normal map I of the high-frequency material image to be rendered, and selecting a new block Pj; in the selection process, calculating the overlapping area error of four-dimensional Gaussian lobes contained in the overlapping area of the new block Pj and the block Pi, randomly selecting a block meeting the overlapping area error constraint, and if the block meeting the overlapping area error constraint is not available, selecting the block with the smallest overlapping area error;
(4): calculating the overlapping area of the new block Pj and the block Pi, and finding the path of the minimum joint error between the two blocks;
(5): fixing the new block Pj to the target normal map H, while also being fixed with the path of minimum joint error;
(6): repeating (3) - (5) until the target normal map H is completely filled by the blocks.
3. The method for rendering the real-time multi-scale high-frequency material based on the normal map according to claim 2, wherein the normal map I of the high-frequency material image to be rendered is divided into a plurality of blocks; each block is considered as a set of several four-dimensional gaussian lobes; the method specifically comprises the following steps:
Firstly, gaussian lobes on I are divided into n space grids, then, for each grid, a K-Means clustering method is used for clustering four-dimensional Gaussian lobes in each grid into K new four-dimensional Gaussian lobes, and in the clustering process, the positions and normal information of the lobes are considered at the same time, and the same K value is used for different space grids, so that storage is stable.
4. The method for rendering real-time multi-scale high-frequency material based on normal map according to claim 1, wherein the corresponding current level is determined based on the coloring point footprint and the mapping structure; the method specifically comprises the following steps:
and positioning the hierarchy of the MIP-map according to the footprint size corresponding to the coloring point.
5. The method for rendering real-time multi-scale high-frequency material based on normal map according to claim 1, wherein upper-level Gaussian lobes and lower-level Gaussian lobes corresponding to a current level are screened according to the determined current level; the method specifically comprises the following steps:
and querying Gaussian lobes meeting the condition of the half-vector retrieval range on two adjacent MIP-map levels according to the determined MIP-mapped levels.
6. The method for rendering real-time multi-scale high-frequency material based on normal map according to claim 1, wherein the contribution values of the upper-level Gaussian lobe and the lower-level Gaussian lobe are calculated; the method specifically comprises the following steps:
And calculating the contribution values of the screened upper-level Gaussian lobe and lower-level Gaussian lobe by adopting a normal distribution function term.
7. The method for rendering real-time multi-scale high-frequency material based on normal map according to claim 1, wherein the method is characterized in that a direct illumination image without noise of the high-frequency material to be rendered and an indirect illumination result image after denoising of the non-high-frequency material are mixed to obtain a final rendered image; the method specifically comprises the following steps:
and obtaining a noise-removed image from the indirect illumination result of the noisy non-high frequency material through a denoising algorithm, and then mixing the noise-removed image with the direct illumination result of the non-noise high frequency material to obtain a final rendered image with a global illumination effect.
8. Real-time multiscale high-frequency material rendering system based on normal map, characterized by comprising:
An acquisition module configured to: acquiring a high-frequency material image to be rendered; the high-frequency materials are divided into discrete high-frequency materials and structured high-frequency materials, wherein the discrete high-frequency materials comprise snowfield, scratches, wiredrawing metals and leather; the structured high frequency material can cause anisotropic highlighting; the high-frequency material image is a rendering result image which shows high-frequency characteristics after materials in a scene are lightened by a strong light source; the intense light source is a pointing light source; the high frequency features include: anisotropic highlights or scratches;
A mapping structure determination module configured to: acquiring a normal map of a high-frequency material image to be rendered; determining a target normal map and a mapping structure based on the normal map of the high-frequency material image to be rendered; the mapping structure refers to: mapping relation of blocks between normal line mapping of the high-frequency material image to be rendered and target normal line mapping;
A computing module configured to: acquiring a coloring point footprint; determining a corresponding current level based on the shading point footprint and the mapping structure; screening upper-level Gaussian lobes and lower-level Gaussian lobes corresponding to the current level according to the determined current level; calculating contribution values of the screened upper-level Gaussian lobe and lower-level Gaussian lobe; interpolating the contribution values of the upper layer and the lower layer to obtain a final total contribution value, and further obtaining a direct illumination image without noise of the high-frequency material to be rendered; wherein the footprint refers to the queried area in the texture space of the normal map corresponding to the color point;
a mixing module configured to: mixing the direct illumination image without noise of the high-frequency material to be rendered and the indirect illumination result image after denoising of the non-high-frequency material to obtain a final rendered image.
9. An electronic device, comprising:
A memory for non-transitory storage of computer readable instructions; and
A processor for executing the computer-readable instructions,
Wherein the computer readable instructions, when executed by the processor, perform the method of any of the preceding claims 1-7.
10. A storage medium, characterized by non-transitory storing computer-readable instructions, wherein the instructions of the method of any one of claims 1-7 are performed when the non-transitory computer-readable instructions are executed by a computer.
CN202111400846.0A 2021-11-19 2021-11-19 Real-time multi-scale high-frequency material rendering method and system based on normal map Active CN114092625B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111400846.0A CN114092625B (en) 2021-11-19 2021-11-19 Real-time multi-scale high-frequency material rendering method and system based on normal map

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111400846.0A CN114092625B (en) 2021-11-19 2021-11-19 Real-time multi-scale high-frequency material rendering method and system based on normal map

Publications (2)

Publication Number Publication Date
CN114092625A CN114092625A (en) 2022-02-25
CN114092625B true CN114092625B (en) 2024-05-10

Family

ID=80303731

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111400846.0A Active CN114092625B (en) 2021-11-19 2021-11-19 Real-time multi-scale high-frequency material rendering method and system based on normal map

Country Status (1)

Country Link
CN (1) CN114092625B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117953137B (en) * 2024-03-27 2024-06-14 哈尔滨工业大学(威海) Human body re-illumination method based on dynamic surface reflection field

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105261059A (en) * 2015-09-18 2016-01-20 浙江大学 Rendering method based on indirect reflection highlight calculation in screen space
CN111768473A (en) * 2020-06-28 2020-10-13 完美世界(北京)软件科技发展有限公司 Image rendering method, device and equipment
CN111784816A (en) * 2020-06-28 2020-10-16 山东大学 High-frequency material rendering method and system based on micro-surface theory

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8542231B2 (en) * 2009-06-29 2013-09-24 Crytek Gmbh Method, computer graphics image rendering system and computer-readable data storage medium for computing of indirect illumination in a computer graphics image of a scene
US10964099B2 (en) * 2019-07-01 2021-03-30 Imperial College Innovations Limited Image processing for diffuse-specular separation

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105261059A (en) * 2015-09-18 2016-01-20 浙江大学 Rendering method based on indirect reflection highlight calculation in screen space
CN111768473A (en) * 2020-06-28 2020-10-13 完美世界(北京)软件科技发展有限公司 Image rendering method, device and equipment
CN111784816A (en) * 2020-06-28 2020-10-16 山东大学 High-frequency material rendering method and system based on micro-surface theory

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
A Stationary SVBRDF Material Modeling Method Based on Discrete Microsurface;Junqiu Zhu , Yanning Xu , Lu Wang;《Computer Graphics Forum》;20191031;第38卷(第7期);745-754 *
Real‐Time Microstructure Rendering with MIP‐Mapped Normal Map Samples;Haowen Tan, Junqiu Zhu, Yanning Xu, Xiangxu Meng, Lu Wang , Ling-Qi Yan;《Computer Graphics Forum》;20220228;第41卷(第1期);495-505 *
均匀参与介质的渲染方法研究;王贝贝,樊家辉;《中国图象图形学报》;20210516;第26卷(第5期);961-969 *

Also Published As

Publication number Publication date
CN114092625A (en) 2022-02-25

Similar Documents

Publication Publication Date Title
Li et al. SURE-based optimization for adaptive sampling and reconstruction
US9196021B2 (en) Video enhancement using related content
CN104616345B (en) Octree forest compression based three-dimensional voxel access method
CN111429391B (en) Infrared and visible light image fusion method, fusion system and application
KR20100072729A (en) Apparatus and method for synthesizing time-coherent texture
CN111553858B (en) Image restoration method and system based on generation countermeasure network and application thereof
CN111738265B (en) Semantic segmentation method, system, medium, and electronic device for RGB-D image
BRPI0808277A2 (en) "COMPUTER IMPLEMENTED METHOD FOR PROCESSING SYNTHETIC OPENING RADAR IMAGES (SAR) AND COMPUTER SYSTEM FOR PROCESSING SYNTHETIC OPENING RADAR IMAGES (SAR)
Uchida et al. Noise-robust transparent visualization of large-scale point clouds acquired by laser scanning
JP4413971B2 (en) Image interpolation apparatus, image interpolation method, and image interpolation program
CN114092625B (en) Real-time multi-scale high-frequency material rendering method and system based on normal map
Haq et al. An edge-aware based adaptive multi-feature set extraction for stereo matching of binocular images
CN114494611B (en) Intelligent three-dimensional reconstruction method, device, equipment and medium based on nerve basis function
Parihar et al. Graph theory based approach for image segmentation using wavelet transform
CN110610504A (en) Pencil drawing generation method and device based on skeleton and tone
CN107403465B (en) Urban scene segmentation plane reconstruction method based on structure prior and deep learning
CN116958416A (en) Three-dimensional modeling method, device, system and storage medium
US9514566B2 (en) Image-generated system using beta distribution to provide accurate shadow mapping
Chen et al. Candidate region acquisition optimization algorithm based on multi-granularity data enhancement
Hamzah et al. Disparity map algorithm based on edge preserving filter for stereo video processing
CA3185128A1 (en) Method and apparatus of processing image, computing device, and medium
Hjelmervik Direct pixel-accurate rendering of smooth surfaces
Sangeetha et al. Performance analysis of exemplar based image inpainting algorithms for natural scene image completion
Haindl et al. A compound moving average bidirectional texture function model
CN103295208A (en) Geologic body data visualization oriented feature-preservation quantifying method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant