Methods, devices, electronic equipment, and readable storage media for processing scene special effects

By using stylized effects texture processing methods in virtual scenes, the problem of unnatural effect boundaries in virtual scenes is solved, achieving more natural and delicate scene effects.

CN119701341BActive Publication Date: 2026-01-30NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411957880.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2026-01-30
Estimated Expiration
2044-12-26

AI Technical Summary

Technical Problem

In existing technologies, scene effects boundaries in virtual scenes may have straight chamfers, unnatural transitions between adjacent grid cells, a lack of clarity and detail, and monotonous effect forms.

Method used

By identifying target scene units and effect meshes in a virtual scene, stylized effect maps are obtained. Scene effects are then generated by rendering based on these effect maps in the virtual scene. The effect maps store stylized effect textures to match the target performance style.

Benefits of technology

The generated scene effects have more natural and delicate edges, avoiding problems such as straight bevels and texture repetition, resulting in a richer visual presentation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119701341B_ABST
    Figure CN119701341B_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, electronic device, and readable storage medium for processing scene special effects. The method includes: determining a target scene unit of the scene special effect to be processed in a virtual scene and a special effect mesh corresponding to the virtual scene; determining a target special effect unit corresponding to the target scene unit in the special effect mesh and target special effect information of the target special effect unit; determining a target special effect map corresponding to the target special effect information in a preset set of special effect maps; different target special effect information corresponds to different special effect maps, and the special effect maps are used to store stylized special effect textures; adding target special effect textures to the special effect model corresponding to the target special effect unit according to the target special effect map to render and generate a scene special effect with a target performance style that matches the style of the special effect texture corresponding to the target special effect map in the virtual scene. This method can improve the visual performance of scene special effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, and specifically to a method, apparatus, electronic device, and computer-readable storage medium for processing scene effects. Background Technology

[0002] Currently, in virtual games, when special effects need to be added to a scene, the rendering engine determines which parts of the virtual scene should have effects and how the intensity of the effects should change based on preset rules or algorithms. Then, the rendering engine generates a mesh region based on the area where the effects are to be generated. Each vertex or face of each mesh cell in this mesh region is assigned certain attribute values ​​(such as effect color, effect transparency, etc.) according to the aforementioned preset rules. Then, interpolation calculations are performed on each attribute value to obtain the effect in each mesh cell.

[0003] However, in the above methods, the grid cells are usually regular geometric shapes, meaning that the boundaries of each grid cell are straight lines. This can lead to the generated special effects having straight chamfered edges, and the transition between special effects between adjacent grid cells being abrupt and lacking a natural feel. Even if the special effects in the grid cells are blurred, the special effects between adjacent grid cells may have repeated textures, or the edge effects may lose detail, resulting in a lack of clarity and refinement. In addition, during the interpolation calculation process, the special effects in each grid cell are easily distributed relatively evenly, resulting in a relatively monotonous special effect form in the special effect area.

[0004] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this application, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0005] In view of this, this application provides a method, apparatus, electronic device, and computer-readable storage medium for processing scene effects, which can improve the visual performance of scene effects in virtual scenes.

[0006] Firstly, embodiments of this application provide a method for processing scene special effects, the method comprising:

[0007] Identify multiple target scene units in the virtual scene that are to be processed for scene effects, as well as the corresponding effect grid of the virtual scene. The effect grid includes multiple effect units, and the scene effects in the virtual scene that present the first performance effect.

[0008] Determine the target effect unit corresponding to the target scene unit among multiple effect units, and the target effect information corresponding to the target effect unit; the target effect information is used to indicate the target display area of ​​the scene effect in the effect unit;

[0009] Obtain the target effect map corresponding to the target effect information in the preset effect map set; wherein, the effect map set includes different effect maps corresponding to different target effect information, and the effect map is used to store stylized effect textures;

[0010] Based on the target effect map, a target effect texture is added to the effect model corresponding to the target effect unit to render and generate the scene effect with the target performance style in the virtual scene; the target performance style matches the style of the effect texture stored in the target effect map.

[0011] Secondly, embodiments of this application provide a scene effects processing apparatus, which includes: a determining unit, an acquiring unit, and a generating unit;

[0012] The determining unit is used to determine multiple target scene units of the scene effects to be processed in the virtual scene, as well as the effect grid corresponding to the virtual scene. The effect grid includes multiple effect units, and the scene effects in the virtual scene that present the first performance effect.

[0013] The determining unit is also used to determine the target effect unit corresponding to the target scene unit among multiple effect units, as well as the target effect information corresponding to the target effect unit; the target effect information is used to indicate the target display area of ​​the scene effect in the effect unit;

[0014] The acquisition unit is also used to acquire the target effect map corresponding to the target effect information in the preset effect map set; wherein, the effect map set includes different effect maps corresponding to different target effect information, and the effect map is used to store stylized effect textures;

[0015] A generation unit is used to add a target effect texture to the effect model corresponding to the target effect unit according to the target effect map, so as to render and generate the scene effect with the target performance style in the virtual scene; the target performance style matches the style of the effect texture stored in the target effect map.

[0016] Thirdly, embodiments of this application provide an electronic device, including:

[0017] Processor; and

[0018] The memory is used to store data processing programs, which, when the electronic device is powered on and run by the processor, execute the method as described in the first aspect.

[0019] Fourthly, embodiments of this application provide a computer-readable storage medium storing a data processing program that is executed by a processor to perform the method as described in the first aspect.

[0020] The scene effects processing method provided in this application determines multiple target scene units of the scene effects to be processed in a virtual scene, and a corresponding effect grid for the virtual scene. The effect grid includes multiple effect units, and there is a correspondence between each scene unit in the virtual scene and the effect units in the effect grid. Based on this, the method determines the target effect unit corresponding to the target scene unit in the multiple effect units, and the target effect information corresponding to the target effect unit. The target effect information is used to indicate the display area of ​​the scene effect in the target effect unit. Further, the method can obtain the target effect map corresponding to the target effect information in a preset effect map set. The effect map set includes different effect maps corresponding to different effect information, that is, the effect textures in different effect maps have different display areas in the corresponding maps. In addition, the effect map stores stylized effect textures. For example, the effect texture boundaries have stylized appearance, that is, the edges of the effect textures in the effect map are not harsh and the appearance is natural. Or, the stylized effect textures in an effect map have different texture densities or different transparency in different areas. Based on the target effect map that stores stylized effect textures, the target effect texture is added to the effect model corresponding to the target effect unit to render and generate scene effects with the target performance style in the virtual scene; the target performance style matches the style of the effect texture stored in the target effect map.

[0021] As can be seen, since the effect textures stored in each effect texture in the preset effect texture set have a stylized appearance, after adding the target effect texture to the effect model in each target effect unit according to the target effect texture, the surface texture of the effect model in the target effect unit has the aforementioned stylized appearance. For example, the edges of the surface texture of the effect model have the aforementioned stylized appearance, thereby making the edges of the scene effects generated in the virtual scene more natural and delicate, which can avoid the problems of straight chamfers and texture repetition in the edges of the effect performance generated in related technologies. In addition, when the stylized effect textures stored in the target effect texture have different texture densities or different transparency in different areas, scene effects with richer visual effects can be generated. Attached Figure Description

[0022] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 A flowchart illustrating an example of a method for processing scene effects provided in an embodiment of this application;

[0024] Figure 2 A schematic diagram of an example of a special effects mesh provided in an embodiment of this application;

[0025] Figure 3 A schematic diagram illustrating a preset set of special effects textures provided in an embodiment of this application;

[0026] Figure 4 This is an example of a schematic diagram showing that adjacent special effects units correspond to adjacent special effects maps when they are adjacent, as provided in the embodiments of this application.

[0027] Figure 5 A schematic diagram illustrating an example of a target effect unit provided in an embodiment of this application;

[0028] Figure 6 This is another example of a flowchart illustrating the scene effects processing method provided in the embodiments of this application;

[0029] Figure 7 This is a schematic diagram of the scene effects processing device provided in the embodiments of this application;

[0030] Figure 8 This application provides a structural block diagram of an electronic device for implementing a scene special effects processing method. Detailed Implementation

[0031] Many specific details are set forth in the following description to provide a full understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this application; therefore, this application is not limited to the specific embodiments disclosed below.

[0032] It should be noted that the terms "first," "second," "third," etc., in the claims, specification, and drawings of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. Such data are interchangeable where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that shown or described herein. Furthermore, the terms "comprising," "having," and their variations are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or apparatuses.

[0033] It should be understood that in the embodiments of this application, "at least one" refers to one or more, "several" refers to one or more, and "more than" refers to two or more. "And / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship. "Contains A, B, and / or C" means containing any one, two, or three of A, B, and C.

[0034] It should be understood that in the embodiments of this application, "B corresponding to A", "B corresponding to A", "A corresponds to B" or "B corresponds to A" means that B is associated with A, and B can be determined based on A. Determining B based on A does not mean that B is determined solely based on A; B can also be determined based on A and / or other information.

[0035] Based on the problems existing in the related technologies described above, embodiments of this application provide a method, apparatus, electronic device, and computer-readable storage medium for processing scene special effects.

[0036] The scene effects processing method provided in this application embodiment can be executed by an electronic device, which can be a terminal or a server. The terminal can be a smartphone, tablet, laptop, or other terminal device. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster composed of multiple servers or as a single server. When the server is software, it can be implemented as multiple software programs or software modules (e.g., software or software modules used to provide distributed services) or as a single software program or software module. This application embodiment does not specifically limit this.

[0037] It should be noted that, in this embodiment, the execution entity of the scene effect processing method can be a terminal device or a server. The terminal device can be a local terminal device or a client device in the aforementioned cloud service system. This embodiment does not limit the type of execution entity.

[0038] The technical solution of this application will be described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. For example... Figure 1 As shown, Figure 1 This is an example flowchart of a scene effects processing method provided in an embodiment of this application. It should be noted that the steps shown may be executed in a different logical order than that shown in the flowchart. The method may include the following steps S110 to S140.

[0039] Step S110: Determine multiple target scene units of the scene effects to be processed in the virtual scene, and the corresponding effect grid of the virtual scene. The effect grid includes multiple effect units.

[0040] Step S120: Determine the target effect unit corresponding to the target scene unit in multiple effect units, and the target effect information corresponding to the target effect unit; the target effect information is used to indicate the display area of ​​the scene effect in the target effect unit.

[0041] Step S130: Obtain the target effect map corresponding to the target effect information in the preset effect map set; wherein, the effect map set includes effect maps with different display areas of scene effects corresponding to different effect information, and the effect maps are used to store stylized effect textures.

[0042] Step S140: Based on the target effect map, add a target effect texture to the effect model corresponding to the target effect unit to render and generate the scene effect with the target performance style in the virtual scene; the target performance style matches the style of the effect texture stored in the target effect map.

[0043] Next, each of the above steps will be described in detail.

[0044] For step S110 above, multiple target scene units of the scene effects to be processed in the virtual scene are determined, as well as the effect grid corresponding to the virtual scene. The effect grid includes multiple effect units.

[0045] In this embodiment, the virtual scene is divided into multiple scene units by a preset two-dimensional grid. A scene unit refers to a series of minimum operating areas of a fixed size, which are the preset ground or a plane of the virtual scene. Each minimum operating area can be called a scene unit. In this embodiment, the scene unit can be a quadrilateral, a hexagon, or other shapes. In this embodiment, a quadrilateral is used as an example of a scene unit.

[0046] The aforementioned virtual scenes are the environments in which players complete game logic within virtual games. These can be simulations of the real world within the game, semi-simulated / semi-fictional virtual environments, or purely fictional virtual environments. Virtual scenes can be any of the following: two-dimensional, 2.5-dimensional, or three-dimensional virtual scenes; there are no specific restrictions.

[0047] The aforementioned scene effects refer to dynamic or static effects used to enhance the visual effects in virtual scenes, thereby improving the immersion and visual appeal of the game. For example, scene effects may include, but are not limited to, fog effects, fire effects, ice and snow effects, haze effects, sand effects, etc. This embodiment does not specifically limit them.

[0048] In this embodiment, the performance effect of scene effects refers to the visual effect presented by scene effects in a virtual scene. For example, when the scene effect is a fog effect, the performance effect of the fog effect may include, but is not limited to, the display area of ​​the fog effect in the virtual scene, the display transparency, whether it is displayed dynamically or statically, etc., and there are no specific restrictions.

[0049] In this embodiment, each of the above-mentioned target scene units may present scene effects with certain visual effects in the game interface of the current frame, or may not display scene effects. This embodiment does not specifically limit this.

[0050] The aforementioned target scene unit refers to the scene unit to be processed with special effects among multiple scene units corresponding to the virtual scene. The number of target scene units can be one or more, and this embodiment does not specifically limit this. The specific method for determining the target scene unit can be referred to in detail later, and will not be repeated here.

[0051] The aforementioned virtual scene's corresponding effects grid is a two-dimensional grid used to manage scene effects within the virtual scene. This effects grid can include multiple effects units, each of which can include specific effects information. For example, this information can characterize the display area of ​​the scene effects within that unit. Optionally, the effects information can also characterize the effect type, display color, display transparency, display position, etc., without specific limitations. Typically, the effects information of a single effects unit can be processed individually to adjust the performance of the scene effects indicated by that single unit, thereby adjusting the overall performance of the scene effects in the virtual scene.

[0052] In this embodiment, there is a mapping relationship between the scene unit corresponding to the virtual scene and the special effect unit in the special effect mesh. For example, it can be a mapping relationship where one scene unit corresponds to multiple special effect units, or a mapping relationship where one special effect unit corresponds to multiple scene units. It can be specifically set according to actual needs.

[0053] Additionally, it should be noted that in this embodiment, the scene unit and the special effects unit have the same unit size.

[0054] In an optional specific embodiment, the determination of the special effects mesh corresponding to the virtual scene can specifically be: generating the special effects mesh corresponding to the virtual scene in real time based on each scene unit of the virtual scene, or obtaining a special effects mesh preset for the virtual scene. In this embodiment, there is no specific restriction on whether the special effects mesh is generated in real time or stored in advance. Specifically, the special effects mesh corresponding to the virtual scene can be constructed in the following way: obtaining the vertex positions and scene unit sizes of each scene unit corresponding to the virtual scene; using the vertex positions as the center positions of the special effects units to be generated, and the scene unit sizes as the special effects unit sizes of the special effects units to be generated, generating multiple special effects units to obtain the special effects mesh.

[0055] like Figure 2 As shown, Figure 2 The black solid-line grid shown in (a) is the scene grid corresponding to the virtual scene. This scene grid contains 5×5 scene units, each of which is a square with a side length of l. Based on this scene grid, with the vertex of each scene unit (e.g., vertex a) as the center position of the effect unit to be generated, and the side length l of the scene unit as the side length of the effect unit to be generated, it can be calculated as follows: Figure 2 The gray dashed grid shown in (b) generates multiple effect units, resulting in the effect grid corresponding to the virtual scene. It can be seen that the center position of each effect unit in the effect grid shown by the gray dashed grid is the vertex position of the scene unit, and the side length of each effect unit is l.

[0056] It should be noted that the above Figure 2 The method of generating special effects mesh shown is only an example, and this embodiment does not specifically limit the method of generating special effects mesh.

[0057] For step S120 above, the target effect unit corresponding to the target scene unit in the multiple effect units is determined, as well as the target effect information corresponding to the target effect unit; the target effect information is used to indicate the display area of ​​the scene effect in the effect unit.

[0058] In this embodiment, since the special effects mesh is generated based on the relevant unit attributes of each scene unit in the virtual scene, each scene unit in the virtual scene has a mapping relationship with each special effects unit in the special effects mesh. Based on the mapping relationship between each scene unit and each special effects unit, the target special effects unit corresponding to each target scene unit can be determined in the special effects mesh.

[0059] It should be noted that this embodiment does not specifically limit the number of special effects units corresponding to one special effects unit in the special effects grid; it can be one-to-one, one-to-many, or many-to-one.

[0060] In an optional specific embodiment, a scene unit corresponds to multiple scene vertices. Based on this, the step S120 of "determining the target effect unit corresponding to the target scene unit in multiple effect units" can be specifically implemented through the following steps S121 to S122.

[0061] Step S121: For each target scene unit, determine the scene vertices of the target scene unit;

[0062] Step S122: Determine the special effects unit with the scene vertex as the geometric center as the target scene unit among multiple special effects units.

[0063] For example, such as Figure 2 As shown, one scene unit can correspond to four effect units in the effect mesh, that is, one scene unit can be associated with four effect units. Assuming that the target scene unit is scene unit abcd, then scene unit abcd includes four scene vertices, namely vertex a, vertex b, vertex c and vertex d. Based on this, the target effect units corresponding to scene unit abcd in the effect mesh are: the effect mesh centered at vertex a, the effect mesh centered at vertex b, the effect mesh centered at vertex c and the effect mesh centered at vertex d.

[0064] The target effect information corresponding to the aforementioned target effect unit is used to indicate the target display area of ​​the scene effect within the target effect unit. That is, it indicates which areas within the target effect unit will display the scene effect and which areas will not. For example, when a scene effect is displayed in a single effect unit, its display can be categorized as: the effect unit fully displays the scene effect, the effect unit partially displays the scene effect, and the effect unit does not display the scene effect. The partial display of the scene effect within the effect unit can be further subdivided, for example, displaying the scene effect only in the upper left corner, only in the upper right corner, only in the lower left corner, only in the lower right corner, etc. There are no restrictions on the specific display area of ​​the scene effect within the effect unit.

[0065] To address the above situation, the target effect information corresponding to the target effect unit can be represented by several bit characters. When a bit character is "0", it indicates that the scene effect is not displayed; when a bit character is "1", it indicates that the scene effect is displayed. Therefore, if the target effect unit fully displays the scene effect, the target effect information corresponding to the target effect unit can be "1"; if the target effect unit does not display the scene effect at all, the target effect information corresponding to the target effect unit can be "0"; if the target effect unit partially displays the scene effect, the target effect information corresponding to the target effect unit has position mapping capabilities, used to indicate the position of the effect display area and the position of the effect not display area within the target effect unit. In this case, multiple bit characters can be used to represent it. For example, when the target effect information corresponding to the target effect unit is "1", it can be represented by "1". When "0010" is displayed, it indicates that the target effect unit can be divided into four parts, one of which displays scene effects, and the other three parts do not display scene effects. It can be understood that if the target effect unit fully displays scene effects, the target effect information corresponding to the target effect unit can also be "1111". If the target effect unit does not display scene effects at all, the target effect information corresponding to the target effect unit can also be "0000". The number of bit characters used to represent the target effect information can be determined according to the number of regions of the target effect unit. This embodiment does not impose specific restrictions.

[0066] It should be noted that in some embodiments, there are no overlapping areas between different parts of the special effects unit, and the parts of the special effects unit are arranged in a specific order. For example, they can be arranged in a left-to-right order, a top-to-bottom order, clockwise rotation, counterclockwise rotation, or a serpentine arrangement, etc., which can be set according to actual needs.

[0067] The specific method for determining the target effect information corresponding to the target effect unit can be found in the following text, and will not be described in detail here.

[0068] For step S130 above, the target effect map corresponding to the target effect information in the preset effect map set is obtained; wherein, the effect map set includes different effect maps corresponding to different effect information, and the effect map is used to store stylized effect textures.

[0069] In this embodiment, the aforementioned preset set of special effects textures includes different special effects textures corresponding to different target special effects information. Each special effects texture is a two-dimensional image storing stylized special effects textures of a scene. Stylized special effects textures can be understood as follows: the texture density, transparency, edge blurring, and other attributes of the special effects texture in a single special effects texture are all stylized. For example, the density and transparency of the special effects texture differ in different areas of the corresponding special effects texture, and the edges have stylized designs. This embodiment does not specifically limit this aspect.

[0070] As described above, target effect information is used to indicate the target display area of ​​scene effects in the effect unit. Therefore, the display areas of effect textures in the effect maps corresponding to different target effect information are not exactly the same.

[0071] For example, assuming the special effects unit is divided into four parts—top left, top right, bottom right, and bottom left—the corresponding target special effects data can include the following 16 cases: 0000, 0001, 0010, 0100, 1000, 1100, 0110, 0011, 1001, 1010, 0101, 0111, 1110, 1011, 1101, and 1111; where, refer to Figure 3 , Figure 3 A set of effect maps pre-set for the above 16 target effect data is provided; 0000 indicates that no scene effects are displayed in the effect unit, and the effect texture corresponding to it does not have scene effects set. Figure 3The text uses diagonal lines to represent scene effects textures; 0001 indicates that the scene effect is displayed in the lower left corner of the effect unit, while the rest of the area does not display scene effects, and the corresponding effect texture only has an effect texture in the lower left corner; 0010 indicates that the scene effect is displayed in the lower right corner of the effect unit, while the rest of the area does not display scene effects, and the corresponding effect texture only has an effect texture in the lower right corner; 0100 indicates that the scene effect is displayed in the upper right corner of the effect unit, while the rest of the area does not display scene effects, and the corresponding effect texture only has an effect texture in the upper right corner; 1000 indicates that the scene effect is displayed in the upper left corner of the effect unit, while the rest of the area does not display scene effects, and the corresponding effect texture only has an effect texture in the upper left corner. 1100 indicates that the top left and top right corners of the effect unit display scene effects, while the rest of the area does not. The corresponding effect texture map has effect textures set in the top left and top right corners. 0110 indicates that the top right and bottom left corners of the effect unit display scene effects, while the rest of the area does not. The corresponding effect texture map has effect textures set in the top right and bottom left corners. 0011 indicates that the bottom right and bottom left corners of the effect unit display scene effects, while the rest of the area does not. The corresponding effect texture map has effect textures set in the bottom right and bottom left corners. 1001 indicates that the top left and bottom left corners of the effect unit display scene effects, while the rest of the area does not. The corresponding effect texture map has effect textures set in the top left and bottom right corners. The top left and bottom left corners have special effect textures; 1010 indicates that the top left and bottom right corners of the special effect unit display scene effects, while the rest of the area does not display scene effects, and the top left and bottom right corners of the corresponding special effect texture have special effect textures; 0101 indicates that the top right and bottom left corners of the special effect unit display scene effects, while the rest of the area does not display scene effects, and the top right and bottom left corners of the corresponding special effect texture have special effect textures; 0111 indicates that the rest of the special effect unit, except for the top left corner, displays scene effects, while the top left corner does not display scene effects, and the rest of the corresponding special effect texture has special effect textures; 1110 indicates that the rest of the special effect unit, except for the bottom left corner, displays scene effects. Scene effects are categorized as follows: 1011 indicates that the effect unit displays scene effects in all areas except the top right corner, while the top right corner does not. 1101 indicates that the effect unit displays scene effects in all areas except the bottom right corner, while the top right corner does not. 1111 indicates that the effect unit fully displays scene effects, and all areas in its corresponding effect map have effect textures.

[0072] In addition, such as Figure 3As shown, the boundaries of the special effects textures in each special effects map have a stylized curved design, rather than rigid straight lines.

[0073] In an optional embodiment, in the special effects mesh, the similarity of pixel values ​​of the special effects textures corresponding to the target special effects information of adjacent special effects units on the adjacent boundaries is greater than a preset similarity.

[0074] In this context, adjacent effect units refer to effect units within the effect mesh that share common edges and vertices. It's important to note that in this embodiment, the similarity of pixel values ​​between the target effect information and the effect textures corresponding to adjacent effect units at their adjacent boundaries is greater than a preset similarity, or in other words, the difference in pixel values ​​is less than a preset difference. This means that the effect textures corresponding to the target effect information of adjacent effect units can seamlessly transition at their adjacent boundaries. This helps to ensure a smooth transition in the final generated scene effects, without any seams, further refining the effect performance of scene effects in the virtual scene and making the scene effects more delicate and natural.

[0075] For example, such as Figure 4 As shown, Figure 4 (a) provides four adjacent effect units, whose target effect information is 0110, 1011, 1001, and 0100, respectively, based on... Figure 3 Given the provided set of effect textures, obtain the effect textures corresponding to the target effect information 0110, 1011, 1001, and 0100 respectively. Figure 4 As shown in (b), the effect maps corresponding to each target effect information can be spliced ​​together according to the splicing relationship of each effect unit. It can be found that the pixel values ​​of adjacent effect maps on adjacent boundaries can be connected and transitioned.

[0076] In summary, after determining the target effect information of each target effect unit, the target effect texture corresponding to the target effect information can be obtained. Through the target effect texture, the display area of ​​the scene effect in each target effect unit can be determined.

[0077] In step S140 above, a target effect texture is added to the effect model corresponding to the target effect unit according to the target effect texture map, so as to render and generate the scene effect with the target performance style in the virtual scene; the target performance style matches the style of the effect texture stored in the target effect texture map.

[0078] In this embodiment, the special effects model corresponding to the target special effects unit can be understood as a model instance of a basic two-dimensional patch model set for the virtual scene. That is, different special effects models reference the model data of the same two-dimensional patch model. For example, different special effects models have the same model vertices, model normals, model texture coordinates, etc., and only the model position, model scaling and / or model orientation of the special effects models are different.

[0079] In other words, in this embodiment, only one basic graphic element (two-dimensional patch model) can be pre-set for the virtual scene. This two-dimensional patch model corresponds to geometric information (such as vertices, normals, UV coordinates, etc.) and material information (such as special effects textures, colors, etc.). When drawing special effects for each special effects mesh, the two-dimensional patch model can be instantiated so that each special effects unit corresponds to a special effects model. The specific instantiation process can be: setting unique attributes for the two-dimensional patch model, such as setting model position, model rotation, model scaling, model texture, etc., to obtain a specific special effects model. Among them, the model position is used to indicate the placement position of the special effects model obtained after instantiation. For example, in this embodiment, the model position can be the center position of the geometric center of each special effects unit. The model scaling is used to indicate the size of the special effects model obtained after instantiation. In this embodiment, the size of the special effects model corresponding to each special effects mesh matches the unit size of the special effects unit.

[0080] Based on the target effect map, the target effect texture is added to the effect model corresponding to the target effect unit. This can be simply understood as "pasting" a portion of the effect texture stored in the target effect map onto the surface of the effect model corresponding to the target effect unit, so that the surface of the effect model has the target effect texture. In this way, scene effects with the target performance style can be rendered and generated in the virtual scene, and the target performance style is consistent with the style of the effect texture stored in the effect map.

[0081] For details on how to add a portion of the target effect texture stored in the target effect map to the surface of the effect model corresponding to the target effect unit, please refer to the following introduction; it will not be described in detail here.

[0082] As can be seen, since the effect textures stored in each effect texture in the preset effect texture set have a stylized appearance, after adding the target effect texture to the effect model in each target effect unit according to the target effect texture, the surface texture of the effect model in the target effect unit has the aforementioned stylized appearance. For example, the edges of the surface texture of the effect model have the aforementioned stylized appearance, thereby making the edges of the scene effects generated in the virtual scene more natural and delicate, which can avoid the problems of straight chamfers and texture repetition in the edges of the effect performance generated in related technologies. In addition, when the stylized effect textures stored in the target effect texture have different texture densities or different transparency in different areas, scene effects with richer visual effects can be generated.

[0083] In addition, since the textures of adjacent effect maps in the preset effect map set can be seamlessly connected on adjacent boundaries, after adjusting the surface texture of the effect model in each target effect unit according to each effect map in the effect map set, the effect textures of the effect models in each adjacent effect unit in the effect mesh can be smoothly transitioned, thus making the visual performance of the scene effects generated in the virtual scene more delicate.

[0084] Next, the method for processing scene effects provided in this application will be described in further detail. As described above, each effect unit in the effect grid stores corresponding effect information. Therefore, after determining the target effect unit corresponding to the target scene unit, the target effect information corresponding to the target effect unit can be further determined.

[0085] It is understood that a single special effects unit can include multiple special effects vertices. In this embodiment, each special effects vertex of the special effects unit can correspond to a unit area. In this way, the display state of scene effects in the corresponding unit area can be indicated by the vertex information corresponding to each special effects vertex, thereby realizing the control of the display area of ​​scene effects within the special effects unit through the vertex information corresponding to each special effects vertex. That is, the target special effects information of the special effects unit described above is the information composed of the vertex information of each special effects vertex. For example, if the target special effects information corresponding to a certain special effects unit is "1100", it means that the special effects unit includes four special effects vertices, and the vertex information of each special effects vertex is 1, 1, 0, 0 respectively.

[0086] Based on the above description, in some optional embodiments, each special effect vertex corresponds to a first special effect information; the first special effect information is used to indicate the first display state of the scene special effect in the unit area corresponding to the special effect vertex in the special effect unit; in this scenario, the "determining the target special effect information corresponding to the target special effect unit" in the above step S120 can be specifically implemented through the following steps S123 to S125.

[0087] Step S123: Determine the first effect vertex among multiple effect vertices of the target effect unit; the first effect vertex is located inside the target scene unit corresponding to the target effect unit.

[0088] Step S124: Adjust the first effect information corresponding to the first effect vertex to the second effect information; the second effect information is used to indicate the second display state of the scene effect in the unit area corresponding to the first effect vertex in the target effect unit.

[0089] Step S125: The second effect information stored in the first effect vertex and the first effect information corresponding to the second effect vertex are determined as the target effect information corresponding to the target effect unit; the second effect vertex is located outside the target scene unit corresponding to the target effect unit.

[0090] In this embodiment, the first effect information corresponding to each effect vertex is used to indicate the first display state of the scene effect in the corresponding unit area of ​​the effect vertex in the effect unit, that is, to indicate the current display state of the scene effect in each unit area.

[0091] It should be noted that the first effect information corresponding to different effect vertices can be the same or different. For example, for a certain target effect unit, there are four effect vertices, and the first effect information corresponding to the four effect vertices can be 0, 1, 1, and 0 respectively. In this way, the current display status of each unit area in the target effect unit of the scene effect can be: not displayed, displayed, displayed, and not displayed respectively.

[0092] As mentioned earlier, the center position of the special effects unit is the vertex position of the corresponding scene unit. Some special effects vertices of the special effects unit can be located inside the corresponding scene unit, and some special effects vertices can be located outside the corresponding scene unit. In this embodiment, the special effects vertex located inside the target scene unit among the multiple special effects vertices corresponding to the target special effects unit is called the first special effects vertex, and the special effects vertex located outside the target scene unit is called the second special effects vertex.

[0093] The above-mentioned adjustment of the first special effect information corresponding to the first special effect vertex to the second special effect information can be understood as adjusting the special effect information currently corresponding to the first special effect vertex to the target special effect information. In this embodiment, "first" and "second" are used to distinguish the current special effect information and the target special effect information to be adjusted. It can be understood that the first special effect information and the second special effect information can be the same or different, and there is no restriction on this.

[0094] Specifically, the second effect information is used to indicate the second display state of the scene effect in the cell area corresponding to the first effect vertex in the target effect cell. This second display state is usually different from the first display state described above.

[0095] In some embodiments of this invention, the display state of scene effects within a certain unit area may include display and non-display. In this case, the first display state may be display and the second display state may be non-display. When the first display state is non-display, the second display state may be display.

[0096] That is, after adjusting the first effect information of the effect vertex located inside the target scene unit of the target effect unit to the second effect information, the first effect vertex corresponds to the second effect information, and the second effect vertex corresponds to the first effect information. At this time, the second effect information corresponding to the first effect vertex and the first effect information corresponding to the second effect vertex are determined as the target effect information corresponding to the target effect unit.

[0097] like Figure 5 As shown, assuming the target scene unit is scene unit abcd in the scene mesh, its corresponding target effect units in the effect mesh include: effect unit efml, effect unit fghm, effect unit mhij and effect unit lmjk.

[0098] The special effect vertices corresponding to each target special effect unit include: special effect vertex e, special effect vertex f, special effect vertex g, special effect vertex h, special effect vertex i, special effect vertex j, special effect vertex k, special effect vertex l, and special effect vertex m; among them, special effect units efml, fghm, mhij, and lmjk share a special effect vertex m, and this special effect vertex m is located inside the target scene unit abcd. Therefore, special effect vertex m can be determined as the first special effect vertex, and special effect vertices e, f, g, h, i, j, k, and l can be determined as the second special effect vertex.

[0099] As shown in Table 1, Table 1 provides examples of the first and second special effects information corresponding to special effect vertices e to m.

[0100] Table 1. Examples of the first and second special effects information corresponding to special effect vertices e to m.

[0101] Special Effects Pinnacle First Special Effects Information Second Special Effects Information Special effects vertex e, 0 0 Special effects vertex f 0 0 Special effects vertex g 0 0 Special effects peak h 0 0 Special Effects Vertex i 0 0 Special effects vertex j 0 0 Special effects vertex k 0 0 Special Effects Top 0 0 Special effects vertex m 0 1

[0102] As shown in Table 1, if the first effect information corresponding to each effect vertex is 0, it means that no scene effect is currently displayed in each target effect unit. At this time, the first effect information of the first effect vertex m can be adjusted to the second effect information, that is, from 0 to 1. Then the target effect information corresponding to the effect unit efml is 0010, the target effect information corresponding to the effect unit fghm is 0001, the target effect information corresponding to the effect unit mhij is 1000, and the target effect information corresponding to the effect unit lmjk is 0100.

[0103] The methods for determining the target effect information shown in steps S123 to S125 above are merely examples and do not constitute specific limitations on this application.

[0104] Below, in conjunction with Figure 6 The application also provides a specific example to describe in detail the scene effects processing method provided in this application.

[0105] like Figure 6 As shown in (a), Figure 6 (a) provides a virtual scene that presents scene effects that are the primary visual impact, based on which Figure 6 In the virtual scene shown in (a), assuming the player applies an elimination operation to the target scene unit (i.e., the scene unit displaying the smiley face icon), this elimination operation removes the smiley face icon, making it invisible in the virtual scene. The triggering operation (such as multiple swipes, clicks, etc.) can then be described as follows: Figure 6 As shown in (b), four target effect units corresponding to the target scene unit are determined in the effect grid corresponding to the virtual scene (such as the four effect units shown in the black bold dashed box);

[0106] The effect information corresponding to each effect unit in the effect grid of the virtual scene that presents the first visual effect can be referred to... Figure 6 As shown in (c), the effect information corresponding to the aforementioned target effect units is currently 0000, 0000, 0010, and 0011. Based on this, the target effect information corresponding to each target effect unit can be further determined using the method for determining target effect information described above. That is, it can be done as follows: Figure 6 As shown in (d), the target effect information corresponding to each target effect unit can be 0010, 0001, 0110, and 1011, respectively, and the target texture corresponding to each target effect information is as follows. Figure 6 The effect textures in each target effect unit are shown in (d).

[0107] Based on this, effects can be rendered and generated according to the corresponding textures of each target effect unit, such as... Figure 6In the virtual scene shown in (e), the second effect of the scene effect is presented in the virtual scene. That is, after the smiley face icon is removed, the scene effect is generated in the scene unit to which the smiley face icon belongs, so that the effect of the scene effect in the virtual scene is adjusted from the first effect to the second effect.

[0108] The remaining implementation methods for scene effects provided in this application will be described in further detail below.

[0109] In some alternative implementations, step S140 described above can be specifically implemented through the following steps S141 to S143.

[0110] Step S141: Determine the first texture coordinates of the effect model corresponding to the target effect unit.

[0111] Step S142: Sample the target effect map corresponding to the target effect unit according to the first texture coordinates to obtain the first texture information.

[0112] Step S143: Render according to the first texture information to add the target effect texture to the effect model corresponding to the target effect unit.

[0113] The first texture coordinates of the effect model corresponding to the aforementioned target effect unit refer to the coordinate system used to map the texture information stored in the effect map to its corresponding two-dimensional patch model instance. Specifically, it is used to specify the position of each vertex on the surface of the two-dimensional patch model instance of the target effect unit in its corresponding effect map.

[0114] In an optional specific embodiment, the first texture coordinate of the special effect model corresponding to the target special effect unit may be the preset texture coordinate of the two-dimensional patch model preset for the special effect mesh. As described above, the two-dimensional patch model does not have a special effect texture.

[0115] It should be noted that, as described above, the special effects models corresponding to each special effects unit in the special effects mesh all reference the same two-dimensional patch model. Therefore, the first texture coordinates of the special effects models corresponding to each target special effects unit are the same. However, since the target special effects maps corresponding to each target special effects unit are different, the texture information of the special effects models corresponding to each target special effects unit can be different.

[0116] Based on the first texture coordinates of the effect model corresponding to each target effect unit, the target effect map corresponding to each target effect unit can be sampled, that is, the pixel value of the pixel at the corresponding position of the first texture coordinate in the target effect map can be obtained. These sampled pixel values ​​can constitute the first texture information corresponding to each target effect unit. Furthermore, rendering can be performed based on the first texture information, so that at least part of the effect texture stored in the target effect map can be applied to the surface of the effect model, so that the surface of the effect model has the target effect texture, thereby generating scene effects with the target performance style in the virtual scene.

[0117] The aforementioned first texture information can be used to indicate the texture display area and display color of the target effect texture on the surface of the effect model. The display color can be consistent with the color of the effect texture in the target effect map, which will not be described in detail here.

[0118] In some optional embodiments, a flowing effect can be further added to the effect texture on the surface of the effect model of the target effect unit. That is, the step S143 above, "rendering according to the first texture information to add the target effect texture to the effect model corresponding to the target effect unit", can be specifically implemented through the following steps S10 to S30.

[0119] Step S10: Determine the second texture coordinates of the effect model corresponding to the target effect unit. Different target effect units correspond to different effect models with different second texture coordinates.

[0120] Step S20 determines the effect flow information corresponding to the target effect unit based on the second texture coordinates and the flow field map corresponding to the scene effect. The flow field map is used to store the effect flow information of the scene effect.

[0121] Step S30: Render according to the special effect flow information and the first texture information to add the target special effect texture with a flow effect to the special effect model corresponding to the target special effect unit.

[0122] In this embodiment, the second texture coordinates of the special effects model corresponding to the target special effects unit are texture coordinates used for sampling flow information.

[0123] As described above, the first texture coordinates of the special effects models corresponding to different target special effects units are all the same. If different special effects models use the same first texture coordinates to sample the same preset flow field map, the sampling of flow information is limited to the same area in the flow field map, making the special effects texture flow effect of different target special effects units exactly the same. This is visually monotonous, lacks naturalness and dynamism, and reduces the realism of scene special effects.

[0124] Therefore, in this embodiment, the second texture coordinates of the special effect model corresponding to the target special effect unit are further determined, so that the second texture coordinates corresponding to different target special effect units are different. However, this embodiment does not exclude the case that the second texture coordinates corresponding to different target special effect units are the same.

[0125] The specific method for determining the second texture coordinates will be described later and will not be elaborated here.

[0126] The flowmaps corresponding to the aforementioned scene effects are pre-drawn based on the required flow effects of the scene effects. This flowmap is a two-dimensional image used to simulate the flow effects of surface textures on three-dimensional or two-dimensional models. For example, it can be used in games to implement fluid effects such as rivers, waves, waterfalls, flames, and fog.

[0127] The pixel values ​​of each pixel in the flow field map are used to indicate flow information such as flow direction and flow speed at the corresponding pixel position. That is, in this embodiment, the flow field map is used to store the flow information of scene effects. The flow field map will not be described in detail in this embodiment.

[0128] The above-mentioned determination of the special effect flow information corresponding to the target special effect unit based on the second texture coordinates and the flow field map corresponding to the scene special effect can specifically be to sample the flow field map based on the second texture coordinates, and further, to determine the special effect flow information of the target special effect unit based on the sampled pixel values. For example, the flow direction and flow speed of the special effect texture on the surface of the special effect model of the target special effect unit can be determined by the sampled pixel values.

[0129] The above-mentioned rendering is based on the special effect flow information and the first texture information. That is, special effect flow information is added to the first texture information so that the target special effect texture added to the surface of the special effect model has a flow effect, thereby generating scene special effects with dynamic and target expression style in the virtual scene.

[0130] In an optional specific embodiment, the step S10 above, "determining the second texture coordinates of the special effect model corresponding to the target special effect unit", can be specifically implemented through the following steps S11 to S12.

[0131] Step S1: Obtain the cell coordinates of the target effect unit in the effect grid;

[0132] Step S2: Obtain the preset texture coordinates of the 2D patch model corresponding to the special effects mesh; the 2D patch model is a special effects model without special effects texture;

[0133] Step S3: Determine the second texture coordinates of the target effect unit based on the preset texture coordinates and cell coordinates.

[0134] As described in the text, the special effects models corresponding to each special effects unit all reference the model data of the same two-dimensional patch model. Therefore, the second texture coordinates of each special effects model can be calculated based on the preset texture coordinates of the two-dimensional patch model it references.

[0135] The cell coordinates of the target effect unit in the effect grid can be understood as the row and column coordinates of the target effect unit in the effect grid, that is, indicating the row and column coordinates of the target effect unit in the effect grid. For example... Figure 6 As shown in (b), the cell coordinates of the four target effect grids are (2,3), (2,4), (3,3), and (3,4), respectively. (2,3) indicates that a target effect unit is located in the second row and third column of the effect grid, (2,4) indicates that a target effect unit is located in the second row and fourth column of the effect grid, (3,3) indicates that a target effect unit is located in the third row and third column of the effect grid, and (3,4) indicates that a target effect unit is located in the third row and fourth column of the effect grid.

[0136] In an optional specific embodiment, when the cell coordinates of the target effect unit in the effect grid and the preset texture coordinates of the two-dimensional patch model are known, the second texture coordinates corresponding to each target effect unit can be calculated by the following formulas (1) and (2).

[0137] UV [u] =UV.u×rcp(m)+coord.x×rcp(m) (Formula 1)

[0138] UV [v] =UV.v×rcp(m)+0.5+(coord.y-0.5n)×rcp(m) (Formula 2)

[0139] Formula (1) is used to calculate the horizontal texture coordinate U in the second texture coordinates of each target effect unit; UV [u] This refers to the horizontal texture coordinates in the second texture coordinates of the target effect unit; UV.u represents the horizontal texture coordinates in the preset texture coordinates of the 2D patch model; rcp(m) is the scaling factor used to scale the preset texture coordinates of the 2D patch model, rcp(m) is 1 / m, and m is the number of columns in the effect mesh, that is, the number of effect units in the horizontal direction in the effect mesh; UV.U×rcp(m) is used to evenly distribute the horizontal texture coordinates in the preset texture coordinates of the 2D patch model in m equally divided intervals, that is, to evenly distribute the horizontal texture coordinates in the preset texture coordinates of the 2D patch model in each effect unit; coord.x is the x component used to characterize the cell coordinates of each effect unit.

[0140] Formula (2) is used to calculate the vertical texture coordinate V in the second texture coordinates of each target effect unit. Wherein, UV... [v] This refers to the vertical texture coordinate in the second texture coordinate of the target effect unit; UV.v represents the vertical texture coordinate in the preset texture coordinate of the two-dimensional patch model; coord.y is the y component in the cell coordinate of each effect cell; n represents the number of rows in the effect grid and the number of effect units in the vertical direction in the effect grid.

[0141] By using formulas (1) and (2), the preset texture coordinates of the two-dimensional patch model can be scaled and offset, so that the second texture coordinates of the effect model of each target effect unit occupy different areas in the flow field map. That is, it ensures that the second texture coordinates of each target effect unit are evenly distributed in the flow field map, making full use of the resolution of the flow field map, and then generating different second texture coordinates for different target effect units. This facilitates the subsequent sampling of flow information in different areas of the same flow field map, thereby generating diverse flow effects for multiple target effect units, enriching the visual flow effect of scene effects, and generating more stylized scene effects.

[0142] In some optional embodiments, the step S30 above, "rendering according to the special effect flow information and the first texture information to add the target special effect texture with a flow effect to the special effect model corresponding to the target special effect unit", can be specifically implemented through the following steps S31 to S33.

[0143] Step S31: Based on the special effect flow information, control the first texture coordinates to offset, and obtain the offset first texture coordinates;

[0144] Step S32: Sample the target effect map corresponding to the target effect unit according to the offset first texture coordinates to obtain the first texture information with a flowing effect;

[0145] Step S33: Render according to the first texture information with a flowing effect to add the target effect texture with a flowing effect to the effect model corresponding to the target effect unit.

[0146] As described above, the flow information of the special effects can include the flow direction and flow speed. Therefore, based on the flow direction and flow speed of each pixel in the sampled two-dimensional patch model, combined with the time node, the first texture coordinates corresponding to each pixel can be shifted according to the corresponding flow direction and flow speed to obtain the shifted first texture coordinates corresponding to different time nodes.

[0147] By sampling the target effect texture based on the offset first texture coordinates corresponding to each time node, the first texture information that changes with the time node can be obtained, that is, the first texture information with a flowing effect can be obtained. Then, the first texture information with a flowing effect is rendered to generate the target effect texture with a flowing effect on the surface of the effect model corresponding to the target effect unit, thereby generating the scene effect with a flowing effect in each target scene unit in the virtual scene.

[0148] It should be noted that in this embodiment, when adding flow effects to the target effect textures on the surface of the effect models corresponding to different target effect units, the flow information of the effect is sampled through the same flow field map. In this way, only one flow field map can be stored, reducing the memory usage of electronic devices. In addition, it can ensure that the visual flow style of the target effect textures on the surface of the effect models in different effect units is consistent, which can improve the consistency of the flow performance of scene effects in virtual scenes.

[0149] In some optional embodiments, in addition to adding a flow effect to the second special effect texture, the target color and texture repetition of the target special effect texture to be added to the surface of the special effect model corresponding to the target special effect unit can be further adjusted. That is, the step S30 above, "rendering according to the special effect flow information and the first texture information to add the target special effect texture with a flow effect to the special effect model corresponding to the target special effect unit", can be specifically implemented through the following steps S34 to S36.

[0150] Step S34: Based on the special effect flow information, control the second texture coordinates to offset, and obtain the offset second texture coordinates.

[0151] Step S35: Sample the base color map corresponding to the scene effect according to the offset second texture coordinates to obtain the second texture information with the effect flow information; the second texture information is used to indicate the target color of the second effect texture.

[0152] Step S36: Render according to the first texture information and the second texture information with a flowing effect, so as to add the target effect texture with a flowing effect and the target color to the effect model corresponding to the target effect unit.

[0153] It should be noted that the purpose of steps S34 to S36 is to use a preset base color map to unify the target color of the special effects textures to be added to the surface of each special effects model, so that the style of the target color of the special effects textures on the surface of each special effects unit is consistent, and further refine the detail of the special effects textures on the surface of each special effects model, reduce the sense of repetition caused by the limited special effects textures provided by the limited special effects map, and increase the detail level of the target special effects textures on the surface of each special effects model.

[0154] The base color map corresponding to the above scene effects is used to define the target color of the surface of each effect model. This target color can further affect the texture visual effect of the surface texture of each effect model.

[0155] In this embodiment, the second texture coordinates of the effect model of each target effect unit can be shifted according to the flow direction and flow speed corresponding to different time nodes using the special effect flow information, resulting in the shifted second texture coordinates at different time nodes. Then, the shifted second texture coordinates can be used to sample a preset base color map to obtain second texture information that changes with time nodes, i.e., second texture information with a flow effect. Thus, during the rendering process, the sampled second texture information with a flow effect is fused with the first texture information used to indicate the display area of ​​the second special effect texture to be generated, so as to add a target special effect texture with a flow effect and a target color to the effect model corresponding to the target effect unit. It can be understood that the target color is the color obtained by superimposing the color in the first texture information and the color in the second texture information.

[0156] It is important to note that, as described above regarding the calculation process of the second texture coordinates, the second texture coordinates can occupy different texture areas on the same base color map. That is, the second texture coordinates corresponding to each target effect unit are evenly distributed on the same base color map. Therefore, the effect models of different target effect units can sample the color information of different areas on the same flow field map, thereby producing diverse color effects for multiple target effect units, enriching the visual texture effects of scene effects, and generating more stylized scene effects.

[0157] It should be noted that in this embodiment, when adjusting the target color of the effect texture on the surface of the effect model corresponding to different target effect units, the second texture information is sampled through the same base color map. In this way, only one base color map can be stored, reducing the memory usage of electronic devices. In addition, it can ensure that the color style of the second effect texture on the surface of the effect model in different effect units is consistent, which can improve the consistency of the visual performance of scene effects in virtual scenes.

[0158] The method provided in this embodiment has been described above. The scene effect processing method provided in this application utilizes the stylized representation of effect textures stored in each effect texture map within a preset set of effect texture maps. Therefore, after adding target effect textures to the effect models in each target effect unit according to the target effect texture map, the surface texture of the effect models in the target effect unit exhibits the aforementioned stylized representation. For example, the edges of the surface texture of the effect model exhibit the aforementioned stylized representation, thereby making the edges of the scene effects generated in the virtual scene more natural and delicate. This avoids the problems of straight bevels and texture repetition in the edges of effect effects generated in related technologies. Furthermore, when the stylized effect textures stored in the target effect texture map have different texture densities or different transparency in different areas, scene effects with richer visual effects can be generated.

[0159] Meanwhile, since the textures of adjacent effect maps in the preset effect map set can be seamlessly connected at adjacent boundaries, after adjusting the surface texture of the effect model in each target effect unit according to each effect map in the effect map set, the effect textures of the effect models in each adjacent effect unit in the effect mesh can transition smoothly, thus making the visual performance of the scene effects generated in the virtual scene more delicate.

[0160] In addition, flow effects and / or target colors can be added to the surface textures of the effect models of different effect units respectively. Compared with the existing technology that uses the entire rendering target for rendering, the scene effect processing method provided in this application is more flexible and can adjust only the surface textures of the effect models corresponding to the effect units of the scene units to be adjusted.

[0161] It should be noted that in each of the attached figures, the same pattern represents the same element. Therefore, each pattern is labeled and introduced when it first appears, and although it is not labeled when it appears in subsequent attached figures, the introduction in the attached figures can be referred to.

[0162] Corresponding to the scene effect processing method provided in the embodiments of this application, the embodiments of this application also provide a scene effect processing device 1000, such as... Figure 7 As shown, the device 1000 includes: a determining unit 1001, an acquiring unit 1002, and a generating unit 1003;

[0163] The determining unit 1001 is used to determine multiple target scene units of scene effects to be processed in a virtual scene, and the special effect grid corresponding to the virtual scene. The special effect grid includes multiple special effect units, and the scene effects in the virtual scene present a first performance effect.

[0164] The determining unit 1001 is further configured to determine the target special effect unit corresponding to the target scene unit in the plurality of special effect units, and the target special effect information corresponding to the target special effect unit; the target special effect information is used to indicate the target display area of ​​the scene special effect in the special effect unit;

[0165] The acquisition unit 1002 is further configured to acquire the target effect map corresponding to the target effect information in a preset effect map set; wherein, the effect map set includes different effect maps corresponding to different target effect information, and the effect map is used to store stylized effect textures;

[0166] The generation unit 1003 is used to add target effect textures to the effect model corresponding to the target effect unit according to the target effect texture map, so as to render and generate the scene effect with the target performance style in the virtual scene; the target performance style matches the style of the effect texture stored in the target effect texture map.

[0167] Optionally, in the special effects mesh, the similarity of pixel values ​​of the special effects textures corresponding to the target special effects information of adjacent special effects units on adjacent boundaries is greater than a preset similarity.

[0168] Optionally, one of the target scene units includes multiple scene vertices;

[0169] The determining unit 1001 is specifically used to determine the scene vertex of the target scene unit for each target scene unit; and to determine the special effect unit with the scene vertex as the geometric center as the target special effect unit corresponding to the target scene unit among the multiple special effect units.

[0170] Optionally, one of the special effects units includes multiple special effects vertices, each of the special effects vertices corresponding to first special effects information; the first special effects information is used to indicate the first display state of the scene special effects in the unit area corresponding to the special effects vertex in the special effects unit;

[0171] The determining unit 1001 is specifically used to determine a first effect vertex among a plurality of effect vertices of the target effect unit; the first effect vertex is located inside the target scene unit corresponding to the target effect unit; the first effect information corresponding to the first effect vertex is adjusted to second effect information; the second effect information is used to indicate the second display state of the scene effect in the unit area corresponding to the first effect vertex in the target effect unit; the second effect information corresponding to the first effect vertex and the first effect information corresponding to the second effect vertex are determined as the target effect information corresponding to the target effect unit; the second effect vertex is located outside the target scene unit corresponding to the target effect unit.

[0172] Optionally, the generation unit 1003 is specifically used to determine the first texture coordinates of the effect model corresponding to the target effect unit; sample the target effect map corresponding to the target effect unit according to the first texture coordinates to obtain first texture information; and render according to the first texture information to add the target effect texture to the effect model corresponding to the target effect unit; the texture features of the target effect texture are at least partially the same as the texture features of the effect texture stored in the target effect map.

[0173] Optionally, the generation unit 1003 is further configured to determine the preset texture coordinates corresponding to the preset two-dimensional patch model as the first texture coordinates of the special effect model corresponding to the target special effect unit; the two-dimensional patch model is the special effect model without special effect texture.

[0174] Optionally, the generation unit 1003 is specifically used to determine the second texture coordinates of the effect model corresponding to the target effect unit; different effect models corresponding to different target effect units have different second texture coordinates; based on the second texture coordinates and the flow map corresponding to the scene effect, the effect flow information corresponding to the target effect unit is determined, and the flow map is used to store the effect flow information of the scene effect; rendering is performed based on the effect flow information and the first texture information to add the target effect texture with a flow effect to the effect model corresponding to the target effect unit.

[0175] Optionally, the generation unit 1003 is further configured to obtain the cell coordinates of the target effect unit in the effect grid; obtain the preset texture coordinates of the two-dimensional patch model corresponding to the effect grid; the two-dimensional patch model is the effect model without effect texture; and determine the second texture coordinates of the target effect unit based on the preset texture coordinates and the cell coordinates.

[0176] Optionally, the generation unit 1003 is specifically configured to: control the first texture coordinates to be offset according to the special effect flow information to obtain the offset first texture coordinates; sample the target special effect map corresponding to the target special effect unit according to the offset first texture coordinates to obtain the first texture information with the flow effect; and render according to the first texture information with the flow effect to add the target special effect texture with the flow effect to the special effect model corresponding to the target special effect unit.

[0177] Optionally, the generation unit 1003 is specifically used to control the second texture coordinates to be offset according to the special effect flow information to obtain the offset second texture coordinates; to sample the base color map corresponding to the scene special effect according to the offset second texture coordinates to obtain second texture information with a flow effect; the second texture information is used to indicate the target color of the second special effect texture; and to render according to the first texture information and the second texture information with a flow effect to add the target special effect texture with a flow effect and the target color to the special effect model corresponding to the target special effect unit.

[0178] Optionally, the determining unit 1001 is specifically used to obtain the vertex positions and scene unit sizes of each scene unit corresponding to the virtual scene; using the vertex positions as the center positions of the special effects units to be generated, and the scene unit sizes of the scene units as the special effects unit sizes of the special effects units to be generated, multiple special effects units are generated to obtain the special effects mesh.

[0179] Corresponding to the scene effects processing method provided in the embodiments of this application, the embodiments of this application also provide an electronic device 2000 for implementing the scene effects processing method, such as... Figure 8 As shown, the electronic device 2000 includes: a processor 2001; and a memory 2002 for storing a program for processing scene effects. After the device is powered on and the program for processing scene effects is run by the processor, it can execute the method steps in any of the embodiments of the above-described method for processing scene effects. For example, the following steps can be executed:

[0180] Multiple target scene units to be processed in a virtual scene are identified, as well as the special effects grid corresponding to the virtual scene. The special effects grid includes multiple special effects units, and the scene special effects in the virtual scene present a first performance effect.

[0181] The target scene unit is determined to correspond to the target effect unit among the plurality of effect units, and the target effect information corresponding to the target effect unit is determined; the target effect information is used to indicate the target display area of ​​the scene effect in the effect unit;

[0182] Obtain the target effect map corresponding to the target effect information in a preset effect map set; wherein, the effect map set includes different effect maps corresponding to different target effect information, and the effect map is used to store stylized effect textures;

[0183] Based on the target effect map, a target effect texture is added to the effect model corresponding to the target effect unit to render and generate the scene effect with the target performance style in the virtual scene; the target performance style matches the style of the effect texture stored in the target effect map.

[0184] Corresponding to the scene effect processing method provided in the embodiments of this application, the embodiments of this application also provide a computer-readable storage medium storing a program for the scene effect processing method. This program is executed by a processor and can perform the method steps as described in any of the method embodiments of the above-described scene effect processing method. For example, it can perform the following steps:

[0185] Multiple target scene units to be processed in a virtual scene are identified, as well as the special effects grid corresponding to the virtual scene. The special effects grid includes multiple special effects units, and the scene special effects in the virtual scene present a first performance effect.

[0186] The target scene unit is determined to correspond to the target effect unit among the plurality of effect units, and the target effect information corresponding to the target effect unit is determined; the target effect information is used to indicate the target display area of ​​the scene effect in the effect unit;

[0187] Obtain the target effect map corresponding to the target effect information in a preset effect map set; wherein, the effect map set includes different effect maps corresponding to different target effect information, and the effect map is used to store stylized effect textures;

[0188] Based on the target effect map, a target effect texture is added to the effect model corresponding to the target effect unit to render and generate the scene effect with the target performance style in the virtual scene; the target performance style matches the style of the effect texture stored in the target effect map.

[0189] It should be noted that for a detailed description of the apparatus, electronic device and computer-readable storage medium provided in the embodiments of this application, please refer to the relevant description of the scene effect processing method embodiments provided in the embodiments of this application, which will not be repeated here.

[0190] Although this application discloses preferred embodiments as described above, it is not intended to limit this application. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of this application. Therefore, the scope of protection of this application should be determined by the scope defined in the claims of this application.

[0191] In a typical configuration, an electronic device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0192] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0193] 1. Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable operations, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include non-transitory computer-readable media, such as modulated data signals and carrier waves.

[0194] 2. Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0195] Although this application discloses preferred embodiments as described above, it is not intended to limit this application. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of this application. Therefore, the scope of protection of this application should be determined by the scope defined in the claims of this application.

Claims

1. A method of processing a scene effect, characterized by, The method comprises: determining a plurality of target scene units of a scene effect to be processed in a virtual scene, and a special effect grid corresponding to the virtual scene, the special effect grid comprising a plurality of special effect units; determining a target special effect unit corresponding to the target scene unit in the plurality of special effect units, and target special effect information corresponding to the target special effect unit; the target special effect information is used to indicate a target display area of the scene effect in the special effect unit; obtaining a target special effect map corresponding to the target special effect information in a preset special effect map set; wherein the special effect map set comprises different special effect maps corresponding to different target special effect information respectively, and the special effect map is used to store stylized special effect textures; adding a target special effect texture to a special effect model corresponding to the target special effect unit according to the target special effect map, so as to render the scene effect with a target performance style in the virtual scene; the target performance style matches the style of the special effect texture stored in the target special effect map; one of the target scene units comprises a plurality of scene vertices; the determination of the target special effect unit corresponding to the target scene unit in the plurality of special effect units comprises: determining the scene vertices of the target scene unit for each target scene unit; determining a special effect unit with the scene vertices as the geometric center as the target special effect unit corresponding to the target scene unit in the plurality of special effect units.

2. The method of claim 1, wherein, In the special effect grid, the similarity of the pixel values of the special effect maps corresponding to the target special effect information of adjacent special effect units on the adjacent boundaries is greater than a preset similarity.

3. The method according to claim 1 or 2, characterized in that, one of the special effect units comprises a plurality of special effect vertices, and each of the special effect vertices corresponds to first special effect information; the first special effect information is used to indicate a first display state of the scene effect in a unit area corresponding to the special effect vertex in the special effect unit; determining the target special effect information corresponding to the target special effect unit comprises: determining a first special effect vertex in a plurality of special effect vertices of the target special effect unit; the first special effect vertex is located inside the target scene unit corresponding to the target special effect unit; adjusting the first special effect information corresponding to the first special effect vertex to second special effect information; the second special effect information is used to indicate a second display state of the scene effect in a unit area corresponding to the first special effect vertex in the target special effect unit; determining the second special effect information corresponding to the first special effect vertex and the first special effect information corresponding to a second special effect vertex as the target special effect information corresponding to the target special effect unit; the second special effect vertex is located outside the target scene unit corresponding to the target special effect unit.

4. The method of claim 3, wherein, the adding of the target special effect texture to the special effect model corresponding to the target special effect unit according to the target special effect map comprises: determining a first texture coordinate of the special effect model corresponding to the target special effect unit; sampling the target special effect map corresponding to the target special effect unit according to the first texture coordinate to obtain first texture information; According to the first texture information, rendering is performed to add the target special effect texture to the special effect model corresponding to the target special effect unit; and texture features of the target special effect texture are at least partially same as texture features of the special effect texture stored in the target special effect map.

5. The method of claim 4, wherein, The first texture coordinate of the target special effect unit is determined by: The preset texture coordinate corresponding to the two-dimensional patch model is determined as the first texture coordinate of the special effect model corresponding to the target special effect unit; and the two-dimensional patch model is the special effect model without special effect texture.

6. The method of claim 4, wherein, According to the first texture information, rendering is performed to add the target special effect texture to the special effect model corresponding to the target special effect unit; and texture features of the target special effect texture are at least partially same as texture features of the special effect texture stored in the target special effect map. The second texture coordinate of the target special effect unit is determined by: The second texture coordinates of the special effect models corresponding to different target special effect units are different; According to the second texture coordinate and the flow field map corresponding to the scene special effect, special effect flow information corresponding to the target special effect unit is determined; and the flow field map is used to store special effect flow information of the scene special effect; 7. The method of claim 6, wherein, According to the special effect flow information and the first texture information, rendering is performed to add the target special effect texture with flow effect to the special effect model corresponding to the target special effect unit. The second texture coordinate of the target special effect unit is determined by: The cell coordinate of the target special effect unit in the special effect grid is obtained; The preset texture coordinate of the two-dimensional patch model corresponding to the special effect grid is obtained; and the two-dimensional patch model is the special effect model without special effect texture; 8. The method of claim 6, wherein, According to the preset texture coordinate and the cell coordinate, the second texture coordinate of the target special effect unit is determined. According to the special effect flow information and the first texture information, rendering is performed to add the target special effect texture with flow effect to the special effect model corresponding to the target special effect unit. According to the special effect flow information, the first texture coordinate is controlled to be offset to obtain an offset first texture coordinate; According to the offset first texture coordinate, the target special effect map corresponding to the target special effect unit is sampled to obtain the first texture information with the flow effect; 9. The method of claim 6, wherein, According to the first texture information with the flow effect, rendering is performed to add the target special effect texture with flow effect to the special effect model corresponding to the target special effect unit. According to the special effect flow information, the second texture coordinate is controlled to be offset to obtain an offset second texture coordinate; According to the offset second texture coordinate, the base color map corresponding to the scene special effect is sampled to obtain second texture information with flow effect; and the second texture information is used to indicate a target color of a second special effect texture. Render according to the first texture information and the second texture information with flow effect, to add the target special effect texture with flow effect and with the target color to the special effect model corresponding to the target special effect unit.

10. The method of claim 1, wherein, The step of determining the special effect grid corresponding to the virtual scene comprises: Obtaining the vertex position of each scene unit corresponding to the virtual scene and the scene unit size; Taking the vertex position as the center position of the special effect unit to be generated and taking the scene unit size of the scene unit as the special effect unit size of the special effect unit to be generated, a plurality of special effect units are generated to obtain the special effect grid.

11. A processing apparatus of a special effect of a scene, characterized by, The device comprises a determination unit, an acquisition unit and a generation unit. The determination unit is configured to determine a plurality of target scene units of a scene special effect to be processed in a virtual scene, and a special effect grid corresponding to the virtual scene, wherein the special effect grid comprises a plurality of special effect units, and the scene special effect in the virtual scene presents a first performance effect. The determination unit is further configured to determine target special effect units corresponding to the target scene units in the plurality of special effect units, and target special effect information corresponding to the target special effect units; the target special effect information is used to indicate a target display area of the scene special effect in the special effect unit. The acquisition unit is further configured to acquire a target special effect map corresponding to the target special effect information in a preset special effect map set; wherein the special effect map set comprises different special effect maps corresponding to different target special effect information respectively, and the special effect map is used to store stylized special effect texture. The generation unit is configured to add target special effect texture to a special effect model corresponding to the target special effect unit according to the target special effect map, so as to render and generate the scene special effect with a target performance style in the virtual scene; the target performance style matches the style of the special effect texture stored in the target special effect map. One of the target scene units comprises a plurality of scene vertices; the determination of the target special effect units corresponding to the target scene units in the plurality of special effect units comprises: For each of the target scene units, the scene vertices of the target scene unit are determined; The special effect unit with the scene vertices as the geometric center is determined as the target special effect unit corresponding to the target scene unit in the plurality of special effect units.

12. An electronic device, comprising: Comprise: A processor; And A memory for storing a data processing program, after the electronic device is powered on and the program is run by the processor, the method in any one of claims 1-10 is executed.

13. A computer-readable storage medium, characterized in that, A data processing program is stored, and the program is run by the processor to execute the method in any one of claims 1-10.

Citation Information

Patent Citations

  • Special effect processing method, device and equipment and storage medium

    CN110354500A

  • Special effect image drawing method and device, equipment and medium

    CN115578495A