Rendering method and device, storage medium, equipment and product

By extracting alpha channel data and using circular texture coordinates to drive texture scrolling, the problem of high resource consumption in lighting and shadow effect rendering is solved, achieving seamless looping of special effects and preservation of details, thus improving rendering efficiency and visual effects.

CN121810831APending Publication Date: 2026-04-07GUANGZHOU BOGUAN TELECOMM TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-19
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing technologies consume a lot of computing and storage resources in rendering lighting and shadow effects, resulting in flat special effects and loss of semi-transparent details, failing to effectively preserve the details of special effects.

Method used

By extracting the alpha channel data of the source effects to generate static textures, and using circular texture coordinates to drive the texture coordinates of the planar model to scroll, seamless looping playback of dynamically rendered textures is achieved, enhancing the visual clarity of the effects.

Benefits of technology

It achieves seamless looping of special effects under limited resources, preserves the details of the original special effects, makes the textures of the special effects clearer, and improves rendering efficiency and visual performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121810831A_ABST
    Figure CN121810831A_ABST
Patent Text Reader

Abstract

The invention discloses a rendering method and device, a storage medium, equipment and a program product, and the method comprises the steps: firstly extracting transparent channel data of a source special effect, and generating at least one static texture containing the transparent channel data; then a planar model is obtained, texture coordinates of the planar model are annular texture coordinates, and the left side and the right side of the texture can be closed and connected in a three-dimensional space when the planar model carries out texture sampling; providing a dynamic rendering texture according to at least one static texture containing the transparent channel data generated by extracting the transparent channel data of the special effect; performing material rendering on the planar model by using the dynamic rendering texture; finally, the texture coordinates of the plane model are driven to roll in the annular direction so that the source special effect can be played on the plane model in a loop mode, and the annular direction is determined based on the annular texture coordinates. According to the rendering method provided by the invention, seamless circulation of the special effect can be automatically realized, and the original detail effect of the source special effect is reserved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, specifically to a rendering method, apparatus, storage medium, device, and program product. Background Technology

[0002] Lighting and shadow effects are a crucial means of enhancing artistic expression, but complex lighting and shadow calculations consume significant computational and storage resources. Therefore, existing performance optimization methods rely on visual effects artists reducing resource consumption by decreasing the complexity of lighting and shadow effects, such as reducing the number of light sources or lowering shadow quality. This results in effects appearing rather flat in terms of lighting and shadow. Furthermore, manually compressing resolution or reducing the number of frames in a sequence can directly lead to a severe loss of semi-transparent details such as the gradation of effect edges and the smooth transitions of halos. Summary of the Invention

[0003] This application provides a rendering method, apparatus, storage medium, device, and program product that makes special effect textures clearer by acquiring transparency channel information and achieves seamless looping of textures from beginning to end by using circular texture coordinates.

[0004] In a first aspect, embodiments of this application provide a rendering method, the rendering method comprising: extracting alpha channel data of a source effect and generating at least one static texture containing alpha channel data; obtaining a planar model, wherein the texture coordinates of the planar model are annular texture coordinates; providing a dynamic rendering texture, the dynamic rendering texture being generated based on the static texture; performing material rendering on the planar model based on the dynamic rendering texture; and driving the texture coordinates of the planar model to scroll along an annular direction to loop the source effect on the planar model, wherein the annular direction is determined based on the annular texture coordinates.

[0005] Secondly, embodiments of this application provide a rendering apparatus, which includes a processing module, an acquisition module, a providing module, a mapping module, and a driving module. The processing module is used to extract alpha channel data of a source effect and generate at least one static texture containing the alpha channel data; the acquisition module is used to acquire a planar model, wherein the texture coordinates of the planar model are circular texture coordinates; the providing module is used to provide a dynamic rendering texture, which is generated based on the static texture; the rendering module is used to perform material rendering on the planar model based on the dynamic rendering texture; and the driving module is used to drive the texture coordinates of the planar model to scroll along a circular direction to cyclically play the source effect on the planar model, wherein the circular direction is determined based on the circular texture coordinates.

[0006] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program adapted for loading by a processor to execute a rendering method. The rendering method includes: extracting alpha channel data of a source effect and generating at least one static texture containing the alpha channel data; obtaining a planar model, wherein the texture coordinates of the planar model are circular texture coordinates; providing a dynamic rendering texture generated based on the static texture; performing material rendering on the planar model based on the dynamic rendering texture; and driving the texture coordinates of the planar model to scroll along a circular direction to loop the source effect on the planar model, wherein the circular direction is determined based on the circular texture coordinates.

[0007] Fourthly, embodiments of this application provide a computer device, the computer device including a processor and a memory, the memory storing a computer program, the processor executing a rendering method by calling the computer program stored in the memory. The rendering method includes: extracting alpha channel data of a source effect and generating at least one static texture containing alpha channel data; obtaining a planar model, wherein the texture coordinates of the planar model are circular texture coordinates; providing a dynamic rendering texture, the dynamic rendering texture being generated based on the static texture; performing material rendering on the planar model based on the dynamic rendering texture; and driving the texture coordinates of the planar model to scroll along a circular direction to loop the source effect on the planar model, wherein the circular direction is determined based on the circular texture coordinates.

[0008] Fifthly, embodiments of this application provide a computer program product, including computer instructions, which are executed by a processor to perform a rendering method. The rendering method includes: extracting alpha channel data of a source effect and generating at least one static texture containing the alpha channel data; obtaining a planar model, wherein the texture coordinates of the planar model are circular texture coordinates; providing a dynamic rendering texture, the dynamic rendering texture being generated based on the static texture; performing material rendering on the planar model based on the dynamic rendering texture; and driving the texture coordinates of the planar model to scroll along a circular direction to loop the source effect on the planar model, wherein the circular direction is determined based on the circular texture coordinates.

[0009] This application provides a rendering method, apparatus, storage medium, device, and program product. First, it extracts the alpha channel data of the source effect and generates at least one static texture containing the alpha channel data. Then, it obtains a planar model whose texture coordinates are circular texture coordinates. Based on the obtained static texture, it provides a dynamic rendering texture. Subsequently, it performs material rendering on the planar model based on the dynamic rendering texture. Finally, it drives the texture coordinates of the planar model to scroll along a circular direction to loop the source effect on the planar model, wherein the circular direction is determined based on the circular texture coordinates. The rendering method provided by this application can automatically achieve a seamless looping effect of the effect while preserving the details of the source effect, making the effect texture clearer. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0011] Figure 1 A flowchart illustrating some implementation methods of the rendering method provided in this application; Figure 2 A flowchart illustrating some implementation methods of the rendering method provided in this application; Figure 3 A flowchart illustrating some implementation methods of the rendering method provided in this application; Figure 4 A scene illustration illustrating the rendering method provided in some embodiments of this application; Figure 5 A flowchart illustrating some implementation methods of the rendering method provided in this application; Figure 6 A flowchart illustrating some implementation methods of the rendering method provided in this application; Figure 7 A flowchart illustrating some implementation methods of the rendering method provided in this application; Figure 8 A scene illustration illustrating the rendering method provided in some embodiments of this application; Figure 9 A flowchart illustrating some implementation methods of the rendering method provided in this application; Figure 10 A scene illustration illustrating the rendering method provided in some embodiments of this application; Figure 11 A scene illustration illustrating the rendering method provided in some embodiments of this application; Figure 12Schematic diagram of the structure of the rendering apparatus provided for some embodiments of this application; Figure 13 A schematic diagram of the structure of a computer device provided for some embodiments of this application. Detailed Implementation

[0012] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0013] This application provides a method, apparatus, storage medium, device, and program product for rendering special effects. Exemplarily, the rendering method of this application can be executed by a computer device, which can be a terminal or a server. The terminal can be a smartphone, tablet, laptop, desktop computer, smart TV, smart speaker, wearable smart device, personal computer (PC), smart vehicle terminal, etc. The terminal may also include a client, which can be a video client, shopping application client, reading application client, browser client, or instant messaging client, etc. The server 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, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0014] First, some of the nouns or terms that appear in the description of the embodiments of this application are explained as follows.

[0015] A model is a digital 3D model created in computer graphics to simulate objects, characters, environments, or abstract concepts in the real world. It typically consists of vertices, edges, and faces, and includes textures, colors, lighting, and other visual attributes to present a realistic appearance and behavior in a virtual environment.

[0016] Material is a complete description of the visual characteristics of a mesh, including the texture settings applied to the mesh surface, as well as some advanced features such as which shader is selected, the input parameters of that shader, and the functional parameters that control the graphics acceleration hardware itself.

[0017] A material shader is a programmable unit in the graphics rendering pipeline used to determine the visual properties of a model's surface. It can directly manipulate GPU registers, control the GPU rendering process, and support parallel computing. Specific types of shaders include vertex shaders, fragment shaders, and geometry shaders. It receives material property inputs including texture coordinates, texture sampling data, and color parameters, and executes predefined algorithms to output the final color and transparency values ​​of each pixel on the model's surface. The material shader responds to instructions such as texture tiling parameters and texture offset parameters, controlling how textures are mapped onto the model's surface.

[0018] Mapping is the process of mapping specific data (such as texture, color, and position information) to rendering targets (such as pixels and model surfaces) according to rules. It is a transformation rule in the rendering pipeline, responsible for converting abstract data (such as texture images, mathematical coordinates, color parameters, etc.) into visual elements that can be displayed on the screen, realizing the detailed presentation of special effects (such as texture lamination, color gradients, and lighting transitions). For example, the most commonly used is texture mapping, which maps 2D (Dimension) texture images (such as glitter textures and particle textures for special effects) to 3D model surfaces or 2D planes.

[0019] Dual background interpolation is a technique that involves shooting the same special effect image against pure black and pure white backgrounds, calculating the pixel color difference to accurately extract the transparency channel, and can fully preserve the details of semi-transparent special effects.

[0020] The alpha channel (transparency channel) is a special channel in an image, separate from the RGB color channels, used to store transparency information. It represents the degree to which background content is allowed to pass through a pixel in the image. The alpha channel is presented as a single-channel grayscale image. The alpha channel value (transparency) is typically represented by 0-255 (8-bit channel) or 0%-100%. A value of 0 (or 0%) appears black in the grayscale image, indicating that the pixel is completely transparent and the underlying background is fully visible. A value of 255 (or 100%) appears white in the grayscale image, indicating that the pixel is completely opaque and completely obscures the underlying background. Values ​​between 0-255 (or between 0% and 100%) appear gray in the grayscale image, indicating that the pixel is semi-transparent, and the visibility of the underlying background decreases as the value increases. In game effects, the alpha channel is often used to define the real-time rendering of effects, allowing semi-transparent and fully transparent elements (such as smoke, flames, and particle effects) to blend and overlap with the background. Some image formats, such as JPEG, do not support alpha channels and therefore cannot preserve transparency information. For file size reasons: JPEG format discards transparency information to achieve a high compression ratio, focusing on preserving color information, making it unsuitable for scenarios requiring transparency.

[0021] Texture, as an attribute, refers to the spatial arrangement and intensity variation pattern of an object's surface in an image. It is not an attribute of a single pixel, but rather determined by the brightness or color values ​​of multiple pixels within a region and their spatial distribution; that is, texture is a statistical characteristic of pixel spatial distribution. Even if two image regions have the same color or brightness histogram (i.e., the overall distribution of pixel values ​​is the same), they will exhibit different textures if their spatial arrangements are different. For example, a region containing 50% white pixels and 50% black pixels. These pixels arranged in two large blocks (one entirely white, one entirely black) constitute one texture; these pixels interleaved to form a checkerboard pattern constitute another completely different texture. In this application, texture refers to a textured image with a specific pattern of texture attributes.

[0022] Textures are 2D images / pixel data applied to the surface of a model in 3D rendering and graphic design to render colors, details, or special effects. Through texture coordinate mapping, they precisely correspond to the 3D model surface, allowing geometric models to present rich visual effects. Common texture types include: basic color maps, normal maps, transparency maps, and dynamic textures. Dynamic textures (such as Render Texture maps and sequence frame maps) can present dynamic effects by updating texture content in real time or playing it sequentially.

[0023] Texture mapping, also known as material mapping, in computer graphics involves wrapping a bitmap stored in memory onto the surface of a 3D rendered object. An image (texture) is pasted (mapped) onto a simple shape in the scene, much like a print is applied to a plane. This reduces the computational burden of creating shapes and textures in the scene. The pixels ultimately displayed on the screen are calculated from the texture's texels, and the calculation method is determined by texture filtering.

[0024] UV coordinates (texture coordinates) define a two-dimensional texture coordinate system, called texture space. Texture coordinates provide a correspondence between a model surface and a texture (here referring to a texture image), determining which vertex on the model surface a point (pixel) on the texture should be placed on, thus allowing the entire texture to be mapped onto the model. U and V represent the coordinates of the texture map in the horizontal and vertical directions of the display, respectively, or the U-th pixel in the horizontal direction and the V-th pixel in the vertical direction. In computer graphics, for 3D models, there are two most important coordinate systems: the position (X, Y, Z) coordinates of the vertices and the UV coordinates of the texture map. In short, texture coordinates are the basis for mapping textures onto the model surface. In 3D modeling and texture mapping, circular UVs (circular texture coordinates) and rectangular UVs (rectangular texture coordinates) are two different ways of flattening UV islands. The main difference lies in the model shape, texture density, and arrangement in texture space they are applied to. For some complex curved textures, forcibly straightening rectangular UVs into rectangles may result in some degree of texture stretching or distortion. Circular UVs arrange two-dimensional textures on the model surface in a circular logic, achieving seamless connection between the beginning and end of the textures and breaking the boundary limitations of rectangular UVs.

[0025] A sequence of frames is a set of consecutive static image frames that are played in sequence at high speed to create dynamic effects. For example, playing 24 frames per second or 30 frames per second can create animation effects with pauses that are difficult for the human eye to perceive.

[0026] Fog effects are a technique in 3D graphics rendering that simulates atmospheric phenomena. It creates the effect of fog, mist, or atmospheric perspective by gradually blending distant objects in a scene into a specific color (usually gray, white, or blue) as the distance increases. In game engines (such as Unity), fog effects are post-processing effects that blend the colors of the entire scene based on camera distance. The core of achieving fog effects is to mix the original color of an object with the fog color based on the object's distance from the camera. The greater the distance, the higher the proportion of fog color mixed into the object's color.

[0027] In the Unity engine (a game development engine), a Draw Call refers to the process by which the rendering engine sends rendering commands prepared by the CPU (Central Processing Unit) to the graphics hardware (GPU) to draw one or more graphical objects. Each time the engine prepares data and notifies the GPU, it is called a Draw Call. Overdraw refers to a pixel being rendered multiple times. For example, when there are constantly overlapping semi-transparent objects (such as UI, glass, and water) in a scene, each overlap involves a color blending operation, which frequently interrupts the rendering batch, leading to performance degradation. For semi-transparent faces (a face is a planar mesh, most commonly a quadrilateral; in Unity, it is usually the basic unit generated by particle systems), to represent volume and detail, a large number of particle faces (including semi-transparent faces) overlap each other. The GPU needs to perform blending calculations on all semi-transparent faces at the same pixel location sequentially from back to front, and the computational load increases linearly with the number of overlapping layers. Rendering semi-transparent faces increases the number of Draw Calls, causing a CPU performance bottleneck and thus reducing rendering efficiency. Meanwhile, semi-transparent surfaces may require more texture resources, thus increasing memory usage and impacting rendering performance.

[0028] The Bend modifier is a commonly used object space modifier in 3ds Max, Blender and other 3D modeling software. Its core function is to make the model produce smooth bending deformation along specified axes (X / Y / Z) through parameter control. It can also limit the bending range and intensity, and quickly achieve effects such as arcs, curved pipes, and curved surfaces. It is flexible to operate and has low requirements for the model's topology.

[0029] The UVW (Texture Coordinates) map modifier is a commonly used object space modifier in 3ds Max and other 3D modeling software. Its core function is to assign UVW map coordinates to the model, controlling the projection and display effect of the texture map on the surface of the 3D model, and solving the problem of textures not being displayed correctly in models without built-in texture coordinates (such as imported custom meshes).

[0030] Render Texture is a special type of dynamic texture in game engines like Unity. During gameplay, the GPU renders the scene as captured by the camera onto the texture in real time. It dynamically updates content and operates primarily on the GPU, making it far more efficient than CPU-based image processing. Essentially, a render texture binds a GPU-based texture to a custom framebuffer. When the camera renders, it skips the default framebuffer and directly draws the image onto this bound texture. This process eliminates the need for frequent data copying between the CPU and GPU. Subsequent rendering operations (such as applying textures to models or creating image effects) can directly utilize this texture, significantly improving efficiency. Render Textures are extremely useful in various graphics applications, such as rearview mirror effects, dynamic shadows, screen post-processing, and mirror and glass effects.

[0031] In computer graphics, a render target allows a 3D scene to be rendered to an intermediate storage buffer or a render target texture. The render target can then be used by pixel shaders to blend with the final effect. In games, render targets are commonly used for recording motion trajectories and drawing weighted patterns. A render target is essentially a buffer used to record the rendered output, rather than directly drawing the frame buffer to the screen.

[0032] A particle emitter is a component in Unity used to generate and control particle streams (such as flames, smoke, explosions, etc.). It defines key parameters such as particle generation method, velocity, quantity, and lifespan. By adjusting the parameters of the particle emitter, developers can simulate various natural phenomena and effects, adding vivid visuals and dynamism to games or applications.

[0033] The rendering method provided in this application is specifically described through the following embodiments. These embodiments are described in detail below. It should be noted that the order of description of the following embodiments is not intended to limit the priority of the embodiments.

[0034] It is understood that in the specific implementation of this application, user object data, context data and other related data are involved. When the implementation of this application is applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0035] This application provides a rendering method that can be executed by a terminal or a server, or by both a terminal and a server.

[0036] Please see Figure 1The rendering method provided in this application may include steps 01, 03, 04, 06, and 09, which are described in detail below: Step 01: Extract the alpha channel data of the source effect and generate at least one static texture containing the alpha channel data; Step 03: Obtain the planar model, where the texture coordinates of the planar model are the coordinates of the circular texture; Step 04: Provide a dynamic rendering texture, which is generated based on the static texture; Step 06: Perform material rendering on the planar model based on dynamic rendering textures; and Step 09: Drive the texture coordinates of the planar model to roll along the circular direction to loop the source effect on the planar model, where the circular direction is determined based on the circular texture coordinates.

[0037] Texture coordinates, ranging from 0 to 1, map to the width and height of the texture. Each vertex in a Unity engine mesh has a texture coordinate, specifying the location on the material's texture to be sampled. To display the entire texture on a quadrilateral, the texture coordinate values ​​at each of the quadrilateral's four vertices should all be either 0 or 1, so that each corner of the quadrilateral corresponds to a corner of the texture.

[0038] Circular texture coordinates refer to a rule for filling pixels when texture coordinates exceed the standard 0-1 range (i.e., beyond the texture edge). This involves techniques for handling texture repetition or stretching, allowing textures to loop on the model surface. Circular texture coordinates are suitable for mapping to toroidal surfaces, which have twisted and self-intersecting properties; after the model is unfolded, the left and right sides of the texture are closed and connected in 3D space. This tiling / repeat property of circular texture coordinates, tailored to specific UV unwrapping methods for cylindrical / toroidal models, is crucial for creating seamless repeating patterns and simulating infinite texture effects.

[0039] Among them, the ring direction is either the U direction or the V direction, that is, the tiling parameter of the texture has a tiling number of 1 in the U direction or greater than 1 in the V direction.

[0040] Among them, static texture refers to the texture image with continuous left and right boundaries obtained through step 03, which may include one or more sequence frames. A sequence frame is a texture that can completely display the source effect once. A sequence frame includes multiple single-frame static images, and the multiple single-frame static images are arranged in order.

[0041] Among them, dynamic rendering textures are dynamic textures composed of multiple static textures under the same source effect, and are textures that can display the source effect.

[0042] It can be understood that a source effect can be a real-time dynamic effect, the result of the combined effects of particle emitters, dynamically changing sequence frames, shader calculations, lighting, and post-processing effects. A source effect must include at least one semi-transparent panel. When the foreground color of a static texture of a source effect is superimposed on a background color, for each pixel of the bitmap, the final color can be calculated using the color blending formula: Final Color = Foreground Color × Foreground Color's alpha channel data + Background Color × (1 - Alpha). Alpha is a value between 0 and 1 (inclusive), representing the transparency of the foreground and indicating the degree of blending between the foreground and background; the lower the value, the higher the degree of blending. The foreground is located in the foreground of the image (or at the upper visual level) and is the core element that needs to be focused on. The background is located in the background of the image (or at the lower visual level) and serves as an auxiliary element to complement the foreground and explain the scene environment. Since the final special effects displayed on the screen are the result of a combination and looping of all the special effects elements, traditional recording methods cannot directly obtain the original alpha channel of a specific particle facet. Furthermore, recording across different software can degrade the accuracy of the image and textures. Therefore, a solution is to perform a double background interpolation operation on each static image of the source special effects to obtain the transparency channel data. This transparency channel data is a collection of information from the alpha channel of that static image, which can be displayed as a complete grayscale image. This grayscale image, used as the output texture of the source special effects, is then mixed with the color channels to obtain the static texture of the source special effects. This static texture contains the transparency information of all pixels in the static image.

[0043] Specifically, the color channel difference between two images can be calculated pixel by pixel using the dual background color difference operation: the completely transparent area is most affected by the background, and the difference is the color channel difference between the two backgrounds; the semi-transparent area may show a gradient difference from the center of the effect to the edge; the opaque area is not affected by the background, and the difference is 0.

[0044] Please see Figure 2 The rendering method provided in this application may include steps 01, 03, 04, 06, 07, and 09, which are described in detail below: Step 01: Extract the alpha channel data of the source effect and generate at least one static texture containing the alpha channel data; Step 03: Obtain the planar model, where the texture coordinates of the planar model are the coordinates of the circular texture; Step 04: Provide a dynamic rendering texture, which is generated based on the static texture; Step 06: Perform material rendering on the planar model based on dynamic rendering textures; Step 07: Adjust the texture tiling parameters in the circular direction using the material's shader to allow the dynamically rendered texture to be repeatedly stitched onto the surface of the planar model; and Step 09: Drive the texture coordinates of the planar model to roll along the circular direction to loop the source effect on the planar model, where the circular direction is determined based on the circular texture coordinates.

[0045] For step 07, the texture tiling parameter (i.e., the tiling value) refers to the repetition of the texture along the texture coordinates. For example, when Tiling is (1, 2), it means that the dynamically rendered texture is repeated once in the U direction and twice in the V direction, thereby improving the utilization of the dynamically rendered texture (i.e., the complete texture of the source effect). The texture tiling parameter is a two-dimensional vector. When a seamless looping effect with repeated beginnings and ends is to be achieved, the texture tiling parameter is a number greater than 1 in the horizontal or vertical direction of the texture space, and 1 in the other direction.

[0046] Specifically, a sequence of frames requires static images to be arranged sequentially. Given a fixed total resolution for the sequence, the resolution of a single frame is inversely proportional to the number of frames; the higher the resolution of a single frame, the fewer frames can be accommodated. The visual resolution of a sequence is determined by the resolution of each single frame and the frame rate. The higher the resolution of a single frame, the richer the detail information contained in that image, resulting in a more delicate and clear picture. The frame rate refers to the number of frames displayed per second in a sequence; generally, a higher frame rate results in smoother motion.

[0047] For example, a sequence of frames (static texture) with a frame count of 4x4 and a total resolution of 512x512 has a single frame resolution of 128x128. If the resolution of a single frame is to be increased to 256x256 without changing the sequence of frames, then only 4 frames can be accommodated.

[0048] Therefore, by increasing the texture tiling parameters to make the sequence frames repeat at the beginning and end, the visual resolution of the special effects can be improved, thereby achieving better visual effects.

[0049] In this way, by adjusting a specific parameter (Tiling) of the material shader, the number of times the texture is repeated in the UV direction of the model can be controlled, thereby greatly improving the visual clarity without changing the physical resolution of the texture itself.

[0050] Please see Figure 3 In some implementations, step 01, which involves extracting the transparency channel data of the source effect through the difference between two background colors, may include steps 011, 013, 015, and 016, as detailed below: Step 011: Set a background plane of the first color at a distance behind the source effect, and capture the source effect with a rendering camera to obtain the first image; Step 013: Set a background plane of the second color at a second distance behind the source effect, and capture the source effect with a rendering camera to obtain the second image; Step 015: Calculate the color channel difference between the first and second images pixel by pixel to obtain the difference data; Step 016: Obtain the transparency channel data of the source effect based on the difference data.

[0051] In this context, "behind the source effect" refers to setting a background plane along the viewing direction of the rendering camera (i.e., the rendering camera's line of sight or the rendering camera's forward axis), away from the rendering camera. The normal direction of the background plane is substantially parallel to or coincides with the viewing direction of the rendering camera to ensure uniform background color.

[0052] The first distance refers to the distance between the background plane of the first color and the source effect (or camera), and the second distance refers to the distance between the background plane of the second color and the source effect (or rendering camera). Specifically, in the vertex coordinate system of the engine (such as Unity), it is the shortest straight-line distance from the geometric boundary of the source effect to the surface of the background plane. Controlling the first and second distances is to ensure the purity of the background color and avoid environmental factors interfering with the difference calculation.

[0053] The rendering camera is a dedicated camera component in the engine used to capture source effects. It must ensure that the first and second frames, which contain the same foreground (a static image of the source effect), have completely identical viewpoints, perspectives, and resolutions. Specifically, the rendering camera's field of view should be strictly aligned with the source effect, ensuring that the effect is completely centered in the frame, and that parameters such as position, rotation, field of view, and near / far clipping planes remain locked during the shooting process.

[0054] Specifically, by rendering a camera to capture static images of two source effects with two colors as the background, the corresponding pixels are subtracted one by one to obtain the difference data. After the difference data is reverse-processed, the transparency channel can be accurately extracted, thus fully preserving the gradient transparency of smoke, the soft halo of light and shadow, and even the subtle light spots on the edge of the flame, avoiding the visual loss and resource consumption caused by traditional recording.

[0055] By capturing still images of the source effect and mixing them with solid-color backgrounds of the first and second colors respectively, a system of equations containing two equations can be obtained based on the color mixing formula: Cfirst = Csource×Alpha + Cfirst_background×(1 - Alpha) Csecond = Csource×Alpha + Csecond_background×(1 - Alpha) In this context, Cfirst, Csecond, Cfirst_background, Csecond_background, and Csource all represent the values ​​of a single channel for a single pixel in the image. Cfirst represents the color channel value of each pixel in the first image, and Csecond represents the color channel value of each pixel in the second image; all are known values ​​that can be directly extracted. Since the first and second colors are solid colors, Cfirst_background and Csecond_background represent the color channel values ​​of the solid background, which are consistent and known for each pixel. Alpha represents the value of the transparency channel of a pixel in the static image of the source effect, and is the value to be determined. The difference can be obtained by subtracting the Cfirst equation from the Csecond equation, and then the Alpha value of each pixel in the static image of the source effect can be calculated, resulting in a grayscale image of the transparency channel data for the source effect.

[0056] In some implementations, the background plane of the first color is pure white, and the background plane of the second color is pure black.

[0057] Please see Figure 4 For the example static image with special effects shown in the image, the Unity engine cannot obtain the alpha channel of the semi-transparent area in the static image. Therefore, it is necessary to capture two images with different backgrounds, one white and one black, and subtract them to obtain the alpha channel. Figure 8In the image, the first image is (a), the second image is (b), and the grayscale image formed by subtracting the two images is (c). The A channel is the alpha channel, which cannot be extracted in the Unity engine, but the attribute value exists, and changing the background color does not change the value of the alpha channel. In the pure black background (b), the RGBA channel value of each pixel is (0, 0, 0, 0.5), and in the pure white background (a), the RGBA channel value of each pixel is (1, 1, 1, 0.5). For completely transparent areas, the difference between the RGB values ​​of the white and black backgrounds is (1, 1, 1), which is displayed as pure white in the grayscale image of the difference, as shown in (c). For completely opaque areas, the RGB values ​​do not change with the background color. The difference between the RGB values ​​of the white and black backgrounds is (0, 0, 0), which is displayed as pure black in the grayscale image of the difference, as shown in (c). For example, if the content is gray, its RGB value (0.5, 0.5, 0.5) remains unchanged regardless of whether it is black or white. The difference between the RGB values ​​of the white and black backgrounds is (0, 0, 0), which is displayed as pure black in the grayscale image of the difference, and pure white in the grayscale image of the transparency channel. For semi-transparent areas, the area is affected by the black and white background, but its values ​​will not completely become black and white. For example, the RGB value of this area is (0.8, 0.8, 0.8) on a white background and (0.2, 0.2, 0.2) on a black background. The difference between the two is (0.6, 0.6, 0.6). Therefore, the difference calculated from the color channel values ​​can reflect the information of the transparency channel.

[0058] By capturing still images of the source effect and mixing them with pure black and pure white backgrounds respectively, a system of equations containing two equations can be obtained based on the color mixing formula: Cwhite = Csource×Alpha + 1×(1 - Alpha) Cblack = Csource×Alpha + 0×(1 - Alpha) In the system of equations consisting of these two equations, Cwhite represents the color channel value of the first image, and Cblack represents the color channel value of the second image. The color channel values ​​of each pixel in both the first and second images are known. The 1 in the Cwhite equation represents the background color channel value, and the 0 in the Cblack equation represents the background color channel value, which are also known. Therefore, only two unknowns remain: Csource (the color channel value of the source effect) and Alpha (the transparency channel value of the source effect). By subtracting the Cwhite equation from the Cblack equation, the Csource × Alpha term can be eliminated, leaving only 1 - Alpha. Thus, the Alpha value of each pixel can be obtained through the difference.

[0059] It's understandable that using a pure white or pure black background has the lowest computational complexity and is widely applicable to common color effects. Using a pure white or pure black background avoids interference with colored backgrounds. Furthermore, the color difference calculation between two backgrounds can accurately calculate the alpha channel value. When calculating black-based effects, a red and white background combination can be used. Alternatively, a background combination with a significant color contrast to the effect can be used; for example, a blue and white background combination can be used for yellow-green effects. Combinations of backgrounds other than black and white may result in higher computational complexity.

[0060] In some implementations, the first distance or the second distance is less than the starting distance of the scene-wide fog effect.

[0061] Global fog refers to a global rendering effect that may be enabled in a game engine, mixing specific fog colors based on the distance between objects and the camera. This effect changes the observed color of all objects in the scene, thus interfering with the accuracy of calculating the alpha channel based on a fixed background color difference.

[0062] The starting distance is the position where the fog effect intensity is 0, i.e., the threshold distance at which the fog effect begins to take effect. If the distance between the background plane and the rendering camera is greater than the starting distance of the scene's global fog effect, a fog effect will occur with an intensity greater than 0, interfering with shooting against a solid color background. If the distance between the background plane and the rendering camera is less than the starting distance of the scene's global fog effect, the fog effect intensity is equal to 0, and it will not interfere with shooting against a solid color background. Placing the background plane within this starting distance ensures that its color (pure black and pure white) is not mixed with the fog effect color, guaranteeing the accuracy of the source data used for subsequent difference calculations.

[0063] This is understandable. Based on how fog effects work, engines like Unity use global fog to mix the color of the virtual object with the fog color, depending on the distance between the virtual object and the camera. The greater the distance, the more fog colors are mixed. Because the intensity of the fog effect increases with distance, at very close distances, the fog effect intensity is almost zero. It's necessary to control the distance between the background plane and the special effects to ensure that the background plane's own color remains pure, minimizing the impact of fog on the special effects' color during filming.

[0064] Assume the fog effect color is gray (0.5, 0.5, 0.5). If the background plane is too far away, a pure black background (0, 0, 0) will mix with the gray fog, and the actual image captured will be a dark gray of (0.2, 0.2, 0.2). A pure white background (1, 1, 1) will mix into a light gray of (0.8, 0.8, 0.8), with an actual difference of (0.6, 0.6, 0.6). Since the background values ​​are no longer pure (0, 0, 0) and (1, 1, 1), and their difference is no longer the actual (1, 1, 1), it cannot intuitively reflect the transparency of the source effect. This causes an overall shift in the transparency channel values, resulting in distortion of semi-transparent details, which may require complex color compensation algorithms for correction.

[0065] Specifically, when shooting the first and second frames against a dual background, the background plane can be placed closer to the rendering camera to prevent fog effects from interfering with the shooting in both cases.

[0066] In some implementations, the first distance is equal to the second distance.

[0067] It is understandable that by ensuring that the first and second distances are equal, the perspective distortion of the special effects in the two backgrounds can be ensured to be completely consistent. Even if there is a fog effect, the fog effect intensity is consistent, and there is no need to consider the distance difference when calculating the difference.

[0068] Please see Figure 5 In some implementations, step 016 may include steps 0161 and 0163, as detailed below: Step 0161: For each pixel, take the maximum value or the average value of the color channel components of the corresponding difference data, and use the maximum value or the average value as the grayscale value; Step 0163: Obtain the alpha channel value of the pixel in the output texture based on the grayscale value.

[0069] The grayscale image output after the source texture effect is processed by extracting the transparency channel is the grayscale value of each pixel in the output texture.

[0070] It is understandable that when calculating the difference between the first and second images, the values ​​of the three color channels of each pixel are calculated one by one. The difference between the values ​​of the three color channels may be the same or different. When they are the same, the difference can be directly taken as the difference of that pixel in the difference data. When they are different, comprehensive consideration is required.

[0071] Specifically, the grayscale value of a single channel can be obtained by taking the maximum value among the three color channels, or by calculating the arithmetic mean of the values ​​of the three color channels. This grayscale value reflects the difference state, and when the background is pure white or pure black, it is exactly the opposite of the grayscale value of the transparency channel, reflecting the transparency of the pixel. The grayscale values ​​of all pixels are then processed by solving the color mixing equation (e.g., for black and white backgrounds, simply subtract the grayscale value from 1) to obtain the grayscale image of the transparency channel of the source effect.

[0072] In some implementations, step 0163 may include mapping grayscale values ​​to the alpha channel values ​​of corresponding pixels in the final output texture, including: when the grayscale value is greater than or equal to a preset first threshold, mapping the alpha channel value of the corresponding pixel to 0, which represents complete transparency; when the grayscale value is less than or equal to a preset second threshold, mapping the alpha channel value of the corresponding pixel to 1, which represents complete opacity; and when the grayscale value is between the first threshold and the second threshold, mapping the alpha channel value of the corresponding pixel to a semi-transparent value between 0 and 1.

[0073] The first and second thresholds are used for segmented mapping to separate completely transparent, completely opaque, and semi-transparent areas, which can filter noise, preserve core special effects, and make the edges clearer.

[0074] Specifically, the first threshold can be used to define the core area of ​​the effect (or the outermost extremely faint area of ​​the effect), mapping the alpha channel value of areas with higher alpha channel values ​​to a completely opaque 1; the second threshold can be used to filter out overly bright invalid noise (or the outermost extremely faint area of ​​the effect), mapping the alpha channel value of areas with higher alpha channel values ​​to a completely opaque 1; between the first and second thresholds is the semi-transparent image of the source effect that should be preserved and emphasized. Against pure black or pure white backgrounds, the grayscale value (difference) is the opposite of the alpha channel value.

[0075] Please see Figure 6 In some implementations, step 01: generating at least one static texture containing alpha channel data may include steps 017 and 019, as detailed below: Step 017: Obtain color data from the first screen and / or the second screen; and Step 019: Combine the color data with the alpha channel data to generate a static texture containing the alpha channel data.

[0076] The color data can be the color channel data in the first image. If it is white, the highlight areas and bright details can be well preserved, but the color will be diluted and the saturation will be low. The color data can also be the color channel data in the second image. If it is black, the color purity and saturation will be the highest, and it will be closest to the source effect color. The color data can also be the color channel data of the image after the first and second images are combined, which is suitable for complex semi-transparent effects.

[0077] It is understandable that the data in the alpha channel is a single-channel grayscale image, and information from the color channel needs to be added to obtain a static image of the source effect with optimized details, thereby achieving the effect of the source effect.

[0078] For example, when performing interpolation on pure white and pure black backgrounds, the extracted alpha channel data is stored in a 2D texture plane. Since the image taken against a black background is closer to the color of the source effect, the color channel data taken against the black background can be set as the color data. Then, the color data is assigned to the 2D texture containing alpha channel information as its color channel data, thus combining the color data and alpha channel data. Finally, a static texture containing the alpha channel information and color information of the source effect can be obtained.

[0079] Please see Figure 7 In some implementations, step 03: obtaining the planar model includes steps 031, 033, 035, and 037, which are described in detail below: Step 031: Provide an initial model, which is a rectangular geometry; Step 033: Apply bending modification to the initial model to form a ring geometry that is non-overlapping and seamlessly connected; Step 035: Generate the corresponding texture in the ring geometry state; Step 037: Undo the bend modification to restore the model's geometry to a rectangular geometry, while retaining the ring texture mapping generated under the ring geometry to obtain a planar model.

[0080] The rectangular geometry is a planar model with a specific aspect ratio to ensure that it can be bent into a ring-shaped assembly without gaps or overlaps.

[0081] The bending modification allows bending to be achieved by adding a bending modifier to the initial planar model (rectangular geometry).

[0082] Generating the corresponding texture is the process of establishing a texture coordinate system (i.e., texture space) in the state of a ring geometry.

[0083] Please see Figure 8For example, creating a texture-mapped planar model in 3ds Max (a 3D computer graphics modeling software). Create a rectangular plane with a length of 10m and a width of 31.41m, such as... Figure 9 Add a Bend modifier to (a) and set the bend angle to 360 degrees and the bend axis to the Y-axis (within...). Figure 9 (a) shows the vertical bending axis of the rectangle, and drag the axis of the Bend modifier to completely bend it into a ring geometry (not shown in the figure, but should be a cylindrical ring with a bottom circumference equal to the length (10m)). The ring geometry is non-overlapping and seamlessly connected.

[0084] Then, add a UVW map modifier to it in 3ds Max, set the map to planar mode, add a UVW unfold modifier, and open the UV editor to get... Figure 9 The circle in (b) is obtained by projecting the sum of all points on a circumference of the toroidal geometry into a single point. It can also be seen as the projection of the conical ring corresponding to the cylindrical ring. Observing the texture at this time, we can see that the texture arrangement in the UV editor is consistent with the initial model, i.e., the rectangular plane.

[0085] Finally, delete the Bend modifier from the modifier list of the current planar model. The model will then revert to its original rectangular plane before bending, but the UVs in the UV editor will still be circular. Figure 9 As shown in (c) and (d), the circular texture is mapped onto the planar model, which makes the leftmost wide edge of (c) and the rightmost wide edge of (c) continuous in the texture space of the planar model.

[0086] In some implementations, step 03: obtaining a planar model includes: reading a preset planar model; or, generating a planar model.

[0087] It is understandable that the planar model capable of achieving the first-to-last repetition mapping described above can be a pre-defined planar model, or a model generated once or in real-time during the execution of a computer program. Therefore, the planar model can be obtained by reading or generating it.

[0088] Please see Figure 9 In some implementations, step 04: providing a dynamically rendered texture, includes steps 041 and 043, which are described in detail below: Step 041: Based on the static texture, create and play a dynamic source effect in the scene; and Step 043: Set up a rendering camera, configure its output target as a dynamic rendering texture, and align it with a dynamic source effect so that the content of the dynamic rendering texture updates in real time with the dynamic changes of the source effect.

[0089] Specifically, after importing the planar model obtained in step 03, which can realize the first and last repeat mapping function, into the engine, it is necessary to map the texture of the source effect onto the planar model. The texture of the source effect to be mapped should be a dynamic rendering texture formed by static texture.

[0090] To obtain dynamically rendered textures, Render Texture maps can be used. A Render Texture is a special type of texture on the GPU that is typically used as a rendering target. During the rendering process, the camera's rendering results can be output to this texture instead of directly to the screen, in order to store the rendering results and reduce resource consumption.

[0091] In some implementations, the step 041, which describes creating and playing a dynamic source effect in the scene based on a static texture, includes: providing a planar carrier model in the scene; creating a material, assigning a static texture to the material, and applying the material to the planar carrier model; and controlling the texture coordinates or texture offset of the material to drive the static texture to produce dynamic visual changes on the planar carrier model, thereby forming a dynamic source effect.

[0092] Specifically, a new blank Unity scene is created, and a new Render Texture is added to carry the output dynamic texture. The resolution of the Render Texture is set (e.g., to 1024×1024). At the same time, a new rendering camera is added specifically to capture the source effects, and the output texture of the camera is set to the newly added Render Texture. The logic of this operation is to transmit the image captured by the camera to the Render Texture, which serves as a buffer.

[0093] It's understandable that during the frame-by-frame recording stage using a rendering camera, since the frames are static images arranged sequentially as textures, it's necessary to merge and arrange the recorded images of each frame. This can be achieved using a 2D texture function to obtain the width and height resolution of the currently captured single frame, and then create a 2D texture. The width of this texture is the number of columns in the frame sequence multiplied by the width of the single frame, and the height is the number of rows in the frame sequence multiplied by the height of the single frame. That is, for a 2x4 frame sequence with a single frame resolution of 128x128, the overall resolution needs to be set to 256x512.

[0094] If tiling values ​​for a sequence of frames are needed to achieve high-resolution rendering of low-resolution textures, the sequence of frames needs to be kept in a single row and used for mapping within a circular model enclosed by a curved rectangle. The model and UVs should be as follows: Figure 10As shown. Further applying this model, the planar carrier model is placed in the created Unity scene. A new ordinary semi-transparent material is added, and the Render Texture map, including the dynamic texture of the source effects obtained above, is used to texture the semi-transparent material, resulting in the MainTexture. The MainTexture is then mapped onto the planar carrier model (material rendering). When the planar carrier model is a planar model that allows for repeated mapping, the source effects... Figure 11 (a) in the middle can be expanded as Figure 11 In (b), the exported sequence frames are as follows: Figure 11 As shown in (c), after increasing the tiling value, as Figure 11 As shown in (d), when you play the effect, you can see the dynamic effect of the effect being mapped by the texture and then unfolded onto the plane, with the top and bottom ends repeating.

[0095] This application provides a rendering method. First, it extracts the alpha channel data of the source effect and generates at least one static texture containing the alpha channel data. Then, it obtains a planar model whose texture coordinates are circular texture coordinates. Based on the obtained static texture, it provides a dynamic rendering texture. Subsequently, it performs material rendering on the planar model based on the dynamic rendering texture. Finally, it drives the texture coordinates of the planar model to scroll along a circular direction to loop the source effect on the planar model, wherein the circular direction is determined based on the circular texture coordinates. The rendering method provided by this application can automatically achieve a seamless looping effect of the effect while preserving the details of the source effect, making the effect texture clearer.

[0096] The rendering method provided in this application produces special effects with clear textures, seamless loops, and complete preservation of semi-transparent gradients and lighting details at the edges, achieving an effect essentially identical to the source special effects. By increasing the tiling value, the overall visual resolution of the special effects can be improved. The planar model in this application is typically a continuous single facet or a simple geometric shape composed of very few facests. During rendering, for any pixel on the screen, at most one facet of this single model contributes color. This eliminates overdraw caused by multiple particle facets stacked within the same special effect. It reduces the number of fragment shader calls and color blending operations on the GPU. Recording a sequence of frames is equivalent to pre-rendering the special effects offline and saving the data locally, which can reduce rendering costs during real-time runtime. Compared to relying on manual analysis and processing by special effects production experts, it can greatly compress the number of particle emitters, overdraw, and the number of semi-transparent overlays in the special effects, significantly reducing the resource consumption of the special effects.

[0097] All of the above technical solutions can be combined in any way to form the optional implementation methods of this application, and will not be described in detail here.

[0098] To facilitate better implementation of the rendering method described in this application, this application also provides a rendering apparatus. Please refer to... Figure 12 , Figure 12 A schematic diagram of the structure of a rendering apparatus provided in an embodiment of this application. The rendering apparatus 200 may include: Processing module 201 is used to extract the transparency channel data of the source effect and generate at least one static texture containing the transparency channel data; The acquisition module 202 is used to acquire a planar model, wherein the texture coordinates of the planar model are circular texture coordinates; Module 203 is provided for providing a dynamic rendering texture, the dynamic rendering texture being generated based on the static texture; Rendering module 204 is used to perform material rendering on the planar model based on the dynamic rendering texture; and The driving module 205 is used to drive the texture coordinates of the planar model to scroll along a circular direction to loop the source effect on the planar model, wherein the circular direction is determined based on the circular texture coordinates.

[0099] It should be noted that the functions of each module in the rendering device 200 in this application embodiment can be referred to the specific implementation of any of the above-mentioned method embodiments, and will not be repeated here.

[0100] Each unit in the above-described device can be implemented entirely or partially through software, hardware, or a combination thereof. Each unit can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each unit.

[0101] For example, the rendering device 200 can be integrated into a terminal or server that has storage and a processor and thus computing power, or the rendering device 200 can be the terminal or server.

[0102] In some embodiments, this application also provides a computer device including a memory and a processor, wherein the memory stores one or more computer instructions, and the processor executes the stored one or more computer instructions to implement the steps in the above-described method embodiments.

[0103] Figure 13 A schematic structural diagram of the computer device provided for the embodiments of this application, such as... Figure 13As shown, the computer device 300 may include: a communication interface 301, a memory 302, a processor 303, and a communication bus 304. The communication interface 301, memory 302, and processor 303 communicate with each other via the communication bus 304. The communication interface 301 is used for data communication between the device 300 and external devices. The memory 302 can be used to store software programs and modules, and the processor 303 runs the software programs and modules stored in the memory 302, such as the software programs for corresponding operations in the aforementioned method embodiments.

[0104] In some implementations, the processor 303 can invoke software programs and modules stored in the memory 302 to perform the following operations: Extract the alpha channel data of the source effect and generate at least one static texture containing the alpha channel data; Obtain the planar model, where the texture coordinates of the planar model are the coordinates of the ring texture; Provides a dynamically rendered texture, which is generated based on a static texture; Material rendering of planar models based on dynamic rendering textures; and The texture coordinates of the driving planar model are scrolled along a circular direction to loop the source effect on the planar model, where the circular direction is determined based on the circular texture coordinates.

[0105] In some embodiments, the computer device 300 may be integrated, for example, into a terminal or server that has storage and a processor and thus computing power, or the computer device 300 may be the terminal or server.

[0106] This application also provides a computer-readable storage medium for storing a computer program. This computer-readable storage medium can be applied to a computer device, and the computer program causes the computer device to execute the corresponding processes in the methods described above in the embodiments of this application; for brevity, these will not be elaborated further here.

[0107] This application also provides a computer program product including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the corresponding processes in the methods described above in the embodiments of this application. For brevity, these details will not be elaborated further here.

[0108] This application also provides a computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the corresponding processes in the methods described above in the embodiments of this application. For brevity, these details will not be elaborated further here.

[0109] It should be understood that the processor in the embodiments of this application may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method embodiments can be completed by the integrated logic circuits in the processor's hardware or by instructions in software form. The processor described above can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above method.

[0110] It is understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

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

[0112] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the aforementioned method implementations, and will not be repeated here.

[0113] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0114] In this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0115] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0116] In addition, the functional units in the embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0117] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer or a server) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.

[0118] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for rendering special effects, characterized in that, include: Extract the alpha channel data of the source effect and generate at least one static texture containing the alpha channel data; Obtain a planar model, wherein the texture coordinates of the planar model are circular texture coordinates; A dynamic rendering texture is provided, which is generated based on the static texture; The planar model is material-rendered based on the dynamic rendering texture; The texture coordinates of the planar model are driven to scroll along a circular direction to loop the source effect on the planar model, wherein the circular direction is determined based on the circular texture coordinates.

2. The rendering method according to claim 1, characterized in that, include: By adjusting the texture tiling parameters in the ring direction using the material shader, the dynamically rendered texture is repeatedly stitched together on the surface of the planar model.

3. The rendering method according to claim 1, characterized in that, The extracted source effect transparency channel data includes: A background plane of a first color is set at a first distance behind the source effect, and the source effect is captured by a rendering camera to obtain a first image; A background plane of a second color is set at a second distance behind the source effect, and the source effect is captured by the rendering camera to obtain a second image; The color channel difference between the first image and the second image is calculated pixel by pixel to obtain the difference data; The transparency channel data of the source effect is obtained based on the difference data.

4. The rendering method according to claim 3, characterized in that, The background plane of the first color is pure white, and the background plane of the second color is pure black.

5. The rendering method according to claim 3, characterized in that, The first distance or the second distance is less than the starting distance of the scene's global fog effect. The first distance is equal to the second distance.

6. The rendering method according to claim 5, characterized in that, The first distance is equal to the second distance.

7. The rendering method according to claim 3, characterized in that, The step of obtaining the transparency channel data of the source effect based on the difference data includes: For each pixel, obtain the maximum value or the average value of the color channel components of the difference data corresponding to the pixel, and use the maximum value or the average value as the grayscale value; and The alpha channel value of the pixel in the output texture is obtained based on the grayscale value.

8. The rendering method according to claim 7, characterized in that, Obtaining the alpha channel value of the pixel in the output texture based on the grayscale value includes: When the grayscale value is greater than or equal to a preset first threshold, the transparency channel value of the pixel is determined to be 0, which represents complete transparency; When the grayscale value is less than or equal to a preset second threshold, the transparency channel value of the pixel is determined to be 1, which represents complete opacity; When the grayscale value is between the first threshold and the second threshold, the transparency channel value of the pixel is determined to be a semi-transparent value between 0 and 1.

9. The rendering method according to claim 3, characterized in that, Generating at least one static texture containing the alpha channel data includes: Obtain color data from the first screen and / or the second screen; and The color data is combined with the alpha channel data to generate a static texture containing the alpha channel data.

10. The rendering method according to claim 1, characterized in that, The acquisition of the planar model includes: Obtain an initial model, wherein the initial model is a rectangular geometry; The initial model is bent and modified to form a ring geometry, which is non-overlapping and seamlessly connected. In the state of the ring geometry, the corresponding texture is generated; Undo the bending modification to restore the geometry of the initial model to a rectangular geometry, and retain the annular texture mapping generated under the annular geometry to obtain the planar model.

11. The rendering method according to claim 1, characterized in that, The provision of a dynamically rendered texture includes: Based on the static texture, a dynamic source effect is created and played in the scene; and Set up a rendering camera, configure its output target as a dynamic rendering texture, and align it with the dynamic source effect so that the content of the dynamic rendering texture updates in real time with the dynamic changes of the source effect.

12. A rendering apparatus, characterized in that, include: The processing module is used to extract the transparency channel data of the source effect and generate at least one static texture containing the transparency channel data; An acquisition module is used to acquire a planar model, wherein the texture coordinates of the planar model are circular texture coordinates; A module is provided for providing a dynamically rendered texture, the dynamically rendered texture being generated based on the static texture; The rendering module is used to perform material rendering on the planar model based on the dynamic rendering texture; and A driving module is used to drive the texture coordinates of the planar model to scroll along a circular direction to loop the source effect on the planar model, wherein the circular direction is determined based on the circular texture coordinates.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted for loading by a processor to perform the rendering method as described in any one of claims 1-11.

14. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing a computer program, and the processor executing the rendering method according to any one of claims 1-11 by calling the computer program stored in the memory.

15. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the rendering method according to any one of claims 1-11.