Scene special effect processing method and device, electronic equipment and storage medium
By acquiring and processing scene data from the game scene, including special effects masking maps and noise maps, the gradient and flow control of the game scene were realized, solving the problems of high limitations in game scene adjustment and poor interactivity, and improving the realism and visual effects of the game scene.
Patent Information
- Application Number
- CN202311696530.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-11
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2043-12-11
AI Technical Summary
The limitations of game scene adjustments and poor interactivity make it difficult for existing technologies to achieve customized stylization and dynamic interaction when processing game scene effects.
By acquiring scene model and texture data from the scene data, including effect mask textures and noise textures, gradient processing is performed using color control information, flow control is performed using noise control parameters, and the scene model is rendered by vertex displacement. The rendering is then performed by combining gradient color textures and flow noise textures.
It improves the controllability and interactivity of game scenes, reduces adjustment limitations, and makes game scenes more realistic and visually richer.
Smart Images

Figure CN117618893B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a scene effects processing method, a scene effects processing device, an electronic device, and a computer-readable storage medium. Background Technology
[0002] In games, enhancing the realism of game scenes can provide players with a better visual experience. For example, real-world polar scenes (such as the aurora borealis and starry skies) can be incorporated into the game. However, in the process of processing scene effects, because the effects of game scenes can be customized and stylized, overall modifications and adjustments are often required during the processing. Furthermore, the rendering process often presents the scene statically, resulting in poor interactivity within the game. Summary of the Invention
[0003] This invention provides a method, apparatus, electronic device, and computer-readable storage medium for processing scene special effects, in order to solve or partially solve the problems of high limitations in adjusting game scenes and poor game interactivity.
[0004] This invention discloses a method for processing scene special effects, including: Acquire scene data corresponding to the game scene, wherein the scene data includes at least a scene model and texture data, and the texture data includes at least an effect mask texture and a noise texture. Obtain color control information for adjusting gradient colors, and perform gradient processing based on the color control information and the texture coordinates of the scene model to obtain a gradient color texture corresponding to the scene model; Obtain noise control parameters for the noise map, and perform flow control on the noise map according to the noise control parameters to obtain a flow noise map corresponding to the noise map; Vertex displacement is performed based on the noise map to obtain offset information corresponding to the scene model; The scene model is rendered and output based on the gradient color map, the flow noise map, and the offset information.
[0005] This invention also discloses a scene special effects processing device, comprising: The data acquisition module is used to acquire scene data corresponding to the game scene. The scene data includes at least a scene model and texture data. The texture data includes at least an effect mask texture and a noise texture. The gradient adjustment module is used to acquire color control information for adjusting gradient colors, and to perform gradient processing based on the color control information and the texture coordinates of the scene model to obtain a gradient color texture corresponding to the scene model. A flow control module is used to acquire noise control parameters for the noise map, and to perform flow control on the noise map according to the noise control parameters to obtain a flow noise map corresponding to the noise map. The offset control module is used to perform vertex displacement based on the noise map to obtain offset information corresponding to the scene model. The rendering module is used to render and output the scene model based on the gradient color map, the flow noise map, and the offset information.
[0006] This invention also discloses an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; The memory is used to store computer programs; When the processor executes a program stored in the memory, it implements the method described in the embodiments of the present invention.
[0007] This invention also discloses a computer-readable storage medium storing instructions that, when executed by one or more processors, cause the processors to perform the methods described in this invention.
[0008] The embodiments of the present invention have the following advantages: In this embodiment of the invention, for a game scene, scene data corresponding to the game scene is acquired. The scene data includes at least a scene model and texture data. The texture data includes at least an effect mask texture and a noise texture. Then, color control information for adjusting gradient colors is acquired, and gradient processing is performed based on the color control information and the texture coordinates of the scene model to obtain a gradient color texture corresponding to the scene model. Noise control parameters for the noise texture are also acquired, and flow control is performed on the noise texture based on the noise control parameters to obtain a flow noise texture corresponding to the noise texture. Vertex displacement is performed based on the noise texture to obtain offset information corresponding to the scene model. Then, the scene model is rendered and output based on the gradient color texture, the flow noise texture, and the offset information. This achieves gradient and flow control of the game scene, making the game scene more realistic and visually richer. On the other hand, through the corresponding parameter control process, the controllability of game scene adjustment is effectively improved, and the limitations of game scene adjustment are reduced. Attached Figure Description
[0009] Figure 1 This is a flowchart of the steps of a scene special effects processing method provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the texture data provided in the embodiments of the present invention; Figure 3 This is a schematic diagram of the texture data provided in the embodiments of the present invention; Figure 4 This is a schematic diagram of the scene model provided in the embodiments of the present invention; Figure 5 This is a schematic diagram of the scene model provided in the embodiments of the present invention; Figure 6 This is a schematic diagram of the effect of the aurora game scene provided in the embodiment of the present invention; Figure 7 This is a structural block diagram of a scene special effects processing device provided in an embodiment of the present invention; Figure 8 This is a block diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0010] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0011] To enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, some technical features involved in the embodiments of the present invention are explained and described below: UV mapping: UV mapping is the process of mapping the surface of a 3D model onto a 2D plane and placing texture patterns on the 2D plane. When the origin is at the bottom left corner of the screen, the letter "U" indicates that the X-axis of the 2D texture is pointing to the right, and "V" indicates that the Y-axis of the texture is pointing upwards, because "X", "Y" and "Z" are already used to represent the axes of 3D objects in model space.
[0012] Shader: A shader is a piece of code used on the GPU to control the rendering pipeline, thereby enabling the rendering, lighting, and texturing of 3D models. The function of a shader is to convert input graphics data into pixels displayed on the screen.
[0013] Mesh Model: A mesh model is a commonly used method for representing 3D models in computer graphics. It consists of many small triangles, each with three vertices, forming a mesh-like model. Mesh models can represent objects of various shapes, such as characters, buildings, and cars, and are one of the most frequently used methods for representing 3D models in computer graphics.
[0014] Raymarching: Raymarching is a rendering algorithm based on ray casting, used in various fields such as real-time rendering, 3D modeling and visualization, visual effects and special effects, and virtual reality. It achieves high-quality rendering and simulation of scenes and objects through ray casting, providing more realistic, lifelike, and artistic image effects.
[0015] As an example, the aurora material can be used to depict the spectacular nighttime scenes in game environments. In the production process, the aurora material is typically embedded within a sky sphere or generated within screen space. However, during project development, it's necessary to customize the aurora effect's stylistic aspects, such as its position, shape, and the degree of variation. Using the methods described above, the adjustable parameters generally require a complete modification of the aurora material, increasing the limitations of its adjustment capabilities.
[0016] In addition, there are other related processing methods: 2D Texture Mapping: Simply apply a pre-made 2D aurora image to the skybox. Disadvantages: Not dynamic; it cannot change based on the game environment or player interaction.
[0017] Particle systems: These use thousands of tiny particles to simulate the flowing effect of the aurora borealis. Disadvantages: High performance and cost, especially in large-scale scenes where a greater number of particles are required.
[0018] Shader program (using HLSL): Creates a custom shader to simulate the aurora effect. Disadvantages: The shape and volume of the aurora are achieved using shaders, requiring more complex mathematical models and algorithms, as well as more GPU resources.
[0019] Screen-space post-processing: Adds aurora effects at the final stage of the rendering process. Disadvantage: May cause unexpected interactions with other light sources or objects in the scene.
[0020] Raymarching: Raymarching calculates the aurora shape by combining multiple translations and superpositions of a noise function. Disadvantages: This method is relatively computationally intensive, and its application in high-resolution and complex scenes is computationally expensive. It may not be suitable for all platforms, especially low-performance mobile devices.
[0021] In this embodiment of the invention, for a game scene, scene data corresponding to the game scene is acquired. The scene data includes at least a scene model and texture data, and the texture data includes at least an effect mask texture and a noise texture. Then, color control information for adjusting gradient colors is acquired, and gradient processing is performed based on the color control information and the texture coordinates of the scene model to obtain a gradient color texture corresponding to the scene model. Noise control parameters for the noise texture are also acquired, and flow control is performed on the noise texture based on the noise control parameters to obtain a flow noise texture corresponding to the noise texture. Vertex displacement is performed based on the noise texture to obtain offset information corresponding to the scene model. Finally, the scene model is rendered and output based on the gradient color texture, the flow noise texture, and the offset information. This achieves gradient and flow control of the game scene, making the game scene more realistic and visually richer. On the other hand, the controllability of game scene adjustment is effectively improved and the limitations of game scene adjustment are reduced through the corresponding parameter control process.
[0022] Reference Figure 1 The diagram illustrates a flowchart of a scene effects processing method provided in an embodiment of the present invention, which may specifically include the following steps: Step 101: Obtain scene data corresponding to the game scene. The scene data includes at least a scene model and texture data. The texture data includes at least an effect mask texture and a noise texture. When rendering game scenes, corresponding scene data can be obtained. This scene data can include scene models and texture data. The scene model can be a 3D model corresponding to the aurora in the game scene, and the texture data can be texture maps corresponding to special effects in the game scene, mask maps representing corresponding image effects, etc. Among them, the special effect mask map can be a TGA (Truevision Graphics Adapter) format texture with a specified filter added and used to draw blurred edges with vertically varying lines, and the noise map can be a texture used to simulate random noise effects.
[0023] The game scene can be an aurora, starry sky, river, or sky, etc., and it can undergo corresponding dynamic changes in the game. For example, in an aurora game scene, it can present a flowing and changing process over time. Optionally, in this embodiment of the invention, an aurora game scene is used as an example for illustrative purposes. By constructing an aurora model and texture data corresponding to the aurora game scene, the aurora game scene is rendered and output. It is understood that this invention can also be applied to other game scenes, and it is not limited thereto.
[0024] In some feasible implementations, for game scenes, during game development, artists can draw scene models corresponding to the game scene and adjust textures needed for materials. Specifically, in response to texture drawing operations for the game scene, black is filled into a preset canvas, and the target graphic is displayed according to the texture drawing operation. Then, in response to filter addition operations for the target graphic, the target filter corresponding to the filter addition operation is added to the target graphic to obtain an effect mask texture corresponding to the game scene. At the same time, noise maps of the R channel, G channel, and B channel are obtained separately, and the noise maps of the R channel, G channel, and B channel are composited to obtain a noise map corresponding to the game scene. In response to model drawing operations for the game scene, a scene model corresponding to the game scene is obtained. Thus, by drawing the shape of the scene model, custom adjustments to the unilateral aurora can be made, reducing the limitations of aurora material adjustments. Optionally, in the process of creating a special effects mask texture, in order to increase the information of vertical variation, in response to the image processing operation on the special effects mask texture, Gaussian blur and multiply blending can be added to the special effects mask texture according to the image processing operation to obtain the image-processed special effects mask texture. In this way, by adding image processing processes such as Gaussian blur and multiply blending, the edge blur of the special effects mask texture can be improved, the vertical variation information can be added to it, and thus the image quality can be improved.
[0025] In the process of drawing scene models, the model shape corresponding to the game scene can be determined by responding to the model drawing operation for the game scene. Then, the model shape is converted into a polygon to obtain a set of model patches with curvature. Finally, the model patches are folded and reused according to the texture coordinates corresponding to the model patches to obtain the scene model corresponding to the game scene.
[0026] It should be noted that the target graphic can be the shape used to draw the special effects mask texture. In one example, assuming the game scene is an aurora game scene, the corresponding scene model can be an aurora model. When creating the texture data for the aurora model, an ellipse can be drawn using a soft-edged brush in DCC (Digital Content Creation) software, and an appropriate filter style (such as a wind filter) can be selected to obtain a special effects mask texture with filaments at the top (e.g., Figure 2 (As shown). Further image processing can be performed on this special effect mask texture, such as adding Gaussian blur, multiply blending mode, etc., to create a TGA texture with blurred edges and vertically varying lines (e.g., Figure 3 As shown in the image, this is the special effects mask texture.
[0027] In addition, for noise maps, a blank image of a specified size, such as 512x512 pixels, can be created. Then, random grayscale values are generated for the red, green, and blue channels of each pixel, ranging from 0 to 255. A suitable random number generation algorithm, such as Perlin noise or Simplex noise, can be used. The values of the red, green, and blue channels are then set to the generated random grayscale values. Finally, the values of the red, green, and blue channels are assigned to the corresponding red, green, and blue channels of the corresponding pixels to obtain the noise map.
[0028] Similarly, for creating aurora models, the corresponding graphics can be created using DCC software. The shape of the aurora can then be drawn by bending and using the spline tool (e.g., ...). Figure 4 (as shown), and convert the drawn graphic into an editable polygon, resulting in a set of model patches with curvature (such as... Figure 5 As shown in the figure, the model can then be folded and reused based on the UV coordinates corresponding to the model facet, so that an aurora can cycle through two textures, thereby improving the aurora accuracy and texture utilization.
[0029] Step 102: Obtain color control information for adjusting gradient colors, and perform gradient processing based on the color control information and the texture coordinates of the scene model to obtain a gradient color texture corresponding to the scene model; Once the corresponding texture data is obtained, the material information can be processed accordingly, including base color, aurora flow, vertex displacement, and edge hardness. Base color can be used to adjust the color of the scene model; aurora flow can add corresponding flow to the scene model, allowing it to change dynamically in the game; vertex displacement also adds corresponding changes to the scene model, allowing it to swing and change in the game; edge hardness can remove unnatural hard edges from the scene model, making the final rendered blending effect more natural and smooth.
[0030] For the adjustment of the base color, after obtaining the color control information used to adjust the gradient color, the gradient can be processed according to the color control information and the texture coordinates of the scene model to obtain the corresponding gradient color map. This gradient color map can bring a good color gradient effect to the scene model and improve the realism of the game scene.
[0031] In some feasible implementations, color control information, at least color information and highlight parameters, is used to perform gradient processing with the color information and the texture coordinates of the scene model to obtain a gradient color corresponding to the scene model. Then, the highlight parameters and gradient color are used to calculate the pixel points corresponding to the scene model to obtain a gradient color texture corresponding to the scene model.
[0032] The color control information includes gradient range control parameters, texture coordinates including target coordinates in the target direction, color information including at least first-direction effect colors and second-direction effect colors, and highlight parameters including at least center point coordinates, circle radius, and target position for controlling the mask image. The adjustment process for the basic color can be specifically as follows: interpolation is performed using gradient range control parameters, target coordinates, first-direction effect colors, and second-direction effect colors to obtain the gradient color corresponding to the scene model, and the gradient color is assigned to the target position. Then, the texture is calculated with the center point coordinates as the center and the circle radius to obtain the gradient color texture corresponding to the scene model.
[0033] It should be noted that the gradient range control parameter can be used to control the gradient range. For the target coordinates, it can be either the U coordinate or the V coordinate, i.e., coordinates along the X-axis or Y-axis. A linear gradient is applied in one direction, causing the gradient image to show a gradient in that direction. Furthermore, the first and second orientations can be opposite or opposite orientations. For example, if the first orientation effect color is the top effect color of the scene model, then the second orientation effect color can be the bottom effect color; if the first orientation effect color is the left effect color of the scene model, then the second orientation effect color can be the right effect color, and so on. These can be set according to the actual needs of the game scene. For example, they can be assigned values corresponding to green and adjusted according to the orientation. The center point coordinates and the circle radius can be used for positioning, determining the size and location of the highlighted area of the scene model.
[0034] In one example, a gradient map can be generated based on the V coordinate of the UV coordinates in the scene model, and the gradient map can be used as the Alpha value for linear interpolation calculation to generate a gradient effect with controllable upper and lower colors. The calculation formula is as follows.
[0035]
[0036] Where C1 can be the color of the first-position special effect, C2 can be the color of the second-position special effect, p is the parameter that controls the gradient range, V represents the linear gradient map constructed based on the V coordinate, and F(x) is the final controllable gradient color.
[0037] After obtaining the gradient colors, the aurora highlight effect can be implemented. First, based on the given center and radius on the UV map, the distance from each pixel (a pixel can be understood as a colored pixel area (excluding black)) to the center is calculated, generating a circular texture that gradients outward from the center. Specifically, by compressing the V direction of the UV and shifting the center position in the -V direction, an elliptical gradient texture located at the bottom of the aurora is obtained. The calculation formula is as follows:
[0038] Where b represents the coordinates of the center point, R is the radius of the circle, and p is the coordinates of the current pixel in UV space (after transformation). Using the above formula, the UV values corresponding to the gradient color are assigned to a, and a float2 value is assigned as needed to b as the coordinates of the center point. A circle with b as the center and radius R is mapped in p to obtain the corresponding center point coordinates. After obtaining the center point coordinates, the distance between the mask position and the center point can be further calculated using the distance function, as follows:
[0039] Finally, an if function can be used to determine whether to fill areas larger than radius R with black and areas smaller than or equal to radius R with white, thus obtaining a circular mask texture with gradient edges, i.e., a gradient color texture. By calculating the gradient color texture corresponding to the scene model in real time, resource saving can be effectively improved and memory pressure reduced. At the same time, using mathematical operations to generate the corresponding texture reduces the requirements of the game scene for image resolution and reduces the probability of game scene distortion.
[0040] Step 103: Obtain noise control parameters for the noise map, and perform flow control on the noise map according to the noise control parameters to obtain a flow noise map corresponding to the noise map; For the processing of game scene flow, noise control parameters can be obtained for noise control of noise maps. Then, flow control can be applied to the noise map based on the noise control parameters to obtain the corresponding flowing noise map. The noise control parameters include at least scaling parameters, flow speed, and noise magnitude control parameters. The scaling parameters can be used to control scaling, the flow speed can be the flow speed of the scene model in the game, and the noise magnitude control parameters can be used to control changes in the size or range of the noise map in space.
[0041] In some feasible implementations, a first noise map can be selected from any channel of the noise map, and a second noise map can be selected from a different channel of the first noise map. Then, the texture coordinates of the first noise map are scaled several times using scaling parameters with the center point of the first noise map as the axis to obtain the corresponding first texture coordinates. Then, the first texture coordinates are processed by using noise level control parameters and flow speed to obtain several first flow noise maps with different flow behaviors corresponding to the first noise map. Similarly, the texture coordinates of the second noise map are scaled several times using scaling parameters with the center point of the second noise map to obtain the corresponding second texture coordinates. The second texture coordinates are then processed by using noise level control parameters and flow speed to obtain several second flow noise maps with different flow behaviors corresponding to the second noise map.
[0042] It should be noted that in the above-mentioned process of processing flow noise maps, in order to make the flow performance of the scene model change over time, a time parameter can be introduced during the flow process. For example, for the first noise map, noise magnitude control parameters, flow speed, and target time can be used to process the flow of the first texture coordinates to obtain several first flow noise maps with different flow performances corresponding to the first noise map; for the second noise map, noise magnitude control parameters, flow speed, and target time can be used to process the flow of the second texture coordinates to obtain several second flow noise maps with different flow performances corresponding to the second noise map. Thus, by introducing a time parameter, the scene model in the game scene can dynamically change with time, improving the interactivity of the scene model in the game.
[0043] The target time can be one of the following, depending on the different stages of game processing: game scene time during game operation (i.e., time in the game), first real-time during game operation (real time when the game is running, which may be the same as or different from the game scene time), second real-time during game development (i.e., real time when the game scene is being created), etc. This invention does not limit it.
[0044] The first and second noise maps can be noise maps with different channels. For example, assuming the first noise map is an R-channel noise map, the second noise map can be a G-channel or B-channel noise map, etc. Furthermore, by processing the noise maps according to flow speed and game time, the flow noise map can dynamically change according to the corresponding flow speed over time. This allows the scene models in the game scene to change dynamically, improving the interactivity of the scene models in the game.
[0045] It should be noted that the first flow noise map can be a noise map that produces flow changes at the top or bottom of the scene model, and correspondingly, the second flow noise map can be a noise map that produces flow changes at the bottom or top of the scene model. The two can be flow noise maps with opposite processing content.
[0046] In one example, after generating the corresponding noise map using DCC software, you can select any channel of the noise map, such as the R channel. Then, using the center point of the noise map as the axis, you can perform four scaling operations of different sizes. The specific calculation formula can be:
[0047] Here, Z is the parameter controlling the scaling, UV represents the texture coordinates of the texture map, and the obtained f(x) is a float2 value, which is the scaled UV. Using this UV value to sample the noise map can achieve scaling of different sizes with the center point as the axis (i.e., generating four noise maps of different sizes).
[0048] Next, the `Panner` function can be used (which takes a UV coordinate and a velocity parameter, re-outputs a new UV coordinate, and resamples the texture with the new coordinate to produce a movement or scrolling effect). As game time progresses, the U-direction of the UVs on the same noise map is shifted four times, while the V-direction sampling remains unchanged. The results are then summed to generate a more fluid and dynamic noise map. Using the game scene's mask image and the flow noise map for calculations (explained in detail in the edge hardness section), a constantly changing flow effect along the X-axis can be produced. The principle of the noise map's flow is represented by the formula below. After four superpositions, the final noise result is obtained, as shown in the calculation formula below:
[0049] Where D is the parameter that controls the change in the size of the noise map, S is the flow speed, and x is the game time. By assigning different values to the four calculations, four maps with different flow effects can be obtained.
[0050] To increase variation and blur the edges, another noise map with a different texture representation is selected from the G channel storage. Using the same calculation principle as the above process, a noise map that produces secondary changes to the bottom is generated. Thus, the flowing noise map can add corresponding dynamic changes to the scene model, making the game scene more interactive and improving the player's gaming experience.
[0051] Step 104: Perform vertex displacement based on the noise map to obtain offset information corresponding to the scene model; In addition to flowing changes, scene models in the game can also have swaying changes. Vertex displacement can be performed based on noise maps to obtain offset information corresponding to the scene model. This offset information can then be used to offset the scene model, thereby achieving the effect of the scene model swaying over time.
[0052] The noise control parameters include noise intensity control parameters. The R channel can be selected from the noise map as the displacement control parameter. Then, the noise intensity control parameter and the displacement control parameter are used to calculate the offset in the X-axis and Z-axis directions respectively, obtaining the first vertex offset information in the X-axis direction and the second vertex offset information in the Z-axis direction of the scene model. Next, the Y-axis vertex of the scene model is obtained, and the offset in the Y-axis direction is calculated using the Y-axis vertex and the noise intensity control parameter, obtaining the third vertex offset information in the Y-axis direction of the scene model. This allows the scene model to be controlled to swing in different directions from different directions during rendering, further improving the interactivity of the game scene and enhancing the player's gaming experience.
[0053] In one example, offsets can be generated from the X, Y, and Z directions. Similarly, the method of superimposing noise maps with trigonometric functions is used to offset the vertices of the model based on world space, thereby achieving the effect of the aurora swaying and changing over time.
[0054] For vertex offsets along the X-axis, the scene model's own coordinates (x-axis, y-axis, z-axis) are transformed into UV coordinates using scene space. The aforementioned Panner operation is then performed, and the result is reassigned to the noise map as texture coordinates. Below is the formula for calculating one vertex offset along the X-axis. Assuming the R channel of the noise map's RGB channel is taken as parameter A (displacement control parameter), and B is the parameter controlling the intensity change of the noise map, the offset results are finally superimposed.
[0055]
[0056]
[0057] The vertex offset in the Y direction is calculated using the following formula:
[0058] The Z-axis is calculated using the same principle as the X-axis. By using different calculation methods for the Y-axis, we can add variations in oscillation and improve the realism of the scene model.
[0059] Step 105: Render the scene model according to the gradient color map, the flow noise map, and the offset information.
[0060] Once the corresponding gradient color map, flow noise map, and offset information are obtained, the gradient color map can be used to present the color gradient process of the scene model, and the flow noise map and offset information can be used to control the dynamic process of the scene model. The scene model can then be rendered and output based on the gradient color map, flow noise map, and offset information. This achieves gradient and flow control of the game scene, making the game scene more realistic and visually richer. On the other hand, by controlling the process with corresponding parameters, the controllability of game scene adjustment is effectively improved, and the limitations of game scene adjustment are reduced.
[0061] In some feasible implementations, after processing the materials accordingly, the scene model can be rendered based on the processing results. The scene model is rendered according to gradient color maps and flow noise maps, while edge hardness is processed according to special effect mask maps and gradient color maps. The scene model is controlled to flow according to offset information as the game progresses. This achieves gradient, flow, and edge control of the game scene, making the game scene more realistic and visually richer. It can also change flow as the game progresses, improving the interactivity of the game scene. On the other hand, by controlling the process with corresponding parameters, the controllability of game scene adjustment is effectively improved, and the limitations of game scene adjustment are reduced.
[0062] During the rendering process, edge hardness processing can be applied to the scene model to reduce unnatural hard edges and improve the naturalness of the scene model. Specifically, special effects mask textures can be used as transparency values, and interpolation calculations can be performed on a preset threshold and a flow noise texture using these transparency values. The reduction in edge hardness of the scene model can be controlled based on the calculation results. Additionally, interpolation calculations can be performed on a transparency value and a gradient color texture, and the transparency of the scene model can be controlled based on the calculation results. Optionally, the preset threshold can be 0, etc., and this invention does not impose any limitations on this.
[0063] In addition, while calculating the transparency of the scene model, the gradient control parameters for the gradient color map can be obtained. Then, the world position of the scene model is obtained, and the first rate of change in the X-axis direction and the second rate of change in the Y-axis direction corresponding to the world position are calculated. The first rate of change and the second rate of change are used to characterize the change value at the pixel position. Then, the first rate of change and the second rate of change are cross-producted to obtain the normal direction. The normal direction is then normalized to obtain the unit normal direction. Then, Fresnel calculation is used to calculate the edge gradient of the unit normal direction, so that the normal changes between the viewing direction and the unit normal direction, thereby controlling the gradient fading of the scene model.
[0064] In one example, the effect mask texture is first used as the alpha value (transparency value). This is then interpolated using 0 and the noise map containing the flow effect obtained earlier. Next, the effect mask texture is multiplied by the gradient map obtained from the V coordinates of the UV coordinates of the (linear gradient map), and interpolation is performed again to remove unnatural hard edges. Specifically, first, the alpha values of each pixel in the effect mask texture and the flow noise map are interpolated to obtain the interpolated alpha value of the flow noise map. Second, the effect mask texture is multiplied by the linear gradient map to obtain the alpha value after the linear gradient. Third, for each pixel, the interpolated alpha value of the flow noise map is interpolated with the alpha value of the linear gradient to obtain the final alpha value. The formula `final_alpha = (1 - noise_alpha) * aurora_alpha + noise_alpha * linear_gradient_alpha` can be used, where `final_alpha` is the final alpha value, `aurora_alpha` is the alpha value of the effect mask map, `noise_alpha` is the interpolated alpha value of the flow noise map, and `linear_gradient_alpha` is the alpha value of the linear gradient map. Finally, the calculated final alpha value is combined with the RGB values of the image to generate the final blended image. The formula `final_color = final_alpha * aurora_color + (1 - final_alpha) * linear_gradient_color` can also be used, where `final_color` is the final composite color, `aurora_color` is the RGB value of the effect mask map, and `linear_gradient_color` is the RGB value of the linear gradient map. Through corresponding interpolation calculations and blending operations, dynamic blending of the effect mask map, the noise map with flow effects, and the linear gradient map can be achieved, removing unnatural hard edges and making the blended result more natural and smooth. The specific implementation may vary depending on the application scenario and the image processing tools used, and adjustments and optimizations are required based on the specific circumstances.
[0065] Simultaneously, when calculating the semi-transparent result, a gradient fading effect is added, based on the same principle as calculating the color mask. A gradient... Figure 3 Angle functions control the cyclical nature of edge gradients. Simultaneously, by applying DDX and DDY (functions used to calculate the rate of change (gradient) of variables in the pixel shader along the screen's x and y directions) to the world position, the results are cross-productd and then normalized to calculate the normal direction. The normal calculation formula is as follows:
[0066]
[0067] in, The unit normal direction is N, and the result is then subjected to Fresnel calculation. When the normal is perpendicular to the camera during the scene model's swing, there is an edge gradient effect to ensure that no hard edges are generated at the bend.
[0068] In one example, refer to Figure 6 This diagram illustrates the effect of an aurora scene provided in an embodiment of the present invention. Through the above process of the embodiment of the present invention, the aurora scene in the game ( Figure 6 The white area in the middle represents the aurora, making it more realistic and visually richer. It can also dynamically change according to the corresponding flow speed over time, greatly improving the interactivity of the game scene.
[0069] It should be noted that the embodiments of the present invention include, but are not limited to, the examples described above. It is understood that those skilled in the art can make further settings according to actual needs under the guidance of the ideas in the embodiments of the present invention, and the present invention does not limit such settings.
[0070] In this embodiment of the invention, for a game scene, scene data corresponding to the game scene is acquired. The scene data includes at least a scene model and texture data. The texture data includes at least an effect mask texture and a noise texture. Then, color control information for adjusting gradient colors is acquired, and gradient processing is performed based on the color control information and the texture coordinates of the scene model to obtain a gradient color texture corresponding to the scene model. Noise control parameters for the noise texture are also acquired, and flow control is performed on the noise texture based on the noise control parameters to obtain a flow noise texture corresponding to the noise texture. Vertex displacement is performed based on the noise texture to obtain offset information corresponding to the scene model. Then, the scene model is rendered and output based on the gradient color texture, the flow noise texture, and the offset information. This achieves gradient and flow control of the game scene, making the game scene more realistic and visually richer. On the other hand, through the corresponding parameter control process, the controllability of game scene adjustment is effectively improved, and the limitations of game scene adjustment are reduced.
[0071] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0072] Reference Figure 7 The diagram illustrates a structural block diagram of a scene special effects processing device provided in an embodiment of the present invention, which may specifically include the following modules: The data acquisition module 701 is used to acquire scene data corresponding to the game scene. The scene data includes at least a scene model and texture data. The texture data includes at least an effect mask texture and a noise texture. The gradient adjustment module 702 is used to acquire color control information for adjusting gradient colors, and perform gradient processing based on the color control information and the texture coordinates of the scene model to obtain a gradient color texture corresponding to the scene model. The flow control module 703 is used to acquire noise control parameters for the noise map, and to perform flow control on the noise map according to the noise control parameters to obtain a flow noise map corresponding to the noise map. Offset control module 704 is used to perform vertex displacement according to the noise map to obtain offset information corresponding to the scene model; The rendering module 705 is used to render and output the scene model based on the gradient color map, the flow noise map, and the offset information.
[0073] In some feasible implementations, the color control information includes at least color information and highlight parameters, and the gradient adjustment module 702 is specifically used for: The color information and the texture coordinates of the scene model are used to perform gradient processing to obtain a gradient color corresponding to the scene model; The pixel points corresponding to the texture coordinates are calculated using the highlight parameters and the gradient colors to obtain the gradient color texture corresponding to the scene model.
[0074] In some feasible implementations, the color control information further includes gradient range control parameters, the texture coordinates include target coordinates in the target direction, and the color information includes at least a first-direction effect color and a second-direction effect color. The gradient adjustment module 702 is specifically used for: Interpolation is performed using the gradient range control parameters, the target coordinates, the first directional effect color, and the second directional effect color to obtain the gradient color corresponding to the scene model.
[0075] In some feasible implementations, the highlight parameters include at least the coordinates of the center point, the radius of the circle, and the target position for controlling the mask image. The gradient adjustment module 702 is specifically used for: The gradient color is assigned to the target position, and the texture is calculated according to the radius of the circle, with the center point coordinates as the center, to obtain the gradient color texture corresponding to the scene model.
[0076] In some feasible implementations, the noise control parameters include at least scaling parameters, flow velocity, and noise magnitude control parameters, and the flow control module 703 is specifically used for: Select a texture from any channel of the noise texture as the first noise texture, and select another texture from a different channel than the first noise texture as the second noise texture. Using the center point of the first noise map as the axis, the texture coordinates of the first noise map are scaled several times using the scaling parameters to obtain the corresponding first texture coordinates; The first texture coordinates are processed by the noise magnitude control parameters and the flow velocity to obtain several first flow noise maps with different flow performances corresponding to the first noise map. Furthermore, taking the center point of the second noise map as the axis, the texture coordinates of the second noise map are scaled several times using the scaling parameters to obtain the corresponding second texture coordinates; The second texture coordinates are processed using the noise magnitude control parameters and the flow velocity to obtain several second flow noise maps with different flow characteristics corresponding to the second noise map.
[0077] In some feasible implementations, the noise control parameters include noise intensity control parameters, and the offset control module 704 is specifically used for: Select the R channel from the noise map as the displacement control parameter; The noise intensity control parameters and the displacement control parameters are used to calculate the offset in the X-axis direction and the Z-axis direction, respectively, to obtain the first vertex offset information of the scene model in the X-axis direction and the second vertex offset information in the Z-axis direction; Obtain the Y-axis vertex of the scene model, and use the Y-axis vertex and the noise intensity control parameter to calculate the offset in the Y-axis direction, thereby obtaining the offset information of the third vertex of the scene model in the Y-axis direction.
[0078] In some feasible implementations, the rendering module 705 is specifically used for: The scene model is rendered based on the gradient color map and the flow noise map. At the same time, edge hardness processing is performed based on the special effects mask map and the gradient color map, and the scene model is controlled to flow according to the offset information over time.
[0079] In some feasible implementations, the rendering module 705 is specifically used for: Use the special effects masking texture as the transparency value; The transparency value is used to perform interpolation calculations on a preset threshold and the flow noise map, and the edge hardness of the scene model is controlled to decrease based on the calculation results; Furthermore, the transparency value and the gradient color map are interpolated, and the transparency of the scene model is controlled according to the calculation result.
[0080] In some feasible implementations, the apparatus further includes: The parameter acquisition module is used to acquire gradient control parameters for the gradient color texture. The rate of change calculation module is used to obtain the world position of the scene model and calculate the first rate of change in the X-axis direction and the second rate of change in the Y-axis direction corresponding to the world position. The first rate of change and the second rate of change are used to characterize the change value at the pixel position. The normal direction calculation module is used to perform a cross product operation using the first rate of change and the second rate of change to obtain the normal direction. The normalization processing module is used to normalize the normal direction to obtain the unit normal direction; The gradient calculation module is used to calculate the edge gradient of the unit normal direction using Fresnel calculation, so that the normal changes between the viewing direction and the unit normal direction, thereby controlling the gradient fading of the scene model.
[0081] In some feasible implementations, the data acquisition module 701 is specifically used for: In response to the texture creation operation for the game scene, obtain the special effects mask texture corresponding to the game scene; The noise map of the R channel, the noise map of the G channel, and the noise map of the B channel are obtained respectively, and the noise map of the R channel, the noise map of the G channel, and the noise map of the B channel are synthesized to obtain a noise map corresponding to the game scene. In response to a model drawing operation for the game scene, a scene model corresponding to the game scene is obtained.
[0082] In some feasible implementations, the data acquisition module 701 is specifically used for: In response to a texture drawing operation for a game scene, black is filled into a preset canvas, and the target graphic is displayed according to the texture drawing operation. In response to a filter addition operation on the target image, a target filter corresponding to the filter addition operation is added to the target image to obtain an effect mask texture corresponding to the game scene.
[0083] In some feasible implementations, the data acquisition module 701 is further used for: In response to an image processing operation on the special effects mask texture, Gaussian blur and / or multiply blending are added to the special effects mask texture according to the image processing operation to obtain an image-processed special effects mask texture.
[0084] In some feasible implementations, the data acquisition module 701 is specifically used for: In response to a model drawing operation for the game scene, the model shape corresponding to the game scene is determined based on the model drawing operation; The model shape is converted into a polygon to obtain a set of model facets with curvature; The model is folded and reused based on the UV coordinates corresponding to the model patch to obtain a scene model corresponding to the game scene.
[0085] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0086] In addition, this invention also provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the various processes of the above-described scene special effects processing method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0087] This invention also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described scene effects processing method embodiments and achieves the same technical effects. To avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0088] Figure 8A schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present invention. The electronic device 800 includes, but is not limited to, components such as: a radio frequency unit 801, a network module 802, an audio output unit 803, an input unit 804, a sensor 805, a display unit 806, a user input unit 807, an interface unit 808, a memory 809, a processor 810, and a power supply 811. Those skilled in the art will understand that the electronic device structure involved in the embodiments of the present invention does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than illustrated, or combine certain components, or have different component arrangements. In the embodiments of the present invention, the electronic device includes, but is not limited to, mobile phones, tablet computers, laptops, PDAs, in-vehicle terminals, wearable devices, and pedometers.
[0089] It should be understood that, in this embodiment of the invention, the radio frequency unit 801 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink data from the base station and processes it with the processor 810; additionally, it transmits uplink data to the base station. Typically, the radio frequency unit 801 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier, a duplexer, etc. Furthermore, the radio frequency unit 801 can also communicate with networks and other devices through a wireless communication system.
[0090] Electronic devices provide users with wireless broadband internet access through network module 802, such as helping users send and receive emails, browse web pages, and access streaming media.
[0091] The audio output unit 803 can convert audio data received by the radio frequency unit 801 or the network module 802 or stored in the memory 809 into audio signals and output them as sound. Furthermore, the audio output unit 803 can also provide audio output related to specific functions performed by the electronic device 800 (e.g., call signal reception sound, message reception sound, etc.). The audio output unit 803 includes a speaker, a buzzer, and a receiver, etc.
[0092] Input unit 804 is used to receive audio or video signals. Input unit 804 may include a graphics processing unit (GPU) 8041 and a microphone 8042. The GPU 8041 processes image data of still images or videos acquired by an image capture device (such as a camera) in video capture mode or image capture mode. The processed image frames can be displayed on display unit 806. The image frames processed by GPU 8041 can be stored in memory 809 (or other storage media) or transmitted via radio frequency unit 801 or network module 802. Microphone 8042 can receive sound and process such sound into audio data. The processed audio data can be converted into a format that can be transmitted to a mobile communication base station via radio frequency unit 801 in telephone call mode.
[0093] The electronic device 800 also includes at least one sensor 805, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 8061 according to the ambient light level, and the proximity sensor can turn off the display panel 8061 and / or backlight when the electronic device 800 is moved to the ear. As a type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used to identify the posture of the electronic device (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc. The sensor 805 may also include a fingerprint sensor, pressure sensor, iris sensor, molecular sensor, gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc., which will not be described in detail here.
[0094] The display unit 806 is used to display information input by the user or information provided to the user. The display unit 806 may include a display panel 8061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0095] User input unit 807 can be used to receive input numerical or character information, and to generate key signal inputs related to user settings and function control of electronic devices. Specifically, user input unit 807 includes a touch panel 8071 and other input devices 8072. Touch panel 8071, also known as a touch screen, can collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near touch panel 8071). Touch panel 8071 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to processor 810, which receives and executes commands from processor 810. In addition, touch panel 8071 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. Besides touch panel 8071, user input unit 807 may also include other input devices 8072. Specifically, other input devices 8072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, joysticks, etc., which will not be described in detail here.
[0096] Furthermore, the touch panel 8071 can cover the display panel 8061. When the touch panel 8071 detects a touch operation on or near it, it transmits the information to the processor 810 to determine the type of touch event. Subsequently, the processor 810 provides corresponding visual output on the display panel 8061 according to the type of touch event. It is understood that in one embodiment, the touch panel 8071 and the display panel 8061 are implemented as two independent components to realize the input and output functions of the electronic device. However, in some embodiments, the touch panel 8071 and the display panel 8061 can be integrated to realize the input and output functions of the electronic device. The specific implementation is not limited here.
[0097] Interface unit 808 serves as an interface for connecting external devices to electronic device 800. For example, external devices may include a wired or wireless headphone port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, and so on. Interface unit 808 can be used to receive input from external devices (e.g., data, power, etc.) and transmit the received input to one or more components within electronic device 800, or it can be used to transmit data between electronic device 800 and external devices.
[0098] The memory 809 can be used to store software programs and various data. The memory 809 may primarily include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback, image playback, etc.), etc.; the data storage area may store data created based on the use of the mobile phone (such as audio data, phonebook, etc.). Furthermore, the memory 809 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0099] The processor 810 is the control center of the electronic device. It connects various parts of the electronic device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 809, and by calling data stored in the memory 809, it performs various functions and processes data, thereby providing overall monitoring of the electronic device. The processor 810 may include one or more processing units; preferably, the processor 810 may integrate an application processor and a modem processor. The application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 810.
[0100] The electronic device 800 may also include a power supply 811 (such as a battery) that supplies power to various components. Preferably, the power supply 811 can be logically connected to the processor 810 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system.
[0101] In addition, the electronic device 800 includes some functional modules not shown, which will not be described in detail here.
[0102] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0103] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0104] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of the present invention.
[0105] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0106] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0107] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0108] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0109] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0110] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0111] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for processing scene special effects, characterized in that, include: Acquire scene data corresponding to the game scene, wherein the scene data includes at least a scene model and texture data, and the texture data includes at least an effect mask texture and a noise texture. Obtain color control information for adjusting gradient colors, and perform gradient processing based on the color control information and the texture coordinates of the scene model to obtain a gradient color texture corresponding to the scene model; Obtain noise control parameters for the noise map, and perform flow control on the noise map according to the noise control parameters to obtain a flow noise map corresponding to the noise map; Vertex displacement is performed based on the noise map to obtain offset information corresponding to the scene model; The scene model is rendered and output based on the gradient color map, the flow noise map, and the offset information; The step of rendering and outputting the scene model based on the gradient color map, the flow noise map, and the offset information includes: The scene model is rendered based on the gradient color texture and the flow noise texture. At the same time, the special effect mask texture is used as the transparency value. The transparency value is used to perform interpolation calculation on the preset threshold and the flow noise texture. The edge hardness of the scene model is controlled to decrease based on the calculation result. Furthermore, the transparency value and the gradient color map are interpolated, and the transparency of the scene model is controlled according to the calculation result; And, control the scene model to flow according to the offset information over time; The method further includes, after controlling the decrease of edge hardness of the scene model based on the calculation result: Obtain the gradient control parameters for the gradient color map; Obtain the world position of the scene model, and calculate the first rate of change in the X-axis direction and the second rate of change in the Y-axis direction corresponding to the world position. The first rate of change and the second rate of change are used to characterize the change value at the pixel position. The normal direction is obtained by performing a cross product operation using the first rate of change and the second rate of change. Normalize the normal direction to obtain the unit normal direction; Fresnel calculations are used to perform edge gradation calculations on the unit normal direction, causing the normal to change between the viewing direction and the unit normal direction, in order to control the gradation and hidden surface removal of the scene model.
2. The method according to claim 1, characterized in that, The color control information includes at least color information and highlight parameters. The step of performing gradient processing based on the color information and the texture coordinates of the scene model to obtain a gradient color map corresponding to the scene model includes: The color information and the texture coordinates of the scene model are used to perform gradient processing to obtain a gradient color corresponding to the scene model; The pixel points corresponding to the texture coordinates are calculated using the highlight parameters and the gradient colors to obtain the gradient color texture corresponding to the scene model.
3. The method according to claim 2, characterized in that, The color control information further includes gradient range control parameters, the texture coordinates include target coordinates in the target direction, and the color information includes at least a first-direction effect color and a second-direction effect color. The step of using the color information and the texture coordinates of the scene model to perform gradient processing to obtain a gradient color corresponding to the scene model includes: Interpolation is performed using the gradient range control parameters, the target coordinates, the first directional effect color, and the second directional effect color to obtain the gradient color corresponding to the scene model.
4. The method according to claim 2 or 3, characterized in that, The highlight parameters include at least the coordinates of the center point, the radius of the circle, and the target position for controlling the mask image. The step of calculating the pixel points corresponding to the scene model using the highlight parameters and the gradient color to obtain the gradient color texture corresponding to the scene model includes: The gradient color is assigned to the target position, and the texture is calculated according to the radius of the circle, with the center point coordinates as the center, to obtain the gradient color texture corresponding to the scene model.
5. The method according to claim 1, characterized in that, The noise control parameters include at least scaling parameters, flow velocity, and noise magnitude control parameters. The step of performing flow control on the noise map based on the noise control parameters to obtain a flow noise map corresponding to the noise map includes: Select a texture from any channel of the noise texture as the first noise texture, and select another texture from a different channel than the first noise texture as the second noise texture. Using the center point of the first noise map as the axis, the texture coordinates of the first noise map are scaled several times using the scaling parameters to obtain the corresponding first texture coordinates; The first texture coordinates are processed by the noise magnitude control parameters and the flow velocity to obtain several first flow noise maps with different flow performances corresponding to the first noise map. And, taking the center point of the second noise map as the axis, the texture coordinates of the second noise map are scaled several times using the scaling parameters to obtain the corresponding second texture coordinates; The second texture coordinates are processed using the noise magnitude control parameters and the flow velocity to obtain several second flow noise maps with different flow characteristics corresponding to the second noise map.
6. The method according to claim 1, characterized in that, The noise control parameters include noise intensity control parameters, and the step of performing vertex displacement based on the noise map to obtain offset information corresponding to the scene model includes: Select the R channel from the noise map as the displacement control parameter; The noise intensity control parameters and the displacement control parameters are used to calculate the offset in the X-axis direction and the Z-axis direction, respectively, to obtain the first vertex offset information of the scene model in the X-axis direction and the second vertex offset information in the Z-axis direction; Obtain the Y-axis vertex of the scene model, and use the Y-axis vertex and the noise intensity control parameter to calculate the offset in the Y-axis direction, thereby obtaining the offset information of the third vertex of the scene model in the Y-axis direction.
7. The method according to claim 1, characterized in that, The acquisition of scene data corresponding to the game scene includes: In response to the texture creation operation for the game scene, obtain the special effects mask texture corresponding to the game scene; The noise map of the R channel, the noise map of the G channel, and the noise map of the B channel are obtained respectively, and the noise map of the R channel, the noise map of the G channel, and the noise map of the B channel are synthesized to obtain a noise map corresponding to the game scene. In response to the model drawing operation for the game scene, a scene model corresponding to the game scene is obtained.
8. The method according to claim 7, characterized in that, The step of responding to a texture creation operation for a game scene and obtaining an effect mask texture corresponding to the game scene includes: In response to a texture drawing operation for a game scene, black is filled into a preset canvas, and the target graphic is displayed according to the texture drawing operation; In response to a filter addition operation on the target image, a target filter corresponding to the filter addition operation is added to the target image to obtain an effect mask texture corresponding to the game scene.
9. The method according to claim 8, characterized in that, The step of obtaining an effect mask texture corresponding to the game scene in response to a texture creation operation for the game scene further includes: In response to an image processing operation on the special effects mask texture, Gaussian blur and / or multiply blending are added to the special effects mask texture according to the image processing operation to obtain an image-processed special effects mask texture.
10. The method according to claim 7, characterized in that, The step of obtaining a scene model corresponding to the game scene in response to a model rendering operation for the game scene includes: In response to a model drawing operation for the game scene, the model shape corresponding to the game scene is determined based on the model drawing operation; The model shape is converted into a polygon to obtain a set of model facets with curvature; The model is folded and reused based on the texture coordinates corresponding to the model facets to obtain a scene model corresponding to the game scene.
11. A scene special effects processing device, characterized in that, include: The data acquisition module is used to acquire scene data corresponding to the game scene. The scene data includes at least a scene model and texture data. The texture data includes at least an effect mask texture and a noise texture. The gradient adjustment module is used to acquire color control information for adjusting gradient colors, and to perform gradient processing based on the color control information and the texture coordinates of the scene model to obtain a gradient color texture corresponding to the scene model. A flow control module is used to acquire noise control parameters for the noise map, and to perform flow control on the noise map according to the noise control parameters to obtain a flow noise map corresponding to the noise map. The offset control module is used to perform vertex displacement based on the noise map to obtain offset information corresponding to the scene model; The rendering module is used to render and output the scene model based on the gradient color map, the flow noise map, and the offset information; Specifically, the rendering module is used for: The scene model is rendered based on the gradient color map and the flow noise map. At the same time, the special effect mask map is used as the transparency value, and the transparency value is used to perform interpolation calculation on the preset threshold and the flow noise map. The edge hardness of the scene model is controlled to decrease based on the calculation result. Furthermore, the transparency value and the gradient color map are interpolated, and the transparency of the scene model is controlled according to the calculation result; And, control the scene model to flow according to the offset information over time; The device further includes: The parameter acquisition module is used to acquire gradient control parameters for the gradient color texture. The rate of change calculation module is used to obtain the world position of the scene model and calculate the first rate of change in the X-axis direction and the second rate of change in the Y-axis direction corresponding to the world position. The first rate of change and the second rate of change are used to characterize the change value at the pixel position. The normal direction calculation module is used to perform a cross product operation using the first rate of change and the second rate of change to obtain the normal direction. The normalization processing module is used to normalize the normal direction to obtain the unit normal direction; The gradient calculation module is used to calculate the edge gradient of the unit normal direction using Fresnel calculation, so that the normal changes between the viewing direction and the unit normal direction, thereby controlling the gradient fading of the scene model.
12. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; The memory is used to store computer programs; When the processor executes a program stored in the memory, it implements the method as described in any one of claims 1-10.
13. A computer-readable storage medium having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the method as described in any one of claims 1-10.
Citation Information
Patent Citations
Three-dimensional virtual cloud model processing method, storage medium, processor and electronic device
CN111145326A
Animation production method and device, computer equipment and computer readable storage medium
CN115631276A