Corrugated special effect generation method and device, electronic equipment, storage medium and program product
By setting the visual parameters and display position of the ripple effect, and providing multi-dimensional controls and trigger operations to generate dynamic effects, the problem of the inflexible control of water ripple effects in existing technologies is solved, achieving rich visual effects and efficient user interaction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING ZITIAO NETWORK TECH CO LTD
- Filing Date
- 2026-01-16
- Publication Date
- 2026-04-17
AI Technical Summary
The existing technology cannot flexibly control water ripple effects, resulting in a monotonous visual effect that lacks realism and flexibility.
By setting the visual parameters and display position of the ripple effect, a ripple effect can be generated. Multi-dimensional controls are provided for fine-grained control, including adjusting the number, shape, and size of the effect, as well as generating dynamic effects based on trigger operations and continuous motion trajectories.
It enables flexible control of the ripple effect, enhances the visual experience and creative possibilities, strengthens the realism and interactivity of the effect, and improves the user's immersion and enjoyment.
Smart Images

Figure CN121888035A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of special effects processing, and more particularly to a method, apparatus, electronic device, storage medium, and program product for generating ripple effects. Background Technology
[0002] In the technology of simulating water ripples in videos, only pre-made special effects can be used, and the water ripple effects cannot be flexibly controlled, resulting in monotonous effects, lack of realism and flexibility, and poor visual effects of water ripples. Summary of the Invention
[0003] This disclosure proposes a method, apparatus, electronic device, storage medium, and program product for generating ripple effects, which at least partially solves the technical problems of poor ripple effects in related technologies.
[0004] The first aspect of this disclosure provides a method for generating ripple effects, including: Display media content; Set the visual parameters of the ripple effect and its display position in the media content; The ripple effect is generated based on the visual parameters and the display position in the media content.
[0005] A second aspect of this disclosure provides a ripple effect generation device, comprising: The display module is used to display media content; The settings module is used to set the visual parameters of the ripple effect and its display position in the media content; The display module is also used to generate the ripple effect based on the display position of the visual parameters in the media content.
[0006] A third aspect of this disclosure provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method as described in the first aspect.
[0007] A fourth aspect of this disclosure provides a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method described in the first aspect.
[0008] A fifth aspect of this disclosure provides a computer program product including computer program instructions that, when executed on a computer, cause the computer to perform the method as described in the first aspect.
[0009] As can be seen from the above, the ripple effect generation method, apparatus, electronic device, storage medium, and program product provided in this disclosure generate ripple effects by setting the visual parameters of the ripple effect and its specific display position in media content. This allows for flexible control of the visual effects of the ripple effect, enhancing the user's visual experience and creative scope. Attached Figure Description
[0010] To more clearly illustrate the technical solutions in this disclosure or related technologies, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 This is a schematic diagram of the ripple effect generation architecture according to an embodiment of the present disclosure.
[0012] Figure 2 This is a schematic diagram of the hardware structure of an exemplary electronic device according to an embodiment of the present disclosure.
[0013] Figure 3 This is a flowchart illustrating the method for generating ripple effects according to an embodiment of the present disclosure.
[0014] Figure 4 This is a schematic diagram of the display interface of an embodiment of this disclosure.
[0015] Figure 5 This is a schematic diagram illustrating the setting of the ripple effect in an embodiment of this disclosure.
[0016] Figure 6 This is a schematic diagram of a continuous ripple effect according to an embodiment of the present disclosure.
[0017] Figure 7 This is a schematic diagram of alternating rendering of an embodiment of the present disclosure.
[0018] Figure 8 This is a schematic diagram of a ripple effect generation device according to an embodiment of the present disclosure. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this disclosure clearer, the following detailed description is provided in conjunction with specific embodiments and the accompanying drawings.
[0020] It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of this disclosure should have the ordinary meaning understood by one of ordinary skill in the art to which this disclosure pertains. The terms "first," "second," and similar terms used in the embodiments of this disclosure do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0021] It is understood that before using the technical solutions disclosed in the 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 through appropriate means in accordance with relevant laws and regulations, and user authorization should be obtained. For example, in response to receiving a user's active request, a prompt message may be sent to the user to clearly inform the user 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 electronic devices, applications, servers, or storage media that perform the operations of the technical solutions of this disclosure, based on the prompt message.
[0022] 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.
[0023] Figure 1 A schematic diagram of the ripple effect generation architecture according to an embodiment of this disclosure is shown. (See reference...) Figure 1 The ripple effect generation architecture 100 may include a server 110, a terminal 120, and a network 130 providing a communication link. The server 110 and the terminal 120 can be connected via a wired or wireless network 130. The server 110 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, security services, and CDN.
[0024] Terminal 120 can be implemented in hardware or software. For example, when terminal 120 is implemented in hardware, it can be various electronic devices with a display screen and support page display, including but not limited to smartphones, tablets, e-book readers, laptops, and desktop computers. When terminal 120 is implemented in software, it can be installed in the electronic devices listed above; it can be implemented as multiple software programs or software modules (e.g., software programs or software modules used to provide distributed services) or as a single software program or software module, without specific limitations.
[0025] It should be noted that the ripple effect generation method provided in this embodiment can be executed by terminal 120, server 110, or jointly by terminal 120 and server 110. It should be understood that... Figure 1 The number of terminals, networks, and servers shown is for illustrative purposes only and is not intended to be a limitation. Any number of terminals, networks, and servers can be used depending on implementation needs.
[0026] Figure 2 A schematic diagram of the hardware structure of an exemplary electronic device 200 provided in an embodiment of this disclosure is shown. For example... Figure 2 As shown, the electronic device 200 may include: a processor 202, a memory 204, a network module 206, a peripheral interface 208, and a bus 210. The processor 202, memory 204, network module 206, and peripheral interface 208 are interconnected within the electronic device 200 via the bus 210.
[0027] Processor 202 may be a Central Processing Unit (CPU), a Neural Processing Unit (NPU), a Microcontroller (MCU), a programmable logic device, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits. Processor 202 can be used to perform functions related to the techniques described in this disclosure. In some embodiments, processor 202 may also include multiple processors integrated as a single logic component. For example, such as... Figure 2 As shown, processor 202 may include multiple processors 202a, 202b and 202c.
[0028] Memory 204 can be configured to store data (e.g., instructions, computer code, etc.). Figure 2As shown, the data stored in memory 204 may include program instructions (e.g., program instructions for implementing the ripple effect generation method of the embodiments of this disclosure) and data to be processed (e.g., the memory may store configuration documents of other modules, etc.). Processor 202 may also access the program instructions and data stored in memory 204 and execute the program instructions to operate on the data to be processed. Memory 204 may include volatile storage devices or non-volatile storage devices. In some embodiments, memory 204 may include random access memory (RAM), read-only memory (ROM), optical disk, magnetic disk, hard disk, solid-state drive (SSD), flash memory, memory stick, etc.
[0029] Network module 206 can be configured to provide communication with other external devices to electronic device 200 via a network. This network can be any wired or wireless network capable of transmitting and receiving data. For example, the network can be a wired network, a local wireless network (e.g., Bluetooth, WiFi, Near Field Communication (NFC), etc.), a cellular network, the Internet, or a combination thereof. It is understood that the type of network is not limited to the specific examples described above. In some embodiments, network module 206 may include any combination of any number of network interface controllers (NICs), radio frequency modules, transceivers, modems, routers, gateways, adapters, cellular network chips, etc.
[0030] The peripheral interface 208 can be configured to connect the electronic device 200 to one or more peripheral devices to enable information input and output. For example, peripheral devices may include input devices such as keyboards, mice, touchpads, touch screens, microphones, and various sensors, as well as output devices such as displays, speakers, vibrators, and indicator lights.
[0031] Bus 210 can be configured to transmit information between various components of electronic device 200 (e.g., processor 202, memory 204, network module 206, and peripheral interface 208), such as internal buses (e.g., processor-memory bus), external buses (USB port, PCI-E bus), etc.
[0032] It should be noted that although the architecture of the above-described electronic device 200 only shows the processor 202, memory 204, network module 206, peripheral interface 208, and bus 210, in specific implementations, the architecture of the electronic device 200 may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the architecture of the above-described electronic device 200 may only include the components necessary for implementing the embodiments of this disclosure, and does not necessarily include all the components shown in the figures.
[0033] See Figure 3 , Figure 3A schematic flowchart of a ripple effect generation method according to an embodiment of the present disclosure is shown. The ripple effect generation method according to an embodiment of the present disclosure can be deployed on a server or a terminal. Figure 3 In the process, the ripple effect generation method 300 may further include the following steps.
[0034] In step S310, the media content is displayed.
[0035] Media content can be an information carrier disseminated through a specific medium, such as text, images, audio, animation, and video. This media content can be displayed on the interface. See details... Figure 4 , Figure 4 A schematic diagram of a display interface according to an embodiment of the present disclosure is shown. Figure 4 In the middle, the display interface 400 can display media content 410.
[0036] In step S320, the visual parameters of the ripple effect and its display position in the media content are set.
[0037] The ripple effect refers to a dynamic visual effect that simulates wave patterns. For example, adding a ripple effect to a video can make a static plane appear as dynamic ripples, or cause the edges of text / images to distort and deform in a ripple-like manner. Visual parameters refer to the key parameters that control the appearance of the ripple effect. Display position refers to the spatial positioning of the ripple effect within the media content, which can be determined by a coordinate system or relative position anchor points. For example, this display position could be the center of the ripple effect. By setting the visual parameters and display position of the ripple effect, flexible control over its dynamic characteristics can be achieved, enhancing the user's visual experience and creative possibilities.
[0038] In some embodiments, setting the display position of the ripple effect within the media content includes: Display location control; In response to a first setting operation for the position control, the display position is determined; or, In response to a trigger operation on the media content, the display position is determined based on the trigger position of the trigger operation.
[0039] The display interface includes visual interactive tools for intuitively adjusting the coverage area of the ripple effect. A display position control allows adjustment of the center position of the ripple effect when it appears; the first setting operation refers to the interactive operation of the display position control. A trigger operation refers to the interactive behavior of the media content, used to set the display position on the directly displayed media content. Display position controls such as anchor point drag boxes or coordinate input fields can be provided, allowing users to determine the display position through dragging, numerical adjustment, or template selection. Furthermore, an effect overlay can be dynamically generated based on trigger coordinates or gesture range at any location or defined area within the media content (e.g., after clicking an object in the media content, the ripple spreads outward from the clicked location).
[0040] like Figure 4 As shown, the display position control 420 may include a horizontal position control 421 and a vertical position control 422. The horizontal position control 421 can adjust the horizontal position of the ripple effect 430, and the vertical position control 422 can adjust the vertical position of the ripple effect 430. The ripple effect 430 can be moved left or right by sliding the slider on the horizontal position control 421, and the ripple effect 430 can be moved up or down by sliding the slider on the vertical position control 422.
[0041] In some embodiments, the visual parameters further include at least one of the following: number of effects, ripple shape, or ripple size; wherein the number of effects is used to control the number of ripple effects; the ripple shape is used to control the ripple outline of the ripple effect; and the ripple size is used to control the initial outline size of the ripple effect. The visual parameters for the ripple effect are then set, including: Display at least one of the following: effect quantity control, ripple shape control, and ripple size control; In response to a second setting operation for the effect quantity control, the quantity of the ripple effect is determined; In response to a third setting operation for the ripple shape control, the ripple outline of the ripple effect is set; In response to a fourth setting operation for the ripple size control, the initial outline size of the ripple effect is set.
[0042] Furthermore, the display interface provides multi-dimensional visual parameter controls for precise control of the ripple effect. Users can select the number of displayed effects (e.g., a slider to adjust the number of ripples from 1-20), the ripple shape (e.g., selecting from preset contours such as circles, ellipses, and waves, or customizing curves), and the ripple size (e.g., inputting pixel values or scaling the initial ripple diameter). Parameters are captured in real-time and the effect is dynamically rendered through second, third, and fourth type of setting operations (e.g., dragging sliders, clicking to select, and inputting values). This allows for the creation of complex fluid dynamics (e.g., in a rainstorm scene) through multiple ripple overlays, and the use of ripples of specific shapes / sizes to highlight key elements (e.g., using large-sized wave-shaped ripples to emphasize water flow). The independent parameter adjustment mechanism ensures users can quickly balance visual effects and performance overhead, ultimately achieving diverse dynamic expressions ranging from delicate ripples to violent surges. Compared to traditional, uncontrolled water ripple effects, the ripple effect disclosed here not only improves the flexibility of effect control but also achieves richer visual effects.
[0043] like Figure 4 As shown, the effect quantity control 440 can be used to adjust the quantity of ripple effects. For example, the quantity of ripple effects can be decreased by moving the slider on the effect quantity control 440 to the left, and the quantity of ripple effects can be increased by moving the slider on the effect quantity control 440 to the right. The ripple size control 450 can be used to adjust the outline size of the ripple effect 430 in the display interface. For example, the outline size of the ripple effect 430 can be decreased by moving the slider on the ripple size control 450 to the left, and the outline size of the ripple effect 430 can be increased by moving the slider on the ripple size control 450 to the right.
[0044] The ripple shape control (not shown) allows for both preset and custom shape selection, enhancing the freedom of shape control in ripple effects. For example, when performing the third setting operation, a preset shape library (such as basic outlines like circles, ellipses, and waves) can be provided, which can be directly selected by clicking, automatically loading the corresponding shape outline for the ripple effect. A custom mode is also available, such as activating the shape editor, where users can adjust curves by dragging control points (e.g., Bézier curve deformation) or input function expressions (e.g., sine wave superposition formula) to customize the ripple outline. The shape change effect can be previewed in real time during editing. This allows for quick ripple effects using preset shapes (e.g., circular ripples simulating raindrops falling into water) and also allows for personalized needs using custom shapes (e.g., heart-shaped ripples creating a romantic atmosphere).
[0045] It should be understood that the above control descriptions are for illustrative purposes only and are not intended to limit the functionality of the controls. In application scenarios involving multiple ripple effects, corresponding parameter control groups can be bound to each ripple effect to achieve fine-grained customization of the dynamic effects.
[0046] In some embodiments, the second setting operation includes an increase in quantity or a decrease in quantity; In response to a second setting operation on the effect quantity control, the quantity of the ripple effect is determined, including: In response to an increase operation on the effect quantity control, the effect quantity is increased based on a first preset rule; the first preset rule includes sequentially increasing the ripple effects of different ripple shapes in a first order. In response to the reduction operation of the effect quantity control, the effect quantity is reduced based on a second preset rule; the second preset rule includes reducing the ripple effects of different ripple shapes in a second order.
[0047] The dynamic and orderly management of ripple effects can be achieved by defining preset rules for increasing and decreasing the number of effects. When increasing the number, different contours of ripples can be generated sequentially according to the first preset rule (such as a preset shape sequence of circle → ellipse → wave), avoiding visual monotony caused by repetition of a single shape. When decreasing the number, effects can be gradually removed according to the second preset rule (such as deleting in reverse order or prioritizing the removal of edge ripples based on visual weight). This not only enriches the visual layering with multiple ripple shape contours (such as multiple special-body ripples with different contours), but also maintains the dynamic performance of the core area when reducing effects (such as retaining the ripples in the center of the image while prioritizing the removal of edge effects), ultimately achieving a dual balance between changing the number of effects and optimizing the visual effect.
[0048] See Figure 5 , Figure 5 The diagram shows a schematic of the ripple effect setup according to an embodiment of the present disclosure. Figure 5In the game, by increasing the quantity of effects using the effect quantity control, different ripple effects with different shapes can be added sequentially in a preset first order. For example, when the effect quantity control is set to 1, a circular ripple effect 434 can be added; when the effect quantity control is set to 2, a heart-shaped ripple effect 433 can be added; when the effect quantity control is set to 3, a square ripple effect 431 can be added; and when the effect quantity control is set to 4, a five-pointed star ripple effect 432 can be added. Similarly, when the effect quantity control is decreased, the five-pointed star ripple effect 432, the square ripple effect 431, and the heart-shaped ripple effect 433 can be decreased sequentially in a preset second order. The preset rules of shape sequence can simplify the collaborative control of multiple special effects (without setting the shape of each special effect separately), and can also realize the superposition and diffusion effect of multiple shape ripples (such as the interweaving and propagation of circular and star-shaped ripples), which enhances the richness of dynamic special effects and the naturalness of interaction.
[0049] In some embodiments, generating the ripple effect based on the visual parameters at the display position in the media content includes: In response to a plurality of triggering operations on the media content, the triggering position of the triggering operation is determined as the display position; Based on the operational sequence of the multiple triggering operations, the ripple effect is generated sequentially at the corresponding display positions based on the visual parameters.
[0050] This method allows for the dynamic generation of ripple effects based on continuous triggering of media content. The location of each triggering operation can be recorded in real time as the effect display location, and the ripple effect is rendered sequentially at the corresponding locations according to the order of the operations. For example, if a user clicks on objects in the screen sequentially, ripple effects can be generated at each location in the order of the clicks. This multi-location triggering creates a natural dynamic diffusion effect, improving the realism of the visual effect (such as simulating the ripples spreading as raindrops fall on water); it also allows for control over the generation rhythm of the effect using the order of operations (such as rapid, continuous clicks forming a dense chain of ripples). Compared to traditional methods where water ripple effects lack flexible control and interactivity, this disclosure achieves deep synchronization between visual effects and user interaction, enhancing the immersiveness and engagement of the media content.
[0051] In some embodiments, the triggering operation forms a continuous motion trajectory; The ripple effect is generated based on the visual parameters and the display position in the media content, including: determining multiple display positions along a continuous motion trajectory based on the trigger position; The ripple effect is generated at the display location based on the visual parameters to display multiple consecutive ripple effects.
[0052] One or more triggering operations can form a continuous motion trajectory, expanding the generation of ripple effects from a single location to a dynamic sequence. Multiple key points can be uniformly sampled along the trajectory as display positions based on the movement path of the triggering operation, or the triggering positions of multiple operations can be used as display positions. At each display position, ripple effects are generated synchronously according to preset visual parameters (such as ripple shape, size, and quantity), ultimately presenting a series of interconnected ripple diffusion effects in the media content (e.g., as a finger strokes across water, continuously generating wave-shaped ripples that gradually decay). This enhances the intuitiveness of interaction through trajectory visualization (e.g., directly seeing the ripples flow with the gesture), and also allows for the creation of more realistic fluid dynamics through the superposition of continuous effects (e.g., simulating continuous water waves), while maintaining the consistency of visual parameters for all ripples to ensure overall stylistic harmony.
[0053] See Figure 6 , Figure 6 A schematic diagram of a continuous ripple effect according to an embodiment of the present disclosure is shown. Figure 6 In this process, multiple trigger operations form a continuous motion trajectory 610. The trigger points 621-623 of these multiple trigger operations can be used as display positions. Based on the set visual parameters, multiple ripple effects are generated, presenting a continuous ripple dynamic diffusion effect. Compared with the water ripple simulation with uncontrollable parameters in existing technologies, this method improves the interactive accuracy and visual expressiveness of the effects. Existing technologies typically only support generating fixed-shape water ripples from a single trigger point, and parameters such as the ripple diffusion range and decay speed cannot be adjusted in real time, resulting in stiff dynamic effects and a lack of layering, making the effects unrealistic. This disclosure can not only synchronously generate multiple sets of ripples based on multiple trigger points on a continuous motion trajectory (such as a finger sliding path), but also precisely control the diffusion shape (such as circular ripples or wave-like surges), decay rhythm (such as rapid disappearance or slow dissipation), and superposition effect (such as interference phenomena when ripples collide) of each set of ripples through flexible configuration of visual parameters. Ultimately, it presents a more physically consistent and immersive continuous ripple dynamic diffusion scene (such as multiple ripples naturally intertwining).
[0054] In step S330, the ripple effect is generated based on the visual parameters at the display position in the media content.
[0055] This method generates ripple effects within media content by adjusting visual parameters and display positions. It achieves diverse ripple effects through parametric control and ensures logical alignment between the effects and the media content through precise positioning. This enhances the dynamic expressiveness of the visuals while maintaining natural realism and immediate interactive feedback.
[0056] In some embodiments, generating the ripple effect based on the visual parameters at the display position in the media content includes: Initialize the first rendering texture state and the second rendering texture state based on the visual parameters; Update the state of the first or second rendered texture based on the fluctuation parameters; Image rendering is performed alternately based on the first rendering texture state and the second rendering texture state to generate the ripple effect that changes continuously over time.
[0057] The smooth dynamic performance of the ripple effect can be achieved by alternating updates of dual rendering textures. Specifically, two independent rendering texture states (a first texture state and a second texture state) can be initialized based on visual parameters (such as diffusion speed and ripple height), storing the morphological data of the ripple at different time frames, for example, storing speed and page height in the color channel of a pixel. Then, one of the texture states is dynamically updated according to the ripple parameters, and the data of the two textures are alternately used for mixed output during each frame rendering (e.g., the first frame uses the first texture to render the basic ripple, and the second frame uses the second texture to render the diffused ripple and superimpose it on the first frame). This double buffering mechanism avoids screen tearing during single texture updates, ensuring that the ripple changes continuously in the time dimension (such as the natural diffusion of ripples rather than abrupt changes), while using texture state reuse to reduce computational overhead, ultimately presenting a realistic dynamic effect with high frame rate and low latency in media content.
[0058] In some embodiments, the fluctuation parameters include a damping coefficient and an elastic coefficient; Then, based on the fluctuation parameters, the state of the first or second rendered texture is updated, including: The first acceleration is determined based on the average ripple height difference between the target pixel and its neighboring pixels at the previous time step. The second acceleration is determined based on the damping coefficient and the velocity of the target pixel at the previous moment; The third acceleration is determined based on the elastic coefficient and the ripple height of the target pixel at the previous moment; The current velocity is determined based on the sum of the first acceleration, the second acceleration, and the third acceleration, and the velocity of the target pixel at the previous moment. The current ripple height is determined based on the current speed and the ripple height at the previous moment; Update the first rendering texture state or the second rendering texture state based on the current speed and the current ripple height.
[0059] A physically driven ripple rendering update mechanism can be constructed using damping and elasticity coefficients to achieve realistic dynamic simulation of ripple effects. For each pixel, the first acceleration generated by fluid diffusion can be calculated based on the difference in ripple height between it and its neighboring pixels at the previous moment, simulating the driving force of ripple propagation. A second acceleration can be calculated by combining the damping coefficient with the velocity at the previous moment, simulating energy attenuation caused by wave viscosity. A third acceleration can be calculated using the elasticity coefficient with the ripple height at the previous moment, simulating the restoring force caused by surface tension. The three types of acceleration are then superimposed and combined with the velocity at the previous moment to synthesize the current velocity, thereby deriving the current ripple height. The first or second rendering texture state is dynamically adjusted based on the updated velocity and page height data. In this way, through precise control of physical parameters, the ripples can exhibit natural attenuation and rebound effects during diffusion (such as ripples gradually weakening until they disappear), while avoiding the problems of stiff or over-diffused ripples in traditional algorithms, significantly improving the realism and immersion of the dynamics.
[0060] Specifically, surface ripple effects can be implemented in pixel (or vertex) shaders based on physical simulations. First, a first acceleration can be calculated. For example, for each pixel, the first ripple height indicated in the color channel of the current target pixel and the second ripple height indicated in the color channels of the neighboring pixels can be obtained. The average difference between the first ripple height and the average difference between the multiple second ripple heights is calculated, yielding the average ripple height difference, i.e., the first acceleration. The average height difference between the current pixel (or vertex) and its neighbors can be simulated as a "pull" or "compression," driving the rippled surface towards smoothness. Second, second and third accelerations can be determined based on applied physical forces. Specifically, damping force (viscous force) simulates the viscosity within the ripples, causing the waves to gradually lose energy and slow down during propagation, slowing them down over time. The second acceleration can be determined based on the product of the velocity at the previous moment and the damping coefficient (e.g., less than 1). Elastic forces (gravity / restoring forces) can simulate gravity or other restoring forces, causing the corrugated surface to tend to return to a certain reference height (such as a plane), i.e., the force pulling the corrugated surface back to the horizontal plane (0 height). The third acceleration can be obtained based on the product of the corrugation height at the previous moment and the elastic coefficient. Then, the current page height and current velocity can be determined. The current new velocity can be the sum of the velocity at the previous moment and the total acceleration, which can be the sum of the first, second, and third accelerations. Considering all forces (tension, damping, elastic forces, etc.), the total acceleration is applied to the velocity at the previous moment using Euler integrals or other integration methods to obtain the current velocity value. The current corrugation height can be the sum of the old corrugation height at the previous moment and the current velocity. In this way, by simulating forces (such as tension, damping, and elastic forces) and motion (through velocity and acceleration) in the physical world, realistic corrugated surface undulation effects can be created in media content, suitable for static images and also for real-time rendering.
[0061] In some embodiments, image rendering is performed alternately based on the first rendering texture state and the second rendering texture state, including: Read the first rendering parameters from the first rendering texture state; The first rendering parameter is updated based on the fluctuation coefficient to obtain the second rendering parameter; The image is rendered based on the second rendering parameters, and the state of the second rendering texture is updated based on the second rendering parameters. Read the second rendering parameters from the second rendering texture state; The second rendering parameter is updated based on the fluctuation coefficient to obtain the third rendering parameter; Image rendering is performed based on the third rendering parameters, and the first rendering texture state is updated based on the third rendering parameters.
[0062] High-frame-rate smooth rendering of ripple effects can be achieved through an alternating update and parameter iteration mechanism using dual rendering textures. During each frame rendering, the current rendering parameters (such as ripple height and velocity) in the first rendering texture state are read. Combined with wave coefficients (such as damping and elasticity parameters), the second rendering parameters for the next moment are dynamically calculated and immediately used to render the current frame. Simultaneously, the second rendering parameters are updated to the second rendering texture state as the initial values for the next frame. The next frame switches to the second rendering texture state, repeating the parameter reading, updating, and rendering process, and the results are sent back to the first rendering texture state. The dual-buffering mechanism eliminates rendering latency and avoids screen tearing during single-texture updates. Continuous parameter iteration ensures the natural evolution of the ripple shape, such as the diffusion and decay of ripples. Ultimately, physically realistic dynamic effects are presented in media content, achieving high frame-rate output without sacrificing rendering performance.
[0063] Specifically, efficient ripple simulation can be achieved by utilizing rendering textures and a ping-pong alternation mechanism. Combined with single-frame multi-acceleration iteration and data compression techniques, memory usage and computational efficiency are optimized. For example... Figure 7 As shown, Figure 7 A schematic diagram of alternating rendering according to an embodiment of the present disclosure is shown. Figure 7 First, create rendering textures: generate two sufficiently large rendering textures, StatusA and StatusB, to store the page state. The rendering texture format can support the required precision and number of color channels. Initialize the initial height and velocity values of StatusA and StatusB according to the simulation requirements. This can be achieved through external data import or programmatic generation. Set parameters such as damping coefficient, elasticity coefficient, and display position (e.g., the click position that triggers the action); these parameters will affect the behavior and appearance of the ripple simulation.
[0064] In each frame execution phase, a wave simulation loop is implemented. For odd-numbered loops (e.g., 1, 3, 5, 7), ripple height and velocity data are read from StatusB (or the initial state). Physics calculations are performed in the Spread.ausl shader, including calculating acceleration, applying damping, and elastic forces. The calculated new state is written to StatusA as input for the next frame. For even-numbered loops (e.g., 2, 4, 6, 8), ripple height and velocity data are read from StatusA. Physics calculations continue to be performed in the same or a different Spread.ausl shader to further update the ripple state. The calculated new state is written back to StatusB to prepare for the next iteration or final rendering.
[0065] The final rendering stage obtains the final state from StatusB (or StatusA after multiple iterations). A normal map is generated using the NormalDraw shader based on the ripple height data to simulate the lighting effects of the ripples. Lighting and refraction calculations are performed in the ResultDraw shader, combining camera input and the normal map, to generate the final ripple rendering effect. The output to the screen is then displayed as the final rendering result for the user to view.
[0066] Therefore, this disclosure uses two rendering textures, StatusA and StatusB, as storage media to save the ripple state at different points in time, including height and vertical velocity. This persistent storage avoids the need to reinitialize the state every frame, thus improving efficiency. Inter-frame state updates are achieved by alternately using the two rendering textures as input and output. This avoids read / write conflicts while fully utilizing video memory bandwidth. It improves the parallelism and efficiency of data processing, ensuring smooth real-time rendering. Multiple iterations of physical calculations within a single frame accelerate the solution process of the ripple dynamic equations. It can capture rapidly changing ripple dynamics, such as ripple propagation and high-frequency details, while maintaining the stability of numerical calculations. A specific encoding algorithm is used to convert floating-point height and velocity values into a format suitable for storage in a limited color channel (RGBA). It enables efficient data storage and transmission within limited video memory bandwidth while maintaining data accuracy and integrity.
[0067] It should be noted that the method of this embodiment can be executed by a single device, such as a computer or server. The method of this embodiment can also be applied to a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of these devices may execute only one or more steps of the method of this embodiment, and the multiple devices will generate ripple effects to complete the method described.
[0068] It should be noted that the above description describes some embodiments of this disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the above embodiments and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0069] Based on the same technical concept, corresponding to any of the above embodiments, this disclosure also provides a ripple effect generation device, see [link to relevant documentation]. Figure 8 The ripple effect generation device includes: The display module is used to display media content; The settings module is used to set the visual parameters of the ripple effect and its display position in the media content; The display module is also used to generate the ripple effect based on the display position of the visual parameters in the media content.
[0070] In some embodiments, setting the display position of the ripple effect within the media content includes: Display location control; In response to a first setting operation for the position control, the display position is determined; or, In response to a trigger operation on the media content, the display position is determined based on the trigger position of the trigger operation.
[0071] In some embodiments, generating the ripple effect based on the visual parameters at the display position in the media content includes: In response to a plurality of triggering operations on the media content, the triggering position of the triggering operation is determined as the display position; Based on the operational sequence of the multiple triggering operations, the ripple effect is generated sequentially at the corresponding display positions based on the visual parameters.
[0072] In some embodiments, the triggering operation forms a continuous motion trajectory; The ripple effect is generated based on the visual parameters and the display position in the media content, including: determining multiple display positions along a continuous motion trajectory based on the trigger position; The ripple effect is generated at the display location based on the visual parameters to display multiple consecutive ripple effects.
[0073] In some embodiments, generating the ripple effect based on the visual parameters at the display position in the media content includes: Initialize the first rendering texture state and the second rendering texture state based on the visual parameters; Update the state of the first or second rendered texture based on the fluctuation parameters; Image rendering is performed alternately based on the first rendering texture state and the second rendering texture state to generate the ripple effect in which the ripples change continuously over time.
[0074] In some embodiments, the fluctuation parameters include a damping coefficient and an elastic coefficient; Then, based on the fluctuation parameters, the state of the first or second rendered texture is updated, including: The first acceleration is determined based on the average ripple height difference between the target pixel and its neighboring pixels at the previous time step. The second acceleration is determined based on the damping coefficient and the velocity of the target pixel at the previous moment; The third acceleration is determined based on the elastic coefficient and the ripple height of the target pixel at the previous moment; The current velocity is determined based on the sum of the first acceleration, the second acceleration, and the third acceleration, and the velocity of the target pixel at the previous moment. The current ripple height is determined based on the current speed and the ripple height at the previous moment; Update the first rendering texture state or the second rendering texture state based on the current speed and the current ripple height.
[0075] In some embodiments, image rendering is performed alternately based on the first rendering texture state and the second rendering texture state, including: Read the first rendering parameters from the first rendering texture state; The first rendering parameter is updated based on the fluctuation coefficient to obtain the second rendering parameter; The image is rendered based on the second rendering parameters, and the state of the second rendering texture is updated based on the second rendering parameters. Read the second rendering parameters from the second rendering texture state; The second rendering parameter is updated based on the fluctuation coefficient to obtain the third rendering parameter; Image rendering is performed based on the third rendering parameters, and the first rendering texture state is updated based on the third rendering parameters.
[0076] In some embodiments, the visual parameters further include at least one of the following: number of effects, ripple shape, or ripple size; wherein the number of effects is used to control the number of ripple effects; the ripple shape is used to control the ripple outline of the ripple effect; and the ripple size is used to control the initial outline size of the ripple effect. The visual parameters for the ripple effect are then set, including: The display effect quantity control, the ripple shape control, and the ripple size control are at least one of the following: In response to a second setting operation for the effect quantity control, the quantity of the ripple effect is determined; In response to a third setting operation for the ripple shape control, the ripple outline of the ripple effect is set; In response to a fourth setting operation for the ripple size control, the initial outline size of the ripple effect is set.
[0077] In some embodiments, the second setting operation includes an increase in quantity or a decrease in quantity; In response to a second setting operation on the effect quantity control, the quantity of the ripple effect is determined, including: In response to an increase operation on the effect quantity control, the effect quantity is increased based on a first preset rule; the first preset rule includes sequentially increasing the ripple effects of different ripple shapes in a first order. In response to the reduction operation of the effect quantity control, the effect quantity is reduced based on a second preset rule; the second preset rule includes reducing the ripple effects of different ripple shapes in a second order.
[0078] For ease of description, the above apparatus is described in terms of its functions, divided into various modules. Of course, in implementing this disclosure, the functions of each module can be implemented in one or more software and / or hardware.
[0079] The apparatus described above is used to implement the corresponding ripple effect generation method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0080] Based on the same technical concept, corresponding to the methods of any of the above embodiments, this disclosure also provides a non-transitory computer-readable storage medium that stores computer instructions for causing the computer to execute the ripple effect generation method as described in any of the above embodiments.
[0081] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable multimedia, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0082] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to execute the ripple effect generation method as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0083] Based on the same inventive concept, corresponding to the ripple effect generation method of any of the above embodiments, this disclosure also provides a computer program product, which includes computer program instructions. In some embodiments, when the computer program instructions are run on a computer, the computer executes each step of each embodiment of the ripple effect generation method. Corresponding to the execution entity corresponding to each step in each embodiment of the ripple effect generation method, the processor executing the corresponding step may belong to the corresponding execution entity.
[0084] The computer program product of the above embodiments is used to cause the processor to execute the ripple effect generation method as described in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0085] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of this disclosure (including the claims) is limited to these examples; within the framework of this disclosure, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of this disclosure as described above, which are not provided in detail for the sake of brevity.
[0086] Additionally, to simplify the description and discussion, and to avoid obscuring the embodiments of this disclosure, the provided drawings may or may not show well-known power / ground connections to integrated circuit (IC) chips and other components. Furthermore, the apparatus may be shown in block diagram form to avoid obscuring the embodiments of this disclosure, and this also takes into account the fact that the details of implementation of these block diagram apparatuses are highly dependent on the platform on which the embodiments of this disclosure will be implemented (i.e., these details should be fully understood by those skilled in the art). While specific details (e.g., circuits) have been set forth to describe exemplary embodiments of this disclosure, it will be apparent to those skilled in the art that the embodiments of this disclosure can be implemented without these specific details or with variations thereof. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0087] Although this disclosure has been described in conjunction with specific embodiments thereof, many substitutions, modifications, and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed.
[0088] This disclosure is intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for generating ripple effects, comprising: Display media content; Set the visual parameters of the ripple effect and its display position in the media content; The ripple effect is generated based on the visual parameters and the display position in the media content.
2. The method according to claim 1, wherein, Setting the display position of the ripple effect within the media content includes: Display location control; In response to a first setting operation for the position control, the display position is determined; or, In response to a trigger operation on the media content, the display position is determined based on the trigger position of the trigger operation.
3. The method according to claim 2, wherein, The ripple effect is generated based on the visual parameters and the display position in the media content, including: In response to a plurality of triggering operations on the media content, the triggering position of the triggering operation is determined as the display position; Based on the operational sequence of the multiple triggering operations, the ripple effect is generated sequentially at the corresponding display positions based on the visual parameters.
4. The method according to claim 2, wherein, The triggering operation forms a continuous motion trajectory; The ripple effect is generated based on the visual parameters at the display position in the media content, including: Multiple display positions are determined based on the trigger position along the continuous motion trajectory; The ripple effect is generated at the display location based on the visual parameters to display multiple consecutive ripple effects.
5. The method according to claim 1, wherein the ripple effect is generated based on the visual parameters at the display position in the media content, comprising: Initialize the first rendering texture state and the second rendering texture state based on the visual parameters; Update the state of the first or second rendered texture based on the fluctuation parameters; Image rendering is performed alternately based on the first rendering texture state and the second rendering texture state to generate the ripple effect in which the ripples change continuously over time.
6. The method according to claim 5, wherein, The fluctuation parameters include the damping coefficient and the elastic coefficient; Then, based on the fluctuation parameters, the state of the first or second rendered texture is updated, including: The first acceleration is determined based on the average ripple height difference between the target pixel and its neighboring pixels at the previous time step. The second acceleration is determined based on the damping coefficient and the velocity of the target pixel at the previous moment; The third acceleration is determined based on the elastic coefficient and the ripple height of the target pixel at the previous moment; The current velocity is determined based on the sum of the first acceleration, the second acceleration, and the third acceleration, and the velocity of the target pixel at the previous moment. The current ripple height is determined based on the current speed and the ripple height at the previous moment; Update the first rendering texture state or the second rendering texture state based on the current speed and the current ripple height.
7. The method according to claim 5, wherein image rendering is performed alternately based on the first rendering texture state and the second rendering texture state, comprising: Read the first rendering parameters from the first rendering texture state; The first rendering parameter is updated based on the fluctuation coefficient to obtain the second rendering parameter; The image is rendered based on the second rendering parameters, and the state of the second rendering texture is updated based on the second rendering parameters. Read the second rendering parameters from the second rendering texture state; The second rendering parameter is updated based on the fluctuation coefficient to obtain the third rendering parameter; Image rendering is performed based on the third rendering parameters, and the first rendering texture state is updated based on the third rendering parameters.
8. The method according to claim 2, wherein, The visual parameters also include at least one of the following: number of effects, ripple shape, or ripple size; wherein the number of effects is used to control the number of ripple effects; the ripple shape is used to control the ripple outline of the ripple effect; and the ripple size is used to control the initial outline size of the ripple effect. The visual parameters for the ripple effect are then set, including: Display at least one of the following: effect quantity control, ripple shape control, and ripple size control; In response to a second setting operation for the effect quantity control, the quantity of the ripple effect is determined; In response to a third setting operation for the ripple shape control, the ripple outline of the ripple effect is set; In response to a fourth setting operation for the ripple size control, the initial outline size of the ripple effect is set.
9. The method according to claim 8, wherein, The second setting operation includes increasing the quantity or decreasing the quantity; In response to a second setting operation on the effect quantity control, the quantity of the ripple effect is determined, including: In response to an increase operation on the effect quantity control, the effect quantity is increased based on a first preset rule; the first preset rule includes sequentially increasing the ripple effects of different ripple shapes in a first order. In response to a reduction operation on the effect quantity control, the effect quantity is reduced based on a second preset rule; the second preset rule includes reducing the ripple effects of different ripple shapes in a second order.
10. A ripple effect generation device, comprising: The display module is used to display media content; The settings module is used to set the visual parameters of the ripple effect and its display position in the media content; The display module is also used to generate the ripple effect based on the display position of the visual parameters in the media content.
11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method as claimed in any one of claims 1 to 9.
12. A non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method according to any one of claims 1 to 9.
13. A computer program product comprising computer program instructions that, when executed on a computer, cause the computer to perform the method of any one of claims 1 to 9.