Screen display effect rendering method and device, storage medium and electronic equipment
By adding program code and texture maps for screen display effects to the game engine, the screen display effects can be rendered for single or group virtual models, solving the problems of poor flexibility and accuracy in existing technologies and improving the rendering performance and richness of game scenes.
Patent Information
- Application Number
- CN202310438738.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-13
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2043-04-13
AI Technical Summary
Existing technologies cannot customize individual or group virtual models in video games, resulting in poor flexibility and accuracy of screen display effects, as well as decreased computing performance and reduced frame rate in complex scenes.
By adding program code to independent shaders and combining it with pre-made texture maps, the screen display effect is rendered for a single or group of virtual models in the game scene, generating target material spheres to achieve specific display effects.
It improves the flexibility and accuracy of screen display effects, enhances the richness of game scenes, reduces computing resource consumption, and improves rendering performance.
Smart Images

Figure CN116492676B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer graphics technology, and in particular to a method for rendering screen display effects, a device for rendering screen display effects, a computer storage medium, and an electronic device. Background Technology
[0002] Video games often feature realistic or futuristic game scenes. These scenes typically use methods such as placing monitors to simulate screen display effects and interact with players. For example, they can display game mission information or enhance the atmosphere of the scene.
[0003] In existing video game technologies, screen display effects are typically achieved during the post-processing rendering stage of the game engine's rendering pipeline.
[0004] However, the post-processing rendering stage can only perform uniform calculations on all model images that have been rendered in the previous stage. It cannot perform customized processing on individual or single-group model images to achieve the screen display effect, resulting in poor flexibility and accuracy in rendering screen display effects.
[0005] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0006] This disclosure provides a method for rendering screen display effects, a device for rendering screen display effects, a computer storage medium, and an electronic device, thereby improving the flexibility and accuracy of rendering screen display effects.
[0007] In a first aspect, one embodiment of this disclosure provides a method for rendering screen display effects. The method includes: acquiring multiple virtual models in a game scene to be rendered; for a target virtual model among the multiple virtual models, passing a pre-made texture map and shader file into a material ball to obtain a target material ball; wherein the shader file is used to generate a display model and an initial display effect of the target scene image located in the display model; and rendering the target virtual model through the target material ball to obtain a target display effect that matches the target virtual model with the initial display effect.
[0008] Secondly, one embodiment of this disclosure provides a rendering apparatus for screen display effects. The apparatus includes: a model acquisition module for acquiring multiple virtual models in a game scene to be rendered; an information transmission module for transmitting a pre-made texture map and shader file to a material ball for a target virtual model among the multiple virtual models to obtain a target material ball; wherein the shader file is used to generate a display model and an initial display effect of the target scene image located in the display model; and a model rendering module for rendering the target virtual model through the target material ball to obtain a target display effect that matches the target virtual model with the initial display effect.
[0009] Thirdly, one embodiment of this disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a rendering method for the screen display effect described above.
[0010] Fourthly, one embodiment of this disclosure provides an electronic device, including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the rendering method for the screen display effect described above by executing the executable instructions.
[0011] The technical solution disclosed herein has the following beneficial effects:
[0012] The aforementioned screen display rendering method obtains multiple virtual models in the game scene to be rendered; for the target virtual model among the multiple virtual models, a pre-made texture map and shader file are passed to a material sphere to obtain a target material sphere; wherein, the shader file is used to generate the display model and the initial display effect of the target scene image located in the display model; the target virtual model is rendered using the target material sphere to obtain a target display effect that matches the initial display effect of the target virtual model. This method can write the rendering effect method for simulating screen display in a separate shader, and obtain the target material sphere based on the aforementioned shader and texture map, so as to assign it to a specific single or group of virtual models in the game scene. Firstly, it overcomes the technical problem of related technologies that can only achieve screen display effects for all virtual models in the entire game scene in the post-processing stage of the rendering pipeline, and cannot achieve screen display effects for a single virtual model or a group of virtual models in the game scene, resulting in poor flexibility and accuracy of screen display effects, thereby achieving the technical effect of improving the flexibility and accuracy of screen display effects. Secondly, this method can simultaneously simulate different screen display effects for different virtual models within the same game scene, avoiding the technical problem of limited screen display effects for the entire game scene, which results in poor game richness. This improves the richness of screen display effects and enhances the player's gaming experience. Thirdly, this screen display rendering method is also applicable to game scenes with complex virtual model distribution, avoiding the problem of large screen display occupancy for the entire game scene, which leads to decreased computer performance, lower frame rate, and hinders performance optimization. This expands the applicability of screen display effects and improves rendering efficiency.
[0013] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0014] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0015] Figure 1 (a)- Figure 1 (b) A schematic diagram illustrating an application scenario of a screen display effect rendering method in this exemplary embodiment;
[0016] Figure 2This schematic diagram illustrates the system architecture of a screen display effect rendering system in this exemplary embodiment.
[0017] Figure 3 A flowchart illustrating a screen display effect rendering method in this exemplary embodiment is shown schematically.
[0018] Figure 4 A flowchart illustrating a screen color shift effect rendering method in this exemplary embodiment is shown.
[0019] Figure 5 This schematically illustrates a flowchart of a color shifting process for a target area in this exemplary embodiment;
[0020] Figure 6 This schematic diagram illustrates a method for determining a first offset region and a second offset region in this exemplary embodiment.
[0021] Figure 7 This illustration schematically depicts a simulated screen pixel effect in this exemplary embodiment.
[0022] Figure 8 This illustration shows an application scenario diagram of another screen display effect rendering method in this exemplary embodiment;
[0023] Figure 9 This schematic diagram illustrates the structure of a rendering device for a screen display effect in this exemplary embodiment.
[0024] Figure 10 This schematic diagram illustrates the structure of a rendering device for another screen display effect in this exemplary embodiment.
[0025] Figure 11 The schematic diagram illustrates the structure of an electronic device in this exemplary embodiment. Detailed Implementation
[0026] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of exemplary embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.
[0027] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0028] The flowchart shown in the attached diagram is merely an illustrative example and does not necessarily include all steps. For example, some steps may be broken down, while others may be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0029] To help those skilled in the art better understand the technical solutions of this disclosure, the relevant content involved in the technical solutions of this disclosure will be introduced below.
[0030] (1) UV mapping: In 3D modeling, UV mapping is the process of projecting a 2D image onto the surface of a 3D model to perform texture mapping. U and V represent the coordinate axes on the texture map, since XYZ is already used to represent the coordinate axes of objects in 3D space, while W (in addition to XYZ) is used to calculate quaternions, which is a common operation in computer graphics.
[0031] (2) Shader: A technique specifically used to render graphics. Essentially, it is a piece of program code designed to combine the input mesh with the input texture map or color in a specified way and output the result. A shader is a tool that can precisely control the material ball. Through the combination of texture map and shader, developers can create very realistic virtual models.
[0032] (3) Material Sphere: A virtual model whose display effect can be obtained by applying a material sphere to the surface of a virtual model in a game scene. The material sphere consists of a texture map and a shader. The same texture map can produce different display effects by using different shaders, and different texture maps referencing the same shader will also produce different display effects. The material is the simulated physical property of objects in the virtual scene, such as color, reflection, transparency, texture, etc., and the material sphere is a general term for the integration of the above material properties.
[0033] (4) Batch processing: Batch rendering improves the overall efficiency of the logic and rendering threads by reducing the number of times the Central Processing Unit (CPU) sends rendering commands (DrawCalls) to the Graphics Processing Unit (GPU) and the number of times the GPU switches rendering states. However, this is only meaningful when the GPU is relatively idle and the CPU spends more time submitting rendering commands.
[0034] (5) Game Engine: Refers to the core component of a pre-written, editable computer game system or some interactive real-time graphics application. These systems provide game designers with various tools needed to write games, aiming to enable game designers to quickly and easily create game programs without having to rewrite them from scratch. Most support multiple operating platforms, such as Linux, Mac OS X, and Microsoft Windows.
[0035] (6) Render Pipeline: In the rendering process, the CPU and GPU cooperate to render images. During the computation, the CPU continuously sends data to be processed to the GPU, and the GPU mobilizes various computing units to process the data to assemble the product—the image.
[0036] (7) Moiré pattern: a high-frequency interference stripe that appears on the photosensitive element of a digital camera or scanner. It is a high-frequency irregular stripe that makes the picture appear colored. Because moiré pattern is irregular, it does not have a clear shape pattern.
[0037] The screen display effect rendering method provided by the exemplary embodiments of this disclosure can be applied to any application scenario that requires displaying a simulated screen display effect on the screen, especially to application scenarios where a simulated screen display effect appears in a game scene. The screen display effect includes a simulated monitor model and the scene image presented in the monitor model. For example, in some online games, when the system issues game tasks to players or helps players understand the game rules, it usually simulates a monitor in the game scene and displays the issued game tasks or game rules on the simulated monitor screen.
[0038] The rendering pipeline of a game engine includes, in order of processing, the application stage, geometry stage, rasterization stage, per-fragment meta-operations stage, and post-processing stage. In existing game scene rendering, the screen display effect is typically achieved during the post-processing rendering stage of the rendering pipeline. The shader in the post-processing rendering stage declares and passes in the image returned by the previous rendering stage (per-fragment meta-operations), and this returned image contains all the virtual models displayed in the same game scene.
[0039] Figure 1 This illustration shows an application scenario diagram of a screen display effect rendering method in this exemplary embodiment. Figure 1 (a) is a scene from a multiplayer online tactical competitive shooting game, which includes multiple virtual models such as virtual characters, shooting props, helicopters, etc.
[0040] In order to issue tasks to players via a simulated display screen, one obtains, for example... Figure 1 (b) shows a display 101 that simulates the entire game scene. This display 101 contains the specific content of the task being issued, thereby achieving the screen display effect.
[0041] The aforementioned technical solutions apply a unified processing approach to all virtual models within the same screen, i.e., the entire game scene, to achieve the desired screen display effect. On one hand, the post-processing stage cannot perform individual processing and calculations on single virtual models or groups of virtual models within the same screen. It cannot perform region-by-region customized processing of the entire game scene to flexibly achieve the desired screen display effect, resulting in poor flexibility and accuracy in achieving the desired effect. Furthermore, it cannot simulate different screen display effects for different virtual models, leading to limited richness in the achieved screen display effect. On the other hand, existing screen display effects generate a large screen area, making them unsuitable for processing complex scenes of virtual models. This can easily cause degradation in computer computing performance, reduced frame rates, and other problems, hindering subsequent performance optimization efforts.
[0042] This disclosure, through exemplary embodiments, addresses the aforementioned problems and proposes a method for rendering screen display effects. This method adds a series of program codes to a separate shader to simulate screen display effects, and combines this with a pre-made texture map to obtain a target material sphere. This target material sphere is then applied to a single virtual model or a group of virtual models in the game scene. This method overcomes the technical problem of poor flexibility and accuracy in rendering operations caused by related technologies that can only display simulated screen display effects for the entire game scene, thereby improving the flexibility and accuracy of screen display effects. Simultaneously, different screen display effects can be rendered for different virtual models in the same game scene, increasing the richness of rendered screen display effects. Furthermore, the screen display effect formed for a specific virtual model accounts for a smaller proportion compared to the screen display effect formed for the entire game scene, thus ensuring computer computing performance and facilitating subsequent performance optimization.
[0043] To address the aforementioned problems, this disclosure proposes a method and apparatus for rendering screen display effects, which can be applied to... Figure 2 In the system architecture of the exemplary application environment shown.
[0044] like Figure 2 As shown, system architecture 200 may include one or more of terminal devices 201, 202, and 203, a network 204, and a server 205. Network 204 serves as the medium for providing communication links between terminal devices 201, 202, and 203 and server 205. Network 204 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc. Terminal devices 201, 202, and 203 may be, for example, smartphones, PDAs, laptops, servers, desktop computers, or any other network-enabled computing devices, but are not limited to these.
[0045] It should be understood that Figure 2 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, there can be any number of terminal devices, networks, and servers. For example, server 205 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0046] The screen display rendering method provided in this embodiment can be executed in server 205, and correspondingly, the screen display rendering device is generally located in server 205. The screen display rendering method provided in this embodiment can also be executed in a terminal device, and correspondingly, the screen display rendering device can also be located in the terminal device. The screen display rendering method provided in this embodiment can also be partially executed in server 205 and partially executed in the terminal device; correspondingly, some modules of the screen display rendering device can be located in server 205, and some modules can be located in the terminal device.
[0047] For example, in one exemplary embodiment, multiple players play the game through terminal devices 201, 202, and 203 respectively. The server 205 can match the terminal devices 201, 202, and 203 into the same game process, allowing the multiple players to participate in the same game process. When a player uses any of the terminal devices to play the game, the terminal device can obtain multiple virtual models in the game scene to be rendered; for the target virtual model among the multiple virtual models, a pre-made texture map and shader file are passed into a material ball to obtain a target material ball; wherein, the shader file is used to generate the display model and the initial display effect of the scene image located in the display model; the target virtual model is rendered through the target material ball to obtain a target display effect that matches the target virtual model with the initial display effect.
[0048] However, those skilled in the art will readily understand that the above application scenarios are merely illustrative and are not intended to limit the scope of this exemplary embodiment.
[0049] The following explanation uses the aforementioned terminal device as the execution subject, applying the screen display rendering method to the terminal device as an example. This terminal device provides a graphical user interface, which includes at least a portion of the game scene. See also... Figure 3 The screen display effect rendering method provided by the exemplary embodiments of this disclosure may include the following steps S301-S303:
[0050] Step S301: Obtain multiple virtual models from the game scene to be rendered.
[0051] Step S302: For the target virtual model among multiple virtual models, the pre-made texture map and shader file are passed into the material ball to obtain the target material ball; wherein, the shader file is used to generate the display model and the initial display effect of the target scene in the display model.
[0052] Step S303: Render the target virtual model using the display material ball to obtain a target display effect that matches the initial display effect of the target virtual model.
[0053] exist Figure 3 The provided technical solution involves adding a program to a separate shader to implement screen display rendering effects. Based on this shader and pre-made texture maps, a target material sphere is obtained and then assigned to a specific virtual model in the game scene. Firstly, this method overcomes the technical problem of related technologies that, in the post-processing stage of the rendering pipeline, can only implement screen display effects for all virtual models in the entire game scene, failing to generate screen display effects for a specific virtual model or group of virtual models, resulting in poor flexibility and accuracy in screen display rendering. This improves the flexibility and accuracy of screen display effects. Secondly, this method can also simulate different screen display effects simultaneously for different virtual models in the same game scene, avoiding the problem of related technologies only being able to implement one screen display effect for the entire game scene, leading to poor game richness. This improves the richness of screen display effects and enhances the player's gaming experience. Thirdly, the rendering method of this screen display effect is also applicable to game scenes with complex virtual model distribution, thereby avoiding the technical problem of a large screen display ratio caused by related technologies implementing screen display effects for the entire game scene, which leads to a decrease in computer computing performance and frame rate, affecting performance optimization work, thus improving the applicability of screen display effects and improving rendering performance efficiency.
[0054] The following will be about Figure 3 The specific implementation methods of each step in the illustrated embodiment are described in detail below:
[0055] In step S301, multiple virtual models in the game scene to be rendered are obtained.
[0056] The game scene to be rendered can be the game scene currently displayed on the graphical user interface.
[0057] For example, the game scene contains multiple virtual models, which can be three-dimensional models, such as... Figure 1 (a) includes virtual characters, shooting props, helicopter models, etc.; virtual models can also be two-dimensional models, such as... Figure 1 (a) includes various touch buttons, a scaled-down map, etc. In addition, a virtual model can be a single virtual model or a collection of multiple virtual models (e.g., a virtual character holding a shooting prop, i.e., a collection of models consisting of a shooting prop and a virtual character).
[0058] In step S302, for the target virtual model among multiple virtual models, the pre-made texture map and shader file are passed into the material ball to obtain the display material ball; wherein, the shader file is used to generate the display model and the initial display effect of the target scene image located in the display model.
[0059] The target virtual model can be a single virtual model or a collection of multiple virtual models. The initial display effect consists of a simulated monitor model and the target scene displayed on the monitor model's screen. For example, if the system sends a game task to the player through the monitor model, the target scene displayed on the monitor screen is the game task.
[0060] For example, when passing a pre-made texture map and shader file into a material sphere to obtain a display material sphere, a series of shader programs for implementing various screen display effects can be added to the shader file in advance.
[0061] According to some embodiments of this disclosure, a new shader can be created in the game engine, and instructions for implementing a series of shader programs for achieving various screen display effects can be added to the shader so that the shader and pre-made texture resources can be passed to the material sphere.
[0062] According to some other embodiments of this disclosure, instructions for a shader program to implement a series of screen display effects are added to an existing screen shader in the game engine so that the shader and pre-made texture resources are passed into a material sphere.
[0063] Furthermore, the target material sphere is composed of texture maps and shader files. Any difference in the parameters of the texture maps or shader files used to form the target material sphere will result in different screen display effects for the final target virtual model. Therefore, users can achieve specific screen display effects by selecting the desired texture maps and shader programs.
[0064] The process of determining texture maps and shader files will be illustrated below with specific embodiments.
[0065] In some example embodiments of this disclosure, a set of shader programs is provided based on a shader file; in response to a confirmation operation for the screen display effect, the shader program used to generate the screen display effect is determined as the target shader program; and a pre-made texture map and the target shader program are passed into a material sphere to obtain a target material sphere.
[0066] Each shader program in the shader program collection corresponds to a display effect for the target screen content, and the display effects are all different.
[0067] According to some embodiments of this disclosure, the parameters of a shader file can be mapped one-to-one with each shader program. This allows artists to adjust the shader file parameters so that the terminal device responds to a confirmation operation for the desired screen display effect, thus identifying the shader program corresponding to that screen display effect as the target shader program, and matching it with the selected texture. Figure 1 The material ball is then passed in.
[0068] For example, different shader programs are labeled (e.g., color shift effect is labeled as 1, screen dithering effect as 2, moiré effect as 3). If the user needs to issue game tasks to the virtual character and the screen display effect is a moiré effect, the parameter of the shader file is adjusted to 3. Then, a material ball is constructed based on the texture map and the shader program used to implement the moiré effect.
[0069] In addition to the user manually selecting the target shader program as described above, according to some other embodiments of this disclosure, the target shader program can also be randomly determined based on a random function, and then the pre-made texture map and the target shader program can be passed into the material sphere to obtain the target material sphere.
[0070] By allowing users to flexibly select shader programs from the shader program set to achieve the desired screen display effects, the richness of screen display effects is improved, while also enhancing user operability.
[0071] After determining the shader program in the shader file in the above embodiments, it is also necessary to determine the texture map used to construct the target material sphere.
[0072] In one optional embodiment of this disclosure, a pre-made list of texture maps can be displayed on a graphical user interface; in response to a touch operation on a target texture map in the list of texture maps, the terminal device passes the target texture map and shader file to a material sphere to obtain a display material sphere.
[0073] The texture map list contains multiple pre-made texture maps created by artists, allowing users to flexibly select the texture map they need. These texture maps are then passed into the material sphere along with the selected target shader program to achieve a screen display effect that matches the user's requirements.
[0074] Furthermore, to allow players to more deeply experience interacting with an electronic screen in the game, a series of screen display malfunction effects can be added on top of the normal screen display effects, such as screen jitter effects, color shift effects, moiré effects, and other malfunction display effects, making the visual effects of the monitor in the game scene more realistic and rich.
[0075] The following will illustrate the processes of screen jitter effect, color shift effect, moiré effect, and screen pixel effect with specific embodiments.
[0076] It should be noted that the embodiments disclosed herein are only described with reference to screen jitter effect, color shift effect, moiré effect, and screen pixel effect, and may also include shader programs for implementing other screen display fault effects.
[0077] (1) Screen shaking effect
[0078] In one optional embodiment of this disclosure, a color map of the target image content is obtained; for each pixel in the color map, the coordinate offset of each pixel is determined by a first random function; the initial texture coordinates of each pixel are superimposed with the coordinate offset to obtain the target texture coordinates of each pixel; a first display effect corresponding to the target texture coordinates is generated, and the first shader program corresponding to the first display effect is added to the shader file.
[0079] Among them, texture coordinates are UV coordinate values, and the first display effect is the screen dizziness effect superimposed on the target image content.
[0080] For example, a texture slot can be declared in the shader to store the color texture of the scene in the display model. For the UV coordinates of each pixel in the color texture, a dynamic UV offset algorithm (i.e., a first random function) can be added to make each UV coordinate point of the color texture change dynamically over time, thereby simulating the jitter effect when the screen fails in the screen component.
[0081] When a monitor malfunctions, it typically jitters at preset time intervals or frequencies, causing the user to continuously observe the display error. Therefore, the dynamic UV offset algorithm used, i.e., the first random function, is related to the time variable, thus generating dynamically changing coordinate offsets as the time variable changes.
[0082] The first random function is related to the sampling point (Seed), screen flicker speed (Speed), and the current in-game time variable (Time). In subsequent embodiments, Time is uniformly set to the incremental time GameTime, a built-in incremental time in the game engine independent of frame rate, representing the time span of elapsed game time since the last update. This value is typically globally accessible. The Seed and Speed values determine the frequency of change in the coordinate offset output by the first random function.
[0083] For example, the first random function could be the following program logic:
[0084] float randomNoise2(float2 seed,float Speed,float2 Time)
[0085] {
[0086] return frac(sin(dot(seed*floor(Time.y*Speed),float2(17.13,3.71)))*43758.5453123);
[0087] }
[0088] Here, randomNoise2 is the name of the first random function; the input parameters are the sampling point (Seed), the screen flicker speed (Speed), and the current actual game time variable (Time); the frac function is used to return the fractional part of each component in a scalar or vector; the dot function is a matrix multiplication function that can perform dot product on two arrays, or on an array and a scalar.
[0089] Understandably, the Seed and Speed variables can be set by the art team according to the actual situation, while the Time variable is input as GameTime obtained from the game engine.
[0090] By determining each initial UV coordinate point in the color map and the coordinate offset that dynamically changes over time based on the first random function, the target UV coordinate values at different times can be determined, thereby displaying the screen jitter effect and improving the realism of the screen display.
[0091] (2) Color shift effect
[0092] In addition to the jitter effect in the above-mentioned screen display fault effect, a color shift effect can also be achieved. The following will illustrate the implementation method of the color shift effect when the display model displays the scene image with specific implementation examples.
[0093] Figure 4 A flowchart illustrating a screen color shift effect rendering method in this exemplary embodiment is shown schematically. See also... Figure 4 In an optional embodiment of this disclosure, the following steps S401-S405 may be included:
[0094] Step S401: Obtain the color texture of the target screen content and obtain the mask texture that matches the color texture.
[0095] For example, declaring a texture slot in a shader yields a mask texture, where the mask texture is pre-created by an artist. For instance, adding a 24-bit mask texture to the texture slot.
[0096] Step S402: For each pixel of the mask texture corresponding to multiple second color components, determine multiple target areas corresponding to each first color component in the color texture according to the preset color values of the multiple second color components.
[0097] In this process, each first pixel in the color texture and each second pixel in the mask texture contain multiple color components (color components are color channels). Typically, the values of the multiple first color components corresponding to each first pixel in the color texture range from 0 to 255, while the values of the second color components corresponding to each second pixel in the mask texture range from 0 to 1. The black (color value 0) and white (color value 1) textures in each second color component of the mask texture are pre-created by the artists based on the texture content in the color image and stored in the game engine.
[0098] Taking three color components as an example, the first color components are red (R), green (G), and blue (B), and the second color components are also red (R), green (G), and blue (B).
[0099] It should be noted that the R, G, and B color components mentioned above are merely examples and can be other color components. For example, CMYK images have four channels by default: cyan, magenta, yellow, and black.
[0100] In some example embodiments of this disclosure, when performing the step of determining multiple target regions corresponding to each first color component in a color map based on the preset color values of each second color component in a mask map, the initial color values of each first pixel in the color map corresponding to multiple first color components can be obtained; the initial color values can be normalized to obtain target color values; and the region where the target color value corresponding to each first color component in the color map is located can be determined as the target region based on the preset color values of the mask map.
[0101] Taking color channels R, G, and B as an example, any first pixel in the color map contains R, G, and B color components. The initial color value for each component ranges from 0 to 255; that is, the values for R, G, and B all range from 0 to 255.
[0102] Since the value range of the second color component corresponding to each second pixel in the mask map is 0 to 1, in order to facilitate data processing and to use the mask map to filter out the target area in the color map that needs to be color offset, the above initial color values (0 to 255) are usually normalized to normalize the color values to the range of 0 to 1.
[0103] For example, the target areas of the color map in the R, G, and B color components can be marked with white (i.e., the preset color value of the mask map is 1) in the R, G, and B color components respectively, so as to perform color offset processing on the target areas; and the areas in the color map that do not need to be color offset processed can be marked with black (color value 0).
[0104] By normalizing the color values of each color channel in the color map, it is not only easier to process data in the subsequent process, but also easier to select target areas for color offset processing through masking maps, thereby further improving the richness of the screen display effect.
[0105] Step S403: Perform color shift processing on multiple target areas respectively to obtain the color shift effect under each first color component.
[0106] For example, when performing color shift processing, it is necessary to determine the color shift intensity, color shift frequency, color shift area, and color shift pixel value. The greater the color shift intensity, the larger the corresponding color shift area. The color shift pixel value can be red (R=255, G=0, B=0), green (R=0, G=255, B=0), or blue (R=0, G=0, B=255), and this color shift pixel value determines the overall hue of the color shift.
[0107] The following will combine Figure 5 The illustrated embodiment provides an example of the process of color shifting for a target area.
[0108] Figure 5 This schematically illustrates a flowchart of a color shifting process for a target area in this exemplary embodiment. See also... Figure 5 In an optional embodiment of this disclosure, the following steps S501-S505 may be included:
[0109] Step S501: Determine the first target offset parameter for the target region based on the second random function.
[0110] The second random function can be used to randomly generate the target offset parameters. Furthermore, the second random function can be a set of multiple different random functions.
[0111] Since the color shift effect of the screen changes dynamically over time, the second random function is related to the time variable.
[0112] In an optional embodiment of this disclosure, the first target offset parameter includes at least one or more of offset intensity and offset frequency.
[0113] The target offset parameter can be the color offset intensity, the color offset frequency, or both. The color offset frequency represents the time interval between each update of the color offset intensity; the higher the color offset frequency, the shorter the time interval between updates.
[0114] According to some embodiments of this disclosure, when the target offset parameter is the color offset intensity, the second random function can be used to randomly generate offset intensity values. The time variable of the second random function can be the time variable GmeTime built into the game engine, thereby driving it to dynamically generate offset intensity values, thus producing different color offset effects caused by different color offset intensities during each update.
[0115] At this point, the offset frequency can be selected from the preset default value, that is, the offset intensity determined based on the second random function is updated according to the preset time interval.
[0116] According to some embodiments of this disclosure, when the target offset parameter is the color offset frequency, the second random function is used to generate the color offset frequency.
[0117] At this point, the offset strength can be selected from the preset default value, that is, the same offset strength is updated at the offset frequency determined based on the second random function.
[0118] According to some other embodiments of this disclosure, when the target offset parameters are the offset intensity and offset frequency of the color, the second random function is a set of multiple random functions, and the offset intensity and offset frequency parameters are determined by different random functions respectively.
[0119] This process can determine at least one or more of the offset intensity and offset frequency through a first random function, which facilitates the generation of multiple different types of color offset effects, thereby improving the richness of screen display effects.
[0120] Step S502: Move each texture coordinate value of the target area by a preset amount in the first offset direction and the second offset direction respectively to obtain a first region for the first offset direction and a second region for the second offset direction.
[0121] The first offset direction and the second offset direction are offset directions that are opposite to each other.
[0122] For example, the UV coordinate system containing the target area includes a horizontal coordinate axis X and a vertical coordinate axis Y. If the first offset direction can be a rightward movement of the horizontal coordinate axis X, then the corresponding second offset direction is a leftward movement of the horizontal coordinate axis X; or if the first offset direction can be an upward movement of the vertical coordinate axis Y, then the corresponding second offset direction is a downward movement of the vertical coordinate axis Y.
[0123] For example, taking the target area in the R color component as an example, the method for the target areas in the G color component and B color component is the same. The first area is obtained by moving each UV coordinate point of the target area in the R color component to the left by a preset amount of horizontal coordinates, and the second area is obtained by moving each UV coordinate point of the target area to the right by a preset amount of horizontal coordinates.
[0124] Step S503: Trim the area in the first region that overlaps with the target region to obtain the first offset region, and trim the area in the second region that overlaps with the target region to obtain the second offset region.
[0125] For example, by cropping the area in the first region that overlaps with the target region, the remaining area in the first region is the determined first offset region. Similarly, by cropping the area in the second region that overlaps with the target region, the remaining area in the second region is the determined second offset region.
[0126] Figure 6 This schematic diagram illustrates a method for determining a first offset region and a second offset region in this exemplary embodiment. Figure 6 As shown, Figure 6 The target region 603 is included. The target region 603 is moved horizontally to the left by a distance of -X to obtain the first region. The area overlapping with the target region is then cropped to obtain the first offset region 601. At the same time, the target region 603 is moved horizontally to the right by a distance of +X to obtain the second region. The area overlapping with the target region is then cropped to obtain the second offset region 602.
[0127] Step S504: Perform color shift processing on the first offset region and the second offset region respectively using preset pixel values and first target offset parameters to obtain the color shift effect under each first color component.
[0128] The preset pixel value is the color used to simulate color shift.
[0129] For example, by determining the first offset region and the second offset region, the offset intensity and the offset frequency, a color offset effect with an offset intensity can be generated within the first offset region and the second offset region at the offset frequency.
[0130] Meanwhile, by multiplying the color values in the first offset region and the second offset region by a preset pixel value (e.g., red), a color offset effect based on red can be obtained.
[0131] Step S404: Mix the color shift effects of multiple first color components to obtain the second display effect.
[0132] The second display effect is a color shift effect resulting from the mixing of color shift effects from multiple color channels. For example, the final second display effect can be obtained by mixing the color shift effects in the offset areas of the R color channel, the G color channel, and the B color channel.
[0133] Step S405: Add the second shader program corresponding to the second display effect to the shader file.
[0134] For example, a second shader program instruction for implementing the second display effect described above is added to the shader so that the art staff can select the second display effect for display.
[0135] In one optional embodiment of this disclosure, the color shift effect displayed in the screen component can be superimposed with the screen jitter effect to form a new screen display effect.
[0136] In some example embodiments of this disclosure, after generating a second display effect based on the target screen content, the parameters of the color shift effect (including color shift intensity, color shift frequency, color shift area, and color shift pixel value) can be provided to the user so that the user can update the color shift effect by adjusting the parameters and improve the efficiency of displaying the color shift effect.
[0137] The above embodiments filter the target area of the color map corresponding to the first color component by multiple second color components of the mask map. In another optional embodiment of this disclosure, the color map can be pre-divided into multiple areas to be processed, and for the target area to be processed in the multiple areas to be processed, the first target offset parameter of the target area to be processed is adjusted to the second target offset parameter; and the color offset effect corresponding to the second target offset parameter is displayed in the screen component.
[0138] For example, by dividing the color map into multiple regions to be processed, the following can be performed on each region: Figure 4 The steps are illustrated, and a visual offset parameter is provided for each area to be processed in the graphical user interface for the user to adjust. When the user adjusts the first target offset parameter of the target area to be processed to the second target offset parameter, the color shift effect corresponding to the second target offset parameter is displayed in the screen component.
[0139] It should be noted that color maps can be divided according to the distribution of color values or according to the distribution of virtual models. This embodiment does not impose any special restrictions on this.
[0140] By dividing the color map into multiple processing areas, individual color shift effects can be displayed and adjusted based on each processing area. This results in differences in color shift intensity, color, and frequency for each processing area within the same color map, providing artists with the opportunity to adjust these effects and thus enhancing the richness of the screen display.
[0141] (3) Moiré effect
[0142] For example, a texture slot is declared in the shader to store a moiré texture.
[0143] In some example embodiments of this disclosure, a pre-configured moiré texture map is obtained; a second coordinate offset of each pixel of the moiré texture map in a preset direction is determined according to a third random function; a target coordinate is determined based on the initial coordinates of each pixel of the moiré texture map and the second coordinate offset; a third display effect corresponding to the target coordinate is generated, and a third shader program corresponding to the third display effect is added to the shader file.
[0144] The preset direction can be horizontal or vertical; the moiré texture map is a texture map that includes a moiré effect.
[0145] At any given moment, the UV coordinates (initial coordinates) are shifted by a second coordinate offset towards the X or Y axis of the UV coordinate system based on a time variable in a third random function (such as the game engine's built-in time variable GameTime). Over a period of time, the UV coordinates (initial coordinates) continue to shift by the second coordinate offset towards the X or Y axis of the UV coordinate system, thus creating the third display effect.
[0146] (4) Screen pixel effect
[0147] In an optional embodiment of this disclosure, a model texture of the target virtual model is obtained, and the pixel density of each pixel in the model texture is determined according to a preset value; pixels with pixel values greater than or equal to a pixel threshold are updated to a first pixel value, and pixels with pixel values less than the pixel threshold are updated to a second pixel value; the pixels corresponding to the first pixel value and the second pixel value are displayed based on the pixel density to obtain a fourth display effect; and the fourth shader program corresponding to the fourth display effect is added to the shader file.
[0148] The aforementioned preset values determine the display density of the pixels corresponding to the first pixel value and the second pixel value. An image consists of several square-shaped pixels with gaps between them. Typically, the squares are white (pixel value 1), and the gaps are black (pixel value 0). The preset value determines the density between the squares. The larger the preset value, the denser the squares, and consequently, the denser the pixels on the simulated screen. For example, a preset value of 100 indicates that the screen has 10,000 pixels (100 * 100 = 10,000).
[0149] Figure 7 This schematic diagram illustrates a simulated screen pixel effect in this exemplary embodiment, such as... Figure 7 As shown, pixels with values greater than or equal to a pixel threshold in the model texture are updated to 1, and pixels with values less than the pixel threshold are updated to 0. Pixels with a value of 0 are used as gaps between square pixels, and pixels with a value of 1 are used as squares, thus achieving the fourth display effect. The higher the pixel density, the better. Figure 7 The smaller the spacing between the squares, the better.
[0150] In step S303, the target virtual model is rendered based on the target material sphere to obtain a target display effect that matches the screen display effect.
[0151] The target display effect is a display effect formed by overlaying texture maps on the screen display effect.
[0152] Figure 8 This illustration schematically depicts an application scenario of another screen display rendering method in this exemplary embodiment. Figure 8 As can be seen, the target virtual model can be multiple virtual characters in a game scene. Rendering each virtual character based on the target material generates a screen display effect for that virtual character. The screen display effects for two virtual characters can be the same or different. For example, one virtual character might display a color shift effect, while the other displays a screen jitter effect.
[0153] This process provides artists with flexible and controllable conditions for creating and adjusting materials. It allows for different screen display effects by assigning different texture maps or shader programs to materials; it also enables multiple virtual models to share the same material to achieve the same screen display effect, thus achieving batch processing. Batch processing effectively reduces rendering performance overhead during game runtime.
[0154] In order to achieve the above-mentioned screen display effect rendering method, one embodiment of this disclosure provides a screen display effect rendering device. Figure 9A schematic diagram of the rendering apparatus for screen display effects is shown.
[0155] The rendering device 900 for the screen display effect includes a model acquisition module 901, an information transmission module 902, and a model rendering module 903.
[0156] The model acquisition module 901 is used to acquire multiple virtual models in the game scene to be rendered; the information transmission module 902 is used to pass a pre-made texture map and shader file to a material ball to obtain a target material ball for the target virtual model among the multiple virtual models; wherein, the shader file is used to generate a display model and the initial display effect of the target scene image located in the display model; the model rendering module 903 is used to render the target virtual model through the target material ball to obtain a target display effect that matches the target virtual model with the initial display effect.
[0157] The screen display effect rendering apparatus 900 provided in this embodiment can execute the technical solution of the screen display effect rendering method in any of the above embodiments. Its implementation principle and beneficial effects are similar to those of the screen display effect rendering method. Please refer to the implementation principle and beneficial effects of the screen display effect rendering method. It will not be repeated here.
[0158] Furthermore, one embodiment of this disclosure provides a rendering apparatus for another screen display effect. Figure 10 A schematic diagram of the rendering apparatus for screen display effects is shown.
[0159] Among them, the rendering device 1000 for the screen display effect is in Figure 9 The rendering device for the screen display effect shown includes a model acquisition module 901, an information transmission module 902, and a model rendering module 903, as well as an effect generation module 904, a region determination module 905, and an offset processing module 906.
[0160] In an optional embodiment, the information transmission module 902 is specifically used to provide a set of shader programs based on the shader file; wherein each shader program in the set of shader programs corresponds to a different display effect for the target screen content; in response to a confirmation operation for the screen display effect, the shader program used to generate the screen display effect is determined as the target shader program; and the pre-made texture map and the target shader program are passed into the material sphere to obtain the target material sphere.
[0161] In an optional embodiment, the effect generation module 904 is used to obtain a color map of the target screen content; for each first pixel in the color map, a first coordinate offset of each first pixel is determined by a first random function; the initial texture coordinates of each first pixel are superimposed with the first coordinate offset to obtain the target texture coordinates of each first pixel; a first display effect corresponding to the target texture coordinates is generated, and a first shader program corresponding to the first display effect is added to the shader file.
[0162] In an optional embodiment, the effect generation module 904 is used to acquire a color map of the target image content and a mask map that matches the color map; the region determination module 905 is used to determine multiple target regions corresponding to each first color component in the color map based on the preset color values of the multiple second color components corresponding to each second pixel point of the mask map; the offset processing module 906 is used to perform color offset processing on the multiple target regions respectively to obtain the color offset effect under each first color component; the effect generation module 904 is used to mix the color offset effects under the multiple first color components to obtain a second display effect, and add the second shader program corresponding to the second display effect to the shader file.
[0163] In an optional embodiment, the region determination module 905 is used to obtain the initial color values of multiple first color components corresponding to each first pixel in the color map; normalize the initial color values to obtain target color values; and determine the region where the target color value corresponding to each first color component is located as the target region according to the preset color value of the mask map.
[0164] In an optional embodiment, the offset processing module 906 is used to determine a first target offset parameter for the target region based on a second random function; shift each texture coordinate value of the target region by a preset coordinate amount in a first offset direction and a second offset direction to obtain a first region in the first offset direction and a second region in the second offset direction; wherein the first offset direction and the second offset direction are opposite offset directions; trim the region in the first region that overlaps with the target region to obtain a first offset region, and trim the region in the second region that overlaps with the target region to obtain a second offset region; perform color offset processing on the first offset region and the second offset region respectively using preset pixel values and the first target offset parameter to obtain the color offset effect under each first color component.
[0165] In an optional embodiment, the offset processing module 906 is used for the first target offset parameters, which include at least one or more of offset intensity and offset frequency.
[0166] In an optional embodiment, the effect generation module 904 is used to divide the color map into multiple regions to be processed; for a target region to be processed in the multiple regions to be processed, the first target offset parameter of the target region to be processed is adjusted to a second target offset parameter; and the color offset effect corresponding to the second target offset parameter is displayed in the screen component.
[0167] In an optional embodiment, the effect generation module 904 is used to obtain a pre-configured moiré texture map; determine the second coordinate offset of each pixel of the moiré texture map in a preset direction according to a third random function; determine the target coordinates based on the initial coordinates of each pixel of the moiré texture map and the second coordinate offset; generate a third display effect corresponding to the target coordinates; and add the third shader program corresponding to the third display effect to the shader file.
[0168] In an optional embodiment, the effect generation module 904 is used to acquire the model texture of the target virtual model, determine the pixel density of each pixel in the model texture according to a preset value, update the pixels with pixel values greater than or equal to a pixel threshold to a first pixel value, and update the pixels with pixel values less than the pixel threshold to a second pixel value; display the pixels with the first pixel value and the second pixel value based on the pixel density to obtain a fourth display effect, and add the fourth shader program corresponding to the fourth display effect to the shader file.
[0169] The screen display effect rendering apparatus 1000 provided in this embodiment can execute the technical solution of the screen display effect rendering method in any of the above embodiments. Its implementation principle and beneficial effects are similar to those of the screen display effect rendering method. Please refer to the implementation principle and beneficial effects of the screen display effect rendering method. It will not be repeated here.
[0170] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible embodiments, various aspects of the present invention may also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of the present invention described in the "Exemplary Methods" section above.
[0171] According to embodiments of the present invention, a program product for implementing the above-described method may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0172] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0173] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.
[0174] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0175] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0176] In an exemplary embodiment of this disclosure, an electronic device capable of implementing the above-described method is also provided.
[0177] Those skilled in the art will understand that various aspects of the present invention can be implemented as systems, methods, or program products. Therefore, various aspects of the present invention can be specifically implemented in the following forms: entirely hardware implementations, entirely software implementations (including firmware, microcode, etc.), or implementations combining hardware and software aspects, collectively referred to herein as “circuits,” “modules,” or “systems.”
[0178] The following reference Figure 11 To describe an electronic device 1100 according to this embodiment of the present invention. Figure 11 The electronic device 1100 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0179] like Figure 11 As shown, the electronic device 1100 is manifested in the form of a general-purpose computing device. The components of the electronic device 1100 may include, but are not limited to: at least one processing unit 1110, at least one storage unit 1120, a bus 1130 connecting different system components (including storage unit 1120 and processing unit 1110), and a display unit 1140.
[0180] The storage unit stores program code, which can be executed by the processing unit 1110 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of the present invention. For example, the processing unit 1110 can perform actions such as... Figure 3 Steps S301 to S303 are shown in the diagram.
[0181] Storage unit 1120 may include a readable medium in the form of a volatile storage unit, such as random access memory (RAM) 11201 and / or cache memory 11202, and may further include a read-only memory (ROM) 11203.
[0182] Storage unit 1120 may also include a program / utility 11204 having a set (at least one) of program modules 11205, such program modules 11205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0183] Bus 1130 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.
[0184] Electronic device 1100 can also communicate with one or more external devices 1200 (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with electronic device 1100, and / or any device that enables electronic device 1100 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 1150. Furthermore, electronic device 1100 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 1160. As shown, network adapter 1160 communicates with other modules of electronic device 1100 via bus 1130. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 1100, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0185] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0186] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0187] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0188] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.
[0189] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is defined only by the appended claims.
Claims
1. A method for rendering screen display effects, characterized in that, A graphical user interface is provided through a terminal device, wherein the graphical user interface includes at least a portion of the game scene screen, including: Obtain multiple virtual models from the scene to be rendered; For the target virtual model among the multiple virtual models, a set of shader programs is provided based on the shader file; in response to the confirmation operation for the screen display effect, the shader program used to generate the screen display effect is determined as the target shader program; the pre-made texture map and the target shader program are passed into the material sphere to obtain the target material sphere; The shader file is used to generate screen display effects for target screen content displayed on screen components. Each shader program in the shader program set corresponds to a different display effect for the target screen content. The shader file provides a first shader program corresponding to a first display effect and / or a second shader program corresponding to a second display effect. The first display effect is generated by obtaining a color map of the target screen content and generating it based on the target texture coordinates of each first pixel in the color map. The target texture coordinates are obtained by superimposing the initial texture coordinates of each first pixel with a first coordinate offset. The second display effect is generated by obtaining a color map of the target screen content and a mask map that matches the color map. For each second pixel in the mask map, multiple second color components are used to determine multiple target regions corresponding to each first color component in the color map based on the preset color values of the multiple second color components. Color offset processing is performed on the multiple target regions to obtain the color offset effect under each first color component. The color offset effects under the multiple first color components are then mixed. The target virtual model is rendered based on the target material sphere to obtain a target display effect that matches the screen display effect.
2. The screen display effect rendering method according to claim 1, characterized in that, The method further includes: For each first pixel in the color map, the first coordinate offset of each first pixel is determined by a first random function; The initial texture coordinates of each first pixel are superimposed with the first coordinate offset to obtain the target texture coordinates of each first pixel.
3. The screen display effect rendering method according to claim 1, characterized in that, The step of determining multiple target regions corresponding to each first color component in the color map based on preset color values of the multiple second color components includes: Obtain the initial color values of multiple first color components corresponding to each first pixel in the color map; The initial color values are normalized to obtain the target color values; The target region is determined by identifying the region containing the target color value corresponding to each first color component based on the preset color value of the mask texture.
4. The screen display effect rendering method according to claim 1, characterized in that, The step of performing color shift processing on the multiple target regions to obtain the color shift effect under each first color component includes: The first target offset parameter for the target region is determined based on the second random function; The texture coordinate values of the target region are shifted by a preset amount in the first offset direction and the second offset direction, respectively, to obtain a first region for the first offset direction and a second region for the second offset direction; wherein the first offset direction and the second offset direction are offset directions opposite to each other; A first offset region is obtained by cropping the region in the first region that overlaps with the target region, and a second offset region is obtained by cropping the region in the second region that overlaps with the target region; By using preset pixel values and the first target offset parameter, color offset processing is performed on the first offset region and the second offset region respectively to obtain the color offset effect under each first color component.
5. The screen display effect rendering method according to claim 4, characterized in that, The first target offset parameter includes at least one or more of offset intensity and offset frequency.
6. The screen display effect rendering method according to claim 4, characterized in that, The method further includes: The color map is divided into multiple regions to be processed; For the target region to be processed in the plurality of regions to be processed, the first target offset parameter of the target region to be processed is adjusted to the second target offset parameter; The screen component displays a color offset effect corresponding to the second target offset parameter.
7. The method for rendering screen display effects according to claim 1, characterized in that, The shader file also provides a third shader program corresponding to the third display effect, and the method further includes: Obtain the pre-configured moiré texture map; The second coordinate offset of each pixel in the moiré texture map in a preset direction is determined according to a third random function; The target coordinates are determined based on the initial coordinates of each pixel in the moiré texture map and the second coordinate offset. Generate a third display effect corresponding to the target coordinates, and add the third shader program corresponding to the third display effect to the shader file.
8. The method for rendering screen display effects according to claim 1, characterized in that, The shader file also provides a fourth shader program corresponding to the fourth display effect, and the method further includes: Obtain the model texture of the target virtual model, and determine the pixel density of each pixel in the model texture according to preset values; Pixels whose pixel values are greater than or equal to a pixel threshold are updated to a first pixel value, and pixels whose pixel values are less than a pixel threshold are updated to a second pixel value. Based on the pixel density, the pixels with the first pixel value and the second pixel value are displayed to obtain a fourth display effect, and the fourth shader program corresponding to the fourth display effect is added to the shader file.
9. A rendering device for screen display effects, characterized in that, The device includes: The model acquisition module is used to acquire multiple virtual models in the game scene to be rendered; The information transmission module is used to provide a set of shader programs based on shader files for a target virtual model among the multiple virtual models; in response to a confirmation operation for the screen display effect, the shader program used to generate the screen display effect is identified as the target shader program; and the pre-made texture map and the target shader program are passed into the material sphere to obtain the target material sphere. The shader file is used to generate screen display effects for target screen content displayed on screen components. Each shader program in the shader program set corresponds to a different display effect for the target screen content. The shader file provides a first shader program corresponding to a first display effect and / or a second shader program corresponding to a second display effect. The first display effect is generated by obtaining a color map of the target screen content and generating it based on the target texture coordinates of each first pixel in the color map. The target texture coordinates are obtained by superimposing the initial texture coordinates of each first pixel with a first coordinate offset. The second display effect is generated by obtaining a color map of the target screen content and a mask map that matches the color map. For each second pixel in the mask map, multiple second color components are used to determine multiple target regions corresponding to each first color component in the color map based on the preset color values of the multiple second color components. Color offset processing is performed on the multiple target regions to obtain the color offset effect under each first color component. The color offset effects under the multiple first color components are then mixed. The model rendering module is used to render the target virtual model based on the target material ball to obtain a target display effect that matches the screen display effect.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the screen display effect rendering method according to any one of claims 1 to 8.
11. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the screen display effect rendering method according to any one of claims 1 to 8 by executing the executable instructions.
Citation Information
Patent Citations
Apparatus and method of image rendering
CN106997612A
Game model rendering method and device, terminal and storage medium
CN113546411A