Data processing method and apparatus
By acquiring and storing the baked state mapping relationship in the skeletal animation, the problem of decal slippage in the skeletal animation is solved, and efficient decal rendering is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHUHAI KINGSOFT ONLINE GAME TECH CO LTD
- Filing Date
- 2026-03-27
- Publication Date
- 2026-06-23
AI Technical Summary
When processing skinned meshes with skeletal animation, existing techniques cannot follow the non-linear deformation of vertices, resulting in visual sliding or floating, and the computational overhead is high, leading to low rendering efficiency.
By obtaining the baked state mapping relationship of the target bone in the initial frame, the bone position information of the current frame is obtained in response to the bone offset, the target position of the decal is redefined and rendered, avoiding the calculation of irrelevant bone data, and storing the decal influence relationship in units of bones.
It reduces computational overhead, avoids decal slippage, and improves rendering efficiency.
Smart Images

Figure CN122265490A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to data processing methods. This application also relates to a data processing apparatus, a computing device, a computer-readable storage medium, and a computer program product. Background Technology
[0002] With the continuous development of computer technology, dynamic decals are commonly used to represent various environmental interactions in real-time rendering scenarios of digital cultural and creative products. Dynamic decals are a technique used in games and graphics rendering to create real-time changing visual effects on object surfaces, such as changes in object material or the appearance of pits or depressions on the object's surface.
[0003] However, when processing skinned meshes with skeletal animation, decals are typically projected using a static coordinate system or simple hierarchical mounting. In this case, when complex skeletal animation exists on the object, the decal projection cannot follow the non-linear deformation of the vertices, causing the decal to appear to "slide" or "float" on the object's surface. To resolve this slippage, it's necessary to upload the entire skeleton matrix corresponding to the object and recalculate the decal's placement on the object's surface for each frame based on the current bone position and pose. However, this approach incurs significant computational overhead. Furthermore, since decals are typically attached to local areas of the object, uploading the entire skeleton matrix for skinning results in calculations of a large amount of irrelevant skeletal data, leading to wasted computation and transmission of skeletal data. Summary of the Invention
[0004] In view of this, embodiments of this application provide a data processing method. This application also relates to a data processing apparatus, a computing device, a computer-readable storage medium, and a computer program product, to address the aforementioned problems existing in the prior art.
[0005] According to a first aspect of the embodiments of this application, a data processing method is provided, including: Obtain at least one baked state mapping relationship of the target bone in the target object in the initial frame, wherein each baked state mapping relationship is determined based on the initial frame bone position information between each sticker and the target bone in the initial frame; In response to the target bone shifting in the current frame, the current frame bone position information corresponding to the target bone is obtained, and the target position information between the target bone and each decal is determined based on the current frame bone position information and the mapping relationship of each baked state. Based on the target position information between the target bone and each decal, each decal is rendered to the current frame bone position corresponding to the target bone.
[0006] According to a second aspect of the embodiments of this application, a data processing apparatus is provided, comprising: The acquisition unit is configured to acquire at least one baked state mapping relationship of the target bone in the target object in the initial frame, wherein each baked state mapping relationship is determined based on the initial frame bone position information between each decal and the target bone in the initial frame; The determining unit is configured to, in response to the target bone shifting in the current frame, acquire the current frame bone position information corresponding to the target bone, and determine the target position information between the target bone and each decal based on the current frame bone position information and the mapping relationship of each baked state; The rendering unit is configured to render each decal to the current frame bone position corresponding to the target bone based on the target position information between the target bone and each decal.
[0007] According to a third aspect of the embodiments of this application, a computing device is provided, comprising: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions, which, when executed by the processor, implement the steps of the above-described data processing method.
[0008] According to a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided that stores a computer program / instructions, which, when executed by a processor, implement the steps of the above-described data processing method.
[0009] According to a fifth aspect of the present application, a computer program product is provided, including a computer program / instructions that, when executed by a processor, implement the steps of the above-described data processing method.
[0010] According to the data processing method provided in this application, by detecting the presence of a hit target bone in the target object in the initial frame, at least one decal affecting the target bone is obtained, and the initial frame bone position information between each decal and the target bone is determined. Based on the bone position information between each decal and the target bone in the initial frame, the baked state mapping relationship between each decal and the target bone in the initial frame is obtained. On this basis, the current bone position information of the bone and the decal is determined, and combined with the baked state mapping relationship between the bone and the decal, the target position information of the bone and the decal in the current frame is obtained. According to this application, by determining the baked state mapping relationship between the bone affected by the decal and each decal on a bone-by-bone basis, the computational overhead is reduced, thereby avoiding the calculation of a large amount of irrelevant bone data when calculating the target position relationship between the bone and the decal in the current frame, thus improving the decal rendering efficiency. On this basis, by combining the current bone position information with the baked state mapping relationship, the decal and the target bone can maintain a precise relative positional relationship, thereby effectively preventing the decal from slipping. Attached Figure Description
[0011] Figure 1 A flowchart of a data processing method according to an embodiment of this application is shown; Figure 2 This illustration shows a schematic diagram of the structure of a data processing apparatus according to an embodiment of this application; Figure 3 A structural block diagram of a computing device according to an embodiment of this application is shown.
[0012] Obviously, the accompanying drawings are only some illustrative examples of embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without any creative effort. Detailed Implementation
[0013] Many specific details are set forth in the following description to provide a full understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this application; therefore, this application is not limited to the specific embodiments disclosed below.
[0014] The terminology used in one or more embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the scope of one or more embodiments of this application. The singular forms “a,” “the,” and “the” used in one or more embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” used in one or more embodiments of this application refers to and includes any or all possible combinations of one or more associated listed items. For example, “A and / or B” can represent three cases: only A exists, only B exists, and both A and B exist, where A and B can be singular or plural. The character “ / ” generally indicates that the preceding and following objects are in an “or” relationship. “At least one of the following” or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of A, B, or C can represent: A, B, C, “A and B,” “A and C,” “B and C,” or “A and B and C,” where A, B, and C can be single or multiple.
[0015] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this application, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another and are not necessarily used to describe a specific order or sequence. It should be understood that such terms can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those described herein. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this application, and similarly, second may also be referred to as first. Furthermore, the terms "comprising," "having," "including," and variations thereof all indicate non-exclusive inclusion, such as a process, method, system, product, or device that comprises a series of steps or units, not limited to the steps or units explicitly listed, but may also include other steps or units not explicitly listed or inherent in the process itself.
[0016] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0017] The data processing method provided in this solution is applicable to the field of computer graphics rendering, such as applying decals to objects in game scenes. It can be widely used in next-generation information technology fields (such as artificial intelligence and virtual reality) for digital cultural and creative product creation software and other related fields.
[0018] First, the terms and concepts involved in one or more embodiments of this application will be explained.
[0019] Mesh: A 3D model is a surface composed of countless triangles. The shape of the model is formed by the vertices of the triangles. The vertex positions of a static mesh are fixed.
[0020] Bones: Bones are a hierarchical structure (parent-child relationship). In the embodiments provided in this application, taking a skinned network model of a target object including a left arm region, a right arm region, and a torso region as an example, this hierarchy can be understood as the body being the parent, the arm being the child of the body, the forearm being the child of the arm, and the hand being the child of the forearm. Each bone has a transformation matrix (position, rotation, scaling) used to determine the bone's pose in space.
[0021] Skinning: Skinning refers to the process of binding mesh vertices to bones. Each vertex can be affected by multiple bones, and the degree of influence of each bone on the vertex is represented by a weight.
[0022] With the continuous development of computer technology, dynamic decals are often used to represent different visual effects produced in the environment when applying decals to object surfaces. In this process, a new mesh that perfectly fits the object's surface is dynamically generated based on a static coordinate system, and the decal texture is projected onto this new mesh. Alternatively, based on simple hierarchical mounting, decals can be drawn on the object's surface using projection matrices or screen space techniques.
[0023] When complex skeletal animation occurs on an object's surface, using a static coordinate system, the mesh projection creates a new, independent mesh during generation and fixes its vertices to specific positions on the object's surface. This fixing process is static, used to record the object's surface topology at that moment. When the skeletal animation plays, the vertices on the object's surface move according to the bound bones and weights, and the world position of each vertex is obtained by a weighted sum of the transformation matrices of its associated bones. However, because the vertex weights projected onto the mesh are copied from the vertices of the original surface to which they are attached, for example, when a joint bends, the projected mesh, as an independent geometry, may have vertices in different parts assigned to different bones. As the joint rotates, the vertices in different parts move in completely different directions, causing the originally smooth decal mesh to shift and misalign at the joint.
[0024] Furthermore, the simple hierarchical mounting method essentially involves applying decals to the pixels of an object like slides in the later stages of the graphics rendering pipeline, without altering the object's geometry. Therefore, when skeletal animation undergoes complex geometric transformations, decals generated in this way do not actively simulate the physical effects produced by the skeletal animation, leading to visually disorienting drift phenomena.
[0025] In summary, based on the above methods, during skeletal animation playback, to prevent decals from slipping on the object's surface when bones shift, it's necessary to upload the entire bone matrix corresponding to the object and perform real-time calculations. However, generating independent mesh decals that move with the bones in this way causes DrawCall to increase linearly with the number of decals (O(n)), severely impacting CPU submission efficiency in scenarios with numerous bullet holes. Furthermore, recalculating decal positions on the CPU every frame incurs significant computational overhead. Moreover, since decals are typically attached to local areas of an object, this also leads to calculations on a large amount of irrelevant bone data, resulting in wasted bone data calculation and transmission, ultimately leading to low rendering efficiency.
[0026] In view of this, this application provides a data processing method that stores the baked-state mapping relationship between bones affected by decals and decals, on a bone-by-bone basis. When a bone shifts, the stored baked-state mapping relationship between bones and decals is combined with the current frame bone position information to redetermine the target position information between the bones and decals, and then rendered to the current frame bone position to avoid slippage caused by decals. This application also relates to a data processing apparatus, a computing device, a computer-readable storage medium, and a computer program product, which will be described in detail in the following embodiments.
[0027] Figure 1A flowchart of a data processing method according to an embodiment of this application is shown, specifically including the following steps 102-106: Step 102: Obtain at least one baked state mapping relationship of the target bone in the target object in the initial frame, wherein each baked state mapping relationship is determined based on the initial frame bone position information between each decal and the target bone in the initial frame.
[0028] The target object can be understood as a skinned mesh model with a skeletal structure that can be animated in a 3D virtual scene. For example, the skinned mesh model can be a character or mecha in a game. For ease of understanding, this application uses an object that at least includes a torso region, a left arm region, and a right arm region as the target object, and will explain this further later.
[0029] A skeleton can be understood as the basic unit that constitutes a target object; a skeleton is a transformation node that drives the movement of the model's vertices. The target skeleton involved in this application can be understood as a skeleton that has an attachment relationship with the decal. It should be understood that in this application, the target object can have at least one target skeleton.
[0030] The initial frame can be understood as the moment when a decal is created and attached to the target object. It's important to understand that since different decals are created and attached to the target object at different times, the initial frame for each decal in this application does not represent a fixed moment. In other words, in this application, each decal affecting the target skeleton has its own initial frame.
[0031] Baked state mapping can be understood as a data association that binds and stores the transformation state of a decal to the target skeleton in the initial frame. For example, it could be a snapshot of the skeleton's pose when the decal is generated.
[0032] Decals can be understood as textures projected onto the surface of a 3D model to simulate the physical and visual effects produced during various interactions in a 3D virtual scene. Examples include bullet holes and stains. The decals involved in this application are those that affect the target skeleton during skeletal animation.
[0033] The initial frame bone position information can be understood as the transformation data of the target bone in world space in the initial frame, represented in the form of a matrix, which includes the position, rotation and scaling information of the bone.
[0034] In one specific embodiment provided in this application, a baked-state mapping relationship is determined based on the initial frame bone position information between the decal and the target bone in the initial frame. Accordingly, at least one baked-state mapping relationship corresponding to the target bone affected by at least one decal is obtained. It should be understood that the baked-state mapping relationship involved in this application is a pre-determined and stored snapshot data of the target bone pose at the time of decal generation.
[0035] It should be noted that the target skeleton involved in this application can be determined in the following way: A pre-configured skeletal subset of the target object is provided, wherein the skeletal subset includes at least one bone corresponding to different regional structures of the target object; In response to detecting a decal generation event, the target area structure corresponding to the decal generation event is determined; The target skeleton is determined from the skeleton subset corresponding to the target region structure.
[0036] In one specific embodiment provided in this application, different bone subsets are set for different regional structures of the target object. When a decal generation event is detected, the regional structure affected by the decal generation event is determined, and then the corresponding bone subset is determined, thereby determining at least one bone affected by the decal generation event. The at least one bone affected by the decal generation event is then identified as the target bone.
[0037] For ease of understanding, this application uses the following method to explain and illustrate the mapping relationship of at least one baking state corresponding to the target bone.
[0038] In a specific embodiment provided in this application, obtaining at least one baked state mapping relationship of the target bone in the target object corresponding to the initial frame includes S1022-S1026: S1022. In response to detecting a decal generation event in the initial frame, determine the target bone corresponding to the decal generation event and at least one decal.
[0039] In one specific embodiment provided in this application, by detecting a hit point in the target object using ray tracing in the initial frame and determining that a decal is generated at the hit point location, a decal generation event is determined to have been detected in the initial frame. Based on the decal generation event, the relevant skeleton to which the decal is attached in the target object is determined, resulting in at least one target skeleton.
[0040] In one example, the hit point on the target object is detected by ray detection, the triangle to which the hit point is attached is determined, and then the bone index of the vertex corresponding to the driving triangle is determined. The bone corresponding to the obtained bone index is identified as the target bone. For ease of understanding, this application uses a single target bone as an example. However, it should be understood that the target bone can be a single bone or represent a group of bones. It should also be understood that the decal generation event contains all the contextual information required for the decal creation.
[0041] S1024. Obtain the position information of the target bone in the initial frame and obtain the initial decal attribute information corresponding to each decal.
[0042] The initial decal attribute information can be understood as the decal's attachment location, as well as data describing the decal's geometric appearance and projection method. For example, decal attribute information may include the decal's projection view matrix, world space projection direction, etc.
[0043] In one specific embodiment provided in this application, obtaining the initial decal attribute information corresponding to each decal includes: In the decal generation event, the decal size corresponding to each decal is determined, and the hit point position information and normal direction corresponding to the hit point are detected, wherein the hit point is determined based on the target bone hit by the decal generation event; Based on the decal size, hit point position information and normal direction of each decal, determine the projection view matrix and world space projection direction of each decal. Based on the projection view matrix corresponding to each decal and the world space projection direction, the initial decal attribute information corresponding to each decal is obtained.
[0044] In this context, decal size can be understood as the range of sizes a decal represents in world space. For example, it can be a two-dimensional scale used to determine the scaling ratio of the decal's projection.
[0045] The point of impact can be understood as the intersection point on the target object's surface when the detected ray intersects with it. It's important to understand that this point is the three-dimensional coordinate point of the intersection.
[0046] Hit point location information can be understood as the three-dimensional spatial coordinates of the hit point, which is used to define the specific position where the decal is rendered on the target object.
[0047] The normal direction can be understood as the orientation of the target object's surface at the point of impact, used to determine whether the decal should be applied flat to the surface or projected at an angle.
[0048] The projection view matrix can be understood as a matrix used to transform points in world space to the local projection space of the decal itself. This matrix includes placement information, rotation information, and scaling information. Placement information involves placing the center point of the decal at the hit point location. Rotation information involves rotating the decal according to the normal direction so that its projection direction (usually the Z-axis or Y-axis of its local coordinate system) is aligned with (or opposite to) the surface normal. Scaling information involves scaling the projection range of the decal according to its size. It should be understood that, in the embodiments provided in this application, the projection view matrix allows the transformation of vertex coordinates in world space to the decal's projection space in the shader, thereby calculating UV coordinates and determining whether the vertex should be covered by the decal.
[0049] World space can be understood as the absolute coordinate system in a three-dimensional virtual scene.
[0050] The projection direction can be understood as the direction vector of the decal projection.
[0051] In one specific embodiment provided in this application, the skinned mesh to which the hit point is attached is analyzed by the correlation between the decal generation event and the target bone, thereby determining which bones drive the skinned mesh and thus identifying the target bone. Further, the decal size, hit point position information, and normal direction of each decal affecting the target bone are converted into a projection view matrix and world space projection direction usable by the graphics rendering pipeline. The obtained projection view matrix and world space projection direction corresponding to each decal are then determined as the initial decal attribute information of the decal in the initial frame.
[0052] According to a specific embodiment provided in this application, the projection view matrix and world space projection direction are obtained by using the decal size, hit point position information, and normal direction. This ensures that the spatial attribute information such as position, orientation, and size of each decal is accurately captured when it is created, facilitating subsequent determination of which point in world space should be affected by this decal, thereby avoiding rendering errors caused by ambiguous decal definitions. Furthermore, determining the decal's projection view matrix and world space projection direction based on the normal direction allows the decal to be printed flatly on the surface, thus improving the visual effect of the decal on the target object's surface.
[0053] S1026. Based on the position information of the bone to be processed in the initial frame and the initial decal attribute information corresponding to each decal, determine at least one baked state mapping relationship of the target bone in the initial frame.
[0054] The baking state mapping relationship can be understood as the data used to anchor the sticker to the target bone, calculated using the target bone's position information in the initial frame and the initial sticker attribute information corresponding to each sticker.
[0055] In one specific embodiment provided in this application, based on the bone position information to be processed in the initial frame and the initial sticker attribute information corresponding to each sticker, the baked state mapping relationship between each sticker and the target bone in the initial frame is determined, and at least one baked state mapping relationship is obtained.
[0056] In one specific embodiment provided in this application, based on the position information of the bone to be processed in the initial frame and the initial decal attribute information corresponding to each decal, at least one baked state mapping relationship of the target bone in the initial frame is determined, including: Determine the initial decal attribute information corresponding to the decal to be processed, wherein the decal to be processed is any one of the decals; Based on the position information of the bone to be processed and the initial sticker attribute information corresponding to the sticker to be processed, the initial frame bone matrix snapshot of the sticker to be processed and the target bone is calculated. Based on the initial frame skeleton matrix snapshot corresponding to the decal to be processed, the baking state mapping relationship of the target skeleton in the initial frame is determined.
[0057] In this context, "decals to be processed" can be understood as decal instances that are currently being processed but have not yet completed their calculation process. It's important to understand that "decals to be processed" is a looping iterative object among all decals, representing any decal that needs to be processed during the traversal.
[0058] The initial frame skeleton matrix snapshot can be understood as a transformation matrix data that records how the decal is positioned relative to the target skeleton at the moment of decal generation.
[0059] In one example, the initial frame bone matrix snapshot can be determined by determining the world matrix of the target bone and the projection matrix of the decal in world space. Based on the world matrix of the target bone and the projection matrix of the decal in world space, the local matrix of the decal relative to the target bone is obtained. The local matrices of each decal relative to the target bone are calculated sequentially to obtain the initial frame bone matrix snapshot for each decal. It should be understood that the initial frame bone matrix snapshot involved in this application does not change with subsequent animation of the target bone.
[0060] Specifically, based on the initial frame skeleton matrix snapshot corresponding to the decal to be processed, the baked state mapping relationship of the target bone in the initial frame is determined, including: Obtain the decal identifier corresponding to the decal to be processed; Based on the decal identifier to be processed, the baking slot index corresponding to the decal identifier to be processed is determined in the preset baking slot corresponding to the target bone; Based on the baking slot index, the initial frame skeleton matrix snapshot corresponding to the decal to be processed is stored to obtain the baking state mapping relationship.
[0061] The decal identifier to be processed can be understood as an identifier (ID) used to uniquely distinguish and identify the current decal to be processed. It should be understood that in this application, each decal is assigned a unique ID when it is created. Based on this, all subsequent operations on the decal (such as updating, destroying, rendering) are performed by calling the ID corresponding to the decal.
[0062] Preset baking slots can be understood as predefined, fixed storage locations pre-assigned to the target skeleton to store the baking state data corresponding to different decals.
[0063] A baking slot index can be understood as a number used to precisely locate a specific slot in a predefined baking slot array. For example, if the data for decal A is stored in slot 1 and the data for decal B is stored in slot 2, then baking slot 1 and baking slot 2 can be used to represent the baking slot indices corresponding to decal A and decal B, respectively.
[0064] In one specific embodiment provided in this application, a decal identifier corresponding to the decal to be processed is obtained, and based on the decal identifier, a baking slot index corresponding to the decal identifier is determined from a preset baking slot. On this basis, an initial frame skeleton matrix snapshot corresponding to the decal to be processed is stored in the corresponding baking slot index, thereby establishing a baking state mapping relationship for the decal to be processed.
[0065] According to a specific embodiment provided in this application, decal data is stored in units of bones based on a preset baking slot and baking slot index. This allows the location of the required data to be quickly determined based on the stored decal identifiers during rendering, eliminating the need for complex search or traversal operations and thus improving the rendering efficiency of decals.
[0066] Furthermore, after determining the baking slot index corresponding to the decal identifier in the preset baking slot corresponding to the target bone based on the decal identifier to be processed, the method further includes: Obtain the decal display period of the decal corresponding to the decal identifier to be processed from the baking tank index; If the decal display cycle meets the cycle condition, a recycling mark is configured for the decal identifier to be processed; Based on the recycling marker, the decal to be processed is recycled, and the initial frame bone position information corresponding to the decal to be processed is cleared.
[0067] The decal display period can be understood as the entire time range from when the decal is created to when it disappears. In this application, the decal display period can be, for example, the fade-out timer and fade-in timer of the decal.
[0068] A periodic condition can be understood as a predefined threshold or state used to determine whether a decal should be destroyed. In this application, the periodic condition can be, for example, a time condition, such as the decal's lifespan exceeding a preset fade-out timer. It can also be a state condition, such as the decal's transparency fading to an invisible state. This application does not limit the specific periodic condition.
[0069] In one specific embodiment provided in this application, the storage area corresponding to the decal to be processed is determined according to the baking tank index, and the display cycle data of the decal is read from it in order to determine whether to perform a recycling operation on the decal.
[0070] According to a specific embodiment provided in this application, after a decal generation event is detected in the initial frame, the target bone and at least one decal affecting the target bone are determined. This ensures that the bone pose on which the obtained baked-state mapping relationship is based is the pose corresponding to the moment the decal hits, avoiding the influence of bone poses at other times, thereby improving the accurate positioning of subsequent decals on the target bone. Furthermore, by determining the target bone and at least one corresponding decal based on the decal generation event, a mapping relationship between the target bone and the decal is established, clarifying the attribution relationship between the decal and the target bone, thus avoiding the slippage phenomenon of the decal on the target bone when the target bone shifts.
[0071] Furthermore, this application obtains the decal display period corresponding to the decal identifier to be processed from the baking index slot, so that when the decal display period is detected to meet the period condition, the decal is recycled and the decal in the index slot is cleared, thereby improving the application efficiency of the index slot.
[0072] In one specific embodiment provided in this application, after obtaining at least one baked state mapping relationship of the target bone in the initial frame, the real-time pose of the target bone is further obtained through real-time frames. That is, during the playback of the skeletal animation, the pose of the target bone is recorded in real time using real-time frames to obtain the real-time bone matrix corresponding to the target bone.
[0073] Step 104: In response to the target bone shifting in the current frame, obtain the current frame bone position information corresponding to the target bone, and based on the current frame bone position information and the mapping relationship of each baked state, redetermine the target position information between the target bone and each decal.
[0074] The current frame can be understood as any subsequent time point relative to the initial frame, rendered in real time.
[0075] Skeletal displacement can be understood as a change in the position, rotation, or scaling of a target bone relative to its state in the initial frame, driven by skeletal animation.
[0076] The current frame bone position information can be understood as the real-time transformation data of the target bone in the current frame.
[0077] Target location information can be understood as the specific location data in the current frame that represents the decal should be rendered.
[0078] In one specific embodiment provided in this application, when a target bone offset is detected in the current frame, in order to avoid slippage of the decals affecting the target bone, the current frame bone position information (i.e., the real-time bone matrix of the target bone in the current frame) is obtained. Based on the current frame bone position information and the mapping relationship of each baked state corresponding to the target bone, the belonging position of the decals affecting the target bone is re-determined, and the target position information between the target bone and each decal in the current frame is obtained.
[0079] The process of redetermining the target position information between the target bone and each decal, based on the current frame bone position information and the mapping relationships of each baked state, can be as follows: According to the baking matrix, the mesh vertices on the target bone currently affected by the decal are transformed from world space to the bone local space at the time of decal generation. Using a real-time matrix, the obtained bone local space is transformed to obtain the world space of the current frame. Since the actual mesh vertex is affected by the weighted influence of multiple bones, a weighted sum is performed on the obtained world space of the current frame corresponding to each bone to obtain the world space corresponding to that mesh vertex.
[0080] In one specific embodiment provided in this application, determining the target position information between the target bone and each decal based on the current frame bone position information and the mapping relationship of each baked state includes: Obtain the mesh vertices covered by the initial decal in the current frame, and determine the vertex position corresponding to each mesh vertex, wherein the initial decal is any one of the decals corresponding to the target bone; Based on the baking state mapping relationship, the initial frame bone position information between the initial decal and the target bone is determined; Based on the vertex positions corresponding to each grid vertex and the initial frame bone position information, the local position information of each grid vertex is determined; Based on the local position information of each mesh vertex and the bone position information of the current frame, the current vertex position of each mesh vertex in the current frame is obtained, and based on the current vertex position of each mesh vertex in the current frame, the target position information between the target bone and the initial decal is determined.
[0081] The initial decal can be understood as any one of the decals that affects the target skeleton and requires the calculation of target position information. It's important to understand that the initial decal is attached to the target skeleton, and each mesh vertex follows the target skeleton; therefore, each mesh vertex is covered by the initial decal.
[0082] Mesh vertices can be understood as the basic geometric elements that constitute the surface of a target object. It's important to understand that each vertex contains its position, normal, texture coordinates, bone index, and bone weights. In this application, the mesh vertices corresponding to each decal can be understood as the mesh vertices within the target object that are affected by the decal, and whose bound bones include the target bone to which the decal is attached. Furthermore, the mesh vertices affected by the decal can be determined based on the projection range of the decal.
[0083] Vertex position can be understood as the position of the mesh vertices in the target object.
[0084] The bone position information to be processed can be understood as the transformation matrix of the target bone in the initial frame, which is stored in the baking slot and corresponds to the decal.
[0085] Local position can be understood as the position of the target bone relative to the local coordinate system in the initial frame.
[0086] In one specific embodiment provided in this application, any one of the decals associated with the target bone is selected from the graphics rendering pipeline as the initial decal. The mesh vertices affected by the initial decal that need to be processed are determined, and the vertex positions corresponding to each mesh vertex are read. Based on the baked state mapping relationship containing decal identifiers to baked slot storage locations, the bone matrix data of the target bone is read. At this time, based on the vertex positions corresponding to each mesh vertex and the position information of the bone to be processed, the local position information of the mesh vertices corresponding to the initial decal affecting the target bone is obtained. This local position information is the fixed local coordinates relative to the target bone at the decal generation time (initial frame). Based on the current frame bone position information and the local position information of each mesh vertex, the current vertex positions of all vertices affected by the initial decal in the current frame are transformed. The current vertex positions corresponding to each mesh vertex collectively constitute the target position information between the target bone and the initial decal.
[0087] According to a specific embodiment provided in this application, calculation is performed at the decal level. By determining the initial decal and the corresponding vertex of the initial decal, and reading the baking data corresponding to the decal, the local position of the decal is calculated. Then, the final position is obtained by combining the real-time current frame bone position information, thus avoiding the initial slippage phenomenon of the decal.
[0088] Step 106: Based on the target position information between the target bone and each decal, render each decal to the current frame bone position corresponding to the target bone.
[0089] In one specific embodiment provided in this application, based on the target position information between the target bone and each decal, each decal is rendered to the current frame bone position corresponding to the target bone, including: Obtain the decal identifier corresponding to each decal; Based on each decal identifier, obtain the projection parameters and dynamic status parameters corresponding to each decal; Based on the projection parameters, dynamic state parameters, and target position information of each decal, each decal is rendered to the current frame bone position corresponding to the target bone.
[0090] The projection parameters can be understood as including at least the projection view matrix of the decal and the world space projection direction. Specifically, the projection view matrix and world space projection direction of the decal are detailed in step S1024 of this application. This application will not elaborate further on these details.
[0091] Dynamic state parameters can be understood as the state of the decal as it changes over time. Examples include the decal's fade-in timer, fade-out timer, current transparency, and color blending factor.
[0092] In one example, the world coordinates of the current pixel are transformed to the decal projection space using the projection view matrix in the projection parameters to obtain the UV coordinates. The calculated UV coordinates are then checked to see if they fall within the range [0, 1]. If not, the pixel is outside the decal coverage area and its color should be discarded. Optionally, the angle between the world space projection direction and the pixel's normal direction in the projection parameters is calculated to determine whether the decal should be displayed (e.g., only on the front). For pixels within this range, the UV coordinates are sampled from the decal texture to obtain the original decal color. The final blending factor is calculated using fade-in / fade-out timing, current transparency, etc., in the dynamic state parameters. The decal color is then blended with the model's original color using this factor to obtain the final pixel color.
[0093] According to the data processing method described above in this application, by detecting the presence of a hit target bone in the target object in the initial frame when a decal generation event occurs, subsequent decal processing is performed on a bone-by-bone basis, avoiding interference from irrelevant bones and saving computational resources. Furthermore, at least one decal affecting the target bone is acquired, and the initial frame bone position information between each decal and the target bone is determined. This provides a basis for recalculating the position information between the decal and the target bone when the target bone shifts. Further, based on the bone position information between each decal and the target bone in the initial frame, the baked-state mapping relationship between each decal and the target bone in the initial frame is obtained. Based on this, the current bone position information of the bone and the decal is determined, and combined with the baked-state mapping relationship between the bone and the decal, the target position information of the bone and the decal in the current frame is obtained. Therefore, in this application, by determining the baked-state mapping relationship between the bones affected by the decal and each decal on a bone-by-bone basis, computational overhead is reduced, thereby avoiding the calculation of a large amount of irrelevant bone data when calculating the target position relationship between the bone and the decal in the current frame, thus improving decal rendering efficiency.
[0094] For ease of understanding, this application explains the data processing methods mentioned above in the following manner.
[0095] In one specific implementation provided in this application, an architecture that constructs a global manager (MultiDecalManager) and combines it with a unified GPU data bus decouples the decal lifecycle from rendering. The CPU performs lightweight resource allocation, capacity expansion scheduling, and data synchronization, while the GPU is responsible for storage and parallel computing.
[0096] In one specific embodiment provided in this application, the global manager, which exists in singleton mode in the global control center on the CPU side, does not handle rendering. It is used to maintain the mirror relationship between NativeArray and ComputeBuffer, trigger dynamic expansion and contraction of video memory according to the number of decals, and synchronize physical data to the GPU every frame.
[0097] NativeArray can be understood as a contiguous memory data allocated in unmanaged memory.
[0098] ComputeBuffer can be understood as a data buffer used for GPU computing, serving as a bridge for data transfer between the CPU and GPU.
[0099] For example, on the CPU side, a NativeArray is used to store and manage decal data. Data for each frame in the NativeArray is synchronized to the ComputeBuffer via SetData. Then, on the GPU side, the shader reads the data directly from the ComputeBuffer for rendering.
[0100] Furthermore, in the above process, since decentralized management of decal resources can easily lead to memory fragmentation, using a singleton pattern for the global manager on the CPU side allows for unified maintenance of the NativeArray and ComputeBuffer for all decals. Additionally, multiple managers can lead to resource reallocation; using a singleton ensures the uniqueness of the resource pool by providing a globally unique instance. Moreover, since memory expansion / shrinkage requires coordination, a single scheduling center can handle this centrally.
[0101] Furthermore, the global manager, which exists in singleton mode, provides a single management entry point for all decal data, avoiding data conflicts between multiple managers and ensuring synchronization between CPU and GPU data.
[0102] In one specific embodiment provided in this application, a unified data bus is implemented on the GPU side. Specifically, five parallel data pipelines are used to store the context data required for decal rendering.
[0103] For ease of understanding, this application assumes that a target object has been identified based on the decal generation event, and a preset number of decals has been determined. The target object is composed of multiple skeletons. The skeletons within the target object are divided according to their regional structures, resulting in multiple skeleton subsets corresponding to different regional structures. These regional structures include head structures, torso structures, left arm structures, right arm structures, etc. Therefore, the skeleton subsets include a head skeleton subset, a torso skeleton subset, a left arm skeleton subset, and a right arm skeleton subset.
[0104] A decal is configured for each root bone in the target object that is affected by the decal, wherein the number of decals attached to a single bone at any given time is limited by the number of baking slots for that bone. Based on this, the interpretation of the five parallel data pipelines includes: Decal Bone Matrix Buffer: Used to store real-time bone matrix snapshots (hereinafter referred to as real-time bone matrix snapshots, Slot 0) for each bone affected by a decal and initial frame bone matrix snapshots (hereinafter referred to as baked bone matrix snapshots, Slots 1~N) for each decal. For example, bone 1 contains the real-time matrix corresponding to bone 1 (Slot 0) and baked matrix snapshots for each decal (Slots 1~N). Bone 2 contains the real-time matrix corresponding to bone 2 (Slot 0) and baked matrix snapshots for each decal (Slots 1~N), and so on. The baked matrix snapshot can be understood as a 4-dimensional matrix that records the position, rotation, and scaling of the bone at the moment of impact.
[0105] Decal Dynamic Data Buffer: Used to store the dynamic state (i.e., lifecycle) of each decal: fade-in time, fade-out time, and logical ID.
[0106] Topology Index Bus (Bone Index Data Buffer): Used to store the bone index remapping table, mapping the original bone index of the mesh to the compressed local buffer offset.
[0107] Projection Space Bus (UV Plane Data Buffer): Used to store the projection space parameters (world space projection direction, view matrix) of each decal, and is used to calculate UVs.
[0108] Per Decal Target Data Buffer: Used to store the metadata of each decal, such as the starting offset of the skeleton matrix, the starting offset of the skeleton index, and the baking slot index.
[0109] In one specific embodiment provided in this application, when a decal generation event is detected, at the instant of each decal projection, the pose snapshot of the target bone is baked and stored in the GPU (i.e., at least one baked state mapping relationship is obtained in the initial frame as mentioned above in this application). Using the baked state bone matrix snapshot as a reference, in the subsequent rendering process, the decal is fixed on the bone topology corresponding to the instant of decal projection and changes with the offset of the bone.
[0110] Specifically, in the bone matrix bus, matrix slots are allocated to bones affected by decals. The number of matrix slots is pre-defined, including at least one baked slot (Slot 1~N) and one real-time slot (Slot 0). The real-time slot (Slot 0) stores a snapshot of the real-time frame bone matrix obtained from the inverse transformation matrix of the current frame (i.e., the bone position information of the current frame), which is updated with each frame update and used to transform vertices into bone space. The baked slot (Slot 1~N) stores a snapshot of the bone world matrix at the moment of decal generation (i.e., a baked-state bone matrix snapshot), which remains read-only and unchanged throughout the decal's lifecycle.
[0111] Based on this, raycasting is used to detect hits on the skinned mesh of the target object, determining the hit point and normal of the decal projection. The decal's projection matrix is calculated based on its projection parameters, and the projection range of the decal on the target object's surface is determined. The bone transformation data corresponding to the hit position in that frame is read and converted into a matrix array. During this process, bones unaffected by the decal are discarded to avoid wasting resources on calculating irrelevant bones.
[0112] Furthermore, the matrix data is stored in the baked slots of the bone matrix bus, generating a baked matrix snapshot, which is saved until the decal disappears. At this point, real-time bone position information is stored in the real-time slot, obtaining a real-time frame bone matrix snapshot. A unique decal identifier is assigned to each decal affecting the bone. When a target bone offset is detected in the current frame, during rendering, the baked bone matrix snapshot corresponding to the target bone is read, and the real-time frame bone matrix snapshot is read synchronously. Through relative transformation, the current vertex positions of the mesh vertices corresponding to each decal affecting the target bone are obtained, thus achieving synchronous deformation of the decal following the skinned mesh.
[0113] In this process, the decal is attached to the skeletal topology of the initial frame corresponding to the decal generation event by calculation, so that no matter any subsequent offset of the bones, the decal can remain relatively stationary with the skinned mesh corresponding to the target bone, thereby eliminating the decal slippage phenomenon.
[0114] During the above process, when a decal affecting the target skeleton fades out or disappears, the decal identifier and other information it occupied will be recycled to the ID pool. When a new decal is generated, the idle ID is retrieved from the ID pool first, realizing the reuse of video memory addresses and avoiding runtime memory allocation. In addition, the CPU maintains a NativeArray as a shadow mirror of the GPU Buffer. When the number of active decals exceeds a threshold, a larger NativeArray is automatically created. The old data is efficiently moved using NativeArray.Copy, and then a matching new ComputeBuffer is created and the data is uploaded at once. The scaling is completed within a single frame, with no screen flicker and no decal loss.
[0115] To facilitate understanding, the dynamic decal generation process is illustrated in the following examples.
[0116] In this process, it is assumed that the target object is composed of multiple skeletons (e.g., 40 bones). The bones in the target object are divided according to their regional structures, resulting in multiple bone subsets corresponding to different regional structures. These regional structures include the head structure (e.g., 8 bones, corresponding to a bone index range of 0-7), the torso structure (e.g., 12 bones, corresponding to a bone index range of 8-19), the left arm structure (e.g., 10 bones, corresponding to a bone index range of 20-29), and the right arm structure (e.g., 10 bones, corresponding to a bone index range of 30-39), etc. Therefore, the bone subsets include the head bone subset, the torso bone subset, the left arm bone subset, and the right arm bone subset.
[0117] Based on the above, the hit point location information on the target object is detected (e.g., world coordinates (125.3, 45.8, 78.2)), and the bone affected by this hit point is the third bone in the right arm structure (e.g., the bone index is 32). The predicted number of decals corresponding to this bone is 3 (e.g., one bullet hole decal and two burn mark decals). At this point, the global manager (MultiDecalManager) is invoked.
[0118] In the global manager, check if there are any free slots in the video memory resource pool. If there are free slots, assign a decal ID to each decal to be applied (e.g., ID: 1024, ID: 1025, ID: 1026). Then, query the subset of bones to which the matched bone belongs (e.g., the right arm structure RightArmSubset (index 30-39)). Based on the obtained bone subset, determine that the bone region that needs to be baked is the 10 bones corresponding to the right arm structure. This avoids rendering all 40 bones globally, reducing computational resources.
[0119] Furthermore, a mapping table is constructed based on the CPU's NativeArray to the original bone index and the offset index within the subset. For example, when the original bone index is 30, the offset index within the subset is determined to be 0; when the original bone index is 31, the offset index within the subset is determined to be 1; when the original bone index is 32, the offset index within the subset is determined to be 2, and so on, until the original bone index is 39, where the offset index within the subset is determined to be 9. In this case, by transmitting only the bone subset data corresponding to the right arm structure, it is unnecessary to transmit all 40 bones globally, thereby reducing bandwidth consumption during data transmission.
[0120] For each decal, the corresponding bone pose is determined in the bone matrix snapshot. For example, Slot0 stores the current frame bone position information for each bone in each frame, while Slot1 stores the initial frame bone position information for each bone corresponding to the right arm structure.
[0121] For each frame of skeletal data, five parallel data pipelines are used to transmit data between the CPU and GPU.
[0122] During the decal rendering process, the current frame's bone position information, the initial frame's bone position information, and the offset index within a subset are obtained. Based on the offset index within the subset, the initial frame's bone position information is determined, and the decal vertices are modified to obtain the decal rendered on the right arm's bone structure. This allows the decal to be attached to the right arm structure, and when the right arm structure shifts, the decal moves synchronously with the bone's shift. Furthermore, to enhance the decal's realism, a fade-in / fade-out effect on the bone is achieved through the decal's corresponding decal cycle.
[0123] It should be noted that the data processing methods provided in this manual can be applied to various industries or scenarios, such as virtual reality processing software, home entertainment product software, digital cultural product production software, digital cultural and creative software, digital cultural and creative design, education, news, cultural content industry software, digital publishing software, digital music development and production, and digital mobile multimedia development and production. In some cases, they can also be applied to fields such as animation and game production engine software and development systems, game and animation software, animation and game digital content services, digital film and television development and production, and digital performance development and production.
[0124] Corresponding to the above method embodiments, this application also provides data processing apparatus embodiments. Figure 2 A schematic diagram of the structure of a data processing apparatus according to an embodiment of this application is shown. Figure 2 As shown, the device includes: The acquisition unit 202 is configured to acquire at least one baked state mapping relationship of the target bone in the target object in the initial frame, wherein each baked state mapping relationship is determined based on the initial frame bone position information between each decal and the target bone in the initial frame.
[0125] The determining unit 204 is configured to, in response to the target bone shifting in the current frame, acquire the current frame bone position information corresponding to the target bone, and determine the target position information between the target bone and each decal based on the current frame bone position information and the mapping relationship of each baked state.
[0126] The rendering unit 206 is configured to render each decal to the current frame bone position corresponding to the target bone based on the target position information between the target bone and each decal.
[0127] Furthermore, the acquisition unit 202 is further configured as follows: In response to detecting a decal generation event in the initial frame, the target bone corresponding to the decal generation event and at least one decal are determined; Obtain the target bone's position information in the initial frame and obtain the initial decal attribute information corresponding to each decal; Based on the position information of the bone to be processed in the initial frame and the initial decal attribute information corresponding to each decal, at least one baked state mapping relationship of the target bone in the initial frame is determined.
[0128] Furthermore, the acquisition unit 202 is further configured as follows: Determine the initial decal attribute information corresponding to the decal to be processed, wherein the decal to be processed is any one of the decals; Based on the position information of the bone to be processed and the initial sticker attribute information corresponding to the sticker to be processed, the initial frame bone matrix snapshot of the sticker to be processed and the target bone is calculated. Based on the initial frame skeleton matrix snapshot corresponding to the decal to be processed, the baking state mapping relationship of the target skeleton in the initial frame is determined.
[0129] Furthermore, the acquisition unit 202 is further configured as follows: Obtain the decal identifier corresponding to the decal to be processed; Based on the decal identifier to be processed, the baking slot index corresponding to the decal identifier to be processed is determined in the preset baking slot corresponding to the target bone; Based on the baking slot index, the initial frame skeleton matrix snapshot corresponding to the decal to be processed is stored to obtain the baking state mapping relationship.
[0130] Furthermore, the acquisition unit 202 is also configured as follows: Obtain the decal display period of the decal corresponding to the decal identifier to be processed from the baking tank index; If the decal display cycle meets the cycle condition, a recycling mark is configured for the decal identifier to be processed; Based on the recycling marker, the decal to be processed is recycled, and the initial frame bone position information corresponding to the decal to be processed is cleared.
[0131] Furthermore, the acquisition unit 202 is further configured as follows: In the decal generation event, the decal size corresponding to each decal is determined, and the hit point position information and normal direction corresponding to the hit point are detected, wherein the hit point is determined based on the target bone hit by the decal generation event; Based on the decal size, hit point position information and normal direction of each decal, determine the projection view matrix and world space projection direction of each decal. Based on the projection view matrix corresponding to each decal and the world space projection direction, the initial decal attribute information corresponding to each decal is obtained.
[0132] Furthermore, unit 204 is also configured as follows: Obtain the mesh vertices covered by the initial decal in the current frame, and determine the vertex position corresponding to each mesh vertex, wherein the initial decal is any one of the decals corresponding to the target bone; Based on the baking state mapping relationship, the initial frame bone position information between the initial decal and the target bone is determined; Based on the vertex positions corresponding to each grid vertex and the initial frame bone position information, the local position information of each grid vertex is determined; Based on the local position information of each mesh vertex and the bone position information of the current frame, the current vertex position of each mesh vertex in the current frame is obtained, and based on the current vertex position of each mesh vertex in the current frame, the target position information between the target bone and the initial decal is determined.
[0133] Furthermore, rendering unit 206 is further configured as follows: Obtain the decal identifier corresponding to each decal; Based on each decal identifier, obtain the projection parameters and dynamic status parameters corresponding to each decal; Based on the projection parameters, dynamic state parameters, and target position information of each decal, each decal is rendered to the current frame bone position corresponding to the target bone.
[0134] Furthermore, the acquisition unit 202 is also configured as follows: A pre-configured skeletal subset of the target object is provided, wherein the skeletal subset includes at least one bone corresponding to different regional structures of the target object; In response to detecting a decal generation event, the target area structure corresponding to the decal generation event is determined; The target skeleton is determined from the skeleton subset corresponding to the target region structure.
[0135] The above is an illustrative scheme of a data processing apparatus according to this embodiment. It should be noted that the technical solution of this data processing apparatus and the technical solution of the data processing method described above belong to the same concept. For details not described in detail in the technical solution of the data processing apparatus, please refer to the description of the technical solution of the data processing method described above.
[0136] Figure 3 A structural block diagram of a computing device according to an embodiment of this application is shown. The components of the computing device 300 include, but are not limited to, a memory 310 and a processor 320. The processor 320 is connected to the memory 310 via a bus 330, and a database 350 is used to store data.
[0137] The computing device 300 also includes an access device 340, which enables the computing device 300 to communicate via one or more networks 360. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), 5G communication networks, or combinations of communication networks such as the Internet. The access device 340 may include one or more of any type of wired or wireless network interface (e.g., a network interface controller (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.
[0138] In one embodiment of this application, the aforementioned components of the computing device 300 and Figure 3 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 3 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this application. Those skilled in the art can add or replace other components as needed.
[0139] Computing device 300 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones, in-vehicle computers, POS machines, game consoles, etc.), wearable computing devices (e.g., smartwatches, smart glasses, etc.), smart home appliances, multimedia playback devices, smart voice interaction devices, or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). Computing device 300 can also be a mobile or stationary server. A 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, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0140] The processor 320 is used to execute the following computer program / instructions, which, when executed by the processor, implement the steps of the above-described data processing method.
[0141] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the data processing method described above belong to the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the data processing method described above.
[0142] An embodiment of this specification also provides a computer-readable storage medium storing a computer program / instructions that, when executed by a processor, implement the steps of the above-described data processing method.
[0143] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the data processing method described above belong to the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the data processing method described above.
[0144] An embodiment of this specification also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the above-described data processing method.
[0145] The above is an illustrative scheme of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product and the technical solution of the data processing method described above belong to the same concept. For details not described in detail in the technical solution of the computer program product, please refer to the description of the technical solution of the data processing method described above.
[0146] The foregoing has described specific embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0147] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or certain intermediate forms. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added or removed according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.
[0148] One embodiment of this application also provides a chip that stores a computer program, which, when executed by the chip, implements the steps of the data processing method.
[0149] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0150] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0151] The preferred embodiments disclosed above are merely illustrative of this application. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this application. These embodiments are selected and specifically described in this application to better explain the principles and practical applications of this application, thereby enabling those skilled in the art to better understand and utilize this application. This application is limited only by the claims and their full scope and equivalents.
Claims
1. A data processing method, characterized in that, include: Obtain at least one baked state mapping relationship of the target bone in the target object in the initial frame, wherein each baked state mapping relationship is determined based on the initial frame bone position information between each sticker and the target bone in the initial frame; In response to the target bone shifting in the current frame, the current frame bone position information corresponding to the target bone is obtained, and the target position information between the target bone and each decal is determined based on the current frame bone position information and the mapping relationship of each baked state. Based on the target position information between the target bone and each decal, each decal is rendered to the current frame bone position corresponding to the target bone.
2. The method as described in claim 1, characterized in that, Obtain at least one baked-state mapping relationship of the target bone in the target object in the initial frame, including: In response to detecting a decal generation event in the initial frame, the target bone corresponding to the decal generation event and at least one decal are determined; Obtain the target bone's position information in the initial frame and obtain the initial decal attribute information corresponding to each decal; Based on the position information of the bone to be processed in the initial frame and the initial decal attribute information corresponding to each decal, at least one baked state mapping relationship of the target bone in the initial frame is determined.
3. The method as described in claim 2, characterized in that, Based on the position information of the bone to be processed in the initial frame and the initial decal attribute information corresponding to each decal, at least one baked state mapping relationship of the target bone in the initial frame is determined, including: Determine the initial decal attribute information corresponding to the decal to be processed, wherein the decal to be processed is any one of the decals; Based on the position information of the bone to be processed and the initial sticker attribute information corresponding to the sticker to be processed, the initial frame bone matrix snapshot of the sticker to be processed and the target bone is calculated. Based on the initial frame skeleton matrix snapshot corresponding to the decal to be processed, the baking state mapping relationship of the target skeleton in the initial frame is determined.
4. The method as described in claim 3, characterized in that, Based on the initial frame skeleton matrix snapshot corresponding to the decal to be processed, the baked state mapping relationship of the target bone in the initial frame is determined, including: Obtain the decal identifier corresponding to the decal to be processed; Based on the decal identifier to be processed, the baking slot index corresponding to the decal identifier to be processed is determined in the preset baking slot corresponding to the target bone; Based on the baking slot index, the initial frame skeleton matrix snapshot corresponding to the decal to be processed is stored to obtain the baking state mapping relationship.
5. The method as described in claim 4, characterized in that, Based on the decal identifier to be processed, after determining the baking slot index corresponding to the decal identifier in the preset baking slot corresponding to the target bone, the method further includes: Obtain the decal display period of the decal corresponding to the decal identifier to be processed from the baking tank index; If the decal display cycle meets the cycle condition, a recycling mark is configured for the decal identifier to be processed; Based on the recycling marker, the decal to be processed is recycled, and the initial frame bone position information corresponding to the decal to be processed identifier is cleared.
6. The method as described in claim 2, characterized in that, Retrieve the initial decal attribute information corresponding to each decal, including: In the decal generation event, the decal size corresponding to each decal is determined, and the hit point position information and normal direction corresponding to the hit point are detected, wherein the hit point is determined based on the target bone hit by the decal generation event; Based on the decal size, hit point position information and normal direction of each decal, determine the projection view matrix and world space projection direction of each decal. Based on the projection view matrix corresponding to each decal and the world space projection direction, the initial decal attribute information corresponding to each decal is obtained.
7. The method as described in claim 1, characterized in that, Based on the current frame bone position information and the mapping relationship of each baked state, the target position information between the target bone and each decal is determined, including: Obtain the mesh vertices covered by the initial decal in the current frame, and determine the vertex position corresponding to each mesh vertex, wherein the initial decal is any one of the decals corresponding to the target bone; Based on the baking state mapping relationship, the initial frame bone position information between the initial decal and the target bone is determined; Based on the vertex positions corresponding to each grid vertex and the initial frame bone position information, the local position information of each grid vertex is determined; Based on the local position information of each mesh vertex and the bone position information of the current frame, the current vertex position of each mesh vertex in the current frame is obtained, and based on the current vertex position of each mesh vertex in the current frame, the target position information between the target bone and the initial decal is determined.
8. The method as described in claim 1, characterized in that, Based on the target position information between the target bone and each decal, each decal is rendered to the current frame bone position corresponding to the target bone, including: Obtain the decal identifier corresponding to each decal; Based on each decal identifier, obtain the projection parameters and dynamic status parameters corresponding to each decal; Based on the projection parameters, dynamic state parameters, and target position information of each decal, each decal is rendered to the current frame bone position corresponding to the target bone.
9. The method as described in claim 1, characterized in that, The method further includes: A pre-configured skeletal subset of the target object is provided, wherein the skeletal subset includes at least one bone corresponding to different regional structures of the target object; In response to detecting a decal generation event, the target area structure corresponding to the decal generation event is determined; The target skeleton is determined from the skeleton subset corresponding to the target region structure.
10. A data processing apparatus, characterized in that, include: The acquisition unit is configured to acquire at least one baked state mapping relationship of the target bone in the target object in the initial frame, wherein each baked state mapping relationship is determined based on the initial frame bone position information between each decal and the target bone in the initial frame; The determining unit is configured to, in response to the target bone shifting in the current frame, acquire the current frame bone position information corresponding to the target bone, and determine the target position information between the target bone and each decal based on the current frame bone position information and the mapping relationship of each baked state; The rendering unit is configured to render each decal to the current frame bone position corresponding to the target bone based on the target position information between the target bone and each decal.
11. A computing device, characterized in that, include: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions, which, when executed by the processor, implement the steps of the method according to any one of claims 1 to 9.
12. A computer-readable storage medium storing a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 9.
13. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 9.