Interface rendering method and device, electronic equipment, storage medium and program product
By separately processing the rendering results of interactive objects and backgrounds, the problem of insufficient flexibility in the interface rendering method in the prior art is solved, and a more refined and flexible visual performance is achieved.
Patent Information
- Application Number
- CN202411161043.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-12-06
AI Technical Summary
In the prior art, when the interface rendering method processes the aftereffects, since the UI and the scene share the same aftereffect settings, it is difficult for developers to meet visual requirements at the same time, and lack flexibility.
By separately updating the rendering results of interactive objects and background rendering results, the rendering effects of interactive objects and backgrounds can be independently optimized to achieve more flexible and accurate visual performance.
It significantly improves the flexibility and accuracy of update processing, avoids visual interference and inconsistent effects caused by binding updates, and achieves more refined and flexible visual performance.
Smart Images

Figure CN119088491A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of picture rendering technology, and in particular to an interface rendering method, device, electronic device, storage medium and program product. Background Art
[0002] Post-effect processing refers to a series of visual effect processing steps applied after the image or video rendering is completed to enhance or modify the final appearance of the image. Post-effect processing is usually performed at the final stage of image rendering, which can significantly improve image quality, improve visual experience, and enhance the beauty and expressiveness of the picture.
[0003] In the related art, post-effect processing is usually applied to the entire rendering view, which includes all elements in the scene and the user interface (UI), that is, the scene and the UI will be subjected to the same post-effect processing at the same time. As a result, since the UI and the scene share the same post-effect processing settings, developers need to weigh the needs of the scene and the UI when adjusting the post-effect effects. It is often difficult to meet the visual requirements of both at the same time, and there is a lack of flexibility.
[0004] Therefore, a more flexible interface rendering method is urgently needed. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides an interface rendering method. One or more embodiments of the present invention also relate to an interface rendering device, a computing device, a computer-readable storage medium and a computer program product to solve the technical defects existing in the prior art.
[0006] According to a first aspect of an embodiment of the present invention, there is provided an interface rendering method, comprising:
[0007] Obtaining an initial interface rendering result, wherein the initial interface rendering result includes a background rendering result and an interactive object rendering result;
[0008] In response to an update processing request for the interactive object, performing a first update processing on the interactive object rendering result to obtain a first rendering update result;
[0009] An update interface rendering result is determined based on the first rendering update result and the background rendering result.
[0010] According to a second aspect of an embodiment of the present invention, there is provided an interface rendering device, comprising:
[0011] An acquisition module is configured to acquire an initial interface rendering result, wherein the initial interface rendering result includes a background rendering result and an interactive object rendering result;
[0012] An updating module, configured to perform a first updating process on the interactive object rendering result in response to an updating process request for the interactive object, to obtain a first rendering updating result;
[0013] The determination module is configured to determine the update interface rendering result based on the first rendering update result and the background rendering result.
[0014] According to a third aspect of an embodiment of the present invention, there is provided a computing device, including:
[0015] Memory and processor;
[0016] The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the above-mentioned interface rendering method are implemented.
[0017] According to a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, which stores a computer program / instruction, and when the computer program / instruction is executed by a processor, the steps of the above-mentioned interface rendering method are implemented.
[0018] According to a fifth aspect of an embodiment of the present invention, a computer program product is provided, including a computer program / instruction, which implements the steps of the above-mentioned interface rendering method when executed by a processor.
[0019] An embodiment of the present invention realizes obtaining the initial interface rendering result, wherein the initial interface rendering result includes the background rendering result and the interactive object rendering result, and in response to the update processing request for the interactive object, the interactive object rendering result is subjected to the first update processing to obtain the first rendering update result, and the update interface rendering result is determined based on the first rendering update result and the background rendering result. By updating the interactive object rendering result and the background rendering result separately, the flexibility and accuracy of the update processing are significantly improved, so that the update processing of the background and the interactive object can be optimized independently, avoiding the visual interference and inconsistent effects caused by the binding update of the background and the interactive object, and realizing a more refined and flexible visual performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is a schematic diagram of the structure interaction of an interface rendering system provided by an embodiment of the present invention;
[0021] Figure 2 is a flow chart of an interface rendering method provided by an embodiment of the present invention;
[0022] Figure 3 It is a processing flow chart of an interface rendering method provided by an embodiment of the present invention;
[0023] Figure 4 is a schematic diagram of a halo treatment provided by an embodiment of the present invention;
[0024] Figure 5 is a schematic diagram of a depth of field processing provided by an embodiment of the present invention;
[0025] Figure 6 It is a structural schematic diagram of an interface rendering device provided by an embodiment of the present invention;
[0026] Figure 7 It is a structural block diagram of a computing device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0027] Many specific details are set forth in the following description to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present invention, so the present invention is not limited to the specific implementation disclosed below.
[0028] The terms used in one or more embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present invention. The singular forms of "a", "said" and "the" used in one or more embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present invention refers to and includes any or all possible combinations of one or more associated listed items.
[0029] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present invention, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present invention, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0030] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of the present invention are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0031] First, the terms involved in one or more embodiments of the present invention are explained.
[0032] HDRP: High Definition Render Pipeline, an advanced rendering pipeline that aims to provide high-quality graphics effects and realistic visual performance. It is mainly used in applications that require high image quality and complex visual effects.
[0033] Post-effects: Post-effects are processing steps applied after an image or video is rendered, designed to enhance visual effects or correct image quality. It includes a variety of techniques, such as vignetting, depth of field, motion blur, etc., which can significantly change and enhance the final image. Through these effects, more artistic and visually impactful image presentations can be achieved.
[0034] Alpha Blend algorithm: A technique for image synthesis that achieves a smooth transition between different images or layers by processing the transparency (alpha value) of the image. Specifically, the Alpha Blend algorithm blends the foreground image and the background image according to the alpha value (indicating transparency or opacity) of each pixel to generate a final image with a gradient effect.
[0035] Additive Blend algorithm: also known as additive blending algorithm, refers to adding the color value of the newly drawn pixel to the color value of the existing pixel to produce the final color effect.
[0036] HDR value: High Dynamic Range value. In the field of image and video processing, it refers to the brightness value of a pixel in an image. Especially in high dynamic range images, it represents a wider brightness range than standard dynamic range images.
[0037] In the present invention, an interface rendering method is provided. The present invention also relates to an interface rendering device, a computing device, a computer-readable storage medium, and a computer program product, which are described in detail one by one in the following embodiments.
[0038] See also Figure 1 , Figure 1It is a schematic diagram of an interface rendering system structure interaction provided by an embodiment of the present invention. The interface rendering system includes a rendering end, an update processing end and a user end. The rendering end is used to send an initial interface rendering result to the update processing end; the user end is used to generate an update processing request based on the user's update processing operation, and send the update processing request to the update processing end; the update processing end is used to obtain the initial interface rendering result, wherein the initial interface rendering result includes a background rendering result and an interactive object rendering result, and in response to the update processing request for the interactive object, the interactive object rendering result is subjected to a first update processing to obtain a first rendering update result, and the first rendering update result is returned to the rendering end; the rendering end is also used to determine an update interface rendering result based on the first rendering update result and the background rendering result.
[0039] Applied to the interface rendering system, the update processing end obtains the initial interface rendering result sent by the rendering end and the update processing request sent by the user end, performs a separate update processing on the interactive object to obtain the first rendering result, and the rendering end determines the updated interface rendering result based on the first rendering update result and the background rendering result. By updating the interactive object rendering result and the background rendering result separately, the flexibility and accuracy of the processing are significantly improved, so that the updates of the two can be optimized independently, thereby avoiding the visual interference and inconsistent effects that may be caused by binding updates, and achieving a more refined and flexible visual performance.
[0040] See also Figure 2 , Figure 2 It is a flow chart of an interface rendering method provided by an embodiment of the present invention, which specifically includes the following steps.
[0041] Step 202: Obtain an initial interface rendering result, wherein the initial interface rendering result includes a background rendering result and an interactive object rendering result.
[0042] The initial interface rendering result refers to the complete visual picture that the user sees when opening an application or page. It includes a combination of all visible elements. It refers to the visual elements that constitute the basic layer of the user interface, usually including but not limited to non-interactive visual effects such as background images, color fills, gradient colors, etc. The interactive object rendering result refers to objects on the interface that can be directly operated by the user, such as buttons, text boxes, sliders, etc. These objects usually have specific behaviors, such as responding to user clicks, touches, and other actions.
[0043] In actual applications, before obtaining the initial interface rendering results, the required static resources, such as images or other media files, are loaded from the server or other storage locations. The exact position and size of each element on the screen is determined, a process called layout or reflow. According to the background information in the rendering tree, background elements, such as background images, colors, or gradients, are drawn. Then interactive UI elements, such as buttons, input boxes, etc., are drawn.
[0044] Step 204: In response to the update processing request for the interactive object, a first update processing is performed on the interactive object rendering result to obtain a first rendering update result.
[0045] The update processing request usually refers to a signal triggered by an update operation or update instruction of an interface designer, which requires the system to update a specific interactive object. The first update processing refers to the update processing step of the interface rendering system for the interactive object after receiving the update processing request. The first rendering update result is the visual effect obtained after completing the first update processing, that is, the new presentation mode of the updated interactive object on the screen.
[0046] In actual applications, when the interface designer updates the interactive object or issues an update instruction, this triggers an update processing request. In response to this request, the interface rendering system starts the first update processing of the interactive object involved. This processing step may include modifying the color, position, shape or any other visual attributes of the interactive object. After completing the first update processing, the presentation of the interactive object on the screen will be updated accordingly, and the new visual effect obtained is the first rendering update result.
[0047] In a specific embodiment of the present invention, the designer decides to change the background color of the button from blue to green. This operation triggers an update processing request. After receiving the update request, the interface rendering system starts the first update processing of the button. Color modification: The system updates the background color of the button from blue to green. The interface rendering system re-renders the button to apply the new color.
[0048] Furthermore, performing a first update process on the interactive object rendering result to obtain a first rendering update result includes: parsing the update process request to obtain an update type; performing a first update process on the interactive object rendering result based on the update type to obtain a first rendering update result.
[0049] The update types include, but are not limited to, dispersion, chromatic aberration, mosaic, distortion, checker flicker, film grain, color adjustment, lens distortion, vignette, halo, depth of field, and exposure processing types.
[0050] In actual applications, when an update processing request for an interactive object is received, the system first parses the request to determine the update type. Based on the parsed update type, the system performs a corresponding first update processing on the current rendering result of the interactive object. This processing may involve changing the color, position, size or other visual attributes of the interactive object. After completing the first update processing, the system outputs the updated visual effect to the screen and obtains the first rendering update result. This means that the user can see the new presentation of the updated interactive object on the screen.
[0051] In a specific embodiment of the present invention, an interactive object (e.g., a filter application button) is provided. The interface designer decides to apply a "halo" effect to the button, as follows:
[0052] The interface designer clicks the button, selects the "halo" effect, and issues an update processing request. The system receives the request and parses the update type as "halo". The current rendering result of the button is a standard blue button with the same position and size. The system adds a halo effect around the button to create a fuzzy halo effect around its edges, and adjusts the intensity and color of the halo so that the button visually appears to have a glowing effect. After the halo effect is applied, the button's appearance on the screen becomes different from before, with a fuzzy halo surrounding the edge of the button. The system outputs the updated visual effect (i.e., the button with the halo effect applied) to the display, and the user can see the new presentation of the button.
[0053] Based on this, after the first update process of the interactive object, the system parses the update request and applies the specified effect (such as color difference, halo). As a result, the visual properties of the interactive object (such as color, brightness, blur, etc.) change, and the updated rendering effect is generated and displayed on the screen. The user can see the new visual state of the interactive object.
[0054] Furthermore, the update type includes color correction; based on the update type, a first update process is performed on the interactive object rendering result to obtain a first rendering update result, including: obtaining target color information of the interactive object in the interactive object rendering result, wherein the target color information is a mixed color of the object color information and preset background color information; obtaining a combination parameter corresponding to the target color information, wherein the combination parameter is used to characterize the combination weight of the object color information and the preset background color information; based on the combination parameter and the preset background color information, determining the object color information from the target color information, and using the object color information to update the target color information; updating the interactive object rendering result based on the updated target color information to obtain a first rendering update result.
[0055] The target color information refers to the color value of the interactive object without color correction, which is the mixed color of the object color information and the preset background color information. The preset background color information is the background color information preset by the interface designer, which is used to mix with the object color information. The combination parameter is used to characterize the ratio or weight of the object color information and the preset background color information when mixing.
[0056] In an actual application, an update processing request for an interactive object is received, and the update type is determined to be color correction. The color information of the interactive object is extracted from the current rendering result to obtain the target color information. In the rendering data of the current interactive object, a combination parameter for characterizing the combination weight of the object color information and the preset background color information is obtained. The object color information is calculated from the target color information using the combination parameter and the preset background color information. The target color information is updated using the calculated object color information to achieve color correction. Based on the updated target color information, the rendering result of the interactive object is updated to obtain a first rendering update result.
[0057] In a specific embodiment of the present invention, taking the preset background color as black as an example, assume that we have an interactive object (such as a button), and the current rendering result shows that the color of the button is dark blue, and the preset background color is black. The user wants to correct the color of the button to make it more readable on the black background. The following is a specific example: The user selects the color correction effect. The current color value of the current button color is (RGB: 0,0,128). Assume that the combination parameter is set to 0.5 (that is, the mixing weight of the button color and the background color). Using the combination parameter (0.5) and the background color (black, RGB: 0,0,0), calculate the target color.
[0058] Calculation formula: Current color = combination parameter × target color + (1-combination parameter) × background color
[0059] Then, target color = [current color - (1 - combination parameter) × background color] / combination parameter
[0060] Calculation result: The target color is approximately RGB: 0, 0, 255. The button color is updated to the calculated color (RGB: 0, 0, 255) and displayed on a black background.
[0061] Based on this, after color correction according to the update type, the system calculates the updated target color by mixing the object color and the preset background color. Based on the calculated target color information, the rendering effect of the interactive object is updated to make its color more prominent or adaptable in the background.
[0062] Furthermore, the update type includes object deformation; based on the update type, a first update processing is performed on the interactive object rendering result to obtain a first rendering update result, including: determining the current position information of the interactive object in the interface in the interactive object rendering result; determining the deformation area based on the current position information and the shape information of the interactive object; performing a deformation processing operation based on the deformation area to obtain a deformation result; updating the interactive object rendering result based on the deformation result to obtain a first rendering update result.
[0063] The current position information refers to the coordinate position of the interactive object in the current interface. The shape information describes the data of the original shape of the interactive object, such as the border, vertex coordinates, etc. The deformation area is the area that needs to be deformed according to the current position information and shape information. The deformation processing operation is the shape modification operation performed on the object in the deformation area, such as stretching, twisting, etc. The deformation result is the new shape of the interactive object obtained after the deformation processing operation.
[0064] In actual applications, the coordinate position of the interactive object in the interface is obtained from the current rendering result. According to the current position information and the shape information of the interactive object, the area that needs to be deformed is determined. The deformation processing operation is performed on the interactive object in the deformation area to obtain a deformation result. The rendering result of the interactive object is updated based on the deformation result to obtain a first rendering update result.
[0065] In a specific embodiment of the present invention, deformation into distortion is taken as an example. The current coordinate position of the button is the center of the screen, for example (X:400, Y:300). According to the shape of the button (rectangle), it is determined that the entire rectangular area needs to be deformed. A distortion algorithm is applied to each pixel of the rectangular button. For example, a distortion function can be used to distort the corners of the button inward or outward. Assume that the four corners of the button were originally right angles of the rectangle. After distortion, the edges of the button become curved. The distorted deformation result is applied to the rendering of the button, so that it appears as a curved or distorted rectangle on the screen. Finally, the button is displayed on the screen as a distorted shape, which may be a rectangle with curved edges, which significantly changes the visual effect.
[0066] Based on this, the deformation area can be adjusted in real time to accurately cover and process the target area. When the position or shape of the interactive object changes, the deformation area can automatically follow these changes to ensure that the deformation effect is always correctly applied to the interactive object.
[0067] Furthermore, the update type includes halo processing; accordingly, based on the update type, a first update processing is performed on the interactive object rendering result to obtain a first rendering update result, including: determining the brightness value of the interactive object in the interactive object rendering result, and screening the objects to be processed whose brightness values are greater than a preset brightness threshold; performing blur processing on the objects to be processed to obtain blurred processed objects; merging the blurred processed objects with the objects to be processed to obtain a halo result; updating the interactive object rendering result based on the halo result to obtain a first rendering update result.
[0068] The preset brightness threshold is used to select the standard brightness value of the interactive objects that need to be processed by halo processing. Blurring is an image processing technology used to simulate the effect of light diffusion. The blurred object is the object to be processed after blurring. The halo result is the result of merging the blurred object with the original object to be processed.
[0069] In practical applications, the brightness value of the interactive object is obtained from the current rendering result. According to a preset brightness threshold, the interactive objects with brightness values greater than the threshold are screened out as objects to be processed. Blurring is performed on the screened objects to be processed to obtain blurred objects. The blurred objects are merged with the original objects to be processed to obtain a halo result. The rendering result of the interactive object is updated based on the halo result to obtain a first rendering update result.
[0070] In a specific embodiment of the present invention, a user interface is provided with a plurality of buttons, each button having a different color and brightness. There is an existing demand for applying a halo effect to the buttons with higher brightness to enhance their visual effects.
[0071] For the current button, its color is bright yellow (RGB: 255, 255, 0). By calculating its brightness, the brightness value is 255. Set the preset brightness threshold to 200. Compare the brightness value (255) with the preset threshold (200), and find that the brightness value of the button is greater than the threshold, so it is determined as the object to be processed. Perform blur processing on the filtered object to be processed (bright yellow button). The blur algorithm will blur the edge of the button to simulate the light diffusion effect, so that a soft halo appears around the button. The final blurred object may appear as a light yellow halo. Merge the halo object obtained by blurring with the original button. The result is that the center of the button is still bright yellow, and a circle of light yellow halo effect appears around it. Based on the merged halo result, update the rendering result of the button. Finally, the button displayed on the user interface now has a significant halo effect, which highlights the brightness of the button and attracts the user's attention.
[0072] Based on this, a halo effect is generated by applying blur processing to interactive objects whose brightness values are greater than a preset threshold. Finally, the halo effect is merged with the original object and the rendering result is updated. The effect is to make objects with higher brightness appear to have a soft halo visually, highlighting these objects and enhancing the visual appeal and layering of the interface.
[0073] Further, performing fuzzy processing on the object to be processed to obtain the fuzzy processed object includes: performing a preset number of compression operations on the object to be processed according to a preset ratio to obtain a preset number of compressed objects; and superimposing the preset number of compressed objects to obtain the fuzzy processed object.
[0074] The preset ratio is used to determine the degree of each compression operation, that is, the compression ratio. The preset number of times is the total number of times the compression operation is performed. The compression operation is the process of reducing the object to be processed to a certain ratio. The compressed object is a smaller version of the object obtained after each compression operation.
[0075] In actual applications, the object to be processed is compressed a preset number of times according to a preset ratio, and each compression will obtain a new smaller version of the object, namely the compressed object. The obtained preset number of compressed objects are superimposed to simulate the effect of light diffusion, and finally a blurred object is obtained.
[0076] In a specific embodiment of the present invention, suppose there is a particularly bright icon on the user interface, and the interface designer adds a halo effect to it by blurring. This icon is in the shape of a star, and its original size is 100x100 pixels. The preset ratio is set to 0.9 (that is, after each compression, the size of the object will become 90% of the original). The first compression reduces the size of the original star icon to 100x100 pixels. After compression at a ratio of 0.9, a new star icon is obtained, the size of which is 90x90 pixels. The second compression compresses the 90x90 pixel star icon after the first compression again at a ratio of 0.9 to obtain a new star icon of 81x81 pixels. The third compression continues to compress the 81x81 pixel star icon after the second compression at a ratio of 0.9 to obtain a new star icon of 72.9x72.9 pixels (it may be rounded to 73x73 pixels in actual processing). The original 100x100 pixel star icon, the 90x90 pixel compressed icon, the 81x81 pixel compressed icon, and the 73x73 pixel compressed icon are superimposed. When superimposing, the smaller icon can be centered in the center of the larger icon. By superimposing star icons of different sizes, the effect of light spreading outward from the center can be simulated. The larger icon represents the center of the light, while the gradually smaller icons show the diffusion of light. After the superposition is completed, the resulting image is a star icon with a halo effect. The brightness of this icon is the highest in the center, and as it spreads outward, the brightness gradually decreases, forming a blurred halo effect.
[0077] Based on this, the light diffusion effect is simulated by compressing and superimposing the smaller versions of the object multiple times. Each time the compressed object becomes smaller and blurred, by superimposing these compressed objects, a gradual blur effect can be produced, making the surrounding area of the original object look like light or mist is diffused, enhancing the visual depth and softness.
[0078] Furthermore, the blurred object and the object to be processed are merged to obtain a halo result, including: mixing the object to be processed with preset background color information to obtain a first mixed result; mixing the blurred object with the preset background color information to obtain a second mixed result; superimposing the first mixed result and the second mixed result to obtain a halo result.
[0079] In a specific embodiment of the present invention, a button on a user interface is provided, and a halo effect needs to be added to it. The color of the button is light blue, and the background color is set to dark blue. The object to be processed is a light blue button (RGB: 0,0,255). Background color: dark blue (RGB: 0,0,100). The light blue button is mixed with the dark blue background color. After mixing, the color of the button will have some depth of the background color, and the first mixed result obtained may be a slightly dim blue, showing a fusion effect of the button and the background. The light blue halo is mixed with the dark blue background color. The color of the halo effect will be affected by the depth of the background color, and the second mixed result obtained is a dark blue gradient effect with a halo. The first mixed result (slightly dark blue button) is superimposed with the second mixed result (halo effect). The halo effect will cover the area around the button, and the color of the button itself will be slightly rendered with depth, but the halo effect makes the button more prominent, and the halo effect appears as a soft blue circle surrounding the button.
[0080] Based on this, the interactive object appears more prominent under the influence of the halo effect. By combining the blurred halo with the button color and the background color, the final result is a button surrounded by a halo, making the button more conspicuous and eye-catching, while the halo effect blends softly into the background.
[0081] Furthermore, the update type includes depth of field processing; accordingly, based on the update type, a first update processing is performed on the interactive object rendering result to obtain a first rendering update result, including: obtaining an interactive object depth feature map in the interactive object rendering result, wherein the depth feature map is used to characterize the depth information of each position in the interactive object; blurring the interactive object to obtain a blurred object; based on the depth feature map, merging the blurred object and the interactive object to obtain a depth of field processed object; updating the interactive object rendering result based on the depth of field processed object to obtain a first rendering update result.
[0082] Among them, the depth feature map is used to characterize the depth information of each position in the interactive object, that is, the distance from the observer.
[0083] In actual applications, a depth feature map is obtained from the current rendering result of the interactive object. This map records the depth information of each position in the interactive object. Blurring is performed on the interactive object to obtain a blurred object. According to the information of the depth feature map, the blurred object is merged with the original interactive object to obtain a depth-of-field processed object. The rendering result of the interactive object is updated based on the depth-of-field processed object to obtain a first rendering update result.
[0084] In a specific embodiment of the present invention, an interactive object in a 3D interface is a foreground button and an icon in the background. The interface designer hopes to enhance the visual effect of the button through depth of field processing to make it more prominent in the foreground. In the current rendering result, a depth feature map is obtained. The depth feature map records the depth information of each pixel. The depth value of the foreground button is small, and the depth value of the background icon is large. Blurring is performed on the interactive object (foreground button). For example, a Gaussian blur is applied to generate a blurred button object to soften the edge of the button. Using the information of the depth feature map, the blurred object is merged with the original interactive object (foreground button). According to the depth feature map, the part closer to the lens (i.e., the foreground button) will remain clear, while the farther part (i.e., the background icon) will be affected by the halo effect of the blurred object.
[0085] Based on this, the rendering result of the interactive object is updated based on the depth of field processing object. This updated rendering result combines the blur processing and the depth of field effect, showing that the interactive object is more prominent and clear visually, while the background icon is relatively blurred, enhancing the visual effect of the depth of field.
[0086] Furthermore, the update type includes brightness adjustment; accordingly, a first update process is performed on the interactive object rendering result based on the update type to obtain a first rendering update result, including: calculating the average brightness of the initial interface based on the initial interface rendering result; adjusting the brightness of the interactive object based on the average brightness to obtain a brightness adjustment result; updating the interactive object rendering result based on the brightness adjustment result to obtain a first rendering update result.
[0087] In a specific embodiment of the present invention, an interactive object of a user interface is provided, such as a button, and the interface designer wants to render and update the button based on the brightness adjustment type. First, the rendering result of the current interface is captured, which includes buttons and other interface elements. The brightness value of each pixel in the entire initial rendering result image is calculated. The brightness values of all pixels are averaged to obtain the average brightness value of the initial interface. The brightness of the interactive object is adjusted according to the calculated average brightness value. For example, if the average brightness value of the initial interface is low, the brightness of the button can be increased; if it is high, the brightness of the button may need to be reduced. Brightness adjustment is applied to each pixel of the interactive object (such as a button). The brightness can be changed by adjusting the RGB value of each pixel by simple addition or multiplication. The adjusted brightness of the interactive object is applied to the rendering result. This will make the brightness of the button meet the set adjustment target.
[0088] Based on this, by adjusting and updating the brightness, we can make the visual effects of interactive objects meet the needs, making them more obvious in the user interface or meeting the design standards.
[0089] Step 206: Determine an update interface rendering result based on the first rendering update result and the background rendering result.
[0090] In actual applications, the updated interactive object rendering results are synthesized with the background rendering results. The system will determine the final display method of the interactive object on the background based on the new state of the interactive object and the background information. Rendering processing: Combining the background rendering results and the first rendering update results, the system correctly superimposes the updated effect of the interactive object on the background to generate a complete updated interface rendering result. Output the updated interface rendering results: Output the synthesized results to the display or rendering buffer to show the updated interface effect.
[0091] In a specific embodiment of the present invention, assume that the background is a light gray canvas, and the background rendering result includes a light gray fill effect for the entire canvas. Initially, the background color of the button is blue and the position is in the center of the canvas. The designer decides to update the background color of the button to green and move the position of the button slightly downward. The system synthesizes the updated button rendering result (green background color and slightly downward position) with the background rendering result. The system superimposes the green background color of the button on the light gray of the background canvas according to the new color and position of the button. Since the position of the button has changed, the system needs to update the new position of the button during synthesis. The final updated interface rendering result shows a light gray background canvas with a new button with a green background, and the position has been adjusted to a slightly downward position. The system outputs the synthesized result to the display or rendering buffer so that the user can see the updated interface effect.
[0092] Furthermore, determining the update interface rendering result based on the first rendering update result and the background rendering result includes: in response to an update processing request for the background, performing a second update processing on the background rendering result to obtain a second rendering update result; and mixing the first rendering update result and the second rendering update result to obtain an update interface rendering result.
[0093] The second update process is an update operation performed on the background after receiving an update process request for the background. The second rendering update result is a new visual presentation of the background obtained after completing the second update process.
[0094] In actual applications, the system receives an update processing request for the background, which may involve changing the background color, adding or removing background elements, etc. According to the update processing request, the background rendering result is updated accordingly to obtain a second rendering update result. The interactive object with brightness adjustment (first rendering update result) is mixed with the updated background (second rendering update result). Through the mixing operation, a new visual presentation of the entire interface is obtained, that is, the updated interface rendering result.
[0095] In a specific embodiment of the present invention, the background update request is assumed to be a background color change: changing the background color from light gray (RGB: 200, 200, 200) to dark blue (RGB: 0, 0, 128). Adding background elements: adding a blurred gradient effect to the background to make the background look more layered. The background rendering result is updated by:
[0096] Apply the background color change to the background layer and add a gradient effect. The updated background rendering is obtained, which is the second rendering update. The color of the background changes to a dark blue, and the gradient effect is blurred to make it look deeper. The updated button (the first rendering update) is composited with the updated background (the second rendering update). When blending, the button can be rendered to some extent according to the new color and gradient effect of the background, and finally a new visual presentation is obtained.
[0097] Based on this, the rendering updates of backgrounds and interactive objects can be done independently, allowing for more fine-grained adjustments. The updates of backgrounds and interactive objects do not have to happen at the same time, and their respective rendering effects can be processed and optimized separately. In this way, designers can adjust background colors, elements, etc. separately without interfering with the state of interactive objects, ensuring that the interface remains consistent and beautiful during the update process.
[0098] Applied to the interface rendering method, an initial interface rendering result is obtained, wherein the initial interface rendering result includes a background rendering result and an interactive object rendering result. In response to an update processing request for an interactive object, a first update processing is performed on the interactive object rendering result to obtain a first rendering update result, and an updated interface rendering result is determined based on the first rendering update result and the background rendering result. By updating the interactive object rendering result and the background rendering result separately, the flexibility and accuracy of the update processing are significantly improved, so that the update processing of the background and the interactive object can be optimized independently, avoiding the visual interference and inconsistent effects caused by the binding update of the background and the interactive object, and achieving a more refined and flexible visual performance.
[0099] The following combination Figure 3 Taking the application of the interface rendering method provided by the present invention in UI post-effect processing as an example, the interface rendering method is further described. Figure 3 It is a processing flow chart of an interface rendering method provided by an embodiment of the present invention, which specifically includes the following steps.
[0100] Step 302: Receive UI processing rendering results and post-effect processing instructions.
[0101] Step 304: Identify the post-effect processing type.
[0102] Specifically, the post-effect processing types include but are not limited to dispersion, chromatic aberration, mosaic, distortion, checkered flicker, film grain, color adjustment, lens distortion, vignette, halo, depth of field and exposure, etc., and multiple after-effects can be superimposed and arranged in a specified order.
[0103] Step 306: Execute a post-effect processing operation corresponding to the post-effect processing type to obtain a UI post-effect.
[0104] Specifically, the UI color information in the UI processing rendering result is the result of mixing the UI and black (that is, the aforementioned preset background color). Directly using this result will cause the UI color to be dim. The Alpha Blend algorithm is used to remove black from the original information so that the color information in the UI after-effect can be correctly displayed.
[0105] In the distortion after-effect, it is expected that the distortion will only affect the UI interface of some modules. Since the targeted UI interface area will change dynamically, the function of generating dynamic masks (i.e. the aforementioned deformation area) is added to the UI rendering pipeline. This function supports the dynamic generation of matching mask areas according to the specified UI interface, so that the UI after-effect can only affect the specified UI interface as needed, and the effect application is more flexible.
[0106] UI halo processing includes three processes: screening, blurring and overlaying. In the screening process, the UI uses customized materials to adjust the HDR value of the color, and according to the configured global threshold, removes objects in the screen UI whose HDR value does not exceed the threshold. In the blurring process, a special double blurring algorithm is used. First, the sampling is downsampled step by step, and the box filter algorithm is used during the sampling process. Then, the upsampling result of the next level is mixed step by step, and then the upsampling is continued to achieve a good blurring effect and better performance. In the overlaying process, since the UI carries transparency information, a special linear dodge algorithm is used. First, the original UI and the blurred result are alpha blended with black respectively, and then additively blended with each other. Finally, a flexible local UI can be configured, and the UI Bloom effect that supports UI default components and custom components is achieved. See Figure 4 As shown, Figure 4 This is a schematic diagram of a halo processing provided by an embodiment of the present invention. Taking A0 as the UI to be haloed, A1, A2, A3, A4, and A5 are sampled step by step. For A5, after upsampling, it is added to A4 to obtain B4. And so on, finally the UI after halo processing of B0 is obtained. Optionally, the color information of B0 can be converted from HDR to LDR to reduce the overexposure caused by directly outputting HDR, making the effect more natural.
[0107] See also Figure 5 As shown, Figure 5It is a schematic diagram of a depth of field processing provided by an embodiment of the present invention. The UI depth of field processing process includes: rendering all UI objects separately, writing the depth features of all UIs into a separate image denoted as Mask (i.e., the aforementioned depth feature map); rendering all UI objects normally to obtain a clear image with full resolution denoted as RT_A; using the blurring processing described above to process RT_A into a blurred image RT_B; and finally using the depth Mask image to mix RT_A and RT_B into a final image.
[0108] Step 308: Combine the UI after-effect and the scene after-effect to obtain the interface after-effect.
[0109] Corresponding to the above method embodiment, the present invention also provides an interface rendering device embodiment, Figure 6 FIG. 1 is a schematic diagram of the structure of an interface rendering device provided by an embodiment of the present invention. Figure 6 As shown, the device comprises:
[0110] The acquisition module 602 is configured to acquire an initial interface rendering result, wherein the initial interface rendering result includes a background rendering result and an interactive object rendering result;
[0111] The updating module 604 is configured to perform a first updating process on the interactive object rendering result in response to the updating process request for the interactive object, and obtain a first rendering updating result;
[0112] The determination module 606 is configured to determine the update interface rendering result based on the first rendering update result and the background rendering result.
[0113] Optionally, the update module 604 is further configured to parse the update processing request to obtain an update type; and perform a first update processing on the interactive object rendering result based on the update type to obtain a first rendering update result.
[0114] Optionally, the update module 604 is further configured to obtain target color information of the interactive object in the interactive object rendering result, wherein the target color information is a mixed color of the object color information and the preset background color information; obtain combination parameters corresponding to the target color information, wherein the combination parameters are used to characterize the combination weight of the object color information and the preset background color information; determine the object color information from the target color information based on the combination parameters and the preset background color information, and update the target color information using the object color information; update the interactive object rendering result based on the updated target color information to obtain a first rendering update result.
[0115] Optionally, the update module 604 is further configured to determine the current position information of the interactive object in the interface in the interactive object rendering result; determine the deformation area based on the current position information and the shape information of the interactive object; perform a deformation processing operation based on the deformation area to obtain a deformation result; update the interactive object rendering result based on the deformation result to obtain a first rendering update result.
[0116] Optionally, the update module 604 is further configured to determine the brightness value of the interactive object in the interactive object rendering result, filter out the objects to be processed whose brightness values are greater than a preset brightness threshold; perform blur processing on the objects to be processed to obtain blurred objects; merge the blurred objects with the objects to be processed to obtain a halo result; and update the interactive object rendering result based on the halo result to obtain a first rendering update result.
[0117] Optionally, the updating module 604 is further configured to perform a preset number of compression operations on the object to be processed according to a preset ratio to obtain a preset number of compressed objects; and superimpose the preset number of compressed objects to obtain a fuzzy processed object.
[0118] Optionally, the updating module 604 is further configured to mix the object to be processed with preset background color information to obtain a first mixed result; mix the blurred object with preset background color information to obtain a second mixed result; and superimpose the first mixed result and the second mixed result to obtain a halo result.
[0119] Optionally, the update module 604 is further configured to obtain a depth feature map of the interactive object in the interactive object rendering result, wherein the depth feature map is used to characterize the depth information of each position in the interactive object; blur the interactive object to obtain a blurred object; based on the depth feature map, merge the blurred object and the interactive object to obtain a depth of field processed object; and update the interactive object rendering result based on the depth of field processed object to obtain a first rendering update result.
[0120] Optionally, the update module 604 is further configured to calculate the average brightness of the initial interface based on the initial interface rendering result; adjust the brightness of the interactive object based on the average brightness to obtain a brightness adjustment result; update the interactive object rendering result based on the brightness adjustment result to obtain a first rendering update result.
[0121] Optionally, the determination module 606 is further configured to perform a second update process on the background rendering result in response to an update process request for the background to obtain a second rendering update result; and mix the first rendering update result with the second rendering update result to obtain an updated interface rendering result.
[0122] Applied to the interface rendering device, the acquisition module 602 acquires the initial interface rendering result, the update module 604 responds to the update processing request for the interactive object, performs a first update processing on the interactive object rendering result, and obtains the first rendering update result, and the determination module 606 determines the updated interface rendering result based on the first rendering update result and the background rendering result. By processing the rendering results of the interactive object and the background separately, the flexibility and accuracy of the update processing are effectively improved. The background and the interactive object can be optimized independently to avoid visual interference and inconsistent effects caused by the binding update, thereby achieving a more refined and flexible visual performance.
[0123] The above is a schematic scheme of an interface rendering device of this embodiment. It should be noted that the technical scheme of the interface rendering device and the technical scheme of the above-mentioned interface rendering method belong to the same concept, and the details not described in detail in the technical scheme of the interface rendering device can be referred to the description of the technical scheme of the above-mentioned interface rendering method.
[0124] Figure 7 The block diagram of a computing device 700 according to an embodiment of the present invention is shown. The components of the computing device 700 include but are not limited to a memory 710 and a processor 720. The processor 720 is connected to the memory 710 via a bus 730, and the database 750 is used to store data.
[0125] The computing device 700 also includes an access device 740 that enables the computing device 700 to communicate via one or more networks 760. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 740 may include one or more of any type of network interface, wired or wireless (e.g., a network interface card (NIC)), such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, and a Near Field Communication (NFC).
[0126] In one embodiment of the present invention, the above components of the computing device 700 and Figure 7 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 7 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present invention. Those skilled in the art may add or replace other components as needed.
[0127] The computing device 700 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 700 may also be a mobile or stationary server.
[0128] The processor 720 is used to execute the following computer program / instructions, which implement the steps of the above-mentioned interface rendering method when executed by the processor.
[0129] Each embodiment of the present invention is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the computing device embodiment, since it is basically similar to the interface rendering method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the interface rendering method embodiment.
[0130] An embodiment of the present invention further provides a computer-readable storage medium storing a computer program / instruction, which implements the steps of the above-mentioned interface rendering method when executed by a processor.
[0131] Each embodiment of the present invention is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the computer-readable storage medium embodiment, since it is basically similar to the interface rendering method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the interface rendering method embodiment.
[0132] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned interface rendering method when executed by a processor.
[0133] The above is a schematic scheme of a computer program product of this embodiment. It should be noted that the technical scheme of the computer program product and the technical scheme of the above-mentioned interface rendering method belong to the same concept, and the details not described in detail in the technical scheme of the computer program product can be referred to the description of the technical scheme of the above-mentioned interface rendering method.
[0134] The above describes specific embodiments of the present invention. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0135] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0136] It should be noted that, for the convenience of description, the aforementioned method embodiments are all described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the described action sequence, because according to the embodiments of the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of the present invention.
[0137] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0138] The preferred embodiments of the present invention disclosed above are only used to help explain the present invention. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of the present invention. The present invention selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.
Claims
1. An interface rendering method, It is characterized in that include: Obtaining an initial interface rendering result, wherein the initial interface rendering result includes a background rendering result and an interactive object rendering result; In response to an update processing request for an interactive object, performing a first update processing on the interactive object rendering result to obtain a first rendering update result; An update interface rendering result is determined based on the first rendering update result and the background rendering result.
2. The method according to claim 1, It is characterized in that Performing a first update process on the interactive object rendering result to obtain a first rendering update result includes: Parsing the update processing request to obtain an update type; A first update process is performed on the interactive object rendering result based on the update type to obtain a first rendering update result.
3. The method according to claim 1, It is characterized in that The update type includes color correction; and performing a first update process on the interactive object rendering result based on the update type to obtain a first rendering update result includes: Obtaining target color information of the interactive object in the interactive object rendering result, wherein the target color information is a mixed color of the object color information and preset background color information; Acquire a combination parameter corresponding to the target color information, wherein the combination parameter is used to represent a combination weight of the object color information and the preset background color information; Based on the combination parameter and the preset background color information, determining the object color information from the target color information, and updating the target color information using the object color information; The interactive object rendering result is updated based on the updated target color information to obtain a first rendering update result.
4. The method according to claim 1, It is characterized in that The update type includes object deformation; and performing a first update process on the interactive object rendering result based on the update type to obtain a first rendering update result includes: Determining the current position information of the interactive object in the interface in the interactive object rendering result; Determine a deformation area based on the current position information and the shape information of the interactive object; Performing a deformation processing operation based on the deformation area to obtain a deformation result; The interactive object rendering result is updated based on the deformation result to obtain a first rendering update result.
5. The method according to claim 1, It is characterized in that The update type includes halo processing; accordingly, performing a first update process on the interactive object rendering result based on the update type to obtain a first rendering update result includes: Determining the brightness value of the interactive object in the interactive object rendering result, and screening the objects to be processed whose brightness value is greater than a preset brightness threshold; Performing fuzzy processing on the object to be processed to obtain a fuzzy processed object; Merging the blurred object and the object to be processed to obtain a halo result; The interactive object rendering result is updated based on the halo result to obtain a first rendering update result.
6. The method according to claim 5, It is characterized in that The performing fuzzy processing on the object to be processed to obtain the fuzzy processed object includes: Performing a preset number of compression operations on the object to be processed according to a preset ratio to obtain a preset number of compressed objects; The preset number of compressed objects are superimposed to obtain a blurred object.
7. The method according to claim 5, It is characterized in that The step of merging the blurred object and the object to be processed to obtain a halo result includes: Mixing the object to be processed with preset background color information to obtain a first mixing result; Mixing the blurred object with the preset background color information to obtain a second mixed result; The first mixing result and the second mixing result are superimposed to obtain a halo result.
8. The method according to claim 1, It is characterized in that The update type includes depth of field processing; accordingly, performing a first update process on the interactive object rendering result based on the update type to obtain a first rendering update result includes: Obtaining a depth feature map of the interactive object in the interactive object rendering result, wherein the depth feature map is used to represent the depth information of each position in the interactive object; Performing fuzzy processing on the interactive object to obtain a fuzzy object; Based on the depth feature map, merging the blurred object and the interactive object to obtain a depth of field processed object; The interactive object rendering result is updated based on the depth of field processing object to obtain a first rendering update result.
9. The method according to claim 1, It is characterized in that The update type includes brightness adjustment; accordingly, performing a first update process on the interactive object rendering result based on the update type to obtain a first rendering update result includes: Based on the initial interface rendering result, calculating the average brightness of the initial interface; adjusting the brightness of the interactive object based on the average brightness to obtain a brightness adjustment result; The interactive object rendering result is updated based on the brightness adjustment result to obtain a first rendering update result.
10. The method according to claim 1, It is characterized in that The determining an update interface rendering result based on the first rendering update result and the background rendering result includes: In response to an update processing request for the background, performing a second update processing on the background rendering result to obtain a second rendering update result; The first rendering update result and the second rendering update result are mixed to obtain an updated interface rendering result.
11. An interface rendering device, It is characterized in that include: An acquisition module is configured to acquire an initial interface rendering result, wherein the initial interface rendering result includes a background rendering result and an interactive object rendering result; An updating module, configured to, in response to an update processing request for an interactive object, perform a first update processing on the interactive object rendering result to obtain a first rendering update result; The determination module is configured to determine an update interface rendering result based on the first rendering update result and the background rendering result.
12. A computing device, It is characterized in that include: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer program / instructions are executed by the processor, the steps of the interface rendering method according to any one of claims 1 to 10 are implemented.
13. A computer-readable storage medium, It is characterized in that It stores a computer program / instruction, which, when executed by a processor, implements the steps of the interface rendering method described in any one of claims 1 to 10.
14. A computer program product, It is characterized in that It includes a computer program / instruction, which, when executed by a processor, implements the steps of the interface rendering method described in any one of claims 1 to 10.
