Paper surface simulation effect generation method based on multi-dimensional noise transformation
By setting an initial background color, generating a mesh texture and multidimensional noise transformation, and combining it with smooth blending processing, a realistic paper surface texture effect is generated. This solves the problem that existing technologies cannot effectively simulate the details of paper surfaces, improves the user's visual experience, and avoids complex high-performance overhead.
Patent Information
- Application Number
- CN202511587772.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-31
- Publication Date
- 2026-02-17
AI Technical Summary
Existing paper surface simulation methods lack deep details, resulting in poor presentation and an inability to effectively simulate the subtle textures and creases of paper.
By setting the initial background color of the simulated paper, a grid texture is generated and blended with the background color. Combining noise values and brightness values of different directions and frequencies, a roughness effect is generated using smooth blending processing, and finally a realistic paper image is output.
It generates realistic paper surface texture effects, enhancing the user's visual experience, while avoiding complex high-performance overhead, and has good real-time rendering performance and adaptability.
Smart Images

Figure CN121544746A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, in particular to a paper surface simulation effect generation method based on multi-dimensional noise transformation. BACKGROUND
[0002] In many digital reading platforms (such as e-books, news websites, online documents), simulating a paper reading experience has become an important direction to improve user reading comfort and enhance immersion. Especially with the popularity of electronic screens, how to simulate the visual and tactile experience of paper on the browser side has become an important topic in user interface design.
[0003] Existing paper surface simulation methods simulate paper by using simple background images, gradients or textures, but lack deeper details such as paper micro-texture, creases, etc., so the rendering effect is poor. SUMMARY
[0004] Therefore, it is necessary to provide a paper surface simulation effect generation method based on multi-dimensional noise transformation, a computer device and a computer readable storage medium to solve the above technical problems.
[0005] In a first aspect, an embodiment of the present application provides a paper surface simulation effect generation method based on multi-dimensional noise transformation, which comprises: setting an initial background color of a simulated paper to obtain a first paper image; generating a grid texture of the simulated paper, and fusing the grid texture with the background color of the first paper image to obtain a second paper image; fusing noise values of each pixel point generated in different directions and frequencies with a set brightness value to obtain a roughness effect; combining the second paper image with the roughness effect using a smoothing fusion process to output a final paper image after rendering.
[0006] In some embodiments, the setting of the initial background color of the simulated paper to obtain the first paper image comprises: calculating the brightness of the RGB color by a weighted average formula to obtain the initial background color.
[0007] In some embodiments, the generating of the grid texture of the simulated paper and the fusing of the grid texture with the background color of the first paper image to obtain the second paper image comprises: setting the color of the grid texture and the position of the grid texture in the first paper image; using a smoothing fusion process to fuse the color and position of the grid texture with the background color of the first paper image to obtain the second paper image.
[0008] In some embodiments, the fusing the noise values of the pixels generated in different directions and frequencies with the set luminance value to obtain the roughness effect comprises: generating initial noise values of the pixels; rotating the initial noise values of the pixels by using a rotation matrix to obtain the noise values of the pixels in different directions; fusing the noise values of the pixels generated in different directions and frequencies and combining the set luminance value to obtain the roughness effect.
[0009] In some embodiments, the generating initial noise values of the pixels comprises: generating initial noise values of the pixels by using a hash function and a smoothing function.
[0010] In some embodiments, the rotating the initial noise values of the pixels by using a rotation matrix to obtain the noise values of the pixels in different directions comprises: constructing a rotation matrix: ; wherein, the rotation matrix is represented by R, and the rotation angle is represented by θ; rotating the initial noise values of the pixels by using the rotation matrix to obtain the noise values of the pixels in different directions.
[0011] In some embodiments, the fusing the noise values of the pixels generated in different directions and frequencies and combining the set luminance value to obtain the roughness effect comprises: calculating the difference between the luminance value of each pixel and the maximum value in each noise value, summing the difference and a threshold value to obtain the roughness of each pixel.
[0012] In some embodiments, the combining the second paper image and the roughness effect by using the smoothing fusion processing and outputting the rendered final paper image comprises: applying the roughness effect to the second paper image by using a preset ratio, and controlling the transition effect of the color by using an exponential decay function to obtain a second background color; limiting the color value of the second background color to be not less than zero by using a comparison function, and adjusting the range of the color value of the second background color to be 【0, 1】 by using a square root operation function, to output the rendered final paper image.
[0013] In a second aspect, an embodiment of the present application provides a computer device, comprising a memory and a processor, the memory stores a computer program, and the processor executes the steps of the first aspect.
[0014] In a third aspect, an embodiment of the present application provides a computer readable storage medium, having stored thereon a computer program, wherein the processor executes the computer program to implement the steps of the first aspect.
[0015] The method, computer device and storage medium described above, by setting the initial background color of the simulated paper, obtaining a first paper image, generating a grid texture of the simulated paper, fusing the grid texture with the background color of the first paper image to obtain a second paper image, fusing noise values of each pixel point generated in different directions and frequencies with the set brightness value to obtain a roughness effect, combining the second paper image with the roughness effect by using a smoothing fusion process, and outputting a final paper image after rendering. The finally generated paper surface texture visually presents realistic details, simulates the concave-convex feeling, fiber feeling and natural light and shadow effect of the paper. The application can efficiently generate the paper surface texture effect, greatly improves the visual experience of the user, and avoids complex image processing and high performance overhead, and has good real-time rendering performance and adaptability. BRIEF DESCRIPTION OF DRAWINGS
[0016] Figure 1 FIG. 1 is a flowchart of a paper surface simulation effect generation method based on multi-dimensional noise transformation in an embodiment; Figure 2 FIG. 2 is a flowchart of generating a second paper image in an embodiment; Figure 3 FIG. 3 is a schematic diagram of obtaining a roughness effect in an embodiment; Figure 4 FIG. 4 is a flowchart of generating a final paper image in an embodiment; Figure 5 FIG. 5 is an effect schematic diagram of a final paper image in an embodiment. DETAILED DESCRIPTION
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are only some examples or embodiments of the present application, and for those skilled in the art, the present application can also be applied to other similar scenarios without creative labor. Unless it is obvious from the language environment or otherwise stated, the same reference numbers in the figures represent the same structure or operation.
[0018] As indicated in this invention and the claims, unless the context clearly indicates otherwise, the words "a," "an," "an," and / or "the" do not specifically refer to the singular and may also include the plural. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of explicitly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.
[0019] While this invention makes various references to certain modules in an apparatus according to embodiments of the invention, any number of different modules can be used and run on a computing device and / or processor. Modules are merely illustrative, and different aspects of the apparatus and methods may use different modules.
[0020] It should be understood that when a unit or module is described as "connected" or "coupled" to other units, modules, or blocks, it may refer to a direct connection or coupling, or communication with other units, modules, or blocks, or the presence of intermediate units, modules, or blocks, unless the context explicitly indicates otherwise. The term "and / or" as used herein may include any and all combinations of one or more of the related listed items.
[0021] Figure 1 A flowchart illustrating the paper surface simulation effect generation method based on multidimensional noise transformation provided in this embodiment of the invention is shown below. Figure 1 As shown, the method includes the following steps: S102, Set the initial background color of the simulated paper to obtain the first paper image; The initial background color is set to a light shade, simulating the base color of paper.
[0022] S104, generate a grid texture simulating paper, and blend the grid texture with the background color of the first paper image to obtain a second paper image.
[0023] To simulate the grid-like texture of paper, the position of the current pixel within the grid is calculated, and a smooth transition process is used to blend the background color with the grid color, thus simulating the structural features of paper.
[0024] S106 fuses the noise values of each pixel generated in different directions and frequencies with the set brightness value to obtain a roughness effect.
[0025] By fusing the noise values of each pixel generated in different directions and frequencies with the set brightness value, a roughness effect simulating the subtle textures and irregularities of a paper surface is generated.
[0026] S108, the second paper image is combined with the roughness effect using smooth blending processing to output the final rendered paper image.
[0027] In this embodiment, a first paper image is obtained by setting an initial background color to simulate paper. A grid texture of simulated paper is generated, and the grid texture is blended with the background color of the first paper image to obtain a second paper image. The noise values of each pixel generated in different directions and frequencies are blended with a set brightness value to obtain a roughness effect. A smooth blending process is used to combine the second paper image with the roughness effect to output the final rendered paper image. The final generated paper surface texture visually presents realistic details, simulating the unevenness, fiber texture, and natural light and shadow effects of paper. This application can efficiently generate paper surface texture effects, greatly improving the user's visual experience, while avoiding complex image processing and high-performance overhead, and has good real-time rendering performance and adaptability.
[0028] In some embodiments, prior to step S102, in order to accurately render each pixel, it is first necessary to calculate the two-dimensional coordinates of the texture. By calculating the ratio of the current pixel's position to the resolution of the rendering area, a standardized UV coordinate system is obtained for subsequent texture processing.
[0029] UV coordinate system calculation formula: Where fragCoord represents the coordinates of the current pixel, iResolution represents the resolution of the canvas, and xy represents the number of pixels horizontally and vertically, respectively.
[0030] This calculation provides the positional proportion of each pixel on the entire canvas, which is used for subsequent texture calculation and generation.
[0031] In some embodiments, setting the initial background color of the simulated paper to obtain the first paper image includes: calculating the brightness of the RGB colors using a weighted average formula to obtain the initial background color.
[0032] The weighted average formula is: Here, backgroundColor represents the background color, and vec3 is a three-dimensional vector representing RGB color values.
[0033] A light shade that approximates white is obtained using a weighted average formula, simulating the initial background color of the paper.
[0034] In some embodiments, such as Figure 2 As shown, generating a simulated paper grid texture and blending the grid texture with the background color of the first paper image to obtain a second paper image includes: S202, Set the color of the grid texture and the position of the grid texture in the first paper image; Mesh texture position calculation formula: The mod operator is used to calculate the position of the coordinates within the period of the mesh texture. 0.1 is used to control the period of the mesh texture, while 0.05 is used to ensure that the center of the mesh texture is aligned.
[0035] S204, using smooth blending processing, the second paper image is obtained by blending the grid texture with the background color of the first paper image according to the color and position of the grid texture.
[0036] Fusion formula: Here, mix() represents a linear interpolation function that performs a smooth transition between the background color and the mesh texture color.
[0037] The `moothstep` function is used to create smooth transitions, ensuring that the boundaries of the mesh texture do not appear too abrupt. 0.0 and 0.05 are the start and end thresholds for blending, respectively.
[0038] In this embodiment, a mesh texture structure is simulated to mimic the microstructure of paper, resulting in a more natural and delicate texture. By using smooth transitions in the mesh texture, the arrangement of tiny particles on the paper surface is simulated, giving the paper simulation a sense of texture without sacrificing depth and complexity. The generation of the mesh texture is based on the periodic calculation of texture coordinates, precisely controlling the distribution and thickness of the mesh texture, further enhancing the realism of the paper.
[0039] In some embodiments, such as Figure 3 As shown, the process of fusing the noise values of each pixel generated in different directions and frequencies with a set brightness value to obtain a roughness effect includes: S302 generates the initial noise value for each pixel.
[0040] The initial noise value of each pixel is generated using a hash function and a smoothing function.
[0041] The generation of hash values ensures the non-periodicity of the noise, avoiding obvious repetitive patterns. A smoothing function is used to generate initial noise values with a smooth transition, avoiding unnatural jumps and ensuring a smoother, more natural noise transition.
[0042] The resulting initial noise values have a natural transition, avoiding hard boundaries and making the texture look more coherent, conforming to the natural variations of surfaces such as paper.
[0043] S304, the initial noise value of each pixel is rotated using a rotation matrix to obtain the noise value of each pixel in different directions.
[0044] Construct the rotation matrix: ; in, Let θ represent the rotation matrix, and θ represent the rotation angle.
[0045] By using a rotation matrix, noise that was originally in a single direction can be rotated to an arbitrary angle, thereby simulating the fiber orientation of paper and enhancing the naturalness of the paper surface. The implementation of this rotation matrix is based on coordinate transformation in two-dimensional space. By adjusting the rotation angle θ, the distribution and direction of noise can be flexibly controlled, greatly increasing the complexity of texture simulation.
[0046] The initial noise values of each pixel are rotated using the rotation matrix to obtain noise values of each pixel in different directions.
[0047] In this embodiment, rotation is used to change the direction of the noise, thereby achieving multi-directional noise fusion and simulating the irregular and randomly changing texture structure of the paper surface. This embodiment employs a multi-dimensional noise algorithm, which transforms the noise in different dimensions, ensuring that the noise information of each pixel undergoes multi-directional transformation. This results in richer and more natural details on the final rendered paper surface, avoiding the texture repetition and monotony commonly found in traditional methods.
[0048] S306, the noise values of each pixel generated in different directions and frequencies are fused together and combined with the set brightness value to obtain a roughness effect.
[0049] Brightness calculation formula: The brightness of RGB colors is calculated by weighted averaging, which conforms to the human eye's perception of color brightness. The constants 0.299, 0.587, and 0.114 are chosen based on the human eye's sensitivity to red, green, and blue.
[0050] The calculation of brightness ensures that the visual effect of the noise generation result is more natural and consistent with the visual perception of real paper.
[0051] Calculate the difference between the brightness value of each pixel and the maximum value among all noise values, and sum the difference with a threshold to obtain the roughness of each pixel.
[0052] Taking three noise values (noise1, noise2, and noise3) with different directions and frequencies as an example, the roughness calculation formula is as follows: The details of paper surface texture are simulated by calculating the difference between the maximum values of brightness and noise in different directions. The greater the difference in maximum noise values, the stronger the roughness of the surface texture.
[0053] Roughness calculations simulate subtle irregularities on paper using multi-directional noise, increasing the complexity and naturalness of the texture.
[0054] This embodiment generates a more complex paper surface texture effect by superimposing multiple weighted noises and combining noises of different frequencies. Each layer of noise not only enriches the texture but also simulates the fine structure of paper, such as graininess and roughness, through noise at different frequencies. The noise frequency control and fusion process uses a dynamic weighting mechanism to simulate various natural changes on the paper surface, such as wrinkles, fine textures, and different roughnesses, avoiding the limitations of single textures in traditional methods.
[0055] During the rendering process, the brightness of the paper surface was dynamically adjusted to achieve a natural variation in the final effect. By combining multiple noise fusion and rotation operations with real-time calculations of brightness, texture, and roughness, the subtle differences and microscopic irregularities of paper under different lighting conditions were successfully simulated. The final paper surface not only exhibits a random, delicate texture effect, but also ensures a natural and layered effect by adjusting the interaction between roughness and lighting.
[0056] In some embodiments, such as Figure 4 As shown, the step of combining the second paper image with the roughness effect using smooth blending processing to output the rendered final paper image includes: S402, apply the roughness effect to the second paper image using a preset ratio, and control the color transition effect using an exponential decay function to obtain the second background color.
[0057] The fusion formula is: The exp() exponential decay function controls the color transition effect, making it more natural and avoiding overly bright or abrupt effects.
[0058] The mix function applies a roughness effect to the background color according to a preset ratio (0.85), further enhancing the detail of the paper surface.
[0059] S404 uses a comparison function to restrict the color value of the second background color to be no less than zero, and uses a square root operation function to adjust the range of the color value of the second background color to [0,1], so as to output the final rendered paper image.
[0060] Final paper image as followsFigure 5 As shown, the final color output formula is: The sqrt() square root function is used to adjust color values to make them softer and avoid exceeding the range of [0, 1].
[0061] The max() comparison function ensures that the color value will not be less than zero, thus preventing negative values from being generated during rendering.
[0062] In this embodiment, multi-directional noise and rotation transformation techniques were used to successfully simulate the details of the paper surface. Smooth transitions and color processing ensured a natural and realistic visual effect. This rendering method not only creates a highly realistic paper surface effect visually, but also ensures efficient execution through reasonable formulas and code implementation, enabling real-time rendering in the browser.
[0063] In one embodiment, the present invention provides a computer device including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the steps in any of the above embodiments of the paper surface simulation effect generation method based on multidimensional noise transformation.
[0064] In one embodiment, the present invention provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps in any of the above embodiments of the paper surface simulation effect generation method based on multidimensional noise transformation.
[0065] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0066] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0067] The above embodiments merely illustrate several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for generating simulated paper surface effects based on multidimensional noise transformation, characterized in that, The method includes: Set the initial background color of the simulated paper to obtain the first paper image; A simulated paper grid texture is generated, and the grid texture is blended with the background color of the first paper image to obtain a second paper image; The noise values of each pixel generated in different directions and frequencies are fused with the set brightness value to obtain a roughness effect; The second paper image is combined with the roughness effect using a smooth blending process to output the final rendered paper image.
2. The method according to claim 1, characterized in that, The process of setting the initial background color of the simulated paper to obtain the first paper image includes: The initial background color is obtained by calculating the brightness of RGB colors using a weighted average formula.
3. The method according to claim 1, characterized in that, The process of generating a simulated paper grid texture and blending the grid texture with the background color of the first paper image to obtain a second paper image includes: Set the color of the grid texture and the position of the grid texture in the first paper image; Using a smooth blending process, the second paper image is obtained by blending the grid texture with the background color of the first paper image based on the color and position of the grid texture.
4. The method according to claim 1, characterized in that, The process of fusing the noise values of each pixel generated in different directions and frequencies with a set brightness value to obtain a roughness effect includes: Generate the initial noise value for each pixel; The initial noise values of each pixel are rotated using a rotation matrix to obtain the noise values of each pixel in different directions; The noise values of each pixel generated in different directions and frequencies are fused together and combined with a set brightness value to obtain a roughness effect.
5. The method according to claim 4, characterized in that, The initial noise values for each pixel include: The initial noise value of each pixel is generated using a hash function and a smoothing function.
6. The method according to claim 4, characterized in that, The step of rotating the initial noise value of each pixel using a rotation matrix to obtain the noise value of each pixel in different directions includes: Construct the rotation matrix: ; in, This represents the rotation matrix, where θ represents the rotation angle. The initial noise values of each pixel are rotated using the rotation matrix to obtain noise values of each pixel in different directions.
7. The method according to claim 4, characterized in that, The process of fusing the noise values of each pixel generated from different directions and frequencies and combining them with a set brightness value to obtain a roughness effect includes: Calculate the difference between the brightness value of each pixel and the maximum value among all noise values, and sum the difference with a threshold to obtain the roughness of each pixel.
8. The method according to claim 1, characterized in that, The step of combining the second paper image with the roughness effect using smooth blending processing to output the rendered final paper image includes: The roughness effect is applied to the second paper image using a preset ratio, and the color transition effect is controlled using an exponential decay function to obtain the second background color; A comparison function is used to restrict the color value of the second background color to be no less than zero, and a square root operation function is used to adjust the range of the color value of the second background color to [0,1], so as to output the final rendered paper image.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.