Rendering method and device, electronic equipment and storage medium
By integrating off-screen rendering and color conversion for translucent special effects, the over-drawing problem caused by translucent special effects in the game is solved, achieving the effect of improving game performance while maintaining visual effects.
Patent Information
- Application Number
- CN202411245964.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2025-01-24
AI Technical Summary
In game development, the rendering of translucent effects is likely to lead to over-drawing, increasing the load on the CPU and GPU, resulting in a degradation of game performance. It is difficult for the existing technology to improve game performance while maintaining visual effects.
By obtaining the color information and transparency information of the scene objects to be rendered and translucent special effects objects, we perform off-screen rendering processing, optimize the rendering process, reduce over-drawing and rendering pressure, and ensure the quality of the game screen through color conversion and fusion processing. Reduce the consumption of special effects on game performance.
While ensuring the quality of game graphics, it significantly improves game performance, reduces the consumption of game performance by special effects, and improves game fluency and user experience.
Smart Images

Figure CN119345685A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a rendering method, device, electronic device and storage medium. Background Art
[0002] In game development, special effects usually have an important impact on the player's gaming experience. Most game special effects use translucent effects, which can better show the light and shadow effects in the real world and enhance the realism and three-dimensionality of the game screen. However, due to the transparency and complexity of the special effects, over-drawing may occur during the rendering process, and the load on the CPU and GPU will increase, resulting in a decrease in game performance. In the prior art, the above problems are usually solved by reducing the number of special effect particles or simplifying materials, but it is difficult to improve the performance of the game while maintaining the visual effects, and it is difficult to balance the game performance and picture quality. Summary of the invention
[0003] The present application provides a rendering method, device, electronic device and storage medium to at least solve the problem in the related art that it is difficult to balance game performance and picture quality, optimize the rendering process, and reduce the consumption of special effects on game performance while ensuring visual effects. The technical solution of the present application is as follows:
[0004] According to a first aspect of an embodiment of the present application, a rendering method is provided, including:
[0005] Obtain a scene object to be rendered and at least one translucent special effect object, as well as color information and transparency information corresponding to each translucent special effect object;
[0006] Based on the first rendering resource, each semi-transparent special effect object is subjected to off-screen rendering processing according to the color information and transparency information corresponding to each semi-transparent special effect object to obtain a target special effect image; and based on the second rendering resource, the scene object is subjected to rendering processing to obtain an initial scene image; the resolution of the initial scene image is greater than the resolution of the target special effect image;
[0007] Performing color conversion processing on the initial scene image based on the second rendering resource to obtain a target scene image;
[0008] The target special effect image and the target scene image are fused based on the second rendering resource to obtain a target special effect scene image.
[0009] In an optional embodiment, performing off-screen rendering processing on each semi-transparent special effect object according to the color information and transparency information corresponding to each semi-transparent special effect object to obtain a target special effect image includes:
[0010] Acquire an initial special effect image, wherein the initial special effect image includes each of the semi-transparent special effect objects and a background object;
[0011] According to the transparency information corresponding to each semi-transparent special effect object, the color information corresponding to each semi-transparent special effect object and the preset color information corresponding to the background object are mixed to obtain mixed color information;
[0012] Based on the mixed color information, the initial special effect image is updated to obtain the target special effect image.
[0013] In an optional embodiment, the color information corresponding to each semi-transparent special effect object and the preset color information corresponding to the background object are mixed according to the transparency information corresponding to each semi-transparent special effect object to obtain the mixed color information, including:
[0014] Based on a preset mixing mode, according to the transparency information corresponding to each semi-transparent special effect object, the color information corresponding to each semi-transparent special effect object and the preset color information corresponding to the background object are mixed to obtain the mixed color information.
[0015] In an optional embodiment, the target special effect scene image includes a target object image, and the step of fusing the target special effect image with the target scene image to obtain the target special effect scene image includes:
[0016] Performing fusion processing on the target special effect image and the target scene image to obtain an initial special effect scene image, wherein the initial special effect scene image includes an initial object image;
[0017] Obtaining depth information and color information corresponding to initial pixel points of the initial special effects scene image;
[0018] In a case where the depth information of the initial pixel satisfies a first preset condition, the color information corresponding to the initial pixel is updated based on the color information corresponding to the target pixel to obtain first updated color information corresponding to the initial pixel; the target pixel is a pixel, among the initial pixel and adjacent pixels, whose depth information has a difference with the first preset depth information that is less than a first preset depth threshold, and the adjacent pixels include a preset number of pixels adjacent to the initial pixel;
[0019] Based on the first updated color information of the initial pixel point, the initial object image is updated to obtain the target object image.
[0020] In an optional embodiment, the initial special effect scene image includes an initial background image, the target special effect scene image includes a target background image, and the fusing process of the target special effect image and the target scene image to obtain the target special effect scene image further includes:
[0021] When the depth information of the initial pixel does not satisfy the preset condition, averaging the color information corresponding to the initial pixel and the color information corresponding to adjacent pixels to obtain second updated color information corresponding to the initial pixel;
[0022] Based on the second updated color information of the initial pixel, the initial background image is updated to obtain the target background image.
[0023] In an optional embodiment, when the depth information of the initial pixel satisfies the first preset condition, the color information corresponding to the initial pixel is updated based on the color information corresponding to the target pixel, and the first updated color information corresponding to the initial pixel is obtained, including:
[0024] When the difference between the depth information of the initial pixel point and the second preset depth information is greater than the second preset depth threshold, the color information corresponding to the initial pixel point is updated based on the color information corresponding to the target pixel point to obtain the first updated color information corresponding to the initial pixel point.
[0025] In an optional embodiment, based on the first rendering resource, performing off-screen rendering processing on each semi-transparent special effect object according to color information and transparency information corresponding to each semi-transparent special effect object to obtain a target special effect image includes:
[0026] Obtaining weight information, loading duration information and complexity information of each translucent special effect object;
[0027] Evaluate each of the semi-transparent special effect objects according to the weight information, the loading duration information, and the complexity information to obtain a comprehensive evaluation index corresponding to the at least one semi-transparent special effect object; the comprehensive evaluation index is used to characterize the degree of influence of the at least one semi-transparent special effect object on rendering performance;
[0028] When the comprehensive evaluation index meets the second preset condition, based on the first rendering resource, each semi-transparent special effect object is off-screen rendered according to the color information and transparency information corresponding to each semi-transparent special effect object to obtain the target special effect image.
[0029] In an optional embodiment, based on the first rendering resource, performing off-screen rendering processing on each semi-transparent special effect object according to color information and transparency information corresponding to each semi-transparent special effect object to obtain a target special effect image includes:
[0030] When the number of at least one semi-transparent special effect object is greater than a preset number threshold, based on the first rendering resource, off-screen rendering is performed on each semi-transparent special effect object according to the color information and transparency information corresponding to each semi-transparent special effect object to obtain the target special effect image.
[0031] According to a second aspect of an embodiment of the present application, a rendering device is provided, including:
[0032] An acquisition module, configured to acquire a scene object to be rendered and at least one semi-transparent special effect object, as well as color information and transparency information corresponding to each semi-transparent special effect object;
[0033] The rendering module is configured to perform off-screen rendering processing on each semi-transparent special effect object based on the first rendering resource and according to the color information and transparency information corresponding to each semi-transparent special effect object to obtain a target special effect image; and perform rendering processing on the scene object based on the second rendering resource to obtain an initial scene image; the resolution of the initial scene image is greater than the resolution of the target special effect image;
[0034] A color conversion module is configured to perform color conversion processing on the initial scene image based on the second rendering resource to obtain a target scene image;
[0035] The fusion module is configured to perform fusion processing on the target special effect image and the target scene image based on the second rendering resource to obtain a target special effect scene image.
[0036] According to a third aspect of an embodiment of the present application, there is provided an electronic device for rendering, including:
[0037] processor;
[0038] a memory for storing instructions executable by the processor;
[0039] The processor is configured to execute the instructions to implement the rendering method as described in any of the above embodiments.
[0040] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device executes the rendering method as described in any of the above embodiments.
[0041] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the rendering method described in any of the above embodiments is implemented.
[0042] The technical solution provided by the embodiments of the present application brings at least the following beneficial effects:
[0043] The embodiments of the present application provide a rendering method, device, electronic device and storage medium. The method first obtains a scene object to be rendered and at least one semi-transparent special effect object, as well as color information and transparency information corresponding to each semi-transparent special effect object, and then based on a first rendering resource, performs off-screen rendering processing on each semi-transparent special effect object according to the color information and transparency information corresponding to each semi-transparent special effect object to obtain a target special effect image, thereby optimizing the rendering process, reducing over-drawing and rendering pressure, and ensuring the visual effect of special effect off-screen rendering; and based on a second rendering resource, performs rendering processing on the scene object to obtain an initial scene image, wherein the resolution of the initial scene image is greater than the resolution of the target special effect image; thereafter, performs color conversion processing on the initial scene image based on the second rendering resource to obtain a target scene image, and performs fusion processing on the target special effect image and the target scene image based on the second rendering resource to obtain a target special effect scene image, thereby ensuring the quality of the game screen, while reducing the consumption of special effects on game performance, and improving game performance and stability.
[0044] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application, and do not constitute an improper limitation on the present application.
[0046] Figure 1 The present invention is a diagram showing an application environment of a rendering method according to an exemplary embodiment.
[0047] Figure 2 The present invention is a flowchart of a rendering method according to an exemplary embodiment.
[0048] Figure 3 The figure is a schematic diagram of a process of obtaining a target special effect image according to an exemplary embodiment.
[0049] Figure 4 The figure is a schematic diagram of another process of obtaining a target special effect image according to an exemplary embodiment.
[0050] Figure 5The present invention is a schematic diagram of a flow chart showing a fusion process of a target special effect image and a target scene image according to an exemplary embodiment.
[0051] Figure 6 It is a schematic diagram of a target special effect scene image before color information corresponding to an initial pixel point is updated based on color information corresponding to a target pixel point according to an exemplary embodiment.
[0052] Figure 7 It is a schematic diagram of a target special effect scene image after color information corresponding to an initial pixel point is updated based on color information corresponding to a target pixel point according to an exemplary embodiment.
[0053] Figure 8 The figure is another flowchart of fusing a target special effect image and a target scene image according to an exemplary embodiment.
[0054] Fig. 9 The present invention is a block diagram of a rendering device according to an exemplary embodiment.
[0055] Fig.10 It is a block diagram of an electronic device for rendering according to an exemplary embodiment.
[0056] Fig.11 is a block diagram of another electronic device for rendering according to an exemplary embodiment. DETAILED DESCRIPTION
[0057] In order to enable ordinary persons in the art to better understand the technical solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0058] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0059] Special effects play a vital role in games. They not only add visual splendor to the game, but are also an important element in creating the atmosphere and emotional experience of the game world. Therefore, special effects play an indispensable role in game performance and play a vital role in the quality and influence of the game. Most game special effects use translucent effects. This is because translucent special effects can better show the light and shadow effects in the real world, enhancing the realism and three-dimensionality of the game screen. However, translucent special effects are a complex and thorny issue in game optimization. The challenges are mainly reflected in the unpredictability of rendering load, the relationship between special effect complexity and performance consumption, and the limitations of traditional optimization methods. Due to the transparency and complexity of special effects, a large amount of overdrawing may be generated during the rendering process, resulting in performance degradation, while overly refined special effects design will increase the load on the CPU and GPU, causing large fluctuations in frame rate.
[0060] This application implements a special effect off-screen rendering solution with reduced resolution in the Unity engine, which makes fundamental optimizations in the rendering pipeline to solve the problem of balancing special effect performance and picture quality in game development, and significantly improves game performance while minimizing picture quality loss. In this way, game developers can significantly reduce the consumption of special effects on game performance while maintaining good visual effects, thereby improving the fluency of the game and user experience.
[0061] See also Figure 1 , Figure 1 01 is an application environment diagram of a rendering method according to an exemplary embodiment. The application environment may include a client 01 and a server 02. The server 02 may communicate with the client 01 in a wired or wireless manner, which is not limited in this application.
[0062] Among them, the client 01 can be used to provide services such as special effects rendering of game scenes to any user. Specifically, the client 01 can include but is not limited to smart phones, desktop computers, tablet computers, laptops, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, smart wearable devices and other types of electronic devices, and can also be software running on the above electronic devices, such as applications. Optionally, the operating system running on the electronic device can include but is not limited to Android system, IOS system, Linux, Windows, etc.
[0063] The server 02 may provide background services for the client 01. Specifically, the server 02 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.
[0064] It should be noted that Figure 1 This is only one application environment of the rendering method provided in this application. In actual applications, other application environments may also be included.
[0065] Figure 2 is a flowchart of a rendering method according to an exemplary embodiment. Figure 2 As shown, the method may at least include the following steps:
[0066] In step S201, a scene object to be rendered and at least one semi-transparent special effect object, as well as color information and transparency information corresponding to each semi-transparent special effect object are obtained.
[0067] The present application does not limit scene objects and translucent special effects objects. In a specific embodiment, the scene objects may include object objects and background objects. Specifically, the object objects may include opaque object objects. Translucent special effects objects can be rendered to form different translucent effects, such as water, fog, gas, fire, dust, etc. The transparency information corresponding to the translucent special effects object can indicate the degree of transparency of the translucent special effects object. Specifically, the value range of the transparency information of the translucent special effects object can be (0,1). The smaller the transparency information, the higher the degree of transparency of the translucent special effects object, that is, a transparency information of 0 indicates full transparency, and a transparency information of 1 indicates opacity.
[0068] In step S203, based on the first rendering resource, each semi-transparent special effect object is rendered off-screen according to the color information and transparency information corresponding to each semi-transparent special effect object to obtain a target special effect image; and based on the second rendering resource, the scene object is rendered to obtain an initial scene image.
[0069] In a specific embodiment, the first rendering resource may be an off-screen rendering channel, and the second rendering resource is different from the first rendering resource, and the second rendering resource may be a non-off-screen rendering channel, so as to render the semi-transparent special effect objects and the scene objects synchronously respectively. Specifically, based on the above-mentioned off-screen rendering channel (first rendering resource), each semi-transparent special effect object may be rendered, and the semi-transparent special effect rendering information may be stored in an off-screen buffer, which may store the attribute information of the semi-transparent special effect object, such as color information, transparency information, depth information, etc.; based on the non-off-screen rendering channel (second rendering resource), the scene object may be rendered, and the scene information may be stored in a non-off-screen buffer (frame buffer FrameBuffer), which may store the attribute information of the scene object, such as color information, transparency information, depth information, etc. The resolution of the above-mentioned initial scene image may be greater than the resolution of the target special effect image.
[0070] In the prior art, semi-transparent special effect objects and scene objects are usually rendered through a non-off-screen rendering channel. This application adds a new off-screen channel to render semi-transparent special effect objects off-screen, while scene objects are still rendered through a non-off-screen rendering channel. Through such optimization, the GPU load can be reduced, over-drawing and rendering pressure can be reduced, thereby improving the performance and smoothness of the game. This improvement can not only alleviate the performance pressure during the rendering process, but also maintain the clarity and visual effects of the game screen, providing players with a smoother and higher-quality gaming experience.
[0071] In an alternative embodiment, Figure 3 is a schematic diagram of a process of obtaining a target special effect image according to an exemplary embodiment. Figure 3 As shown, in the above step S203, performing off-screen rendering processing on each semi-transparent special effect object according to the color information and transparency information corresponding to each semi-transparent special effect object to obtain a target special effect image may include:
[0072] In step S301, an initial special effect image is obtained.
[0073] In a specific embodiment, the initial special effect image may include each of the above-mentioned semi-transparent special effect objects and the background object.
[0074] In step S303, according to the transparency information corresponding to each semi-transparent special effect object, the color information corresponding to each semi-transparent special effect object and the preset color information corresponding to the background object are mixed to obtain mixed color information.
[0075] In a specific embodiment, the color information and transparency information corresponding to each semi-transparent special effect object may include the color information and transparency information corresponding to the pixel points of each semi-transparent special effect object. According to the correspondence between the pixel points of the semi-transparent special effect object and the background object in the screen coordinate system in the initial special effect image, the corresponding pixel points in each semi-transparent special effect object and the background object are mixed to obtain the mixed color information of the pixel points. Specifically, the screen coordinate system is a two-dimensional coordinate system established on the screen, with pixels as units, the lower left corner of the screen is (0, 0), and the upper right corner is (screen width, screen height). In actual applications, the color information and transparency information corresponding to each pixel point can be output by the pixel shader (Shader) of the game engine (such as Unity), and the above-mentioned preset color information can be the color information of the pixel points of the background object stored in the above-mentioned non-off-screen buffer.
[0076] In an optional embodiment, in the above step S303, the color information corresponding to each semi-transparent special effect object and the preset color information corresponding to the background object are mixed according to the transparency information corresponding to each semi-transparent special effect object to obtain the mixed color information, which may include:
[0077] Based on the preset mixing mode, according to the transparency information corresponding to each semi-transparent special effect object, the color information corresponding to each semi-transparent special effect object and the preset color information corresponding to the background object are mixed to obtain mixed color information.
[0078] In a specific embodiment, based on the corresponding blending mode, the color information corresponding to each semi-transparent special effect object and the preset color information corresponding to the background object can be blended according to the transparency information corresponding to each semi-transparent special effect object. Specifically, the preset blending mode may include the Blend blending mode, the Addictive blending mode, and the Multiply blending mode.
[0079] Specifically, taking off-screen blending in Blend blending mode as an example, the blending color information can be obtained according to the following formula:
[0080] p n =d*(1-α1)*…*(1-α n )+s1*α1*(1-α2)*…*(1-α n )+…+s n *α n
[0081] Among them, p n represents mixed color information, d represents preset color information, α1,…,α n Indicates the transparency information corresponding to each semi-transparent special effect object, s1,…,s n Represents the color information corresponding to each semi-transparent special effect object, and n represents the number of at least one semi-transparent special effect object.
[0082] In step S305, the initial special effect image is updated based on the mixed color information to obtain a target special effect image.
[0083] Specifically, the initial special effect image updated based on the mixed color information may be used as the target special effect image.
[0084] In the above embodiment, according to the transparency information corresponding to each semi-transparent special effects object, the color information corresponding to each semi-transparent special effects object and the preset color information corresponding to the background object are mixed, and in the mixing process, the color calculation method corresponding to different mixing modes is combined to calculate the mixed color, and the initial special effects image is updated to obtain the target special effects image, thereby ensuring that the results of subsequent off-screen rendering can be correctly integrated with the rendering results of other rendering channels to ensure the overall rendering effect of the game, which not only ensures the visual effect of special effects rendering, but also ensures the efficient use of game performance.
[0085] In an alternative embodiment, Figure 4 is a schematic diagram of another process of obtaining a target special effect image according to an exemplary embodiment. Figure 4 As shown, in the above step S203, based on the first rendering resource, each semi-transparent special effect object is subjected to off-screen rendering processing according to the color information and transparency information corresponding to each semi-transparent special effect object to obtain the target special effect image, which may include:
[0086] In step S401, the weight information, loading duration information and complexity information of each semi-transparent special effect object are obtained.
[0087] In a specific embodiment, the weight information of each translucent special effect object can represent the importance of each translucent special effect object to the visual effect of the game. The larger the weight information, the higher the importance. The weight information can be set according to the actual application requirements. The loading time information and complexity information of each translucent special effect object can represent the rendering load information corresponding to each translucent special effect object. The longer the loading time, the higher the complexity, and the greater the corresponding load, that is, the greater the impact on the game rendering performance. Specifically, the above loading time information may be related to the configuration of the game running terminal.
[0088] In step S403, each semi-transparent special effect object is evaluated according to the weight information, the loading time information and the complexity information to obtain a comprehensive evaluation index corresponding to at least one semi-transparent special effect object.
[0089] In a specific embodiment, the comprehensive evaluation index can be used to characterize the degree of influence of at least one semi-transparent special effect object on rendering performance. The larger the value corresponding to the comprehensive evaluation index, the greater the degree of influence of the semi-transparent special effect object on rendering performance. The at least one semi-transparent special effect object is a semi-transparent special effect object for display on the same screen. Specifically, based on the weight information, the loading time information and complexity information of each semi-transparent special effect object can be weighted and summed to calculate the above comprehensive evaluation index.
[0090] In step S405, when the comprehensive evaluation index meets the second preset condition, based on the first rendering resource, each semi-transparent special effect object is off-screen rendered according to the color information and transparency information corresponding to each semi-transparent special effect object to obtain a target special effect image.
[0091] In a specific embodiment, the second preset condition can be set according to actual application requirements. Specifically, when the comprehensive evaluation index is greater than or equal to the preset evaluation threshold, based on the first rendering resource, each semi-transparent special effect object can be rendered off-screen according to the color information and transparency information corresponding to each semi-transparent special effect object to obtain the above-mentioned target special effect image; the preset evaluation threshold can be set according to actual application requirements.
[0092] Optionally, when the comprehensive evaluation index does not meet the above-mentioned second preset condition, each semi-transparent special effect object and scene object may be rendered based on the above-mentioned second rendering resource to obtain the above-mentioned target special effect image and target scene image. Specifically, when the comprehensive evaluation index is less than the above-mentioned preset evaluation threshold, each semi-transparent special effect object and scene object may be rendered based on the above-mentioned second rendering resource to obtain the above-mentioned target special effect image and target scene image. In actual applications, since the addition of additional off-screen rendering channels may increase the bandwidth consumption of the system and have a negative impact on game performance, the step of performing off-screen rendering on each semi-transparent special effect object based on the first rendering resource may not be performed when the impact of the semi-transparent special effect object on the rendering performance is small.
[0093] In the above embodiment, each semi-transparent special effect is scored according to information such as the importance of the semi-transparent special effect and the rendering load, and a determination is made whether to perform off-screen rendering on the semi-transparent special effect based on the off-screen rendering channel based on the cumulative score of the semi-transparent special effects on the same screen. This can improve the flexibility of special effects rendering in game development, select corresponding special effects and scene rendering methods for rendering optimization based on actual conditions, achieve a balance between picture quality and game performance as much as possible, and perform off-screen rendering on the semi-transparent special effects based on the off-screen rendering channel.
[0094] In an optional embodiment, in the above step S203, based on the first rendering resource, performing off-screen rendering processing on each semi-transparent special effect object according to the color information and transparency information corresponding to each semi-transparent special effect object to obtain the target special effect image may include:
[0095] When the number of at least one semi-transparent special effects object is greater than a preset number threshold, based on the first rendering resource, off-screen rendering is performed on each semi-transparent special effects object according to the color information and transparency information corresponding to each semi-transparent special effects object to obtain a target special effects image.
[0096] In a specific embodiment, the preset quantity threshold can be set according to actual application requirements, for example, it can be determined according to information such as the type of game, the size of the space occupied, and the configuration of the game running terminal. Optionally, when the number of at least one translucent special effect object is less than or equal to the above-mentioned preset quantity threshold, each translucent special effect object and scene object can be rendered based on the above-mentioned second rendering resource to obtain the above-mentioned target special effect image and target scene image. In actual applications, the camera settings can be performed in the game engine, and dynamic switch settings can be provided to select the corresponding special effects and scene rendering methods.
[0097] In the embodiments of the present specification, the corresponding special effects and scene rendering methods can be selected according to the number of semi-transparent special effects. When the number of semi-transparent special effects is large, the semi-transparent special effects can be rendered off-screen based on the added off-screen rendering channel, while the scene objects are rendered through the non-off-screen rendering channel. When the number of semi-transparent special effects is small, the off-screen rendering channel does not need to be added, and the semi-transparent special effects and scene objects are only rendered through the non-off-screen rendering channel. The flexibility of special effects rendering in game development can be improved, performance optimization can be achieved, and the overall quality and performance of the game can be improved.
[0098] In step S205, color conversion processing is performed on the initial scene image based on the second rendering resource to obtain a target scene image.
[0099] In a specific embodiment, the initial scene image may be subjected to tone mapping, that is, mapping from a high dynamic color range (HDR color range) to a low dynamic color range (LDR color range) on a display screen to obtain a target scene image. The LDR color range is [0,1]. Specifically, the initial scene image may be subjected to tone mapping based on a preset mapping formula to obtain a target scene image, and the preset mapping formula may be set according to actual application requirements.
[0100] In step S207, the target special effect image and the target scene image are fused based on the second rendering resource to obtain a target special effect scene image.
[0101] Specifically, the target special effect scene image may include a target object image and a target background image, the target object image may correspond to the object object in the above-mentioned scene object, and the target background image may correspond to the background object in the above-mentioned scene object. In practical applications, since the off-screen rendering processing of the semi-transparent special effects is performed through the newly added off-screen rendering channel in the early stage, if the subsequent rendering operation is still performed through the newly added channel, the complexity of the rendering pipeline will also increase accordingly, which may lead to a decrease in performance. Therefore, the present application simplifies the subsequent rendering process on the basis of ensuring the picture quality to improve the performance of the game. Specifically, on the basis of the off-screen rendering processing of the semi-transparent special effects by the newly added off-screen rendering channel, the off-screen rendering result (i.e., the target special effect image) is subsequently fused with the rendering result (i.e., the target scene image) of the scene object based on the rendering channel corresponding to the scene object, and integrated into the tone mapping stage, based on the rendering channel corresponding to the scene object, the tone mapping and the above-mentioned fusion process are performed in sequence, thereby saving a rendering channel, and effectively optimizing the rendering process and improving performance utilization on the basis of realizing the rendering function and effect.
[0102] In an alternative embodiment, Figure 5 FIG. 1 is a flow chart showing a fusion process of a target special effect image and a target scene image according to an exemplary embodiment. Figure 5 As shown, in the above step S207, the above-mentioned fusion processing of the target special effect image and the target scene image based on the second rendering resource to obtain the target special effect scene image may include:
[0103] In step S501, a fusion process is performed on the target special effect image and the target scene image to obtain an initial special effect scene image.
[0104] In a specific embodiment, the initial special effect scene image may be a special effect scene image without pixel color update. Specifically, the initial special effect scene image may include an initial object image and an initial background image, and the initial object image may correspond to the above-mentioned opaque object image.
[0105] In step S503, the depth information and color information corresponding to the initial pixel point of the initial special effect scene image is obtained.
[0106] In actual applications, a single rendering channel can be bound to at least one rendering buffer, and the rendering buffer can include at least a color buffer and a depth buffer. The depth buffer can be used to store the depth information of the pixel, which can represent the distance from the pixel to the camera; the color buffer can be used to store the color information of the pixel.
[0107] In step S505, when the depth information of the initial pixel satisfies the first preset condition, the color information corresponding to the initial pixel is updated based on the color information corresponding to the target pixel to obtain first updated color information corresponding to the initial pixel.
[0108] In a specific embodiment, the target pixel point may be a pixel point, among the initial pixel point and the adjacent pixel points, whose depth information differs from the first preset depth information by less than the first preset depth threshold; the adjacent pixel points may include a preset number of pixel points adjacent to the initial pixel point. Specifically, the target pixel point may be a pixel point, among the initial pixel point and the adjacent pixel points, whose depth information differs from the first preset depth information by less. The above-mentioned first preset depth information, first preset depth threshold and preset number may be set according to actual application requirements. For example, the first preset depth information may be the depth information corresponding to the initial pixel point at full resolution; the preset number may be set to 4. In the case where the first preset depth information is the depth information corresponding to the initial pixel point at full resolution, the above-mentioned target pixel point may be a pixel point, among the initial pixel point and the adjacent pixel points, whose depth information is closest to the depth information corresponding to the full resolution.
[0109] Specifically, when the depth information of the initial pixel meets the first preset condition, the initial pixel can be determined as a pixel located at the edge in the overlapping area between the semi-transparent special effect and the opaque object of the initial special effect scene image, that is, a pixel corresponding to the overlapping edge of the semi-transparent special effect and the opaque object, and then the color information corresponding to the above-mentioned target pixel can be determined as the first updated color information of the corresponding initial pixel; when the depth information of the initial pixel meets the first preset condition, the initial pixel can be determined as a pixel that is not the above-mentioned edge pixel in the initial special effect scene image, that is, a non-edge pixel, wherein the non-edge pixel can include a pixel that is not located at the overlapping edge in the overlapping area between the semi-transparent special effect and the opaque object, and a pixel corresponding to other areas in the initial special effect scene image except the above-mentioned overlapping area. For the above-mentioned pixel that is not located at the overlapping edge in the overlapping area between the semi-transparent special effect and the opaque object, the color information corresponding to the initial pixel and the color information corresponding to the adjacent pixel can be averaged to obtain the first updated color information corresponding to the initial pixel.
[0110] Optionally, in the above step S505, when the depth information of the initial pixel satisfies the first preset condition, the color information corresponding to the initial pixel is updated based on the color information corresponding to the target pixel, and obtaining the first updated color information corresponding to the initial pixel may include:
[0111] When the difference between the depth information of the initial pixel and the second preset depth information is greater than the second preset depth threshold, the color information corresponding to the initial pixel is updated based on the color information corresponding to the target pixel to obtain the first updated color information corresponding to the initial pixel.
[0112] Specifically, the second preset depth information and the second preset depth threshold can be set according to actual application requirements. For example, the second preset depth information can be the depth information corresponding to the initial pixel at full resolution. Specifically, when the difference between the depth information of the initial pixel and the second preset depth information is greater than the second preset depth threshold, the initial pixel can be determined as a pixel located at the edge in the overlapping area of the target special effect image and the initial object image, and then the color information corresponding to the above target pixel can be determined as the first updated color information of the corresponding initial pixel.
[0113] Optionally, when the absolute value of the difference between the depth information of the initial pixel and the second preset depth information is greater than a third preset depth threshold, the color information corresponding to the initial pixel can be updated based on the color information corresponding to the target pixel to obtain the first updated color information corresponding to the initial pixel. Specifically, the third preset depth threshold can be set according to actual application requirements.
[0114] In practical applications, the pixel points corresponding to the overlapping edges of the above-mentioned translucent special effects and opaque objects can be subjected to approximate depth upsampling (Nearest-Depth Upsampling). Along the preset order, for the initial pixel point, the color information corresponding to the pixel point whose depth information is closest to the depth information corresponding to the full resolution in the 2x2 pixel block covering the initial pixel point (that is, the initial pixel point and the adjacent pixel points) is determined as the updated color information of the initial pixel point.
[0115] In step S507, the initial object image is updated based on the first updated color information of the initial pixel to obtain the target object image. Specifically, the object image updated based on the first updated color information can be used as the target object image.
[0116] In the embodiments of this specification, Figure 6 is a schematic diagram of a target special effect scene image before color information corresponding to an initial pixel point is updated based on color information corresponding to a target pixel point according to an exemplary embodiment. Figure 7 is a schematic diagram of a target special effect scene image after color information corresponding to an initial pixel point is updated based on color information corresponding to a target pixel point according to an exemplary embodiment. Figure 6 and Figure 7As shown, for the special effects scene image, the semi-transparent special effects overlap the edge pixels with the opaque objects in the scene, and the color of the pixel and its adjacent pixels whose depth information is closest to the full-resolution depth information is used as the color of the pixel, thereby updating the color of the pixel, making the overlapping edges of the semi-transparent special effects and the opaque objects in the scene clearer, thereby improving the rendering effect of the edge area.
[0117] Optional, Figure 8 FIG. 1 is another flow chart showing another process of fusing a target special effect image and a target scene image according to an exemplary embodiment. Figure 8 As shown, in the above step S207, the above-mentioned fusion processing of the target special effect image and the target scene image based on the second rendering resource to obtain the target special effect scene image may also include:
[0118] In step S801, when the depth information of the initial pixel does not satisfy a preset condition, the color information corresponding to the initial pixel and the color information corresponding to the adjacent pixels are averaged to obtain second updated color information corresponding to the initial pixel.
[0119] In a specific embodiment, when the depth information of the initial pixel does not meet the first preset condition, the initial pixel can be determined as a pixel in the initial special effect scene image that is not the above-mentioned edge pixel, that is, a non-edge pixel, wherein the non-edge pixel may include a pixel that is not located at the overlapping edge in the overlapping area between the semi-transparent special effect and the opaque object, and a pixel corresponding to other areas except the above-mentioned overlapping area in the initial special effect scene image. Specifically, the pixel corresponding to other areas except the above-mentioned overlapping area in the initial special effect scene image include pixel corresponding to the overlapping area between the semi-transparent special effect and the background, and pixel corresponding to the non-overlapping area between the semi-transparent special effect and the background. For the pixel corresponding to the overlapping area between the semi-transparent special effect and the background, the color information corresponding to the initial pixel and the color information corresponding to the adjacent pixel are averaged to obtain the second updated color information corresponding to the initial pixel; for the pixel corresponding to the non-overlapping area between the semi-transparent special effect and the background, the color information corresponding to the initial pixel is determined as the second updated color information.
[0120] In the embodiments of the present specification, bilinear upsampling can be performed on the pixels corresponding to the non-edges in the overlapping area between the above-mentioned translucent special effects and opaque objects, and the pixels corresponding to the overlapping area between the translucent special effects and the background, and along the preset order, for the initial pixel, the color information of the pixels in the 2x2 pixel block covering the initial pixel is averaged to update the color information of the initial pixel. For the pixels corresponding to the non-overlapping area between the translucent special effects and the background, color updating may not be performed. In practical applications, the information of multiple pixels can be obtained at one time through interfaces such as GATHER_RED_TEXTURE2D_X, and specific channel data in the texture can be directly accessed without adding additional storage or bandwidth overhead, which can save memory bandwidth and texture cache usage, thereby further improving rendering efficiency and performance.
[0121] In step S803, the initial background image is updated based on the second updated color information of the initial pixel to obtain a target background image. Specifically, the initial background image updated based on the second updated color information can be used as the target object image.
[0122] In the above embodiment, for the special effects scene image, except for the edge pixels where the semi-transparent special effects overlap with the opaque objects in the scene, the color information corresponding to the adjacent pixels are averaged to update the color of the pixel, avoid blocky defective pixels in non-edge areas, and improve the rendering effect of non-edge areas.
[0123] In practical applications, through the above rendering method, the rendering results after off-screen rendering with different degrees of resolution reduction for semi-transparent special effects are merged with the scene rendering results to obtain special effect scene images. The GPU time corresponding to full resolution is 15.101ms, and the GPU time corresponding to 1 / 2 resolution is 9.133ms. Compared with full resolution, the GPU time performance of 1 / 2 resolution is improved by far more than 15%, and the GPU time corresponding to 1 / 4 resolution is 6.08ms. The GPU time performance of 1 / 4 resolution is improved by far more than 30%; and the loss of picture effect at 1 / 2 resolution is less than 15%, and the loss of picture effect at 1 / 4 resolution is less than 30%. In addition, at 1 / 4 resolution, if the above upsampling process is not integrated into the scene tone mapping stage, the corresponding GPU time is 7.478ms. Therefore, the GPU time performance corresponding to the rendering method of this scheme is improved by 18%.
[0124] The embodiment of the present application provides a rendering method, firstly obtaining a scene object to be rendered and at least one semi-transparent special effect object, as well as the color information and transparency information corresponding to each semi-transparent special effect object, and then based on the first rendering resource, performing off-screen rendering processing on each semi-transparent special effect object according to the color information and transparency information corresponding to each semi-transparent special effect object, obtaining a target special effect image, thereby optimizing the rendering process, reducing over-drawing and rendering pressure, and ensuring the visual effect of off-screen rendering of special effects; and based on the second rendering resource, performing rendering processing on the scene object to obtain an initial scene image, wherein the resolution of the initial scene image is greater than the resolution of the target special effect image; then, performing color conversion processing on the initial scene image based on the second rendering resource to obtain a target scene image, and performing fusion processing on the target special effect image and the target scene image based on the second rendering resource to obtain a target special effect scene image, thereby ensuring the quality of the game screen, while reducing the consumption of special effects on game performance, and improving game performance and stability. The off-screen rendering with reduced resolution of semi-transparent special effects can simultaneously improve the picture quality and operation efficiency of the product, and can meet the game needs of different game running terminal users.
[0125] Fig. 9 is a block diagram of a rendering device according to an exemplary embodiment. Fig. 9 , the device comprises:
[0126] The acquisition module 910 is configured to acquire a scene object to be rendered and at least one semi-transparent special effect object, as well as color information and transparency information corresponding to each semi-transparent special effect object;
[0127] The rendering module 920 is configured to perform off-screen rendering processing on each semi-transparent special effect object based on the first rendering resource and according to the color information and transparency information corresponding to each semi-transparent special effect object to obtain a target special effect image; and perform rendering processing on the scene object based on the second rendering resource to obtain an initial scene image; the resolution of the initial scene image is greater than the resolution of the target special effect image;
[0128] A color conversion module 930 is configured to perform color conversion processing on the initial scene image based on the second rendering resource to obtain a target scene image;
[0129] The fusion module 940 is configured to perform fusion processing on the target special effect image and the target scene image based on the second rendering resource to obtain a target special effect scene image.
[0130] In an optional embodiment, the rendering module includes:
[0131] A first acquisition unit is configured to acquire an initial special effect image, wherein the initial special effect image includes each of the semi-transparent special effect objects and the background object;
[0132] A first mixing unit is configured to mix the color information corresponding to each semi-transparent special effect object and the preset color information corresponding to the background object according to the transparency information corresponding to each semi-transparent special effect object to obtain mixed color information;
[0133] The first updating unit is configured to update the initial special effect image based on the mixed color information to obtain the target special effect image.
[0134] In an optional embodiment, the first mixing unit comprises:
[0135] The second mixing unit is configured to mix the color information corresponding to each semi-transparent special effect object and the preset color information corresponding to the background object based on a preset mixing mode and according to the transparency information corresponding to each semi-transparent special effect object to obtain the mixed color information.
[0136] In an optional embodiment, the above fusion module includes:
[0137] a fusion unit configured to perform fusion processing on the target special effect image and the target scene image to obtain an initial special effect scene image, wherein the initial special effect scene image includes an initial object image;
[0138] A second acquisition unit is configured to acquire depth information and color information corresponding to initial pixel points of the initial special effect scene image;
[0139] A second updating unit is configured to update the color information corresponding to the initial pixel point based on the color information corresponding to the target pixel point when the depth information of the initial pixel point satisfies the first preset condition, so as to obtain first updated color information corresponding to the initial pixel point; the target pixel point is a pixel point among the initial pixel point and the adjacent pixel points, the difference between the depth information and the first preset depth information of the target pixel point is less than a first preset depth threshold, and the adjacent pixel points include a preset number of pixel points adjacent to the initial pixel point;
[0140] The third updating unit is configured to update the initial object image based on the first updated color information of the initial pixel point to obtain the target object image.
[0141] In an optional embodiment, the above fusion module further includes:
[0142] A second updated color information determining unit is configured to, when the depth information of the initial pixel does not satisfy the preset condition, average the color information corresponding to the initial pixel and the color information corresponding to the adjacent pixels to obtain second updated color information corresponding to the initial pixel;
[0143] The fourth updating unit is configured to update the initial background image based on the second updated color information of the initial pixel point to obtain the target background image.
[0144] In an optional embodiment, the second updating unit includes:
[0145] The fifth updating unit is configured to update the color information corresponding to the initial pixel point based on the color information corresponding to the target pixel point when the difference between the depth information of the initial pixel point and the second preset depth information is greater than the second preset depth threshold, so as to obtain the first updated color information corresponding to the initial pixel point.
[0146] In an optional embodiment, the rendering module includes:
[0147] A third acquisition unit is configured to acquire weight information, loading duration information and complexity information of each semi-transparent special effect object;
[0148] a comprehensive evaluation index determination unit, configured to evaluate each of the semi-transparent special effect objects according to the weight information, the loading time information and the complexity information, and obtain a comprehensive evaluation index corresponding to the at least one semi-transparent special effect object; the comprehensive evaluation index is used to characterize the degree of influence of the at least one semi-transparent special effect object on the rendering performance;
[0149] The first off-screen rendering unit is configured to, when the comprehensive evaluation index meets the second preset condition, based on the first rendering resource, perform off-screen rendering processing on each semi-transparent special effect object according to the color information and transparency information corresponding to each semi-transparent special effect object, so as to obtain the target special effect image.
[0150] In an optional embodiment, the rendering module includes:
[0151] The second off-screen rendering unit is configured to, when the number of at least one semi-transparent special effect object is greater than a preset number threshold, perform off-screen rendering processing on each semi-transparent special effect object based on the first rendering resource and according to the color information and transparency information corresponding to each semi-transparent special effect object to obtain the target special effect image.
[0152] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0153] Fig.10 is a block diagram of an electronic device for rendering according to an exemplary embodiment. The electronic device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig.10 As shown. The electronic device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a rendering method is implemented. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the housing of the electronic device, or an external keyboard, touchpad or mouse, etc.
[0154] Fig.11 is a block diagram of another electronic device for rendering according to an exemplary embodiment. The electronic device may be a server, and its internal structure diagram may be as shown in FIG. Fig.11 As shown. The electronic device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a rendering method is implemented.
[0155] Those skilled in the art will understand that Fig.10 or Fig.11 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present disclosure, and does not constitute a limitation on the electronic device to which the scheme of the present disclosure is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0156] In an exemplary embodiment, an electronic device is also provided, including: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the rendering method in the embodiment of the present disclosure.
[0157] In an exemplary embodiment, a computer-readable storage medium is further provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the steps of any rendering method in the above embodiments.
[0158] In an exemplary embodiment, a computer program product is further provided, including a computer program, and when the computer program is executed by a processor, the rendering method provided in any one of the above embodiments is implemented.
[0159] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0160] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0161] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A rendering method, characterized in that: The method comprises: Obtain a scene object to be rendered and at least one translucent special effect object, as well as color information and transparency information corresponding to each translucent special effect object; Based on the first rendering resource, each semi-transparent special effect object is subjected to off-screen rendering processing according to the color information and transparency information corresponding to each semi-transparent special effect object to obtain a target special effect image; and based on the second rendering resource, the scene object is subjected to rendering processing to obtain an initial scene image; the resolution of the initial scene image is greater than the resolution of the target special effect image; Performing color conversion processing on the initial scene image based on the second rendering resource to obtain a target scene image; The target special effect image and the target scene image are fused based on the second rendering resource to obtain a target special effect scene image.
2. The method according to claim 1, characterized in that The performing off-screen rendering processing on each semi-transparent special effect object according to the color information and transparency information corresponding to each semi-transparent special effect object to obtain a target special effect image comprises: Acquire an initial special effect image, wherein the initial special effect image includes each of the semi-transparent special effect objects and a background object; According to the transparency information corresponding to each semi-transparent special effect object, the color information corresponding to each semi-transparent special effect object and the preset color information corresponding to the background object are mixed to obtain mixed color information; Based on the mixed color information, the initial special effect image is updated to obtain the target special effect image.
3. The method according to claim 2, characterized in that The step of mixing the color information corresponding to each semi-transparent special effect object and the preset color information corresponding to the background object according to the transparency information corresponding to each semi-transparent special effect object to obtain the mixed color information includes: Based on a preset mixing mode, according to the transparency information corresponding to each semi-transparent special effect object, the color information corresponding to each semi-transparent special effect object and the preset color information corresponding to the background object are mixed to obtain the mixed color information.
4. The method according to claim 1, characterized in that: The target special effect scene image includes a target object image, and the fusion processing of the target special effect image and the target scene image to obtain the target special effect scene image includes: Performing fusion processing on the target special effect image and the target scene image to obtain an initial special effect scene image, wherein the initial special effect scene image includes an initial object image; Obtaining depth information and color information corresponding to initial pixel points of the initial special effects scene image; In a case where the depth information of the initial pixel satisfies a first preset condition, the color information corresponding to the initial pixel is updated based on the color information corresponding to the target pixel to obtain first updated color information corresponding to the initial pixel; the target pixel is a pixel, among the initial pixel and adjacent pixels, whose depth information differs from the first preset depth information by less than a first preset depth threshold, and the adjacent pixels include a preset number of pixels adjacent to the initial pixel; Based on the first updated color information of the initial pixel point, the initial object image is updated to obtain the target object image.
5. The method according to claim 4, characterized in that The initial special effect scene image includes an initial background image, the target special effect scene image includes a target background image, and the fusion processing of the target special effect image and the target scene image to obtain the target special effect scene image further includes: When the depth information of the initial pixel does not satisfy the preset condition, averaging the color information corresponding to the initial pixel and the color information corresponding to adjacent pixels to obtain second updated color information corresponding to the initial pixel; Based on the second updated color information of the initial pixel, the initial background image is updated to obtain the target background image.
6. The method according to claim 4, characterized in that When the depth information of the initial pixel satisfies the first preset condition, the color information corresponding to the initial pixel is updated based on the color information corresponding to the target pixel to obtain the first updated color information corresponding to the initial pixel, including: When the difference between the depth information of the initial pixel point and the second preset depth information is greater than the second preset depth threshold, the color information corresponding to the initial pixel point is updated based on the color information corresponding to the target pixel point to obtain the first updated color information corresponding to the initial pixel point.
7. The method according to claim 1, characterized in that The performing off-screen rendering processing on each semi-transparent special effect object based on the first rendering resource and according to the color information and transparency information corresponding to each semi-transparent special effect object to obtain the target special effect image comprises: Obtaining weight information, loading duration information and complexity information of each translucent special effect object; Evaluate each of the semi-transparent special effect objects according to the weight information, the loading duration information, and the complexity information to obtain a comprehensive evaluation index corresponding to the at least one semi-transparent special effect object; the comprehensive evaluation index is used to characterize the degree of influence of the at least one semi-transparent special effect object on rendering performance; When the comprehensive evaluation index meets the second preset condition, based on the first rendering resource, each semi-transparent special effect object is off-screen rendered according to the color information and transparency information corresponding to each semi-transparent special effect object to obtain the target special effect image.
8. The method according to claim 1, characterized in that The performing off-screen rendering processing on each semi-transparent special effect object based on the first rendering resource and according to the color information and transparency information corresponding to each semi-transparent special effect object to obtain the target special effect image comprises: When the number of at least one semi-transparent special effect object is greater than a preset number threshold, based on the first rendering resource, off-screen rendering is performed on each semi-transparent special effect object according to the color information and transparency information corresponding to each semi-transparent special effect object to obtain the target special effect image.
9. A rendering device, characterized in that: include: An acquisition module, configured to acquire a scene object to be rendered and at least one semi-transparent special effect object, as well as color information and transparency information corresponding to each semi-transparent special effect object; A rendering module configured to perform off-screen rendering processing on each semi-transparent special effect object based on the first rendering resource and according to the color information and transparency information corresponding to each semi-transparent special effect object to obtain a target special effect image; and performing rendering processing on the scene object based on the second rendering resource to obtain an initial scene image; The resolution of the initial scene image is greater than the resolution of the target special effect image; A color conversion module is configured to perform color conversion processing on the initial scene image based on the second rendering resource to obtain a target scene image; The fusion module is configured to perform fusion processing on the target special effect image and the target scene image based on the second rendering resource to obtain a target special effect scene image.
10. An electronic device for rendering, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the rendering method according to any one of claims 1 to 8.
11. A computer-readable storage medium, when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device executes the rendering method according to any one of claims 1 to 8.