Methods, devices, equipment and media for displaying bullet comments
By splitting the bullet screen object into multiple display elements and assigning them diffusion direction and transparency variations, the problem of monotonous bullet screen display methods is solved, achieving rich visual effects and dynamic performance, and improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING IQIYI TECH CO LTD
- Filing Date
- 2026-05-11
- Publication Date
- 2026-06-30
AI Technical Summary
Existing bullet screen display methods present static text or simple linear scrolling, with fixed movement trajectories and monotonous forms, resulting in insufficient visual expression, difficulty in achieving complex dynamic effects, and a lack of visual richness and expressiveness.
During the movement and display of the bullet screen object, it is split into multiple display elements, and each element is given a diffusion direction and gradient transparency. Random perturbation is used to simulate the dynamic process of smoke dissipation in a real environment, and frame-by-frame rendering technology is used to ensure the accuracy of the display effect.
It enriches the visual effects of bullet comments, enhances dynamism and layering, improves user experience and engagement, simulates a natural and vivid smoke dissipation process, and improves the expressiveness of bullet comment display.
Smart Images

Figure CN122317331A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a method, apparatus, device and medium for displaying bullet screens. Background Technology
[0002] With the continuous development of multimedia technology, bullet comments, as a highly interactive form of user commenting, have been widely used on various media playback platforms. Users comment on the content of media resources by sending bullet comments, thus forming a unique collaborative viewing experience. However, current bullet comments are usually presented as static text or simple linear scrolling, with fixed movement trajectories and monotonous forms. This display method limits the visual expression of bullet comments, making it difficult to achieve complex dynamic effects, resulting in insufficient visual richness and expressiveness. Summary of the Invention
[0003] In order to solve the above-mentioned technical problems, or at least partially solve the above-mentioned technical problems, this disclosure provides a method, apparatus, device and medium for displaying bullet screens.
[0004] This disclosure provides a method for displaying bullet comments, the method comprising: During the process of displaying media resources on the display interface, the bullet screen object corresponding to the media resource is obtained, and the bullet screen object is controlled to move and display along a preset path on the display interface. During the movement and display of the bullet screen object, the bullet screen object is controlled to switch from a first display form to a second display form containing multiple display elements, and the multiple display elements are controlled to move and display along their respective diffusion directions; the transparency of the multiple display elements changes to a preset transparency value according to a preset rule during the movement and display process; the multiple display elements are obtained by splitting the bullet screen object, and the diffusion direction corresponding to each display element is determined after randomly perturbing the preset direction.
[0005] This disclosure also provides a bullet screen display device, including: The display module is used to obtain the bullet screen object corresponding to the media resource during the process of displaying media resources on the display interface, and control the bullet screen object to move and display along a preset path on the display interface. The display module is further configured to control the bullet screen object to switch from a first display form to a second display form containing multiple display elements during the movement and display of the bullet screen object, and to control the multiple display elements to move and display along their respective diffusion directions; the transparency of the multiple display elements changes to a preset transparency value according to a preset rule during the movement and display process; the multiple display elements are obtained by splitting the bullet screen object, and the diffusion direction corresponding to each display element is determined after randomly perturbing the preset direction.
[0006] This disclosure also provides an electronic device, the electronic device comprising: a processor; a memory for storing executable instructions of the processor; the processor being configured to read the executable instructions from the memory and execute the instructions to implement the bullet screen display method provided in this disclosure.
[0007] This disclosure also provides a computer-readable storage medium storing a computer program for executing the bullet screen display method provided in this disclosure.
[0008] This disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the bullet screen display method provided in this disclosure.
[0009] In the solution provided by this embodiment, the bullet screen object moves along a preset path during the display of media resources. During the movement of the bullet screen object, the bullet screen object switches from a first display form to a second display form containing multiple display elements. Each display element is given a differentiated diffusion direction and gradient transparency so that each display element gradually diffuses and fades out visually, thereby presenting a dynamic and layered particle effect. Since the diffusion direction of each display element is randomly generated based on a preset direction, the overall diffusion effect of the bullet screen is more natural and vivid, which can simulate the dynamic process of smoke dissipation in a real environment, enrich the display mode of the bullet screen object, and enhance the visual richness and expressiveness of the bullet screen.
[0010] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0011] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0012] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without creative effort.
[0013] Figure 1 A flowchart illustrating a bullet screen display method provided in an embodiment of this disclosure; Figure 2A flowchart illustrating a bullet screen display method provided in an embodiment of this disclosure; Figure 3 A flowchart illustrating a bullet screen display method provided in an embodiment of this disclosure; Figure 4 A flowchart illustrating a bullet screen display method provided in an embodiment of this disclosure; Figure 5 A flowchart illustrating a bullet screen display method provided in an embodiment of this disclosure; Figure 6 This is a schematic diagram of the structure of a bullet screen display system provided in an embodiment of the present disclosure; Figure 7 A schematic diagram of a reference barrage layer image frame provided in an embodiment of this disclosure; Figure 8 A schematic diagram of a current bullet screen layer image frame provided in an embodiment of this disclosure; Figure 9 This is a schematic diagram of the structure of a bullet screen display device provided in an embodiment of the present disclosure; Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0014] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0015] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.
[0016] In related technologies, bullet comments are typically displayed as text or graphics superimposed on the screen of media resources, moving at a constant speed within the display screen in a specific direction (such as from right to left) until they completely move off the screen and are then removed. However, this bullet comment display method has poor display effects, resulting in a poor user experience. To improve the above problems, embodiments of this disclosure provide a bullet comment display method, apparatus, device, and medium, which are described in detail below.
[0017] Figure 1 This is a flowchart illustrating a bullet screen display method provided in an embodiment of this disclosure. The method can be executed by a bullet screen display device, which can be implemented using software and / or hardware, and is generally integrated into an electronic device. Figure 1 As shown, the method mainly includes: Step S101: During the process of displaying media resources on the display interface, obtain the bullet screen object corresponding to the media resource, and control the bullet screen object to move and display along a preset path on the display interface.
[0018] In this embodiment of the disclosure, during the display of media resources, the corresponding bullet screen objects are superimposed and displayed. The bullet screen objects are shown to move dynamically on the display interface along a preset path (such as from right to left). During the display of the bullet screen objects, the original whole bullet screen object is split into multiple display elements, so that the bullet screen object is switched from the first display form to the second display form. Each display element is controlled to move along different diffusion directions after random perturbation. At the same time, the transparency is gradually adjusted according to preset rules until the target value is reached, so that the bullet screen object simulates the dynamic process of smoke dissipation in a real environment, thereby improving the bullet screen display effect.
[0019] The display interface is the visual area used to display media resources. Media resources are the audio and video content played on the display interface, such as video and audio, or even a live data stream. Bullet comments are user-sent or system-generated comments, emoticons, animations, etc., which are overlaid on the media screen as dynamic text or graphics. Preset paths are predefined bullet comment movement trajectories, such as horizontal movement across the screen from right to left, scrolling from bottom to top, or curved paths.
[0020] In this embodiment of the disclosure, while displaying media resources, the bullet screen objects associated with the media resources are acquired, and these bullet screen objects are controlled to move dynamically on the display interface according to a pre-defined path. For example, if the media resource is a video, when the video is displayed on the display interface, the bullet screen objects sent by the user will slide in at a constant speed from the right side of the screen and slide out from the left side, forming a horizontal scrolling effect of the bullet screen.
[0021] Step S102: During the movement and display of the bullet screen object, control the bullet screen object to switch from the first display form to the second display form containing multiple display elements, and control the multiple display elements to move and display along their respective diffusion directions; the transparency of the multiple display elements changes to a preset transparency value according to preset rules during the movement and display process; the multiple display elements are obtained by splitting the bullet screen object, and the diffusion direction corresponding to each display element is determined after randomly perturbing the preset direction.
[0022] In this embodiment of the disclosure, when the bullet screen object is moved and displayed, it is switched from a first display form as a whole to a second display form composed of multiple display elements. Subsequently, each display element diffuses outward in slightly different directions, while its transparency gradually decreases, and finally fades out and disappears, to simulate the dynamic process of smoke dissipation in a real environment.
[0023] The multiple display elements are the elements used to compose the bullet screen object. For example, these elements might be the characters, pixel blocks, or particles corresponding to the bullet screen object. For instance, if the bullet screen object is "666", the multiple display elements are the particles that make up the bullet screen object. Since the bullet screen object is displayed in white text on the display interface, these multiple display elements are the particles used to form the white text "666". Another example is that the multiple display elements are the characters in the bullet screen object. If the bullet screen object is "666", the multiple display elements are the individual "6". The first display state is the initial overall display state of the bullet screen object, where it is a complete piece of text or graphic. The second display state is the dispersed state after the bullet screen object has been broken down into multiple independent display elements. The preset direction is used to simulate the effects of gravity and thermal convection during the natural dissipation of smoke and can be represented in any direction. For example, the preset direction is the top-down direction on the display interface. The diffusion direction refers to the direction in which each displayed element moves after starting from its original position. The diffusion direction is generated based on a preset direction plus random perturbation, causing a slight angular offset from the preset direction to create a natural, irregular diffusion effect. The transparency change rule refers to the gradual increase in transparency of the displayed element over time or position during the diffusion process, eventually reaching a preset transparency value (such as completely transparent or semi-transparent). The preset transparency value can be any value; for example, a preset transparency value of 100 means the displayed element is completely transparent when it reaches the preset transparency value. The preset rule refers to the rule governing the change in the transparency of the displayed element. For example, the preset rule can be linear decay or non-linear decay. Linear decay indicates that the transparency decreases uniformly over time; non-linear decay can be exponential decay, quadratic decay, etc., making the transparency change slowly at the beginning and disappear rapidly later, creating a more natural sense of dissipation.
[0024] In some embodiments, step S102 includes: during the process of moving and displaying the bullet screen object, controlling the bullet screen object to switch from a first display form to a second display form containing multiple display elements according to a preset period, and controlling the multiple display elements to move and display along their respective diffusion directions; wherein, at the end of each preset period, controlling the display form of the bullet screen object to switch back to the first display form.
[0025] In this embodiment of the disclosure, the bullet screen object does not trigger the diffusion effect only once at a specific location, but performs a form switching process in a cycle according to a preset period: when the bullet screen object moves along the path on the screen, the system will periodically switch the bullet screen object from the overall first display form to a second display form composed of multiple display elements; these display elements then scatter along their respective diffusion directions determined by random perturbation, while their transparency gradually decreases to a preset transparency value according to preset rules; after the current cycle ends, the bullet screen object is restored to the first display form and continues to move normally, and then enters the next cycle to diffuse in the second display form.
[0026] The preset period is a pre-defined time interval that serves as the control time for triggering the switching of the display form of the bullet screen object. For example, if the preset period is 4 seconds, the bullet screen object will be displayed in a loop with a 4-second cycle during the movement and display process. In each cycle, the bullet screen object will be displayed as gradually splitting from its complete form into multiple display elements, which will gradually spread outward and fade out until they disappear. Then, the bullet screen will immediately return to its complete form and start the next cycle.
[0027] For example, taking a preset path as a straight line from right to left in the display interface, the bullet screen object will enter from the right side of the display interface and move out to the left. When a bullet screen object moves along this preset path, if it happens to coincide with the start of a preset cycle, the bullet screen object will immediately begin to simulate the effect of smoke diffusion and gradually fade out until it disappears completely; then, at the end of the cycle, the bullet screen object will instantly return to its complete initial form and seamlessly continue moving to the left along its previous trajectory, waiting for the triggering of the next cycle.
[0028] In this embodiment, during the movement and display of the bullet screen object, the display form of the bullet screen object is periodically switched, and the periodic diffusion and fade-out create a sense of rhythm and layering, which can alleviate visual obstruction and fatigue caused by high-density bullet screens and improve the viewing experience. In addition, the diffusion direction of random perturbation makes the special effects more natural and unpredictable, enhancing visual interest and dynamic expression.
[0029] In some embodiments, as the transparency of the displayed elements changes according to a preset rule, at the end of the current cycle, the transparency of the displayed elements changes to a preset transparency value. In this embodiment of the disclosure, for each preset cycle, at the beginning of the current cycle, the bullet screen object switches to a second display form containing multiple displayed elements, and then the multiple displayed elements diffuse outward and gradually become transparent. At the end of the current cycle, the transparency of the displayed elements just reaches a preset threshold.
[0030] In the solution provided by this embodiment, the bullet screen object moves along a preset path during the display of media resources. During the movement of the bullet screen object, it switches from a first display form to a second display form containing multiple display elements. Each display element is given a differentiated diffusion direction and gradient transparency, so that each display element gradually diffuses and fades out visually, thereby presenting a dynamic and layered particle effect. Since the diffusion direction of each display element is randomly generated based on a preset direction, the overall diffusion effect of the bullet screen is more natural and vivid, which can simulate the dynamic process of smoke dissipation in a real environment, enrich the display mode of the bullet screen object, improve the bullet screen display effect, and thus improve the user experience.
[0031] In the above Figure 1 Based on the illustrated embodiments, in this embodiment of the disclosure, the bullet screen object moves and is displayed along a preset path in a first display form, and the bullet screen object is only presented in a second display form when it moves and is displayed in the triggered area. For details, please refer to the following embodiments. Figure 2 This is a flowchart illustrating a bullet screen display method provided in an embodiment of this disclosure. The method can be executed by a bullet screen display device, which can be implemented using software and / or hardware, and is generally integrated into an electronic device. Figure 2 As shown, the method mainly includes: Step S201: During the process of displaying media resources on the display interface, obtain the bullet screen object corresponding to the media resource, and control the bullet screen object to move and display along a preset path in the first display form on the display interface.
[0032] In this embodiment of the disclosure, during the display of media resources, the corresponding bullet screen objects are simultaneously acquired. Subsequently, these bullet screen objects are displayed on the display interface along a preset path in a first display form to present a dynamic and orderly interactive comment effect. The first display form refers to the visual presentation of the bullet screen objects in the initial stage or a specific mode, equivalent to the default or normal display form of the bullet screen objects. For example, if the bullet screen object is a text bullet screen, the bullet screen object in the first display form can be displayed in complete text form.
[0033] In some embodiments, during the process of displaying media resources on the display interface, the bullet screen object associated with the current timestamp (i.e., playback progress) of the media resource is obtained in real time from the local cache or server to achieve synchronized display of the bullet screen object and the media resource content.
[0034] Step S202: During the movement and display of the bullet screen object, in response to the trigger operation on the first position in the display interface, the bullet screen object in the first area is controlled to switch from the first display form to the second display form containing multiple display elements, and the multiple display elements are controlled to move and display along their respective diffusion directions; the transparency of the multiple display elements changes to a preset transparency value according to a preset rule during the movement and display process; the multiple display elements are obtained by splitting the bullet screen object, and the diffusion direction corresponding to each display element is determined after randomly perturbing the preset direction; wherein, the first area is the area determined with the first position as the center in the display interface.
[0035] In this embodiment, during the normal movement and display of the bullet screen object along a preset path, if the user performs a trigger operation (such as clicking or long-pressing) on a certain position (i.e., the first position) in the display interface, a range of action will be defined centered on that position, called the first area. The first area essentially constitutes an interactive diffusion area. Subsequently, not only will the bullet screen object currently located within this area immediately switch from the first display form to the second display form, but any subsequent bullet screen object entering the first area will also trigger the same form transformation the instant it enters the first area: that is, it will be split into multiple display elements, each display element independently scattering according to a random perturbation direction introduced based on the preset diffusion direction, while its transparency gradually changes to the target transparency value according to preset rules, thereby continuously presenting a dynamic visual effect of smoke dissipation. Furthermore, once a bullet screen object moves out of the first area, it will immediately switch back to the first display form.
[0036] The first position is the location triggered by the user's action on the display interface, which can be represented by coordinates on the screen. The triggering action can be any action, such as a click, long press, or other gesture. The first area can be any shape, such as a circular area centered on the first position, or a rectangular area centered on the first position. The first area is a local area within the display interface, equivalent to the area where the bullet screen effect applies.
[0037] In this embodiment of the disclosure, when a user triggers a certain location on the display interface, a local area (i.e., a first area) is determined centered on that location to present the bullet screen diffusion effect. As the bullet screen object enters and moves within the first area, it is decomposed into multiple display elements, and each display element is given a different diffusion direction and gradient transparency, so that each display element gradually diffuses and fades out, simulating the dynamic process of smoke dissipating in a real environment. This improves the bullet screen display effect and enhances the user's sense of participation, thereby improving the user experience.
[0038] In some embodiments, the process of determining whether a bullet screen object is located in a first region includes: in response to a trigger operation on a first position in the display interface, defining a region centered on the first position and determined according to a preset size as the first region, and determining the coordinate range of the first region; obtaining the coordinates of a bullet screen object in the display interface; if the coordinates of the bullet screen object are within the coordinate range of the first region, determining that the bullet screen object is located within the first region; if the coordinates of the bullet screen object are outside the coordinate range of the first region, determining that the bullet screen object is located outside the first region.
[0039] The preset size is a pre-defined size used to define the effective area of the bullet screen effect; if the preset range is a radius, the first area determined is a circular area; if the preset range is a length and width, the first area determined is a rectangular area. The coordinates of the bullet screen object refer to the coordinates of the center point or bounding box of the bullet screen object in the display interface.
[0040] In this embodiment, the coordinates of the bullet screen object are acquired in real time and logically compared with the coordinate range of the first region. If the coordinates of the bullet screen object fall within the coordinate range of the first region, the form switching logic of the bullet screen object is triggered, converting the bullet screen object from a first display form to a second display form containing multiple display elements, and initiating diffusion and transparency change animations; otherwise, the original display state of the bullet screen object is maintained. This method based on coordinate mapping and range determination achieves precise spatial positioning of bullet screen effects.
[0041] It should be noted that the embodiments disclosed herein are illustrated by example of displaying the bullet screen object only in the area triggered by the user in the second display form. In another embodiment, it is not necessary to perform the above steps S201-S202. Instead, other methods are adopted. During the process of displaying media resources on the display interface, the bullet screen object corresponding to the media resource is obtained, and the bullet screen object is controlled to move and display along a preset path on the display interface. During the process of the bullet screen object moving and displaying, the bullet screen object is controlled to switch from the first display form to the second display form containing multiple display elements, and the multiple display elements are controlled to move and display along their respective diffusion directions.
[0042] In this embodiment, during the display of media resources, the bullet screen object corresponding to the media resource is controlled to move and display along a preset path on the display interface in a first display form. When the user performs a trigger operation on any position (i.e., the first position) in the display interface, a first area is defined centered on that position, and the bullet screen objects within the first area (including those subsequently entering the first area) are switched to a second display form. This causes the bullet screen object to be split into multiple display elements, each of which moves independently based on a randomly perturbed diffusion direction, while its transparency gradually changes to a target value according to a preset rule. This not only enriches the interaction between the bullet screen object and the user, allowing the user to actively trigger and control the dynamic diffusion effect of local bullet screens, but also simulates the dynamic process of smoke dissipation in a real environment through the collaborative design of particle-based splitting, random perturbation direction, and gradual transparency. This improves the bullet screen display effect while enhancing user engagement, thereby improving the user experience.
[0043] In the above Figures 1 to 2Based on the illustrated embodiment, in this embodiment of the disclosure, during the process of the bullet screen object presenting a particle diffusion effect in a second display form, the user can trigger a certain position on the display interface to define a local area, so that the bullet screen object entering or located in the area is restored to the original first display form; that is, after step S102 or S202, the method further includes: in response to the triggering operation of the second position in the display interface, controlling the bullet screen object in the second area to switch from the second display form to the first display form; wherein, the second area is an area defined in the display interface with the second position as the center.
[0044] In this embodiment, when a bullet screen object has switched to the second display form and is in a diffusion state, if the user performs a trigger operation on any position on the interface (i.e., the second position), a second area will be defined. Not only will the bullet screen object currently located in the second area immediately switch from the second display form to the first display form, but any subsequent bullet screen object in the second display form, upon entering the second area, will be immediately restored to the first display form and continue to move along a preset path in its original form (i.e., the first display form) within the second area, no longer exhibiting a particle diffusion effect. Furthermore, once a bullet screen object moves out of the second area, it will switch back from the first display form to the second display form and continue to be displayed according to the previous diffusion effect.
[0045] The second position refers to the location triggered by the user's action on the display interface, which can be represented by coordinates on the screen. The second region can be any shape, such as a circular region centered on the second position, or a rectangular region centered on the second position. The second region is a local area in the display interface, essentially acting as the area to suppress the spread effect of the bullet screen object.
[0046] In this embodiment, during the process of the bullet screen object presenting a particle diffusion effect in a second display form, when the user performs a trigger operation on any position (i.e., the second position) in the display interface, a second region is defined centered on that position, and the bullet screen objects within the second region (including those subsequently entering the second region) are switched to the first display form. This achieves an interactive method for switching bullet screen display forms, enriching the interaction between the bullet screen object and the user, enabling the user to actively trigger and control the dynamic diffusion effect of local bullet screen objects, enhancing user engagement, and thus improving the user experience.
[0047] In the above Figure 1Based on the illustrated embodiments, in this embodiment of the disclosure, the media resource corresponds to multiple bullet screen objects. For any two bullet screen objects among the multiple bullet screen objects, the time when the first bullet screen object among the two bullet screen objects switches to the second display mode is earlier than the time when the second bullet screen object among the two bullet screen objects switches to the second display mode; the position of the first bullet screen object is farther away from the start of the preset path than the position of the second bullet screen object.
[0048] In this embodiment, the media resource corresponds to multiple bullet screen objects. During the display of the media resource, the multiple bullet screen objects enter the display interface sequentially along a preset path and move continuously. When the bullet screen object form switching mechanism is enabled, each bullet screen object does not switch to the second display form simultaneously, but the switching timing is determined according to the real-time spatial position of each bullet screen object on the preset path. Specifically, the bullet screen objects located at the front of the path (i.e., further away from the starting end) will switch their display forms first, and will be broken down into multiple display elements and begin to spread earlier; while the bullet screen objects at the back of the path (i.e., closer to the starting end) will switch their display forms with a certain delay, so that each bullet screen object on the display screen can start to dissipate from the side far away from the starting segment of the preset path, simulating the dynamic process of smoke dissipation in a real environment.
[0049] For example, if the preset path indicates the direction of the display screen from right to left, then during the display of multiple bullet comments on the display screen, the bullet comments on the left will first simulate the dynamic process of smoke dissipation in a real environment, while the bullet comments on the right will simulate the dynamic process of smoke dissipation in a real environment after a certain delay.
[0050] In this embodiment of the disclosure, for multiple bullet screen objects corresponding to media resources, each bullet screen object participates in display control as an independent object. The time of switching to the second display mode refers to the specific moment when the bullet screen object changes from its initial complete form (i.e., the first display mode) to a particle-like state composed of multiple display elements (i.e., the second display mode). The starting end of the preset path is the starting position of the preset trajectory, which is also equivalent to the initial appearance position of the bullet screen object in the display interface. For example, if the display interface scrolls the bullet screen from right to left, then the starting end of the preset path is the right side of the screen. A position further away from the starting end indicates that the bullet screen object has moved a longer distance along the preset path and is at a more forward position on the preset path.
[0051] In this embodiment, multiple bullet screen objects corresponding to the media resources switch to a second display mode to present a particle diffusion effect. Since the multiple bullet screen objects are positioned differently on the preset path, the switching timing is naturally staggered: bullet screen objects located at the front of the path (farthest from the starting point) trigger diffusion first, followed by bullet screen objects at the back of the path. This creates a dynamic effect where the diffusion effect of multiple bullet screen objects unfolds layer by layer from front to back, enhancing visual hierarchy and realism. It simulates the dynamic process of smoke dissipating in a real environment, improving the bullet screen display effect and thus enhancing the user experience.
[0052] In the above Figures 1 to 2 Based on the illustrated embodiment, in this embodiment of the disclosure, after the transparency of the display element changes to a preset transparency value, the bullet screen object will switch back to the first display mode. After step S102 or S202, the method further includes: in response to the transparency of multiple display elements changing to a preset transparency value, controlling the bullet screen object to switch from the second display mode back to the first display mode.
[0053] In this embodiment, when the bullet screen object switches from the first display form to the second display form, the bullet screen object is split into multiple display elements. These display elements each move along a randomly perturbed diffusion direction, while their transparency gradually decreases according to a preset rule. When the transparency of a display element reaches a preset transparency value, it is determined that the particle diffusion process of the bullet screen object has ended, and the form restoration logic is automatically triggered to recombine the bullet screen object into its original form, that is, switch back to the first display form, and make the bullet screen object continue to move and display along the original preset path in the first display form.
[0054] For example, if the bullet screen object is a text bullet screen and the display elements are the particles that make up the bullet screen object, when the bullet screen object is split into multiple particles (or split into multiple light points) to simulate the dissipation of smoke, if each particle changes to a preset transparency value, at this time each particle is completely transparent, the user cannot observe the bullet screen object through the display interface. Therefore, it is determined that the particle diffusion process of the bullet screen object has ended, and the bullet screen object will be switched back to text bullet screen and moved and displayed along a preset path.
[0055] In this embodiment of the disclosure, the bullet screen object is automatically switched back to the first display form after the transparency of the display element reaches a preset value, so that the bullet screen object can reappear in a readable form after fading out, avoiding the situation where the bullet screen object disappears permanently after one disappearance, thus avoiding the loss of important interactive content, improving the bullet screen display effect, and thereby improving the user experience.
[0056] In the above Figure 1Based on the embodiments shown, in the embodiments of this disclosure, during the display of the moving bullet screen object, the current bullet screen layer image frame is displayed by rendering frame by frame, so as to present the changing effect of the bullet screen object. For details of the process, please refer to the following embodiments. Figure 3 This is a flowchart illustrating a bullet screen display method provided in an embodiment of this disclosure. The method can be executed by a bullet screen display device, which can be implemented using software and / or hardware, and is generally integrated into an electronic device. Figure 3 As shown, the method mainly includes: Step S301: During the process of displaying media resources on the display interface, obtain the bullet screen object corresponding to the media resource, and control the bullet screen object to move and display along a preset path on the display interface.
[0057] It should be noted that this step is the same as step S101 above, and will not be repeated here.
[0058] Step S302: During the process of moving and displaying the bullet screen object, obtain the reference bullet screen layer image frame corresponding to the current content frame of the media resource. The reference bullet screen layer image frame is used to represent the display status of the bullet screen object in the display interface at the current frame time when the bullet screen object moves and displays in the first display form on the display interface.
[0059] In this embodiment, during the display of the bullet screen object along a preset path, a frame-by-frame display method is adopted. Steps S302-S304 are executed for each frame time according to the rendering sequence of each image frame to generate a current bullet screen layer image frame reflecting the real-time form of the bullet screen object, and render it to the display interface. This allows the dynamic change process of the bullet screen object switching from a first display form to a second display form to be presented while displaying media resources. For the current frame time, a reference bullet screen layer image frame aligned with the content frame of the currently displayed media resource is obtained. This reference bullet screen layer image frame is not directly used to synthesize the final image, but rather to represent the baseline state of the bullet screen object. That is, it reflects the spatial distribution and display result of each bullet screen object on the display interface when all bullet screen objects are rendered normally in the most basic first display form (such as ordinary scrolling text) at the current time. The reference bullet screen layer image frame can reflect the position, size, color, transparency, and mutual occlusion relationship of each bullet screen object.
[0060] The current content frame of a media resource refers to the frame of the media resource at the current moment during its display. For example, if the media resource is a video, the current content frame is the video frame at the current moment. The reference bullet screen layer image frame is a virtual image data used to record, at the current frame time, a snapshot of the overall bullet screen layer, consisting of the layout, position, transparency, and overlay state of the bullet screen objects on the display interface, if all bullet screen objects are displayed normally along a preset path in their first display form (such as regular, un-effected text). The current frame time refers to the specific timestamp during the media resource display process, corresponding to the content frame currently being rendered or about to be rendered in the media resource.
[0061] In this embodiment of the disclosure, a reference barrage layer image frame mechanism is introduced to provide a reliable benchmark for the dynamic rendering of the barrage system, ensuring that even after a large number of barrage objects have undergone form switching, the standard display state that the barrage object should have can still be accurately restored; since the reference frame only reflects the idealized first display form of the barrage object, it provides a reliable basis for the subsequent rendering of the barrage object and ensures the accuracy of the subsequent barrage rendering.
[0062] In some embodiments, the process of obtaining a reference barrage layer image frame includes: obtaining barrage position information matching the current frame time from cached barrage layout data based on the current frame time, and generating a reference barrage layer image frame according to the barrage position information and the rendering parameters of the first display form.
[0063] In this embodiment, the layout of all bullet comments is not calculated in real time for each frame. Instead, it relies on cached bullet comment layout data. This data is based on the timestamps, path rules, and display strategies of the bullet comment objects, and calculates the spatial position of each bullet comment at various points in time offline. When a certain current frame is reached, the bullet comment position information corresponding to that time point can be quickly retrieved. Combined with the rendering parameters of a unified first display form (such as white text, 16-point font, 80% transparency, etc.), an image frame containing standard bullet comment objects—that is, the reference bullet comment layer image frame—is rendered.
[0064] The pre-stored bullet screen layout data refers to a data structure pre-calculated and stored before or during the display of media resources. It records the spatial layout information of each bullet screen object, including its position, size, and layer, at various points in its lifecycle. Bullet screen position information describes the coordinates, bounding box, and direction of movement of each bullet screen object on the display interface at a specific point in time. The rendering parameters for the first display form define the parameters required for the bullet screen to be displayed in a standard form; for example, rendering parameters include font, font size, color, transparency, stroke, and alignment. Generating a reference bullet screen layer image frame refers to synthesizing an image frame containing only bullet screens (excluding media content) in memory or video memory, which serves as a reference image for subsequent processing.
[0065] In this embodiment of the disclosure, a reference bullet screen layer image frame is generated by using cached bullet screen layout data, which greatly reduces the real-time computing burden during playback, improves performance under high-concurrency bullet screens, and ensures the reliability and accuracy of the generated reference bullet screen layer image frame.
[0066] Step S303: Based on the reference barrage layer image frame, generate the current barrage layer image frame corresponding to the current frame time. The current barrage layer image frame is used to represent the display status of the barrage object in the display interface at the current frame time when the barrage object enters the second display mode for moving display.
[0067] In this embodiment, a reference bullet screen layer image frame corresponding to the current frame time is first obtained to represent the layout information when the bullet screen object moves and displays in a first display mode. For bullet screen objects in a second display mode, these bullet screen objects are split into multiple display elements. These multiple display elements move and display from the original position of the bullet screen object along their respective diffusion directions. The transparency of the multiple display elements changes to a preset transparency value according to a preset rule during the movement and display process. Therefore, by combining the reference bullet screen layer image frame, it is possible to determine the display position and transparency of the multiple display elements after the bullet screen object is split into multiple display elements, which simulate the dynamic process of smoke dissipation in a real environment. This forms the current bullet screen layer image frame corresponding to the current frame time, so that the current bullet screen layer image frame fully reflects the actual display situation of the bullet screen at the current moment.
[0068] Among them, the current bullet screen layer image frame is an image frame that truly reflects the actual display state of the bullet screen object at the current frame time, and can present the bullet screen effect of the bullet screen object switching to the second display form.
[0069] Step S304: Render the current bullet screen layer image frame in the display interface.
[0070] In this embodiment of the disclosure, by rendering the current bullet screen layer image frame in the display interface, the display interface can present the current display status of the bullet screen object, so as to present the dynamic process of smoke dissipation in the real environment after the bullet screen object enters the second display form.
[0071] Rendering is the process of converting data into a visual image output. In this embodiment of the disclosure, rendering is the process of converting the current bullet screen layer image frame into text or graphics that the user can see and correctly placing them in the corresponding position on the display interface.
[0072] In some embodiments, the current bullet screen layer image frame indicates the pixel value of each pixel in the display interface relative to the bullet screen layer; the process of rendering the current bullet screen layer image frame includes: obtaining a media resource layer image frame corresponding to the current frame time in the media resources, the media resource layer image frame indicating the pixel value of each pixel in the display interface relative to the media resource layer; determining the sum of pixel values corresponding to the same pixel in the display interface in the bullet screen layer and the media resource layer image frame based on the current bullet screen layer image frame and the media resource layer image frame; rendering the current image frame based on the sum of pixel values corresponding to each pixel in the display interface; and displaying the current image frame in the display interface.
[0073] In this embodiment, the media resource layer image frame and the current bullet screen layer image frame corresponding to the current frame time are obtained respectively. For each pixel in the display interface, a pixel-by-pixel synthesis method is adopted to fuse the pixel value of the pixel in the bullet screen layer and the pixel value in the media resource layer to obtain the final pixel value of the pixel. The final pixel values of all pixels are combined into a complete current image frame and rendered on the display interface. In this way, the distribution of bullet screen objects can be accurately displayed, ensuring the display effect of bullet screen while ensuring the display effect of media resources.
[0074] The media resource layer is a base layer specifically for displaying media resource content; the bullet screen layer is a virtual layer specifically for displaying bullet comments, typically located above the media resource layer. The current bullet screen layer image frame represents the image data containing only bullet comment objects at the current frame time. The bullet screen layer image records the color and transparency information of each pixel in the bullet screen layer. The media resource layer image frame is the original image frame corresponding to the media resource at the current frame time, containing only the pixel information of the media resource content and no bullet comments. Pixel values are data used to describe the color and transparency of a pixel in the image, usually represented in RGBA (red, green, blue, alpha) four-channel format. The alpha (transparency) channel controls transparency, with 0 being completely transparent and 255 being completely opaque. The current image frame is the final composite image output to the display interface, formed by merging the media resource layer and the bullet screen layer according to transparency rules; it is the complete image frame that the user actually sees.
[0075] In some embodiments, taking the pixel value represented by RGBA four channels as an example, the process of fusing the pixel values of the same pixel in two layers includes: for any pixel point in the bullet screen layer and the media resource layer, the values of the same channel are added together to obtain the sum value corresponding to each channel, and the sum values corresponding to the four channels are used to form the fused pixel value of the pixel point.
[0076] It should be noted that the embodiments disclosed herein are illustrated using a frame-by-frame rendering method to display the current bullet screen layer image frame. In another embodiment, steps S302-S304 are not required. Instead, other methods are used. During the movement and display of the bullet screen object, the bullet screen object is controlled to switch from a first display form to a second display form containing multiple display elements, and the multiple display elements are controlled to move and display along their respective diffusion directions. The transparency of the multiple display elements changes to a preset transparency value according to a preset rule during the movement and display. The multiple display elements are obtained by splitting the bullet screen object, and the diffusion direction corresponding to each display element is determined after randomly perturbing the preset direction.
[0077] It should be noted that step S301 above describes the process of bullet screen movement and display in a visual form. In another embodiment, after obtaining the bullet screen object corresponding to the media resource, the current bullet screen layer image frame can be rendered in the display interface in the manner of steps S302-S304 above, so as to present the process of the bullet screen object moving and displaying along a preset path. During the movement and display process, the dynamic process of the bullet screen object entering the second display form is presented, simulating the dissipation of smoke in the real environment.
[0078] In the solution provided by this disclosure, during the movement and display of the bullet screen object, a frame-by-frame generation method is adopted. Based on the current frame time, a reference bullet screen layer image frame is constructed to reflect the standard bullet screen layout. Using this as a reference, the actual distribution state of the bullet screen object after switching to the second display form is simulated, including the position, diffusion direction, and transparency changes of the multiple display elements split from the bullet screen object. This generates a current bullet screen layer image frame that accurately represents the visual state of the bullet screen at the current moment, which is then overlaid and rendered onto the display interface. By introducing a reference bullet screen layer image frame as a precise reference for space and layout, the accuracy of the particle effects can be ensured. At the same time, the dynamic generation of the current bullet screen layer image frame frame by frame allows the entire process of the bullet screen object from its complete form to particle diffusion and then to fading away to be presented smoothly, simulating the dynamic process of smoke dissipation in a real environment. This enriches the expression of the bullet screen and improves the bullet screen display effect and user experience.
[0079] In the above Figure 3 Based on the embodiments shown, in this embodiment of the disclosure, a pixel-by-pixel calculation method is adopted to generate the current bullet screen layer image frame. For details of the process, please refer to the following embodiments. Figure 4 This is a flowchart illustrating a bullet screen display method provided in an embodiment of this disclosure. The method can be executed by a bullet screen display device, which can be implemented using software and / or hardware, and is generally integrated into an electronic device. Figure 4 As shown, the method mainly includes: Step S401: During the process of displaying media resources on the display interface, obtain the bullet screen object corresponding to the media resource, and control the bullet screen object to move and display along a preset path on the display interface.
[0080] Step S402: During the process of moving and displaying the bullet screen object, obtain the reference bullet screen layer image frame corresponding to the current content frame of the media resource. The reference bullet screen layer image frame is used to represent the display status of the bullet screen object in the display interface at the current frame time when the bullet screen object moves and displays in the first display form on the display interface.
[0081] It should be noted that steps S401-S402 are the same as steps S301-S302 above, and will not be repeated here.
[0082] Step S403: For each pixel in the display interface, the initial position of the pixel is iteratively offset multiple times based on the noise function and the offset parameter to obtain the sampling position after each offset. The noise function is used to disturb the position of the pixel, and the offset parameter indicates the amount of change of the position of the pixel along the preset direction over time.
[0083] In this context, pixels in the display interface are the smallest units that make up the final output image. Each pixel has coordinates and a color value. For example, there are approximately 2.07 million pixels on a 1920×1080 resolution screen. The initial position is the location of a pixel in the display interface, which can be represented in coordinates. The noise function is a function used to generate a natural perturbation field with fractal characteristics; for example, the noise function is a multi-layer fractal Perlin (a type of gradient noise) noise algorithm. The offset parameter can be represented in any form, such as velocity or acceleration. Multiple iterative offsets refer to offsetting the initial position based on the noise function and offset parameters, with each subsequent offset based on the previous one, resulting in a sampled position. The sampled position is the new position obtained after each iterative offset, which can be represented in coordinates.
[0084] In this embodiment of the disclosure, in order to enhance the naturalness and dynamic details of the particle diffusion of the bullet screen, for each pixel in the display interface, the initial position of the pixel is iteratively offset multiple times based on the noise function and offset parameters. Each iteration generates a sampling position, and these positions together depict a subtle, irregular but coherent motion trajectory so that the pixel values presented by the pixels in the display interface during the dynamic process of smoke dissipation in a real environment can be determined by using these sampling positions.
[0085] In this embodiment of the disclosure, for each pixel, the initial position is represented by fragCoord (fragment coordinates), which is used as a random seed to randomly offset each pixel, ensuring that the offset path of each pixel is different.
[0086] In some embodiments, step S403 includes steps 1 to 5: Step 1: Based on the noise function and the initial position of the pixel, determine the noise value corresponding to the initial position. The noise function is used to perturb the position of the pixel.
[0087] In this embodiment, the noise value corresponding to the initial position is a vector value obtained by inputting the initial position into a noise function, which represents the offset direction and offset magnitude of the initial position. The initial position can be represented in coordinate form, for example, the initial position can be represented by the coordinates of a pixel in the display interface, or the initial position can be represented by the coordinates of a pixel in the display interface after normalization, such as x and y in the coordinates (x, y) of a pixel in the display interface, where x and y are both positive integers, used to represent the row and column of the pixel in the display interface; the coordinate x is divided by the width of the display interface, and the coordinate y is divided by the height of the display interface to normalize the coordinates x and y, resulting in coordinates (u, v), where the values of u and v are both in the range [0, 1].
[0088] In some embodiments, step 1 above includes: mapping the initial position of a pixel to a noise space corresponding to each noise frequency based on multiple noise frequencies, to obtain a mapped position in each noise space; for each mapped position, obtaining a noise value corresponding to the mapped position based on the mapped position and a noise function; adjusting the noise value corresponding to the mapped position based on the amplitude attenuation coefficient corresponding to the mapped position, to obtain an adjusted noise value corresponding to the mapped position, wherein the amplitude attenuation coefficient is the reciprocal of the noise frequency corresponding to the mapped position; and fusing the adjusted noise values corresponding to multiple mapped positions to obtain a noise value corresponding to the initial position.
[0089] Here, the noise frequency refers to the frequency of different noise levels, which determines the fineness of the noise. In this embodiment, a power of 2 (such as 2^2) is used. 0 ,2 1 ,2 2 , ..., 2 9 The frequencies of the 10 noise levels are used to construct a multi-scale perturbation field from macroscopic to microscopic. The amplitude attenuation coefficient is used to control the amplitude of each noise level. In the embodiments of this disclosure, the amplitude attenuation coefficient of each noise level is the reciprocal of the frequency corresponding to that noise level.
[0090] In this embodiment, for each pixel, its initial position is mapped to the noise space corresponding to each noise frequency according to different noise frequencies, obtaining the mapped position in each noise space. Then, for each mapped position, a noise function is used to obtain the corresponding noise value; the noise value is adjusted using an amplitude attenuation coefficient inversely proportional to the noise frequency to ensure that high-frequency noise does not excessively affect the final result. Finally, the adjusted noise values corresponding to all frequencies are merged to form the final noise value of the pixel, so as to balance the noise influence at different frequencies. Through multi-layer noise superposition, low-frequency noise dominates the large-scale overall motion direction disturbance, while high-frequency noise dominates the small-scale superimposed fine local disturbance (such as local turbulence). Each layer is attenuated by the inverse of the frequency to ensure clear hierarchy and order of primary and secondary elements; the final synthesized disturbance field exhibits a natural dynamic effect with fractal characteristics.
[0091] In some embodiments, the noise value corresponding to the initial position satisfies the following formula: perlin(p)=Σ(i=0 to 9) [(noiseRGBA(p * 2 i * 0.001).xy - 0.5) / 2 i ] Where, perlin(p) represents the noise value corresponding to the initial position p, Σ(i=0 to 9) represents the accumulation of displacement vectors obtained from 10 levels of noise to form a complex perturbation field; noiseRGBA() represents the noise function; the initial position p is the normalized coordinate representation of the pixel's coordinates in the display interface; 2 i The variable is used to represent the noise frequency, i to represent the noise level, 0.001 to represent the position adjustment coefficient, noiseRGBA().xy to represent the displacement vector formed by the first two channels of the four-channel output of the noise function, which represents the displacement of the initial position in coordinates x and y; 0.5 to center the displacement vector from [0, 1] to [-0.5, 0.5], so that the disturbance can be positive or negative (i.e., can be shifted in any direction), rather than only shifted in one direction.
[0092] Step 2: Determine the offset based on the current frame time and offset parameters.
[0093] In this embodiment of the disclosure, the displacement in the preset direction is calculated using the current frame time and the offset parameter in the preset direction to simulate the offset of the display elements after the bullet screen object is split in the preset direction. The offset is the distance the initial position of the pixel moves along the preset direction during the current frame time, simulating the upward drift phenomenon (such as gravity and thermal convection) of the bullet screen object in the natural dissipation of smoke.
[0094] In this embodiment of the disclosure, in order to achieve the effect of the bullet screen objects dissipating naturally like smoke, an offset proportional to time is used to ensure a smooth transition in the animation process.
[0095] In some embodiments, the offset is represented in the form of a vector or in the form of a scalar; if the offset is represented in the form of a vector, it can reflect the offset direction (i.e., the preset direction) and the offset magnitude; if the offset is represented in the form of a scalar, it is the offset magnitude on the y-axis, and the offset direction (i.e., the preset direction) is along the positive or negative direction of the y-axis.
[0096] In some embodiments, step 2 above includes: adjusting the current frame time based on the delay time corresponding to the pixel to obtain the local time of the pixel, wherein the delay time is determined based on the initial position of the pixel; and determining the offset based on the local time of the pixel and the offset parameter.
[0097] The delay time is a time offset calculated based on the initial position of a pixel, used to simulate the time difference between different pixels. Local time is the adjusted time value for a pixel, calculated as: Local Time = Current Frame Time + Delay Time. It allows each pixel to have an independent clock, achieving asynchronous dynamic effects. Offset: Driven by local time, the distance the pixel should move in the current frame is calculated using offset parameters (such as upward velocity), determining the position after perturbation along a preset direction.
[0098] In this embodiment, instead of using a uniform global time for all pixels, a spatial delay mechanism is introduced. A delay time is calculated based on the initial position of each pixel. For example, if the bullet screen object simulates the dynamic process of smoke dissipation in a real environment, spreading from the top left corner to the bottom right corner of the display interface, then the closer a pixel is to the top left corner, the smaller its delay time. That is, the pixel in the top left corner has the smallest delay, and the pixel in the bottom right corner has the largest delay. Subsequently, the delay time corresponding to each pixel is adjusted to the current frame time to obtain the local time of the pixel. Finally, the offset is calculated based on the local time and a preset offset parameter to ensure that different pixels have different offsets, achieving a gradual dissipation effect starting from a specified area, thus better simulating the dynamic process of smoke dissipation in a real environment. By introducing a delay time and a local time mechanism based on the initial position, the naturalness and layering of the smoke dissipation simulation by the bullet screen object are enhanced, simulating the changes in the startup timing caused by positional differences in real physical phenomena, thus ensuring the subsequent bullet screen diffusion effect.
[0099] In some embodiments, the initial position of a pixel is represented by normalized coordinates, and the corresponding delay time for the pixel is uv.x + 1.0 - uv.y, where uv.x represents the x-coordinate of the initial position of the pixel, and uv.y represents the y-coordinate of the initial position of the pixel. This method of calculating the delay time ensures that the delay is minimized for the pixel in the upper left corner of the display interface (uv=(0,1)) and maximized for the pixel in the lower right corner (uv=(1,0)), so that the subsequent simulation of smoke dissipation by the bullet screen object can present a diffusion effect from the upper left to the lower right corner of the display interface.
[0100] In some embodiments, the process of cyclically displaying the bullet screen object switching from the first display mode to the second display mode according to a preset period includes determining the offset based on local time and offset parameters: mapping the local time to the current period, and determining the offset based on the mapped time and offset parameters.
[0101] In this embodiment, mapping a local time to the current period limits the local time within a preset period, achieving seamless looping of the animation. For example, if the preset period is 2 seconds and the local time is 5.7 seconds, the mapped time is the 1.7th second of the current period. By mapping the local time to the preset period to determine the offset, stable, controllable, and looping playback of the bullet screen effect is achieved.
[0102] In some embodiments, the process of determining the offset based on the mapped time and offset parameters includes: if the offset parameter is velocity, then the product of the mapped time and velocity is determined as the offset; if the offset parameter is acceleration, then the product of the square of the mapped time and the acceleration is divided by 2 to determine the offset.
[0103] In this embodiment, if the offset parameter is velocity, the offset at that velocity can be calculated based on the mapped time and velocity. If the offset parameter is acceleration, the offset needs to be calculated using the square of the mapped time. Using the time square function (t²) to calculate the offset ensures that the offset changes little at the beginning of each preset period and changes much more in the later period, achieving a natural rhythm of slow start and fast end. This allows the final presentation of the bullet screen object to simulate the physical phenomenon of smoke dissipating slowly at the beginning and rapidly at the end.
[0104] Step 3: Based on the offset and the noise value corresponding to the initial position, offset the initial position of the pixel to obtain the first sampling position.
[0105] In the disclosed embodiment, when the original position of the pixel is perturbed for the first time, the noise value and offset corresponding to the initial position are obtained. Both the noise value and the offset are used to offset the initial position. By superimposing the two and offsetting the initial position of the pixel, a new position can be obtained, which is used as the first sampling position.
[0106] In some embodiments, the offset is represented as a vector and the noise value is also represented as a vector. The offset and the noise value are added together to obtain the offset vector, which indicates the offset direction and magnitude relative to the initial position. The first sampling position is obtained by offsetting the initial position according to the offset vector.
[0107] In some embodiments, step 3 above includes: adjusting the offset amount and the noise value corresponding to the initial position based on the current iteration offset number to obtain the offset amplitude; and offsetting the initial position based on the offset amplitude to obtain the first sampling position.
[0108] Here, the current iteration offset count refers to the number of offset operations performed during multiple iterations of offsetting the initial position (usually counting from 1), which is equivalent to acquiring the sampling position in the current iteration. In this embodiment, the current iteration offset count is 1 during the process of obtaining the first sampling position. The offset amplitude is a comprehensive displacement vector obtained by weighting and adjusting the original offset and noise value according to the current iteration count, so that the offset amplitude decreases with the number of iterations. In this way, during multiple iterations of offsetting the initial position, the early offset amplitude is large and the later offset amplitude is small.
[0109] In this embodiment of the disclosure, during the process of multiple iterative offsets of the initial position, the offset magnitude of each iteration decreases with the current number of iterative offsets, so as to ensure that the process of simulating smoke dissipation of the displayed bullet screen object is more reasonable, thereby ensuring the display effect of the bullet screen.
[0110] In some embodiments, the offset is represented as a vector and the noise value is also represented as a vector. The offset and the noise value are added together to obtain the offset vector. The ratio of the offset vector to the current iteration offset number is determined as the offset magnitude.
[0111] Step 4: Based on the noise function and the i-th sampling position, determine the noise value corresponding to the i-th sampling position, where i takes the values 1, 2, ..., N-1, and N is an integer greater than 1.
[0112] It should be noted that step 4 is the same as step 1 above, and will not be repeated here.
[0113] Step 5: Based on the offset and the noise value corresponding to the i-th sampling position, offset the i-th sampling position to obtain the (i+1)-th sampling position.
[0114] In some embodiments, step 5 above includes: adjusting the offset amount and the noise value corresponding to the i-th sampling position based on the current iteration offset number to obtain the offset amplitude; and offsetting the i-th sampling position based on the offset amplitude to obtain the (i+1)-th sampling position.
[0115] In this embodiment, the current iteration offset number refers to the number of offset operations performed during multiple iterations of offsetting the initial position (usually counting from 1), which is equivalent to acquiring the sampling position in the current iteration. In this embodiment, the current iteration offset number is i+1 during the process of obtaining the (i+1)th sampling position. The offset magnitude is a comprehensive displacement vector obtained by weighting and adjusting the original offset and noise value according to the current iteration number, so that the offset magnitude decreases with the number of iterations. This results in a larger offset magnitude in the early stages and a smaller offset magnitude in the later stages during multiple iterations of offsetting the initial position.
[0116] It should be noted that step 5 is the same as step 3 above, and will not be repeated here.
[0117] It should be noted that the embodiments disclosed herein are only used as an example to illustrate obtaining the (i+1)th sampling position. In another embodiment, after step 3 above, the first sampling position is used to obtain the second sampling position according to steps 4-5 above; then, the second sampling position is used to obtain the third sampling position according to steps 4-5 above, and so on until the Nth sampling position is obtained, that is, a total of N sampling positions are obtained.
[0118] In this embodiment, by combining the noise function with the time-related offset, the pixel position is iteratively perturbed multiple times to generate a series of sampling positions. In this way, not only is the overall motion trend along the preset direction preserved, but also local randomness is introduced through each iteration, so that the motion trajectory presents a natural, non-repetitive and detailed organic change, ensuring that the bullet screen can simulate the dynamic process of smoke dissipation in the real environment, thereby ensuring the bullet screen display effect.
[0119] Step S404: Based on the reference barrage layer image frame, determine the pixel value corresponding to each sampling position.
[0120] In this embodiment, a reference bullet screen layer image frame is used as the source of the bullet screen content. Texture sampling is performed at each sampling position to obtain the pixel value corresponding to each sampling position. This process ensures that even if the bullet screen object is split into multiple display elements for diffusion, the visual attributes such as color and transparency of each display element remain consistent with the original bullet screen object, guaranteeing the display effect of the bullet screen in simulating the dynamic process of smoke dissipation in a real environment.
[0121] In some embodiments, step S404 includes: performing multi-scale transformation on the reference barrage layer image frame to obtain texture images corresponding to multiple scales respectively; determining a target scale that matches the sampling position from multiple scales based on the number of iteration offsets corresponding to the sampling position; and extracting the pixel value corresponding to the sampling position from the texture image corresponding to the target scale.
[0122] Multi-scale transformation refers to performing multiple transformations on the reference bullet screen layer image frame to obtain multiple texture images at different scales. In some embodiments, this can be achieved using multiple iterative scale transformations. Multiple iterative scale transformations involve downsampling the reference bullet screen layer image frame level by level, generating a series of images with progressively decreasing resolution, forming a mipmap (multi-level texture map) texture pyramid. For example, if the reference image frame has a scale of 1024×1024, the obtained scales are 1024×1024→512×512→256×256…→1×1. The texture images corresponding to each scale include the reference bullet screen layer image frame itself and other scaled-down images. The texture images corresponding to each scale are also called texture mipmaps. Each level of image at a specific resolution in the mipmap corresponds to a mip level. The higher the level, the smaller and blurrier the image, and the less detail. The iteration offset number corresponding to the sampling position refers to which iteration offset the sampling position was generated in (e.g., the 1st, 3rd, etc.), reflecting its temporal depth or motion stage in the diffusion trajectory. The target scale is a dynamically selected mipmap level based on the number of iterations and offsets, used to match the desired blur level for that sampling point. Pixel value extraction involves performing texture sampling at the sampling location within the selected target scale texture image to obtain the corresponding RGBA pixel value. This RGBA pixel value inherently contains the corresponding level of blur effect.
[0123] In this embodiment, to simulate the natural blurring and edge diffusion visual characteristics of smoke dissipation in a real environment, a complete Mipmap pyramid (i.e., downsampled textures at multiple scales) is constructed for the reference bullet screen layer image frame. Subsequently, during the multi-step sampling process, instead of uniformly reading colors from the original high-resolution texture, an appropriate mip level is dynamically selected based on the iteration offset number at each sampling position. By combining the mipmap mechanism with the iteration offset number to dynamically select the texture scale, a physically reasonable diffusion blur effect is achieved with extremely low computational overhead, enhancing the visual realism of the bullet screen object simulating smoke dissipation. Mipmap technology, by pre-generating a series of texture images with decreasing resolution, can achieve performance optimization, reduce memory bandwidth usage, and achieve anti-aliasing and avoid moiré patterns without additional computation due to the naturally generated blur effect of high mip levels. Its hardware acceleration characteristics make the visual perception smoother and more natural, improving overall rendering efficiency and image quality.
[0124] In some embodiments, the process of determining a target scale matching the sampling position from multiple scales includes: determining the target scale matching the sampling position from multiple scales based on the number of iteration offsets corresponding to the sampling position and the current frame time. In this embodiment of the disclosure, in order to simulate the natural blurring effect caused by the diffusion of smoke over time and space in the real world, not only the number of iteration offsets of the sampling position is considered, but also the current frame time is combined to determine the optimal target scale. Using a method based on the number of iteration offsets and the current frame time to determine the target scale can achieve a blurring effect that automatically changes over time, ensuring that the overall blur level increases with time, thus ensuring the effect of simulating smoke dissipation in the bullet screen object.
[0125] In some embodiments, the target scale is: float(steps - i) * t * 0.2, where steps represents the total number of iteration offsets, which is also equivalent to the total number of sampling positions obtained for each pixel, i represents the number of iteration offsets corresponding to a sampling position, float() represents the explicit conversion of the integer steps - i to a floating-point number; t represents the current frame time. In this embodiment, if the bullet screen object is displayed according to a preset period to simulate the dynamic process of smoke dissipation in a real environment, then t represents the time mapped by the current frame time within the current period; 0.2 is the scaling factor.
[0126] Step S405: Merge the pixel values corresponding to multiple sampling positions to obtain the pixel value of the pixel in the bullet screen layer.
[0127] In this embodiment of the disclosure, the current bullet screen layer image frame indicates the pixel value of each pixel in the display interface relative to the bullet screen layer. Therefore, after determining the pixel value of each pixel in the bullet screen layer according to the above steps S403-S405, the pixel values of each pixel in the bullet screen layer are combined to form the current bullet screen layer image frame.
[0128] In some embodiments, the pixel values corresponding to multiple sampling positions are fused by averaging to obtain the pixel value of the pixel in the bullet screen layer.
[0129] It should be noted that this embodiment of the disclosure uses a pixel-by-pixel calculation method to generate the current bullet screen layer image frame as an example for illustration. In another embodiment, steps S403-S405 are not required. Instead, other methods are used to generate the current bullet screen layer image frame corresponding to the current frame time based on a reference bullet screen layer image frame. In some embodiments, generating the current bullet screen layer image frame corresponding to the current frame time includes: allocating multiple pixels in the display interface to different processing threads for parallel calculation using the fragment shader of the graphics processor, with each processing thread calculating the allocated pixels to obtain the pixel values of the multiple pixels in the bullet screen layer.
[0130] A Graphics Processing Unit (GPU) is an electronic circuit specifically designed for processing graphics and image data. It possesses powerful parallel computing capabilities, enabling it to handle a large number of similar computational tasks simultaneously, making it suitable for real-time rendering of complex visual effects. A fragment shader, also known as a fragment shader, is a programmable stage in the GPU rendering pipeline responsible for calculating the color, depth, and transparency attributes of each "fragment" (which will eventually become a pixel) in an image. A processing thread is a logical path for an electronic device to execute program instructions. In a GPU, thousands of processing threads can run concurrently, each processing the data assigned to it independently. Parallel computing refers to the GPU simultaneously processing all pixels in the display interface using the same algorithm, but the data for each pixel does not interfere with each other.
[0131] In this embodiment, the entire display interface is divided into several pixels, and the data of these pixels is distributed to the GPU. The GPU's rendering engine starts an independent processing thread for each pixel (or a group of pixels) and executes the same computational logic in the fragment shader. By utilizing the parallel computing capabilities of the GPU fragment shader, the load is distributed across thousands of cores, breaking through the CPU's serial bottleneck and ensuring smooth rendering at high frame rates.
[0132] Step S406: Render the current bullet screen layer image frame in the display interface.
[0133] In this embodiment of the disclosure, during the process of the bullet screen object moving and displaying along a preset path, a frame-by-frame display method is adopted, and steps S402-S406 are executed frame by frame to generate the current bullet screen layer image frame that reflects the real-time form of the bullet screen object, and render it to the display interface. This allows the dynamic change process of the bullet screen object switching from the first display form to the second display form to be presented while displaying media resources.
[0134] Based on the embodiments shown above, this disclosure provides a flowchart illustrating a bullet screen display method, as follows: Figure 5 As shown, the method includes: 1. Initialize the GL (Open Graphics Library) environment: Create a Canvas element and obtain the GL rendering context. Check if the browser supports GL. If not, report an error and exit. Then set the default size of the Canvas to 1280×720 and configure the background color to complete the basic rendering environment setup.
[0135] 2. Shader program creation: Constructing vertex and fragment shaders, compiling vertex and fragment shaders, creating shader programs and linking them.
[0136] 3. Texture creation: Create a GL texture object.
[0137] 4. Rendering Loop: The entire rendering process is cyclical, with its rendering frequency related to the refresh rate (e.g., 60 frames per second). Each rendering cycle executes a similar process: First, based on the current frame time, the bullet screen position information matching the current frame time is obtained from the cached bullet screen layout data. Then, based on the bullet screen position information and the rendering parameters of the first display form, an off-screen reference bullet screen texture (i.e., the reference bullet screen layer image frame) is rendered. Subsequently, in the fragment shader, the following steps are executed sequentially: For each pixel in the display interface, a ten-layer fractal Perlin noise superposition algorithm is used to construct a natural perturbation field. Utilizing the frequencies of 10 noise levels, the initial... The initial position is mapped to the noise space corresponding to each noise frequency, obtaining the mapped position in each noise space. Then, for each mapped position, a noise function is used to obtain the corresponding noise value. The adjusted noise values corresponding to all frequencies are merged to form the final noise value of the pixel. An eight-step path sampling method combined with decreasing step weights is adopted to simulate the particle trajectory. Using the current frame time and the offset parameter in the preset direction, the displacement in the preset direction is calculated to simulate the offset of the display elements after the bullet screen object is split in the preset direction. Based on the noise function and the offset parameter, the initial position of the pixel is iteratively offset multiple times. The sampling position after each offset is obtained. During the multiple iterative offsets from the initial position, the offset magnitude of each iteration decreases with the current iteration offset number to ensure that the simulated smoke dissipation process of the displayed bullet screen object is more reasonable. Furthermore, when calculating the offset, a spatiotemporal progressive control and time squared acceleration mechanism are adopted to regulate the dissipation rhythm. Based on the delay time corresponding to the pixel, the current frame time is adjusted to obtain the local time of the pixel. The delay time is determined based on the initial position of the pixel. The process of determining the offset based on the mapped time and offset parameters includes: if the offset parameter is velocity, then the mapped time is multiplied by the velocity. The product is determined as the offset; if the offset parameter is acceleration, the product of the square of the mapped time and the acceleration is divided by 2 to determine the offset. Furthermore, a dynamic blur sampling method based on mipmaps is used to achieve a natural diffusion effect. Multi-scale transformations are performed on the reference bullet screen layer image frame to obtain texture images corresponding to multiple scales. Based on the number of iterations corresponding to the sampling position, a target scale matching the sampling position is determined from multiple scales. Pixel values corresponding to the sampling position are extracted from the texture image corresponding to the target scale. Finally, the pixel values corresponding to multiple sampling positions are fused to obtain the pixel value of the pixel in the bullet screen layer. After obtaining the pixel values of each pixel in the bullet screen layer in the above manner, Gamma correction and color processing are finally performed to output the current bullet screen layer image frame with a realistic smoke diffusion effect.
[0138] Based on the embodiments shown above, this disclosure provides a structural schematic diagram of a bullet screen display system, as follows: Figure 6As shown, the system includes the following five modules: 1. Bullet Screen Management Module: As the front-end control unit of the entire bullet screen effect system, it is responsible for the full lifecycle management of bullet screen objects, including downloading, creating, updating and destroying bullet screen objects.
[0139] 2. Special Effects Parameter Configuration Module: Responsible for initializing the configuration of special effects related parameters.
[0140] 3. Off-screen Rendering Module for Bullet Comments: This module completes the drawing of the bullet comment layout logic, refreshes the scrolling animation according to the timeline progress, and generates off-screen bullet comment textures (i.e., reference bullet comment layer image frames), such as... Figure 7 As shown.
[0141] 4. Special Effects Algorithm Rendering Module: This is the core processing unit of this solution. On the GPU side, it executes parallel processing on each pixel in the display interface through a fragment shader. It employs a ten-layer fractal Perlin noise superposition algorithm to construct a natural perturbation field. Using the frequencies of 10 noise levels, the initial position of each pixel is mapped to the noise space corresponding to each noise frequency, obtaining the mapped position in each noise space. Then, for each mapped position, a noise function is used to obtain the corresponding noise value. The adjusted noise values corresponding to all frequencies are merged to form the final noise value of the pixel. An eight-step path sampling method combined with decreasing step weights is used to simulate particle trajectories. Using the current frame time and the offset parameter in the preset direction, the displacement in the preset direction is calculated to simulate the offset of the display elements after the bullet screen object is split in the preset direction. Based on the noise function and offset parameters, the initial position of the pixel is iteratively offset multiple times to obtain the sampling position after each offset. During the multiple iterative offsets of the initial position, the offset amplitude of each iteration decreases with the current iteration offset number to ensure... The evidence shows that simulating the smoke dissipation process of the bullet screen object is more reasonable. Furthermore, when calculating the offset, a spatiotemporal progressive control and time square acceleration mechanism are used to regulate the dissipation rhythm. Based on the delay time corresponding to each pixel, the current frame time is adjusted to obtain the local time of the pixel, with the delay time determined based on the initial position of the pixel. The process of determining the offset based on the mapped time and offset parameters includes: if the offset parameter is velocity, the product of the mapped time and velocity is used to determine the offset; if the offset parameter is acceleration, the product of the square of the mapped time and the acceleration is divided by 2 to determine the offset. Additionally, a method based on Mipmap dynamic blur sampling is used to achieve a natural diffusion effect. Multi-scale transformations are performed on the reference bullet screen layer image frame to obtain texture images corresponding to multiple scales. Based on the number of iterations corresponding to the sampling position, a target scale matching the sampling position is determined from multiple scales. The pixel value corresponding to the sampling position is extracted from the texture image corresponding to the target scale. Finally, the pixel values corresponding to multiple sampling positions are fused to obtain the pixel value of the pixel in the bullet screen layer. After obtaining the pixel values of each pixel in the bullet screen layer using the above method, Gamma correction and color processing are performed to improve visual consistency, outputting an image frame of the current bullet screen layer with a realistic smoke effect. All algorithms work together to transform the original bullet screen texture into a physically realistic dynamic smoke effect.
[0142] 5. On-screen display module: As the final output stage, it combines the current bullet screen layer image frame, processed by special effects algorithms, with the main video frame and outputs it to the display interface, such as... Figure 8 As shown.
[0143] This disclosure proposes a GPU-based parallel rendering system for bullet screen smoke dissipation effects. The core idea is to take the bullet screen texture image (i.e., the reference bullet screen layer image frame) as input, and apply a physically based smoke dissipation algorithm while processing each pixel in parallel using the GPU fragment shader. The final output is a bullet screen image (i.e., the bullet screen layer image) with a natural dissipation effect. The system uses multi-layer fractal Perlin noise to construct a spatially continuous natural perturbation field; it tracks the motion trajectory of particles in the perturbation field through a multi-step path integral sampling mechanism to simulate the smoke dissipation process; it combines spatiotemporal progressive control to achieve a "slow start, fast end" natural dissipation rhythm; and it utilizes Mipmap blur sampling technology to efficiently achieve a natural softening visual effect as the diffusion distance increases without additional blur calculations, thereby enhancing the realism of bullet screen object dissipation. Simultaneously, the system builds a GPU parallel rendering architecture based on graphics technologies such as OpenGL, fully leveraging hardware acceleration capabilities. It adopts a non-particle-based scheme to break through the traditional particle number limitation, achieving high-density, high-performance, and real-time bullet screen smoke effect rendering.
[0144] In this embodiment, a ten-layer fractal Perlin noise superposition algorithm is introduced into the bullet screen scene to generate a fractal perturbation field that combines macroscopic disturbances and microscopic turbulence, highly replicating the physical characteristics of natural smoke. An eight-step path sampling and step-decreasing weight mechanism is designed to make the particle trajectory exhibit a realistic diffusion behavior of "fast first, then slow; coarse first, then fine." A spatiotemporal progressive control and time square acceleration mechanism is proposed to achieve a slow start-fast end dissipation rhythm that conforms to human eye reading habits, starting from the upper left corner. Dynamic blur sampling is achieved using Mipmap hardware characteristics, automatically selecting the mip level according to the number of sampling steps and time, achieving a visual effect of natural softening with diffusion without additional blur calculations. The overall architecture is based on a fully parallel rendering architecture built on GPU fragment shaders, with all pixels executing the above algorithms independently and synchronously, giving full play to SIMD capabilities, maintaining a high frame rate of 60 FPS (frames per second) and low CPU usage while supporting high-resolution real-time rendering. This solution not only breaks through the limitations of traditional bullet screen expressiveness but also achieves an excellent balance between performance, realism, and scalability.
[0145] In this embodiment of the disclosure, in order to achieve a better balance between performance and image quality, an adaptive sampling mechanism can be introduced: the image gradient or variance used to represent the content complexity is calculated in the shader, and the number of path sampling steps (i.e. the number of sampling positions obtained above) is dynamically adjusted based on the content complexity of the image; the number of steps is reduced in simple areas to improve performance, and the number of steps is increased in complex areas to improve quality.
[0146] In this embodiment of the disclosure, to further enhance the immersive experience, the dynamic process of the smoke dissipation of the current bullet screen object can be extended to three-dimensional space, using GL's 3D texture or volumetric texture; Perlin noise and path sampling are applied in the 3D space to present a 3D smoke dissipation effect with realistic volume and spatial hierarchy.
[0147] In this embodiment, audio signals can be integrated into the smoke animation. Specifically, the audio spectrum of the played audio is analyzed in real time through the Audio API (Audio Application Programming Interface), and the spectrum data is passed to the shader through a uniform array. The dissipation parameters are adjusted according to the audio intensity, so that the diffusion rhythm and intensity of the bullet screen smoke are precisely synchronized with the music beat or voice fluctuations, ensuring that the dissipation effect of the bullet screen object is synchronized with the audio rhythm.
[0148] The bullet screen smoke dissipation effect technology in this embodiment has broad application prospects: In video live streaming platforms, it can provide broadcasters and viewers with unique and highly expressive bullet screen visual effects, enhancing interactivity and immersion; in online video websites, it supports high-quality, customizable bullet screen dissipation effects, improving user viewing experience and stickiness; in the field of game development, it can be used to implement natural dissipation animations of UI (User Interface) text and prompts, reducing development costs and improving image quality without pre-rendering; in VR (Virtual Reality) / AR (Augmented Reality) applications, it can dissipate text information in three-dimensional space in a way that conforms to physical laws, enhancing the realism and interactive response of the virtual environment; in digital marketing scenarios, it can create dynamic visual memory points for brand activities, online press conferences, or H5 (HyperText Markup Language Version 5) pages, enhancing the appeal of dissemination; at the same time, this technology also provides a new expressive tool for digital art creation, supporting interactive art installations and new media exhibitions, promoting innovation and boundary expansion of art forms.
[0149] It should be noted that the above-mentioned multiple optional embodiments can be combined in any way, and this disclosure does not limit this. For example, during the process of displaying media resources on the display interface, the current bullet screen layer image frame is rendered periodically according to the above steps S402-S406 according to a preset period, so as to periodically simulate the dynamic process of smoke dissipation in the real environment during the process of the bullet screen object moving and displaying along a preset path on the display interface. That is, the bullet screen object is displayed to gradually dissipate and disappear, and then it is clearly displayed again, and then gradually dissipates and disappears again.
[0150] Corresponding to the aforementioned bullet screen display method, this disclosure further provides a bullet screen display device. Figure 9 This is a schematic diagram of a bullet screen display device provided in an embodiment of the present disclosure. The device can be implemented by software and / or hardware, and is generally integrated into an electronic device, such as... Figure 9 As shown, the bullet screen display device includes: The display module 901 is used to obtain the bullet screen object corresponding to the media resource during the process of displaying media resources on the display interface, and control the bullet screen object to move and display along a preset path on the display interface. The display module 901 is also used to control the bullet screen object to switch from a first display form to a second display form containing multiple display elements during the process of moving and displaying the bullet screen object, and to control the multiple display elements to move and display along their respective diffusion directions; the transparency of the multiple display elements changes to a preset transparency value according to preset rules during the process of moving and displaying; the multiple display elements are obtained by splitting the bullet screen object, and the diffusion direction corresponding to each display element is determined after randomly perturbing the preset direction.
[0151] In some embodiments, the display module 901 is used to control the bullet screen object to move and display along a preset path on the display interface in a first display form; During the movement and display of the bullet screen object, the system controls the bullet screen object to switch from a first display mode to a second display mode containing multiple display elements, and controls the multiple display elements to move and display along their respective diffusion directions, including: During the movement and display of the bullet screen object, in response to the trigger operation of the first position in the display interface, the bullet screen object in the first area is controlled to switch from the first display form to the second display form containing multiple display elements, and the multiple display elements are controlled to move and display along their respective diffusion directions. The first region is the area defined in the display interface with the first position as the center.
[0152] In some embodiments, the display module 901 is further configured to control the bullet screen object in the second area to switch from a second display mode to a first display mode in response to a trigger operation on the second position in the display interface; The second region is the area defined in the display interface with the second position as the center.
[0153] In some embodiments, the media resource includes multiple bullet screen objects. For any two bullet screen objects, the time when the first bullet screen object switches to the second display mode is earlier than the time when the second bullet screen object switches to the second display mode. The position of the first bullet screen object is further away from the start of the preset path than the position of the second bullet screen object.
[0154] In some embodiments, the display module 901 is further configured to control the bullet screen object to switch from the second display mode back to the first display mode in response to the change in transparency of multiple display elements to a preset transparency value.
[0155] In some embodiments, the display module 901 is configured to control the bullet screen object to switch from a first display form to a second display form containing multiple display elements according to a preset period during the process of moving and displaying the bullet screen object, and to control the multiple display elements to move and display along their respective diffusion directions; the transparency of the multiple display elements changes to a preset transparency value according to a preset rule during the process of moving and displaying; and to control the display form of the bullet screen object to switch back to the first display form at the end of each preset period.
[0156] In some embodiments, the display module 901 is configured to perform the following operations for each frame time according to the rendering sequence of each image frame during the process of moving and displaying the bullet screen object: obtain a reference bullet screen layer image frame corresponding to the current content frame of the media resource, the reference bullet screen layer image frame being used to represent the display status of the bullet screen object in the display interface at the current frame time when the bullet screen object moves and displays in a first display form; generate a current bullet screen layer image frame corresponding to the current frame time based on the reference bullet screen layer image frame, the current bullet screen layer image frame being used to represent the display status of the bullet screen object in the display interface at the current frame time when the bullet screen object enters a second display form for moving and displaying; and render the current bullet screen layer image frame in the display interface.
[0157] In some embodiments, the current bullet screen layer image frame indicates the pixel value of each pixel in the display interface relative to the bullet screen layer; the display module 901 is further configured to obtain the media resource layer image frame corresponding to the current frame time in the media resources, and the media resource layer image frame indicates the pixel value of each pixel in the display interface relative to the media resource layer. The display module 901 is used to determine the sum of pixel values of the same pixel in the display interface in the bullet screen layer and the media resource layer based on the current bullet screen layer image frame and the media resource layer image frame; to render the current image frame based on the sum of pixel values of each pixel in the display interface; and to display the current image frame in the display interface.
[0158] In some embodiments, the current bullet screen layer image frame indicates the pixel value of each pixel in the display interface relative to the bullet screen layer; the display module 901 is used to perform multiple iterative offsets on the initial position of each pixel in the display interface based on a noise function and an offset parameter to obtain the sampling position after each offset. The noise function is used to perturb the position of the pixel, and the offset parameter indicates the amount of change of the position of the pixel along a preset direction over time; the pixel value corresponding to each sampling position is determined based on the reference bullet screen layer image frame; the pixel values corresponding to multiple sampling positions are fused to obtain the pixel value of the pixel in the bullet screen layer.
[0159] In some embodiments, the display module 901 is configured to: determine the noise value corresponding to the initial position based on a noise function and the initial position of the pixel, wherein the noise function is used to perturb the position of the pixel; determine the offset based on the current frame time and offset parameters; offset the initial position of the pixel based on the offset and the noise value corresponding to the initial position to obtain the first sampling position; determine the noise value corresponding to the i-th sampling position based on the noise function and the i-th sampling position, where i takes the value 1, 2, ..., N-1, and N is an integer greater than 1; and offset the i-th sampling position based on the offset and the noise value corresponding to the i-th sampling position to obtain the (i+1)-th sampling position.
[0160] In some embodiments, the display module 901 is configured to map the initial position of a pixel to a noise space corresponding to each noise frequency based on multiple noise frequencies, thereby obtaining a mapped position in each noise space; for each mapped position, to obtain a noise value corresponding to the mapped position based on the mapped position and a noise function; to adjust the noise value corresponding to the mapped position based on the amplitude attenuation coefficient corresponding to the mapped position, thereby obtaining an adjusted noise value corresponding to the mapped position, wherein the amplitude attenuation coefficient is the reciprocal of the noise frequency corresponding to the mapped position; and to fuse the adjusted noise values corresponding to multiple mapped positions to obtain a noise value corresponding to the initial position.
[0161] In some embodiments, the display module 901 is used to adjust the current frame time based on the delay time corresponding to the pixel to obtain the local time of the pixel, wherein the delay time is determined based on the initial position of the pixel; and to determine the offset based on the local time of the pixel and the offset parameter.
[0162] In some embodiments, the display module 901 is used to adjust the offset amount and the noise value corresponding to the i-th sampling position based on the current iteration offset number to obtain the offset amplitude; and to offset the i-th sampling position based on the offset amplitude to obtain the (i+1)-th sampling position.
[0163] In some embodiments, the display module 901 is used to perform multi-scale transformation on the reference barrage layer image frame to obtain texture images corresponding to multiple scales respectively; based on the iteration offset number corresponding to the sampling position and the current frame time, determine the target scale that matches the sampling position from multiple scales; and extract the pixel value corresponding to the sampling position from the texture image corresponding to the target scale.
[0164] In some embodiments, the display module 901 is configured to allocate multiple pixels in the display interface to different processing threads for parallel computation via the fragment shader of the graphics processor, and each processing thread performs calculations on the allocated pixels to obtain the pixel values of the multiple pixels in the bullet screen layer.
[0165] The bullet screen display device provided in this disclosure can execute the bullet screen display method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0166] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device embodiments can be referred to the corresponding process in the method embodiments, and will not be repeated here.
[0167] This disclosure provides an electronic device, which includes: a storage device storing a computer program thereon; and a processing device for executing the computer program in the storage device to implement the steps of any method of this disclosure.
[0168] The following is for reference. Figure 10 The diagram illustrates a structural schematic of an electronic device 1000 suitable for implementing embodiments of the present disclosure. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 10 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0169] like Figure 10As shown, the electronic device 1000 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1008 into a random access memory (RAM) 1003. The RAM 1003 also stores various programs and data required for the operation of the electronic device 1000. The processing unit 1001, ROM 1002, and RAM 1003 are interconnected via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0170] Typically, the following devices can be connected to the I / O interface 1005: input devices 1006 including, for example, a touchscreen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 1007 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1008 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication device 1009 allows electronic device 1000 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 10 An electronic device 1000 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0171] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 1009, or installed from storage device 1008, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of embodiments of this disclosure.
[0172] In addition to the methods and apparatus described above, embodiments of this disclosure can also be computer program products, comprising computer program instructions that, when executed by a processor, cause the processor to perform the image processing methods provided in the embodiments of this disclosure. The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of this disclosure. Programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on a user's computing device, partially on a user's device, as a standalone software package, partially on a user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0173] Furthermore, embodiments of this disclosure may also be computer-readable storage media storing computer program instructions, which, when executed by a processor, cause the processor to perform the bullet screen display method provided in embodiments of this disclosure.
[0174] Computer-readable storage media may take the form of any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may, for example, include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0175] This disclosure also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the bullet screen display method in this disclosure.
[0176] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0177] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0178] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0179] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0180] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0181] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for displaying bullet comments, characterized in that, include: During the process of displaying media resources on the display interface, the bullet screen object corresponding to the media resource is obtained, and the bullet screen object is controlled to move and display along a preset path on the display interface. During the movement and display of the bullet screen object, the bullet screen object is controlled to switch from a first display form to a second display form containing multiple display elements, and the multiple display elements are controlled to move and display along their respective diffusion directions; the transparency of the multiple display elements changes to a preset transparency value according to a preset rule during the movement and display process; the multiple display elements are obtained by splitting the bullet screen object, and the diffusion direction corresponding to each display element is determined after randomly perturbing the preset direction.
2. The method according to claim 1, characterized in that, The control of the bullet screen object to move and display along a preset path on the display interface includes: Control the bullet screen object to move and display it on the display interface along the preset path in the first display form; During the process of moving and displaying the bullet screen object, controlling the bullet screen object to switch from a first display mode to a second display mode containing multiple display elements, and controlling the multiple display elements to move and display along their respective diffusion directions, includes: During the process of moving and displaying the bullet screen object, in response to the trigger operation of the first position in the display interface, the bullet screen object in the first area is controlled to switch from the first display form to a second display form containing multiple display elements, and the multiple display elements are controlled to move and display along their respective diffusion directions. The first region is the area defined in the display interface with the first position as the center.
3. The method according to claim 1, characterized in that, During the process of moving and displaying the bullet screen object, after controlling the bullet screen object to switch from a first display mode to a second display mode containing multiple display elements, and controlling the multiple display elements to move and display along their respective diffusion directions, the method further includes: In response to a trigger operation on the second position in the display interface, the bullet screen object in the second area is controlled to switch from the second display mode to the first display mode; The second region is the area defined in the display interface with the second position as the center.
4. The method according to claim 1, characterized in that, The media resource includes multiple bullet screen objects. For any two bullet screen objects, the time when the first bullet screen object switches to the second display mode is earlier than the time when the second bullet screen object switches to the second display mode. The position of the first bullet screen object is further away from the start of the preset path than the position of the second bullet screen object.
5. The method according to claim 1, characterized in that, During the process of moving and displaying the bullet screen object, after controlling the bullet screen object to switch from a first display mode to a second display mode containing multiple display elements, and controlling the multiple display elements to move and display along their respective diffusion directions, the method further includes: In response to the change in transparency of the plurality of display elements to the preset transparency value, the bullet screen object is controlled to switch from the second display mode back to the first display mode.
6. The method according to claim 1, characterized in that, During the process of moving and displaying the bullet screen object, controlling the bullet screen object to switch from a first display mode to a second display mode containing multiple display elements, and controlling the multiple display elements to move and display along their respective diffusion directions, includes: During the process of moving and displaying the bullet screen object, the bullet screen object is controlled to switch from the first display form to a second display form containing multiple display elements according to a preset cycle, and the multiple display elements are controlled to move and display along their respective diffusion directions. Specifically, at the end of each preset cycle, the display mode of the bullet screen object is controlled to switch to the first display mode.
7. The method according to any one of claims 1 to 6, characterized in that, During the process of moving and displaying the bullet screen object, controlling the bullet screen object to switch from a first display mode to a second display mode containing multiple display elements, and controlling the multiple display elements to move and display along their respective diffusion directions, includes: During the movement and display of the bullet screen object, the following operations are performed for each frame time according to the rendering sequence of each image frame: Obtain the reference barrage layer image frame corresponding to the current content frame of the media resource. The reference barrage layer image frame is used to represent the display status of the barrage object on the display interface at the current frame time when the barrage object moves and displays on the display interface in the first display form. Based on the reference barrage layer image frame, a current barrage layer image frame corresponding to the current frame time is generated. The current barrage layer image frame is used to represent the display status of the barrage object in the display interface at the current frame time when the barrage object enters the second display mode for moving display. The current bullet screen layer image frame is rendered in the display interface.
8. The method according to claim 7, characterized in that, The current bullet screen layer image frame indicates the pixel value of each pixel in the display interface relative to the bullet screen layer; Before rendering the current bullet screen layer image frame in the display interface, the method further includes: Obtain the media resource layer image frame corresponding to the current frame time in the media resource, wherein the media resource layer image frame indicates the pixel value of each pixel point in the display interface relative to the media resource layer; Rendering the current bullet screen layer image frame in the display interface includes: Based on the current bullet screen layer image frame and the media resource layer image frame, determine the sum of the pixel values of the same pixel in the display interface corresponding to the bullet screen layer and the media resource layer; based on the sum of the pixel values corresponding to each pixel in the display interface, render the current image frame; The current image frame is displayed in the display interface.
9. The method according to claim 7, characterized in that, The current bullet screen layer image frame indicates the pixel value of each pixel in the display interface relative to the bullet screen layer; The step of generating the current bullet screen layer image frame corresponding to the current frame time based on the reference bullet screen layer image frame includes: For each pixel in the display interface, the initial position of the pixel is iteratively offset multiple times based on the noise function and the offset parameter to obtain the sampling position after each offset. The noise function is used to perturb the position of the pixel, and the offset parameter indicates the amount of change of the position of the pixel along the preset direction over time. Based on the reference barrage layer image frame, the pixel value corresponding to each sampling position is determined respectively; The pixel values corresponding to multiple sampling positions are fused to obtain the pixel value of the pixel in the bullet screen layer.
10. The method according to claim 9, characterized in that, The step of iteratively shifting the initial position of the pixel based on the noise function and the shift parameter to obtain the sampling position after each shift includes: Based on the noise function and the initial position of the pixel, the noise value corresponding to the initial position is determined, and the noise function is used to perturb the position of the pixel; The offset is determined based on the current frame time and offset parameters; Based on the offset and the noise value corresponding to the initial position, the initial position of the pixel is offset to obtain the first sampling position; Based on the noise function and the i-th sampling position, determine the noise value corresponding to the i-th sampling position, where i takes the value 1, 2, ..., N-1, and N is an integer greater than 1; Based on the offset and the noise value corresponding to the i-th sampling position, the i-th sampling position is offset to obtain the (i+1)-th sampling position.
11. The method according to claim 10, characterized in that, The step of determining the noise value corresponding to the initial position based on the noise function and the initial position of the pixel includes: Based on multiple noise frequencies, the initial position of the pixel is mapped to the noise space corresponding to each noise frequency, thereby obtaining the mapped position in each noise space; For each mapping position, based on the mapping position and the noise function, the noise value corresponding to the mapping position is obtained; based on the amplitude attenuation coefficient corresponding to the mapping position, the noise value corresponding to the mapping position is adjusted to obtain the adjusted noise value corresponding to the mapping position, wherein the amplitude attenuation coefficient is the reciprocal of the noise frequency corresponding to the mapping position; The adjusted noise values corresponding to multiple mapping positions are fused together to obtain the noise value corresponding to the initial position.
12. The method according to claim 10, characterized in that, The step of determining the offset based on the current frame time and offset parameters includes: Based on the delay time corresponding to the pixel, the current frame time is adjusted to obtain the local time of the pixel, wherein the delay time is determined based on the initial position of the pixel; The offset is determined based on the local time of the pixel and the offset parameter.
13. The method according to claim 10, characterized in that, The step of offsetting the i-th sampling position based on the offset and the noise value corresponding to the i-th sampling position to obtain the (i+1)-th sampling position includes: Based on the current iteration offset number, the offset amount and the noise value corresponding to the i-th sampling position are adjusted to obtain the offset amplitude; Based on the offset magnitude, the i-th sampling position is offset to obtain the (i+1)-th sampling position.
14. The method according to claim 9, characterized in that, The step of determining the pixel value corresponding to each sampling position based on the reference barrage layer image frame includes: Perform multi-scale transformation on the reference barrage layer image frame to obtain texture images corresponding to multiple scales respectively; Based on the iteration offset number corresponding to the sampling position and the current frame time, a target scale that matches the sampling position is determined from the multiple scales; Extract the pixel value corresponding to the sampling position from the texture image corresponding to the target scale.
15. The method according to claim 7, characterized in that, The current bullet screen layer image frame indicates the pixel value of each pixel in the display interface relative to the bullet screen layer; The step of generating the current bullet screen layer image frame corresponding to the current frame time based on the reference bullet screen layer image frame includes: The fragment shader of the graphics processor distributes multiple pixels in the display interface to different processing threads for parallel computation. Each processing thread calculates the assigned pixels to obtain the pixel values of the multiple pixels in the bullet screen layer.
16. A device for displaying bullet screen objects, characterized in that, include: The display module is used to obtain the bullet screen object corresponding to the media resource during the process of displaying media resources on the display interface, and control the bullet screen object to move and display along a preset path on the display interface. The display module is further configured to control the bullet screen object to switch from a first display form to a second display form containing multiple display elements during the movement and display of the bullet screen object, and to control the multiple display elements to move and display along their respective diffusion directions; the transparency of the multiple display elements changes to a preset transparency value according to a preset rule during the movement and display process; the multiple display elements are obtained by splitting the bullet screen object, and the diffusion direction corresponding to each display element is determined after randomly perturbing the preset direction.
17. An electronic device, characterized in that, The electronic device includes: A storage device on which computer programs are stored; A processing device for executing the computer program in the storage device to implement the bullet screen display method according to any one of claims 1-15.
18. A computer-readable storage medium, characterized in that, The storage medium stores a computer program for executing the bullet screen display method according to any one of claims 1-15.
19. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the bullet screen display method according to any one of claims 1-15.