Display switching method, device, electronic device and storage medium

Through the two-way dissolving method and the technical means of timestamp alignment, the problems of smooth game model switching and insufficient interactivity in the existing technology are solved, the fluency and interactivity are improved, and the development cost is reduced.

CN118379420BActive Publication Date: 2024-10-01NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410834492.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-26
Publication Date
2024-10-01
Estimated Expiration
2044-06-26

AI Technical Summary

Technical Problem

Among the existing game model switching methods, the fade-in, fade-out and one-way dissolve methods result in an insufficiently smooth model transition, affecting fluency, and lack of display of model interactivity.

Method used

The two-way dissolving method is used to generate the same dissolving effect through the same shader information, so that the game model can seamlessly switch from the first effect model to the second effect model, and the timestamps are aligned during the forward dissolving and reverse dissolving processes, showing Interactivity between models.

Benefits of technology

It improves the smoothness and interactivity of game model switching effects, achieves seamless effect model switching, and reduces game development costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118379420B_ABST
    Figure CN118379420B_ABST
Patent Text Reader

Abstract

The present application relates to the field of computer technology, and discloses a display switching method, device, electronic device and storage medium, the method comprising: displaying a game model and its first effect model in a game page; responding to a switching instruction for the first effect model, obtaining shader information and a second effect model; generating a first dissolve effect of the first effect model and a second dissolve effect of the second effect model based on the shader information; dissolving the first effect model forward with the first dissolve effect, and dissolving the second effect model reversely with the second dissolve effect, so as to control the game model to switch from the first effect model to the second effect model. The present application generates a first dissolve effect and a second dissolve effect with the same dissolve effect, so that the effect model can be seamlessly switched, improving the fluency of the game model switching effect, and the first effect model dissolves forward and disappears while the second effect model dissolves reversely, improving the interactivity of the effect model of the game model.
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 in particular to a display switching method, device, electronic device and storage medium. Background Art

[0002] In game development, model switching effects are a common requirement. Currently, the transition effects when switching models are mainly achieved through methods such as fade-in and fade-out and one-way dissolve. Fade-in and fade-out achieve the transition effect by changing the transparency value of the model. However, during the switching process, the transparency of the model is gradually increased or decreased, so that the model appears or disappears smoothly, and the change in transparency may not be smooth enough, resulting in visual discontinuity, thus affecting the smoothness of the switching effect. One-way dissolve gradually discards part of the pixels of the model, making the model gradually disappear, thereby achieving a smooth model transition effect. However, one-way dissolve lacks the mutual influence between the two models during the model switching process, so it cannot effectively show the interactivity between models. Summary of the invention

[0003] In response to the above problems, the embodiments of the present application provide a display switching method, device, electronic device and storage medium, which can improve the smoothness of the switching effect of the game model and improve the interactivity of the effect model of the game model.

[0004] In a first aspect, an embodiment of the present application provides a display switching method, comprising:

[0005] Displaying a game model and a first effect model of the game model on a game page;

[0006] In response to a switch instruction for the first effect model, obtaining shader information and a second effect model;

[0007] generating a first dissolve effect of the first effect model and a second dissolve effect of the second effect model based on the shader information;

[0008] Dissolving the first effect model forward with the first dissolving effect, and dissolving the second effect model backward with the second dissolving effect, so as to control the game model to switch from the first effect model to the second effect model;

[0009] Wherein, the forward dissolution represents the elimination of pixels of the first effect model; the reverse dissolution represents the display of pixels of the second effect model; and the timestamp of the forward dissolution is aligned with the timestamp of the reverse dissolution.

[0010] In a second aspect, an embodiment of the present application provides a display switching device, comprising:

[0011] A display module, used for displaying a game model and a first effect model of the game model in a game page;

[0012] An acquisition module, configured to respond to a switching instruction for a first effect model and acquire shader information and a second effect model;

[0013] a generating module, configured to generate a first dissolving effect of the first effect model and a second dissolving effect of the second effect model based on the shader information;

[0014] An effect switching module, configured to perform forward dissolution of the first effect model using the first dissolution effect, and reverse dissolution of the second effect model using the second dissolution effect, so as to control the game model to switch from the first effect model to the second effect model;

[0015] Wherein, the forward dissolution represents the elimination of pixels of the first effect model; the reverse dissolution represents the display of pixels of the second effect model; and the timestamp of the forward dissolution is aligned with the timestamp of the reverse dissolution.

[0016] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a memory storing a plurality of computer programs; a processor loads the computer program from the memory to execute any one of the display switching methods provided in the embodiments of the present application.

[0017] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores a plurality of computer programs, and the computer programs are suitable for loading by a processor to execute any display switching method provided in the embodiment of the present application.

[0018] In a fifth aspect, an embodiment of the present application further provides a computer program product, the computer program product including a computer program, and when the computer program is executed by a processor, any one of the display switching methods provided in the embodiments of the present application is implemented.

[0019] The embodiment of the present application generates a first dissolve effect and a second dissolve effect with the same dissolve effect according to the same shader information, so that the game model can switch seamlessly from the first effect model to the second effect model, thereby improving the smoothness of the game model switching effect. At the same time, during the forward dissolution of the first effect model and the reverse dissolution of the second effect model, the timestamp of the forward dissolution is aligned with the timestamp of the reverse dissolution, that is, the forward dissolution of the first effect model disappears while the reverse dissolution of the second effect model is displayed, which can effectively demonstrate the interactivity between the effect models, thereby improving the interactivity of the effect models of the game model. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 is a flow chart of a display switching method provided in an embodiment of the present application;

[0022] Figure 2 It is a structural diagram of an application scenario of the game model provided in an embodiment of the present application;

[0023] Figure 3 is a schematic diagram of a process for generating a first dissolution effect provided in an embodiment of the present application;

[0024] Figure 4 is a schematic diagram of a process for generating a second dissolution effect provided in an embodiment of the present application;

[0025] Figure 5 is a schematic diagram of the structure of a display switching device provided in an embodiment of the present application;

[0026] Figure 6 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] The technical solutions 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, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application. At the same time, in the description of the embodiments of the present application, the terms "first", "second", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0028] The embodiments of the present application provide a display switching method, device, electronic device and storage medium. Specifically, the embodiments of the present application will be described from the perspective of a display switching device, which can be specifically integrated in an electronic device, that is, the display switching method of the embodiments of the present application can be executed by an electronic device. Optionally, the electronic device includes a terminal device. The terminal device can be a mobile phone, a tablet computer, a laptop computer, a game console, or a personal computer (PC) and other devices. Optionally, the electronic device includes a server, which can be an independent server or a server network or server cluster composed of servers, including but not limited to computers, network hosts, single network servers, network server sets or cloud servers composed of servers. Among them, the cloud server is composed of a large number of computers or network servers based on cloud computing (Cloud Computing).

[0029] It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments. Although the logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in an order different from that shown in the drawings.

[0030] In game development, model switching effects are a common requirement. Currently, the transition effects when switching models are mainly achieved through methods such as fade-in and fade-out and one-way dissolve. Fade-in and fade-out achieve the transition effect by changing the transparency value of the model. However, during the switching process, the transparency of the model is gradually increased or decreased, so that the model appears or disappears smoothly, and the change in transparency may not be smooth enough, resulting in visual discontinuity, thus affecting the smoothness of the switching effect. One-way dissolve gradually discards part of the pixels of the model, making the model gradually disappear, thereby achieving a smooth model transition effect. However, one-way dissolve lacks the mutual influence between the two models during the model switching process, so it cannot effectively show the interactivity between models.

[0031] In order to solve the problems in the prior art, the inventor of the present application proposed a bidirectional dissolution method, that is, in the process of model switching effect, a first dissolution effect and a second dissolution effect with the same dissolution effect are generated according to the same shader information, so that the game model can seamlessly switch from the first effect model to the second effect model, thereby improving the smoothness of the game model switching effect. At the same time, in the process of forward dissolution of the first effect model and reverse dissolution of the second effect model, the timestamp of the forward dissolution is aligned with the timestamp of the reverse dissolution, that is, the forward dissolution of the first effect model disappears while the reverse dissolution of the second effect model is displayed, which can effectively demonstrate the interactivity between the effect models, thereby improving the interactivity of the effect models of the game model.

[0032] Glossary:

[0033] Game models refer to virtual game objects designed and made in proportion to the scenes, characters and props within the game, such as virtual game characters, virtual game pets, etc.

[0034] OpenGL is a specification developed and maintained by the Khronos organization, which contains a series of functions that can operate graphics and images.

[0035] GLSL is a language used for shading programming in OpenGL. The shader code is generally divided into two parts: Vertex Shader and Fragment Shader.

[0036] Shader is an editable program used to implement image rendering and replace the fixed rendering pipeline. Among them, the vertex shader is mainly responsible for the calculation of the geometric relationship of vertices, and the fragment shader is mainly responsible for the calculation of fragment color.

[0037] A noise map is a texture map that represents a noise function in computer graphics.

[0038] Interpolation: Find the pattern in a known data sequence (such as a series of discrete points), and then use the pattern to make numerical estimates of the points that have no data records yet.

[0039] Linear interpolation: perform numerical estimation based on the two adjacent data points on the left and right of the point to be interpolated in the one-dimensional data sequence (the weight of the numerical estimation is allocated according to the distance to the two points).

[0040] The alpha value refers to the transparency of the color, which determines whether the object behind an object can be seen through it. In computer graphics, the alpha value is usually represented by a floating point number between 0 and 1, where 0 means completely transparent and 1 means completely opaque.

[0041] API (Application Programming Interface) is a set of predefined functions that aims to provide applications and developers with the ability to access a set of routines based on certain software or hardware without having to access the source code or understand the details of the internal working mechanism.

[0042] Optionally, the execution subject of the embodiment of the present application can be described as a display switching device, which is described in detail below with reference to the accompanying drawings.

[0043] Optional, reference Figure 1 , Figure 11 is a flow chart of the display switching method provided in the embodiment of the present application. In one embodiment, the specific flow of the display switching method provided in the embodiment of the present application may be as follows: Steps 10 to 40, including:

[0044] Step 10: Display the game model and the first effect model of the game model on the game page.

[0045] In the embodiment of the present application, the display switching device provides a graphical user interface through the terminal device, and displays the game screen in the graphical user interface, wherein the game screen at least partially includes a virtual scene and a controlled game virtual object located in the virtual scene, wherein the game virtual object can be a game model in any form, depending on the setting, type and goal of the game, such as a large multi-limbed monster model, a large mechanical model, a vehicle model, etc., or a virtual game character, a virtual animal character, etc. If the game model is a virtual game character, refer to Figure 2 , Figure 2 It is a structural diagram of an application scenario of the game model provided in an embodiment of the present application.

[0046] Optionally, the display switching device displays the game model and the first effect model of the game model in the game page, wherein the effect model can be understood as the visual appearance of the game model, including its appearance, texture, lighting effect, animation, etc. The effect model is usually determined by multiple factors, including the geometric shape, material texture, texture, lighting and shadow effects, etc. of the game model.

[0047] Step 20: In response to a switch instruction for the first effect model, shader information and a second effect model are acquired.

[0048] Optionally, the display switching device responds to a switching instruction for the first effect model, wherein the switching instruction may be triggered by a user clicking on the game screen, or may be automatically triggered by the display switching device.

[0049] Therefore, in the case where the switching instruction is triggered by the user clicking on the game screen, when the effect of the game model needs to be switched, the user clicks the switch control on the game screen. At this time, the display switching device will pop up a list of effect models on the game screen, and the user can slide the effect model list to select the effect model to be switched, thereby obtaining a second effect model. Alternatively, the user clicks the switch control on the game screen. At this time, the display switching device will pop up an input box for the model ID (Identity Document) on the game screen, and the user enters the target model ID of the effect model to be switched in the input box. The display switching device matches the effect model data according to the target model ID to obtain the second effect model.

[0050] Furthermore, in the case where the switching instruction is automatically triggered by the display switching device, a preset effect switching procedure is set, such as setting the first effect model to be displayed for a preset time, and then switching the first effect model to the second effect model with a model ID of XXX, and the preset time is 10 seconds, 30 seconds, 1 minute, etc. Therefore, after the display switching device displays the first effect model of the game model for a preset time, it matches the effect model data according to the model ID to obtain the second effect model.

[0051] Furthermore, the display switching device obtains shader information, wherein the shader information includes noise map information, dissolution speed parameters, dissolution edge color, dissolution edge area ratio, and dissolution factor parameters.

[0052] Optionally, the noise map information may be a preset noise map, or a map path of a preset noise map, where the map path is a link for loading the preset noise map. Therefore, if the noise map information is a preset noise map A, a preset noise map B, etc., the preset noise map is pre-configured by the user according to the requirements. The noise map information may also be xxxx.html, xxxx.com, etc.

[0053] Optionally, the dissolution speed parameter is used to control the dissolution speed of the pixels of the effect model, simulating the effect of the effect model gradually disappearing. It can be a fixed speed value or a dynamic value determined by other factors. For example, the dissolution speed parameter is a fixed value of 0.1.

[0054] Optionally, the dissolve edge color is pre-configured by the user according to the needs. The dissolve edge color is a four-dimensional vector corresponding to the values ​​of the four channels of RGBA (red, green, blue, and transparency). The first component represents the value of the red channel, ranging from 0 to 1. The second component represents the value of the green channel, ranging from 0 to 1. The third component represents the value of the blue channel, ranging from 0 to 1. The fourth component represents the value of the transparency channel, ranging from 0 to 1, where 0 represents completely transparent and 1 represents completely opaque.

[0055] Optionally, the dissolving edge area ratio refers to the proportion of the edge area during the dissolving process. Therefore, the edge width of the dissolving effect can be controlled by adjusting the dissolving edge area ratio, thereby affecting the appearance of the dissolving effect of the effect model.

[0056] Optionally, the dissolution factor parameter is a parameter that controls the degree of dissolution of the effect model, and is usually a value between 0 and 1, where 0 indicates that the effect model is not dissolved at all and 1 indicates that the effect model is completely dissolved.

[0057] Step 30 : Generate a first dissolve effect of the first effect model and a second dissolve effect of the second effect model based on the shader information.

[0058] Optionally, the display switching device generates a first dissolution effect of the first effect model according to the shader information, and at the same time, generates a second dissolution effect of the second effect model according to the shader information, that is, the first dissolution effect and the second dissolution effect are generated according to the noise map information, dissolution speed parameters, dissolution edge color, dissolution edge area ratio, and dissolution factor parameters, as specifically described in step 301.

[0059] It should be noted that the embodiment of the present application generates the first dissolve effect and the second dissolve effect according to the same shader information, and therefore, the first dissolve effect and the second dissolve effect are the same.

[0060] Step 40, dissolving the first effect model forward with a first dissolving effect, and dissolving the second effect model backward with a second dissolving effect, so as to control the game model to switch from the first effect model to the second effect model.

[0061] Optionally, the display switching device dissolves the first effect model forward with a first dissolving effect, and at the same time, dissolves the second effect model backward with a second dissolving effect, wherein the forward dissolving represents the elimination of pixels of the first effect model, and the backward dissolving represents the display of pixels of the second effect model. Therefore, it can be understood that the display switching device eliminates the pixels of the first effect model with a first dissolving effect, and at the same time, displays the pixels of the second effect model with a second dissolving effect, so that the pixels displayed by the second effect model cover the pixels eliminated by the first effect model, thereby switching the game model from the first effect model to the second effect model, and realizing a seamless dissolving switching effect between the effect models of the game model.

[0062] It should be noted that the forward dissolution area of ​​the first effect model in the forward dissolution process of the embodiment of the present application overlaps with the reverse dissolution area of ​​the second effect model in the reverse dissolution process, that is, the pixel elimination area of ​​the forward dissolution of the first effect model overlaps with the pixel display area of ​​the reverse dissolution of the second effect model. It should be noted that the overlap in the embodiment of the present application refers to the overlap of the positive and reverse dissolution areas, not the overlap of the effect model itself.

[0063] Optionally, the timestamp of the forward dissolution in the embodiment of the present application is aligned with the timestamp of the reverse dissolution, which can also be understood as the alignment of the pixel frame eliminated by the first effect model with the pixel frame displayed by the second effect model, wherein the timestamp alignment includes forward alignment and reverse alignment.

[0064] For timestamp alignment, it is forward alignment, that is, the starting time point of the first pixel frame in the forward dissolving first effect model is consistent with the starting time point of the first pixel frame in the reverse dissolving second effect model, and the ending time point of the last pixel frame in the forward dissolving first effect model is consistent with the ending time point of the last pixel frame in the reverse dissolving second effect model. Therefore, it can be understood that when the first pixel frame in the first effect model is eliminated, the first pixel frame in the second effect model is displayed, and when the last pixel frame in the first effect model is eliminated, the last pixel frame in the second effect model is displayed, and the pixel frames eliminated and displayed in the middle are also forward aligned.

[0065] In one embodiment, the first effect model includes pixel frame 1, pixel frame 2, ..., pixel frame 10, and the second effect model includes pixel frame A, pixel frame B, ..., pixel frame J, pixel frame 1 is aligned with pixel frame A, pixel frame 2 is aligned with pixel frame B, ..., pixel frame 10 is aligned with pixel frame J. During the process of effect model switching, if the first effect model eliminates pixel frame 1, the second effect model displays pixel frame A; if the first effect model eliminates pixel frame 2, the second effect model displays pixel frame B; if the first effect model eliminates pixel frame 3, the second effect model displays pixel frame C; if the first effect model eliminates pixel frame 4, the second effect model displays pixel frame D; if the first effect model eliminates pixel frame 5, the second effect model displays pixel frame E; if the first effect model eliminates pixel frame 6, the second effect model displays pixel frame F; if the first effect model eliminates pixel frame 7, the second effect model displays pixel frame G; if the first effect model eliminates pixel frame 8, the second effect model displays pixel frame H; if the first effect model eliminates pixel frame 9, the second effect model displays pixel frame I; if the first effect model eliminates pixel frame 10, the second effect model displays pixel frame J.

[0066] For timestamp alignment in reverse alignment, the start time point of the first pixel frame in the forward dissolving first effect model is consistent with the start time point of the last pixel frame in the reverse dissolving second effect model, and the end time point of the last pixel frame in the forward dissolving first effect model is consistent with the end time point of the first pixel frame in the reverse dissolving second effect model. Therefore, it can be understood that when the first pixel frame in the first effect model is eliminated, the last pixel frame in the second effect model is displayed, and when the last pixel frame in the first effect model is eliminated, the first pixel frame in the second effect model is displayed, and the pixel frames eliminated and displayed in the middle are also reversely aligned.

[0067] In one embodiment, the first effect model includes pixel frame 1, pixel frame 2, ..., pixel frame 10, and the second effect model includes pixel frame A, pixel frame B, ..., pixel frame J, pixel frame 1 is aligned with pixel frame A, pixel frame 2 is aligned with pixel frame B, ..., pixel frame 10 is aligned with pixel frame J. During the process of effect model switching, if the first effect model eliminates pixel frame 1, the second effect model displays pixel frame J, if the first effect model eliminates pixel frame 2, the second effect model displays pixel frame I, if the first effect model eliminates pixel frame 3, the second effect model displays pixel frame H, if the first effect model eliminates pixel frame 4, the second effect model displays pixel frame G, if the first effect model eliminates pixel frame 5, the second effect model displays pixel frame F, if the first effect model eliminates pixel frame 6, the second effect model displays pixel frame E, if the first effect model eliminates pixel frame 7, the second effect model displays pixel frame D, if the first effect model eliminates pixel frame 8, the second effect model displays pixel frame C, if the first effect model eliminates pixel frame 9, the second effect model displays pixel frame B, and if the first effect model eliminates pixel frame 10, the second effect model displays pixel frame A.

[0068] The embodiment of the present application generates a first dissolve effect and a second dissolve effect with the same dissolve effect according to the same shader information, so that the game model can switch seamlessly from the first effect model to the second effect model, thereby improving the smoothness of the game model switching effect. At the same time, during the forward dissolution of the first effect model and the reverse dissolution of the second effect model, the timestamp of the forward dissolution is aligned with the timestamp of the reverse dissolution, that is, the forward dissolution of the first effect model disappears while the reverse dissolution of the second effect model is displayed, which can effectively demonstrate the interactivity between the effect models, thereby improving the interactivity of the effect models of the game model.

[0069] In one embodiment, the first effect model can be expressed by a first fragment shader, and the second effect model can be expressed by a second fragment shader, so it can be understood that the first fragment shader is forward dissolved with a first dissolve effect, and the second fragment shader is reversely dissolved with a second dissolve effect, so as to switch the game model from the first effect model to the second effect model. Therefore, the embodiment of the present application realizes the switching effect of the effect model by dissolving the fragment shader, without adding an additional animation model, thereby reducing performance overhead. At the same time, the embodiment of the present application only needs a fragment shader to realize the switching effect of the effect model, and does not require additional design and implementation of complex animation effects, thereby reducing the cost of game development.

[0070] In one embodiment, step 301 is described as follows:

[0071] Step 301 : generating a first dissolve effect of a first effect model and a second dissolve effect of a second effect model based on a preset package dissolve switching interface and shader information.

[0072] Optionally, the display switching device calls the dissolve interface through a preset encapsulated dissolve switching interface, and passes the shader information into the dissolve interface, and calls the dissolve interface to generate a first dissolve effect of the first effect model and a second dissolve effect of the second effect model according to the shader information.

[0073] Among them, the preset encapsulation dissolution switching interface in the embodiment of the present application is the dissolveSwitch (dissolution switch) interface, so it can be understood that the dissolution interface is called through the encapsulation dissolution switching interface dissolveSwitch, and the shader information is passed into the dissolution interface, and the dissolution interface is called to generate the first dissolution effect and the second dissolution effect according to the shader information, as described in steps 3011 to 3012.

[0074] The embodiment of the present application generates a first dissolve effect and a second dissolve effect by encapsulating a dissolve switching interface to achieve switching of effect models, thereby simplifying the complexity of interface calling and parameter passing.

[0075] In one embodiment, the description of step 3011 to step 3012 is as follows:

[0076] Step 3011, calling the forward dissolve interface based on the encapsulated dissolve switching interface, and passing the shader information to the forward dissolve interface, so as to call the forward dissolve interface to generate a first dissolve effect according to the shader information;

[0077] Step 3012: calling a reverse dissolve interface based on the encapsulated dissolve switching interface, and passing the shader information to the reverse dissolve interface, so as to call the reverse dissolve interface to generate a second dissolve effect according to the shader information.

[0078] Optionally, the dissolveSwitch interface in the embodiment of the present application can call the forward dissolve interface dissolve and the reverse dissolve interface dissolveReverse. Therefore, the dissolve interfaces in the embodiment of the present application are the forward dissolve interface dissolve and the reverse dissolve interface dissolveReverse.

[0079] Optionally, the display switching device calls the forward dissolve interface dissolve by encapsulating the dissolve switching interface dissolveSwitch, and passes the shader information to the forward dissolve interface dissolve, and calls the forward dissolve interface dissolve to generate a first dissolve effect according to the shader information, as described in steps 30111 to 30114. At the same time, the display switching device calls the reverse dissolve interface dissolveReverse by encapsulating the dissolve switching interface dissolveSwitch, and passes the shader information to the reverse dissolve interface dissolveReverse, and calls the reverse dissolve interface dissolveReverse to generate a second dissolve effect according to the shader information.

[0080] Therefore, the embodiment of the present application can be understood as calling the forward dissolve interface dissolve by encapsulating the dissolve switching interface dissolveSwitch to dissolve the first effect model. At the same time, calling the reverse dissolve interface dissolveReverse by encapsulating the dissolve switching interface dissolveSwitch to dissolve the second effect model, and passing the same shader information into the forward dissolve interface dissolve and the reverse dissolve interface dissolveReverse, respectively, and implementing the forward dissolve first effect model and the reverse dissolve second effect model in the forward dissolve interface dissolve and the reverse dissolve interface dissolveReverse.

[0081] It should be noted that there are many technical difficulties in the existing single-interface dissolution switching method, such as abrupt visual effects, discontinuous animation effects, and difficulty in expansion. In the face of the above technical difficulties, the present application simultaneously calls the forward dissolution interface and the reverse dissolution interface during the dissolution switching process. ① The same shader information is passed into the forward dissolution interface and the reverse dissolution interface, so that the effect of the forward dissolution interface and the effect of the reverse dissolution interface are the same, which better presents the switching effect of the effect model and achieves unexpected visual effects, so that the visual effect will not appear abrupt. ② Control the alignment of the timestamps of the forward dissolution interface and the reverse dissolution interface on the dissolution, so that the effect model can be switched seamlessly and the animation effect can be switched smoothly. ③ When it is necessary to modify the parameters or make other extensions, it is only necessary to pass in the corresponding modification parameters or extension parameters in the two interfaces, without modifying or extending the switching code or the switching program, so that it can be flexibly expanded.

[0082] The embodiment of the present application passes the same shader information into the forward dissolve interface and the reverse dissolve interface, thereby generating a first dissolve effect and a second dissolve effect with the same dissolve effect, so that the game model can seamlessly switch from the first effect model to the second effect model, thereby improving the smoothness of the game model switching effect.

[0083] It should be noted that, since the first dissolution effect and the second dissolution effect are the same, the present embodiment of the application is described in detail with respect to the process of generating the first dissolution effect. In one embodiment, the process of generating the first dissolution effect is as described in steps 30111 to 30114:

[0084] Step 30111, obtaining a model map of the first effect model;

[0085] Step 30112, sampling the noise map in the shader information to obtain first pixel data, and sampling the model map to obtain second pixel data;

[0086] Step 30113, sampling each color channel of the first pixel data to obtain a noise value of the first pixel data;

[0087] Step 30114: based on the first dissolution factor parameter in the shader information and the noise value of the first pixel data, the second pixel data is eliminated to generate a first dissolution effect.

[0088] It should be noted that before executing the generation of the first dissolve effect, the fragment shader Fragment Shader needs to be initialized, that is, the fragment shader Fragment Shader needs to be cleaned first, and the shader information needs to be initialized, that is, the dissolve speed parameter, dissolve edge color, dissolve edge area ratio, and dissolve factor parameter values ​​are set. In one embodiment, for example, the dissolve speed parameter is set to 0.1, the dissolve edge color is set to vec4 (1.0, 0.93, 0.68, 0.0), and the initial value of the dissolve factor parameter is 0. Further, the fragment shader Fragment Shader is instantiated, that is, the noise map information is obtained. The noise map information can be an externally input noise map, or the map path of the noise map can be loaded according to the path of the image resource. After the initialization is completed, the frame loop is started to generate the first dissolve effect, specifically:

[0089] Optionally, the display switching device obtains a noise map according to the noise map information. Since the noise map information can be a preset noise map or a map path of a preset noise map, if the noise map information is a preset noise map, the display switching device can directly obtain the noise map. If the noise map information is a map path of a preset noise map, the display switching device loads the noise map through the map path to obtain the noise map. Further, the display switching device obtains a model map of the first effect model, wherein the model map of the first effect model is preconfigured.

[0090] Further, the display switching device obtains the first dissolution factor parameter in the shader information, and determines whether the first dissolution factor parameter is less than a preset value, wherein the preset value in the embodiment of the present application is 1. It should be noted that if the dissolution factor parameter is greater than or equal to the preset value, it means that the effect model has been completely dissolved, and if the dissolution factor parameter is less than the preset value, it means that the effect model has not been completely dissolved.

[0091] Therefore, if it is determined that the first dissolution factor parameter is less than the preset value, the display switching device obtains the noise map color of the noise map according to the preset texture coordinates, wherein the noise map color can be expressed as noiseColor, noiseColor=texture2D(uSampleNoise,vTextureCoord), texture2D() means obtaining the color value at vTextureCoord from the texture of uSampleNoise, uSampleNoise is the noise map, and vTextureCoord is the preset texture coordinates.

[0092] Furthermore, the display switching device samples the noise map to obtain first pixel data, and samples the model map to obtain second pixel data, wherein the first pixel data and the second pixel data have a mapping relationship, that is, the first pixel data and the second pixel data are aligned.

[0093] Further, the display switching device samples each color channel of the first pixel data to obtain the noise value of the first pixel data in each color channel, wherein the color channel may include RGB color channels. Therefore, it can be understood that the RGB color channels in the first pixel data are sampled separately to obtain the noise values ​​of the first pixel data in the RGB color channels. In one embodiment, for the R color channel, the noise value of the first pixel data in the R color channel is noiseValue1=noiseColor.r, for the G color channel, the noise value of the first pixel data in the G color channel is noiseValue2=noiseColor.g, and for the B color channel, the noise value of the first pixel data in the B color channel is noiseValue3=noiseColor.b.

[0094] Furthermore, the display switching device eliminates the second pixel data according to the first dissolution factor parameter and the noise value of the first pixel data to generate a first dissolution effect, as specifically described in steps a to c.

[0095] The embodiment of the present application can generate a dissolving effect of the effect model by setting a noise map, without the need for additional design and implementation of complex animation effects, thereby reducing game development costs.

[0096] In one embodiment, steps a to c are described as follows:

[0097] Step a, determining first target pixel data based on a first dissolution factor parameter and a noise value of the first pixel data;

[0098] Step b, for each frame of the model map, eliminating the second target pixel data corresponding to the first target pixel data in the model map;

[0099] Step c, combining the dissolve edge color and dissolve edge area ratio in the shader information, and eliminating the first remaining pixel data in the model map until all the first remaining pixel data in the model map are eliminated to generate a first dissolve effect.

[0100] Optionally, the display switching device compares the noise value of the first pixel data with the first dissolution factor parameter in numerical value to obtain a comparison result.

[0101] Further, the display switching device determines the pixel data in the first pixel data whose comparison result is that the noise value is less than or equal to the first dissolution factor parameter as the first target pixel data in the first pixel data, and the first target pixel data is the pixel data that needs to be dissolved.

[0102] Further, for each frame of the model map, the display switching device obtains the second target pixel data corresponding to the first target pixel data in the model map, and eliminates the second target pixel data in the model map, wherein the second target pixel data is the pixel data corresponding to the first target pixel data in the second pixel data. Further, after eliminating the second target pixel data in the model map, the display switching device obtains the first remaining pixel data in the model map, which is the pixel data in the second pixel data other than the second target pixel data.

[0103] Furthermore, the display switching device obtains the dissolve edge color and the dissolve edge area ratio in the shader information, and eliminates the first remaining pixel data in the model map according to the dissolve edge color and the dissolve edge area ratio until all the first remaining pixel data in the model map are eliminated, thereby generating a first dissolve effect, as specifically described in steps c1 to c4.

[0104] In one embodiment, the first dissolution factor parameter is 0.1, the noise map includes pixel data 1, pixel data 2, ..., pixel data 10, the model map includes pixel data A, pixel data B, ..., pixel data J, pixel data 1 is aligned with pixel data A, pixel data 2 is aligned with pixel data B, ..., pixel data 10 is aligned with pixel data J. The noise values ​​of pixel data 1, pixel data 2, ..., pixel data 10 are 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9 respectively. In this dissolution, since the noise values ​​of pixel data 1 and pixel data 2 in the noise map are less than or equal to the first dissolution factor parameter, it is determined that the first target pixel data to be dissolved in the noise map are pixel data 1 and pixel data 2, and therefore, pixel data A and pixel data B in the model map need to be dissolved. After this dissolution, the remaining pixel data of the model map are pixel data C, pixel data D, ..., pixel data J. Furthermore, during the next dissolution, the pixel data C, the pixel data D, ..., the pixel data J are dissolved until the pixel data C, the pixel data D, ..., the pixel data J are all dissolved, thereby generating a first dissolution effect.

[0105] The embodiment of the present application can generate a dissolving effect of the effect model by setting the dissolving edge color, without the need for additional design and implementation of complex animation effects, thereby reducing game development costs.

[0106] In one embodiment, steps c1 to c4 are described as follows:

[0107] Step c1, obtaining the texture color of the first remaining pixel data;

[0108] Step c2, obtaining an edge degree factor parameter based on the first dissolution factor parameter, the dissolution edge area ratio and the noise value of the second remaining pixel data;

[0109] Step c3, superimposing the dissolve edge color and the texture color of the first remaining pixel data to obtain the superimposed color of the first remaining pixel data;

[0110] Step c4, based on the first dissolution factor parameter, the dissolution speed parameter in the shader information, and the superimposed color, map color and edge degree factor parameter of the first remaining pixel data, the first remaining pixel data in the model map is eliminated.

[0111] Optionally, the display switching device obtains the texture color of the model map according to the preset texture coordinates. It should be noted that the model map at this time is the model map corresponding to the first remaining pixel data after eliminating the second target pixel data. The texture coordinates here are the same as the texture coordinates in the process of processing the noise map, wherein the texture color can be expressed as baseColor=texture2D(uSample,vTextureCoord), baseColor is the texture color, texture2D() means obtaining the color value at vTextureCoord from the texture of uSample, uSample is the model map, and vTextureCoord is the preset texture coordinates.

[0112] Furthermore, the display switching device obtains a noise value of second remaining pixel data, wherein the second remaining pixel data is pixel data other than the first target pixel data in the first pixel data.

[0113] Furthermore, the display switching device obtains an edge degree factor parameter according to the first dissolution factor parameter, the dissolution edge area ratio and the noise value of the second remaining pixel data.

[0114] In one embodiment, the first dissolution factor parameter can be expressed as dissolveFactor, the dissolution edge area ratio can be expressed as edgeScale, the noise value of the second residual pixel data can be expressed as noiseValue, the original edge degree factor parameter can be expressed as edgeFacor1, and the final edge degree factor parameter can be expressed as edgeFacor2, so edgeFacor1=(noiseValue-dissolveFactor) / (edgeScale*dissolveFactor). Further, the display switching device performs a saturate range operation and inverts the original edge degree factor parameter to obtain the final edge degree factor parameter, so edgeFacor2=1.0-max(0.0,min(1.0,edgeFactor1)).

[0115] Furthermore, the display switching device superimposes the dissolved edge color and the map color of the first remaining pixel data to obtain the superimposed color of the first remaining pixel data. In one embodiment, the dissolved edge color and the map color of the first remaining pixel data are multiplied and superimposed to obtain the superimposed color of the first remaining pixel data. Therefore, the superimposed color can be expressed as blendColor=baseColor*edgeColor, wherein edgeColor represents the dissolved edge color. In one embodiment, the dissolved edge color can be passed in through the encapsulated dissolve switching interface dissolveSwitch.

[0116] Furthermore, the display switching device obtains the dissolution rate parameter in the shader information, and eliminates the first remaining pixel data in the model map according to the first dissolution factor parameter, the dissolution rate parameter, and the superimposed color, map color and edge degree factor parameter of the first remaining pixel data.

[0117] The embodiment of the present application can simulate the special effects and animation of the dissolution model through the dissolution rate parameters and the dissolution factor parameters, and realize the effect of the dissolution model gradually disappearing. It does not require additional design and implementation of complex animation effects, thereby reducing the cost of game development.

[0118] In one embodiment, the description of steps c41 to c43 is as follows:

[0119] Step c41, interpolating the superimposed color and the mapping color of the first remaining pixel data based on the edge degree factor parameter to obtain the final color of the first remaining pixel data;

[0120] Step c42, obtaining a second dissolution factor parameter based on the first dissolution factor parameter and the dissolution rate parameter;

[0121] Step c43, based on the second dissolution factor parameter and the final color of the first remaining pixel data, the first remaining pixel data in the model map is eliminated.

[0122] Optionally, the display switching device interpolates the superimposed color and the map color of the first remaining pixel data according to the edge degree factor parameter to obtain the final color of the first remaining pixel data, wherein the interpolation processing in the embodiment of the present application is a lerp linear interpolation operation.

[0123] Therefore, it can be understood that the superimposed color and the map color of the first remaining pixel data are subjected to lerp linear interpolation operation according to the edge degree factor parameter to obtain the final color, and the final color can be expressed as gl_FragColor=(1.0-edgeFactor2)*baseColor+edgeFactor2*blendColor.

[0124] Further, the display switching device adds a dissolution rate parameter on the basis of the first dissolution factor parameter to obtain a second dissolution factor parameter, that is, the second dissolution factor parameter = the first dissolution factor parameter + the dissolution rate parameter. Further, the display switching device uses the second dissolution factor parameter as a new dissolution factor parameter to eliminate the final color of the first remaining pixel data, thereby eliminating the first remaining pixel data in the model map. The specific description of steps 30111 to 30114 will not be repeated here.

[0125] In one embodiment, the first dissolution factor parameter is 0, the dissolution speed parameter is 0.1, the noise map includes pixel data 1, pixel data 2, ..., pixel data 10, the model map includes pixel data A, pixel data B, ..., pixel data J, pixel data 1 is aligned with pixel data A, pixel data 2 is aligned with pixel data B, ..., pixel data 10 is aligned with pixel data J. The noise values ​​of pixel data 1, pixel data 2, ..., pixel data 10 are 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9 respectively. In this dissolution, since the noise value of pixel data 1 in the noise map is less than or equal to the first dissolution factor parameter, it is determined that the first target pixel data to be dissolved in the noise map is pixel data 1, and therefore, pixel data A in the model map needs to be dissolved. After this dissolution, the remaining pixel data of the model map is obtained as pixel data B, pixel data C, pixel data D, ..., pixel data J. Furthermore, the next time the dissolution is performed, pixel data B, pixel data C, pixel data D, ..., pixel data J are dissolved with 0+0.1=0.1 as the new dissolution factor parameter, and the cycle is repeated until pixel data B, pixel data C, pixel data D, ..., pixel data J are all dissolved, thereby generating a first dissolution effect.

[0126] The embodiment of the present application can simulate the special effects and animation of the dissolution model through the dissolution rate parameters and the dissolution factor parameters, and realize the effect of the dissolution model gradually disappearing. It does not require additional design and implementation of complex animation effects, thereby reducing the cost of game development.

[0127] Optional, see Figure 3 , Figure 3 : is a flow chart of generating the first dissolution effect provided by an embodiment of the present application. In this embodiment, the effect model is represented by a fragment shader, the dissolution speed parameter in the shader information is 0, the dissolution factor parameter is 0.1, and the preset value is 1. Therefore, the specific analysis is as follows:

[0128] Step 1: Determine whether the dissolution rate parameter is greater than or equal to a preset value. Since the dissolution rate parameter 0 is less than the preset value 1, it means that the effect model is not completely dissolved, and proceed to step 2.

[0129] Step 2: Get the noise map color noiseColor of the noise map uSampleNoise according to the preset texture coordinate vTextureCoord.

[0130] Step 3: Sample the noise map to obtain first pixel data, and sample the model map to obtain second pixel data.

[0131] Step 4: Sampling each color channel of the first pixel data to obtain a noise value of the first pixel data in each color channel.

[0132] Step 5: Determine whether the noise value of the first pixel data is less than or equal to the dissolution rate parameter.

[0133] Step 6: If yes, obtain the first target pixel data, and eliminate the second target pixel data corresponding to the first target pixel data in the second pixel data.

[0134] Step 7: If not, obtain the texture color baseColor of the model texture uSample according to the preset texture coordinate vTextureCoord.

[0135] Step 8: According to the first dissolution factor parameter, the proportion of the dissolve edge area and the noise value of the second residual pixel data, the edge degree factor parameter is obtained. edgeFacor1=(noiseValue-dissolveFactor) / (edgeScale*dissolveFactor). Perform saturate range operation and negate edgeFacor1 to obtain edgeFacor2=1.0-max(0.0,min(1.0,edgeFactor1)).

[0136] Step 9: Multiply the dissolved edge color and the map color of the first remaining pixel data to superimpose them, and obtain the superimposed color blendColor=baseColor*edgeColor.

[0137] Step 10: Linearly interpolate the overlay color and the map color according to the edge degree factor parameter to obtain the final color gl_FragColor=(1.0-edgeFactor2)*baseColor+edgeFactor2*blendColor.

[0138] Step 11: Using the dissolution speed parameter + the dissolution factor parameter as the new dissolution factor parameter, all pixels in the final color are eliminated to generate the first dissolution effect.

[0139] Optional, see Figure 4 , Figure 4 : is a flow chart of generating the second dissolution effect provided by an embodiment of the present application. In this embodiment, since the shader information is the same as the shader information for generating the first dissolution effect, the dissolution rate parameter at this time is 0, the dissolution factor parameter is 0.1, and the preset value is 1. The specific analysis process is such as the analysis process for generating the first dissolution effect, which is different from the process for generating the first dissolution effect in that:

[0140] Step 6 in the first dissolution effect process is to eliminate the second target pixel data in the second pixel data corresponding to the first target pixel data, and step 6 in the second dissolution effect process is to display the second target pixel data in the second pixel data corresponding to the first target pixel data.

[0141] The calculation formula of the edge degree factor parameter of step 8 in the first dissolve effect process is: edgeFacor1=(noiseValue-dissolveFactor) / (edgeScale*dissolveFactor). The calculation formula of the edge degree factor parameter of step 8 in the second dissolve effect process is edgeFacor1=(dissolveFactor-noiseValue) / (edgeScale*dissolveFactor).

[0142] The display switching device provided in the embodiment of the present application is described below. The display switching device described below and the display switching method described above can be referred to in correspondence with each other. Figure 5 As shown, Figure 5 : is a schematic diagram of the structure of a display switching device provided in an embodiment of the present application, and the display switching device may include:

[0143] Display module 501, used for displaying the game model and the first effect model of the game model in the game page;

[0144] An acquisition module 502 is used to respond to a switch instruction for the first effect model and acquire shader information and a second effect model;

[0145] A generating module 503, configured to generate a first dissolving effect of the first effect model and a second dissolving effect of the second effect model based on the shader information;

[0146] The effect switching module 504 is used to forward dissolve the first effect model with the first dissolve effect, and reversely dissolve the second effect model with the second dissolve effect, so as to control the game model to switch from the first effect model to the second effect model.

[0147] The embodiment of the present application generates a first dissolve effect and a second dissolve effect with the same dissolve effect according to the same shader information, so that the game model can switch seamlessly from the first effect model to the second effect model, thereby improving the smoothness of the game model switching effect. At the same time, during the forward dissolution of the first effect model and the reverse dissolution of the second effect model, the timestamp of the forward dissolution is aligned with the timestamp of the reverse dissolution, that is, the forward dissolution of the first effect model disappears while the reverse dissolution of the second effect model is displayed, which can effectively demonstrate the interactivity between the effect models, thereby improving the interactivity of the effect models of the game model.

[0148] In an optional embodiment, the generating module 503 is further used for:

[0149] Based on a preset encapsulated dissolve switching interface and the shader information, a first dissolve effect of the first effect model and a second dissolve effect of the second effect model are generated.

[0150] In an optional embodiment, the generating module 503 is further used for:

[0151] calling a forward dissolve interface based on the encapsulated dissolve switching interface, and passing the shader information to the forward dissolve interface, so as to call the forward dissolve interface to generate the first dissolve effect according to the shader information;

[0152] A reverse dissolve interface is called based on the encapsulated dissolve switching interface, and the shader information is passed into the reverse dissolve interface, so as to call the reverse dissolve interface to generate the second dissolve effect according to the shader information.

[0153] In an optional embodiment, the generating module 503 is further used for:

[0154] Obtaining a model map of the first effect model;

[0155] Sampling the noise map in the shader information to obtain first pixel data, and sampling the model map to obtain second pixel data;

[0156] Sampling each color channel of the first pixel data to obtain a noise value of the first pixel data;

[0157] Based on the first dissolution factor parameter in the shader information and the noise value of the first pixel data, the second pixel data is eliminated to generate the first dissolution effect.

[0158] In an optional embodiment, the generating module 503 is further used for:

[0159] Determine first target pixel data based on the first dissolution factor parameter and the noise value of the first pixel data; the first target pixel data is pixel data of the first pixel data whose noise value is less than or equal to the first dissolution factor parameter;

[0160] For the model map of each frame, second target pixel data corresponding to the first target pixel data in the model map is eliminated; the second target pixel data is pixel data corresponding to the first target pixel data in the second pixel data;

[0161] In combination with the dissolve edge color and dissolve edge area ratio in the shader information, the first remaining pixel data in the model map is eliminated until all the first remaining pixel data in the model map are eliminated to generate the first dissolve effect; the first remaining pixel data is the pixel data in the second pixel data excluding the second target pixel data.

[0162] In an optional embodiment, the generating module 503 is further configured to:

[0163] Obtaining a texture color of the first remaining pixel data;

[0164] Obtaining an edge degree factor parameter based on the first dissolution factor parameter, the dissolution edge area ratio and the noise value of the second remaining pixel data; the second remaining pixel data is the pixel data in the first pixel data except the first target pixel data;

[0165] Superimposing the dissolve edge color and the texture color of the first remaining pixel data to obtain a superimposed color of the first remaining pixel data;

[0166] The first remaining pixel data in the model map is eliminated based on the first dissolution factor parameter, the dissolution speed parameter in the shader information, and the superimposed color, map color and edge degree factor parameter of the first remaining pixel data.

[0167] In an optional embodiment, the generating module 503 is further configured to:

[0168] Performing interpolation processing on the superimposed color and the map color of the first remaining pixel data based on the edge degree factor parameter to obtain a final color of the first remaining pixel data;

[0169] Based on the first dissolution factor parameter and the dissolution rate parameter, obtaining a second dissolution factor parameter;

[0170] The first remaining pixel data in the model map is eliminated based on the second dissolution factor parameter and the final color of the first remaining pixel data.

[0171] The specific embodiments of the display switching device provided in the present application are basically the same as the embodiments of the display switching method, and will not be described in detail here.

[0172] Accordingly, an embodiment of the present application further provides an electronic device, which may be a terminal, and the terminal may be a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC), a personal digital assistant (PDA), etc. Alternatively, the electronic device may be a server.

[0173] like Figure 6 As shown, Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 600 includes a processor 601 having one or more processing cores, a memory 602 having one or more computer-readable storage media, and a computer program stored in the memory 602 and executable on the processor. The processor 601 is electrically connected to the memory 602. Those skilled in the art will appreciate that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or arrange components differently.

[0174] The processor 601 is the control center of the electronic device 600, and uses various interfaces and lines to connect various parts of the entire electronic device 600. By running or loading software programs and / or units stored in the memory 602, and calling data stored in the memory 602, the processor 601 executes various functions of the electronic device 600 and processes data, thereby monitoring the electronic device 600 as a whole. The processor 601 can be a central processing unit CPU, a graphics processing unit GPU, a network processor (Network Processor, NP), etc., and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application.

[0175] In the embodiment of the present application, the processor 601 in the electronic device 600 will load the processes of one or more applications into the memory 602 according to the following steps, and the processor 601 will run the application stored in the memory 602 to implement various functions, such as:

[0176] Displaying a game model and a first effect model of the game model on a game page;

[0177] In response to a switch instruction for the first effect model, obtaining shader information and a second effect model;

[0178] generating a first dissolve effect of the first effect model and a second dissolve effect of the second effect model based on the shader information;

[0179] Dissolving the first effect model forward with the first dissolving effect, and dissolving the second effect model backward with the second dissolving effect, so as to control the game model to switch from the first effect model to the second effect model;

[0180] Wherein, the forward dissolution represents the elimination of pixels of the first effect model; the reverse dissolution represents the display of pixels of the second effect model; and the timestamp of the forward dissolution is aligned with the timestamp of the reverse dissolution.

[0181] The embodiment of the present application generates a first dissolve effect and a second dissolve effect with the same dissolve effect according to the same shader information, so that the game model can switch seamlessly from the first effect model to the second effect model, thereby improving the smoothness of the game model switching effect. At the same time, during the forward dissolution of the first effect model and the reverse dissolution of the second effect model, the timestamp of the forward dissolution is aligned with the timestamp of the reverse dissolution, that is, the forward dissolution of the first effect model disappears while the reverse dissolution of the second effect model is displayed, which can effectively demonstrate the interactivity between the effect models, thereby improving the interactivity of the effect models of the game model.

[0182] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0183] Optional, such as Figure 6 As shown, the electronic device 600 further includes: a touch screen 603, a radio frequency circuit 604, an audio circuit 605, an input unit 606, and a power supply 607. The processor 601 is electrically connected to the touch screen 603, the radio frequency circuit 604, the audio circuit 605, the input unit 606, and the power supply 607, respectively. Those skilled in the art can understand that Figure 6 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0184] The touch display screen 603 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 603 may include a display panel and a touch panel. Among them, the display panel can be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device, which can be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light-emitting diode (OLED, Organic Light-Emitting Diode), etc. The touch panel can be used to collect the user's touch operations on or near it (such as the user's operation on the touch panel or near the touch panel using any suitable object or accessory such as a finger, stylus, etc.), and generate corresponding operation instructions, and the operation instructions execute the corresponding program. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 601, and can receive the command sent by the processor 601 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 601 to determine the type of touch event, and then the processor 601 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 603 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 603 can also be used as a part of the input unit 606 to realize the input function.

[0185] The radio frequency circuit 604 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other electronic devices through wireless communication, and to send and receive signals with the network device or other electronic devices.

[0186] The audio circuit 605 can be used to provide an audio interface between the user and the electronic device through a speaker and a microphone. The audio circuit 605 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 605 and converted into audio data, and then the audio data is output to the processor 601 for processing, and then sent to another electronic device through the radio frequency circuit 604, or the audio data is output to the memory 602 for further processing. The audio circuit 605 may also include an earplug jack to provide communication between an external headset and an electronic device.

[0187] The input unit 606 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0188] The power supply 607 is used to supply power to various components of the electronic device 600. Optionally, the power supply 607 can be logically connected to the processor 601 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The power supply 607 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components. Although Figure 6 Not shown, the electronic device 600 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.

[0189] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0190] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0191] The present application embodiment provides a computer-readable storage medium, in which a plurality of computer programs are stored, and the computer program can be loaded by a processor to execute any display switching method provided in the present application embodiment. The computer program can execute the following steps of the display switching method:

[0192] Displaying a game model and a first effect model of the game model on a game page;

[0193] In response to a switch instruction for the first effect model, obtaining shader information and a second effect model;

[0194] generating a first dissolve effect of the first effect model and a second dissolve effect of the second effect model based on the shader information;

[0195] Dissolving the first effect model forward with the first dissolving effect, and dissolving the second effect model backward with the second dissolving effect, so as to control the game model to switch from the first effect model to the second effect model;

[0196] Wherein, the forward dissolution represents the elimination of pixels of the first effect model; the reverse dissolution represents the display of pixels of the second effect model; and the timestamp of the forward dissolution is aligned with the timestamp of the reverse dissolution.

[0197] The embodiment of the present application generates a first dissolve effect and a second dissolve effect with the same dissolve effect according to the same shader information, so that the game model can switch seamlessly from the first effect model to the second effect model, thereby improving the smoothness of the game model switching effect. At the same time, during the forward dissolution of the first effect model and the reverse dissolution of the second effect model, the timestamp of the forward dissolution is aligned with the timestamp of the reverse dissolution, that is, the forward dissolution of the first effect model disappears while the reverse dissolution of the second effect model is displayed, which can effectively demonstrate the interactivity between the effect models, thereby improving the interactivity of the effect models of the game model.

[0198] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0199] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0200] Since the computer program stored in the computer-readable storage medium can execute any display switching method provided in the embodiments of the present application, the beneficial effects that can be achieved by any display switching method provided in the embodiments of the present application can be achieved, see the previous embodiments for details.

[0201] According to one aspect of the present application, a computer program product or a computer program is also provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the methods provided in various optional implementations of the above embodiments.

[0202] In the above-mentioned display switching device, computer-readable storage medium, electronic device, and computer program product embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a certain embodiment, reference can be made to the relevant description of other embodiments. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process and beneficial effects of the display switching device, computer-readable storage medium, computer program product, electronic device and its corresponding units described above can refer to the description of the display switching method in the above embodiment, and will not be repeated here.

[0203] The above is a detailed introduction to a display switching method, device, electronic device, computer-readable storage medium and computer program product provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A display switching method, characterized in that: include: Displaying a game model and a first effect model of the game model on a game page; In response to a switch instruction for the first effect model, acquiring shader information and a second effect model; generating a first dissolve effect of the first effect model and a second dissolve effect of the second effect model based on the shader information; The first effect model is forwardly dissolved with the first dissolve effect, and the second effect model is reversely dissolved with the second dissolve effect, so as to control the game model to switch from the first effect model to the second effect model; wherein the forward dissolve represents the elimination of pixels of the first effect model; the reverse dissolve represents the display of pixels of the second effect model; and the timestamp of the forward dissolve is aligned with the timestamp of the reverse dissolve; Generating the first dissolving effect according to the shader information includes: Obtaining a model map of the first effect model; Sampling the noise map in the shader information to obtain first pixel data, and sampling the model map to obtain second pixel data; Sampling each color channel of the first pixel data to obtain a noise value of the first pixel data; Based on the first dissolution factor parameter in the shader information and the noise value of the first pixel data, the second pixel data is eliminated to generate the first dissolution effect.

2. The display switching method according to claim 1, characterized in that: The generating a first dissolve effect of the first effect model and a second dissolve effect of the second effect model based on the shader information includes: Based on a preset encapsulated dissolve switching interface and the shader information, a first dissolve effect of the first effect model and a second dissolve effect of the second effect model are generated.

3. The display switching method according to claim 2, characterized in that: The generating, based on the preset encapsulated dissolution switching interface and the shader information, a first dissolution effect of the first effect model and a second dissolution effect of the second effect model comprises: calling a forward dissolve interface based on the encapsulated dissolve switching interface, and passing the shader information to the forward dissolve interface, so as to call the forward dissolve interface to generate the first dissolve effect according to the shader information; A reverse dissolve interface is called based on the encapsulated dissolve switching interface, and the shader information is passed into the reverse dissolve interface, so as to call the reverse dissolve interface to generate the second dissolve effect according to the shader information.

4. The display switching method according to claim 3, characterized in that: The shader information includes at least one or more of the following: noise map information, dissolution speed parameter, dissolution edge color, dissolution edge area ratio, and dissolution factor parameter.

5. The display switching method according to claim 4, characterized in that: The shader information includes noise map information, and the noise map information includes a preset noise map, or a map path of the noise map.

6. The display switching method according to claim 1, characterized in that: The step of eliminating the second pixel data based on the first dissolution factor parameter in the shader information and the noise value of the first pixel data to generate the first dissolution effect includes: Determine first target pixel data based on the first dissolution factor parameter and the noise value of the first pixel data; the first target pixel data is pixel data of the first pixel data whose noise value is less than or equal to the first dissolution factor parameter; For each frame of the model map, second target pixel data corresponding to the first target pixel data in the model map is eliminated; the second target pixel data is pixel data in the second pixel data corresponding to the first target pixel data; In combination with the dissolve edge color and dissolve edge area ratio in the shader information, the first remaining pixel data in the model map is eliminated until all the first remaining pixel data in the model map are eliminated to generate the first dissolve effect; the first remaining pixel data is the pixel data in the second pixel data excluding the second target pixel data.

7. The display switching method according to claim 6, characterized in that: The step of eliminating the first remaining pixel data in the model map by combining the dissolve edge color and the dissolve edge area ratio in the shader information includes: Obtaining a texture color of the first remaining pixel data; Obtaining an edge degree factor parameter based on the first dissolution factor parameter, the dissolution edge area ratio and the noise value of the second remaining pixel data; the second remaining pixel data is the pixel data in the first pixel data except the first target pixel data; Superimposing the dissolve edge color and the texture color of the first remaining pixel data to obtain a superimposed color of the first remaining pixel data; The first remaining pixel data in the model map is eliminated based on the first dissolution factor parameter, the dissolution speed parameter in the shader information, and the superimposed color, map color and edge degree factor parameter of the first remaining pixel data.

8. The display switching method according to claim 7, characterized in that: The first remaining pixel data in the model map is eliminated based on the first dissolution factor parameter, the dissolution speed parameter in the shader information, and the superimposed color, the map color, and the edge degree factor parameter of the first remaining pixel data, including: interpolating the superimposed color and the map color of the first remaining pixel data based on the edge degree factor parameter to obtain a final color of the first remaining pixel data; Based on the first dissolution factor parameter and the dissolution rate parameter, obtaining a second dissolution factor parameter; The first remaining pixel data in the model map is eliminated based on the second dissolution factor parameter and the final color of the first remaining pixel data.

9. The display switching method according to any one of claims 1 to 8, characterized in that: The forward dissolution region of the first effect model in the forward dissolution process overlaps with the reverse dissolution region of the second effect model in the reverse dissolution process.

10. The display switching method according to claim 9, characterized in that: The alignment of the timestamp of the forward dissolution and the timestamp of the reverse dissolution includes forward alignment and reverse alignment; The forward alignment represents that the starting time point of the first pixel frame in the forward dissolution of the first effect model is consistent with the starting time point of the first pixel frame in the reverse dissolution of the second effect model, and the ending time point of the last pixel frame in the forward dissolution of the first effect model is consistent with the ending time point of the last pixel frame in the reverse dissolution of the second effect model; the reverse alignment represents that the starting time point of the first pixel frame in the forward dissolution of the first effect model is consistent with the starting time point of the last pixel frame in the reverse dissolution of the second effect model, and the ending time point of the last pixel frame in the forward dissolution of the first effect model is consistent with the ending time point of the first pixel frame in the reverse dissolution of the second effect model.

11. A display switching device, characterized in that: include: A display module, used for displaying a game model and a first effect model of the game model in a game page; an acquisition module, configured to respond to a switching instruction for the first effect model and acquire shader information and a second effect model; a generation module, configured to generate a first dissolve effect of the first effect model and a second dissolve effect of the second effect model based on the shader information; An effect switching module, configured to perform forward dissolution of the first effect model using the first dissolution effect, and reverse dissolution of the second effect model using the second dissolution effect, so as to control the game model to switch from the first effect model to the second effect model; Wherein, the forward dissolution represents the elimination of the pixels of the first effect model; the reverse dissolution represents the display of the pixels of the second effect model; and the timestamp of the forward dissolution is aligned with the timestamp of the reverse dissolution; Generating the first dissolving effect according to the shader information includes: Obtaining a model map of the first effect model; Sampling the noise map in the shader information to obtain first pixel data, and sampling the model map to obtain second pixel data; Sampling each color channel of the first pixel data to obtain a noise value of the first pixel data; Based on the first dissolution factor parameter in the shader information and the noise value of the first pixel data, the second pixel data is eliminated to generate the first dissolution effect.

12. An electronic device, characterized in that: The device comprises a processor and a memory, wherein the memory stores a plurality of computer programs; the processor loads the computer programs from the memory to execute the display switching method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of computer programs, and the computer programs are suitable for being loaded by a processor to execute the display switching method according to any one of claims 1 to 10.