Method, device, electronic device and readable storage medium for realizing display screen with flashing effect
By obtaining and superimposing scene object maps and star maps and changing their brightness values, the problem of difficult to achieve the flashing effect of water surface galaxy in the existing technology is solved, and the reality of water surface ripples and galaxy flashing in three-dimensional games is realized. Simulation improves the fun of the picture.
Patent Information
- Application Number
- CN202011531381.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-22
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2040-12-22
AI Technical Summary
The prior art is difficult to achieve the galaxy flashing effect based on the water surface in water surface reflection, and it is impossible to simulate the real water surface ripples and galaxy flashing effect.
By obtaining the scene object map and star map to be reflected, obtaining multi-frame reference screens, superimposing the scene object map and star map to each frame reference screen, and transforming its brightness values, using the vertex shader to perturb the vertex data , combined with pixel shader for rendering and display, and random transformation of brightness values is realized to simulate flashing effects.
It realizes the effect of simulating the ripples and galaxy flashing on the water surface in a three-dimensional game scene, improving the fun and authenticity of the picture.
Smart Images

Figure CN112669415B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer vision technology, and in particular to a method, device, electronic device and readable storage medium for realizing a display screen with a flashing effect. Background Art
[0002] In scene display applications, such as 3D games, in order to create an environmental atmosphere, a variety of objects are generally rendered, including mountains, terrain, vegetation, various buildings, and various objects. Sometimes, in order to simulate the real world environment, water surface, mirror surface and other effects are rendered. The water surface will contain refraction scenes, water surface ripples, disturbances of reflected scenes under the influence of water surface ripples, and transparency problems caused by reflection points and viewing angles. However, the current implementation methods of water surface, mirror surface, etc. are only limited to realizing the reflection of the water surface, and it is difficult to achieve the effect of the galaxy flashing based on the water surface. Summary of the invention
[0003] The purpose of the present application includes, for example, providing a method, device, electronic device and readable storage medium for realizing a display screen with a flashing effect, which can simulate the screen flashing effect and improve the fun.
[0004] The embodiments of the present application can be implemented as follows:
[0005] In a first aspect, the present application provides a method for realizing a display screen with a flashing effect, the method comprising:
[0006] Obtain the scene object map and star map to be reflected, and obtain multiple frames of reference images;
[0007] Overlaying the scene object map and the star map onto the reference picture of each frame;
[0008] Transforming the brightness values of the scene object map and the star map in the reference picture of each frame;
[0009] The multiple display frames obtained after the transformation are rendered and displayed.
[0010] In an optional embodiment, the star map includes a plurality of images;
[0011] The step of transforming the brightness values of the scene object map and the star map in each frame of the reference picture includes:
[0012] Setting different brightness values for the scene object map in the reference picture of each frame;
[0013] Different overall brightness values are set for the multiple star maps in each frame of the reference picture, and different individual brightness values are set for each star map in each reference picture.
[0014] In an optional implementation, the step of setting different individual brightness values for each star map in each reference picture includes:
[0015] For each frame of the reference picture, an initial individual brightness value is set for the reference picture;
[0016] Based on the initial individual brightness value, expansion is performed to obtain a plurality of individual brightness values corresponding to each star map.
[0017] In an optional implementation manner, the step of rendering and displaying the multiple frames of display pictures obtained after the transformation process includes:
[0018] For each pixel point in each frame of the display picture after the transformation processing, sampling is performed to obtain the pixel values of the pixel points of the star map and the pixel points of the scene object map in the display picture;
[0019] According to the pixel values of the pixel points of the star map and the pixel values of the pixel points of the scene object map, the pixel values of the pixel points in the display picture are determined, and the rendering is performed for display.
[0020] In an optional implementation, the step of determining the pixel values of the pixels in the display image according to the pixel values of the pixels of the star map and the pixel values of the pixels of the scene object map comprises:
[0021] Obtaining pixel conversion values of each star map according to the pixel values of the pixel points sampled from each star map and the corresponding brightness information;
[0022] Obtaining a pixel conversion value of the scene object map according to a pixel value of a pixel point of the scene object map and its corresponding brightness information;
[0023] Based on the pixel conversion values of each of the star maps and the pixel conversion values of the scene object map, the pixel values of the pixels in the display picture are determined.
[0024] In an optional implementation, the step of obtaining the pixel conversion value of each of the star maps according to the pixel values of the pixel points sampled from each of the star maps and the corresponding brightness information includes:
[0025] For each of the star maps, according to the pixel values sampled from the star map and the corresponding transparency, a pixel value under the transparency is obtained;
[0026] A pixel conversion value of the star map is obtained according to the pixel value under the transparency, the individual brightness value of the star map, and the overall brightness value.
[0027] In an optional implementation, the step of superimposing the scene object map and the star map onto each frame of the reference picture includes:
[0028] Obtaining vertex data of the reference picture of each frame;
[0029] perturbing the vertex data in a vertex shader;
[0030] The scene object map and the star map are superimposed on each frame of the reference picture after disturbance.
[0031] In a second aspect, the present application provides a device for realizing a flashing effect on a display screen, the device comprising:
[0032] An acquisition module is used to acquire a scene object map and a star map to be reflected, and obtain multiple frames of reference images;
[0033] An overlay module, used for overlaying the scene object map and the star map onto the reference picture of each frame;
[0034] A processing module, used for transforming the brightness values of the scene object map and the star map in the reference picture of each frame;
[0035] The display module is used to render and display the multiple frames of display images obtained after the transformation processing.
[0036] In a third aspect, the present application provides an electronic device comprising one or more storage media and one or more processors communicating with the storage media, wherein the one or more storage media store machine executable instructions executable by the processors, and when the electronic device is running, the processor executes the machine executable instructions to execute the method for implementing a display screen with a flashing effect as described in any one of the aforementioned embodiments.
[0037] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are executed, the method for realizing a display screen with a flashing effect as described in any one of the aforementioned embodiments is implemented.
[0038] The beneficial effects of the embodiments of the present application include, for example:
[0039] The present application provides a method, device, electronic device and readable storage medium for realizing a display screen with a flashing effect, by obtaining a scene object map and a star map to be reflected, and obtaining a multi-frame reference screen, superimposing the scene object map and the star map on each frame of the reference screen, transforming the brightness values of the scene object map and the star map in each frame of the reference screen, and finally rendering and displaying the multi-frame display screen obtained after the transformation. In this way, when displaying the multi-frame display screen obtained after the brightness transformation process, since the brightness values of the scene object map and the star map between each frame are constantly changing, when the display screen is played continuously, a flashing effect can be simulated to improve the display interest. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0041] Figure 1 A flowchart of a method for realizing a display screen with a flashing effect provided in an embodiment of the present application;
[0042] Figure 2 A flowchart of a method for overlaying a texture in a method for realizing a display screen with a flashing effect provided in an embodiment of the present application;
[0043] Figure 3 A flowchart of a method for setting brightness information in a method for realizing a display screen with a flashing effect provided in an embodiment of the present application;
[0044] Figure 4 A flowchart of a method for setting individual brightness values in a method for realizing a display screen with a flashing effect provided in an embodiment of the present application;
[0045] Figure 5 A flowchart of a method for rendering and displaying a screen in a method for realizing a display screen with a flashing effect provided in an embodiment of the present application;
[0046] Figure 6 A flowchart of a method for determining pixel values in a method for realizing a display screen with a flashing effect provided in an embodiment of the present application;
[0047] Figure 7 A functional module block diagram of a device for realizing a display screen with a flashing effect provided in an embodiment of the present application;
[0048] Figure 8 A structural block diagram of an electronic device provided in an embodiment of the present application.
[0049] Icons: 110 - device for realizing display screen with flashing effect; 111 - acquisition module; 112 - superposition module; 113 - processing module; 114 - display module; 120 - memory; 130 - processor; 140 - communication unit. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, 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 part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0051] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0052] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0053] In the description of the present application, it should be noted that the terms "first", "second", etc., if used, are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0054] It should be noted that, in the absence of conflict, the features in the embodiments of the present application may be combined with each other.
[0055] Figure 1 The flowchart of the method for realizing a display screen with a flashing effect provided by an embodiment of the present application is shown. The method for realizing a display screen provided by the present application can be applied to a computer device and realized by the computer device. It should be understood that in other embodiments, the order of some steps in the method for realizing a display screen described in this embodiment can be interchanged according to actual needs, or some steps can be omitted or deleted. The detailed steps of the method for realizing a display screen are described as follows.
[0056] Step S110, obtaining a scene object map to be reflected and a star map, and obtaining multiple frames of reference images.
[0057] Step S120: superimpose the scene object map and the star map onto each frame of the reference picture.
[0058] Step S130, transforming the brightness values of the scene object map and the star map in the reference picture of each frame.
[0059] Step S140, rendering and displaying the multiple frames of display pictures obtained after the transformation process.
[0060] In the prior art, when implementing plane reflection, the template test is usually used to implement mirror reflection. The implementation method is usually to draw the scene objects once, then draw the mirror into the template cache and turn on the template test, clear the depth cache and turn on blending, and finally render the object to be reflected. Alternatively, in another existing implementation method, it can be implemented by rendering to a texture. The implementation method is usually to first draw the objects in the scene once, save the drawing results to a texture, perturb the vertex data in the vertex shader, and use Fresnel reflection in the pixel shader to control transparency.
[0061] Among the above-mentioned prior arts, the first method is the reflection of a plane mirror. Because it is directly rendered, the final rendered image is similar to a mirror and cannot be disturbed. The second water surface reflection method solves the problem of vertex data disturbance and uses Fresnel to solve the problem of water surface transparency. However, this method still makes it difficult to achieve the effect of a galaxy flashing based on the water surface.
[0062] In this embodiment, a three-dimensional game scene is used as an example for explanation. When a water surface effect is involved in the game scene, on the one hand, a ripple effect of the water surface needs to be designed, and on the other hand, a galaxy flashing effect based on the water surface is desired. Therefore, this embodiment provides a display screen implementation method for implementation.
[0063] In this embodiment, a scene object map to be reflected is prepared in advance, and the scene object map can be set according to the scene objects around the water surface in the scene, for example, it can include trees, mountains, vegetation, buildings, objects, etc. The scene object map needs to be superimposed on the water surface to simulate the reflection effect of the water surface on the surrounding scene.
[0064] The star map may be a block or dot map with a certain glossy color, which is used to simulate the flashing effect of the water surface in the subsequent simulation. In addition, multiple frames of reference images may be prepared in advance, wherein the reference image is the water surface image in the game scene. The pre-prepared reference image may include vertex data of the water surface, including the position information of the XYZ coordinates of the vertices, and the UVW sampling coordinate information of the vertices.
[0065] In this embodiment, the prepared star map and scene object map need to be eventually superimposed on the reference picture, and the flashing effect is mainly achieved by changing the brightness values of the scene object map and the star map between different frames. Therefore, when multiple frames are rendered and displayed and played continuously, the brightness values of the scene object map and the star map are constantly changing, so the flashing effect of the water surface can be simulated.
[0066] In this embodiment, considering that the base screen in a general game scene, for example, the land on the water surface is generally large, for example, the land may reach an area of 512 meters * 512 meters. Therefore, if the star map is directly superimposed on the base screen, if the accuracy of the star map is not high enough, it may cause the star map to be blurred.
[0067] In order to avoid the above problems, as a possible implementation method, the problem can be solved by improving the accuracy of the star map, for example, the accuracy of the star map can be improved to 1024*1024. As another possible implementation method, the range of the reference screen to which the star map is attached can be reduced, for example, the reference screen area can be adjusted by adjusting the vertex information of the reference screen, for example, the reference screen area can be adjusted to within the range of 64 meters*64 meters. As another implementation method, the problem can also be solved by reducing the pixels in the star map. For example, if dozens of pixels are required to express a star map, it can be changed to using a few pixels to express a star map.
[0068] In this embodiment, in order to simulate the ripple effect on the water surface, please refer to Figure 2 , the reference picture can be processed in the following ways:
[0069] Step S121, obtaining vertex data of the reference picture of each frame.
[0070] Step S122, perturbing the vertex data in a vertex shader.
[0071] Step S123, superimposing the scene object map and the star map onto each frame of the reference picture after disturbance.
[0072] In this embodiment, the UV data in the vertex data of the reference picture can be disturbed in the vertex shader, so that the reference picture presents an undulating effect, that is, simulating the effect of ripples on the water surface. On this basis, the scene object map and the star map are superimposed on the disturbed reference picture.
[0073] In this embodiment, the star map may include multiple images, so that the brightness can be changed not only between different picture frames, but also between different star maps, so as to better simulate the random flashing effect.
[0074] See also Figure 3 , when transforming the brightness values of the scene object map and the star map, the above can be achieved in the following ways:
[0075] Step S131, setting different brightness values for the scene object map in the reference picture of each frame.
[0076] Step S132, setting different overall brightness values for the multiple star maps in each frame of the reference picture, and setting different individual brightness values for each star map in each frame of the reference picture.
[0077] In this embodiment, a global variable may be used to control the brightness information. For example, the type of the global variable may be float4 type, wherein the global variable may include an x variable, a y variable, a z variable, and a w variable.
[0078] In this embodiment, different brightness values can be set for the scene object maps in each frame of the reference picture, and the brightness values can be stored in the z variable in the global variable. In addition, different overall brightness values can be set for multiple star maps in each frame of the reference picture, and the overall brightness values can be stored in the x variable in the global variable.
[0079] In this embodiment, when setting the overall brightness value of the star map for each frame of the reference picture, a brightness value range may be pre-set, starting from the minimum brightness value in the brightness value range, and sequentially and cyclically setting the overall brightness value of the star map for each frame of the reference picture in the multiple frames of the reference picture within the brightness value range. In this way, the overall brightness value of the star map in the multiple frames of the reference picture will show a regular brightness change. Alternatively, in another embodiment, it is also possible to start from the maximum brightness value in the above-mentioned brightness value range, and sequentially and cyclically set the overall brightness value of the star map for each frame of the reference picture in the multiple frames of the reference picture within the brightness value range.
[0080] In addition, in this embodiment, different individual brightness values are set for each star map in each reference picture. In the final picture, the brightness of the star map is determined by the overall brightness value of the star map in each frame and the individual brightness value of each star map.
[0081] See also Figure 4 In this embodiment, for each reference picture, different individual brightness values are set for each star map in the following manner:
[0082] Step S1321 : for each frame of the reference picture, an initial individual brightness value is set for the reference picture.
[0083] Step S1322: Expand based on the initial individual brightness value to obtain a plurality of individual brightness values corresponding to each star map.
[0084] In this embodiment, the number of star maps in each frame of the reference picture can be set according to the needs, for example, it can include three star maps, four star maps, etc. When setting the brightness value for each frame of the reference picture, an overall brightness value can be set for all the star maps in each frame of the reference picture, and an initial individual brightness value can be set. The initial individual brightness value can be the same as the overall brightness value, or the initial individual brightness value can be different from the overall brightness value, and there is no specific limitation.
[0085] On the basis of the set initial individual brightness value, the individual brightness value can be expanded according to the number of star maps. For example, if the number of star maps is three, three individual brightness values can be expanded based on the initial individual brightness value. The three individual brightness values can be different in size, partially the same, or the same. The specific embodiment is not limited. During implementation, in order to simulate a random flashing effect, the values of the multiple individual brightness values obtained by expansion can be different, so that a random flashing effect can be achieved.
[0086] In this embodiment, the generation of the initial individual brightness value of the star map can be completed in the CPU of the computer device. After the initial individual brightness value is generated, the GPU can expand the initial individual brightness value to obtain multiple individual brightness values corresponding to multiple star maps. In this way, the initial individual brightness value only needs to be calculated once in the CPU, avoiding the problem of increasing the amount of calculation caused by the influence of the number of vertices and the final output image resolution when performing information calculation in the GPU.
[0087] In this embodiment, after the brightness value conversion process is implemented, in order to realize the display of the final display picture, the display picture to be displayed needs to be rendered. To realize the rendering process, the pixel value of each pixel point needs to be determined to realize the display.
[0088] Optionally, see Figure 5 When rendering and displaying the multi-frame display images obtained after the transformation, it can be achieved in the following ways:
[0089] Step S141 , for each pixel point in each frame of the display picture after the transformation processing, sample and obtain the pixel values of the pixel points of the star map and the pixel points of the scene object map in the display picture.
[0090] Step S142, determining the pixel values of the pixels in the display image according to the pixel values of the pixel points of the star map and the pixel values of the pixel points of the scene object map, and performing rendering and display.
[0091] In this embodiment, the rendering display of the display screen can be realized based on the pixel shader, and the display effect of each pixel point in the display screen is determined by the pixel information of the sampled pixel points in the scene object map and the star map.
[0092] Assuming that there are three star maps, the pixel values of the sampled star maps can be recorded as StarCol1, StarCol2, and StarCol3, respectively, and the pixel value of the sampled pixel point of the scene object map can be recorded as ReflCol. The above global variable can be recorded as CtrlF4. For the pixel point on the display screen to be processed, the pixel value of the pixel point can be determined according to the pixel values StarCol1, StarCol2, and StarCol3 of the pixel point of the star map and the pixel value ReflCol of the pixel point of the scene object map.
[0093] Optionally, see Figure 6 , the pixel value of the pixel in the display can be determined by:
[0094] Step S1421, obtaining pixel conversion values of each of the star maps according to the pixel values of the pixel points sampled from each of the star maps and the corresponding brightness information.
[0095] Step S1422: Obtain pixel conversion values of the scene object map according to pixel values of the pixel points of the scene object map and corresponding brightness information.
[0096] Step S1423, determining the pixel value of the pixel point in the display image based on the pixel conversion value of each of the star maps and the pixel conversion value of the scene object map.
[0097] In this embodiment, each of the star maps has transparency information. For each star map, the pixel value under transparency can be obtained according to the pixel value obtained by sampling the star map and the corresponding transparency. For example, the pseudo code for implementation can be as follows, where a represents transparency:
[0098] StarCol1*=StarCol1.a;
[0099] StarCol2*=StarCol2.a;
[0100] StarCol3*=StarCol3.a;
[0101] On this basis, according to the pixel values under the above transparency and the individual brightness values and overall brightness values of the star map, the pixel conversion value of the star map is obtained. Among them, the intermediate value is obtained based on the pixel value and the individual brightness value through the pseudo code shown below:
[0102] StarCol1*=CtrlF4.y;
[0103] StarCol2*=(2.0f-CtrlF4.y);
[0104] StarCol3*=CtrlF4.y*1.5f;
[0105] Among them, y represents the individual brightness value of the star map, and f indicates that the variable type is float type.
[0106] On the basis of the above, combined with the overall brightness value of the star map in the display screen, the pixel conversion value of the star map is obtained through the following pseudo code:
[0107] StarCol1*CtrlF4.x;
[0108] StarCol2*CtrlF4.x;
[0109] StarCol3*CtrlF4.x;
[0110] After obtaining the pixel conversion value of the star map in the above manner, the pixel value OutCol of the pixel point in the display screen can be obtained by combining the pixel conversion value of the star map with the pixel conversion value of the scene object map in the following manner:
[0111] OutCol=StarCol1*CtrlF4.x+StarCol2*CtrlF4.x+StarCol3*CtrlF4.x+ReflCol*CtrlF4.z
[0112] Finally, the display screen can be rendered based on the obtained pixel values of the pixels.
[0113] In this embodiment, the flashing effect is achieved by transforming the brightness values of the star map and the scene object map. When setting the brightness, the brightness value can be set once in the CPU. On this basis, the brightness value can be expanded in the GPU based on the set brightness value to obtain the individual brightness value of each star map. In the pixel shader, the pixel values of the pixel points sampled from different maps are combined for mixing processing to obtain the pixel values of the pixel points of the final image to be displayed, thereby achieving rendering display.
[0114] like Figure 71 is a functional module block diagram of a device 110 for realizing a display screen with a flashing effect provided in an embodiment of the present application, and the device is applied to the above-mentioned computer device. The device comprises an acquisition module 111, an overlay module 112, a processing module 113 and a display module 114.
[0115] The acquisition module 111 is used to acquire the scene object map and the star map to be reflected, and obtain multiple frames of reference images;
[0116] In this embodiment, the description of the acquisition module 111 can be specifically referred to in Figure 1 The detailed description of step S110 shown, that is, step S110 can be executed by the acquisition module 111.
[0117] An overlay module 112, used for overlaying the scene object map and the star map onto each frame of the reference picture;
[0118] In this embodiment, the description of the superposition module 112 can be specifically referred to in Figure 1 The detailed description of step S120 is shown, that is, step S120 can be performed by the superposition module 112.
[0119] The processing module 113 is used to transform the brightness values of the scene object map and the star map in each frame of the reference picture;
[0120] In this embodiment, the description of the processing module 113 can be specifically referred to in Figure 1 The detailed description of step S130 shown is that step S130 can be executed by the processing module 113.
[0121] The display module 114 is used to render and display the multiple display frames obtained after the transformation process.
[0122] In this embodiment, the description of the display module 114 can be specifically referred to in Figure 1 The detailed description of step S140 is shown, that is, step S140 can be executed by the display module 114.
[0123] In a possible implementation, the star map includes multiple images, and the processing module 113 may be specifically used to:
[0124] Setting different brightness values for the scene object map in the reference picture of each frame;
[0125] Different overall brightness values are set for the multiple star maps in each frame of the reference picture, and different individual brightness values are set for each star map in each reference picture.
[0126] In a possible implementation, the processing module 113 may be specifically used to:
[0127] For each frame of the reference picture, an initial individual brightness value is set for the reference picture;
[0128] Based on the initial individual brightness value, expansion is performed to obtain a plurality of individual brightness values corresponding to each star map.
[0129] In a possible implementation, the display module 114 may be specifically used for:
[0130] For each pixel point in each frame of the display picture after the transformation processing, sampling is performed to obtain the pixel values of the pixel points of the star map and the pixel points of the scene object map in the display picture;
[0131] According to the pixel values of the pixel points of the star map and the pixel values of the pixel points of the scene object map, the pixel values of the pixel points in the display picture are determined, and the rendering is performed for display.
[0132] In a possible implementation, the display module 114 may be specifically used for:
[0133] Obtaining pixel conversion values of each star map according to the pixel values of the pixel points sampled from each star map and the corresponding brightness information;
[0134] Obtaining a pixel conversion value of the scene object map according to a pixel value of a pixel point of the scene object map and its corresponding brightness information;
[0135] Based on the pixel conversion values of each of the star maps and the pixel conversion values of the scene object map, the pixel values of the pixels in the display picture are determined.
[0136] In a possible implementation, the display module 114 may be specifically used for:
[0137] For each of the star maps, according to the pixel values sampled from the star map and the corresponding transparency, a pixel value under the transparency is obtained;
[0138] A pixel conversion value of the star map is obtained according to the pixel value under the transparency, the individual brightness value of the star map, and the overall brightness value.
[0139] In a possible implementation, the superposition module 112 may be specifically used for:
[0140] Obtaining vertex data of the reference picture of each frame;
[0141] perturbing the vertex data in a vertex shader;
[0142] The scene object map and the star map are superimposed on each frame of the reference picture after disturbance.
[0143] like Figure 8 As shown, an embodiment of the present application further provides an electronic device, which includes a device 110 for realizing a display screen with a flashing effect, a memory 120, a processor 130, and a communication unit 140.
[0144] The memory 120, the processor 130 and the communication unit 140 are electrically connected to each other directly or indirectly to realize the transmission or interaction of information. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines. The memory 120 stores software function modules stored in the memory 120 in the form of software or firmware. The processor 130 executes various functional applications and data processing by running software programs and modules stored in the memory 120, such as the display screen implementation device 110 with a flashing effect in the embodiment of the present application, that is, realizing the display screen implementation method with a flashing effect in the embodiment of the present application.
[0145] The memory 120 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory 120 is used to store a program, and the processor 130 executes the program after receiving an execution instruction. The communication unit 140 is used to establish communication between the electronic device and other external devices.
[0146] The processor 130 may be an integrated circuit chip with signal processing capabilities. The above-mentioned processor 130 may be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU), a network processor (NP), etc. It can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor 130 can also be any conventional processor, etc.
[0147] The embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by the processor 130, the steps of the above-mentioned method for realizing a display screen with a flashing effect are executed.
[0148] In summary, the present application provides a method, device, electronic device, and readable storage medium for realizing a display screen with a flashing effect. By obtaining the scene object map and star map to be reflected and obtaining multiple frames of reference screens, the scene object map and star map are superimposed on each frame of the reference screen, the brightness values of the scene object map and star map in each frame of the reference screen are transformed, and finally the multiple frames of display screens obtained after the transformation are rendered and displayed. In this way, when displaying the multiple frames of display screens obtained after the brightness transformation process, since the brightness values of the scene object map and star map between each frame are constantly changing, when the display screen is played continuously, a flashing effect can be simulated to improve the display interest.
[0149] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for realizing a display screen with a flashing effect, characterized in that: Applied to a computer device, the method comprises: Obtain the scene object map and star map to be reflected, and obtain multiple frames of reference images; Overlaying the scene object map and the star map onto the reference picture of each frame; Transforming the brightness values of the scene object map and the star map in the reference picture of each frame; Rendering and displaying the multiple display frames obtained after the transformation processing; The star maps include multiple ones; The step of transforming the brightness values of the scene object map and the star map in each frame of the reference picture includes: Setting different brightness values for the scene object map in the reference picture of each frame; Setting different overall brightness values for the multiple star maps in each frame of the reference picture, and setting different individual brightness values for each star map in each reference picture; The step of setting different individual brightness values for each star map in each reference picture includes: For each frame of the reference picture, an initial individual brightness value is set for the reference picture, wherein the setting of the initial individual brightness value is executed in the CPU of the computer device; Based on the initial individual brightness value, expansion is performed to obtain a plurality of individual brightness values corresponding to each star map, wherein the expansion of the initial individual brightness value is performed in the GPU of the computer device.
2. The method for realizing a display screen with a flashing effect according to claim 1, characterized in that: The step of rendering and displaying the multiple frames of display pictures obtained after the transformation process comprises: For each pixel point in each frame of the display picture after the transformation processing, sampling is performed to obtain the pixel values of the pixel points of the star map and the pixel points of the scene object map in the display picture; According to the pixel values of the pixel points of the star map and the pixel values of the pixel points of the scene object map, the pixel values of the pixel points in the display picture are determined, and the rendering is performed for display.
3. The method for realizing a display screen with a flashing effect according to claim 2, characterized in that: The step of determining the pixel values of the pixels in the display image according to the pixel values of the pixels of the star map and the pixel values of the pixels of the scene object map comprises: Obtaining pixel conversion values of each star map according to the pixel values of the pixel points sampled from each star map and the corresponding brightness information; Obtaining a pixel conversion value of the scene object map according to a pixel value of a pixel point of the scene object map and its corresponding brightness information; Based on the pixel conversion values of each of the star maps and the pixel conversion values of the scene object map, the pixel values of the pixels in the display picture are determined.
4. The method for realizing a display screen with a flashing effect according to claim 3, characterized in that: The step of obtaining the pixel conversion value of each star map according to the pixel value of the pixel point sampled by each star map and the corresponding brightness information thereof comprises: For each of the star maps, according to the pixel values sampled from the star map and the corresponding transparency, a pixel value under the transparency is obtained; A pixel conversion value of the star map is obtained according to the pixel value under the transparency, the individual brightness value of the star map, and the overall brightness value.
5. The method for realizing a display screen with a flashing effect according to claim 1, characterized in that: The step of superimposing the scene object map and the star map onto each frame of the reference picture includes: Obtaining vertex data of the reference picture of each frame; perturbing the vertex data in a vertex shader; The scene object map and the star map are superimposed on each frame of the reference picture after disturbance.
6. A device for realizing a flashing effect on a display screen, characterized in that: The method for realizing a display screen with a flashing effect as described in any one of claims 1 to 5, wherein the device comprises: An acquisition module is used to acquire a scene object map and a star map to be reflected, and obtain multiple frames of reference images; An overlay module, used for overlaying the scene object map and the star map onto the reference picture of each frame; A processing module, used for transforming the brightness values of the scene object map and the star map in the reference picture of each frame; The display module is used to render and display the multiple frames of display images obtained after the transformation processing.
7. An electronic device, characterized in that: The electronic device comprises one or more storage media and one or more processors communicating with the storage media, wherein the one or more storage media store machine executable instructions executable by the processors, and when the electronic device is running, the processor executes the machine executable instructions to execute the method for realizing a display screen with a flashing effect as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are executed, the method for realizing a display screen with a flashing effect as described in any one of claims 1 to 5 is implemented.
