Image Rendering Method, Device, Computer Equipment and Readable Storage Medium
By constructing and overlaying texture images in live video rendering and rendering real-time and historical pictures in sub-rendering areas, the problems of limited special effects types and poor rendering flexibility in the prior art are solved, and flexible video rendering and time delay effects are achieved.
Patent Information
- Application Number
- CN202311385337.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-24
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2043-10-24
AI Technical Summary
The existing live video rendering scheme has limited special effects types and poor rendering flexibility, making it difficult to expand the special effects types to achieve flexible video rendering.
By constructing the texture image and texture image to be rendered, superimposing it to the sub-rendered area of the texture image to be rendered, rendering the real-time picture in one of the sub-rendered areas, and rendering the historical picture in the other sub-rendered area, thereby generating a delay effect.
It realizes extended special effects types, improves image rendering flexibility, generates time delay effects, and enhances the rendering effect of live videos.
Smart Images

Figure CN117440181B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an image rendering method, device, computer equipment and readable storage medium. Background Art
[0002] With the development of Internet technology, various live broadcast functions have also been widely popularized. With the development of video applications, it is possible to render live video frames, such as adding some live special effects to live video frames, to increase the content of the live broadcast. However, some current rendering schemes can only achieve a limited number of live special effects, and the rendering flexibility is poor. Therefore, how to expand the special effect types to flexibly render live videos is a technical problem that needs to be solved. Summary of the invention
[0003] One of the purposes of the present invention is to provide an image rendering method, apparatus, computer device and readable storage medium for expanding special effect rendering types and improving image rendering flexibility. The technical solution of the present invention can be implemented as follows:
[0004] In a first aspect, the present invention provides an image rendering method, the method comprising: constructing a texture image to be rendered, a first texture image and a second texture image, and superimposing the first texture image and the second texture image on a first sub-rendering area and a second sub-rendering area of the texture image to be rendered, respectively; wherein the texture and size of the first texture image and the second texture image are the same; storing a current video frame to be rendered in the first texture image; determining a target pixel filling area in the second sub-rendering area, and filling the target pixels in the current video frame to be rendered at locations where they coincide with a boundary line of the sub-rendering areas into the target pixel filling area, to obtain a target rendering image corresponding to the current video frame to be rendered; wherein an adjacent pixel area of the target pixel filling area stores historical target pixels corresponding to a previous video frame of the current video frame to be rendered; and rendering the target rendering image so that the second sub-rendering area on the screen generates a time-delay special effect.
[0005] In a second aspect, the present invention provides an image rendering device, comprising: a construction module, a storage module, a filling module and a rendering module; the construction module is used to construct a texture image to be rendered, a first texture image and a second texture image, and superimpose the first texture image and the second texture image on a first sub-rendering area and a second sub-rendering area of the texture image to be rendered, respectively; wherein the texture and size of the first texture image and the second texture image are the same; the storage module is used to store a current video frame to be rendered in the first texture image; the filling module is used to determine a target pixel filling area in the second sub-rendering area, and fill the target pixels in the current video frame to be rendered at the locations where they coincide with the sub-rendering area boundary line into the target pixel filling area to obtain a target rendering image corresponding to the current video frame to be rendered; wherein the adjacent pixel area of the target pixel filling area stores the historical target pixels corresponding to the previous video frame of the current video frame to be rendered; the rendering module is used to render the target rendering image so that the second sub-rendering area on the screen generates a delay special effect.
[0006] In a third aspect, the present invention provides a computer device, comprising a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the image rendering method as described in the first aspect.
[0007] In a fourth aspect, the present invention provides a readable storage medium, wherein the storage medium stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the image rendering method as described in the first aspect.
[0008] The image rendering method, device, computer equipment and readable storage medium provided by the present invention include: first constructing a texture image to be rendered and a first texture image and a second texture image for rendering, then superimposing the first texture image and the second texture image on a first sub-rendering area and a second sub-rendering area of the texture image to be rendered respectively, then storing the picture of the current video frame to be rendered in the first texture image, using the second texture image to store part of the picture information of the previous frame of the current video frame to be rendered, determining the target pixel filling area in the second sub-rendering area, and filling the target pixel at the location where the current video frame to be rendered coincides with the sub-rendering area boundary line into the target pixel filling area, obtaining the target rendering image corresponding to the current video frame to be rendered, and the adjacent pixel area of the target pixel filling area stores the historical target pixel corresponding to the previous video frame of the video frame, so that the first sub-rendering area is used to render the real-time picture, and the second sub-rendering area renders the historical picture stored in the second texture image, and finally after the target rendering image is rendered into the screen, a time delay effect is presented between the two sub-rendering areas. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0010] Figure 1 A schematic diagram of an interactive scenario of the live broadcast system provided by the present application is shown;
[0011] Figure 2 A schematic structural block diagram of a computer device provided by the present application is shown;
[0012] Figure 3 An exemplary flow chart of the image rendering method provided by the present application is shown;
[0013] Figure 4 An example diagram showing step S301 provided by an embodiment of the present invention is shown;
[0014] Figure 5 A schematic diagram of a first method of determining a target pixel filling area provided by an embodiment of the present invention;
[0015] Figure 6 Schematic diagrams showing two methods of determining target pixel filling areas provided by embodiments of the present invention;
[0016] Figure 7 A schematic diagram of pixel filling provided by an embodiment of the present invention is shown;
[0017] Figure 8 A functional module diagram of an image rendering device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0019] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0020] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0021] In the description of the present invention, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. appear to indicate an orientation or position relationship, they are based on the orientation or position relationship shown in the accompanying drawings, or are the orientation or position relationship in which the product of the invention is usually placed when used. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.
[0022] In addition, the terms “first”, “second”, etc., if used, are merely used to distinguish between the descriptions and should not be understood as indicating or implying relative importance.
[0023] It should be noted that, in the absence of conflict, the features in the embodiments of the present invention may be combined with each other.
[0024] With the continuous development of computer graphics technology, image rendering technology has been widely used. It can not only achieve exquisite image effects, but also provide users with a better interactive experience. Specifically, image rendering technology has been widely used in many fields such as game development, live streaming and virtual reality. In game development, it can achieve a realistic three-dimensional environment and natural and smooth animation effects, thereby enhancing the player's sense of immersion. In live streaming, it can provide viewers with visual enjoyment equivalent to the scene. In virtual reality devices, efficient image rendering can build a three-dimensional virtual world for users to immerse themselves in.
[0025] In addition, with the increasing popularity of video applications, before rendering the video, developers can also perform some additional processing on the original video according to the specific needs of the product, such as adding textures, special effects, etc., to achieve the customized effects required by the product. These customized effects can be directly rendered to the screen of the user's terminal device, thereby improving the user's visual and experience effects. At the same time, this also expands the application prospects of image rendering technology in the video industry.
[0026] The following embodiment of the present invention will take a live broadcast scene as an example to introduce an image rendering method provided by an embodiment of the present invention.
[0027] See also Figure 1 , Figure 1 A schematic diagram of an interactive scenario of the live broadcast system provided by the present application is shown. In some embodiments, the live broadcast system may be a live broadcast platform for, for example, Internet live broadcast. The live broadcast system may include a server, a live broadcast initiator, and a live broadcast receiver. The server may establish communication with the live broadcast receiver and the live broadcast initiator, respectively, and the server may provide live broadcast services to the live broadcast receiver and the live broadcast initiator. For example, the anchor may provide a real-time online live broadcast stream to the audience through the live broadcast initiator and transmit it to the server, and the live broadcast receiver may pull the live broadcast stream from the server.
[0028] In some implementation scenarios, the live broadcast receiving end and the live broadcast initiating end can be used interchangeably. For example, the anchor of the live broadcast initiating end can use the live broadcast initiating end to provide live video services to the audience, or watch the live videos provided by other anchors as an audience. For another example, the audience of the live broadcast receiving end can also use the live broadcast receiving end to watch the live videos provided by the anchor they follow, or provide live video services to other audiences as an anchor.
[0029] In some embodiments, the live broadcast receiving end and the live broadcast initiating end may include but are not limited to mobile devices, tablet computers, laptop computers, or any combination of two or more thereof. In some embodiments, the mobile device may include but are not limited to wearable devices, smart mobile devices, augmented reality devices, etc., or any combination thereof. In some embodiments, the smart mobile device may include but are not limited to smart phones, personal digital assistants (PDAs), gaming devices, navigation devices, or point of sale (POS) devices, etc., or any combination thereof.
[0030] In addition, in some possible implementations, there may be zero, one, or more live broadcast receiving terminals and live broadcast initiating terminals accessing the server. Figure 1 Among them, the live broadcast receiving end and the live broadcast initiating end can be installed with an Internet product for providing Internet live broadcast services. For example, the Internet product can be an application APP, a Web page, a small program, etc. related to the Internet live broadcast service used in a computer or a smart phone.
[0031] In some embodiments, the server may be a single physical server or a server group consisting of multiple physical servers for performing different data processing functions. The server group may be centralized or distributed (for example, the server may be a distributed system). In some possible implementations, if the server uses a single physical server, different logical server components may be assigned to the physical server based on different live broadcast service functions.
[0032] Understandably, Figure 1 The live broadcast system shown is only a possible example. In some other possible embodiments of the present application, the live broadcast system may also include only Figure 1 Some of the components shown may also include other components.
[0033] In e.g. Figure 1 In the live broadcast scenario shown, the anchor on the live broadcast initiator side can choose to add some rendering effects to the live broadcast screen in combination with some live broadcast requirements during the video broadcast, so as to enrich the screen content during the live broadcast and enhance the viewing experience of the audience.
[0034] For example, in some rendering schemes, the live broadcast initiator can respond to the host's rendering request, render the picture content of the live video frame, and send the rendered live video frame to the server. The live broadcast receiver can pull the rendered live video frame from the server and play it, so that the audience at the live broadcast receiver can watch the rendered live picture.
[0035] However, the live broadcast special effects that can be achieved by rendering the picture content of the live broadcast video frame at the live broadcast initiator, for example, are limited, and the rendering flexibility is poor. Therefore, how to expand the special effects type to flexibly render the live broadcast video is a technical problem that needs to be solved.
[0036] Based on this, in order to improve the defects in the above-mentioned rendering scheme, the present application provides an image rendering method that can combine different special effects in combination with timing, achieve rendering effects involving time-related special effects, expand image rendering types, and improve the flexibility of rendering operations.
[0037] See also Figure 2 , Figure 2 A schematic structural block diagram of a computer device 200 provided in the present application is shown. In some embodiments, the computer device 200 can be used as Figure 1 The live broadcast initiator in Figure 1 Servers in .
[0038] In addition, in some embodiments, the computer device 200 may include a memory 201, a processor 202, and a communication interface 203, wherein the memory 201, the processor 202, and the communication interface 203 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components may be electrically connected to each other via one or more communication buses or signal lines.
[0039] The memory 201 can be used to store software programs and modules, such as program instructions / modules corresponding to the live broadcast rendering device provided in this application. The processor 202 executes various functional applications and data processing by executing the software programs and modules stored in the memory 201, thereby executing the steps of the image rendering method provided in this application. The communication interface 203 can be used to communicate signaling or data with other node devices.
[0040] Among them, the memory 201 can be, but is not limited to, random access memory (Random Access Memory, RAM), read only memory (Read Only Memory, ROM), programmable read-only memory (Programmable Read-Only Memory, PROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable programmable read-only memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc.
[0041] The processor 202 may be an integrated circuit chip with signal processing capability. The processor 202 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0042] Understandably, Figure 2 The structure shown is for illustration only. The computer device 200 may also include Figure 2 More or fewer components as shown, or with Figure 2 Different configurations shown. Figure 2 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0043] Below Figure 2 The computer device 200 shown in the figure is used as an exemplary execution subject to exemplify the image rendering method provided by the present application; it can be understood that in some embodiments, the computer device 200 can be used as Figure 1 The live broadcast initiator in the live broadcast initiator receives the rendering parameters input by the anchor on the live broadcast initiator side and executes the image rendering method provided by the present application; of course, in some other embodiments, the computer device 200 can also be used as Figure 1 The server in the embodiment executes the image rendering method provided by the present application by receiving the video frames sent by the live broadcast initiator.
[0044] See also Figure 3 , Figure 3 An exemplary flow chart of the image rendering method provided by the present application is shown, and the image rendering method may include the following steps:
[0045] S301, constructing a texture image to be rendered, a first texture image and a second texture image, and superimposing the first texture image and the second texture image on a first sub-rendering area and a second sub-rendering area of the texture image to be rendered, respectively;
[0046] In the embodiment of the present invention, the texture image to be rendered is an image to be rendered on the screen. The first texture image is used to store the real-time picture, and the second texture image is used to store the historical pixels of the previous picture of the real-time picture. The texture and size of the first texture image and the second texture image are the same;
[0047] After constructing the texture image to be rendered, the texture image to be rendered can be divided into a first sub-rendering area and a second sub-rendering area. Specifically, a sub-rendering area dividing line with a width is set in the middle of the texture image to be rendered. The width can be in pixels, such as one pixel or multiple pixels. Then, the first texture image is superimposed on the first sub-rendering area, and the second texture image is superimposed on the second sub-rendering area; the first sub-rendering area is the rendering area of the real-time picture, and the second sub-rendering area is the rendering area of the previous picture, specifically, it is used to render part of the information of the previous picture, so that the effect of time freeze can be presented on the screen.
[0048] S302, storing the current video frame to be rendered in the first texture image;
[0049] S303, determining a target pixel filling area within the second sub-rendering area, and filling the target pixels in the current video frame to be rendered that coincide with the boundary line of the sub-rendering area into the target pixel filling area, to obtain a target rendering image corresponding to the current video frame to be rendered;
[0050] In the embodiment of the present invention, the target pixel filling area is an area in the second texture image used to store partial pixel information corresponding to the historical video frame, and the adjacent pixel area of the target pixel filling area stores the historical target pixels corresponding to the previous video frame of the current video frame to be rendered. The adjacent pixel area refers to the pixel area on the side away from the sub-rendering area relative to the target pixel filling area.
[0051] That is to say, for each video frame, while rendering it, the target pixels corresponding to the historical video frames will also be rendered, thereby forming a time delay effect.
[0052] S301: Render a target rendering image to generate a time-delay special effect in a second sub-rendering area on the screen.
[0053] In an embodiment of the present invention, the generated delay special effect is a time delay effect between the first sub-rendering area and the second sub-rendering area in the screen, and the picture rendered by the second sub-rendering area is the picture content before the picture rendered in the first sub-rendering area.
[0054] In the above-mentioned image rendering method, firstly, a texture image to be rendered and a first texture image and a second texture image for rendering are constructed, and then the first texture image and the second texture image are superimposed on the first sub-rendering area and the second sub-rendering area of the texture image to be rendered respectively, and then the picture of the current video frame to be rendered is stored in the first texture image, and the second texture image is used to store part of the picture information of the previous frame of the current video frame to be rendered, and the target pixel filling area in the second sub-rendering area is determined, and the target pixels in the current video frame to be rendered that coincide with the boundary line of the sub-rendering area are filled into the target pixel filling area to obtain the target rendering image corresponding to the current video frame to be rendered, and the adjacent pixel area of the target pixel filling area stores the historical target pixels corresponding to the previous video frame of the video frame, so that the first sub-rendering area is used to render the real-time picture, and the second sub-rendering area renders the historical picture stored in the second texture image, and finally after the target rendering image is rendered into the screen, a time delay effect is presented between the two sub-rendering areas.
[0055] The above steps are introduced and explained in detail below.
[0056] See also Figure 4 , Figure 4 An example diagram of step S301 provided in an embodiment of the present invention. The current video frame to be rendered is an image captured by a camera in real time. The first texture image and the second texture image are respectively denoted as TX1 and TX2. Multiple textures can be combined to produce multiple effects, that is, different textures can be combined to obtain the first texture image and the second texture image. The texture of the texture image to be rendered can be the same as the texture of TX1 and TX2, or different, which is not limited here.
[0057] In step S302, the texture image to be rendered in the embodiment of the present invention is divided into a first sub-rendering area and a second sub-rendering area, the first sub-rendering area is the rendering area of TX1, the second sub-rendering area is the rendering area of TX2, the first texture image is superimposed in the first sub-rendering area, and the second texture image is superimposed in the second sub-rendering area.
[0058] Please continue to see Figure 4 , after storing the picture content of the current video frame to be rendered into the first texture image, the first texture image and the second texture image are superimposed on the first sub-rendering area and the second sub-rendering area. In this way, the picture of the current video frame to be rendered and the texture information in the first texture image are presented in the first sub-rendering area, and in the second sub-rendering area, whenever the picture in the first sub-rendering area is updated, in addition to the texture information of the second texture image, part of the picture information before the picture update will be stored in the second sub-rendering area, gradually forming a time freeze effect.
[0059] In step S303, in order to store the texture information corresponding to the historical picture before the real-time picture in the second sub-rendering area TX2, it is first necessary to determine the corresponding target pixel filling area in TX2. Therefore, the embodiment of the present invention provides two implementation methods, both of which can ultimately achieve the time delay effect.
[0060] In one optional implementation manner, the target pixel filling area in the second sub-rendering area may be determined according to the following steps:
[0061] Step 1a: Update the pixel positions of all pixels in the second sub-rendering area;
[0062] In the embodiment of the present invention, a preset moving speed and a preset direction may be set first. The preset moving direction may be, but is not limited to, a horizontal leftward or horizontal rightward direction, a vertical upward or vertical downward direction. Then, all pixels in the second sub-rendering area are moved along the preset direction at the preset moving speed, thereby achieving an effect of updating the pixel positions of all pixels.
[0063] Step 2a: The blank area formed in the second sub-rendering area after the pixel position is updated is used as the target pixel filling area.
[0064] To understand the above process, please refer to Figure 5 , Figure 5 A schematic diagram of the first method of determining a target pixel filling area provided in an embodiment of the present invention. For ease of description, a column of pixels adjacent to the sub-rendering area dividing line in the second sub-rendering area is used as a reference position for explanation. Assuming that the preset moving speed is to move one column of pixels each time, after the second texture image is moved to the right as a whole, a blank area as shown in the figure will appear between the reference position and the sub-rendering area dividing line. This blank area is the target pixel filling area in the embodiment of the present invention. After pixel filling of this area, all pixels are continued to be moved to the right as a whole. A blank area continues to appear between the reference position and the sub-rendering area dividing line. Since the video frame in the first texture image is updated in real time, the information of the video frame before the update is continuously filled in the formed blank area, which will form a time freeze effect in the second sub-rendering area.
[0065] In another optional implementation manner: the target pixel filling area may be determined in the following manner:
[0066] Step 1b: Update the current position of the sub-rendering area boundary line within the first sub-rendering area;
[0067] Step 2b: According to a preset moving speed, the sub-rendering area boundary line is moved from the initial moving position in a direction away from the starting position to update the current position.
[0068] In the above embodiment, the starting position of the first sub-rendering area can be first determined as the initial moving position of the sub-rendering area boundary line, and then the sub-rendering area boundary line can be moved in a direction away from the starting position at a preset moving speed to achieve the effect of updating the current position of the sub-rendering area boundary line.
[0069] See also Figure 6 , Figure 6 Two schematic diagrams for determining the target pixel filling area provided by an embodiment of the present invention are shown. For the convenience of description, numbers are used to represent the pixel columns of the image. The sub-rendering area dividing line moves to the right, assuming it moves to the position of the third column, then correspondingly, the corresponding position of the third column in the second texture image is the target pixel filling area. The sub-rendering area dividing line continues to move, and the position of the target pixel filling area also changes. After each change, historical pixel information will be filled in this area, thereby forming a time freeze effect.
[0070] After the target pixel filling area is determined by the above implementation, the target pixels in the current video frame to be rendered that coincide with the boundary line of the sub-rendering area are filled into the target pixel filling area to obtain the target rendering image corresponding to the current video frame to be rendered.
[0071] For example, to facilitate understanding of the above filling effect, Figure 4 The scene diagram shown is used as an example to illustrate. Figure 7 , Figure 7 FIG. 1 is a schematic diagram of pixel filling provided by an embodiment of the present invention. The figure ignores the process in which the pixels overlapping the first texture image and the boundary line of the sub-rendering area are also updated in real time. In the blank area formed after the first movement, the pixels overlapping the first texture image and the boundary line of the sub-rendering are filled into the blank area. Figure 7 In order to achieve the effect of (a), continue to move the pixels to the right as a whole, and then continue to fill the pixels that overlap the first texture image and the sub-rendering boundary in the blank area, as shown in (b). At this time, in (b), it can be seen that in addition to the pixels filled this time, the second texture image also includes the pixels filled in (a). Continuing to move will form the result shown in (c). In this way, after each video frame is updated, the second texture image will store the pixel information of multiple historical video frames before the updated video frame. In this way, after rendering the texture image to be rendered corresponding to each video frame, the left side of the screen (the first sub-rendering area) will render the real-time picture, and the right side of the screen (the second sub-rendering area) will render the historical picture, thus forming a time delay effect.
[0072] It should be noted that in the above implementation process, when it is determined that the pixels in the target pixel area are already filled pixels, the pixels in the target pixel area are not filled.
[0073] In an optional implementation, if the current video frame to be rendered is an initial video frame, after the initial video frame is stored in the first texture image, the texture image to be rendered is directly rendered.
[0074] It can be seen from the above embodiments that in the image rendering method provided by the embodiment of the present invention, by setting sub-rendering areas, a real-time image is rendered in one sub-rendering area, and a historical image is rendered in another sub-rendering area, thereby forming a time freeze effect. Moreover, in order to achieve this technical effect, in the image processing process before rendering in the embodiment of the present invention, the moving speed of the pixel or the sub-rendering area boundary can be adjusted, and the position, direction, and coverage position of the sub-rendering area boundary can be adjusted, and finally a variety of different effects can be adjusted, thereby improving the flexibility of time special effect rendering.
[0075] Based on the same inventive concept, the embodiment of the present invention further provides an image rendering device, see Figure 8 , Figure 8 This is a functional module diagram of an image rendering device provided by an embodiment of the present invention. The image rendering device 400 may include: a construction module 410, a storage module 420, a filling module 430 and a rendering module 440;
[0076] A construction module 410 constructs a texture image to be rendered, a first texture image, and a second texture image, and superimposes the first texture image and the second texture image on a first sub-rendering region and a second sub-rendering region of the texture image to be rendered, respectively; wherein the first texture image and the second texture image have the same texture and size;
[0077] The storage module 420 is used to store the current video frame to be rendered in the first texture image;
[0078] The filling module 430 is used to determine a target pixel filling area in the second sub-rendering area, and fill the target pixels in the current video frame to be rendered at the locations where the target pixels coincide with the boundary line of the sub-rendering area to be rendered into the target pixel filling area, so as to obtain a target rendering image corresponding to the current video frame to be rendered; wherein an adjacent pixel area of the target pixel filling area stores a historical target pixel corresponding to a previous video frame of the current video frame to be rendered;
[0079] The rendering module 440 is used to render the target rendering image so that the second sub-rendering area in the screen generates a delay special effect.
[0080] It is understandable that the construction module 410, the storage module 420, the filling module 430 and the rendering module 440 can be executed in a coordinated manner. Figure 3 Each step in the process is performed to achieve the corresponding technical effects.
[0081] In an optional real-time mode, the filling module 430 is specifically used to: update the pixel positions of all pixels in the second sub-rendering area; and use the blank area formed in the second sub-rendering area after the pixel positions are updated as the target pixel filling area.
[0082] In an optional real-time mode, the filling module 430 is specifically used to: move all pixels along a preset moving direction at a preset moving speed to update the pixel position.
[0083] In an optional real-time mode, the filling module 430 is further specifically used to: update the current position of the sub-rendering area boundary line in the first sub-rendering area; and determine the position area in the second sub-rendering area that is the same as the current position as the target pixel filling area in the second sub-rendering area.
[0084] In an optional real-time mode, the filling module 430 is further specifically used to: determine the starting position of the first sub-rendering area as the initial moving position of the sub-rendering area boundary line; move the sub-rendering area boundary line from the initial moving position in a direction away from the starting position according to a preset moving speed to update the current position.
[0085] In an optional implementation, the rendering module 440 is further configured to directly render the texture image to be rendered after storing the initial video frame in the first texture image if the current video frame to be rendered is an initial video frame.
[0086] In an optional implementation, the filling module 430 is further configured to not fill the pixels in the target pixel area when it is determined that the pixels in the target pixel area are already filled pixels.
[0087] It should be noted that the division of modules in the above embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of a software functional unit.
[0088] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program code.
[0089] Based on the above embodiments, the present application further provides a storage medium, in which a computer program is stored. When the computer program is executed by a computer, the computer executes the image rendering method provided by the above embodiments.
[0090] Based on the above embodiments, the embodiments of the present application further provide a computer program, which, when executed on a computer, enables the computer to execute the image rendering method provided in the above embodiments.
[0091] Based on the above embodiments, an embodiment of the present application further provides a chip, which is used to read a computer program stored in a memory and to execute the image rendering method provided in the above embodiments.
[0092] A computer program product is also provided in an embodiment of the present application, including instructions, which, when executed on a computer, enable the computer to execute the image rendering method provided in the above embodiment.
[0093] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by instructions. These instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0094] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0095] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0096] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. An image rendering method, characterized in that, the method includes: Construct a texture image to be rendered, a first texture image, and a second texture image, and superimpose the first texture image and the second texture image on the first sub-rendering area and the second sub-rendering area of the texture image to be rendered respectively; wherein, the textures and sizes of the first texture image and the second texture image are the same; Store the current video frame to be rendered in the first texture image; Determine the target pixel filling area in the second sub-rendering area, and fill the target pixels at the coincidence of the current video frame to be rendered and the sub-rendering area boundary line into the target pixel filling area to obtain the target rendering image corresponding to the current video frame to be rendered; wherein, the adjacent pixel areas of the target pixel filling area store the historical target pixels corresponding to the previous video frame of the current video frame to be rendered; Render the target rendering image to generate a time-lapse special effect in the second sub-rendering area on the screen.
2. The image rendering method according to claim 1, characterized in that, determining the target pixel filling area in the second sub-rendering area includes: Updating the pixel positions of all pixels in the second sub-rendering area; Taking the blank area formed in the second sub-rendering area after the pixel positions are updated as the target pixel filling area.
3. The image rendering method according to claim 2, characterized in that, updating the pixel positions of all pixels in the second sub-rendering area includes: Moving all the pixels along a preset moving direction at a preset moving speed to update the pixel positions.
4. The image rendering method according to claim 1, characterized in that, determining the target pixel filling area in the second sub-rendering area includes: Updating the current position of the sub-rendering area boundary line in the first sub-rendering area; Determining the position area in the second sub-rendering area that is the same as the current position as the target pixel filling area in the second sub-rendering area.
5. The image rendering method according to claim 4, characterized in that, updating the current position of the sub-rendering area boundary line in the first sub-rendering area includes: Determining the starting position of the first sub-rendering area as the initial moving position of the sub-rendering area boundary line; Moving the sub-rendering area boundary line from the initial moving position along the direction away from the starting position at a preset moving speed to update the current position.
6. The image rendering method according to claim 1, characterized in that, the method further includes: If the current video frame to be rendered is an initial video frame, then directly render the texture image to be rendered after storing the initial video frame in the first texture image.
7. The image rendering method according to claim 5, characterized in that, the method further includes: When it is determined that the pixels in the target pixel area are already filled pixels, do not fill the pixels in the target pixel area.
8. An image rendering device, characterized in that, including: A construction module, a storage module, a filling module, and a rendering module; The building module is used to build a texture image to be rendered, a first texture image, and a second texture image, and superimpose the first texture image and the second texture image onto a first sub-rendering area and a second sub-rendering area of the texture image to be rendered respectively; wherein, the textures and sizes of the first texture image and the second texture image are the same; The storage module is used to store the current video frame to be rendered in the first texture image; The filling module is used to determine a target pixel filling area within the second sub-rendering area, and fill target pixels at the coincidence of the current video frame to be rendered with the sub-rendering area demarcation line into the target pixel filling area to obtain a target rendering image corresponding to the current video frame to be rendered; wherein, adjacent pixel areas of the target pixel filling area store historical target pixels corresponding to the previous video frame of the current video frame to be rendered; The rendering module is used to render the target rendering image so that a time-delay special effect is generated in the second sub-rendering area on the screen.
9. A computer device, characterized in that, the device includes a processor and a memory, and at least one instruction or at least one program segment is stored in the memory, and the at least one instruction or the at least one program segment is loaded and executed by the processor to implement the image rendering method according to any one of claims 1-7.
10. A readable storage medium, characterized in that, at least one instruction or at least one program segment is stored in the storage medium, and the at least one instruction or the at least one program segment is loaded and executed by a processor to implement the image rendering method according to any one of claims 1-7.
Citation Information
Patent Citations
Image special effect processing method and device, electronic equipment and computer readable storage medium
CN112348748A
Special effect control method and device, electronic equipment and storage medium
CN113064539A