Rendering method and electronic device

By only moving the position of the two-dimensional patch in the prediction frame whose shape remains unchanged and the relative position of the vertices remains unchanged during the rendering process, the problem of blur in the prediction frame in the existing technology is solved, user experience is improved, and jitter is reduced.

WO2024174655A1PCT designated stage expired Publication Date: 2024-08-29HONOR DEVICE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/135910
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-02-21
Filing Date
2023-12-01
Publication Date
2024-08-29

AI Technical Summary

Technical Problem

In the rendering process of the existing technology, the two-dimensional patch with unchanged shape and unchanged relative position of the vertices is blurred in the predicted frame but clear in the real frame, causing the user to detect the difference between the predicted frame and the real frame, reducing the user experience.

Method used

By obtaining the rendering parameter information and absolute coordinates of the patch in the real frame, it is judged whether the target patch is within a certain range. Only the two-dimensional patch whose shape remains unchanged and the relative position of the vertices remains unchanged moves its position in the predicted frame, not the The displayed content is interpolated or moved to ensure that the displayed content in the predicted frame is consistent with the real frame.

Benefits of technology

It effectively reduces the jitter of two-dimensional patches in prediction frames, improves user experience, and ensures the clarity of patches with unchanged shapes and unchanged relative positions of vertices in prediction frames.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023135910_29082024_PF_FP_ABST
    Figure CN2023135910_29082024_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present application are a rendering method and an electronic device, which are used for reducing the jitter of display content of a two-dimensional patch in a predictive frame. The rendering method comprises: acquiring rendering parameter information of a first patch in a first real frame, absolute coordinates of the first patch, rendering parameter information of a second patch in a second real frame and absolute coordinates of the second patch, wherein the first patch and the second patch refer to two-dimensional patches which are shape invariant and relative positions of vertices of which are invariant; if the rendering parameter information of the first patch and the rendering parameter information of the second patch are the same, and the absolute coordinates of the first patch and the absolute coordinates of the second patch are within a certain range, determining absolute coordinates of a target patch according to the absolute coordinates of the first patch and the absolute coordinates of the second patch, wherein the target patch is located in a predictive frame which is obtained on the basis of the first real frame and the second real frame; and rendering the target patch according to the absolute coordinates and rendering parameter information of the target patch.
Need to check novelty before this filing date? Find Prior Art

Description

Rendering method and electronic device

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on February 21, 2023, with application number 202310203005.3 and invention name “Rendering Method and Electronic Device”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of image processing, and in particular to a rendering method and electronic device. Background Art

[0003] With the rapid development of electronic games, the rendering process of game engines has become increasingly complex and resource-intensive. Currently, the mainstream approach is to insert a predicted frame between or after rendering two adjacent real frames to reduce rendering overhead. In existing technologies, the predicted frame is generated by interpolating or shifting the two real frames pixel by pixel.

[0004] For two-dimensional patches in an image whose shape and relative coordinates of vertices remain unchanged (i.e., the displayed content remains unchanged), such as the text (XXX), icon (smiley face icon), and health bar on the head of a game character in the electronic game shown in Figure 1, if these patches are also interpolated or moved according to pixel points, they will cause them to be blurred in the predicted frame but clear in the real frame (i.e., jitter). Users can clearly perceive the difference between the predicted frame and the real frame, which greatly reduces the user experience.

[0005] Summary of the Invention

[0006] Embodiments of the present application provide a rendering method and an electronic device for reducing jitter of two-dimensional surface display content in a predicted frame.

[0007] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:

[0008] In a first aspect, a rendering method is provided, including: obtaining rendering parameter information of a first facet in a first real frame, the absolute coordinates of the first facet, rendering parameter information of a second facet in a second real frame, and the absolute coordinates of the second facet, wherein the first real frame and the second real frame are adjacent real frames; the first facet and the second facet refer to two-dimensional faces whose shapes remain unchanged and whose relative positions of vertices remain unchanged; if the rendering parameter information of the first facet and the rendering parameter information of the second facet are the same, and the absolute coordinates of the first facet and the absolute coordinates of the second facet are within a certain range, then determining the absolute coordinates of a target facet according to the absolute coordinates of the first facet and the absolute coordinates of the second facet, the target facet being located in a predicted frame obtained based on the first real frame and the second real frame; and rendering the target facet according to the absolute coordinates of the target facet and the rendering parameter information.

[0009] The rendering method provided in the embodiment of the present application, for two-dimensional patches whose shapes and relative positions of vertices remain unchanged (in essence, the displayed content remains unchanged), in the process of obtaining a predicted frame based on two real frames, only the moving position of such patches is predicted in the predicted frame, and the display content of such patches is not interpolated or moved according to the pixels. The display content of such patches in the predicted frame still uses the display content in the real frame. This can ensure that such patches are also very clear in the predicted frame, reducing the jitter of the display content of the two-dimensional patches in the predicted frame.

[0010] In one possible implementation, the rendering parameter information for the first patch or the rendering parameter information for the second patch includes at least one of the following information: texture coordinates mapped to each vertex of the patch, an identifier of the program to which the patch belongs, and the number of vertices of the patch. Two patches being identical means that these parameters are identical for both patches.

[0011] In one possible implementation, the vertex shader source code includes facet attribute information, which indicates whether the facet is a two-dimensional facet with a constant shape and constant relative positions of vertices. One approach is to use the facet attribute information to determine whether the facet is a two-dimensional facet with a constant shape and constant relative positions of vertices.

[0012] In one possible implementation, determining the absolute coordinates of the target patch based on the absolute coordinates of the first patch and the absolute coordinates of the second patch includes smoothing the absolute coordinates of the first patch and the absolute coordinates of the second patch to obtain the absolute coordinates of the target patch, so that the movement of a two-dimensional patch whose shape and relative positions of vertices remain unchanged in the predicted frame and the real frame is relatively smooth.

[0013] In one possible implementation, when the predicted frame is between the first and second real frames, the absolute coordinates P of the target patch are obtained using the following formula: P = (P1*W1+P2*W2) / (W1+W2), where P1 is the absolute coordinate of the first patch, P2 is the absolute coordinate of the second patch, and W1 and W2 are weight coefficients. This implementation is applicable to interpolated frames.

[0014] In a possible implementation, w1 and w2 are equal, and the target patch is located between the first patch and the second patch.

[0015] In one possible implementation, when the predicted frame is located after the first and second real frames, the absolute coordinates P of the target patch are obtained using the following formula: P = P2 + (P2 - P1) * W, where P1 is the absolute coordinates of the first patch, P2 is the absolute coordinates of the second patch, and W is the weight coefficient. This implementation is applicable to extrapolated frames.

[0016] In a second aspect, an electronic device is provided, comprising a processor and a memory, wherein instructions are stored in the memory, and when the processor executes the instructions, the method described in the first aspect and any embodiment thereof is executed.

[0017] In a third aspect, a computer-readable storage medium is provided, comprising instructions, which, when executed on an electronic device, enable the electronic device to execute the method as described in the first aspect and any embodiment thereof.

[0018] In a fourth aspect, a computer program product comprising instructions is provided. When the instructions are executed on the electronic device, the electronic device executes the method as described in the first aspect and any embodiment thereof.

[0019] In a fifth aspect, a chip system is provided, which includes a processor for supporting an electronic device in implementing the functions described in the first aspect. In one possible design, the device further includes an interface circuit, which can be used to receive signals from other devices (such as a memory) or send signals to other devices (such as a communication interface). The chip system may include a chip and may also include other discrete components.

[0020] The technical effects of the second to fifth aspects refer to the technical effects of the first aspect and any of its embodiments and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] FIG1 is a schematic diagram of a two-dimensional patch with a constant shape and constant relative coordinates of vertices provided by an embodiment of the present application;

[0022] FIG2 is a schematic diagram of three-dimensional modeling by splicing multiple facets provided in an embodiment of the present application;

[0023] FIG3 is a schematic diagram of a texture mapping provided in an embodiment of the present application;

[0024] FIG4 is a schematic diagram of an interpolated frame and an extrapolated frame provided in an embodiment of the present application;

[0025] FIG5 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0026] FIG6 is a schematic diagram of a software architecture for running an electronic device provided in an embodiment of the present application;

[0027] FIG7 is a schematic diagram of a flow chart of a rendering method provided in an embodiment of the present application;

[0028] FIG8 is a schematic diagram of a facet provided by an embodiment of the present application in which the shape, relative positions of vertices, and viewing angle do not change;

[0029] FIG9 is a schematic diagram of the absolute coordinate relationship between a target patch, a first patch, and a second patch during an interpolation frame provided by an embodiment of the present application;

[0030] FIG10 is a schematic diagram of the absolute coordinate relationship between a target patch, a first patch, and a second patch during an extrapolation frame according to an embodiment of the present application;

[0031] FIG11 is a schematic diagram of a flow chart of another rendering method provided in an embodiment of the present application;

[0032] FIG12 is a schematic diagram of a flow chart of another rendering method provided in an embodiment of the present application;

[0033] FIG13 is a schematic structural diagram of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0034] First, some concepts involved in this application are described.

[0035] The terms "first", "second", etc. involved in the embodiments of the present application are only used to distinguish features of the same type and cannot be understood as indicating relative importance, quantity, order, etc.

[0036] The terms "exemplary" or "for example" in the embodiments of this application are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0037] The terms "coupling" and "connection" involved in the embodiments of this application should be understood in a broad sense. For example, they may refer to a physical direct connection, or an indirect connection achieved through electronic devices, such as a connection achieved through resistors, inductors, capacitors or other electronic devices.

[0038] Graphics rendering engine: A graphics rendering engine is used to model objects in an image, then render the model, adding color, lighting, and shadows, and finally displaying it on the screen. Currently, mainstream graphics rendering engines include Open Graphics Library (OpenGL), Metal, Vulkan, and DirectX. This application uses OpenGL as an example, but is not intended to be limiting.

[0039] OpenGL (Open Graphics Library) is a cross-language, cross-platform application programming interface (API) for rendering two-dimensional (2D) or three-dimensional (3D) vector graphics. OpenGL is commonly used in computer-aided design (CAD), virtual reality (VR), augmented reality (AR), scientific visualization programs, and video game development. The examples in this application use mobile games as an example, but are not intended to be limiting.

[0040] A shader is an editable program used to render images. Unless otherwise specified, the shaders described in this application are all based on OpenGL shaders. OpenGL shaders include vertex shaders and fragment shaders. Vertex shaders are primarily responsible for calculating the geometric relationships between vertices, while fragment shaders are primarily responsible for calculating the color of patches (more on patches below). Because shaders are editable, a variety of image effects can be achieved without being limited by the graphics card's fixed rendering pipeline.

[0041] The vertex shader is essentially a program code that is called at each vertex to process the data of each vertex (such as vertex coordinates, normals, colors, and texture coordinates). For example, it can perform vertex coordinate transformation, texture coordinate generation and transformation, lighting, color material application, etc. In other words, the program in the main function of the vertex shader must be executed once for each vertex.

[0042] Absolute vertex coordinates: In OpenGL, all objects are located in 3D space, but the screen is composed of 2D pixels. Therefore, OpenGL converts the 3D coordinates of the vertex into 2D coordinates that are suitable for the screen through various transformations. Finally, the vertex's coordinates in screen space are called its absolute coordinates. The OpenGL shader language provides the following predefined variables for vertex shaders: the graphics library position variable (gl_Position), which represents the absolute coordinates of the vertex in screen space.

[0043] Absolute coordinates of the face: Since the face includes multiple vertices, the coordinates of each vertex in the face are maintained in the form of an array. Therefore, for the convenience of description, this application exemplarily uses the coordinates of the first vertex in the array in the face as the absolute coordinates of the face.

[0044] As shown in Figure 2, the surface of an object can be modeled in three dimensions by stitching together multiple basic shapes (such as triangles). Each basic shape is called a patch, and the more patches there are, the more detailed the modeling. A fragment shader is the code that runs at each pixel on each patch. It calculates and fills the color of each pixel and can also perform operations such as interpolation, texture mapping, texture application, and color summation on the pixels.

[0045] Texture, texture coordinates, and texture mapping: To make rendered objects more realistic, on the one hand, we can use more patches to model the object surface. On the other hand, as shown in Figure 3, we can map the coordinates of the vertices of the patch on the object surface to the coordinates of the modeled object surface (texture coordinates), so that the corresponding texture is displayed on the patch. This process is called texture mapping, and texture coordinates are represented using the UV coordinate system. This not only makes the rendered model surface richer in detail, but is also more convenient and efficient.

[0046] OpenGL shaders are written in the OpenGL shading language (GLSL). Since shaders are standalone programs, the shader source code can be stored as a separate script for application calls, or it can be called directly in memory as a string. After the shader source code is compiled, it is converted into a shader object, and then multiple shader objects are linked together to form a shader program. The sender's shader declares an output variable A, and the receiver's shader declares an input variable A. When compiling and linking, the two shaders with the same name A are linked together.

[0047] A uniform variable is a special variable in a shader program that can be accessed and remains consistent throughout the execution of the shader program.

[0048] The viewport is a rectangular area in the window used to display graphics.

[0049] Interpolation: As shown in Figure 4, in the prior art, after rendering two adjacent real frames, a predicted frame is inserted between the two real frames (the interpolated frame shown in Figure 4A) or after the two real frames (the interpolated frame shown in Figure 4B) to reduce rendering overhead. The predicted frame is obtained by interpolating or shifting the two real frames according to the pixels. In this process, the type of facets is not distinguished. For two-dimensional facets whose shapes and relative positions of vertices in the image do not change, if they are also interpolated or shifted according to the pixels, these facets will be blurred in the predicted frame but clear in the real frame (i.e., jitter will occur). Users can clearly perceive the difference between the predicted frame and the real frame, which greatly reduces the gaming experience.

[0050] The rendering method and electronic device provided in the embodiments of the present application predict only the position of the movement of two-dimensional patches whose shapes and relative positions of vertices remain unchanged (essentially, the displayed content remains unchanged) in the predicted frame. The displayed content of such patches is not interpolated or moved pixel by pixel. The displayed content in the predicted frame still uses the content displayed in the real frame. This ensures that these patches are also very clear in the predicted frame, reducing the jitter of the displayed content of the two-dimensional patches in the predicted frame. This can be applied not only to electronic games (such as mobile games), but also to CAD, VR, AR, scientific visualization programs, and the like.

[0051] As shown in Figure 5, the electronic device 101 provided in the embodiment of the present application can be a device with a display function, and the electronic device 101 can be mobile or fixed. The electronic device 101 can be deployed on land (for example, indoors or outdoors, handheld or vehicle-mounted, etc.), can be deployed on the water (for example, a ship, etc.), and can also be deployed in the air (for example, an airplane, etc.). The electronic device 101 can be called user equipment (UE), access terminal, terminal unit, subscriber unit, terminal station, mobile station (MS), mobile station, terminal agent or terminal device, etc. For example, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a virtual reality device, an augmented reality device, etc. The embodiment of the present application does not limit the specific type and structure of the electronic device. A possible structure of the electronic device is described below.

[0052] Taking the electronic device as a mobile phone as an example, the electronic device 101 may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a power management module 240, a battery 241, a wireless charging coil 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, a sensor module 280, a button 290, a motor 291, an indicator 292, a camera 293, a display screen 294 and a subscriber identification module (SIM) card interface 295, etc.

[0053] Among them, the sensor module 280 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.

[0054] It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the electronic device 101. In other embodiments of the present application, the electronic device 101 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0055] The processor 210 may include one or more processing units, for example: the processor 210 may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processing unit (CPU), an application processor (AP), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a baseband processor, and a neural-network processing unit (NPU). Among them, different processing units may be independent devices or integrated into one or more processors. For example, the processor 210 may be an application processor AP. Alternatively, the processor 210 may be integrated into a system on chip (SoC). Alternatively, the processor 210 may be integrated into an integrated circuit (IC) chip. The processor 210 may include an analog front end (AFE) and a microcontroller unit (MCU) in an IC chip. The processor 210 may serve as the nerve center and command center of the electronic device 101. The processor 210 may generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.

[0056] Processor 210 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 210 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 210. If processor 210 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 210 latency, and thus improves system efficiency.

[0057] In some embodiments, the processor 210 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a USB interface.

[0058] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 101. In other embodiments of the present application, the electronic device 101 may also adopt a different interface connection method from the above embodiment, or a combination of multiple interface connection methods.

[0059] The power management module 240 is configured to receive charging input from a charger. The charger may be a wireless charger (e.g., a wireless charging base for the electronic device 101 or other device capable of wirelessly charging the electronic device 101) or a wired charger. For example, the power management module 240 may receive charging input from a wired charger via the USB interface 230. The power management module 240 may also receive wireless charging input via the wireless charging coil 242 of the electronic device.

[0060] The power management module 240 can not only charge the battery 241 but also power the electronic device. The power management module 240 receives input from the battery 241 and provides power to the processor 210, the internal memory 221, the external memory interface 220, the display 294, the camera 293, and the wireless communication module 260. The power management module 240 can also be used to monitor parameters such as the battery capacity, battery cycle count, and battery health status (leakage, impedance) of the battery 241. In other embodiments, the power management module 240 can also be provided in the processor 210.

[0061] The wireless communication function of the electronic device 101 can be implemented through the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modem processor, and the baseband processor.

[0062] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 101 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0063] The mobile communication module 250 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 101. The wireless communication module 260 can provide solutions for wireless communications including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., applied to the electronic device 101. In some embodiments, the antenna 1 of the electronic device 101 is coupled to the mobile communication module 250, and the antenna 2 is coupled to the wireless communication module 260, so that the electronic device 101 can communicate with the network and other devices through wireless communication technology.

[0064] Electronic device 101 implements display functionality through a GPU, display screen 294, and an application processor. A GPU is a microprocessor for image processing that connects display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations and is used for GPU rendering. Processor 210 may include one or more GPUs that execute program instructions to generate or modify display information.

[0065] The display screen 294 is used to display images, videos, etc. The display screen 294 includes a display panel. In some embodiments, the electronic device 101 may include one or N display screens 294, where N is a positive integer greater than one.

[0066] The electronic device 101 can implement a shooting function through an ISP, a camera 293, a video codec, a GPU, a display 294, and an application processor. The ISP is used to process data fed back by the camera 293. In some embodiments, the ISP can be set in the camera 293. The camera 293 is used to capture still images or videos. In some embodiments, the electronic device 101 can include one or N cameras 293, where N is a positive integer greater than 1. Exemplarily, the cameras in the embodiments of the present application include a wide-angle camera and a main camera.

[0067] The external memory interface 220 can be used to connect an external memory card, such as a micro SanDisk (Micro SD) card, to expand the storage capacity of the electronic device 101. The external memory card communicates with the processor 210 via the external memory interface 220 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0068] The internal memory 221 can be used to store computer executable program code, which includes instructions. The processor 210 executes various functional applications and data processing of the electronic device 101 by running the instructions stored in the internal memory 221. In addition, the internal memory 221 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0069] The memory involved in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus RAM (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0070] The electronic device 101 can implement audio functions such as music playback and recording through the audio module 270 , the speaker 270A, the receiver 270B, the microphone 270C, the headphone jack 270D, and the application processor.

[0071] The audio module 270 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. In some embodiments, the audio module 270 can be set in the processor 210, or some functional modules of the audio module 270 can be set in the processor 210. The speaker 270A, also known as the "speaker", is used to convert audio electrical signals into sound signals. The receiver 270B, also known as the "earpiece", is used to convert audio electrical signals into sound signals. The microphone 270C, also known as the "microphone" or "microphone", is used to convert sound signals into electrical signals. The electronic device 101 can be provided with at least one microphone 270C. The headphone jack 270D is used to connect wired headphones. The headphone jack 270D can be a USB interface 230, or it can be a 3.5mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0072] Keys 290 include a power button, a volume button, and the like. Keys 290 can be mechanical keys or touch-sensitive keys. Electronic device 101 can receive key inputs and generate key signal inputs related to user settings and function control of electronic device 101. Motor 291 can generate vibration prompts. Motor 291 can be used for incoming call vibration prompts or for touch vibration feedback. Indicator 292 can be an indicator light that can be used to indicate charging status, power level changes, messages, missed calls, notifications, and the like. SIM card interface 295 is used to connect a SIM card. A SIM card can be connected to or disconnected from electronic device 101 by inserting or removing it from SIM card interface 295. Electronic device 101 can support one or N SIM card interfaces, where N is a positive integer greater than one. SIM card interface 295 can support nano SIM cards, micro SIM cards, SIM cards, and the like. In some embodiments, the electronic device 101 uses an embedded SIM (eSIM) card. The eSIM card can be embedded in the electronic device 101 and cannot be separated from the electronic device 101.

[0073] The processor 210 or GPU executes the rendering method provided by the embodiment of the present application by executing the program and instructions stored in the internal memory 221. The program run by the processor 210 can be based on an operating system, such as the Android operating system. Apple (iOS) operating system Windows operating system, etc.

[0074] As shown in FIG6 , the program executed by the processor 210 is based on the Android operating system. For example, the programs run by the processor 210 are layered according to their functions, and may include an application layer, a framework layer, a local layer, a kernel layer, and a driver layer.

[0075] The application layer can include various applications that require GPU rendering, such as CAD, video games, AR / VR applications, scientific visualization programs, etc.

[0076] The framework layer is used to provide application programming interfaces (APIs) and system resource services to applications in the application layer, such as a GPU rendering API. The rendering method involved in this application can be implemented in the framework layer on the CPU side or in the GPU. For example, the implementation in the framework layer on the CPU side is used as an example for description, but it is not intended to be limited to this.

[0077] The native layer can provide static link libraries or dynamic link libraries for API calls in the framework layer, for example, providing static link libraries or dynamic link libraries to the GPU rendering API in the framework layer.

[0078] The kernel layer includes the operating system (OS) kernel, which manages the system's processes, memory, drivers, file systems, and network systems.

[0079] The driver layer is used to drive the hardware resources of the hardware layer. The driver layer may include GPU drivers.

[0080] As shown in FIG7 , for a two-dimensional face with unchanged shape and unchanged relative positions of vertices (essentially unchanged display content), the rendering method provided in an embodiment of the present application includes:

[0081] S101: Obtain rendering parameter information and absolute coordinates of a first surface in a first real frame, and rendering parameter information and absolute coordinates of a second surface in a second real frame.

[0082] The first real frame and the second real frame are adjacent real frames; both the first patch and the second patch refer to two-dimensional patches with unchanged shapes and unchanged relative positions of vertices. Hereinafter, this type of patch is simply referred to as a stable patch. Among them, the relative position of vertices refers to the relative positions among the vertices in the same patch. For example, for the patches such as the text (XXX), icon (smiling face icon), health bar, etc. on the game character's head in the video game shown in FIG. 8, no matter whether the displayed game character makes near and far view zooming (A), turns around (B), moves (C), or changes the posture (D), the shapes, relative positions of vertices, and viewing angles of these patches will not change, that is, the displayed content remains unchanged.

[0083] Regarding the absolute coordinates of the patch, see the previous description and will not be elaborated here. The rendering parameter information of the patch includes at least one of the following information: the texture coordinates mapped by each vertex of the patch, the identifier of the program to which the patch belongs, and the number of vertices of the patch.

[0084] Step S101 can be executed during the process of rendering the real frame.

[0085] S102. If the rendering parameter information of the first patch is the same as the rendering parameter information of the second patch, and the absolute coordinates of the first patch and the absolute coordinates of the second patch are within a certain range, then determine the absolute coordinates of the target patch according to the absolute coordinates of the first patch and the absolute coordinates of the second patch.

[0086] The target patch is located in the predicted frame obtained based on the first real frame and the second real frame, and describes the same content as the first patch and the second patch (such as the same text, the same icon, the same health bar, etc.).

[0087] First, determine the same content described by the first patch and the second patch in two adjacent real frames. If the texture coordinates mapped by each vertex in the first patch are the same as the texture coordinates mapped by each vertex in the second patch, the identifier of the program to which the first patch belongs is the same as the identifier of the program to which the second patch belongs, and the number of vertices of the first patch is the same as the number of vertices of the second patch. On this basis, if the difference between the absolute coordinate P1 of the first patch and the absolute coordinate P2 of the second patch is less than the distance threshold (that is, |P1 - P2| < Th), then it can be determined that the first patch and the second patch describe the same content in two adjacent real frames.

[0088] Secondly, the difference between the absolute coordinate P1 (i.e., gl_Position) of the first patch and the absolute coordinate P2 of the second patch is the movement amount of the second patch relative to the first patch. Therefore, the absolute coordinates of the first patch and the absolute coordinates of the second patch can be smoothed to obtain the absolute coordinates of the target patch in the predicted frame, so that the movement of the two-dimensional patch with unchanged shape and unchanged relative position of vertices in the predicted frame and the real frame is relatively smooth.

[0089] For an interpolated frame (i.e., a predicted frame located between a first real frame and a second real frame), as shown in FIG9 , the absolute coordinates P of the target patch can be obtained using the following formula: P = (P1*W1+P2*W2) / (W1+W2), where P1 is the absolute coordinate of the first patch, P2 is the absolute coordinate of the second patch, and W1 and W2 are weight coefficients. In particular, W1 and W2 can be equal, in which case the target patch is located between the first and second patches.

[0090] For the interpolated frame (i.e., the predicted frame is located after the first real frame and the second real frame), as shown in Figure 10, the absolute coordinate P of the target patch can be obtained by the following formula: P = P2 + (P2-P1) * W, where P1 is the absolute coordinate of the first patch, P2 is the absolute coordinate of the second patch, and W is the weight coefficient.

[0091] Step S102 may be performed during the process of rendering a real frame or may be performed during the process of rendering a predicted frame.

[0092] S103: Render the target patch according to the absolute coordinates of the target patch and the rendering parameter information.

[0093] Since the rendering parameter information of the first patch and the rendering parameter information of the second patch are the same, the rendering parameter information of the target patch also uses the same rendering parameter information. When rendering the target patch, the target patch is rendered according to the absolute coordinates of the target patch and the rendering parameter information, and then drawn onto the main scene of the predicted frame. In other words, at the absolute coordinates of the target patch, the texture coordinates mapped to each vertex of the patch are used for rendering.

[0094] Step S103 may be performed during the process of rendering a real frame or may be performed during the process of rendering a predicted frame.

[0095] The rendering method provided in the embodiment of the present application, for two-dimensional patches whose shapes and relative positions of vertices remain unchanged (in essence, the displayed content remains unchanged), in the process of obtaining a predicted frame based on two real frames, only the moving position of such patches is predicted in the predicted frame, and the display content of such patches is not interpolated or moved according to the pixels. The display content of such patches in the predicted frame still uses the display content in the real frame. This can ensure that such patches are also very clear in the predicted frame, reducing the jitter of the display content of the two-dimensional patches in the predicted frame.

[0096] The above rendering method is described below in conjunction with the complete rendering process of the real frame and the predicted frame. As shown in FIG11 , the rendering method includes:

[0097] S201. Obtain image rendering source code.

[0098] As shown in S301 in Figure 12, for the rendering workflow, the GPU rendering API of the framework layer loads the image rendering source code (including the vertex shader source code and the fragment shader source code) through the shader source code acquisition function (glShaderSource), and obtains and saves the real frame information from it. The real frame information includes but is not limited to the attribute information, absolute coordinates (i.e., gl_Position), and rendering parameter information of each face in the real frame. Regarding the absolute coordinates (i.e., gl_Position) and rendering parameter information of the face, please refer to the previous description and will not be repeated here.

[0099] The vertex shader source code includes patch attribute information, indicating whether the patch is a two-dimensional patch with no depth information (i.e., it does not change with viewing angle), a constant shape, and constant relative positions of vertices (i.e., the displayed content remains unchanged). This is the aforementioned stable patch. Therefore, when interpolating two adjacent real frames to obtain a predicted frame, for such stable patches, there is no need to use the existing method of pixel-by-pixel interpolation or shifting to obtain the patch in the predicted frame.

[0100] In one embodiment, in the image rendering source code, the attribute information of the face can be set to word to indicate that the face is drawn with text, the attribute information of the face can be set to icon to indicate that the face is drawn with an icon, the attribute information of the face can be set to blood to indicate that the face is drawn with a health bar, etc., thereby indicating that the face is a stable face.

[0101] In another embodiment, the stable patch is usually drawn after the main scene of the real frame or the predicted frame is drawn. Therefore, the patch indicated to be drawn after the main scene drawing is completed in the image rendering source code is the stable patch.

[0102] S202. Replace the source code of the vertex shader of the stable patch and compile it.

[0103] As shown in S302 in FIG12 , for the prediction workflow, first determine whether each patch is a stable patch based on its attribute information. For stable patches, replace the source code of its vertex shader and compile it; for other patches, compile it directly.

[0104] It should be noted that the vertex shader source code for all facets other than the stable facets in the image rendering source code is not modified and is still compiled and rendered according to the original logic. For example, the real frame is rendered according to the rendering method in the prior art, and two adjacent real frames are interpolated according to the interpolation method in the prior art to obtain a predicted frame and render it. This application will not elaborate on this.

[0105] As shown in S303 in Figure 12, after the application in the CPU (such as the engine of an electronic game) is started, it passes the rendering command to the framework layer in the CPU, and then the CPU transmits a drawing initiation (DrawCall) command to the GPU to instruct the GPU to render (including real frames and predicted frames).

[0106] S203: If the real frame is rendered, all the faces in the real frame are rendered and then drawn onto the main scene of the real frame, thus obtaining the real frame.

[0107] The real frame and the predicted frame are cached in different frame buffers. For example, the real frame is cached in the first frame buffer and the predicted frame is cached in the second frame buffer. Alternatively, the real frame and the predicted frame are cached in two different areas of the same frame buffer. For example, if the size of a single frame is A*B (A is width and B is height), the real frame can be cached in the left half of the 2A*B frame buffer, and the predicted frame can be cached in the right half of the frame buffer. The rendering parameter information and absolute coordinates of each facet are stored in a data list. The data list can be located in the shader storage buffer object (SSBO) of the GPU, and the real frame and the predicted frame are bound to different SSBOs respectively; alternatively, the data list can also be located in the CPU, which is not limited in this application.

[0108] As shown in S304 in FIG12 , for a real frame, the prediction workflow sets the rendering flag of the frame through a uniform variable to indicate that the frame is a real frame, so that the rendering workflow can distinguish whether it is rendering a real frame or a predicted frame during rendering.

[0109] As shown in S305 in Figure 12, for the rendering workflow, the GPU rendering API uses the patch drawing function (glDrawElements) to render each patch in the real frame (including the stable patch). Optionally, when the real frame and the predicted frame are cached in two different areas of the same frame buffer, the viewport can be set to indicate which area (e.g., the left half) of the real frame is rendered.

[0110] In the real frame, the rendering and drawing of the stable patches, as well as the rendering and drawing of other patches, can continue in the original source code without modification. Alternatively, as shown in S307 in Figure 12, after all the stable patches in the real frame are rendered, they are drawn onto the main scene of the real frame to obtain the real frame.

[0111] In addition, the predicted frame needs to be predicted. For other patches in the real frame except the stable patch, the preset frame can still be obtained by interpolating or moving pixels in the existing technology.

[0112] S204: Obtain and store rendering parameter information and absolute coordinates of the stable patch in the real frame.

[0113] For each real frame, the rendering parameter information and absolute coordinates of the stable patch in the real frame are stored. Exemplarily, the rendering parameter information and absolute coordinates of the stable patch in the real frame can be stored in the data list of the real frame.

[0114] Since the target patch in the predicted frame will be rendered later, if the predicted frame is to be rendered, the stable patches describing the same content in the two adjacent real frames must be obtained first. Assume that the two adjacent real frames are the first real frame and the second real frame, and the first patch in the first real frame and the second patch in the second real frame are both stable patches.

[0115] During the drawing of the first real frame, after the vertex shader of the first facet is run, the original source code is run to calculate the vertices of the first facet, and the rendering parameter information and the absolute coordinates of the first facet in the first real frame are obtained and saved.

[0116] During the drawing of the second real frame, after the vertex shader of the second patch is run, the original source code is run to calculate the vertices of the second patch, and the rendering parameter information of the second patch in the second real frame and the absolute coordinates of the second patch are obtained and saved.

[0117] This step can obtain the rendering parameter information and absolute coordinates of the first patch in the first real frame, and the rendering parameter information and absolute coordinates of the second patch in the second real frame, which corresponds to step S101 described above.

[0118] S205: Predict the absolute coordinates of the stable patch in the prediction frame.

[0119] In the process of drawing the second real frame, the data list of the previous real frame is traversed to find the first facet that matches the second facet, so as to determine that the first facet and the second facet describe the same content (such as the same text, the same icon, the same health bar, etc.) in the two adjacent real frames, which corresponds to the target facet in the predicted frame. Specifically, if the rendering parameter information of the first facet and the rendering parameter information of the second facet are the same, and the absolute coordinates of the first facet and the absolute coordinates of the second facet are within a certain range, it can be determined that the first facet and the second facet describe the same content in the two adjacent real frames, and the absolute coordinates of the target facet can be determined in the predicted frame. For how to determine the absolute coordinates of the target facet, please refer to the description of step S102 and will not be repeated here.

[0120] This step corresponds to step S102 described above.

[0121] S206: Render the stable patch in the predicted frame.

[0122] Specifically, the target patch is rendered according to the absolute coordinates of the target patch and the rendering parameter information.

[0123] As shown in S306 in Figure 12, for the predicted frame, the prediction workflow will set the rendering flag of the frame through the uniform variable (Uniform) to indicate that the frame is a predicted frame. Optionally, when the real frame and the predicted frame are cached in two different areas of the same frame cache, the viewport (Viewport) can also be set to indicate in which area (for example, the right half area) the predicted frame is rendered. And the above-mentioned stable patch in the predicted frame is rendered through the patch drawing function (glDrawElements). This allows the rendering workflow to distinguish whether it is rendering a real frame or a predicted frame when rendering.

[0124] This step corresponds to step S103 described above.

[0125] S207: If the predicted frame is rendered, the rendered stable patch is drawn onto the main scene of the predicted frame, thereby obtaining the predicted frame.

[0126] Since the rendering of the target patch has been completed in the previous text, when rendering the predicted frame, the patches other than the stable patches are still rendered in the original way and drawn onto the main scene of the predicted frame. Then, the rendered target patch is superimposed and drawn onto the main scene of the predicted frame to obtain a complete predicted frame.

[0127] As shown in S308 in FIG. 12 , after completing the rendering of the main scene of the prediction frame, the prediction workflow will draw the rendered stable patch onto the main scene of the prediction frame.

[0128] As shown in Figure 13, an embodiment of the present application also provides a chip system. The chip system 60 includes at least one processor 601 and at least one interface circuit 602. At least one processor 601 and at least one interface circuit 602 can be interconnected via lines. The processor 601 is used to support the electronic device to implement the various steps in the above method embodiments, such as the methods shown in Figures 7, 11, and 12. At least one interface circuit 602 can be used to receive signals from other devices (such as memories) or send signals to other devices (such as communication interfaces). The chip system may include chips and may also include other discrete devices.

[0129] An embodiment of the present application also provides a computer-readable storage medium, which includes instructions. When the instructions are executed on the above-mentioned electronic device, the electronic device executes the various steps in the above-mentioned method embodiment, such as executing the methods shown in Figures 7, 11, and 12.

[0130] An embodiment of the present application also provides a computer program product including instructions. When the instructions are executed on the above-mentioned electronic device, the electronic device executes each step in the above-mentioned method embodiment, for example, executes the method shown in Figures 7, 11, and 12.

[0131] Regarding the technical effects of the chip system, computer-readable storage medium, and computer program product, refer to the technical effects of the previous method embodiments.

[0132] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0133] Those skilled in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0134] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and modules described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0135] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0136] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, that is, they may be located on a single device or distributed across multiple devices. Some or all of the modules may be selected to achieve the purpose of this embodiment based on actual needs.

[0137] In addition, the functional modules in the various embodiments of the present application may be integrated into one device, or each module may exist physically separately, or two or more modules may be integrated into one device.

[0138] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented using a software program, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium that can be accessed by a computer or may include one or more servers, data centers, or other data storage devices that can be integrated with the medium. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).

[0139] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A rendering method, characterized in that: include: Obtaining rendering parameter information of a first facet in a first real frame, the absolute coordinates of the first facet, and rendering parameter information of a second facet in a second real frame, and the absolute coordinates of the second facet, wherein the first real frame and the second real frame are adjacent real frames; The first face patch and the second face patch are two-dimensional face patches with unchanged shapes and unchanged relative positions of vertices; If the rendering parameter information of the first patch is the same as the rendering parameter information of the second patch, and the absolute coordinates of the first patch and the absolute coordinates of the second patch are within a certain range, determining the absolute coordinates of a target patch according to the absolute coordinates of the first patch and the absolute coordinates of the second patch, and the target patch is located in a predicted frame obtained based on the first real frame and the second real frame; The target surface is rendered according to the absolute coordinates of the target surface and the rendering parameter information.

2. The method according to claim 1, characterized in that The rendering parameter information of the first patch or the rendering parameter information of the second patch includes at least one of the following information: texture coordinates mapped to each vertex of the patch, an identifier of a program to which the patch belongs, and the number of vertices of the patch.

3. The method according to claim 1 or 2, characterized in that: The vertex shader source code includes attribute information of the patch, and the attribute information is used to indicate that the patch is a two-dimensional patch with a constant shape and constant relative positions of vertices.

4. The method according to any one of claims 1 to 3, characterized in that: The determining the absolute coordinates of the target surface patch according to the absolute coordinates of the first surface patch and the absolute coordinates of the second surface patch comprises: The absolute coordinates of the first face patch and the absolute coordinates of the second face patch are smoothed to obtain the absolute coordinates of the target face patch.

5. The method according to claim 4, characterized in that When the predicted frame is located between the first real frame and the second real frame, the absolute coordinate P of the target patch is obtained by the following formula: P = (P1*W1+P2*W2) / (W1+W2), wherein P1 is the absolute coordinate of the first patch, P2 is the absolute coordinate of the second patch, and W1 and W2 are weight coefficients.

6. The method according to claim 5, characterized in that w1 and w2 are equal.

7. The method according to claim 4, characterized in that When the predicted frame is located after the first real frame and the second real frame, the absolute coordinate P of the target patch is obtained by the following formula: P=P2+(P2-P1)*W, where P1 is the absolute coordinate of the first patch, P2 is the absolute coordinate of the second patch, and W is the weight coefficient.

8. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores instructions, and when the processor executes the instructions, the method according to any one of claims 1 to 7 is executed.

9. A computer-readable storage medium, characterized in that: The method comprises instructions, which, when executed on an electronic device, cause the electronic device to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Rendering method and electronic equipment

    CN118537467A

  • Image rendering method, image rendering device and electronic device

    CN106997610A

  • Image frame stream display method, electronic equipment and storage medium

    CN114470750A

  • Method, apparatus and computer-readable medium rendering three-dimensional (3D) graphics

    US20110199377A1

  • Image frame prediction method and electronic device

    WO2022068326A1