Image rendering display method, image display method and electronic device
By alternating between rendering opaque and semi-transparent models, and utilizing the persistence of vision, the high power consumption problem of electronic devices when rendering semi-transparent objects is solved, thereby reducing power consumption and stuttering, while maintaining the display of the semi-transparent effect.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-12
- Publication Date
- 2026-03-20
AI Technical Summary
Electronic devices consume excessive power when rendering and displaying semi-transparent objects, leading to problems such as rapid power consumption, overheating, and lag.
An alternating rendering method is used, in one of two adjacent frames, the opaque model and the model corresponding to the semi-transparent particles are rendered and displayed, while the other frame only renders the opaque model and does not render the model corresponding to the semi-transparent particles. This utilizes the persistence of vision in the human eye to make the user perceive the semi-transparent effect and reduces the power consumption of rendering semi-transparent image elements.
By reducing the number of frames used to render semi-transparent image elements, the power consumption of electronic devices is reduced, power consumption and heat generation are decreased, the stuttering problem is solved, and the semi-transparent effect is maintained.
Smart Images

Figure CN119668729B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of electronics, and in particular, to an image rendering display method, an image display method and an electronic device. BACKGROUND
[0002] A transparent object can be completely transparent, which means that the color can completely penetrate the object. A transparent object can also be translucent, which means that the color can penetrate the object while the color of the object itself is also displayed. The transparency of a pixel can be represented by an alpha channel of the pixel, and an object with an alpha value in the interval (0, 1) is a translucent object.
[0003] In order to simulate a more realistic physical world, electronic devices (such as mobile phones) need to display some translucent effects, such as seawater, smoke, weather, dust, and user interface (UI) controls. From the perspective of resource reading, a large number of texture samples are a major source of power consumption when these translucent objects are rendered on devices such as mobile phones. From the perspective of operation, it is found that there are a large number of high-precision floating-point operations in the GPU rasterization stage during the rendering process of these translucent objects. As the complexity of the scene increases, the rendering of semi-transparent particle effects will render more abundant particles, and the power consumption caused by rendering will also increase, causing the mobile phone to consume power quickly, heat up, and even cause lag and other phenomena.
[0004] Therefore, there is an urgent need for a method to reduce the power consumption of electronic devices when rendering and displaying translucent objects. SUMMARY
[0005] Embodiments of the present application provide an image rendering display method, an image display method and an electronic device, which are used to reduce the power consumption of electronic devices when rendering and displaying translucent objects.
[0006] To achieve the above-mentioned purpose, the embodiments of the present application adopt the following technical solutions:
[0007] In a first aspect, an image rendering display method is provided, which can be applied to an electronic device. The electronic device is installed with an application program. The method comprises:
[0008] The electronic device receives a first rendering instruction issued by an application, and the first rendering instruction is used to instruct the electronic device to render a first image frame including a first opaque model and a model corresponding to a first translucent particle. In response to the first rendering instruction, the electronic device can render and display a second image frame including the first opaque model and the model corresponding to the first translucent particle. Next, the electronic device can receive a second rendering instruction issued by the application, and the second rendering instruction is used to instruct the electronic device to render a third image frame including a second opaque model and a model corresponding to a second translucent particle, the third image frame being a next frame image of the first image frame instructed to be rendered by the application. In response to the second rendering instruction, the electronic device can render and display a fourth image frame including the second opaque model and the model corresponding to the second translucent particle.
[0009] In this scheme, when rendering two adjacent image frames, the electronic device renders and displays, in one of the image frames, the opaque model and the model corresponding to the translucent particle, and renders and displays, in the other of the image frames, only the opaque model without rendering the model corresponding to the translucent particle. When the current frame is a rendering frame (the current frame needs to render and display the model corresponding to the translucent particle), the model corresponding to the translucent particle is directly drawn into the image without starting the blending test, and the user sees the color of the model corresponding to the translucent particle in the display area of the model corresponding to the translucent particle. When the current frame is a non-rendering frame (the current frame does not need to render and display the model corresponding to the translucent particle), the model corresponding to the translucent particle does not need to be drawn in the image frame, and the user sees the color of the background in the display area of the model corresponding to the translucent particle. Due to the persistence of vision of the human eye, the color of the model corresponding to the translucent particle actually exhibited and the color of the background of the display area are mixed, and finally the mixed color is presented in the human eye, so that the user sees the translucent effect of the image element in the image. Since the model corresponding to the translucent particle can not be rendered and displayed in part of the continuous multiple image frames, the user can see the translucent effect of part of the image elements in the image while reducing the power consumption of the electronic device caused by rendering the translucent image element, thereby reducing the power consumption, heating, and lagging of the electronic device.
[0010] In some possible implementation manners of the first aspect, the first image frame is a first preset frame instructed by the application to be rendered by the electronic device, and the third image frame is a second preset frame instructed by the application to be rendered by the electronic device. The first preset frame is an odd frame, and the second preset frame is an even frame. Alternatively, the first preset frame is an even frame, and the second preset frame is an odd frame.
[0011] In this scheme, the electronic device can determine whether the current frame needs to render and display the image frame including the model corresponding to the semi-transparent particle according to whether the current frame is the first preset frame indicated by the application program for the electronic device to render. The first preset frame and the second preset frame are distinguished in the manner of odd frame and even frame, that is, every 1 frame, the image frame including the model corresponding to the semi-transparent particle is rendered. In this way, it can be ensured that when the mobile phone renders the image frame including the model corresponding to the semi-transparent particle, the model corresponding to the semi-transparent particle is rendered in part of the image frames, and the model corresponding to the semi-transparent particle is not rendered in part of the image frames. Thus, by using the visual persistence characteristic, the user can see that the image elements in the image are semi-transparent when viewing this part of the image frames.
[0012] In some possible implementation manners of the first aspect, the first image frame is a first preset frame indicated by the application program for the electronic device to render, and the third image frame is a second preset frame indicated by the application program for the electronic device to render. The first preset frame is a (k*m+1)th image frame indicated by the application program for the electronic device to render, m is a positive integer sequentially taking values in {0, 1, 2, 3, …, M}, k≥3, k is a positive integer, and the second preset frame is other frames than the first preset frame.
[0013] In this scheme, the electronic device renders a frame of the image frame including the model corresponding to the semi-transparent particle every y (y≥2) frames. In this way, it can be ensured that when the mobile phone renders the image frame including the model corresponding to the semi-transparent particle, the model corresponding to the semi-transparent particle is rendered in part of the image frames, and the model corresponding to the semi-transparent particle is not rendered in part of the image frames. Thus, by using the visual persistence characteristic, the user can see that the image elements in the image are semi-transparent when viewing this part of the image frames.
[0014] In some possible implementation manners of the first aspect, the first image frame is a first preset frame indicated by the application program for the electronic device to render, and the third image frame is a second preset frame indicated by the application program for the electronic device to render. The second preset frame is a k*nth image frame indicated by the application program for the electronic device to render, n is a positive integer sequentially taking values in {1, 2, 3, …, N}, k≥3, k is a positive integer, and the first preset frame is other frames than the second preset frame.
[0015] In this scheme, the electronic device renders a frame of the image frame including the model corresponding to the semi-transparent particle every y (y≥2) frames. In this way, it can be ensured that when the mobile phone renders the image frame including the model corresponding to the semi-transparent particle, the model corresponding to the semi-transparent particle is rendered in part of the image frames, and the model corresponding to the semi-transparent particle is not rendered in part of the image frames. Thus, by using the visual persistence characteristic, the user can see that the image elements in the image are semi-transparent when viewing this part of the image frames.
[0016] In some possible implementations of the first aspect, the electronic device can set a frame number for an image frame that the application instructs the electronic device to render. In this approach, the frame number can be used to determine whether the current frame is a first preset frame or a second preset frame. This facilitates the electronic device in determining whether the current frame needs to render an image frame containing the model corresponding to the semi-transparent particles.
[0017] In some possible implementations of the first aspect, the rendering and displaying of the second image frame in response to the first rendering instruction may specifically include: in response to the first rendering instruction instructing the electronic device to render a first image frame including the model corresponding to the semi-transparent particles, and the first image frame being a first preset frame instructed by the application to be rendered by the electronic device, the electronic device renders and displays the second image frame. The rendering and displaying of the fourth image frame in response to the second rendering instruction may specifically include: in response to the second rendering instruction instructing the electronic device to render a third image frame including the model corresponding to the semi-transparent particles, and the third image frame being a second preset frame instructed by the application to be rendered by the electronic device, the electronic device renders and displays the fourth image frame.
[0018] In this configuration, the first preset frame is an odd-numbered frame, and the second preset frame is an even-numbered frame. Alternatively, the first preset frame is an even-numbered frame, and the second preset frame is an odd-numbered frame. Alternatively, the first preset frame is the (k*m+1)th frame image rendered by the electronic device as instructed by the application, where m is a positive integer taking values sequentially from {0, 1, 2, 3, ..., M}, k ≥ 3, and k is a positive integer; the second preset frame is any frame other than the first preset frame. Alternatively, the second preset frame is the (k*n)th frame image rendered by the electronic device as instructed by the application, where n is a positive integer taking values sequentially from {1, 2, 3, ..., N}, k ≥ 3, and k is a positive integer; the first preset frame is any frame other than the second preset frame.
[0019] In this scheme, the electronic device will only render and display the second image frame if the first rendering instruction instructs the electronic device to render a first image frame that includes the model corresponding to the semi-transparent particles, and the first image frame is a first preset frame. Similarly, the electronic device will only render and display the fourth image frame if the second rendering instruction instructs the electronic device to render a second image frame that includes the model corresponding to the semi-transparent particles, and the second image frame is a second preset frame. The first and second preset frames each satisfy one of the aforementioned conditions. This ensures that the electronic device accurately renders image frames that include and do not include the model corresponding to the semi-transparent particles, thereby allowing users to see semi-transparent image elements when viewing multiple consecutive image frames while reducing the power consumption of the electronic device.
[0020] In some possible implementation of the first aspect, the one rendering cycle includes at least two image frames, and the two image frames include a first preset frame and a second preset frame. The electronic device can render an image frame that does not include the model corresponding to the translucent particle in other frames of the rendering cycle.
[0021] In some possible implementation of the first aspect, the one rendering cycle includes at least two image frames, and the two image frames include a first preset frame and a second preset frame. The electronic device can render an image frame that does not include the model corresponding to the translucent particle in other frames of the rendering cycle.
[0022] In some possible implementation of the first aspect, the rendering and displaying the second image frame in response to the first rendering instruction can include: in response to the first rendering instruction indicating that the electronic device renders the first image frame including the model corresponding to the translucent particle, and at least one of the x consecutive image frames rendered by the electronic device before the first image frame does not include the model corresponding to the translucent particle, the electronic device renders and displays the second image frame. The rendering and displaying the fourth image frame in response to the second rendering instruction can include: in response to the second rendering instruction indicating that the electronic device renders the third image frame including the model corresponding to the translucent particle, and all of the x consecutive image frames rendered by the electronic device before the third image frame include the model corresponding to the translucent particle, the electronic device renders and displays the fourth image frame.
[0023] In this scheme, the electronic device determines, according to the rendering instruction, that the application instructs to render an image frame including the model corresponding to the translucent particle, and after at least one of the image frames before the current frame includes the model corresponding to the translucent particle, it is determined that the current frame needs to render the model corresponding to the translucent particle. In this way, the mobile phone can accurately render the model corresponding to the translucent particle in part of the image frames, and does not render the model corresponding to the translucent particle in another part of the image frames. Thus, the user can see that the image elements present a translucent effect when viewing a plurality of consecutive image frames.
[0024] In some possible implementation of the first aspect, the second image frame includes the first opaque model and the model corresponding to the first translucent particle, and the second image frame includes the first opaque model and a third opaque model corresponding to the first translucent particle.
[0025] In the scheme, the electronic device will render the opaque model corresponding to the semi-transparent particle in the image frame when rendering the image frame containing the model corresponding to the semi-transparent particle. That is, although the image frame contains the model corresponding to the semi-transparent particle, the model is an opaque model. In the scheme, since the electronic device does not need to consider the transparency of the model corresponding to the semi-transparent particle when rendering and displaying the image of the model corresponding to the semi-transparent particle in two adjacent frames, blending is not needed. Thus, the complexity of the electronic device when rendering the image frame containing the semi-transparent image element can be further reduced. In turn, the power consumption of the electronic device can be further reduced, and the problems of power consumption, heating and lag can be reduced.
[0026] In some possible implementation manners of the first aspect, the electronic device includes a preset graphics library, a central processing unit (CPU), a graphics processing unit (GPU), and a display screen. The above-mentioned rendering and displaying the second image frame in response to the first rendering instruction can specifically include: the CPU, in response to the first rendering instruction, calling a rendering interface of the preset graphics library, instructing the GPU to render the second image frame containing the first opaque model and the model corresponding to the first semi-transparent particle. The GPU renders the second image frame and sends the second image frame to the display screen. The display screen displays the second image frame.
[0027] In some possible implementation manners of the first aspect, the above-mentioned rendering and displaying the fourth image frame in response to the second rendering instruction can specifically include: the CPU, in response to the second rendering instruction, calling a rendering interface of the preset graphics library, instructing the GPU to render the fourth image frame containing the second opaque model and not containing the model corresponding to the second semi-transparent particle. The GPU renders the fourth image frame and sends the fourth image frame to the display screen. The display screen displays the fourth image frame.
[0028] In the scheme, the CPU determines, according to the rendering instruction, whether the application program instructs the electronic device to render the model corresponding to the semi-transparent particle in the current frame, and determines whether the current frame needs to render and display the model corresponding to the semi-transparent particle. If the rendering instruction instructs the electronic device to render the image frame including the model corresponding to the semi-transparent particle, and the current frame needs to render the model corresponding to the semi-transparent particle, the CPU calls the interface of the preset graphics library to instruct the GPU to render the second image frame including the opaque model and the model corresponding to the semi-transparent particle. If the rendering instruction instructs to render the image frame including the model corresponding to the semi-transparent particle, but the current frame does not need to render the image frame including the model corresponding to the semi-transparent particle, the CPU calls the interface of the preset graphics library to instruct the GPU to render the fourth image frame, i.e. the image frame not including the model corresponding to the semi-transparent particle. In this way, due to the persistence of vision of the human eye, the color of the model corresponding to the semi-transparent particle displayed in the second image frame and the color of the background of the display area in the fourth image frame are mixed in the human eye. Thus, the user sees part of the image elements in the image as semi-transparent. Since the model corresponding to the semi-transparent particle can not be rendered and displayed in some of the continuous multiple frames, the user can see part of the image elements in the image as semi-transparent while reducing the power consumption of the electronic device caused by rendering the semi-transparent image elements, thereby reducing the power consumption, heating and lag of the electronic device.
[0029] In some possible implementation of the first aspect, before rendering and displaying the fourth image frame in response to the second rendering instruction, the method further includes: determining, by the electronic device, that the display frame rate and the rendering frame rate of the electronic device are both greater than a preset frame rate. In this way, the effect of the user viewing the semi-transparent image elements in the continuous multiple frames can be improved.
[0030] In some possible implementation of the first aspect, the preset frame rate is positively correlated with the number of frames in a rendering period when the electronic device renders an image.
[0031] In some possible implementation of the first aspect, the application program is a preset application, and the preset application includes a game application, a video application, a weather application, or a map application.
[0032] In a second aspect, an image display method is provided, which is applied to an electronic device, and includes: displaying a first image frame; and displaying a second image frame; wherein the first image frame includes a first opaque model and a model corresponding to a first semi-transparent particle; the second image frame includes a second opaque model and does not include a model corresponding to a semi-transparent particle; and the second image frame is a next frame image of the first image frame instructed to be rendered by an application program.
[0033] In the scheme, the electronic device can display a continuous first image frame and a second image frame. The first image frame includes a first opaque model and a model corresponding to a first semi-transparent particle. The second image frame includes a second semi-transparent model and does not include a model corresponding to a semi-transparent particle. When a user views a plurality of image frames including the above-mentioned two continuous frames, the user can see the model including the semi-transparent effect, that is, the image element. Generally, when the electronic device displays the model with the semi-transparent effect, the electronic device needs to render the model corresponding to the semi-transparent particle. In the embodiment of the present application, while the user can see the model with the semi-transparent effect, the electronic device reduces the power consumption caused by rendering the model corresponding to the semi-transparent particle in some image frames, and reduces the problems of heat dissipation and power consumption.
[0034] In some possible implementation manners of the second aspect, the first image frame is a first preset frame displayed by the electronic device, and the second image frame is a second preset frame displayed by the electronic device. The first preset frame is an odd frame, and the second preset frame is an even frame; or the first preset frame is an even frame, and the second preset frame is an odd frame.
[0035] In some possible implementation manners of the second aspect, the first image frame is a first preset frame displayed by the electronic device, and the second image frame is a second preset frame displayed by the electronic device. The first preset frame is a (k*m+1)th image frame displayed by the electronic device, m is a positive integer sequentially taking values in {0, 1, 2, 3, …, M}, k≥3, k is a positive integer, and the second preset frame is a frame other than the first preset frame.
[0036] In some possible implementation manners of the second aspect, the first image frame is a first preset frame displayed by the electronic device, and the second image frame is a second preset frame displayed by the electronic device. The second preset frame is a k*nth image frame displayed by the electronic device, n is a positive integer sequentially taking values in {1, 2, 3, …, N}, k≥3, k is a positive integer, and the first preset frame is a frame other than the second preset frame.
[0037] The above-mentioned several display manners can all achieve that when a user views a plurality of continuous image frames including a continuous first preset frame and a second preset frame, the user can see that some image elements are in a semi-transparent effect. At the same time, the power consumption caused by rendering the model corresponding to the semi-transparent particle by the electronic device is reduced.
[0038] In some possible implementation manners of the second aspect, the first image frame includes a first opaque model and a model corresponding to a first semi-transparent particle, and the method includes: the first image frame includes the first opaque model and a third opaque model corresponding to the first semi-transparent particle.
[0039] In some possible implementation manners of the second aspect, the display frame rate of the electronic device is greater than a preset frame rate.
[0040] In a third aspect, an electronic device is provided, comprising a display screen, a processor and a memory. The display screen is configured to display an interface of the electronic device. The memory is configured to store computer-executable instructions. When the electronic device is running, the processor executes the computer-executable instructions stored in the memory, so that the electronic device performs the image rendering and displaying method according to any one of the first aspect and the image displaying method according to any one of the second aspect.
[0041] In a possible implementation of the third aspect, the processor of the electronic device comprises a CPU and a GPU.
[0042] In a fourth aspect, a computer-readable storage medium is provided, which stores instructions. When the instructions are run on a computer, the computer can perform the image rendering and displaying method according to any one of the first aspect and the image displaying method according to any one of the second aspect.
[0043] In a fifth aspect, a computer program product is provided, which contains instructions. When the instructions are run on an electronic device, the electronic device can perform the image rendering and displaying method according to any one of the first aspect and the image displaying method according to any one of the second aspect.
[0044] In a sixth aspect, an apparatus (for example, the apparatus can be a chip system) is provided, which comprises a processor configured to support an electronic device to implement the functions involved in the first aspect. In a possible design, the apparatus further comprises a memory configured to store necessary program instructions and data of the electronic device. When the apparatus is a chip system, it can be composed of a chip or can comprise a chip and other discrete devices.
[0045] The technical effects brought by any one of the designs of the second aspect to the sixth aspect can refer to the technical effects brought by the different designs of the first aspect, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS
[0046] Figure 1 An application interface of an electronic device provided by an embodiment of the present application;
[0047] Figure 2 An application interface of an electronic device provided by an embodiment of the present application;
[0048] Figure 3 A rendering process of an electronic device provided by an embodiment of the present application;
[0049] Figure 4 A flowchart of an electronic device rendering an image frame containing a model corresponding to a semi-transparent particle provided by an embodiment of the present application;
[0050] Figure 5 A hardware structure schematic diagram of an electronic device provided for an embodiment of the present application;
[0051] Figure 6 A software architecture diagram of an electronic device provided for an embodiment of the present application;
[0052] Figure 7A A flowchart of an image rendering display method provided for an embodiment of the present application;
[0053] Figure 7B A display schematic diagram provided for an embodiment of the present application;
[0054] Figure 8 A flowchart of an image rendering display method provided for an embodiment of the present application;
[0055] Figure 9 A flowchart of an electronic device rendering an image frame containing a model corresponding to a semi-transparent particle provided for an embodiment of the present application;
[0056] Figure 10 A structure schematic diagram of a chip system provided for an embodiment of the present application. DETAILED DESCRIPTION
[0057] First, technical terms possibly involved in the present application are briefly explained.
[0058] A graphics library is a library for rendering computer graphics on a display, which usually provides a set of optimized functions to perform common rendering tasks. The graphics library can specifically include Open Graphics Library (OpenGL), OpenGL for Embedded Systems (OpenGLES), Vulkan, Metal, DirectX, and the like.
[0059] Among them, OpenGL is a cross-language and cross-platform application programming interface (API) for rendering 2D and 3D vector graphics, which contains a series of functions that can operate graphics and images.
[0060] Visual persistence, also known as positive afterimage, is the persistence of vision, the visual impression of light after its source has been removed. The cause of visual persistence is the speed of the optic nerve, which takes about 1 / 16 of a second to react. The time of persistence varies with the frequency of the light. Visual persistence is the basis of modern visual media production and dissemination. For example, a fluorescent light flickers on and off more than 100 times per second, but the human eye does not perceive the flicker. This is because of the effect of visual persistence.
[0061] Drawcall is a call command of a central processing unit (CPU) to a bottom layer graphics drawing interface, used to instruct a GPU to perform a rendering operation.
[0062] Particle effects can be used to simulate the effects of water, fire, fog, and gas in reality. The principle is to combine countless individual particles to present a fixed form, and control the overall or individual motion to simulate the real effect. A particle effect can be used to render a semi-transparent image element.
[0063] Image transparency refers to the visibility of each pixel in an image, which determines the opacity of the pixel in the image. An image can be composed of multiple image elements, and the transparency of different image elements in the image can be different.
[0064] Blending is the process of superimposing the color to be drawn with the color in the current buffer according to a specific blending mode when drawing a graphic. Blend blending is commonly used to draw transparent graphics. When performing blending calculation, the alpha value in the RGBA color space (red, green, blue, and alpha value) is used.
[0065] In some examples, transparency can be expressed as a percentage. In some embodiments, when the transparency is 0, the image element is completely opaque (also referred to as opaque); when the transparency is 100%, the image element is completely transparent (also referred to as transparent). An opaque object is either this or that. For an opaque object at the same position, only one opaque object needs to be retained for display. In fact, it is to let the opaque object in the uppermost layer cover the pixels of the opaque object in the lower layer.
[0066] In the displayed interface, the object with an alpha value in the interval (0-1) is a semi-transparent object. For example, an alpha value of 0 indicates that the transparency of the object is completely transparent, and an alpha value of 1 indicates that it is completely opaque.
[0067] In order to simulate a more realistic physical world, some semi-transparent effects such as seawater, smoke, dust, and rain need to be displayed. For example Figure 1 In the application interface shown, the smoke displayed in region A corresponds to a rendering special effect. The smoke in region A can be in a semi-transparent state. Thus, in Figure 1 In the frame image shown, the user can see the semi-transparent smoke, and can also see part of the scene behind the smoke, thereby achieving the effect of simulating a real visual experience.
[0068] In addition, in some interfaces, image elements such as user interface (UI) controls can also be presented in a semi-transparent manner. For example Figure 2 In the application interface shown, the operation control 10 displayed can be in a semi-transparent state. Thus, in Figure 2 In the frame image shown, the user can see the semi-transparent operation control 10, and can also see the background through the operation control 10.
[0069] The model corresponding to the semi-transparent particle usually does not exist in isolation in a frame image, but the same or similar model corresponding to the semi-transparent particle exists in multiple adjacent frame images, thereby achieving continuity of display of the model corresponding to the semi-transparent particle. That is, in the rendering process of multiple adjacent frame images, the application program can issue rendering instructions for instructing the electronic device to render an image frame containing the model corresponding to the semi-transparent particle, and the rendering of the same or similar model corresponding to the semi-transparent particle is performed.
[0070] In order to obtain image data for display, the electronic device can perform image rendering according to the rendering instructions issued by the application program (such as a game application) and in response to the rendering instructions before displaying the image. Thus, the image data is obtained and displayed.
[0071] In combination with Figure 3 When rendering a frame image, the application program can issue rendering instructions. The CPU of the electronic device can call an interface of a preset graphics library in the electronic device according to the rendering instructions, thereby instructing the GPU to perform corresponding rendering operations. The rendering result of the GPU performing the rendering operations can be stored in the cache of the electronic device, and then the rendering result is sent for display. The electronic device can display the frame image on the display screen according to the sent rendering result.
[0072] In the related art, for rendering of semi-transparent image elements, blending needs to be enabled. Figure 4A flow of rendering a semi-transparent image element in the related art is shown. When rendering a current frame, the electronic device determines in turn whether a model to be rendered in the current frame is a model corresponding to a semi-transparent particle. If so, the electronic device starts a blending test and sets a blending parameter. Then, the electronic device draws a draw call corresponding to the semi-transparent image element according to the set blending parameter. If the model to be rendered in the current frame does not correspond to the model corresponding to the semi-transparent particle, the electronic device can directly draw a draw call corresponding to the current model. Until all models in the current frame are drawn and rendered, the current frame is sent to display.
[0073] wherein the blending parameter to be set needs to be determined. Blending in OpenGL can be achieved through a blending equation:
[0074]
[0075] wherein, is a color vector to be displayed.
[0076] is a source color vector, indicating that it is a color vector of a source texture.
[0077] is a target color vector, indicating a color vector currently stored in a color buffer.
[0078] is a source factor value, which specifies the influence of an alpha value on a target color.
[0079] is a target factor value, which specifies the influence of an alpha value on a target color.
[0080] According to the above blending equation, when rendering a semi-transparent image element, the electronic device needs to perform processes such as source texture sampling and calculation according to a source color vector and a target color vector. From the perspective of resource reading, a large number of texture samplings are a major source of power consumption. From the perspective of operation, it is found that in the rendering process of these semi-transparent objects, there are a large number of high-precision floating-point operations in the GPU rasterization stage. With the increase of scene complexity, the model corresponding to the semi-transparent particle will render more abundant particles, and the power consumption caused by rendering will also increase, causing the phone to consume power quickly, heat, and even lag and other phenomena.
[0081] Based on this, the present application provides an image rendering display method, which can be applied to the rendering display scene of an electronic device. Specifically, the electronic device can receive a rendering instruction issued by an application program, and render a corresponding model according to the rendering instruction.
[0082] In the embodiments of the present application, the electronic device can receive a first rendering instruction issued by an application, and the first rendering instruction is used to instruct the electronic device to render a first image frame including a first semi-transparent model and a model corresponding to a first semi-transparent particle. That is, the first image frame contains a semi-transparent image element. Then, in response to the first rendering instruction, the electronic device can render and display a second image frame, and the second image frame includes the first opaque model and the model corresponding to the first semi-transparent particle.
[0083] Then, the electronic device receives a second rendering instruction issued by the application, and the second rendering instruction is used to instruct the electronic device to render a third image frame including a second opaque model and a model corresponding to a second semi-transparent particle, and the third image frame is a next frame image of the first image frame. In response to the second rendering instruction, the electronic device renders and displays a fourth image frame. The fourth rendering frame includes the second opaque model and does not include the model corresponding to the second semi-transparent particle.
[0084] In this scheme, when rendering two adjacent image frames, the electronic device renders and displays the opaque model and the model corresponding to the semi-transparent particle in one of the two image frames, and only renders and displays the opaque model in the other image frame without rendering the model corresponding to the semi-transparent particle. When the current frame is a rendering frame (the current frame needs to render and display the model corresponding to the semi-transparent particle), the model corresponding to the semi-transparent particle is directly drawn into the image, and there is no need to start the blending test. The user sees the color of the model corresponding to the semi-transparent particle in the display area of the model corresponding to the semi-transparent particle. When the current frame is a non-rendering frame (the current frame does not need to render and display the model corresponding to the semi-transparent particle), the model corresponding to the semi-transparent particle is not drawn in the image frame. At this time, the user sees the color of the background in the display area of the model corresponding to the semi-transparent particle. Due to the persistence of vision of the human eye, the color of the model corresponding to the semi-transparent particle actually displayed and the color of the background of the display area are mixed, and finally the mixed color is presented in the human eye, so that the user sees the semi-transparent effect of part of the image elements in the image. Since the model corresponding to the semi-transparent particle can not be rendered and displayed in part of the image frames in a plurality of continuous frames, the user can see the semi-transparent effect of part of the image elements in the image while reducing the power consumption of the electronic device caused by rendering the semi-transparent image elements, thereby reducing the power consumption, heating and freezing problems of the electronic device.
[0085] In some embodiments of the present application, when the electronic device renders and displays the second image frame in response to the first rendering instruction, the model corresponding to the first semi-transparent particle rendered by the electronic device in the second image frame is an opaque model. That is, the transparency of the model corresponding to the first semi-transparent particle in the second image frame is 0. The electronic device still renders and displays the second opaque model in the fourth image frame in response to the second rendering instruction, without rendering the model corresponding to the second semi-transparent particle. Due to the visual persistence effect of the human eye, the user can still see the semi-transparent effect of the model corresponding to the semi-transparent particle for the above two frames of images. Since the electronic device does not need to consider the transparency of the model corresponding to the semi-transparent particle when rendering and displaying the model corresponding to the semi-transparent particle in the adjacent two frames, it is not necessary to enable blending. Thus, the complexity of the electronic device in rendering an image frame containing a semi-transparent image element can be further reduced. In turn, the power consumption of the electronic device can be further reduced, and the problems of power consumption, heating and lag can be reduced.
[0086] In some embodiments of the present application, the above image rendering and display method can be applied to an electronic device with a rendering frame rate and a display frame rate greater than a preset frame rate. When the rendering frame rate and the display frame rate of the electronic device are greater than a certain value, the human eye will be difficult to capture the jitter in the continuous images. Therefore, part of the image frames in the continuous images render and display the model corresponding to the semi-transparent particle, while part of the image frames do not render and display the model corresponding to the semi-transparent particle, which is also difficult to be captured by the human eye. This is conducive to the presentation of the semi-transparent image element contained in the continuous multiple frames of images.
[0087] In some embodiments, the image rendering and display method provided by the present application can be applied to an electronic device with rendering and display functions. For example, a mobile phone, a tablet computer, a personal computer (PC), a smart screen, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a smart watch, an artificial intelligence (AI) sound box, and a vehicle-mounted device, as well as various teaching aids (such as learning machines and early education machines), smart toys, portable robots, personal digital assistants (PDAs), augmented reality (AR) and virtual reality (VR) devices, media players, and devices with mobile office functions, smart home functions, audio and video entertainment functions, and smart travel support functions. The specific form of the device is not specially limited in the embodiments of the present application.
[0088] As Figure 5 Fig. 1 shows a structural schematic diagram of an electronic device 100 according to an embodiment of the present application. For example, the electronic device 100 can be a mobile phone. The electronic device 100 can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a key 190, a motor 191, a camera 192, a display screen 193, and a subscriber identification module (SIM) card interface 194, etc. The sensor module 180 can include a pressure sensor 180A, a touch sensor 180B, etc.
[0089] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can include more or fewer components than shown, or combine certain components, or split certain components, or different component arrangements. The components shown can be implemented in hardware, software, or a combination of software and hardware.
[0090] The processor 110 can include one or more processing units, for example: the processor 110 can include a CPU, an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units can be independent devices, or can be integrated into one or more processors. For example, the processor 110 is configured to execute the image rendering and display method according to an embodiment of the present application.
[0091] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of instruction fetching and instruction execution.
[0092] The processor 110 can also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can hold instructions or data that the processor 110 has recently used or is likely to use again. If the processor 110 needs to use the instructions or data again, it can be retrieved directly from the memory. This avoids repeated accesses and reduces the latency of the processor 110, thereby improving the efficiency of the system.
[0093] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 performs various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 can include a program storage area and a data storage area. The program storage area can store an operating system and at least one application program required for a function (such as a sound playing function, an image playing function, etc.).
[0094] In addition, the internal memory 121 can include a high-speed random access memory and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0095] The power management module 141 is used to connect the battery 142 and the charging management module 140 to the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the external memory, the display screen 193, the camera 192, and the wireless communication module 160, etc.
[0096] In other embodiments, the power management module 141 can also be disposed in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be disposed in the same device.
[0097] The electronic device 100 realizes the display function through the GPU, the display screen 193, and the application processor, etc. The GPU is a microprocessor for image processing, which is connected to the display screen 193 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs, which execute program instructions to generate or change display information.
[0098] The display screen 193 is used to display images, videos, etc. In some embodiments, the electronic device 100 can include 1 or N display screens 193, N being a positive integer greater than 1.
[0099] The image rendering and display methods in the following embodiments can be realized in the electronic device 100 with the above hardware structure.
[0100] The software system of the electronic device 100 can employ a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. Embodiments of the present application take an Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100.
[0101] Figure 6 is a software structure block diagram of the electronic device 100 of embodiments of the present application.
[0102] The layered architecture divides software into several layers, each of which has a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers, from top to bottom, the application layer, the application framework layer, the Android runtime (ART) and native C / C++ library, the hardware abstraction layer (HAL), and the kernel layer.
[0103] The application layer can include a series of application packages.
[0104] As shown in Figure 6 , the application packages can include gallery, calendar, map, WLAN, music, SMS, call, navigation, Bluetooth, video, game, and weather applications, etc.
[0105] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications of the application layer. The application framework layer includes some pre-defined functions.
[0106] As shown in Figure 6 , the application framework layer can include window manager, content provider, view system, resource manager, notification manager, activity manager, input manager, etc.
[0107] The window manager provides window management services (WMS), which can be used for window management, window animation management, surface management, and as a relay station for the input system.
[0108] The content provider is used to store and obtain data, and makes the data accessible to applications. The data can include videos, images, audio, dialed and received calls, browsing history and bookmarks, phonebook, etc.
[0109] The view system includes visual controls, such as controls that display text, controls that display pictures, and the like. The view system can be used to build an application. A display interface can be composed of one or more views. For example, a display interface that includes a short message notification icon can include a view that displays text and a view that displays a picture.
[0110] The resource manager provides various resources for an application, such as localized strings, icons, pictures, layout files, video files, and the like.
[0111] The notification manager enables an application to display notification information in a status bar, which can be used to convey a message of the notification type, which can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify a download completion, a message reminder, and the like. The notification manager can also be a notification that appears in the form of a chart or a scroll bar text in the top status bar of the system, such as a notification of an application running in the background, and can also be a notification that appears in the form of a dialog window on the screen. For example, a text information is prompted in the status bar, a prompt sound is emitted, the electronic device is vibrated, a light flashes, and the like.
[0112] The activity manager can provide an activity management service (Activity Manager Service, AMS), which can be used for the startup, switching, scheduling of system components (such as activities, services, content providers, broadcast receivers), and the management and scheduling of application processes.
[0113] The input manager can provide an input management service (Input Manager Service, IMS), which can be used to manage the input of the system, such as touch screen input, key input, sensor input, and the like. The IMS takes events from input device nodes and distributes the events to appropriate windows through interaction with the WMS.
[0114] The Android runtime includes a core library and an Android runtime. The Android runtime is responsible for converting source code into machine code. The Android runtime mainly includes an ahead of time (AOT) compilation technology and a just in time (JIT) compilation technology.
[0115] The core library is mainly used to provide the functions of the basic Java class library, such as basic data structures, mathematics, IO, tools, databases, network libraries, and the like. The core library provides APIs for users to develop Android applications.
[0116] The native C / C++ library can include a plurality of functional modules. For example: a surface manager, a media framework, libc, OpenGL ES, SQLite, Webkit, and the like.
[0117] The surface manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications. The media framework supports playback and recording of a variety of common audio, video formats, and still image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. OpenGL ES provides drawing and manipulation of 2D graphics and 3D graphics in the application. SQLite provides a lightweight relational database for the applications of the electronic device 100.
[0118] The hardware abstraction layer runs in the user space and encapsulates the kernel layer driver to provide a calling interface to the upper layer.
[0119] The kernel layer is a layer between hardware and software. The kernel layer at least includes a display driver, an audio driver, a camera driver, a Bluetooth driver, and a preset graphics library.
[0120] Generally, after the electronic device receives a rendering instruction issued by an application, the electronic device can perform rendering and display in response to the rendering instruction. In the image rendering and display method provided in the embodiments of the present application, when the rendering instruction issued by the application is used to instruct the electronic device to render a model corresponding to an opaque model and a semi-transparent particle, the electronic device will not render and display the model corresponding to the semi-transparent particle in part of the image frames. The user can see that part of the image elements in the image are semi-transparent while viewing continuous multiple image frames, and the power consumption of the electronic device caused by rendering semi-transparent image elements is reduced, thereby reducing the power consumption, heating, and lag of the electronic device.
[0121] For example, after the electronic device receives a first rendering instruction issued by an application, the electronic device can parse the first rendering instruction to determine the specific content of the image instructed by the electronic device to render. In some embodiments, the first rendering instruction instructs the electronic device to render a first image frame including a first opaque model and a model corresponding to a first semi-transparent particle. In response to the first rendering instruction, the electronic device can render and display a second image frame including the first opaque model and the model corresponding to the first semi-transparent particle.
[0122] Afterwards, the electronic device receives a second rendering instruction issued by the application. Similarly, the electronic device can parse the second rendering instruction to obtain a third image frame indicated by the second rendering instruction for the electronic device to render. The third image frame is a next image frame of the first image frame indicated by the application for the electronic device to render. The third image frame includes the second opaque model and the third image frame of the model corresponding to the second semi-transparent particle. The electronic device renders and displays a fourth image frame in response to the second rendering instruction. The fourth image frame includes the second opaque model and does not include the model corresponding to the second semi-transparent particle.
[0123] In some embodiments, the first image frame and the second image frame are two adjacent image frames indicated by the application for the electronic device to render. Generally, the application indicates more than two image frames for the electronic device to render. In some embodiments, the electronic device can use the above method to render and display in a certain manner. For example, the electronic device takes every two adjacent image frames as a rendering period. If each image frame indicated by the application for the electronic device to render in the rendering period includes an opaque model and a model corresponding to a semi-transparent particle, in the rendering period, the electronic device renders and displays an image frame containing an opaque model and a model corresponding to a semi-transparent particle in the first frame, and renders and displays an image frame containing an opaque model and not containing a model corresponding to a semi-transparent particle in the next frame.
[0124] For another example, the electronic device takes every three adjacent image frames as a rendering period. If each image frame indicated by the application for the electronic device to render in the rendering period includes an opaque model and a model corresponding to a semi-transparent particle, in the rendering period, the electronic device can render and display an image frame containing an opaque model and a model corresponding to a semi-transparent particle in one of the frames, and render and display an image frame containing an opaque model and not containing a model corresponding to a semi-transparent particle in the next frame. The electronic device can render and display an image frame containing an opaque model and a model corresponding to a semi-transparent particle in another frame in the rendering period. Alternatively, the electronic device can render and display an image frame containing an opaque model and not containing a model corresponding to a semi-transparent particle in another frame in the rendering period.
[0125] In other embodiments, the electronic device can also take other adjacent frames as a rendering period, but in each rendering period, at least two adjacent frames are included. One of the two adjacent frames includes a model corresponding to a semi-transparent particle, and the next frame does not include a model corresponding to a semi-transparent particle. Thus, when a user views a plurality of consecutive image frames, the user can see that part of the image elements have a semi-transparent effect, while reducing the power consumption of the electronic device caused by rendering semi-transparent image elements, thereby reducing the power consumption, heating and lagging of the electronic device.
[0126] In some embodiments, the electronic device can further determine that the received rendering instruction indicates that the image frame rendered by the electronic device includes the model corresponding to the semi-transparent particle, and that the current frame is the first preset frame, and render the image frame including the model corresponding to the semi-transparent particle. In some embodiments, the electronic device can further determine that the received rendering instruction indicates that the image frame rendered by the electronic device includes the model corresponding to the semi-transparent particle, and that the current frame is the second preset frame, and render the image frame not including the model corresponding to the semi-transparent particle.
[0127] In some embodiments, the electronic device can further determine that the received rendering instruction indicates that the image frame rendered by the electronic device includes the model corresponding to the semi-transparent particle, and that at least one of the continuous x frames before the current frame is an image frame not including the model corresponding to the semi-transparent particle, and determine that the current frame needs to render and display the image frame including the model corresponding to the semi-transparent particle. In some embodiments, the electronic device can further determine that the received rendering instruction indicates that the image frame rendered by the electronic device includes the model corresponding to the semi-transparent particle, and that at least one of the continuous x frames before the current frame is an image frame including the model corresponding to the semi-transparent particle, and determine that the current frame needs to render and display the image frame not including the model corresponding to the semi-transparent particle.
[0128] In some embodiments, the electronic device can further determine that the received rendering instruction indicates that the image frame rendered by the electronic device includes the model corresponding to the semi-transparent particle, and that in a rendering period, any one of the image frames is rendered to include the model corresponding to the semi-transparent particle, and the other image frames in the rendering period are not rendered to include the model corresponding to the semi-transparent particle. Alternatively, in a rendering period, any one of the image frames is not rendered to include the model corresponding to the semi-transparent particle, and the other image frames in the rendering period are rendered to include the model corresponding to the semi-transparent particle.
[0129] The image rendering and display method of the present application will be described in detail below with reference to the accompanying drawings.
[0130] Please refer to Figure 7A which shows the flow of the image rendering and display method in some embodiments. In this embodiment, the electronic device is taken as a mobile phone for example. In this embodiment, the mobile phone is installed with an application program. The mobile phone includes a CPU, a GPU, a preset graphics library, and a display screen.
[0131] S701. The CPU receives a rendering instruction 1 issued by the application program.
[0132] It can be understood that before the application program issues the rendering to the CPU, the application program is started. In some embodiments, the application program can be a game application, a video application, a weather application, or a map application, etc.
[0133] The rendering instruction is used to instruct the phone to render an image. In some embodiments, the rendering instruction 1 is used to instruct the phone to render a first image frame, the first image frame including a first opaque model and a model corresponding to a first translucent particle. In some embodiments, the rendering instruction 1 described above can also be referred to as a first rendering instruction.
[0134] Generally, a frame of image can include multiple image elements. Among them, the image element can correspond to Figure 1 the smoke shown in area A, or Figure 1 the person shown in area B, or a tree, a cloud, etc. in the figure.
[0135] Different image elements can have different target display effects in the current frame. For example, the display effect of the smoke shown in Figure 1 area A is translucent; while Figure 1 the display effect of the person shown in area B is completely opaque.
[0136] The target display effect of an image element in the current frame is the display effect of the image element in the finally displayed image. In some embodiments, the display effect can include color (such as red, green, and blue primary colors) and transparency, etc.
[0137] The target display effect of an image element in an image is usually determined by an application program that instructs the electronic device to generate and display the image. That is, the application program defines the display effect of each image element in a frame of image that the electronic device needs to display.
[0138] The electronic device can render the image element by means of a model. For example, if the target transparency of the image element in the image is 0, the electronic device can obtain and display the opaque image element by rendering an opaque model. If the target transparency of the image element in the image is greater than 0 and less than 100%, the electronic device can obtain and display the translucent image element by rendering a model corresponding to a translucent particle. The target transparency can represent the transparency of the image element that the application program needs the phone to present in the image frame, which is usually defined by the application program. For example, the application program issues a rendering instruction to instruct the phone to render an image frame, and defines the color and transparency with which each image element in the image frame needs to be presented.
[0139] The first opaque model in the first image frame corresponds to a completely opaque image element. The opaque image element specifically refers to an image element with a transparency of 0 in the rendered and displayed image. For example, the first opaque model can specifically correspond to the person shown in Figure 1 area B, etc.
[0140] In some embodiments, the first opaque model can include a plurality of opaque models, i.e., the first image frame to be rendered can include a plurality of opaque image elements.
[0141] The first semi-transparent particle corresponding model in the first image frame is rendered and displayed in the image frame, and the transparency of the image element is 0. For example, the first semi-transparent particle corresponding model can correspond to the smoke shown in region A, and can also correspond to the operation control 10. Similarly, the first semi-transparent particle corresponding model can include a plurality of semi-transparent particle corresponding models, i.e., the first image frame can include a plurality of semi-transparent particle corresponding models. Figure 1 Figure 2 The first semi-transparent particle corresponding model in the first image frame is rendered and displayed in the image frame, and the transparency of the image element is 0. For example, the first semi-transparent particle corresponding model can correspond to the smoke shown in region A, and can also correspond to the operation control 10. Similarly, the first semi-transparent particle corresponding model can include a plurality of semi-transparent particle corresponding models, i.e., the first image frame can include a plurality of semi-transparent particle corresponding models.
[0142] The rendering instruction can carry first image information of the image to be rendered by the mobile phone. For example, the first image information can include model data of the first opaque model and model data of the first semi-transparent particle corresponding model, so that the mobile phone can know the content of the image frame to be rendered according to the rendering instruction.
[0143] In some embodiments, the model data of the first opaque model corresponding model can include the color (such as RGB value) of the first opaque model and the target transparency (0). The model data of the first semi-transparent particle corresponding model can include the RGB value of the first semi-transparent particle corresponding model and the target transparency (greater than 0 and less than 100%). That is, when the application program issues a requirement to the mobile phone to render the first image frame, the color and target transparency of each model (i.e., image element) in the first image frame are defined. For example, the target transparency in the model data of the model A indicated by the rendering instruction is 0, which means that the application program needs the mobile phone to render and display the completely opaque model A. The target transparency of the model B carried in the rendering instruction is 60%, which means that the application program needs the mobile phone to render and display the semi-transparent (transparency is 60%) model B. It should be noted that in other embodiments, the above-mentioned model data can also include other data, such as the position, size and depth of the model in the image, etc.
[0144] S702. The CPU sends a first call request for the rendering interface to the preset graphics library in response to the rendering instruction 1.
[0145] The call request for the rendering interface sent by the CPU to the preset graphics library can be used to instruct the preset graphics library to inform the GPU to perform the rendering operation. In the embodiments of the present application, the first call request is used to instruct the preset graphics library to inform the GPU to render the second image frame including the first opaque model and the first semi-transparent particle corresponding model.
[0146] In some embodiments, the preset graphics library can be OpenGL. It can be understood that in other embodiments, the preset graphics library can also be other graphics libraries.
[0147] In some embodiments, the second image information of the second image frame to be rendered by the GPU can be carried in the first call request sent by the CPU to the preset graphics library.
[0148] Taking the first call request as an example, since the first call request is sent by the CPU to the preset graphics library in response to the rendering instruction 1, it can be known from the above description of the embodiments that the rendering instruction 1 can carry: the model data of the first opaque model, and the model data of the model corresponding to the first translucent particle. In some embodiments, the second image information can include: the model data of the first opaque model and the model data of the model corresponding to the first translucent particle. In this way, the GPU can render the second image frame containing the first opaque model and the model corresponding to the first translucent particle according to the second image information.
[0149] It can be known from the above description that, in some embodiments of the present application, in order to enable the user to see the semi-transparent effect of part of the image elements while viewing a plurality of continuous image frames, the mobile phone will not render the model corresponding to the translucent particle in part of the image frames. Instead, through the visual persistence phenomenon of the human eye, the user can see the semi-transparent effect when viewing a plurality of continuous image frames.
[0150] In some embodiments, in the case where the model corresponding to the translucent particle needs to be rendered in the current frame, the mobile phone can render the model corresponding to the translucent particle in the current frame according to the color and target transparency of the model corresponding to the translucent particle in the rendering instruction issued by the application. For example, the model data of the model corresponding to the first translucent particle in the second image information described above includes: the color and target transparency of the model corresponding to the first translucent particle.
[0151] In some embodiments, the phone can not consider the target transparency of the model corresponding to the semi-transparent particle when rendering the model corresponding to the semi-transparent particle in the current frame, but only render the model corresponding to the semi-transparent particle according to other information of the model corresponding to the semi-transparent particle, such as color. In this embodiment, the model data of the model corresponding to the first semi-transparent particle in the second image information described above includes color, but does not include the target transparency of the model corresponding to the first semi-transparent particle. In this way, the phone can render the model corresponding to the first semi-transparent particle in the image frame only according to other model data (such as color) of the model corresponding to the first semi-transparent particle. Alternatively, in some other embodiments, the CPU can also set the transparency of the model corresponding to the first semi-transparent particle in the model data of the model corresponding to the first semi-transparent particle to 0; in this way, the phone can render the model corresponding to the first semi-transparent particle as opaque in the image frame.
[0152] For example, the phone renders the smoke in the area A shown in FIG. 10 as completely opaque smoke in the current frame. The phone renders the operation control 10 shown in FIG. 11 as completely opaque operation control in the current frame; and so on. In this way, in the image frame in which the model corresponding to the semi-transparent particle needs to be rendered, the phone can not need to start the blending test, and does not involve source texture sampling and calculation according to the source color vector and the target color vector. Thus, the power consumption of the phone can be reduced when the phone needs to render the model corresponding to the semi-transparent particle in the image frame. Further, while the user views a plurality of continuous frames, the user can still see that some image elements have semi-transparent effects, and the power consumption of the phone caused by rendering the model corresponding to the semi-transparent particle can be further reduced, and the problems such as power consumption, heating, and lag can be reduced. Figure 1 Figure 2 For example, the phone renders the smoke in the area A shown in FIG. 10 as completely opaque smoke in the current frame. The phone renders the operation control 10 shown in FIG. 11 as completely opaque operation control in the current frame; and so on. In this way, in the image frame in which the model corresponding to the semi-transparent particle needs to be rendered, the phone can not need to start the blending test, and does not involve source texture sampling and calculation according to the source color vector and the target color vector. Thus, the power consumption of the phone can be reduced when the phone needs to render the model corresponding to the semi-transparent particle in the image frame. Further, while the user views a plurality of continuous frames, the user can still see that some image elements have semi-transparent effects, and the power consumption of the phone caused by rendering the model corresponding to the semi-transparent particle can be further reduced, and the problems such as power consumption, heating, and lag can be reduced.
[0153] In addition, in some embodiments of the present application, the phone does not render the model corresponding to the semi-transparent particle in some image frames. Therefore, in some embodiments, before S702 described above, the method can further include: determining, by the CPU, whether the current frame needs to render the model corresponding to the semi-transparent particle. After determining that the current frame needs to render the model corresponding to the semi-transparent particle, the phone can execute S702 described above, and the first call request in S702 is used to instruct the GPU to render the image frame including the first opaque model and the model corresponding to the first semi-transparent particle.
[0154] In some other embodiments, after receiving the rendering instruction issued by the application program, if it is determined that the current frame does not need to render the model corresponding to the semi-transparent particle, the phone can not render the model corresponding to the semi-transparent particle. In this way, it can be ensured that the phone can not render the model corresponding to the semi-transparent particle in some image frames, so that the user can still see that some image elements have semi-transparent effects while viewing a plurality of continuous frames by using the characteristics of visual persistence.
[0155] In some embodiments, the CPU can determine that the current frame needs to render the model corresponding to the first semi-transparent particle when the current frame meets certain conditions. It should be noted that the specific implementation process of the CPU judging whether the current frame needs to render the model corresponding to the first semi-transparent particle will be described in detail in the following embodiments.
[0156] S703. The preset graphics library notifies the GPU to start rendering.
[0157] The preset graphics library can notify the GPU to start image rendering in response to the first calling request. For example, the preset graphics library sends a notification message to the GPU.
[0158] In some embodiments, the notification message sent by the preset graphics library to the GPU carries third image information of the image that needs to be rendered by the GPU. The third image information can be the image information (such as the second image information described above) carried by the first calling request when the CPU calls the preset graphics library.
[0159] S704. The GPU renders the image frame 1.
[0160] As can be known from the above description, the second image information can include the model data of the first opaque model and the model data of the model corresponding to the first semi-transparent particle. Therefore, when the GPU renders the image according to the calling of the preset graphics library by the CPU in response to the rendering instruction 1, the GPU will render the model corresponding to the first opaque particle and the first semi-transparent particle, that is, the image frame 1. In some examples, the above image frame 1 can also be referred to as the second image frame. It should be noted that the process of the GPU rendering the image frame 1 can refer to the description in the related art, and will not be described in detail in the embodiments of the present application.
[0161] As can be known from the description of the above embodiments, in some embodiments, the model data of the model corresponding to the first semi-transparent particle in the second image information can include the target transparency of the model corresponding to the first semi-transparent particle. Then in this embodiment, in S704, the GPU renders the model corresponding to the first semi-transparent particle can be that the GPU renders according to the color and the target transparency of the model corresponding to the first semi-transparent particle. That is, when the GPU renders the image frame according to the second image information, the GPU can render the first opaque model 1 and the model 2 corresponding to the first semi-transparent particle; and the model 2 is displayed in the image frame 1 with a semi-transparent effect (the transparency is the target transparency). It can be understood that when rendering the image frame 1, the mobile phone needs to be turned on.
[0162] In some embodiments, the model data of the first semi-transparent particle corresponding model can also not include the target transparency of the first semi-transparent particle corresponding model. Then in this embodiment, in the S704, the GPU renders the first semi-transparent particle corresponding model, specifically can include: the GPU renders according to the color (including red, green and blue) of the first semi-transparent particle corresponding model, without considering the target transparency of the first semi-transparent particle corresponding model. That is, when the GPU renders the image frame according to the second image information, the first opaque model 1 and the first semi-transparent particle corresponding model 3 can be rendered; and the model 3 is displayed as completely opaque (transparency is 0) in the image frame 1. In some embodiments, the model 3 can be recorded as the third opaque model.
[0163] In some embodiments, the model data of the first semi-transparent particle corresponding model can also not include the target transparency of the first semi-transparent particle corresponding model. Then in this embodiment, in the S704, the GPU renders the first semi-transparent particle corresponding model, specifically can include: the GPU renders according to the color (including red, green and blue) of the first semi-transparent particle corresponding model, without considering the target transparency of the first semi-transparent particle corresponding model. That is, when the GPU renders the image frame according to the second image information, the first opaque model 1 and the first semi-transparent particle corresponding model 3 can be rendered; and the model 3 is displayed as completely opaque (transparency is 0) in the image frame 1. In some embodiments, the model 3 can be recorded as the third opaque model.
[0164] S705. The GPU sends the image frame 1 to display.
[0165] In some embodiments, after the GPU renders the image frame 1, the image frame 1 can be stored in the frame buffer of the GPU. Then the display screen obtains the image frame 1 from the frame buffer and displays it.
[0166] S706. The CPU receives the rendering instruction 2 issued by the application program.
[0167] In some embodiments, the rendering instruction 2 is used to instruct the mobile phone to render a third image frame, and the third image frame includes a second opaque model and a second semi-transparent particle corresponding model. And the third image frame is the next frame image of the first image frame rendered by the application program. In some embodiments, the rendering instruction 2 is the next rendering instruction of the rendering instruction 1 issued by the application program, and the rendering instruction 2 can also be recorded as the second rendering instruction.
[0168] Generally, the image elements in the continuous images have continuity. Therefore, in some embodiments, the second opaque model can be the same as the first opaque model; or the second opaque model can be similar to the first opaque model, but there are some differences. Similarly, the second semi-transparent particle corresponding model can be the same as the first semi-transparent particle corresponding model, or the second semi-transparent particle corresponding model can be similar to the first semi-transparent particle corresponding model, but there are some differences.
[0169] In some embodiments, the rendering instruction 2 can carry fourth image information of the image frame (the third image frame) that the application instructs the mobile phone to render. For example, the fourth image information can specifically include model data of the second opaque model and model data of the second semi-transparent particle corresponding model. In this way, the mobile phone can know the content of the image frame that needs to be rendered according to the rendering instruction.
[0170] In some embodiments, the model data of the second opaque model can specifically include color (such as RGB value) of the second opaque model and target transparency (0). The model data of the second semi-transparent particle corresponding model can specifically include RGB value of the second semi-transparent particle corresponding model and target transparency (greater than 0 and less than 100%).
[0171] S707. The CPU sends a second calling request for the rendering interface to the preset graphics library in response to the rendering instruction 2.
[0172] As can be seen from the above description, in some embodiments of the present application, in order to enable the user to see the semi-transparent effect of part of the image elements when viewing a plurality of continuous image frames while reducing the power consumption of the mobile phone, the mobile phone will not render the second semi-transparent particle corresponding model in part of the image frames. Instead, the user can see the semi-transparent effect of part of the image elements in the image frame when viewing a plurality of continuous image frames through the visual persistence of the human eye. In the above S707, the CPU will not instruct the GPU to render the second semi-transparent particle corresponding model when calling the preset graphics library.
[0173] In some embodiments, before S707, the method can further include: the CPU determining whether the current frame needs to render the second semi-transparent particle corresponding model. After determining that the current frame does not need to render the second semi-transparent particle corresponding model, the mobile phone can perform the above S707, and the second calling request in S707 is used to instruct the GPU to render the image frame including the second opaque model and not including the second semi-transparent particle corresponding model.
[0174] In some embodiments, the second calling request sent by the CPU to the preset graphics library can carry fifth image information of the fourth image frame that the CPU instructs the GPU to render.
[0175] Since the GPU does not need to render the second semi-transparent particle corresponding model in the current frame, in some embodiments, the above fifth image information can include model data of the second opaque model and not include model data of the second semi-transparent particle corresponding model. In this way, the GPU can render the image frame including the second opaque model and not including the second semi-transparent particle corresponding model, that is, the fourth image frame, according to the fifth image information.
[0176] S708. The preset graphics library instructs the GPU to start rendering.
[0177] In some embodiments, the preset graphics library in S708 sends a notification message to the GPU, which carries the fifth image information.
[0178] S709. The GPU renders the image frame 2.
[0179] As can be seen from the above description of the embodiments, the fifth image data does not include the model data of the second semi-transparent particle corresponding model. Therefore, in some embodiments, the image frame 2 includes the second opaque model and does not include the model corresponding to the second semi-transparent particle. It can be understood that the image frame 2 is the fourth image frame described above.
[0180] S710. The GPU sends the image frame 2 for display.
[0181] In the above image frame 1 rendered and displayed by the GPU, the model corresponding to the first semi-transparent particle is completely opaque. Please refer to Figure 7B a, which corresponds to the image frame 1 rendered and displayed by the mobile phone. Figure 7B b in the above corresponds to the image frame 2 rendered and displayed by the mobile phone. When the user views the two image frames displayed by the mobile phone, due to the visual persistence characteristic, the user will see the image shown in Figure 7B c. That is, the box 70 in the image is semi-transparent. In Figure 7B c, the background content blocked by the box 70, the number "11", can be seen. It should be noted that Figure 7B is only a simple effect diagram.
[0182] In the technical scheme provided in the embodiments of the present application, in a scenario where an application instructs a mobile phone to render two adjacent frames of images and the application defines that the model corresponding to the semi-transparent particle needs to be included in both the two frames of images, the image frame including the model corresponding to the semi-transparent particle is rendered in the rendering process of one of the two frames of images, and the image frame not including the model corresponding to the semi-transparent particle is rendered in the rendering process of the other frame of images. When the current frame is a rendering frame (the current frame needs to render and display the model corresponding to the semi-transparent particle), the model corresponding to the semi-transparent particle is directly drawn into the image, without the need to enable the blending test, and the user sees the color of the model corresponding to the semi-transparent particle in the display area of the model. When the current frame is a non-rendering frame (the current frame does not need to render and display the model corresponding to the semi-transparent particle), the model corresponding to the semi-transparent particle does not need to be drawn into the image, and the user sees the color of the background in the display area of the model. Due to the persistence of vision of the human eye, the color of the model corresponding to the semi-transparent particle actually displayed and the color of the background in the display area are mixed, and finally the mixed color is presented in the human eye, so that the user sees the semi-transparent effect of part of the image elements in the image. Since the model corresponding to the semi-transparent particle can not be rendered and displayed in part of the continuous multiple frames, the semi-transparent effect of part of the image elements seen by the user in the image can be achieved while reducing the power consumption of the electronic device caused by rendering the semi-transparent image elements, thereby reducing the power consumption, heating and lag of the electronic device.
[0183] It should be noted that, Figure 7A The flowchart shown is the process of rendering two adjacent frames of images by the mobile phone in response to the rendering instruction issued by the application. However, in actual application, the images instructed by the application to be rendered usually include more than two frames. In the case where the continuous multiple frames of images instructed by the application to be rendered all include the model corresponding to the semi-transparent particle, the rendering process of the multiple frames of images can include multiple adjacent two frames (one frame renders the model corresponding to the semi-transparent particle, and the next frame does not render the model corresponding to the semi-transparent particle).
[0184] In some embodiments, the image frame that needs to render the model corresponding to the semi-transparent particle can be denoted as a first preset frame. The image frame that does not need to render the model corresponding to the semi-transparent particle can be denoted as a second preset frame. The second preset frame is an image frame other than the first preset frame.
[0185] Further, the CPU determining whether the current frame needs to render the model corresponding to the semi-transparent particle can specifically include: the CPU determining whether the image frame (e.g., the current frame) that the rendering instruction instructs the mobile phone to render is a first preset frame that the application instructs the mobile phone to render. Further, after the CPU determines that the image frame that the rendering instruction instructs the mobile phone to render is the first preset frame, the mobile phone can render the model corresponding to the semi-transparent particle in the image frame.
[0186] For example, before S702 shown in the flow, the method can further include: the CPU determining whether the current frame is the first preset frame. If the current frame is the first preset frame, S702 can be performed. Figure 7A For example, before S707 shown in the flow, the method can further include: the CPU determining whether the current frame is the first preset frame. If the current frame is not the first preset frame, S707 can be performed. Figure 7A For example, before S707 shown in the flow, the method can further include: the CPU determining whether the current frame is the first preset frame. If the current frame is not the first preset frame, S707 can be performed.
[0187] In some embodiments, in a scenario where the consecutive multiple image frames that the application instructs the mobile phone to render all include the model corresponding to the semi-transparent particle, for the consecutive multiple image frames, the mobile phone can select to render the model corresponding to the semi-transparent particle in one image frame and not to render the model corresponding to the semi-transparent particle in the next image frame. By using the visual persistence feature, the user can see that part of the image elements in the image are semi-transparent when viewing the consecutive multiple image frames. In this embodiment, the first preset frame can be an odd frame, and the second preset frame can be an even frame. Alternatively, the first preset frame can be an even frame, and the second preset frame can be an odd frame.
[0188] The rendering mode that the first preset frame needs to render the model corresponding to the semi-transparent particle, the second preset frame does not need to render the model corresponding to the semi-transparent particle, and the first preset frame is an odd frame and the second preset frame is an even frame can also be referred to as a rendering mode in which the mobile phone renders an image frame containing the model corresponding to the semi-transparent particle every 1 frame interval. In this embodiment, the CPU determining whether the current frame is the first preset frame that the application instructs the mobile phone to render can specifically include: the mobile phone determining whether the current frame is an odd frame that the application instructs the mobile phone to render.
[0189] Further, after determining that the current frame is an odd frame that the application instructs the mobile phone to render, the mobile phone can render an image frame containing the model corresponding to the semi-transparent particle and the opaque model. When the current frame is an even frame that the application instructs the mobile phone to render, the mobile phone can render an image frame containing the opaque model but not containing the model corresponding to the semi-transparent particle.
[0190] For example, in the example of the application instructing the phone to render the image frames 1-1600 each including the model corresponding to the semi-transparent particle, in the embodiment of the phone rendering 1 frame of the image frame including the model corresponding to the semi-transparent particle every 1 frame, the rendering of the image frames 1-1600 is shown in Table 1:
[0191] Table 1
[0192] Frame number Rendering case 1 Render image frames containing opaque models and models corresponding to semi-transparent particles 2 Render image frames containing opaque models, excluding models corresponding to semi-transparent particles 3 Render image frames containing opaque models and models corresponding to semi-transparent particles 4 Render image frames containing opaque models, excluding models corresponding to semi-transparent particles 5 Render image frames containing opaque models and models corresponding to semi-transparent particles 6 Render image frames containing opaque models, excluding models corresponding to semi-transparent particles 7 Render image frames containing opaque models and models corresponding to semi-transparent particles 8 Render image frames containing opaque models, excluding models corresponding to semi-transparent particles … …
[0193] Conversely, if the first preset frame is an even frame and the second preset frame is an odd frame, the phone can render the image frame including the opaque model and the model corresponding to the semi-transparent particle when the current frame is an even frame. Meanwhile, the phone can render the image frame including the opaque model and not including the model corresponding to the semi-transparent particle when the current frame is an odd frame.
[0194] As can be seen from the above examples, the application can define the target transparency of each image element in the image to be rendered, that is, the transparency of the image element to be presented in the image frame. In some embodiments of the present application, in order to present image elements with different transparencies, the interval of the frames in which the phone renders the model corresponding to the semi-transparent particle can be adjusted. For example, in the above embodiment of the phone rendering the image frame including the model corresponding to the semi-transparent particle every 1 frame, the phone can render the image frame including the model corresponding to the semi-transparent particle every 2 frames in other embodiments. Or, the phone can render the image frame not including the model corresponding to the semi-transparent particle every 2 frames.
[0195] Therefore, in some other embodiments, the first preset frame is the (k*m+1) frame image frame instructed by the application to render, m is a positive integer sequentially taking values in {0, 1, 2, 3, …, M}, k≥3, and k is a positive integer. The second preset frame is other frames than the first preset frame.
[0196] When k=3, it means that the phone renders the image frame including the model corresponding to the semi-transparent particle every 2 frames. For example, when m=0, the first preset frame is the 1st frame instructed by the application to render, and the second preset frame is the 2nd frame and the 3rd frame instructed by the application to render. When m=1, the first preset frame is the 4th frame instructed by the application to render, and the second preset frame is the 5th frame and the 6th frame instructed by the application to render. And so on.
[0197] In some embodiments in which the phone renders one frame containing the model corresponding to the semi-transparent particle per every 2 frames, the CPU determines whether the current frame is the first preset frame indicated by the application for the phone to render, which can include: the CPU determines whether the current frame is the (3*m+1)th frame image indicated by the application for the phone to render.
[0198] Further, if the current frame is the (3*m+1)th frame image indicated by the application for the phone to render, it means that the current frame needs to render the model corresponding to the semi-transparent particle, i.e., the current frame is the first preset frame. If the current frame is not the (3*m+1)th frame image indicated by the application for the phone to render, it means that the current frame does not need to render the model corresponding to the semi-transparent particle.
[0199] For example, in the first-1600th frame image indicated by the application for the phone to render, the model corresponding to the semi-transparent particle is included, in the embodiments in which the phone renders one frame containing the model corresponding to the semi-transparent particle per every 2 frames, the rendering of the first-1600th frame image is shown in Table 2:
[0200] Table 2
[0201] Frame number Rendering case 1 Render image frames containing opaque models and models corresponding to semi-transparent particles 2 Render image frames containing opaque models, excluding models corresponding to semi-transparent particles 3 Render image frames containing opaque models, excluding models corresponding to semi-transparent particles 4 Render image frames containing opaque models and models corresponding to semi-transparent particles 5 Render image frames containing opaque models, excluding models corresponding to semi-transparent particles 6 Render image frames containing opaque models, excluding models corresponding to semi-transparent particles 7 Render image frames containing opaque models and models corresponding to semi-transparent particles 8 Render image frames containing opaque models, excluding models corresponding to semi-transparent particles … …
[0202] In some embodiments in which the first preset frame is the (k*m+1)th frame image indicated by the application for the phone to render, and the second preset frame is other frames than the first preset frame, when k=4, it means that the phone renders one frame containing the model corresponding to the semi-transparent particle per every 3 frames. When m=0, the first preset frame is the 1st frame indicated by the application for the phone to render, and the second preset frame is the 2nd-4th frame indicated by the application for the phone to render. When m=1, the first preset frame is the 5th frame indicated by the application for the phone to render, and the second preset frame is the 6th-8th frame indicated by the application for the phone to render; and so on. It can be understood that k can also take values of 4, 6, 7, and the like.
[0203] In some other embodiments, the second preset frame is the k*nth frame image indicated by the application for the phone to render, n is a positive integer sequentially taking values in {1, 2, 3, …, N}, k≥3, and k is a positive integer. The first preset frame is other frames than the second preset frame.
[0204] When k=3, it means that the phone renders one frame not containing the model corresponding to the semi-transparent particle per every 2 frames. For example, when n=1, the first preset frame is the 1st and 2nd frames, and the second preset frame is the 3rd frame. When n=2, the first preset frame is the 4th and 5th frames, and the second preset frame is the 6th frame; and so on.
[0205] In some embodiments in which the mobile phone renders one frame every 2 frames, the frame not containing the model corresponding to the translucent particle, the above-mentioned CPU determining whether the current frame is the first preset frame indicated by the application program for the mobile phone to render can specifically include: the CPU determining whether the current frame is not the 3n-th frame image frame indicated by the application program for the mobile phone to render.
[0206] Further, if the current frame is not the 3n-th frame image frame indicated by the application program for the mobile phone to render, that is, not the second preset frame, but the first preset frame, it indicates that the current frame needs to render the model corresponding to the translucent particle. If the current frame is the 3n-th frame image frame indicated by the application program for the mobile phone to render, that is, the second preset frame, it indicates that the current frame does not need to render the model corresponding to the translucent particle.
[0207] For example, in the first-1600 frame image indicated by the application program for the mobile phone to render, the model corresponding to the translucent particle is included in each frame. In the embodiment in which the mobile phone renders one frame every 2 frames, the frame not containing the model corresponding to the translucent particle, the rendering of the first-1600 frame image is shown in Table 3:
[0208] Table 3
[0209] Frame number Rendering case 1 Render image frames containing opaque models and models corresponding to semi-transparent particles 2 Render image frames containing opaque models and models corresponding to semi-transparent particles 3 Render image frames containing opaque models, excluding models corresponding to semi-transparent particles 4 Render image frames containing opaque models and models corresponding to semi-transparent particles 5 Render image frames containing opaque models and models corresponding to semi-transparent particles 6 Render image frames containing opaque models, excluding models corresponding to semi-transparent particles 7 Render image frames containing opaque models and models corresponding to semi-transparent particles 8 Render image frames containing opaque models and models corresponding to semi-transparent particles … …
[0210] In some other embodiments in which the second preset frame is the k*n-th frame image frame indicated by the application program for the mobile phone to render, and the first preset frame is other frames than the second preset frame, k=4 indicates that the mobile phone renders one frame every 3 frames, the frame not containing the model corresponding to the translucent particle. When n=1, the first preset frame is the first-3 frame, and the second preset frame is the fourth frame. When n=2, the first preset frame is the fifth-7 frame, and the second preset frame is the eighth frame. It can be understood that k can also take values such as 4, 6, 7, and the like.
[0211] In the technical scheme provided in the embodiments of the present application, after the CPU receives the rendering instruction issued by the application program, it can determine whether the current frame belongs to the first preset frame to determine whether the model corresponding to the translucent particle needs to be rendered in the current frame. In this way, it can be ensured that the mobile phone renders the model corresponding to the translucent particle in part of the image frames and does not render the model corresponding to the translucent particle in part of the image frames when rendering the image frames containing the model corresponding to the translucent particle. Thus, by using the visual persistence characteristic, the user can see the image element as a translucent effect when viewing this part of the image frames.
[0212] Further, in some embodiments, the application program can indicate to the mobile phone to set a frame sequence number for each frame rendered by the mobile phone, so that whether the current frame meets the preset condition can be determined according to the frame sequence number, thereby determining whether the current frame needs to render the model corresponding to the semi-transparent particle. The preset condition can correspond to whether the current frame is an odd frame indicated by the application program for the mobile phone to render, or the preset condition can correspond to whether the current frame is an even frame indicated by the application program for the mobile phone to render, or the preset condition can correspond to whether the current frame is a (k*m+1) frame image frame indicated by the application program for the mobile phone to render, or the preset condition can also correspond to whether the current frame is a frame other than the k*n frame image frame indicated by the application program for the mobile phone to render.
[0213] In the technical scheme provided in the embodiments of the present application, the mobile phone sets a frame sequence number for each frame rendered by the application program, which can facilitate the mobile phone to quickly identify whether the current frame needs to render the model corresponding to the semi-transparent particle.
[0214] As can be seen from the above description of the embodiments, the mobile phone needs to render the model corresponding to the semi-transparent particle in the image frame indicated by the rendering instruction issued by the application program, and only in this case, the mobile phone needs to render the model corresponding to the semi-transparent particle in part of the image frames according to the above method, and does not need to render the model corresponding to the semi-transparent particle in part of the image frames. Therefore, before the CPU determines whether the current frame needs to render the model corresponding to the semi-transparent particle, the mobile phone also needs to determine whether the rendering instruction indicates that the image frame rendered by the mobile phone includes the model corresponding to the semi-transparent particle. If the mobile phone determines according to the rendering instruction that the image frame rendered by the application program includes the model corresponding to the semi-transparent particle, the mobile phone determines whether the current frame needs to render the model corresponding to the semi-transparent particle.
[0215] In some embodiments, before the CPU determines whether the current frame needs to render the model corresponding to the semi-transparent particle after receiving the rendering instruction issued by the application program, the above method further includes that the CPU determines whether the rendering instruction indicates that the image frame rendered by the mobile phone includes the model corresponding to the semi-transparent particle. If the rendering instruction indicates that the image frame rendered by the mobile phone includes the semi-transparent particle, the CPU determines whether the current frame needs to render the model corresponding to the semi-transparent particle. For example, Figure 8 which shows a process of rendering an image frame by the mobile phone according to the rendering instruction. After the CPU receives the rendering instruction issued by the application program, the CPU determines whether the rendering instruction indicates that the image frame to be rendered by the mobile phone includes the model corresponding to the semi-transparent particle.
[0216] In some embodiments, if the rendering instruction indicates that the image frame rendered by the mobile phone includes the model corresponding to the semi-transparent particle, and the current frame needs to render the model corresponding to the semi-transparent particle, the CPU instructs the GPU to render the current frame, and the current frame includes the model corresponding to the semi-transparent particle.
[0217] In some embodiments, if the rendering instruction indicates that the image frame rendered by the mobile phone includes the model corresponding to the semi-transparent particle, and at least one of the x consecutive image frames rendered by the mobile phone before the image frame includes the model corresponding to the semi-transparent particle, the mobile phone can determine that the current frame needs to render the model corresponding to the semi-transparent particle.
[0218] In some embodiments, if the rendering instruction indicates that the image frame rendered by the mobile phone does not include the model corresponding to the semi-transparent particle, the CPU does not need to determine whether the current frame needs to render the model corresponding to the semi-transparent particle, but can directly instruct the GPU to render the current frame. Wherein, the current frame does not include the model corresponding to the semi-transparent particle.
[0219] In the technical scheme provided in the embodiments of the present application, whether the mobile phone needs to render the model corresponding to the semi-transparent particle in the current frame is determined in combination with whether the rendering instruction indicates that the image frame rendered by the mobile phone includes the model corresponding to the semi-transparent particle, and whether the current frame needs to render the model corresponding to the semi-transparent particle. In this way, it can be ensured that the mobile phone can accurately render the model corresponding to the semi-transparent particle in part of the image frames, and does not render the model corresponding to the semi-transparent particle in another part of the image frames. Thus, when a user views a plurality of consecutive frames, the user can see the semi-transparent effect of the image element by using the visual persistence characteristic.
[0220] In some embodiments, the CPU determining whether the current frame needs to render the model corresponding to the semi-transparent particle can also be implemented in the following manner: after the mobile phone receives the rendering instruction issued by the application program, the mobile phone determines whether the rendering instruction indicates that the image frame rendered by the mobile phone includes the model corresponding to the semi-transparent particle, and whether at least one of the x consecutive image frames rendered by the mobile phone before the image frame includes the model corresponding to the semi-transparent particle. It should be noted that x is a positive integer, and the value of x can be set according to actual conditions.
[0221] Further, in some embodiments, if the mobile phone determines that the rendering instruction indicates that the image frame rendered by the mobile phone includes the model corresponding to the semi-transparent particle, and at least one of the x consecutive image frames rendered by the mobile phone before the image frame does not include the model corresponding to the semi-transparent particle, the mobile phone can determine that the current frame needs to render the model corresponding to the semi-transparent particle.
[0222] In some embodiments, if the mobile phone determines that the rendering instruction indicates that the image frame rendered by the mobile phone includes the model corresponding to the semi-transparent particle, and at least one of the x consecutive image frames rendered by the mobile phone before the image frame includes the model corresponding to the semi-transparent particle, the mobile phone can determine that the current frame does not need to render the model corresponding to the semi-transparent particle.
[0223] For example, the rendering instruction currently received is rendering instruction 3, and rendering instruction 3 instructs the mobile phone to render image frame 3. Image frame 3 includes opaque model C and semi-transparent particle corresponding model D. The mobile phone determines that rendering instruction 3 instructs the mobile phone to render image frame 3 including the semi-transparent particle corresponding model, and at least one of the x consecutive image frames rendered by the mobile phone before image frame 3 does not include the semi-transparent particle corresponding model. The mobile phone renders image frame 4. Image frame 4 includes opaque model C and semi-transparent particle corresponding model D.
[0224] In another example, the mobile phone determines that rendering instruction 3 instructs the mobile phone to render image frame 3 including the semi-transparent particle corresponding model, and at least one of the x consecutive image frames rendered by the mobile phone before image frame 3 includes the semi-transparent particle corresponding model. The mobile phone renders image frame 5. Image frame 4 includes opaque model C and does not include semi-transparent particle corresponding model D.
[0225] That is, the above Figure 7A S702 in the flowchart shown can specifically include: when rendering instruction 1 instructs the mobile phone to render a first image frame including a semi-transparent particle corresponding model, and at least one of the x consecutive image frames rendered by the mobile phone before the first image frame does not include the semi-transparent particle corresponding model, the CPU sends a first call request for a rendering interface to a preset graphics library. The first call request is used to instruct the GPU to render an image frame including the first opaque model and the first semi-transparent particle corresponding model.
[0226] The above Figure 7A S707 in the flowchart shown can specifically include: when rendering instruction 2 instructs the mobile phone to render a third image frame including a semi-transparent particle corresponding model, and at least one of the x consecutive image frames rendered by the mobile phone before the third image frame includes the semi-transparent particle corresponding model, the CPU sends a second call request for a rendering interface to a preset graphics library. The second call request is used to instruct the GPU to render an image frame including the second opaque model and not including the second semi-transparent particle corresponding model.
[0227] In the technical scheme provided in the embodiments of the present application, whether the at least one of the x consecutive image frames rendered by the mobile phone before the current frame includes the semi-transparent particle corresponding model is combined to determine whether the current frame needs to render the semi-transparent particle corresponding model. In this way, it can be ensured that the mobile phone can accurately render the semi-transparent particle corresponding model in part of the image frames, and does not render the semi-transparent particle corresponding model in another part of the image frames. Thus, when the user views the consecutive image frames, the user can see that part of the image elements have a semi-transparent effect.
[0228] In some embodiments, where the mobile phone determines that the model corresponding to the semi-transparent particles needs to be rendered in the current frame, the model corresponding to the semi-transparent particles rendered by the mobile phone in the current frame can be completely opaque or semi-transparent.
[0229] In some embodiments, multiple frames with the same rendering pattern can be counted as one rendering cycle. For example, if the phone renders one frame containing semi-transparent elements (i.e., the first preset frame mentioned above) every one frame interval, and another frame does not contain the model corresponding to the semi-transparent particles (i.e., the second preset frame mentioned above), then every two frames can be counted as one rendering cycle. As shown in Table 1, frames 1 and 2 constitute one rendering cycle, frames 3 and 4 constitute one rendering cycle, frames 5 and 6 constitute one rendering cycle, and so on. Similarly, if the phone renders one frame containing the model corresponding to the semi-transparent particles every two frames, and another two frames do not contain the model corresponding to the semi-transparent particles, then every three frames can be counted as one rendering cycle. Likewise, if the phone renders one frame not containing the model corresponding to the semi-transparent particles every two frames, and another two frames contain the model corresponding to the semi-transparent particles, then every three frames can be counted as one rendering cycle; and so on. As shown in Tables 2 and 3 above, frames 1-3 constitute one rendering cycle, frames 4-6 constitute one rendering cycle, frames 7-9 constitute one rendering cycle, and so on.
[0230] In a rendering cycle, the larger the proportion of the first preset frame, the lower the transparency of the image elements that the user sees when viewing them in consecutive frames; that is, the more opaque the image elements appear to the user. Conversely, the larger the proportion of the second preset frame in a rendering cycle, the higher the transparency of the image elements that the user sees when viewing them in consecutive frames; that is, the more transparent the image elements appear to the user.
[0231] In the technical solution provided in this application embodiment, by setting the number of frames in a rendering cycle and the proportion of the first preset frame and the second preset frame in a rendering cycle, users can see image elements with different transparency. This allows for the simulation of a more realistic physical world and a better semi-transparent effect.
[0232] Furthermore, when the same image element exhibits different levels of transparency across multiple consecutive frames, the phone can adjust the number of frames included in a rendering cycle, as well as the ratio of the first and second preset frames within that rendering cycle. This allows users to see the transparency of the same image element gradually change when viewing multiple consecutive frames.
[0233] As can be seen from the description of the above embodiments, in some embodiments, the rendering instructions issued by the application carry image information of the image frame to be rendered on the mobile phone.Figure 7A As an example of the rendering instruction 1 in the flow shown, the rendering instruction 1 can carry first image information (including model data of the first opaque model and model data of the model corresponding to the first semi-transparent particle). In this embodiment, the model data of the first opaque model can include the color of the first opaque model, the target transparency, and the like. In this embodiment, the mobile phone can set different rendering periods and the respective proportions of the first preset frame and the second preset frame in a rendering period according to the target transparency of the model carried in the image information of the rendering instruction issued by the application program. It can be understood that the higher the target transparency of the model, the higher the proportion of the second preset frame in a rendering period should be. Conversely, the lower the target transparency of the model, the higher the proportion of the first preset frame in a rendering period should be.
[0234] In the technical solution provided in the embodiments of the present application, the visual persistence characteristics of the human eye are used to enable the user to see the semi-transparent effect of some image elements when viewing consecutive multiple frames of images. When the display frame rate of the image is low, the user may see jitter when viewing consecutive multiple frames, i.e., the model corresponding to the semi-transparent particle is not displayed in some image frames. Therefore, in some embodiments, the image rendering and display method provided in the embodiments of the present application is applied to an electronic device with a rendering frame rate and a display frame rate both greater than a preset frame rate. In this way, the effect of the user when viewing consecutive multiple frames of images can be improved.
[0235] In some embodiments, the preset frame rate is positively correlated with the number of frames in a rendering period when the electronic device renders an image. That is, the greater the number of frames in a rendering period, the higher the preset frame rate. Related data shows that when the frame rate reaches 80 Hz, the human eye will have difficulty capturing the jitter of consecutive images. In some specific embodiments, the mobile phone renders 1 frame of image including the model corresponding to the semi-transparent particle every 1 frame, i.e., the number of frames in a rendering period is 2 frames, and the preset frame rate is (80*2) Hz, i.e., 160 Hz. The mobile phone renders 1 frame of image including the model corresponding to the semi-transparent particle every 2 frames, and the mobile phone renders 1 frame of image not including the model corresponding to the semi-transparent particle every 2 frames, i.e., the number of frames in a rendering period is 3 frames, and the preset frame rate is (80*3) Hz, i.e., 240 Hz. The same applies.
[0236] The following describes the flow of determining whether each model is the model corresponding to the semi-transparent particle when the mobile phone renders one frame of image according to the rendering instruction. Please refer to Figure 9The mobile phone starts to render the image (i.e., the current frame) according to the rendering instruction after receiving the rendering instruction issued by the application. The mobile phone determines whether each model in the current frame is a model corresponding to a semi-transparent particle in sequence, for example, determines whether the current model is a model corresponding to a semi-transparent particle. In some embodiments, if the current model is not a model corresponding to a semi-transparent particle, the mobile phone draws a drawcall corresponding to the current model.
[0237] In some other embodiments, if the current model is a model corresponding to a semi-transparent particle, the mobile phone further needs to determine whether the current frame needs to render the model corresponding to the semi-transparent particle. If the mobile phone determines that the current frame needs to render the model corresponding to the semi-transparent particle, the mobile phone draws a drawcall corresponding to the current model. If the mobile phone determines that the current frame does not need to render the model corresponding to the semi-transparent particle, the mobile phone does not render the current model. Next, the mobile phone can determine whether the rendering of the current frame is completed, and if so, the current frame can be displayed. If the rendering of the current frame is not completed, the mobile phone returns to determine the next model of the current frame.
[0238] In the technical scheme provided in the embodiments of the present application, it is determined whether each model of the current frame is a model corresponding to a semi-transparent particle, and the model corresponding to the semi-transparent particle is rendered when it is determined that the current frame needs to render the model corresponding to the semi-transparent particle. In this way, in the case that the continuous multiple frames of images rendered by the application instructing the mobile phone to render all include the model corresponding to the semi-transparent particle, the model corresponding to the semi-transparent particle can be rendered in part of the image frames, and the model corresponding to the semi-transparent particle is not rendered in another part of the image frames. Thus, the user can see that part of the image elements have the semi-transparent effect when viewing the continuous multiple frames.
[0239] In some embodiments of the present application, an image display method is further provided, which can be applied to an electronic device. In the method, the electronic device can display continuous first and second image frames. The first image frame includes a first opaque model and a model corresponding to a first semi-transparent particle. The second image frame includes a second semi-transparent model and does not include a model corresponding to a semi-transparent particle. When a user views multiple frames of images including the above-mentioned two continuous frames of images, the user can see the model including the semi-transparent effect, i.e., the image element. Generally, the electronic device needs to render the model corresponding to the semi-transparent particle when displaying the model with the semi-transparent effect. In the embodiments of the present application, while the user can see the model with the semi-transparent effect, the electronic device reduces the rendering of the model corresponding to the semi-transparent particle in part of the image frames, thereby reducing the power consumption of the electronic device caused by rendering the model corresponding to the semi-transparent particle and reducing the problems of heat and power consumption.
[0240] When the electronic device displays an image, a plurality of image frames usually need to be displayed. When the electronic device displays the plurality of image frames, the electronic device can display, in a part of the image frames, an image frame including a model corresponding to a semi-transparent particle, and display, in another part of the image frames, an image frame not including the model corresponding to the semi-transparent particle. In the above manner, one of the two continuous image frames displayed by the electronic device is the image frame including the model corresponding to the semi-transparent particle, and the other is the image frame not including the model corresponding to the semi-transparent particle.
[0241] In some embodiments, the first image frame can be a first preset frame displayed by the electronic device, and the second image frame can be a second preset frame displayed by the electronic device.
[0242] In some embodiments, the first preset frame is an odd frame, and the second preset frame is an even frame. Alternatively, the first preset frame is an even frame, and the second preset frame is an odd frame.
[0243] In other embodiments, the first preset frame is a (k*m+1)th image frame displayed by the electronic device, m is a positive integer sequentially taking values in {0, 1, 2, 3, …, M}, k≥3, k is a positive integer, and the second preset frame is other than the first preset frame.
[0244] In other embodiments, the second preset frame is a k*nth image frame displayed by the electronic device, n is a positive integer sequentially taking values in {1, 2, 3, …, N}, k≥3, k is a positive integer, and the first preset frame is other than the second preset frame.
[0245] In other embodiments, the first image frame and the second image frame are both image frames indicated by an application program to be displayed by the electronic device. The first image frame can be a first preset frame indicated by the application program to be displayed by the electronic device, and the second image frame can be a second preset frame indicated by the application program to be displayed by the electronic device.
[0246] The above several display manners of the embodiments can all achieve that when a user views a plurality of continuous image frames including a first preset frame and a second preset frame, the user can see that part of the image elements in the plurality of continuous image frames have a semi-transparent effect. At the same time, the power consumption of the electronic device caused by rendering the model corresponding to the semi-transparent particle is reduced.
[0247] Further, in some embodiments, the first image frame can specifically include a first opaque model and a third opaque model corresponding to a first semi-transparent particle. That is, in the image frame in which the electronic device displays the model corresponding to the semi-transparent particle, the electronic device can display the model corresponding to the semi-transparent particle as opaque.
[0248] In order to enable the user to see a better semi-transparent display effect when viewing the above image frame, the display frame rate of the electronic device is required. In some embodiments, the display frame rate of the electronic device is greater than a preset frame rate.
[0249] For a detailed explanation of the image display method described above, please refer to the specific description of the image rendering and display method in the above embodiments.
[0250] Other embodiments of this application provide an electronic device (such as a mobile phone). The electronic device may include a display screen, a memory, and one or more processors. The display screen is used to display the interface of the electronic device. The memory is coupled to the processor. The memory is also used to store computer program code, which includes computer instructions. When the processor executes the computer instructions, the computer can perform various functions or steps performed by the mobile phone in the above method embodiments. The structure of the electronic device can be referred to... Figure 5 The structure of the electronic device 100 shown.
[0251] This application also provides a chip system, such as... Figure 10 As shown, the chip system 100 includes at least one processor 1001 and at least one interface circuit 1002. The processor 1001 and the interface circuit 1002 are interconnected via lines. For example, the interface circuit 1002 can be used to receive signals from other devices (e.g., a computer's memory). As another example, the interface circuit 1002 can be used to send signals to other devices (e.g., the processor 1001). Exemplarily, the interface circuit 1002 can read instructions stored in memory and send those instructions to the processor 1001. When the instructions are executed by the processor 1001, the computer can perform the steps in the above embodiments. Of course, the chip system may also include other discrete devices, which are not specifically limited in this application embodiment.
[0252] This application also provides a computer-readable storage medium including computer instructions that, when executed on the aforementioned electronic device (such as a mobile phone), cause the electronic device to perform various functions or steps performed by the mobile phone in the above method embodiments.
[0253] This application also provides a computer program product that, when run on a computer, causes the computer to perform the various functions or steps performed by the mobile phone in the above method embodiments. The computer can be an electronic device, such as a mobile phone.
[0254] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0255] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other manners. For example, the division of the apparatus embodiments is merely an example, and for example, the division of the modules or units can be different, and for example, multiple modules or units can be combined or integrated into another apparatus, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, apparatuses or units, and can be in electrical, mechanical or other forms.
[0256] The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, i.e., may be located in one place, or may be distributed in multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0257] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can be physically present separately, or two or more units can be integrated into one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0258] If the integrated unit is realized in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application essentially or the parts that make contributions to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium, and includes a number of instructions to make a device (which can be a single chip, a chip, etc.) or a processor execute all or part of the steps of the embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various storage media that can store program codes.
[0259] The above is merely a specific implementation of the present application, but the protection scope of the present application is not limited thereto, and any changes or replacements within the technical scope disclosed in the present application should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. An image rendering and display method, characterized in that, The method is applied to an electronic device, and the method includes: The electronic device receives a first rendering instruction from the application, which instructs the electronic device to render a first image frame of the model including the first opaque model and the model corresponding to the first semi-transparent particle. In response to the first rendering instruction, a second image frame is rendered and displayed; wherein the second image frame includes the first opaque model and the model corresponding to the first semi-transparent particle; The application receives a second rendering instruction, which instructs the electronic device to render a third image frame that includes a model corresponding to a second opaque model and a second semi-transparent particle; wherein the third image frame is the next frame image after the first image frame that the application instructs to render. In response to the second rendering instruction, a fourth image frame is rendered and displayed; wherein the fourth image frame includes the second opaque model but does not include the model corresponding to the second semi-transparent particle.
2. The method according to claim 1, characterized in that, The first image frame is a first preset frame that the application instructs the electronic device to render, and the third image frame is a second preset frame that the application instructs the electronic device to render; Wherein, the first preset frame is an odd-numbered frame and the second preset frame is an even-numbered frame; or the first preset frame is an even-numbered frame and the second preset frame is an odd-numbered frame; or... The first preset frame is the (k*m+1)th image frame rendered by the electronic device at the instruction of the application, where m is an integer taking values sequentially from {0, 1, 2, 3, ..., M}, M≥0, M is a non-negative integer, and k≥3, k is a positive integer. The second preset frame is any frame other than the first preset frame; or... The second preset frame is the k*nth image frame rendered by the electronic device at the instruction of the application, where n is a positive integer taking values sequentially in {1, 2, 3, ..., N}, N > 0, N is a positive integer, k ≥ 3, k is a positive integer, and the first preset frame is any frame other than the second preset frame.
3. The method according to claim 1, characterized in that, The step of rendering and displaying the second image frame in response to the first rendering instruction includes: In response to the first rendering instruction instructing the electronic device to render the first image frame including the model corresponding to the semi-transparent particles, and the first image frame being a first preset frame instructing the electronic device to render by the application, the electronic device renders and displays the second image frame; The step of rendering and displaying the fourth image frame in response to the second rendering instruction includes: In response to the second rendering instruction instructing the electronic device to render the third image frame, which includes a model corresponding to the semi-transparent particles, and the third image frame is a second preset frame that the application instructs the electronic device to render, the electronic device renders and displays the fourth image frame; Wherein, the first preset frame is an odd-numbered frame and the second preset frame is an even-numbered frame; or the first preset frame is an even-numbered frame and the second preset frame is an odd-numbered frame; or... The first preset frame is the (k*m+1)th image frame rendered by the electronic device at the instruction of the application, where m is an integer taking values sequentially from {0, 1, 2, 3, ..., M}, M is ≥0 and M is a non-negative integer, k ≥3 and k is a positive integer, and the second preset frame is any frame other than the first preset frame; or... The second preset frame is the k*nth image frame rendered by the electronic device at the instruction of the application, where n is a positive integer taking values sequentially in {1, 2, 3, ..., N}, N > 0, N is a positive integer, k ≥ 3, k is a positive integer, and the first preset frame is any frame other than the second preset frame.
4. The method according to claim 1, characterized in that, The step of rendering and displaying the second image frame in response to the first rendering instruction includes: In response to the first rendering instruction instructing the electronic device to render a first image frame including a model corresponding to the semi-transparent particles, and at least one of the consecutive x image frames rendered by the electronic device before the first image frame does not include the model corresponding to the semi-transparent particles, the electronic device renders and displays the second image frame. The step of rendering and displaying the fourth image frame in response to the second rendering instruction includes: In response to the second rendering instruction instructing the electronic device to render the third image frame, which includes the model corresponding to the semi-transparent particles, and the electronic device rendering x consecutive image frames preceding the third image frame all include the model corresponding to the semi-transparent particles, the electronic device renders and displays the fourth image frame.
5. The method according to any one of claims 1-4, characterized in that, The second image frame includes the first opaque model and the model corresponding to the first semi-transparent particle, including: the second image frame includes the first opaque model and the third opaque model corresponding to the first semi-transparent particle.
6. The method according to any one of claims 1-4, characterized in that, The electronic device includes a preset graphics library, a central processing unit (CPU), a graphics processing unit (GPU), and a display screen; the step of rendering and displaying a second image frame in response to the first rendering instruction includes: In response to the first rendering instruction, the CPU calls the rendering interface of the preset graphics library and instructs the GPU to render the second image frame, which includes the model corresponding to the first opaque model and the first semi-transparent particle. The GPU renders the second image frame and sends the second image frame to the display screen; The display screen shows the second image frame.
7. The method according to claim 6, characterized in that, The step of rendering and displaying the fourth image frame in response to the second rendering instruction includes: In response to the second rendering instruction, the CPU calls the rendering interface of the preset graphics library and instructs the GPU to render the fourth image frame including the second opaque model. The GPU renders the fourth image frame and sends the fourth image frame to the display screen; The display screen shows the fourth image frame.
8. The method according to any one of claims 1-4, characterized in that, Prior to rendering and displaying the fourth image frame in response to the second rendering instruction, the method further includes: The electronic device determines that both its display frame rate and rendering frame rate are greater than a preset frame rate.
9. The method according to any one of claims 1-4, characterized in that, The application is a preset application, which includes game applications, video applications, weather applications, or map applications.
10. An image display method, characterized in that, The method is applied to an electronic device, and the method includes: Display a first image frame; wherein the first image frame is rendered in response to a first rendering instruction, the first rendering instruction instructing an electronic device to render an image frame including a first opaque model and a model corresponding to a first semi-transparent particle, the first image frame including the first opaque model and the model corresponding to the first semi-transparent particle. Display a second image frame; wherein the second image frame is rendered in response to a second rendering instruction, the second rendering instruction instructing the electronic device to render an image frame including the model corresponding to the second opaque model and the second semi-transparent particle, the second image frame including the second opaque model but not including the model corresponding to the second semi-transparent particle; the second image frame is the next frame image of the first image frame rendered as instructed by the application.
11. The method according to claim 10, characterized in that, The first image frame is a first preset frame displayed by the electronic device, and the second image frame is a second preset frame displayed by the electronic device; Wherein, the first preset frame is an odd-numbered frame and the second preset frame is an even-numbered frame; or the first preset frame is an even-numbered frame and the second preset frame is an odd-numbered frame; or... The first preset frame is the (k*m+1)th image frame displayed by the electronic device, where m is an integer taking values sequentially from {0, 1, 2, 3, ..., M}, M≥0, M is a non-negative integer, and k≥3, k is a positive integer. The second preset frame is any frame other than the first preset frame; or... The second preset frame is the k*nth image frame displayed by the electronic device, where n is a positive integer taking values sequentially from {1, 2, 3, ..., N}, N > 0, N is a positive integer, k ≥ 3, k is a positive integer, and the first preset frame is any frame other than the second preset frame.
12. The method according to claim 10 or 11, characterized in that, The first image frame includes a first opaque model and a model corresponding to the first semi-transparent particle, including: the first image frame includes the first opaque model and a third opaque model corresponding to the first semi-transparent particle.
13. The method according to claim 10 or 11, characterized in that, The display frame rate of the electronic device is greater than the preset frame rate.
14. An electronic device, characterized in that, The electronic device includes: a display screen, a processor, and a memory; the display screen and the memory are respectively coupled to the processor. The display screen is used to display the interface of the electronic device; the memory stores computer program code, which includes computer instructions, and when the computer instructions are executed by the processor, the electronic device performs the method as described in any one of claims 1-13.
15. A computer-readable storage medium, characterized in that, Includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1-13.
Citation Information
Patent Citations
Image rendering method and electronic equipment
CN114210055A