Image processing method and device, storage medium, and computer equipment
By using the target rendering pipeline in the game to convert color space and mix alpha, the color difference problem caused by different color spaces of the game screen is solved, and the game performance and image production efficiency are improved.
Patent Information
- Application Number
- CN202111679042.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2041-12-31
AI Technical Summary
In the game display screen, due to the different color spaces used by the image processing software and the game engine, there is a color difference in the game screen, which makes the display effect poor.
By obtaining the interface rendering data and scene rendering data of the target game scene, color space conversion and alpha mixing are performed based on gamma space and linear space respectively, and finally converting the result back to linear space to generate the final target scene rendering diagram.
It solves the color difference problem when images exported by image processing software are mixed in the game engine, improves the expressiveness and image production efficiency of the game screen, and reduces the need for game developers to manually adjust the image space and image correction.
Smart Images

Figure CN114307144B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image processing method and apparatus, a storage medium, and a computer device. Background Art
[0002] In addition to the in-game scene screen, the game display screen also includes the interactive interface UI. Usually, the game interactive interface is produced in the gamma space through image processing software, such as Photoshop, while the in-game scene screen is generally rendered in the linear space by the game engine. When the image exported by the image processing software is mixed with the in-game scene screen in the linear space through the game engine, the different color spaces of the two will cause color difference in the game screen, resulting in poor display effect. Summary of the invention
[0003] In view of this, the present application provides an image processing method and apparatus, a storage medium, and a computer device.
[0004] According to one aspect of the present application, there is provided an image processing method, comprising:
[0005] Acquire interface rendering data and scene rendering data of a target game scene, wherein the color space of the interface rendering data is a gamma space, and the color space of the scene rendering data is a linear space;
[0006] Writing the interface rendering data and the scene rendering data into a target rendering pipeline, and processing the scene rendering data through the target rendering pipeline to obtain a first scene rendering image in a linear space;
[0007] The first scene rendering image is converted from a linear space to a gamma space through the target rendering pipeline to obtain a second scene rendering image; the interface rendering data is processed through the target rendering pipeline to implement alpha blending of the second scene rendering image and the interface rendering image to obtain a third scene rendering image, and the third scene rendering image is converted from a gamma space to a linear space to obtain a target scene rendering image.
[0008] Optionally, before obtaining the interface rendering image of the target game scene and the first scene rendering image, the method further includes:
[0009] Cut the initial interface rendering image to obtain multiple interface rendering pixel data;
[0010] The relevant information of the plurality of interface rendering pixel data is stored in a slice table.
[0011] Optionally, the method further comprises:
[0012] The plurality of interface rendering pixel data and the cut table are imported into a game engine, and the game engine renders the interface rendering pixel data into corresponding pixels based on the relevant information in the cut table, and then splices them into the interface rendering graph.
[0013] Optionally, before converting the color space of the interface rendering image into a linear space and performing alpha blending on the second scene rendering image and the converted interface rendering image to obtain a third scene rendering image, the method further includes:
[0014] Based on the relevant information of the interface rendering pixel data, a UI control is added to the interface rendering graph.
[0015] Optionally, the target rendering pipeline is obtained by the following steps:
[0016] Obtaining a universal rendering pipeline in a game engine, wherein the universal rendering pipeline includes a plurality of universal rendering processes;
[0017] The shader of the process matching the interface rendering in the plurality of general rendering processes sets a first color attribute conversion to convert the attribute of the interface rendering image to linear;
[0018] Adding a color space conversion process after the scene rendering process in the plurality of general rendering processes, wherein the color space conversion process is used to convert the first scene rendering image from a linear space to a gamma space;
[0019] A second color space conversion is configured for a plurality of post-processing processes in the general rendering processes to obtain a target rendering pipeline, wherein the second color space conversion is used to convert a third scene rendering image from a gamma space to a linear space.
[0020] Optionally, the method further comprises:
[0021] A rendering identification mechanism is configured for the universal rendering pipeline to identify whether the scene rendering process has completed the rendering of the scene rendering graph through the rendering identification mechanism, and enter the color space conversion process when it is identified that the rendering is completed.
[0022] Optionally, configuring a rendering identification mechanism for the universal rendering pipeline to identify whether the scene rendering process has completed rendering of the scene rendering graph through the rendering identification mechanism includes:
[0023] A UI camera tag is added to the UI camera in the universal rendering pipeline, and the rendering identification mechanism is used to determine that the rendering of the scene rendering graph is completed when it is identified that the tag of the current rendering camera is not the UI camera tag, the current rendering camera is the base camera, and the current rendering camera is not the last rendering camera.
[0024] Optionally, processing the interface rendering data through the target rendering pipeline to implement alpha blending of the second scene rendering image and the interface rendering image includes:
[0025] The interface rendering image is rendered according to the interface rendering data and using a UI camera in the universal rendering pipeline to achieve alpha blending of the second scene rendering image and the interface rendering image.
[0026] According to another aspect of the present application, there is provided an image processing device, comprising:
[0027] A data acquisition module, used to acquire interface rendering data and scene rendering data of a target game scene, wherein the color space of the interface rendering data is a gamma space, and the color space of the scene rendering data is a linear space;
[0028] An image processing module, used for writing the interface rendering data and the scene rendering data into a target rendering pipeline, processing the scene rendering data through the target rendering pipeline, and obtaining a first scene rendering image in a linear space; and
[0029] The first scene rendering image is converted from a linear space to a gamma space through the target rendering pipeline to obtain a second scene rendering image; the interface rendering data is processed through the target rendering pipeline to implement alpha blending of the second scene rendering image and the interface rendering image to obtain a third scene rendering image, and the third scene rendering image is converted from a gamma space to a linear space to obtain a target scene rendering image.
[0030] Optionally, the device further comprises: a data processing module, configured to: slice the initial interface rendering image to obtain a plurality of interface rendering pixel data; and store relevant information of the plurality of interface rendering pixel data in a slice table.
[0031] Optionally, the image processing module is also used to import the multiple interface rendering pixel data and the cutting table into the game engine, and the game engine renders the interface rendering pixel data into corresponding pixels based on the relevant information in the cutting table, and then splices them into the interface rendering picture.
[0032] Optionally, the device further includes: a control adding module, configured to add a UI control to the interface rendering image based on relevant information of the interface rendering pixel data.
[0033] Optionally, the pipeline generation module is used to: execute the following steps to obtain the target rendering pipeline:
[0034] Obtaining a universal rendering pipeline in a game engine, wherein the universal rendering pipeline includes a plurality of universal rendering processes;
[0035] Setting a first color attribute conversion for a shader of a process matching the interface rendering in a plurality of the general rendering processes, so as to convert the attribute of the interface rendering image to linear;
[0036] Adding a color space conversion process after the scene rendering process in the plurality of general rendering processes, wherein the color space conversion process is used to convert the first scene rendering image from a linear space to a gamma space;
[0037] A second color space conversion is configured for a plurality of post-processing processes in the general rendering processes to obtain a target rendering pipeline, wherein the second color space conversion is used to convert a third scene rendering image from a gamma space to a linear space.
[0038] Optionally, the pipeline generation module is further used to configure a rendering identification mechanism for the universal rendering pipeline, so as to identify whether the scene rendering process has completed the rendering of the scene rendering graph through the rendering identification mechanism, and enter the color space conversion process when it is identified that the rendering is completed.
[0039] Optionally, the pipeline generation module is also used to add a UI camera tag to the UI camera in the universal rendering pipeline, and the rendering identification mechanism is used to determine that the rendering of the scene rendering graph is completed when it is identified that the tag of the current rendering camera is not the UI camera tag, and the current rendering camera is the base camera, and the current rendering camera is not the last rendering camera.
[0040] Optionally, the image processing module is further used to render the interface rendering image according to the interface rendering data and using a UI camera in the universal rendering pipeline to achieve alpha blending of the second scene rendering image and the interface rendering image.
[0041] According to another aspect of the present application, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned image processing method is implemented.
[0042] According to another aspect of the present application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the above-mentioned image processing method when executing the program.
[0043] By means of the above technical solution, the present application provides an image processing method and device, storage medium, and computer equipment, which call a pre-configured target rendering pipeline, and perform spatial conversion on the game scene rendering image in the linear space through each rendering process in the target rendering pipeline, convert it from the linear space to the gamma space, perform alpha blending on the scene rendering image and the interface rendering image in the gamma space, and then uniformly convert it back to the linear space. There is no need for game developers to manually adjust the output space and manually perform image correction, which improves the output efficiency, solves the problem of color difference after the output of the image processing software enters the game development engine, and improves the game expression.
[0044] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0046] Figure 1 A schematic diagram of a process flow of an image processing method provided in an embodiment of the present application is shown;
[0047] Figure 2 A schematic diagram showing a flow chart of another image processing method provided in an embodiment of the present application is shown;
[0048] Figure 3 A schematic structural diagram of an image processing device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0049] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0050] In this embodiment, an image processing method is provided. Figure 1 As shown, the method includes:
[0051] Step 101, obtaining interface rendering data and scene rendering data of a target game scene, wherein the color space of the interface rendering data is a gamma space, and the color space of the scene rendering data is a linear space;
[0052] Step 102, writing the interface rendering data and the scene rendering data into a target rendering pipeline, and processing the scene rendering data through the target rendering pipeline to obtain a first scene rendering image in a linear space;
[0053] Step 103, through the target rendering pipeline, converting the first scene rendering image from a linear space to a gamma space to obtain a second scene rendering image; processing the interface rendering data through the target rendering pipeline to implement alpha blending of the second scene rendering image and the interface rendering image to obtain a third scene rendering image, and converting the third scene rendering image from a gamma space to a linear space to obtain a target scene rendering image.
[0054] In order to solve the problem of color difference after mixing a scene rendering image produced in a linear space and an interface rendering image generated in a gamma space, the embodiment of the present application transforms the rendering pipeline, uses the transformed target rendering pipeline to perform spatial conversion on the scene rendering image, converts it from linear space to gamma space, performs alpha blending on the scene rendering image and the interface rendering image in the gamma space, and then uniformly converts them back to linear space, thereby solving the problem that pictures exported by the image processing software PS will change color when mixed in the linear space of the game engine Unity, resulting in inconsistent artistic effects.
[0055] In the above embodiment, first, the interface rendering data and scene rendering data of any target game scene in the game are obtained, wherein the scene rendering data can be obtained by drawing the scene in a linear space produced by the game developer through the game engine, and is used to render it into a scene image for in-game display, and the interface rendering data can be produced in a gamma space through the image processing software PS. Secondly, the above-mentioned interface rendering data and scene rendering data are written into a pre-configured target rendering pipeline, and the first scene rendering image is rendered and the interface rendering image is drawn through the target rendering pipeline. Then, the first scene rendering image is spatially converted, and the first scene rendering image in the linear space is converted to the gamma space to obtain the second scene rendering image in the gamma space, and then the second scene rendering image converted to the gamma space is alpha-blended with the interface rendering image in the gamma space to obtain a picture effect that can show the game scene through the UI interface, that is, the third scene rendering image obtained after alpha blending. Finally, the third scene rendering is spatially transformed from the gamma space back to the linear space, so that the game scene effect displayed by the final target scene rendering will not have color difference, thereby improving the expressiveness of the game screen.
[0056] By applying the technical solution of this embodiment, the pre-configured target rendering pipeline is called, and the game scene rendering image in the linear space is spatially converted through the rendering processes in the target rendering pipeline, and it is converted from the linear space to the gamma space. The scene rendering image and the interface rendering image are alpha-blended in the gamma space, and then uniformly converted back to the linear space. There is no need for game developers to manually adjust the output space and manually perform image correction, which improves the output efficiency and solves the problem of color difference after the output of the image processing software enters the game development engine, thereby improving the game expression.
[0057] Further, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, another image processing method is provided, such as Figure 2 As shown, the method includes:
[0058] Step 201, cutting the initial interface rendering graph to obtain a plurality of interface rendering pixel data; and storing the relevant information of the plurality of interface rendering pixel data in a cutting table.
[0059] Step 202, importing the plurality of interface rendering pixel data and the cut table into the game engine, and using the game engine to render the interface rendering pixel data into corresponding pixels based on the relevant information in the cut table, and then splicing them into the interface rendering graph.
[0060] Step 203: Adding a UI control to the interface rendering graph based on the relevant information of the interface rendering pixel data.
[0061] In the embodiment of the present application, the initial interface rendering image produced by the image processing software PS can be automatically cut by editing the script to obtain multiple interface rendering pixel data. Specifically, the naming convention pre-established in PS can be used to cut the image according to the location of each pixel data and other related information through the edited script to obtain the pixel data of each pixel, and store the related information in the cutting table according to the naming convention, for example, the related information of the pixel is stored in an xml file. Further, the cutting table of the xml file can be imported into the target rendering pipeline, and the target rendering pipeline draws each interface rendering pixel data to obtain multiple pixels, and generates each pixel to the scene by parsing the location of the pixel and other related information through xml, so as to realize the pixel splicing in the engine to obtain a complete interface rendering image.
[0062] Furthermore, the game engine can also obtain the UI control of each pixel at each position based on the relevant information of the interface rendering pixels in the cut graph and the naming rules, and add the corresponding UI control in the interface rendering graph.
[0063] Step 204: write the interface rendering data and the scene rendering data into a target rendering pipeline, and process the scene rendering data through the target rendering pipeline to obtain a first scene rendering image in a linear space.
[0064] In the embodiment of the present application, the target rendering pipeline can be obtained by modifying the universal rendering pipeline URP in the game engine. Optionally, the target rendering pipeline can be generated by the following steps:
[0065] S1, obtaining a universal rendering pipeline (URP) in a game engine, wherein the universal rendering pipeline includes a plurality of universal rendering processes;
[0066] S2, setting a first color attribute conversion for a shader of a process matching the interface rendering in a plurality of the general rendering processes, so as to convert the attribute of the interface rendering image to linear;
[0067] S3, adding a color space conversion process after the scene rendering process in the plurality of general rendering processes, wherein the color space conversion process is used to convert the first scene rendering image from a linear space to a gamma space;
[0068] S4, configuring a second color space conversion for a plurality of post-processing processes in the general rendering processes to obtain a target rendering pipeline, wherein the second color space conversion is used to convert a third scene rendering image from a gamma space to a linear space.
[0069] In this embodiment, the universal rendering pipeline URP in the game engine is transformed to obtain a target rendering pipeline, wherein the universal rendering pipeline includes multiple universal rendering processes (pass), such as a scene graph rendering process, a UI drawing process, an alpha blending process, a post-processing process, etc., and each process may contain a corresponding shader for image rendering and image processing. First, for the process related to interface rendering in the universal rendering process, the shader used in this part of the process is added with the first color attribute conversion SRGB To Linear, so that the color attribute of the interface rendering image entering the corresponding process is converted from SRGB to linear (Linear) through this operation. Specifically, it can be achieved by modifying the UI-Default.shader in the engine source code and the shader Shader used by all UIs, which adds the SRGB To Linear operation. Secondly, a color space conversion process is added to the universal rendering pipeline, and the specific process is added after the scene rendering process, so that after the scene rendering is completed through the pipeline, the scene rendering image is converted from linear space to gamma space through the color space conversion process. Finally, the post-processing process in the general rendering process is configured with the second color space conversion, and the operation of converting the scene rendering image from the gamma space to the linear space is added in the post-processing process, so that the color space of the scene finally rendered by the rendering pipeline is a linear space. In the specific application scenario, the specific post-processing process to be used is determined according to the post-processing enable switch of the game engine. If PostProcess Pass is enabled, the PostProcess Pass post-processing process is entered, and if it is not enabled, the FinalBlit Pass post-processing process is entered. In addition, the general rendering pipeline modified and configured as above is used as the final target rendering pipeline.
[0070] In addition, optionally, after the scene rendering image is converted from the linear space to the gamma space, the UI camera in the universal rendering pipeline can also render the interface rendering image according to the interface rendering data to achieve alpha blending of the interface rendering image and the scene rendering image.
[0071] In the embodiment of the present application, after the scene rendering image is converted from linear space to gamma space and the interface image is drawn, alpha blending with the interface rendering image is achieved.
[0072] Furthermore, in an embodiment of the present application, it is also possible to identify whether the scene rendering in the target rendering pipeline is completed. Optionally, it also includes: configuring a rendering recognition mechanism for the universal rendering pipeline to identify whether the scene rendering process has completed the rendering of the scene rendering image through the rendering recognition mechanism, and entering the space conversion process when it is identified that the rendering is completed. Wherein, a UI camera tag is added to the UI camera in the universal rendering pipeline, and the rendering recognition mechanism is used to enter the color space conversion process when it is identified that the tag of the current rendering camera is not the UI camera tag, and the current rendering camera is the base camera, and the current rendering camera is not the last rendering camera, or when it is identified that the current rendering camera is a scene rendering camera.
[0073] In this embodiment, a rendering recognition mechanism is configured for the rendering pipeline. Under this mechanism, the color space conversion process is triggered only after it is recognized that the scene rendering process has completed the rendering of the scene rendering image. Through this process, the rendered scene rendering image is converted from the linear space to the gamma space.
[0074] Step 205: Convert the first scene rendering image from a linear space to a gamma space through the target rendering pipeline to obtain a second scene rendering image; process the interface rendering data through the target rendering pipeline to implement alpha blending of the second scene rendering image and the interface rendering image to obtain a third scene rendering image, and convert the third scene rendering image from a gamma space to a linear space to obtain a target scene rendering image.
[0075] In an embodiment of the present application, the process of performing scene rendering through a target rendering pipeline can be specifically described as follows: first, interface rendering data and scene rendering data are obtained and written into the target rendering pipeline, and the scene rendering data is rendered into a first scene rendering image through the scene rendering pipeline in the target rendering pipeline; secondly, after identifying that the rendering of the first scene rendering image is completed, the color space conversion process of the pipeline is entered, and the color space of the first scene rendering image is converted from a linear space to a gamma space through the color space conversion process to obtain a second scene rendering image, and the interface rendering data is drawn as an interface rendering image through the UI camera of the pipeline to perform alpha blending on the second scene rendering image and the interface rendering image, which belong to the gamma space, to obtain a third scene rendering image; finally, the image is output through a post-processing process in the pipeline, wherein a second color space conversion is added in the post-processing process, and when outputting the image, the color space of the third scene rendering image is first converted back to a linear space, and then the final target scene rendering image is output.
[0076] Further, as Figure 1 The specific implementation of the method, the embodiment of the present application provides an image processing device, such as Figure 3 As shown, the device comprises:
[0077] A data acquisition module, used to acquire interface rendering data and scene rendering data of a target game scene, wherein the color space of the interface rendering data is a gamma space, and the color space of the scene rendering data is a linear space;
[0078] An image processing module, used for writing the interface rendering data and the scene rendering data into a target rendering pipeline, processing the scene rendering data through the target rendering pipeline, and obtaining a first scene rendering image in a linear space; and
[0079] The first scene rendering image is converted from a linear space to a gamma space through the target rendering pipeline to obtain a second scene rendering image; the interface rendering data is processed through the target rendering pipeline to implement alpha blending of the second scene rendering image and the interface rendering image to obtain a third scene rendering image, and the third scene rendering image is converted from a gamma space to a linear space to obtain a target scene rendering image.
[0080] Optionally, the device further comprises: a data processing module, configured to: slice the initial interface rendering image to obtain a plurality of interface rendering pixel data; and store relevant information of the plurality of interface rendering pixel data in a slice table.
[0081] Optionally, the image processing module is also used to import the multiple interface rendering pixel data and the cutting table into the game engine, and the game engine renders the interface rendering pixel data into corresponding pixels based on the relevant information in the cutting table, and then splices them into the interface rendering picture.
[0082] Optionally, the device further includes: a control adding module, configured to add a UI control to the interface rendering image based on relevant information of the interface rendering pixel data.
[0083] Optionally, the pipeline generation module is used to: execute the following steps to obtain the target rendering pipeline:
[0084] Obtaining a universal rendering pipeline in a game engine, wherein the universal rendering pipeline includes a plurality of universal rendering processes;
[0085] Setting a first color attribute conversion for a shader of a process matching the interface rendering in a plurality of the general rendering processes, so as to convert the attribute of the interface rendering image to linear;
[0086] Adding a color space conversion process after the scene rendering process in the plurality of general rendering processes, wherein the color space conversion process is used to convert the first scene rendering image from a linear space to a gamma space;
[0087] A second color space conversion is configured for a plurality of post-processing processes in the general rendering processes to obtain a target rendering pipeline, wherein the second color space conversion is used to convert a third scene rendering image from a gamma space to a linear space.
[0088] Optionally, the pipeline generation module is further used to configure a rendering identification mechanism for the universal rendering pipeline, so as to identify whether the scene rendering process has completed the rendering of the scene rendering graph through the rendering identification mechanism, and enter the color space conversion process when it is identified that the rendering is completed.
[0089] Optionally, the pipeline generation module is also used to add a UI camera tag to the UI camera in the universal rendering pipeline, and the rendering identification mechanism is used to determine that the rendering of the scene rendering graph is completed when it is identified that the tag of the current rendering camera is not the UI camera tag, and the current rendering camera is the base camera, and the current rendering camera is not the last rendering camera.
[0090] Optionally, the image processing module is further used to render the interface rendering image according to the interface rendering data and using a UI camera in the universal rendering pipeline to achieve alpha blending of the second scene rendering image and the interface rendering image.
[0091] It should be noted that for other corresponding descriptions of the functional units involved in the image processing device provided in the embodiment of the present application, reference can be made to Figure 1 to Figure 2 The corresponding description in the method will not be repeated here.
[0092] Based on the above Figure 1 to Figure 2 The method shown in the embodiment of the present application is accordingly provided with a storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned Figure 1 to Figure 2 The image processing method shown.
[0093] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each implementation scenario of the present application.
[0094] Based on the above Figure 1 to Figure 2 The method shown, and Figure 3 In order to achieve the above-mentioned purpose, the embodiment of the present application further provides a computer device, which can be a personal computer, a server, a network device, etc. The computer device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1 to Figure 2The image processing method shown.
[0095] Optionally, the computer device may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a Bluetooth interface, a WI-FI interface), etc.
[0096] Those skilled in the art will appreciate that the computer device structure provided in this embodiment does not limit the computer device, and may include more or fewer components, or a combination of certain components, or different component arrangements.
[0097] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages and saves the hardware and software resources of the computer device, and supports the operation of information processing programs and other software and / or programs. The network communication module is used to realize communication between the components inside the storage medium, and communication with other hardware and software in the physical device.
[0098] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus necessary general hardware platforms, or by calling a pre-configured target rendering pipeline through hardware implementation, and by various rendering processes in the target rendering pipeline, the game scene rendering image in the linear space is spatially converted, and it is converted from the linear space to the gamma space, and the scene rendering image and the interface rendering image are alpha-blended in the gamma space, and then uniformly converted back to the linear space. There is no need for game developers to manually adjust the output space and manually perform image correction, which improves the output efficiency, solves the problem of color difference after the output of the image processing software enters the game development engine, and improves the game expressiveness.
[0099] Those skilled in the art will appreciate that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily necessary for implementing the present application. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario can be distributed in the devices of the implementation scenario according to the description of the implementation scenario, or can be changed accordingly and located in one or more devices different from the present implementation scenario. The modules of the above-mentioned implementation scenario can be combined into one module, or can be further split into multiple submodules.
[0100] The above serial numbers of this application are only for description and do not represent the advantages and disadvantages of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of this application, but this application is not limited to them, and any changes that can be thought of by technicians in this field should fall within the scope of protection of this application.
Claims
1. An image processing method, characterized in that: include: Acquire interface rendering data and scene rendering data of a target game scene, wherein the color space of the interface rendering data is a gamma space, and the color space of the scene rendering data is a linear space; Writing the interface rendering data and the scene rendering data into a target rendering pipeline, and processing the scene rendering data through the target rendering pipeline to obtain a first scene rendering image in a linear space; The first scene rendering image is converted from a linear space to a gamma space through the target rendering pipeline to obtain a second scene rendering image; the interface rendering data is processed through the target rendering pipeline to implement alpha blending of the second scene rendering image and the interface rendering image to obtain a third scene rendering image, and the third scene rendering image is converted from a gamma space to a linear space to obtain a target scene rendering image.
2. The method according to claim 1, characterized in that Before obtaining the interface rendering image and the first scene rendering image of the target game scene, the method further includes: Cut the initial interface rendering image to obtain multiple interface rendering pixel data; The relevant information of the plurality of interface rendering pixel data is stored in a slice table.
3. The method according to claim 2, characterized in that The method further comprises: The plurality of interface rendering pixel data and the cut table are imported into a game engine, and the game engine renders the interface rendering pixel data into corresponding pixels based on the relevant information in the cut table, and then splices them into the interface rendering graph.
4. The method according to claim 3, characterized in that Before converting the color space of the interface rendering image into a linear space and performing alpha blending on the second scene rendering image and the converted interface rendering image to obtain a third scene rendering image, the method further includes: Based on the relevant information of the interface rendering pixel data, a UI control is added to the interface rendering graph.
5. The method according to any one of claims 1 to 4, characterized in that The target rendering pipeline is obtained by the following steps: Obtaining a universal rendering pipeline in a game engine, wherein the universal rendering pipeline includes a plurality of universal rendering processes; Setting a first color attribute conversion for a shader of a process matching the interface rendering in a plurality of the general rendering processes, so as to convert the attribute of the interface rendering image to linear; Adding a color space conversion process after the scene rendering process in the plurality of general rendering processes, wherein the color space conversion process is used to convert the first scene rendering image from a linear space to a gamma space; A second color space conversion is configured for a plurality of post-processing processes in the general rendering processes to obtain a target rendering pipeline, wherein the second color space conversion is used to convert a third scene rendering image from a gamma space to a linear space.
6. The method according to claim 5, characterized in that The method further comprises: A rendering identification mechanism is configured for the universal rendering pipeline to identify whether the scene rendering process has completed the rendering of the scene rendering graph through the rendering identification mechanism, and enter the color space conversion process when it is identified that the rendering is completed.
7. The method according to claim 6, characterized in that The configuring a rendering identification mechanism for the universal rendering pipeline to identify whether the scene rendering process has completed the rendering of the scene rendering graph through the rendering identification mechanism includes: A UI camera tag is added to the UI camera in the universal rendering pipeline, and the rendering identification mechanism is used to determine that the rendering of the scene rendering graph is completed when it is identified that the tag of the current rendering camera is not the UI camera tag, the current rendering camera is the base camera, and the current rendering camera is not the last rendering camera.
8. The method according to claim 5, characterized in that The processing of the interface rendering data through the target rendering pipeline to implement alpha blending of the second scene rendering image and the interface rendering image includes: The interface rendering image is rendered according to the interface rendering data and using a UI camera in the universal rendering pipeline to achieve alpha blending of the second scene rendering image and the interface rendering image.
9. An image processing device, characterized in that: include: A data acquisition module, used to acquire interface rendering data and scene rendering data of a target game scene, wherein the color space of the interface rendering data is a gamma space, and the color space of the scene rendering data is a linear space; An image processing module, used for writing the interface rendering data and the scene rendering data into a target rendering pipeline, processing the scene rendering data through the target rendering pipeline, and obtaining a first scene rendering image in a linear space; and The first scene rendering image is converted from a linear space to a gamma space through the target rendering pipeline to obtain a second scene rendering image; the interface rendering data is processed through the target rendering pipeline to implement alpha blending of the second scene rendering image and the interface rendering image to obtain a third scene rendering image, and the third scene rendering image is converted from a gamma space to a linear space to obtain a target scene rendering image.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
11. A computer device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Image drawing method and device, computing equipment and storage medium
CN109529349A
NGUI resource rendering processing method and device based on Unity
CN110975284A