Picture generation method and device, storage medium, electronic device and computer program product

By obtaining and processing target composite maps in a virtual scene and rendering fragmentation special effects in light source information, the problems of high cost of fragmentation special effects production and strong scene limitations in the existing technology are solved, and efficient and low-cost fragmentation special effects are achieved generate.

CN119406054APending Publication Date: 2025-02-11NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411420186.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-11
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

The existing technology has high cost and strong scene limitations when producing fragmented special effects, making it difficult to achieve realistic and delicate and realistic visual expressions.

Method used

By obtaining the target composite map of the virtual scene, performing highly offset mixed sampling, combining the target light source information to determine the visual representation parameters of the fragmentation special effect, and then rendering the fragmentation special effect in the area to be generated.

Benefits of technology

It realizes the generation of fragmentation special effects containing concave and convex effects at a lower cost, improves scene applicability and rendering efficiency, and ensures the mimicry of fragmentation special effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119406054A_ABST
    Figure CN119406054A_ABST
Patent Text Reader

Abstract

The invention discloses a picture generation method and device, a storage medium, an electronic device and a computer program product. The method comprises the steps that a target composite map corresponding to a virtual scene is acquired, and the target composite map is used for representing surface concave-convex information of a to-be-generated area corresponding to a fragmentation special effect; performing height offset mixed sampling on the target composite map to obtain a target sampling result; according to the target sampling result and target light source information, visual performance parameters corresponding to the fragmentation special effect are determined, and the target light source information is determined by the current visual angle of a virtual camera in the virtual scene; and based on the visual performance parameter, rendering the fragmentation special effect in the to-be-generated region to obtain a target scene picture. According to the method and the device, the technical problems of high cost and relatively strong scene limitation of the manufacturing scheme of the fragmented special effect picture containing the concave-convex effect in the related technology are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and more specifically, to a screen generation method, device, storage medium, electronic device, and computer program product. Background Art

[0002] In the current development of games and virtual reality projects, the production of fragmentation effects is a common requirement, which aims to enhance the realism and immersion of the scene through visual performance. However, the existing fragmentation effect production technology faces a series of challenges, which limits the application and performance of fragmentation effect production solutions in complex scenes.

[0003] In the related art, a commonly used solution is to use patch particles to produce fragmentation effects. For example, Parallax Occlusion Mapping (POM) is used to simulate the concave and convex feeling of the fragmentation surface. Although the sense of height of the fragmentation effect can be produced to a certain extent, the effect is often too exaggerated and it is difficult to obtain a delicate and realistic visual performance. Another commonly used solution is to use cubemaps to simulate the fragmentation space. Although it can present the depth of the space under the fragmentation surface to a certain extent, the application scope of this solution is limited by the performance of cubemaps, and it cannot show the complex crack details in the fragmentation effect. In addition, the template test solution can also accurately control the rendering area and rendering effect of the fragmentation effect, but the production process is very complicated and requires technicians to perform a lot of manual adjustments and optimizations.

[0004] As can be seen from the above, how to produce a more realistic fragmentation effect at a lower cost has become one of the important technical issues in the technical field related to image generation. Currently, no effective solution has been proposed for the above problem.

[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0006] At least some embodiments of the present application provide a method, device, storage medium, electronic device and computer program product for generating a picture, so as to at least solve the technical problems in the related art of high cost and strong scene limitation of the production scheme of fragmented special effects pictures including concave and convex effects.

[0007] According to one embodiment of the present application, a picture generation method is provided, including: obtaining a target composite map corresponding to a virtual scene, wherein the target composite map is used to characterize the surface convexity and concave information of an area to be generated corresponding to a fragmentation special effect; performing height-offset mixed sampling on the target composite map to obtain a target sampling result; using the target sampling result and target light source information to determine visual performance parameters corresponding to the fragmentation special effect, wherein the target light source information is determined by the current viewing angle of a virtual camera in the virtual scene; based on the visual performance parameters, rendering the fragmentation special effect in the area to be generated to obtain a target scene picture.

[0008] According to one embodiment of the present application, a picture generating device is also provided, including: an acquisition module, used to acquire a target composite map corresponding to a virtual scene, wherein the target composite map is used to characterize the surface convexity information of the area to be generated corresponding to the fragmentation special effect; a sampling module, used to perform height-offset mixed sampling on the target composite map to obtain a target sampling result; a calculation module, used to determine the visual performance parameters corresponding to the fragmentation special effect using the target sampling result and target light source information, wherein the target light source information is determined by the current viewing angle of the virtual camera in the virtual scene; a generation module, used to render the fragmentation special effect in the area to be generated based on the visual performance parameters to obtain a target scene picture.

[0009] According to one embodiment of the present application, a computer-readable storage medium is further provided, in which a computer program is stored, wherein the computer program is configured to execute any of the above-mentioned screen generation methods when running.

[0010] According to one embodiment of the present application, an electronic device is also provided, including: a memory and a processor, the memory stores a computer program, and the processor is configured to run the computer program to execute any of the above-mentioned screen generation methods.

[0011] One embodiment further provides a computer program product, including a computer program, which implements any of the above screen generation methods when executed by a processor.

[0012] In at least some embodiments of the present application, a target composite map corresponding to a virtual scene is obtained, wherein the target composite map is used to characterize the surface concave-convex information of the area to be generated corresponding to the fragmentation special effect; a target composite map is subjected to a height offset mixed sampling to obtain a target sampling result; a visual performance parameter corresponding to the fragmentation special effect is determined using the target sampling result and the target light source information, wherein the target light source information is determined by the current viewing angle of the virtual camera in the virtual scene; based on the visual performance parameter, the fragmentation special effect is rendered in the area to be generated to obtain a target scene screen. Thus, the present application generates the fragmentation special effect of the corresponding area based on the surface concave-convex information, which has a lower cost and less limitation on application in different scenes than the solution of directly using surface particles to produce special effects. That is to say, the present application achieves the purpose of generating a scene screen of a fragmentation special effect containing a concave-convex effect at a lower cost, thereby achieving the technical effect of improving the scene applicability and reducing the cost of the fragmentation special effect screen generation solution while ensuring the realism of the fragmentation special effect screen, thereby solving the technical problem that the production solution of the fragmentation special effect screen containing a concave-convex effect in the related art is high in cost and has strong scene limitations. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0014] Figure 1 It is a hardware structure block diagram of a mobile terminal according to a screen generation method of one embodiment of the present application;

[0015] Figure 2 is a flow chart of a screen generation method according to one embodiment of the present application;

[0016] Figure 3 is a schematic diagram of an optional height map according to one embodiment of the present application;

[0017] Figure 4 is a schematic diagram of an optional normal map according to one embodiment of the present application;

[0018] Figure 5 is a schematic diagram of an optional blurred height map according to one embodiment of the present application;

[0019] Figure 6 is a schematic diagram of an optional target composite map according to one embodiment of the present application;

[0020] Figure 7 is a schematic diagram of an optional target color map according to one embodiment of the present application;

[0021] Figure 8 is a schematic diagram of an optional target scene screen according to one embodiment of the present application;

[0022] Fig. 9 is a structural block diagram of a picture generating device according to one embodiment of the present application;

[0023] Fig.10 is a schematic diagram of an electronic device according to one embodiment of the present application. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0026] It should be noted that, in the specification of the present application, the word "for example" is used to mean "used as an example, illustration or description". Any embodiment described as "for example" in the present application is not necessarily interpreted as being more preferred or more advantageous than other embodiments. In order to enable any technician in the field to implement and use the present application, the following description is given. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present application can be implemented without using these specific details. In other examples, well-known structures and processes will not be elaborated in detail to avoid unnecessary details that make the description of the present application obscure. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest range of principles and features disclosed in the present application.

[0027] In the process of describing the embodiments of the present application, some nouns or terms that appear are subject to the following explanations.

[0028] Linear Interpolation (Lerp) function: used to make a smooth transition between two values. The calculation result of the Lerp function can be expressed as Lerp(A, B, Alpha), where the value of Alpha is used to assign the interpolation ratio between the values ​​A and B. For example, when Alpha is 1, the output value of the Lerp function is B; when Alpha is 0, the output value of the Lerp function is A; when Alpha is 0.5, the output value of the Lerp function is the sum of A×0.5 and B×0.5. In computer graphics and game development, the Lerp function can be used to achieve animation effects, smooth movement, and color gradients.

[0029] Absolute value (Abs) function: refers to a function used to obtain the absolute value or unsigned value corresponding to the input value.

[0030] Target shader (Surf Shader) file: can include a first shader file (recorded as surf file) and a second shader file (recorded as hlsl file), wherein the surf file is used to define the surface shader, and the code contained in the surf file is used to describe the performance of the object in terms of lighting, shadows, and texture mapping. The hlsl file is used to define the pixel shader (pixel shader) and the vertex shader (vertex shader). The high-level shading language (HighLevel Shader Language) code contained in the hlsl file is used to more finely control the rendering effect of the object (such as color, lighting, shadows, reflections, etc.).

[0031] Material (MTL) file: can reference the target shader file and adjust the parameters exposed by the target shader file to make the rendering result show different material effects.

[0032] In a possible implementation of the present application, with respect to the production scheme based on patch particles or the production scheme based on cubemaps commonly used in the scene image generation involving the scene image generation including the rupture special effects in the field of computer technology, after practice and careful research, the inventor still finds that the production cost is too high, the scene is relatively limited, or the visual performance of the special effects is poor. Based on this, the embodiment of the present application proposes a method for image generation, by obtaining a target composite map corresponding to the virtual scene, the target composite map is used to characterize the surface concave-convex information of the area to be generated corresponding to the shattered special effects, and further performing height offset mixed sampling on the target composite map to obtain a target sample. As a result, the target sampling result and the target light source information are then used to determine the visual performance parameters corresponding to the fragmentation special effect. The target light source information is determined by the current viewing angle of the virtual camera in the virtual scene. Then, based on the visual performance parameters, the fragmentation special effect is rendered in the area to be generated to obtain the target scene picture, thereby achieving the purpose of generating a scene picture of the fragmentation special effect including a concave and convex effect at a lower cost, thereby achieving the technical effect of improving the scene applicability of the fragmentation special effect picture generation solution and reducing the cost while ensuring the realism of the fragmentation special effect picture, thereby solving the technical problems in the related technology of the high cost and strong scene limitation of the production solution of the fragmentation special effect picture including concave and convex effect.

[0033] The above method embodiments involved in this application can be executed in a terminal device (for example, a mobile terminal, a computer terminal or a similar computing device). Taking running on a mobile terminal as an example, the mobile terminal can be a smart phone, a tablet computer, a PDA, a mobile Internet device, a game console and other terminal devices.

[0034] Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal according to a method for generating a screen in one embodiment of the present application. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 (only one is shown in the figure) processor 102, memory 104, transmission device 106, input / output device 108 and display device 110. Taking the screen generation method applied to an electronic game scene through the mobile terminal as an example, the processor 102 calls and runs the computer program stored in the memory 104 to execute the screen generation method, and the target scene screen containing the cracking special effect in the generated electronic game scene is transmitted to the input / output device 108 and / or the display device 110 through the transmission device 106, and then the target scene screen is provided to the player.

[0035] Still like Figure 1As shown, the processor 102 may include but is not limited to: a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processing (DSP) chip, a microcontroller unit (MCU), a programmable logic device (Field Programmable Gate Array, FPGA), a neural network processor (Neural-Network Processing Unit, NPU), a tensor processor (Tensor Processing Unit, TPU), an artificial intelligence (Artificial Intelligence, AI) type processor and other processing devices.

[0036] Those skilled in the art will understand that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0037] In some optional embodiments mainly based on game scenarios, the above-mentioned terminal device can also provide a human-computer interaction interface with a touch-sensitive surface, which can sense finger contact and / or gestures to perform human-computer interaction with a graphical user interface (Graphical User Interface, GUI). The human-computer interaction function may include the following interactions: creating web pages, drawing, word processing, making electronic documents, games, video conferencing, instant messaging, sending and receiving emails, call interface, playing digital videos, playing digital music and / or web browsing, etc. The executable instructions for executing the above-mentioned human-computer interaction functions are configured / stored in a computer program product or readable storage medium executable by one or more processors.

[0038] The above method embodiments involved in this application can also be executed in a server. Among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms. Taking the application of the screen generation method to the electronic game scene through the electronic game server as an example, the electronic game server can generate a target scene screen containing a rupture special effect in the electronic game scene based on the screen generation method, and provide the target scene screen to the player (for example, it can be rendered and displayed on the display screen of the player's terminal, or provided to the player through holographic projection, etc.).

[0039] According to one embodiment of the present application, an embodiment of a screen generation method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0040] In this embodiment, a screen generation method running on the above mobile terminal is provided. Figure 2 is a flow chart of a screen generation method according to one embodiment of the present application. Figure 2 As shown, the method includes the following steps S21 to S24.

[0041] Step S21, obtaining a target composite map corresponding to the virtual scene, wherein the target composite map is used to represent surface concave-convex information of the area to be generated corresponding to the fragmentation special effect.

[0042] The above virtual scenes can be scenes involving the display of rupture special effects, such as virtual exhibition halls, virtual classrooms, virtual conference rooms, and electronic game scenes. In particular, the game types corresponding to the above electronic game scenes can be: action games (for example: first-person or third-person shooting games, two-dimensional or three-dimensional fighting games, war action games, and sports action games, etc.), adventure games (for example: exploration games, collection games, puzzle games, etc.), simulation games (for example: simulation sandbox games, simulation development games, strategy simulation games, city construction simulation games, business simulation games, etc.), role-playing games, and leisure games (for example: chess and card table games, casual competitive games, music rhythm games, dress-up development games, etc.), etc.

[0043] The above-mentioned area to be generated can be the area in the above-mentioned virtual scene where the fragmentation special effect is to be displayed, such as a wall area, a ground area, an object surface area, a sky area, etc.

[0044] In the picture production scene, a texture is a two-dimensional image used to give a virtual model visual effects such as color and texture. The above-mentioned target composite texture can be a texture obtained by merging multiple single-function textures (such as height maps, normal maps, color maps, etc.). By merging textures, data transmission and storage can be optimized, and the memory bandwidth requirement during rendering can be reduced. Different channels in the target composite texture (such as R, G, B, and A channels) can store different types of information. The target composite texture can contain surface concave and convex information of the area where the shattered special effect is to be generated, that is, height information (representing the degree of concave and convexity of the shattered surface) and normal information (representing the orientation of the shattered surface). Obtaining the target composite texture can prepare for the subsequent generation of visual effects and ensure that the shattered special effect can accurately reflect the concave and convex details of the shattered surface.

[0045] Step S22, performing height offset mixed sampling on the target composite map to obtain a target sampling result.

[0046] The above-mentioned height offset mixed sampling refers to the process of first performing height offset processing on the target composite map, and then performing mixed sampling on the result of the height offset processing. In the production of game screens, height offset can be a process of fine-tuning the surface of the area to be generated according to the height information in the target composite map, so that the surface has a more realistic and detailed sense of concave and convex, and the result of the height offset processing can be the updated target composite map. Mixed sampling can be a process of combining and sampling different channels or different types of map data in the target composite map to generate a more complex and natural surface effect. By performing height offset mixed sampling on the target composite map, the generated shattered special effects can have a stronger sense of height (that is, a concave and convex effect), thereby helping the target scene containing the shattered special effects to be more realistic and three-dimensional.

[0047] Step S23, using the target sampling result and the target light source information, determine the visual performance parameters corresponding to the fragmentation effect, wherein the target light source information is determined by the current viewing angle of the virtual camera in the virtual scene.

[0048] In the scene production, the target light source information of the virtual scene may include data such as the light source position, light source type, and light source intensity. The target light source information can affect the visual performance effect in the virtual scene. The above target light source information can be determined by the current viewing angle of the virtual camera, which can be a fixed viewing angle or an active viewing angle. The active viewing angle can be a fixed angle position active viewing angle or a viewing angle with both angle and position active.

[0049] The above visual performance parameters may include color, brightness, contrast, transparency and other parameters, which determine the appearance of the shattered special effect under the scene light source corresponding to the target light source information. By combining the target sampling result (which can reflect the concave and convex information of the area to be generated) with the target light source information under the current viewing angle, the light and shadow effects of the shattered special effect under the scene light source can be calculated, such as which parts are brighter (reflecting more light) and which parts are darker (blocked by the shattered parts).

[0050] By introducing the target light source information corresponding to the current viewing angle for lighting simulation, the light and shadow calculation results of the shattered special effect can be generated, thereby determining the realism of the shattered special effect under the scene lighting.

[0051] Step S24, based on the visual performance parameters, rendering the fragmentation effect in the area to be generated to obtain the target scene image.

[0052] Based on the above visual performance parameters, the fragmentation effects are rendered in the area to be generated in the virtual scene. For example, the color parameters and transparency parameters of the model in the area to be generated (such as broken fragments, other objects in the space under the cracks, etc.) are adjusted, and the fusion effect of the model in the area to be generated and the surrounding environment is adjusted.

[0053] In the scene production scene, rendering refers to the process of converting virtual models and special effects into two-dimensional pictures. Specifically, the visual performance parameters determined by the target sampling results and the target light source information are used to adjust the visual performance of the virtual models and / or special effect components in the area to be generated, so that these virtual models and / or special effect components can be well linked and transitioned with other surrounding parts (such as the background part, other nearby models, etc.) in the scene picture, achieving the expected visual reality effect, and then obtaining the target scene picture. The above-mentioned target scene picture is the scene picture of the virtual scene containing the fragmentation special effect.

[0054] In the application scenario of game scene screen generation, by using the above-mentioned scheme of step S21 to step S24, the fragmentation effect can be efficiently generated, so that the generation area of ​​the fragmentation effect looks more realistic and natural in the virtual scene. At the same time, the generation of the fragmentation effect is dynamically matched with the light source conditions of the current perspective, which improves the visual performance quality of the scene screen and the immersive experience of the player. The embodiment of the present application uses composite maps and efficient sampling technology to not only reduce the consumption of memory and computing resources in the screen production process, but also improve the screen rendering efficiency and the real-time performance capability of the fragmentation effect.

[0055] Specifically, the above-mentioned screen generation method may also include other method steps, which can be referred to the further introduction of the embodiments of the present application below, and will not be described in detail here.

[0056] In an embodiment of the present application, a target composite map corresponding to a virtual scene is obtained, wherein the target composite map is used to characterize the surface concave-convex information of the area to be generated corresponding to the fragmentation special effect; a target composite map is subjected to a height offset mixed sampling to obtain a target sampling result; the target sampling result and the target light source information are used to determine the visual performance parameters corresponding to the fragmentation special effect, wherein the target light source information is determined by the current viewing angle of the virtual camera in the virtual scene; based on the visual performance parameters, the fragmentation special effect is rendered in the area to be generated to obtain the target scene picture. Therefore, the present application generates the fragmentation special effect of the corresponding area based on the surface concave-convex information, which is lower in cost and less limited in application to different scenes than the solution of directly using surface particles to make special effects. That is to say, the present application achieves the purpose of generating a scene picture of a fragmentation special effect containing a concave-convex effect at a lower cost, thereby achieving the technical effect of improving the scene applicability of the fragmentation special effect picture generation solution and reducing the cost while ensuring the realism of the fragmentation special effect picture, thereby solving the technical problem that the production solution of the fragmentation special effect picture containing a concave-convex effect in the related art is high in cost and has strong scene limitations.

[0057] The above method of the embodiment of the present application is further introduced below.

[0058] Optionally, in step S21, obtaining a target composite map corresponding to the virtual scene may include the following execution steps:

[0059] Step S211, obtaining height information corresponding to the area to be generated;

[0060] Step S212, performing gradient calculation on the height information to obtain initial normal information corresponding to the area to be generated;

[0061] Step S213, performing Gaussian blur processing on the height information to obtain blurred height data;

[0062] Step S214, generating a target composite map based on the initial normal information, the height information and the blurred height data.

[0063] The above-mentioned area to be generated is a specific area in the virtual scene to which the shattering special effect is to be added. The above-mentioned height information is the height data of multiple points corresponding to the area to be generated, and the height information is usually expressed in the form of a two-dimensional height map. The pixel value of each pixel point in the two-dimensional height map represents the height of the pixel point relative to the reference plane of the virtual scene.

[0064] For example, in the game screen generation scene, first determine the terrain area where the shattering effect will be applied (that is, the area to be generated), and then use the three-dimensional terrain editor of the game scene to obtain the height map of the terrain area, which records the altitude of each terrain point in the terrain area.

[0065] The specific implementation method of performing gradient calculation on the above-mentioned height information can be to use a preset gradient algorithm to calculate the height information to obtain the initial normal information of the generated area. In an exemplary application scenario, the above-mentioned gradient calculation can also be implemented by a preset tool, for example, by inputting the height map into the Knald tool, and using the normal map output by the Knald tool as the initial normal information. The above-mentioned Knald tool refers to a plug-in for map conversion.

[0066] For example, in the game screen generation scene, in order to render the surface details of the fragmentation effect, it is necessary to calculate the normal direction of each point in the area to be generated. Specifically, by performing pixel-level gradient analysis on the height information of the area to be generated, the normal direction of each pixel is calculated to obtain the initial normal information.

[0067] The above-mentioned Gaussian blur processing is an image processing technique that smoothes an image or reduces details by combining the pixel value with the weighted average of the surrounding pixels. Gaussian blur processing of height information can be achieved through a convolution operation, using a Gaussian kernel to perform a weighted average of each pixel value in the height map (that is, the above-mentioned height information) to generate blurred height data. The blurred height data after blurring can be used to create a soft transition effect on the crack edge of the shattered special effect, or to increase the subtle bumps and depressions on the surface of the area to be generated, making the shattered special effect look more natural and realistic.

[0068] Further, the initial normal information, height information and blurred height data are combined to obtain a target composite map. For example, the initial normal information, height information and blurred height data can be stored in different channels of the target composite map respectively. The above target composite map can provide the data required for rendering when rendering the fracture effect.

[0069] Taking the generation of rock cracking special effects in a video game scene as an example, the height map pre-drawn for the area to be generated for the rock cracking special effect is as follows Figure 3 As shown in , the height map can show the rough fragmentation effect of the rock surface in the area to be generated. Figure 3 The height map shown is input to the Knald tool, which includes at least a predefined gradient algorithm. The Knald tool converts the height map into a normal map. Since the effective information in the normal map includes the two-dimensional normal data in the R channel and the G channel (for example, the R channel stores the normal information in the U direction, and the G channel stores the normal information in the V direction), the normal map can be as follows Figure 4 As shown, at this time, the B channel and A channel of the normal map are temporarily empty.

[0070] Furthermore, for Figure 3After Gaussian blurring, the height map shown in Figure 5 The blurred height map shown. Figure 3 The height map shown is stored as Figure 4 The B channel of the normal map shown will be Figure 5 The blurred height map shown is stored as Figure 4 The A channel shown in Figure 1 is Figure 6 The target composite map shown.

[0071] Through the above steps S211 to S214, the embodiment of the present application integrates the initial normal information, height information and blurred height data into a composite map, which can optimize data transmission and storage while ensuring the rendering effect, reduce the cost of subsequent sampling, reduce the memory bandwidth requirement during rendering, and improve the efficiency of special effects rendering.

[0072] Optionally, in step S22, performing height offset mixed sampling on the target composite map to obtain a target sampling result may include the following execution steps:

[0073] Step S221, remapping sampling is performed on the target composite map to obtain a first sampling result;

[0074] Step S222, performing height offset sampling on the target composite map based on the first sampling result to obtain a second sampling result;

[0075] Step S223, mixing the first sampling result and the second sampling result to obtain a target sampling result.

[0076] The above-mentioned remapping sampling can be sampling after remapping the pixel value range of the target composite map, thereby obtaining a first sampling result. The above-mentioned pixel value range remapping can be used to adjust the value range of the target composite map so that the sampling result better matches the rendering requirements of the virtual scene, or can be used to enhance the visual visibility of a specific effect. It should be noted that, according to the requirements of the application scenario, the data stored in some or all channels in the target composite map can be remapped and sampled. The above-mentioned first sampling result may include preliminary normal sampling information corresponding to the area to be generated.

[0077] Further, based on the first sampling result, the target composite map is sampled for height offset. Specifically, the data stored in some or all channels of the target composite map may be calculated for height offset based on the first sampling result, and the target composite map may be sampled according to the height offset calculation result to obtain a second sampling result, which may include normal offset sampling information corresponding to the area to be generated. The second sampling of the target composite map may enhance the surface details and realism of the shattered special effect in the area to be generated.

[0078] Furthermore, the first sampling result and the second sampling result are mixed to obtain a target sampling result, which can be to combine the pixel information corresponding to the first sampling result and the second sampling result in a specified mixing manner to obtain a target sampling result containing more comprehensive information. The above target sampling result can combine the advantages of the above two types of sampling (i.e., remapping sampling and height offset sampling) to provide a data basis for subsequent visual performance parameters.

[0079] Through the above-mentioned steps S221 to S223, the embodiment of the present application combines the sampling results of two samplings to obtain surface information of the area to be generated that can show a height offset effect, so that the target sampling results can help enhance the visual realism and details of the fragmentation special effects.

[0080] Optionally, the first sampling result includes: target normal information, basic height data and basic slope data; in step S221, remapping sampling is performed on the target composite map to obtain the first sampling result, which may include the following execution steps:

[0081] Step S2211, sampling and remapping the initial normal information stored in the first channel of the target composite map to obtain target normal information;

[0082] Step S2212, sampling the height information stored in the second channel of the target composite map to obtain basic height data;

[0083] Step S2213, sampling the fuzzy height data stored in the third channel of the target composite map to obtain basic slope data.

[0084] In an exemplary application scenario, the first channel may include an R channel and a G channel, and initial normal information (including two-dimensional normal data) is stored in the R channel and the G channel of the target composite map. For example, the normal information in the U direction is stored in the R channel, and the normal information in the V direction is stored in the G channel. The second channel may be a B channel, and the B channel of the target composite map stores height information, which may be a height map of a virtual scene or a height map of an area to be generated. The third channel may be an A channel, and the A channel of the target composite map stores fuzzy height data, which may be a fuzzy height map obtained by performing Gaussian blur processing on the height map.

[0085] Furthermore, the initial normal information stored in the target composite map is sampled and remapped. Here, the present application does not limit the order of sampling and remapping, that is, the initial normal information is first remapped according to a preset target range, and then the remapped result is sampled to obtain the target normal information, or the initial normal information is first preliminarily sampled, and then the sampling value in the preliminary sampling result is mapped to a preset target range to obtain the target normal information.

[0086] Therefore, the target normal information may include vectors perpendicular to multiple faces of the area to be generated, which is used to characterize the surface orientation of the area to be generated. The target normal information can be used to simulate the lighting effect of the area to be generated in the virtual scene (because the orientation determines how the surface interacts with the virtual light source). The target discovery information is obtained after the remapping process, which can help to more accurately express the surface details of the area to be generated for the fragmentation effect.

[0087] Further, the height information stored in the target composite map is sampled to obtain basic height data. The fuzzy height data stored in the target composite map is sampled to obtain basic slope data, and the sampling method here can be random sampling, uniform sampling, interpolation sampling, etc.

[0088] Therefore, the above-mentioned basic height data can characterize the terrain undulations in the area to be generated or the height undulations of the surface of objects in the area to be generated. The basic height data is sampled from the height information stored in the second channel of the composite map, and is used to characterize the visual three-dimensional sense brought by the surface height undulations of the area to be generated for the shattered special effect. The above-mentioned basic slope data is used to simulate the transition effect between multiple faces in the area to be generated. Specifically, multiple faces with different heights usually appear as transition slopes, and the surface data of these transition slopes are used as basic slope data. The basic slope data can be used to control the smoothness or sharpness of the edges of the shattered special effect when rendering the shattered special effect in the area to be generated.

[0089] Through the above steps S2211 to S2213, the embodiment of the present application can respectively extract and process the relevant data corresponding to the area to be generated from the target composite map, and obtain the target normal information, basic height data and basic slope data in the first sampling result, through which the preliminary visual performance of the fragmentation effect can be characterized. The separation and processing of the above target normal information, basic height data and basic slope data allow for more refined control of the details of the fragmentation effect (such as surface bumps, edge transitions, lighting effects), thereby presenting a more realistic and dynamic fragmentation effect visual effect in the final scene image. For example, by adjusting the normal information, the crack shadow in the fragmentation effect can be made more realistic; by controlling the slope data, the transition of the crack edge in the fragmentation effect can be made more natural.

[0090] Optionally, in step S222, performing height offset sampling on the target composite map based on the first sampling result to obtain a second sampling result may include the following execution steps:

[0091] Step S2221, performing concave-convex offset calculation based on the basic height data, the preset convex height parameter and the reference plane height data corresponding to the area to be generated, and generating a height offset map;

[0092] Step S2222: sampling the target composite map based on the height offset map to obtain a second sampling result.

[0093] The preset convex height parameter can be a parameter for controlling the surface convex height in the cracking special effect. For example, in the rock cracking special effect, the convex height parameter can be used to determine the convex height of the rock ground. By adjusting the convex height parameter, the surface concavity of the rock ground can be controlled.

[0094] In a virtual scene, the reference plane can be a relatively flat reference plane, and the reference plane height data can be used to compare with the surface height data of the area to be generated to determine the surface offset of the area to be generated. For example, in the production of rock ground cracking special effects, the reference plane height data can be the ground height before the rock ground is broken.

[0095] By comparing the base height data with the reference plane height data and combining the convex height parameters, the remaining concave and convex offsets relative to the reference plane to be generated are calculated. This concave and convex offset is used to generate a height offset map, which is used to guide subsequent lighting calculations, making the shattering effect more three-dimensional and realistic.

[0096] Further, the target composite map is sampled according to the concave-convex offset information calculated by the height offset map. Specifically, the pixel coordinates after the height offset are used to read the data of the corresponding pixel in the target composite map to more accurately obtain the surface information of each pixel, and obtain a second sampling result. The second sampling result includes the normal information after the height offset.

[0097] Through the above steps S2221 to S2222, the second sampling result can include more accurate normal information through height offset sampling. Using these offset normal information for lighting simulation can help produce more three-dimensional fragmentation special effect visual effects, such as crack shadows, highlights, etc.

[0098] Optionally, the second sampling result includes offset normal information; in step S2222, sampling the target composite map based on the height offset map to obtain the second sampling result may include the following execution steps:

[0099] Step S2223, sampling the initial normal information in the target composite map based on the height offset map to obtain a normal sampling result;

[0100] Step S2224, multiplying the normal sampling result by the preset normal strength parameter to obtain offset normal information.

[0101] The above offset normal information may be the discovery information obtained by sampling after the height offset. The initial normal information in the target composite map is sampled based on the height offset map to obtain the normal sampling result. In order to further enhance the flexibility of the solution of the embodiment of the present application, the normal sampling result is multiplied by a preset normal strength parameter to obtain the offset normal information, and the normal strength parameter is used to control the offset strength in the offset normal information.

[0102] Using the height offset map as a guide, we sample the initial normal information in the target composite map. Specifically, in this step, we . Simply put, this means adjusting the initial normal data of each pixel according to the height offset data on the height offset map (for example, offsetting the normal data according to the height offset) so that the adjusted normal data can reflect the surface details of the shatter effect at that pixel.

[0103] The Normal sampling result is multiplied by the preset Normal Strength parameter to increase or decrease the bump effect of the surface. The Normal Strength parameter is used to adjust the visual expression of the Shatter effect. For example, a higher Normal Strength parameter value will make the Shatter effect look rougher and three-dimensional, while a lower Normal Strength parameter value will make the Shatter effect look smoother.

[0104] Through the above steps S2223 to S2224, the embodiment of the present application samples the initial normal information through the height offset data, so that the second sampling result can more accurately and meticulously reflect the concave and convex effect of the surface of the area to be generated, which helps to obtain a more three-dimensional and realistic visual performance of the fragmentation effect after subsequent lighting simulation. In addition, by introducing an adjustable normal strength parameter, it supports users to flexibly control the visual expression of the fragmentation effect to adapt it to different scenes and needs.

[0105] According to the above-mentioned step S22 and the above-mentioned multiple optional execution steps included in step S22, in an exemplary application scenario, in the process of generating a scene screen containing rock ground crack special effects, the initial normal information sampled from the R channel and the G channel of the target composite map is range-remapped, and the mapping result is input into the vector extension node (such as the appendvector node) for expansion to obtain the target normal information (denoted as basenormal), which usually includes floating-point (float) data. Further, the base height data (denoted as baseheight) is sampled from the B channel of the target composite map, and the base slope data (denoted as baseramp) is sampled from the A channel of the target composite map. The above-mentioned target normal information (basenormal), base height data (baseheight) and base slope data (baseramp) are used as the first sampling result.

[0106] Furthermore, the Lerp function is used to mix the base height data (baseheight) and the preset bump height parameter (denoted as bumpoff parameter) to obtain a first mixed result; the first mixed result is input into the bump offset (Bumpoffset) node as the height map to be offset, and the bump offset calculation is performed in the Bumpoffset node in combination with the preset height ratio parameter (denoted as HeightRatio, which is 0.05 in this example) and the reference plane height data (denoted as ReferencePlane, which is 0.5 in this example) to obtain the height offset map (denoted as bumpoffset_uv) output by the Bumpoffset node.

[0107] It should be noted that the Bumpoffset node is a node used to create a bump effect on the surface of a material. Input a height map to the Bumpoffset node, and the Bumpoffset node will calculate the UV information after the height map offset processing, and then use the UV information to sample the original UV map of the scene to obtain a sampled UV map with a bump offset effect.

[0108] Furthermore, the normal information in the R channel and the G channel in the target composite map is sampled again using the height offset map (bumpoffset_uv) to obtain a normal sampling result, which is used to characterize the parallax effect of the screen. The normal sampling result is multiplied by a preset normal intensity parameter (recorded as the normalinten parameter) and then input into the vector extension node to obtain an offset sampling result (recorded as bumpoffset_normal), which is used as the second sampling result. Furthermore, the first sampling result is mixed with the second sampling result to obtain the target sampling result.

[0109] In the above exemplary application scenario, a target sampling result combining the advantages of remapping sampling and height offset sampling is generated, which helps to generate a rock ground crack special effect with more three-dimensionality and detail in the application scenario.

[0110] Optionally, the above screen generation method may further include the following execution steps:

[0111] Step S251, creating a viewing angle light source according to the current viewing angle;

[0112] Step S252 , superimposing the viewing angle light source and the top light source vector to generate target light source information, wherein the top light source vector is used to simulate a virtual top light source in a virtual scene.

[0113] The current viewing angle is the current viewing angle of the virtual camera used to observe the virtual scene. The viewing angle light source is a virtual light source dynamically generated according to the current viewing angle (such as the current position and current orientation of the virtual camera). The viewing angle light source is used to simulate the lighting effect of the objects in the virtual scene from the current viewing angle.

[0114] The top light source vector is used to simulate the light source that shines from top to bottom in the virtual scene, such as the sun or sky light. In the virtual scene, the top light source vector provides a basic lighting direction, which is used to determine the basic shadow effect and basic highlight effect of the virtual scene object. The target light source information can be the comprehensive light source data for lighting calculation obtained by superimposing the view light source and the top light source vector.

[0115] Still taking the above process of generating a scene image containing rock crack special effects as an example, the virtual perspective light source created according to the current perspective direction of the virtual camera is added to the vector float3 (0, 1, 0) used to simulate the top light source to obtain the target light source in the virtual scene (denoted as lightvector).

[0116] Through the above steps S251 to S252, the embodiment of the present application can calculate the target light source information and take into account the influence of the current viewing angle and the top light source on the lighting effects of virtual scene objects, thereby providing more accurate parameters for subsequent calculations of lighting effects.

[0117] Optionally, in step S23, using the target sampling result and the target light source information to determine the visual performance parameters corresponding to the fragmentation special effect may include the following execution steps:

[0118] Step S231, using the target sampling result and the target light source information, generating a light and shadow calculation result corresponding to the fragmentation special effect;

[0119] Step S232, using the target sampling result, the target color map and the light and shadow calculation result to calculate the target special effect color and special effect transparency corresponding to the fragmentation special effect, wherein the target color map is used to define the surface material effect of the fragmentation special effect;

[0120] Step S233, determining visual performance parameters based on the target special effect color, special effect transparency, and vertex colors of the patch particles corresponding to the fragmentation special effect.

[0121] The above target sampling results can characterize the surface concave-convex effect of the area to be generated. Combined with the target sampling results and the target light source information, the light and shadow effects produced when the target light source in the virtual scene illuminates the area to be generated are simulated and calculated to obtain the light and shadow calculation results of the fragmentation special effect.

[0122] The target color map may be a pre-drawn map used to determine the surface material effect of the cracking special effect. For example, in the process of generating a scene screen containing a rock cracking special effect, the target color map may be as follows: Figure 7 As shown, the target color map can define the surface rock effect in the rock crack special effect.

[0123] Furthermore, the target special effect color and special effect transparency in the fragmentation special effect are obtained by comprehensively considering the surface concave-convex effect, surface material effect and light and shadow effect of the area to be generated, and the target sampling result, target color map and light and shadow calculation result are mixed and calculated. The fragmentation special effect can be expressed by patch particles in the virtual scene, and the visual expression parameters can include a variety of particle parameters corresponding to the patch particles.

[0124] Through the above steps S231 to S233, the embodiment of the present application comprehensively considers the surface convex-concave effect, surface material effect and light and shadow effect of the area to be generated to calculate the visual performance parameters of the fragmentation special effect, which can enhance the detailed visual effect of the fragmentation special effect and enhance the three-dimensionality and reality of the fragmentation special effect in the scene picture.

[0125] Optionally, in step S231, using the target sampling result and the target light source information to generate the light and shadow calculation result corresponding to the fragmentation special effect may include the following execution steps:

[0126] Step S2311, determining normal mixed data based on the target sampling result, wherein the normal mixed data is obtained by mixing the offset normal information and the target normal information;

[0127] Step S2312, using normal mixing data and target light source information to generate light and shadow calculation results.

[0128] The target sampling result is obtained by mixing the first sampling result and the second sampling result, the first sampling result at least includes the target normal information, the second sampling result includes the offset normal information, and the target normal information and the offset normal information are mixed to obtain normal mixed data. Furthermore, the light and shadow calculation result corresponding to the fragmentation effect is calculated by combining the target light source information and the normal mixed data.

[0129] Still taking the above process of generating a scene image containing rock crack special effects as an example, a preset normal blending tool (such as the Blend Angle Corrected Normals normal blending node) is used to blend the offset sampling result (recorded as bumpoffset_normal) with the target normal information (basenormal) to obtain normal blending data.

[0130] It should be noted that the result of the above-mentioned mixed calculation can also be normalized and converted into a coordinate system (for example, from the tangent space to the world space) to obtain the above-mentioned normal mixed data.

[0131] Through the above steps S2311 to S2312, the embodiment of the present application comprehensively considers the normal information before the height offset and the normal information after the height offset, so that the obtained light and shadow calculation results are more detailed and realistic.

[0132] Optionally, the light and shadow calculation result includes a first target light and shadow result and a second target light and shadow result; in step S2312, the light and shadow calculation result is generated by using the normal mixing data and the target light source information, which may include the following execution steps:

[0133] Step S2313, performing illumination simulation using the normal mixing data and the target light source information to generate a first initial light and shadow result corresponding to the fragmentation special effect;

[0134] Step S2314, performing smoothing calculation based on the first initial light and shadow result and a preset dark part intensity parameter to obtain a first target light and shadow result;

[0135] Step S2315, performing binarization calculation based on the first initial light and shadow result and the step mapping threshold to obtain a second target light and shadow result.

[0136] In the application scenario, based on the lighting simulation algorithm of the virtual scene, the normal mixed data and the target light source information are subjected to lighting simulation calculation to obtain the above-mentioned first initial light and shadow result.

[0137] The first target light and shadow result is obtained by the above smooth calculation, and the shadow gradient in the first target light and shadow result is more natural, avoiding harsh edges. By combining the dark intensity parameter, the layering of the shadow can be increased, making the special effect look more realistic.

[0138] The second target light and shadow result is obtained through the above-mentioned binarization calculation. The second target light and shadow result includes light and dark dual-state light and shadow effects, and the lighting effect of the area to be generated is divided into an illuminated part and an unilluminated part, thereby helping to produce clear edges and details on the surface of the fragmentation special effect.

[0139] Still taking the above process of generating a scene image containing rock crack special effects as an example, a dot product calculation is performed on the normal mixing data and the target light source information (lightvector) to obtain a dot product calculation result, and then the dot product calculation result is mapped (for example, mapped to the range of 0 to 1) to obtain a first initial light and shadow result.

[0140] Furthermore, a smooth transition (Smoothstep) function is used to perform smooth interpolation processing on the first initial light and shadow result, and a Lerp function is used to interpolate the smooth interpolation processing result and the dark intensity parameter of the rock ground to obtain a first target light and shadow result (referred to as groundshadow). The above dark intensity parameter is used to control the intensity of the light and shadow effect of the rock ground.

[0141] It should be noted that the above Smoothstep is a function used to smoothly transition between two specific values ​​and return an interpolation result between 0 and 1. SmoothStep receives three parameters: the minimum boundary (Min) defines the lower boundary of the interpolation. For input values ​​less than or equal to Min, the output value of the SmoothStep function is 0 (shown as black); the maximum boundary (Max) defines the upper boundary of the interpolation. For values ​​greater than or equal to Max, the output value of the SmoothStep function is 1 (shown as white); the value (Alpha) defines the source of the interpolation. For example, Alpha can be determined by a gradient map or a grayscale texture map. In the field of rendering, the Smoothstep function is often used to create smooth transition effects in rendered graphics, such as interpolating color, brightness, or transparency in a shader program. By using the Smoothstep function, jagged edges or discontinuous transition effects can be avoided during the rendering process, making the final rendering result smoother and more natural.

[0142] Furthermore, a step function is used to perform binarization calculation on the first initial light and shadow result and the step mapping threshold (0.3 in this example) to obtain a second target light and shadow result (denoted as ndotl).

[0143] It should be noted that the above Step function is used to create a step-like effect in the material. The Step function accepts two parameters: the first parameter is the input value, and the second parameter is the step mapping threshold. When the input value is greater than the step mapping threshold, the step function returns 1; when the input value is less than or equal to the step mapping threshold, the step function returns 0. By adjusting the step mapping threshold, you can control the position and width of the steps to achieve different effects.

[0144] Through the above-mentioned steps S2313 to S2315, the embodiment of the present application calculates two different target light and shadow results, among which the first target light and shadow result is relatively smooth, suitable for expressing the soft light and shadow transition of the fragmentation special effect, while the second target light and shadow result is relatively hard, suitable for highlighting the edges or details of the fragmentation special effect.

[0145] Optionally, the cracking special effect is a rock cracking special effect; the above-mentioned image generation method may further include the following execution steps:

[0146] Step S261, interpolating and calculating the transition color intensity parameters corresponding to the geometric mask and the rock crack special effect to obtain a brightness enhancement parameter, wherein the transition color intensity parameter is used to determine the color transition effects corresponding to the inside of the to-be-generated area and the outside of the to-be-generated area respectively;

[0147] Step S262, calculating a second initial light and shadow result using the target light source information and the offset normal information in the target sampling result;

[0148] Step S263, performing multiplication calculation on the second initial light and shadow result and the basic slope data in the target sampling result to obtain a mixing weight;

[0149] Step S264, using a mixing weight to perform mixing calculation on the preset color value to obtain an initial magma color, wherein the preset color value is used to define the magma effect of the rock ground crack special effect;

[0150] Step S265, determining the target magma color based on the brightness enhancement parameter and the initial magma color.

[0151] The geometric mask is used to determine the area where the rock cracking special effect is to be generated. The geometric mask can be a grayscale image, where the white part represents the area where the rock cracking special effect will be applied, the black part represents the area where the rock cracking special effect will not be applied, and the transition part (such as gray) is used to achieve a smooth transition effect of the special effect. In the rock cracking special effect picture, the geometric mask can help ensure that the magma under the rock ground is only displayed in the cracks, and does not overflow into the unbroken area of ​​the rock ground.

[0152] The above transition color intensity parameters are used to adjust the color transition effect between the edge of the rock crack special effect and the surrounding environment. In the real world, the color of the crack edge is often different from the color of the surrounding rock, and there is a color transition between the two. The transition color intensity parameter can help simulate this color transition and make the rock crack special effect more natural.

[0153] The brightness enhancement parameters are obtained by interpolating the geometric mask and the transition color intensity parameters corresponding to the rock crack special effects. The brightness enhancement parameters are used to adjust the display brightness of the magma in the rock cracks, making the magma look hotter and more dynamic. Determining the brightness enhancement parameters based on the geometric mask and the transition color intensity parameters can ensure that the brightness changes of the magma in the cracks are combined with the transition color intensity parameters to produce a more realistic effect.

[0154] The second initial light and shadow result is the result of the lighting calculation based on the target light source information and the offset normal information, and is used to preliminarily determine the lighting effect of the magma. The basic slope data is used to determine the distribution of magma in rock cracks and to determine the light and shadow transition between magma and the rock surface.

[0155] The second initial light and shadow result is multiplied by the basic slope data to obtain the above-mentioned mixing weight. The mixing weight is used to control the degree of mixing between the second initial light and shadow result and the preset color value (such as magma color). The above-mentioned preset color value is the preset color for magma in the rock ground crack special effect. The preset color value may include red, orange, and yellow, etc. The preset color value can reflect the characteristics of high-temperature magma. Since the calculation of the above-mentioned mixing weight is based on the basic slope data, it can ensure that the visual performance of magma in the crack is more prominent without affecting the lighting effect of the surrounding rocks.

[0156] Furthermore, in the process of using mixing weights to mix preset color values ​​to obtain the above-mentioned initial magma color, the mixing weights are used to adjust the combination of the magma color and the second initial light and shadow results to reflect the lighting changes of the magma, thereby ensuring that the magma color still maintains high temperature and dynamic visual characteristics under different lighting conditions.

[0157] The above-mentioned target magma color is the magma color that is finally applied to the rock crack special effect. The determination of the target magma color comprehensively considers the brightness enhancement parameters and the initial magma color to ensure that the magma in the special effect is more realistic, hot and prominent.

[0158] Still taking the above process of generating a scene screen containing rock crack special effects as an example, a circular mask (that is, the above geometric mask) is calculated using the distance function. Based on the range determined by the circular mask, the Lerp function is used to mix the transition color internal intensity parameter corresponding to the rock crack special effect with the transition color external intensity parameter to obtain a brightness enhancement parameter (denoted as crackinoutinten).

[0159] The offset sampling result (denoted as bumpoffset_normal) and the target light source information (lightvector) are used to perform lighting simulation calculations to obtain a second initial light and shadow result; further, the second initial light and shadow result is multiplied by the basic slope data (baseramp) to obtain a mixing weight; the mixing weight is used as the Alpha value of the Lerp function, and the yellow and orange color values ​​are used as the A input and B input of the Lerp function respectively for mixing calculation to obtain the initial magma color; further, the initial magma color is multiplied by the above-mentioned brightness enhancement parameter (crackinoutinten) to obtain the target magma color (denoted as lavacolor).

[0160] Through the above steps S261 to S265, the embodiment of the present application simulates the dynamic and high temperature characteristics of the magma in the rock ground crack special effects by finely controlling the color, brightness and light and shadow effects of the magma, so that the final generated scene image containing the rock ground crack special effects is more visually realistic.

[0161] Optionally, in step S232, the target special effect color is calculated using the target sampling result, the target color map and the light and shadow calculation result, which may include the following execution steps:

[0162] Step S2321, sampling the target color map to obtain the target rock color and special effect transparency corresponding to the rock ground crack special effect;

[0163] Step S2322, based on the target rock color, the target magma color, the first target light and shadow result, the second target light and shadow result and the basic height data in the target sampling result, the target special effect color is calculated.

[0164] The target color map may be a pre-drawn map storing the basic color of the rock, and the target color map may also contain other colors corresponding to the rock (such as reflective color, transition color, etc.). The target color map is sampled to obtain the target rock color and special effect transparency corresponding to the rock part in the rock ground crack special effect. Further, the target special effect color of the rock ground crack special effect is determined by combining the target rock color, the target magma color, the first target light and shadow result, the second target light and shadow result and the basic height data.

[0165] Still taking the above process of generating a scene image containing rock cracking special effects as an example, the pre-drawn target color map is as follows Figure 7 As shown, the target color map is used to define the rock color in the rock ground crack special effect. Specifically, the target color map is sampled to obtain the target rock color (denoted as basic_color_reslut) and the special effect transparency (denoted as basic_alpha_reslut). Furthermore, in an exemplary application scenario, color mixing is performed based on the target rock color and the target magma color. The degree of color mixing can be determined by the basic height data. For example, the deeper the rock crack, the higher the proportion of the target magma color in the mixed color. The first target light and shadow result (interpolated smooth light and shadow effect) and the second target light and shadow result (binarized light and shadow effect) are mixed and applied to the mixed color to obtain the target special effect color.

[0166] Through the above-mentioned steps S2321 to S2322, the embodiment of the present application can support the user to pre-draw the target color map used to define the rock effect, and then combine the target magma color and the light and shadow calculation results to calculate the target special effect color. The target special effect color is affected by the surface convexity and concaveness effects, light and shadow effects, etc. of the area to be generated, which can make the generated rock ground crack special effects have a stronger sense of three-dimensionality and texture reality.

[0167] Optionally, in step S2322, based on the target rock color, the target magma color, the first target light and shadow result, the second target light and shadow result and the basic height data, the target special effect color is calculated, which may include the following execution steps:

[0168] Step S2323, multiplying the target rock color by the first target light and shadow result to obtain a first value;

[0169] Step S2324, multiplying the base height data by the second target light and shadow result to obtain a second value;

[0170] Step S2325, performing interpolation calculation based on the first value, the second value and the target magma color to obtain the target special effect color.

[0171] By multiplying the target rock color with the first target light and shadow result, a smooth lighting effect can be applied to the rock color to obtain a first value, which can be an updated rock color that changes according to changes in lighting in the virtual scene, thereby producing a more realistic visual effect. For example, in areas with strong lighting, the color of the rock will be illuminated and appear brighter; in shadowed areas, the color of the rock will appear darker.

[0172] By multiplying the base height data with the second target lighting and shadow results, the special effect lighting and shadow effects can be adjusted according to the surface convexity of the area to be generated. For example, deeper rock cracks usually have stronger shadow effects. By combining the base height data with the binary lighting and shadow results, these deeper areas can be made to appear darker, while the raised areas on the surface can appear brighter, thereby enhancing the light and dark contrast of the rock crack special effect.

[0173] Still taking the above process of generating a scene screen containing rock ground crack special effects as an example, multiply the target rock color (basic_color_reslut) by the first target light and shadow result (groundshadow) to obtain the first value; multiply the basic height data (Baseheight) by the second target light and shadow result (ndot1) to obtain the second value. The above first value is used as the B input of the Lerp function, the target lava color (lavacolor) is used as the A input of the Lerp function, and the above second value is used as the Alpha input of the Lerp function, and then the result output by the Lerp function is used as the target special effect color (recorded as lavacolor_result).

[0174] Through the above-mentioned steps S2323 to S2325, the target special effect color obtained in the embodiment of the present application is not only affected by the preset rock color, but also by the lighting effect in the virtual scene and the surface unevenness of the area to be generated, making the entire rock ground crack special effect visually richer and more three-dimensional, and can be better integrated into the three-dimensional virtual environment to enhance the user experience.

[0175] Optionally, the visual performance parameters include a target color parameter and a target transparency parameter; in step S233, determining the visual performance parameters based on the target special effect color, special effect transparency and vertex color may include the following execution steps:

[0176] Step S2331, multiplying the color channel of the target special effect color and the vertex color to obtain a target color parameter;

[0177] Step S2332, multiplying the special effect transparency and the transparency channel of the vertex color to obtain a target transparency parameter.

[0178] In the application scenario, the patch particles of the rock cracking special effect can be controlled by the special effect editor in the rendering engine. That is, the rock cracking special effect is presented in the scene screen through patch particles. The vertex color of the patch particles can include RGB channels and A channels, wherein the RGB channel is used to store the target special effect color of the rock cracking special effect, and the A channel is used to store the special effect transparency of the rock cracking special effect.

[0179] Based on this, the target transparency parameter of the rock cracking effect is obtained by multiplying the effect transparency (basic_alpha_reslut) with the A channel of the vertex color (recorded as vertexcolor) of the patch particle. The target color parameter of the rock cracking effect is obtained by multiplying the target effect color (lavacolor_result) with the RGB channel of the vertex color (vertexcolor) of the patch particle.

[0180] Through the above steps S2331 to S2332, the embodiment of the present application determines the target color parameters and target transparency parameters in the visual performance parameters of the rock ground crack special effect by combining the target special effect color and special effect transparency obtained by the above calculations with the vertex colors of the surface particles. Therefore, one implementation method of the above method steps provided by the embodiment of the present application can be to obtain the rock ground crack special effect by using surface particles in a rendering engine, which is easy to apply in scenes involving picture generation.

[0181] Optionally, in step S24, based on the visual performance parameters, rendering the fragmentation effect in the area to be generated to obtain the target scene image may include the following execution steps:

[0182] Step S241, generating a special effect material file based on the visual performance parameters in the virtual shader;

[0183] Step S242, assigning values ​​to the patch particles in the special effects editor according to the special effects material file to obtain target particle special effects;

[0184] Step S243, using the target particle special effect to render the fragmentation special effect to obtain the target scene image.

[0185] The above visual performance parameters can be recorded in a virtual shader (such as Surf Shader), and the visual performance parameters are assigned to the MTL material file, and the MTL material file is used to assign values ​​to the patch particles in the special effect editor, so that a highly effective fragmentation special effect presented by the patch particles can be generated. Further, the fragmentation special effect is rendered using the target particle special effect to obtain the target scene screen.

[0186] Still taking the above process of generating a scene screen including a rock ground crack special effect as an example, the target scene screen displaying a rock ground crack special effect generated by the above method steps is as follows: Figure 8 As shown, it can be seen that the generated rock ground crack special effects can have a three-dimensional effect of surface convexity and concavity in the virtual scene, and have a natural light and shadow effect. Moreover, when the observation angle of the virtual scene is fixed, a certain height parallax effect can also be achieved on the plane particles, and the scene has a strong sense of reality.

[0187] In summary, the above-mentioned image generation method provided by the embodiment of the present application can significantly improve the realism and detail expression of the rock ground crack special effects in the virtual scene. Specifically, the target composite map is used to finely simulate the surface concave and convex information of the rock ground crack, and a more realistic rock ground crack effect is generated in the virtual scene, which optimizes the user experience; the present application uses the height offset hybrid sampling technology to achieve efficient sampling and hybrid processing, ensuring the visual smoothness of the natural transition and depth change of the cracks in the rock ground crack special effects; the present application also considers determining the light source information according to the current viewing angle of the virtual camera, so that the light and shadow effects change with the viewing angle, which greatly enhances the scene immersion.

[0188] In addition, in the calculation of visual performance parameters, the embodiment of the present application realizes the detailed control of the color, transparency and light and shadow of the rock ground crack special effect by comprehensively using the light and shadow calculation results and sampling, color mapping and other data, ensuring the advanced customization and optimization of the visual effect. The embodiment of the present application also introduces the technical concept of real simulation and brightness enhancement of the magma effect, and uses the mixture of interpolation calculation and preset color values ​​to further enhance the visual impact of the special effect.

[0189] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a disk, an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0190] In this embodiment, a screen generation device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0191] Fig. 9 is a structural block diagram of a picture generating device according to one embodiment of the present application, such as Fig. 9As shown, the device includes: an acquisition module 901, used to acquire a target composite map corresponding to a virtual scene, wherein the target composite map is used to characterize the surface convexity information of the area to be generated corresponding to the fragmentation special effect; a sampling module 902, used to perform height-offset mixed sampling on the target composite map to obtain a target sampling result; a calculation module 903, used to determine the visual performance parameters corresponding to the fragmentation special effect using the target sampling result and target light source information, wherein the target light source information is determined by the current viewing angle of the virtual camera in the virtual scene; a generation module 904, used to render the fragmentation special effect in the area to be generated based on the visual performance parameters to obtain a target scene picture.

[0192] Optionally, the above-mentioned acquisition module 901 is also used to: obtain height information corresponding to the area to be generated; perform gradient calculation on the height information to obtain initial normal information corresponding to the area to be generated; perform Gaussian blur processing on the height information to obtain blurred height data; and generate a target composite map based on the initial normal information, height information and blurred height data.

[0193] Optionally, the above-mentioned sampling module 902 is also used to: remap the target composite map to obtain a first sampling result, perform height offset sampling on the target composite map based on the first sampling result to obtain a second sampling result; mix the first sampling result and the second sampling result to obtain a target sampling result.

[0194] Optionally, the first sampling result includes: target normal information, basic height data and basic slope data; the above-mentioned sampling module 902 is also used to: sample and remap the initial normal information stored in the first channel of the target composite map to obtain the target normal information; sample the height information stored in the second channel of the target composite map to obtain the basic height data; sample the blurred height data stored in the third channel of the target composite map to obtain the basic slope data.

[0195] Optionally, the above-mentioned sampling module 902 is also used to: perform concave-convex offset calculation based on basic height data, preset convex height parameters and reference plane height data corresponding to the area to be generated to generate a height offset map; sample the target composite map based on the height offset map to obtain a second sampling result.

[0196] Optionally, the second sampling result includes offset normal information; the above-mentioned sampling module 902 is also used to: sample the initial normal information in the target composite map based on the height offset map to obtain the normal sampling result; multiply the normal sampling result with the preset normal strength parameter to obtain the offset normal information.

[0197] Optionally, in addition to all the above-mentioned modules, the above-mentioned picture generating device also includes a light source module (not shown in the figure), which is used to: create a perspective light source according to the current perspective; superimpose the perspective light source with the top light source vector to generate target light source information, wherein the top light source vector is used to simulate a virtual top light source in a virtual scene.

[0198] Optionally, the above-mentioned calculation module 903 is also used to: generate light and shadow calculation results corresponding to the fragmentation special effect using the target sampling results and the target light source information; calculate the target special effect color and special effect transparency corresponding to the fragmentation special effect using the target sampling results, the target color map and the light and shadow calculation results, wherein the target color map is used to define the surface material effect of the fragmentation special effect; determine the visual performance parameters based on the target special effect color, special effect transparency and the vertex color of the patch particles corresponding to the fragmentation special effect.

[0199] Optionally, the above-mentioned calculation module 903 is also used to: determine normal mixing data based on the target sampling result, wherein the normal mixing data is obtained by mixing the offset normal information with the target normal information; and generate light and shadow calculation results using the normal mixing data and the target light source information.

[0200] Optionally, the light and shadow calculation results include a first target light and shadow result and a second target light and shadow result; the above-mentioned calculation module 903 is also used to: use normal mixing data and target light source information to perform lighting simulation to generate a first initial light and shadow result corresponding to the fragmentation special effect; perform smoothing calculation based on the first initial light and shadow result and a preset dark area intensity parameter to obtain the first target light and shadow result; perform binarization calculation based on the first initial light and shadow result and a step mapping threshold to obtain a second target light and shadow result.

[0201] Optionally, the fragmentation special effect is a rock ground crack special effect; the above-mentioned calculation module 903 is also used to: perform interpolation calculation based on the transition color intensity parameters corresponding to the geometric mask and the rock ground crack special effect to obtain a brightness enhancement parameter, wherein the transition color intensity parameter is used to determine the color transition effects corresponding to the inside of the area to be generated and the outside of the area to be generated respectively; calculate the second initial light and shadow result using the target light source information and the offset normal information in the target sampling result; multiply the second initial light and shadow result with the basic slope data in the target sampling result to obtain a mixing weight; use the mixing weight to mix the preset color value to obtain an initial magma color, wherein the preset color value is used to define the magma effect of the rock ground crack special effect; determine the target magma color based on the brightness enhancement parameter and the initial magma color.

[0202] Optionally, the above-mentioned calculation module 903 is also used to: sample the target color map to obtain the target rock color and special effect transparency corresponding to the rock ground crack special effect; calculate the target special effect color based on the target rock color, target magma color, the first target light and shadow result, the second target light and shadow result and the basic height data in the target sampling result.

[0203] Optionally, the above-mentioned calculation module 903 is also used to: multiply the target rock color with the first target light and shadow result to obtain a first value; multiply the basic height data with the second target light and shadow result to obtain a second value; perform interpolation calculation based on the first value, the second value and the target magma color to obtain the target special effect color.

[0204] Optionally, the visual performance parameters include target color parameters and target transparency parameters; the above-mentioned calculation module 903 is also used to: multiply the color channel of the target special effect color and the vertex color to obtain the target color parameter; multiply the special effect transparency and the transparency channel of the vertex color to obtain the target transparency parameter.

[0205] Optionally, the above-mentioned generation module 904 is also used to: generate special effects material files based on the visual performance parameters in the virtual shader; assign values ​​to the patch particles in the special effects editor according to the special effects material files to obtain target particle special effects; use the target particle special effects to render fragmentation special effects to obtain the target scene picture.

[0206] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0207] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0208] Optionally, in this embodiment, the above-mentioned computer-readable storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.

[0209] Optionally, in this embodiment, the computer-readable storage medium may be located in any one of the computer terminals in a computer terminal group in a computer network, or in any one of the mobile terminals in a mobile terminal group.

[0210] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:

[0211] S1, obtaining a target composite map corresponding to the virtual scene, wherein the target composite map is used to represent surface concave-convex information of the area to be generated corresponding to the fragmentation special effect;

[0212] S2, performing height offset mixed sampling on the target composite map to obtain the target sampling result;

[0213] S3, determining visual performance parameters corresponding to the fragmentation effect using the target sampling result and the target light source information, wherein the target light source information is determined by the current viewing angle of the virtual camera in the virtual scene;

[0214] S4, based on the visual performance parameters, rendering the fragmentation effect in the area to be generated to obtain the target scene image.

[0215] Optionally, the above-mentioned computer-readable storage medium is also configured to store program codes for executing the following steps: obtaining height information corresponding to the area to be generated; performing gradient calculation on the height information to obtain initial normal information corresponding to the area to be generated; performing Gaussian blur processing on the height information to obtain blurred height data; and generating a target composite map based on the initial normal information, the height information and the blurred height data.

[0216] Optionally, the computer-readable storage medium is further configured to store program codes for executing the following steps: remapping sampling of the target composite map to obtain a first sampling result; performing height offset sampling of the target composite map based on the first sampling result to obtain a second sampling result; and mixing the first sampling result and the second sampling result to obtain a target sampling result.

[0217] Optionally, the computer-readable storage medium is further configured to store program codes for executing the following steps: the first sampling result includes: target normal information, basic height data and basic slope data; the initial normal information stored in the first channel of the target composite map is sampled and remapped to obtain the target normal information; the height information stored in the second channel of the target composite map is sampled to obtain the basic height data; the blurred height data stored in the third channel of the target composite map is sampled to obtain the basic slope data.

[0218] Optionally, the above-mentioned computer-readable storage medium is also configured to store program codes for executing the following steps: performing concave-convex offset calculation based on basic height data, preset convex height parameters and reference plane height data corresponding to the area to be generated to generate a height offset map; sampling the target composite map based on the height offset map to obtain a second sampling result.

[0219] Optionally, the computer-readable storage medium is further configured to store program code for executing the following steps: the second sampling result includes offset normal information; the initial normal information in the target composite map is sampled based on the height offset map to obtain a normal sampling result; and the normal sampling result is multiplied by a preset normal strength parameter to obtain offset normal information.

[0220] Optionally, the computer-readable storage medium is also configured to store program codes for executing the following steps: creating a perspective light source according to the current perspective; superimposing the perspective light source with the top light source vector to generate target light source information, wherein the top light source vector is used to simulate a virtual top light source in a virtual scene.

[0221] Optionally, the computer-readable storage medium is also configured to store program codes for executing the following steps: generating light and shadow calculation results corresponding to the fragmentation effect using target sampling results and target light source information; calculating a target special effect color and special effect transparency corresponding to the fragmentation effect using the target sampling results, target color map and light and shadow calculation results, wherein the target color map is used to define the surface material effect of the fragmentation effect; determining visual performance parameters based on the target special effect color, special effect transparency and vertex color of the patch particles corresponding to the fragmentation effect.

[0222] Optionally, the above-mentioned computer-readable storage medium is also configured to store program code for performing the following steps: determining normal mixing data based on the target sampling result, wherein the normal mixing data is obtained by mixing the offset normal information with the target normal information; and generating light and shadow calculation results using the normal mixing data and the target light source information.

[0223] Optionally, the computer-readable storage medium is also configured to store program codes for executing the following steps: the light and shadow calculation results include a first target light and shadow result and a second target light and shadow result; a lighting simulation is performed using normal mixing data and target light source information to generate a first initial light and shadow result corresponding to the fragmentation special effect; a smoothing calculation is performed based on the first initial light and shadow result and a preset dark area intensity parameter to obtain a first target light and shadow result; a binarization calculation is performed based on the first initial light and shadow result and a step mapping threshold to obtain a second target light and shadow result.

[0224] Optionally, the computer-readable storage medium is further configured to store program codes for executing the following steps: the fragmentation effect is a rock ground crack effect; interpolation calculation is performed based on the transition color intensity parameters corresponding to the geometric mask and the rock ground crack effect to obtain a brightness enhancement parameter, wherein the transition color intensity parameter is used to determine the color transition effects corresponding to the inside of the area to be generated and the outside of the area to be generated respectively; a second initial light and shadow result is calculated using the target light source information and the offset normal information in the target sampling result; the second initial light and shadow result is multiplied by the basic slope data in the target sampling result to obtain a mixing weight; a mixing calculation is performed on the preset color value using the mixing weight to obtain an initial magma color, wherein the preset color value is used to define the magma effect of the rock ground crack effect; the target magma color is determined based on the brightness enhancement parameter and the initial magma color.

[0225] Optionally, the computer-readable storage medium is also configured to store program codes for executing the following steps: sampling the target color map to obtain the target rock color and special effect transparency corresponding to the rock ground crack special effect; calculating the target special effect color based on the target rock color, target magma color, the first target light and shadow result, the second target light and shadow result, and the basic height data in the target sampling result.

[0226] Optionally, the computer-readable storage medium is also configured to store program codes for executing the following steps: multiplying the target rock color by the first target light and shadow result to obtain a first value; multiplying the basic height data by the second target light and shadow result to obtain a second value; performing interpolation calculations based on the first value, the second value and the target magma color to obtain a target special effect color.

[0227] Optionally, the computer-readable storage medium is also configured to store program codes for executing the following steps: visual presentation parameters include target color parameters and target transparency parameters; multiplying the target special effect color and the color channel of the vertex color to obtain the target color parameters; multiplying the special effect transparency and the transparency channel of the vertex color to obtain the target transparency parameters.

[0228] Optionally, the computer-readable storage medium is also configured to store program codes for executing the following steps: generating a special effects material file based on visual performance parameters in a virtual shader; assigning values ​​to patch particles in a special effects editor according to the special effects material file to obtain target particle special effects; and rendering a fragmentation special effect using the target particle special effects to obtain a target scene image.

[0229] In the computer-readable storage medium of the above embodiment, a technical solution for realizing a method for generating a picture is provided. Obtain a target composite map corresponding to a virtual scene, wherein the target composite map is used to characterize the surface concave-convex information of the area to be generated corresponding to the fragmentation special effect; perform a height offset mixed sampling on the target composite map to obtain a target sampling result; determine the visual performance parameters corresponding to the fragmentation special effect using the target sampling result and the target light source information, wherein the target light source information is determined by the current viewing angle of the virtual camera in the virtual scene; based on the visual performance parameters, render the fragmentation special effect in the area to be generated to obtain the target scene picture. Therefore, the present application generates the fragmentation special effect of the corresponding area based on the surface concave-convex information, which has a lower cost and less limitation on application in different scenes than the solution of directly using surface particles to make special effects. That is to say, the present application achieves the purpose of generating a scene picture of a fragmentation special effect containing a concave-convex effect at a lower cost, thereby achieving the technical effect of improving the scene applicability and reducing the cost of the fragmentation special effect picture generation solution while ensuring the realism of the fragmentation special effect picture, thereby solving the technical problem that the production solution of the fragmentation special effect picture containing a concave-convex effect in the related art is high in cost and has strong scene limitations.

[0230] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation methods of the present application.

[0231] In an exemplary embodiment of the present application, a program product capable of implementing the above method of the present embodiment is stored on a computer-readable storage medium. In some possible implementations, various aspects of the embodiments of the present application can also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary implementations of the present application described in the above "Exemplary Method" section of the present embodiment.

[0232] According to the program product for implementing the above method in the embodiment of the present application, it can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the embodiment of the present application is not limited thereto. In the embodiment of the present application, the computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0233] The program product may be in any combination of one or more computer-readable media. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive) of computer-readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0234] It should be noted that the program code contained in the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.

[0235] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0236] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0237] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0238] S1, obtaining a target composite map corresponding to the virtual scene, wherein the target composite map is used to represent surface concave-convex information of the area to be generated corresponding to the fragmentation special effect;

[0239] S2, performing height offset mixed sampling on the target composite map to obtain the target sampling result;

[0240] S3, determining visual performance parameters corresponding to the fragmentation effect using the target sampling result and the target light source information, wherein the target light source information is determined by the current viewing angle of the virtual camera in the virtual scene;

[0241] S4, based on the visual performance parameters, rendering the fragmentation effect in the area to be generated to obtain the target scene image.

[0242] Optionally, the above-mentioned processor can also be configured to execute the following steps through a computer program: obtaining height information corresponding to the area to be generated; performing gradient calculation on the height information to obtain initial normal information corresponding to the area to be generated; performing Gaussian blur processing on the height information to obtain blurred height data; and generating a target composite map based on the initial normal information, the height information and the blurred height data.

[0243] Optionally, the processor may also be configured to perform the following steps through a computer program: remapping sampling of the target composite map to obtain a first sampling result; performing height offset sampling of the target composite map based on the first sampling result to obtain a second sampling result; and mixing the first sampling result and the second sampling result to obtain a target sampling result.

[0244] Optionally, the processor may also be configured to perform the following steps through a computer program: the first sampling result includes: target normal information, basic height data, and basic slope data; the initial normal information stored in the first channel of the target composite map is sampled and remapped to obtain the target normal information; the height information stored in the second channel of the target composite map is sampled to obtain basic height data; the blurred height data stored in the third channel of the target composite map is sampled to obtain basic slope data.

[0245] Optionally, the above-mentioned processor can also be configured to perform the following steps through a computer program: perform a concave-convex offset calculation based on basic height data, preset convex height parameters and reference plane height data corresponding to the area to be generated to generate a height offset map; sample the target composite map based on the height offset map to obtain a second sampling result.

[0246] Optionally, the processor may also be configured to perform the following steps through a computer program: the second sampling result includes offset normal information; the initial normal information in the target composite map is sampled based on the height offset map to obtain a normal sampling result; and the normal sampling result is multiplied by a preset normal strength parameter to obtain offset normal information.

[0247] Optionally, the above-mentioned processor can also be configured to perform the following steps through a computer program: create a perspective light source according to the current perspective; superimpose the perspective light source with the top light source vector to generate target light source information, wherein the top light source vector is used to simulate a virtual top light source in a virtual scene.

[0248] Optionally, the processor may also be configured to perform the following steps through a computer program: using the target sampling results and the target light source information to generate light and shadow calculation results corresponding to the fragmentation effect; using the target sampling results, the target color map and the light and shadow calculation results to calculate the target special effect color and special effect transparency corresponding to the fragmentation effect, wherein the target color map is used to define the surface material effect of the fragmentation effect; determining the visual performance parameters based on the target special effect color, special effect transparency and vertex color of the patch particles corresponding to the fragmentation effect.

[0249] Optionally, the processor can also be configured to perform the following steps through a computer program: determine normal mixing data based on the target sampling result, wherein the normal mixing data is obtained by mixing the offset normal information with the target normal information; and generate light and shadow calculation results using the normal mixing data and the target light source information.

[0250] Optionally, the processor can also be configured to perform the following steps through a computer program: the light and shadow calculation results include a first target light and shadow result and a second target light and shadow result; a lighting simulation is performed using normal mixing data and target light source information to generate a first initial light and shadow result corresponding to the fragmentation effect; a smoothing calculation is performed based on the first initial light and shadow result and a preset dark area intensity parameter to obtain a first target light and shadow result; a binarization calculation is performed based on the first initial light and shadow result and a step mapping threshold to obtain a second target light and shadow result.

[0251] Optionally, the processor can also be configured to perform the following steps through a computer program: the fragmentation effect is a rock ground crack effect; interpolation calculation is performed based on the transition color intensity parameters corresponding to the geometric mask and the rock ground crack effect to obtain a brightness enhancement parameter, wherein the transition color intensity parameter is used to determine the color transition effects corresponding to the inside of the area to be generated and the outside of the area to be generated respectively; a second initial light and shadow result is calculated using the target light source information and the offset normal information in the target sampling result; the second initial light and shadow result is multiplied by the basic slope data in the target sampling result to obtain a mixing weight; a mixing calculation is performed on the preset color value using the mixing weight to obtain an initial magma color, wherein the preset color value is used to define the magma effect of the rock ground crack effect; based on the brightness enhancement parameter and the initial magma color, the target magma color is determined.

[0252] Optionally, the above-mentioned processor can also be configured to perform the following steps through a computer program: sampling the target color map to obtain the target rock color and special effect transparency corresponding to the rock ground crack special effect; calculating the target special effect color based on the target rock color, target magma color, the first target light and shadow result, the second target light and shadow result and the basic height data in the target sampling result.

[0253] Optionally, the processor can also be configured to execute the following steps through a computer program: multiplying the target rock color by the first target light and shadow result to obtain a first value; multiplying the basic height data by the second target light and shadow result to obtain a second value; performing interpolation calculations based on the first value, the second value and the target magma color to obtain the target special effect color.

[0254] Optionally, the above-mentioned processor can also be configured to perform the following steps through a computer program: visual presentation parameters include target color parameters and target transparency parameters; multiplying the color channels of the target special effect color and the vertex color to obtain the target color parameters; multiplying the special effect transparency and the transparency channel of the vertex color to obtain the target transparency parameters.

[0255] Optionally, the processor can also be configured to perform the following steps through a computer program: generate a special effects material file based on the visual performance parameters in the virtual shader; assign values ​​to the patch particles in the special effects editor according to the special effects material file to obtain the target particle special effects; and use the target particle special effects to render the fragmentation special effects to obtain the target scene image.

[0256] In the electronic device of the above embodiment, a technical solution for realizing a method for generating a picture is provided. Obtain a target composite map corresponding to a virtual scene, wherein the target composite map is used to characterize the surface concave-convex information of the area to be generated corresponding to the fragmentation special effect; perform a height offset mixed sampling on the target composite map to obtain a target sampling result; determine the visual performance parameters corresponding to the fragmentation special effect using the target sampling result and the target light source information, wherein the target light source information is determined by the current viewing angle of the virtual camera in the virtual scene; based on the visual performance parameters, render the fragmentation special effect in the area to be generated to obtain the target scene picture. Therefore, the present application generates the fragmentation special effect of the corresponding area based on the surface concave-convex information, which has a lower cost and less limitation on application in different scenes than the solution of directly using surface particles to make special effects. That is to say, the present application achieves the purpose of generating a scene picture of a fragmentation special effect containing a concave-convex effect at a lower cost, thereby achieving the technical effect of improving the scene applicability and reducing the cost of the fragmentation special effect picture generation solution while ensuring the realism of the fragmentation special effect picture, thereby solving the technical problem that the production solution of the fragmentation special effect picture containing a concave-convex effect in the related art is high in cost and has strong scene limitations.

[0257] Fig.10 is a schematic diagram of an electronic device according to one embodiment of the present application. Fig.10 As shown, the electronic device 1000 is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0258] like Fig.10As shown, the electronic device 1000 is in the form of a general computing device. The components of the electronic device 1000 may include but are not limited to: the at least one processor 1010, the at least one memory 1020, a bus 1030 connecting different system components (including the memory 1020 and the processor 1010), and a display 1040.

[0259] The memory 1020 stores program codes, which can be executed by the processor 1010, so that the processor 1010 executes the steps described in the method part of the embodiment of the present application according to various exemplary implementations of the present application.

[0260] The memory 1020 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 10201 and / or a cache memory unit 10202, and may further include a read-only memory unit (ROM) 10203, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.

[0261] In some examples, the memory 1020 may also include a program / utility 10204 having a set (at least one) of program modules 10205, such program modules 10205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof may include the implementation of a network environment. The memory 1020 may further include a memory remotely disposed relative to the processor 1010, and these remote memories may be connected to the electronic device 1000 via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0262] The bus 1030 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a local bus of the processor 1010, or a bus using any of a variety of bus architectures.

[0263] The display 1040 may be, for example, a touch screen liquid crystal display (LCD), which may enable a user to interact with a user interface of the electronic device 1000 .

[0264] Optionally, the electronic device 1000 may also communicate with one or more external devices 1100 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device 1000, and / or any device that enables the electronic device 1000 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface 1050. Furthermore, the electronic device 1000 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 1060. Fig.10 As shown, the network adapter 1060 communicates with other modules of the electronic device 1000 via the bus 1030. It should be understood that although Fig.10 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 1000, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, disk arrays (Redundant Arrays of Independent Disks, RAID) systems, tape drives, and data backup storage systems.

[0265] The electronic device 1000 may further include: a keyboard, a cursor control device (such as a mouse), an input / output interface (I / O interface), a network interface, a power supply and / or a camera.

[0266] It can be understood by those skilled in the art that Fig.10 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig.10 More or fewer components as shown, or with Fig.10 The memory 1020 may be used to store computer programs and corresponding data, such as the computer programs and corresponding data corresponding to the screen generation method in the embodiment of the present application. The processor 1010 executes various functional applications and data processing by running the computer programs stored in the memory 1020, that is, implementing the above-mentioned screen generation method.

[0267] The embodiment of the present application further provides a computer program product. Optionally, in this embodiment, the computer program product may include a computer program, and the computer program implements the method provided in the embodiment when executed by a processor.

[0268] The present application also provides a computer program product. Optionally, the computer program product may include a non-volatile computer-readable storage medium, which may be used to store a computer program, and the computer program implements the method provided in the above embodiment when executed by a processor.

[0269] The embodiment of the present application further provides a computer program. Optionally, in this embodiment, when the computer program is executed by a processor, the method provided in the above embodiment is implemented.

[0270] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0271] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0272] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0273] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0274] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0275] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly or all or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0276] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A screen generation method, characterized in that: include: Acquire a target composite map corresponding to the virtual scene, wherein the target composite map is used to represent surface concave-convex information of the area to be generated corresponding to the fragmentation special effect; Performing height-offset mixed sampling on the target composite map to obtain a target sampling result; Determine visual performance parameters corresponding to the fragmentation special effect by using the target sampling result and target light source information, wherein the target light source information is determined by a current viewing angle of a virtual camera in the virtual scene; Based on the visual performance parameters, the fragmentation effect is rendered in the area to be generated to obtain a target scene image.

2. The screen generation method according to claim 1, characterized in that: Acquiring the target composite map corresponding to the virtual scene includes: Obtaining height information corresponding to the area to be generated; Performing gradient calculation on the height information to obtain initial normal information corresponding to the area to be generated; Performing Gaussian blur processing on the height information to obtain blurred height data; The target composite map is generated based on the initial normal information, the height information and the blurred height data.

3. The screen generation method according to claim 1, characterized in that: Performing height offset mixed sampling on the target composite map to obtain the target sampling result includes: Remapping and sampling the target composite map to obtain a first sampling result; Performing height offset sampling on the target composite map based on the first sampling result to obtain a second sampling result; The first sampling result and the second sampling result are mixed to obtain a target sampling result.

4. The screen generation method according to claim 3, characterized in that: The first sampling result includes: target normal information, basic height data and basic slope data; remapping sampling is performed on the target composite map, and the first sampling result obtained includes: Sampling and remapping the initial normal information stored in the first channel of the target composite map to obtain target normal information; Sampling the height information stored in the second channel of the target composite map to obtain the basic height data; The fuzzy height data stored in the third channel of the target composite map is sampled to obtain the basic slope data.

5. The screen generation method according to claim 4, characterized in that: Performing height offset sampling on the target composite map based on the first sampling result to obtain the second sampling result includes: Performing a concave-convex offset calculation based on the basic height data, a preset convex height parameter and the reference plane height data corresponding to the area to be generated to generate a height offset map; The target composite map is sampled based on the height offset map to obtain the second sampling result.

6. The screen generation method according to claim 5, characterized in that: The second sampling result includes offset normal information; Sampling the target composite map based on the height offset map to obtain the second sampling result includes: Sampling the initial normal information in the target composite map based on the height offset map to obtain a normal sampling result; The normal sampling result is multiplied by a preset normal strength parameter to obtain the offset normal information.

7. The screen generation method according to claim 1, characterized in that: The screen generation method further includes: Creating a perspective light source according to the current perspective; The viewing angle light source is superimposed on a top light source vector to generate the target light source information, wherein the top light source vector is used to simulate a virtual top light source in the virtual scene.

8. The screen generation method according to claim 1 or 7, characterized in that: Determining the visual performance parameter corresponding to the fragmentation special effect by using the target sampling result and the target light source information includes: Using the target sampling result and the target light source information, generating a light and shadow calculation result corresponding to the fragmentation special effect; The target special effect color and special effect transparency corresponding to the fragmentation special effect are calculated using the target sampling result, the target color map and the light and shadow calculation result, wherein the target color map is used to define the surface material effect of the fragmentation special effect; The visual performance parameters are determined based on the target special effect color, the special effect transparency, and the vertex colors of the patch particles corresponding to the fragmentation special effect.

9. The screen generation method according to claim 8, characterized in that: Using the target sampling result and the target light source information to generate the light and shadow calculation result corresponding to the fragmentation special effect includes: Based on the target sampling result, determining normal mixing data, wherein the normal mixing data is obtained by mixing the offset normal information and the target normal information; The light and shadow calculation result is generated by using the normal mixing data and the target light source information.

10. The screen generation method according to claim 9, characterized in that: The light and shadow calculation result includes a first target light and shadow result and a second target light and shadow result; Using the normal blending data and the target light source information to generate the light and shadow calculation result includes: Performing illumination simulation using the normal blending data and the target light source information to generate a first initial light and shadow result corresponding to the fragmentation special effect; Performing a smoothing calculation based on the first initial light and shadow result and a preset dark part intensity parameter to obtain the first target light and shadow result; A binarization calculation is performed based on the first initial light and shadow result and the step mapping threshold to obtain the second target light and shadow result.

11. The screen generation method according to claim 10, characterized in that: The fragmentation special effect is a rock cracking special effect; the picture generation method also includes: Based on the geometric mask and the transition color intensity parameters corresponding to the rock ground crack special effect, an interpolation calculation is performed to obtain a brightness enhancement parameter, wherein the transition color intensity parameters are used to determine the color transition effects corresponding to the inside of the to-be-generated area and the outside of the to-be-generated area respectively; Calculating a second initial light and shadow result using target light source information and offset normal information in the target sampling result; Performing multiplication calculation on the second initial light and shadow result and the basic slope data in the target sampling result to obtain a mixing weight; Using the mixing weight to perform mixing calculation on the preset color value to obtain an initial magma color, wherein the preset color value is used to define the magma effect of the rock ground crack special effect; Based on the brightness enhancement parameter and the initial magma color, a target magma color is determined.

12. The screen generation method according to claim 11, characterized in that: Calculating the target special effect color using the target sampling result, the target color map and the light and shadow calculation result includes: Sampling the target color map to obtain the target rock color corresponding to the rock ground crack special effect and the transparency of the special effect; The target special effect color is calculated based on the target rock color, the target magma color, the first target light and shadow result, the second target light and shadow result, and the basic height data in the target sampling result.

13. The screen generation method according to claim 12, characterized in that: The target special effect color is calculated based on the target rock color, the target magma color, the first target light and shadow result, the second target light and shadow result and the basic height data, including: Multiplying the target rock color by the first target light and shadow result to obtain a first value; Multiplying the base height data by the second target light and shadow result to obtain a second value; An interpolation calculation is performed based on the first value, the second value and the target magma color to obtain the target special effect color.

14. The screen generation method according to claim 8, characterized in that: The visual performance parameters include target color parameters and target transparency parameters; Determining the visual performance parameter based on the target special effect color, the special effect transparency, and the vertex color includes: Perform multiplication calculation on the target special effect color and the color channel of the vertex color to obtain the target color parameter; The special effect transparency is multiplied by the transparency channel of the vertex color to obtain the target transparency parameter.

15. The screen generation method according to claim 1, characterized in that: Based on the visual performance parameters, rendering the fragmentation effect in the to-be-generated area to obtain the target scene picture includes: Generate a special effect material file based on the visual performance parameters in the virtual shader; Assign values ​​to the patch particles in the special effects editor according to the special effects material file to obtain target particle special effects; The target particle special effect is used to render the fragmentation special effect to obtain the target scene picture.

16. A screen generating device, characterized in that: include: An acquisition module, used to acquire a target composite map corresponding to a virtual scene, wherein the target composite map is used to characterize surface concave-convex information of a region to be generated corresponding to a fragmentation special effect; A sampling module, used for performing height offset mixed sampling on the target composite map to obtain a target sampling result; A calculation module, used to determine visual performance parameters corresponding to the fragmentation special effect by using the target sampling result and target light source information, wherein the target light source information is determined by a current viewing angle of a virtual camera in the virtual scene; A generation module is used to render the fragmentation effect in the to-be-generated area based on the visual performance parameters to obtain a target scene image.

17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the screen generation method according to any one of claims 1 to 15 when executed by a processor.

18. An electronic device comprising a memory and a processor, characterized in that: The memory stores a computer program, and the processor is configured to run the computer program to execute the screen generating method according to any one of claims 1 to 15.

19. A computer program product, characterized in that The invention comprises a computer program, which implements the screen generating method described in any one of claims 1 to 15 when being executed by a processor.