Virtual Imprint Generation Method and Apparatus

By pre-storing the collision deformation parameters of load-bearing objects in a virtual scene, virtual imprints can be directly generated, solving the problems of high computational load and high resource consumption in existing technologies, and realizing fast and highly realistic virtual imprint generation.

CN116360579BActive Publication Date: 2026-11-17SHANGHAI MIHA YOUHAIYUANCHENG TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111627024.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-28
Publication Date
2026-11-17
Estimated Expiration
2041-12-28

AI Technical Summary

Technical Problem

Existing methods for generating virtual imprints involve large computational demands, high resource consumption, and slow generation speed.

Method used

In the virtual scene, the collision deformation parameters of the load-bearing object are pre-stored in its associated collider. When a collision event is detected, these parameters are directly obtained to generate a virtual imprint, avoiding complex physical simulation calculations.

Benefits of technology

It enables the rapid generation of virtual imprints with minimal resource consumption, improving generation speed and enhancing realism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116360579B_ABST
    Figure CN116360579B_ABST
Patent Text Reader

Abstract

This invention relates to the field of electronic information, specifically disclosing a method and apparatus for generating virtual imprints to solve the problems of slow generation speed and high resource consumption. The method includes: when at least one first collider is detected to be activated by a second collider, acquiring the collision deformation parameters stored in each of the at least one first collider, wherein the first collider is associated with a load-bearing object, and the second collider is associated with an action object; determining the corresponding virtual imprint based on the acquired collision deformation parameters, wherein the virtual imprint is used to be loaded onto the model surface of the load-bearing object at the position corresponding to the action object. This method stores the collision deformation parameters of the load-bearing object in the first colliders, and when a collision occurs, directly acquires the collision deformation parameters stored in the first colliders of the load-bearing object to determine the virtual imprint, thereby achieving rapid virtual imprint generation with minimal resource consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electronic information, specifically to a method and apparatus for generating virtual imprints. Background Technology

[0002] With the increasing development of virtual reality technology, virtual scenes can simulate the physical effects of interactions between different objects in the real world. For example, some load-bearing objects in virtual scenes can respond to collision actions triggered by action objects in the virtual scene, thus displaying a state corresponding to the collision action on their own model surface. For instance, in a virtual scene, if a user-controlled character walks on a ground-type load-bearing object, the walking action is a collision action triggered by the ground-type load-bearing object, and the ground-type load-bearing object will display a virtual mark on the ground corresponding to the collision action, such as a character walking on snow, generating a footprint-like virtual mark in the snow.

[0003] In the process of realizing this invention, the inventors discovered that the existing virtual imprint generation methods have at least the following drawbacks: generating virtual imprints of action objects using real physical calculations involves a large amount of computation and high resource consumption, and correspondingly, the speed of generating virtual imprints is slow. Summary of the Invention

[0004] In view of the above problems, the present invention is proposed to provide a virtual imprint generation method and apparatus that overcomes or at least partially solves the above problems.

[0005] According to one aspect of the present invention, a method for generating a virtual imprint is provided, the method comprising:

[0006] When at least one first collider is detected to be activated by a second collider, the collision deformation parameters stored in each of the at least one first collider are obtained, wherein the first collider is the collider associated with the load-bearing object and the second collider is the collider associated with the action object.

[0007] The corresponding virtual imprint is determined based on the obtained collision deformation parameters, wherein the virtual imprint is used to be loaded onto the model surface of the load-bearing object at the position corresponding to the action object.

[0008] In some examples, before obtaining the collision deformation parameters stored in each of the at least one first collider when at least one first collider is detected to be activated by a second collider, the method includes:

[0009] For a given first collider, obtain at least one material of the load-bearing object corresponding to the first collider, and determine the sub-collision deformation parameters corresponding to each of the at least one material.

[0010] The collision deformation parameters are determined based on the sub-collision deformation parameters corresponding to each material, and the collision deformation parameters are stored in the first collider.

[0011] In some examples, the at least one material is multiple materials; determining the collision deformation parameter based on the sub-collision deformation parameter corresponding to each material includes:

[0012] The collision deformation parameters are calculated by weighting the sub-collision deformation parameters corresponding to different categories of materials among the various materials, and the collision deformation parameters are determined based on the weighted calculation results.

[0013] In some examples, determining the corresponding virtual imprint based on the obtained collision deformation parameters includes:

[0014] Determine the parameter range to which the obtained collision deformation parameters belong;

[0015] Search the virtual imprint material library for the virtual imprint that corresponds to the parameter range.

[0016] In some examples, the at least one first collider is a plurality of first colliders; determining the corresponding virtual imprint based on the acquired collision deformation parameters includes:

[0017] Based on the collision deformation parameters stored in each of the plurality of first colliders, an imprint depth value corresponding to each first collider is generated.

[0018] Virtual imprints are generated based on the imprint depth values ​​corresponding to each first collider.

[0019] In some examples, generating virtual imprints based on the imprint depth values ​​corresponding to each first collider includes:

[0020] The average value of the imprint depth is calculated based on the imprint depth value corresponding to each first collider, and the virtual imprint is generated based on the average value.

[0021] In some examples, generating virtual imprints based on the imprint depth values ​​corresponding to each first collider includes:

[0022] Based on the imprint depth value corresponding to each first collider, a corresponding virtual imprint is generated in the area where the load-bearing object corresponding to each first collider is located.

[0023] According to another aspect of the present invention, a virtual imprint generation apparatus is provided, the apparatus comprising:

[0024] The acquisition module is adapted to acquire the collision deformation parameters stored in each of the at least one first colliders when it is detected that at least one first collider is activated by a second collider, wherein the first collider is a collider associated with a load-bearing object and the second collider is a collider associated with an action object.

[0025] The determining module is adapted to determine the corresponding virtual imprint based on the obtained collision deformation parameters, wherein the virtual imprint is used to be loaded onto the model surface of the load-bearing object at the position corresponding to the action object.

[0026] According to another aspect of the present invention, an electronic device is provided, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus;

[0027] The memory is used to store at least one executable instruction that causes the processor to perform the method described above.

[0028] According to another aspect of the present invention, a computer storage medium is provided, the storage medium storing at least one executable instruction that causes a processor to perform the method described above.

[0029] In the virtual imprint generation method and apparatus provided by this invention, when at least one first collider is detected to be activated by a second collider, the collision deformation parameters stored in each of the at least one first collider are obtained, and the corresponding virtual imprint is determined based on the obtained collision deformation parameters. In this invention, since the collision deformation parameters corresponding to the load-bearing object are stored in the first collider associated with the load-bearing object, when the action object triggers a collision action against the load-bearing object, that is, when the first collider associated with the load-bearing object is activated by the second collider associated with the action object, the collision deformation parameters corresponding to the load-bearing object stored in the first collider can be directly obtained to determine the virtual imprint, without having to perform complex physical simulation calculations on the load-bearing object and then generate the virtual imprint based on the results of the physical simulation calculations. Thus, rapid virtual imprint generation is achieved with minimal resource consumption.

[0030] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0031] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0032] Figure 1 The flowchart of a virtual imprint generation method provided in Embodiment 1 of the present invention is shown;

[0033] Figure 2 A flowchart of a virtual imprint generation method provided in Embodiment 2 of the present invention is shown;

[0034] Figure 3 A flowchart illustrating a virtual imprint generation method provided by an example of the present invention is shown;

[0035] Figure 4 This diagram illustrates the structure of a virtual imprint generation device according to Embodiment 3 of the present invention.

[0036] Figure 5 A schematic diagram of the structure of an electronic device provided in Embodiment 5 of the present invention is shown. Detailed Implementation

[0037] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0038] Example 1

[0039] Figure 1 A flowchart of a virtual imprint generation method provided in Embodiment 1 of the present invention is shown. Figure 1 As shown, the method includes:

[0040] Step S110: When at least one first collider is detected to be activated by a second collider, obtain the collision deformation parameters stored in each of the at least one first collider.

[0041] The method provided in this embodiment is applied in a virtual scene, which includes various scenes presented by electronic screens, such as game scenes, virtual reality scenes, and human-computer interaction scenes. Accordingly, the virtual scene contains multiple virtual objects, such as surface objects, character objects, plant objects, building objects, and item objects. Some objects can collide with each other. Collision actions include walking, hitting, and slashing actions. Correspondingly, collision events that trigger collision actions can include: a character object walking on a surface object, a character object slashing at a plant object, and a character object hitting an item object. To detect whether collision actions occur between different objects, a collider is introduced into the virtual scene. Each object in the virtual scene is associated with a collider. The collider is used for collision detection and describes the boundaries where objects can be collided with. In specific implementation, any action that activates the collider associated with an object can be defined as a collision action. This invention does not limit the specific meaning of a collision action. There are various types of colliders, such as Mesh Collider, Box Collider, Sphere Collider, Capsule Collider, Wheel Collider, and combinations thereof. Depending on the object type, each object can be associated with a corresponding collider type. For example, a Mesh Model can be associated with a Mesh Collider, and a Mesh Model can be a ground object, a building object, etc.; a Box Model can be associated with a Box Collider, and a Box Model can be a block-shaped object, etc.; a Wheel Object can be associated with a Wheel Collider, and so on. There are no restrictions on this.

[0042] Based on the above description, in a virtual scene, for two objects that trigger a collision action, the object that actively triggers the collision action is defined as the action object, and the object that passively responds to the collision action is defined as the load-bearing object. In some cases, both objects that trigger the collision action can be action objects and load-bearing objects for each other. Accordingly, the collider associated with the load-bearing object is defined as the first collider, and the collider associated with the action object is defined as the second collider. When the action object triggers a collision action against the load-bearing object, the first collider is activated by the second collider. To simulate the visual effects of collisions, if an action object triggers a collision action against a load-bearing object, a virtual imprint is loaded onto the surface of the load-bearing object's model at the location corresponding to the collision action. This virtual imprint displays the visual deformation (e.g., indentation, bending) of the load-bearing object's surface caused by the collision. The visual deformation effect varies depending on the material of the load-bearing object. The load-bearing object's model represents its visual characteristics, such as color, shape, and material. Therefore, different load-bearing objects correspond to different collision deformation parameters. When an action object triggers a collision action against a load-bearing object, a virtual imprint displaying the collision deformation is generated based on the corresponding collision deformation parameters. The collision deformation parameters describe the degree to which the load-bearing object's model surface is prone to collision deformation when the action object triggers a collision action; for example, the hardness of the load-bearing object's material.

[0043] In this embodiment, the collision deformation parameters corresponding to each load-bearing object in the virtual scene can be pre-stored in the first collider associated with each load-bearing object. Thus, when at least one first collider is detected to be activated by a second collider, in other words, when an action object is detected to trigger a collision action against at least one load-bearing object, the collision deformation parameters of the associated load-bearing object stored in the at least one activated first collider can be directly obtained.

[0044] In this embodiment, the collision deformation parameters corresponding to each load-bearing object in the virtual scene are stored in the first collider associated with each load-bearing object. This is equivalent to adding a numerical attribute to the first collider, which can be represented by a floating-point parameter (float). The collision deformation parameters are defined through this numerical attribute. Accordingly, when the second collider associated with the action object activates the first collider associated with the load-bearing object, the first collider associated with the load-bearing object outputs the stored float value (i.e., the collision deformation parameter) to generate the virtual imprint. The collision deformation parameters can be stored in the first collider using the following code snippet:

[0045] public float softness — Defines a floating-point parameter softness, which represents the degree of softness, and the value of softness ranges from 0.0 to 255.0;

[0046]

[0047] public void addPropertySoft(Collider objCollider, floatsoft) — Defines and sets the value of the numeric property soft, which represents the collision deformation parameter, in the first collider.

[0048]

[0049]

[0050] addPropertySoft(meshCollider, 25.0); — This method sets the value of 'soft' to the collider.

[0051] As can be seen from the above code segment, in this embodiment, a floating-point parameter softness is defined, which represents the softness of the load-bearing object. The value range of softness is 0-255, which means that the load-bearing object will only undergo collision deformation when its softness is within this range. If the hardness is too high, no collision deformation will occur. It should be noted that the value range of softness can be adjusted according to actual needs. Here, it is only an exemplary value range. Correspondingly, during program execution, the value of the floating-point parameter softness is obtained. If the value of softness is greater than 255 or less than 0, it indicates that the floating-point parameter softness is empty. Further, when the floating-point parameter softness is not empty, the step of adding a floating-point numerical attribute soft to the property list of the first collider (i.e., Collider.propertyList in the code segment) and setting the value of soft is executed. Here, the parameter soft is the collision deformation parameter. In specific implementation, step S110 is to obtain the value of soft (i.e., the collision deformation parameter) stored in each of the at least one first collider when it is detected that at least one first collider is activated by the second collider. The virtual imprint can then be generated based on the value of soft.

[0052] Step S120: Determine the corresponding virtual imprint based on the obtained collision deformation parameters, wherein the virtual imprint is used to load the model surface of the load-bearing object at the position corresponding to the action object.

[0053] Specifically, when at least one first collider is detected to be activated by a second collider, the collision deformation parameters of the load-bearing object associated with each of the activated first colliders are obtained. Based on these parameters, the visual effect of the collision deformation on the model surface of the load-bearing object is determined. Furthermore, a virtual imprint displaying the collision deformation is generated and loaded onto the model surface of the load-bearing object at the position corresponding to the collision action triggered by the action object. Specifically, the virtual imprint can take the form of an imprint map. The graphic of the imprint map can be used to represent the imprint depth and / or imprint range. When the collision deformation parameters represent a change from low to high deformation, the imprint depth of the generated imprint map changes from shallow to deep, and / or the imprint range changes from small to large.

[0054] In this embodiment, since the collision deformation parameters corresponding to the load-bearing object are stored in the first collider associated with the load-bearing object, when the action object triggers a collision action against the load-bearing object, that is, when the first collider associated with the load-bearing object is activated by the second collider associated with the action object, the collision deformation parameters corresponding to the load-bearing object stored in the first collider can be directly obtained to determine the virtual imprint that displays the collision deformation effect, without having to perform complex physical simulation calculations on the load-bearing object and then generate the virtual imprint based on the results of the physical simulation calculations. This achieves rapid virtual imprint generation with minimal resource consumption. Furthermore, in the virtual scene, for different load-bearing objects, the corresponding collision deformation parameters can be stored in the first collider associated with the load-bearing object. Therefore, when the first collider of different load-bearing objects is activated, different virtual imprints will be generated, thereby achieving a highly realistic simulation of collision deformation.

[0055] Example 2

[0056] Figure 2 A flowchart of a virtual imprint generation method provided in Embodiment 2 of the present invention is shown. Figure 2 As shown, the method includes:

[0057] Step S210: For a first collider, obtain at least one material of the load-bearing object corresponding to the first collider, and determine the sub-collision deformation parameters corresponding to each of the at least one material.

[0058] In the process of realizing this invention, the inventors discovered that in traditional virtual imprint generation methods, for load-bearing objects of different materials (including single materials and composite materials), corresponding physical simulation calculations are performed for different materials, and virtual imprints are generated based on the calculation results, which consumes a lot of resources and has a slow generation speed; or the different materials of the load-bearing objects are ignored, and fixed collision deformation parameters are used to generate virtual imprints, so the collision deformation of load-bearing objects of different materials is the same in response to the trigger action, resulting in poor realism.

[0059] To address the aforementioned issues, in this embodiment, each load-bearing object may include one or more materials. A load-bearing object containing only one material is defined as a single-material load-bearing object, and a load-bearing object containing multiple materials is defined as a composite-material load-bearing object. For each material, a sub-collision deformation parameter is predefined. The sub-collision deformation parameter describes the degree of collision deformation that the surface of the load-bearing object's model is prone to when a collision action is triggered on a load-bearing object containing only the material corresponding to the sub-collision deformation parameter, such as the softness of the material. The collision deformation parameters of the load-bearing object can be pre-determined based on the sub-collision deformation parameters of at least one material contained in each load-bearing object, and the determined collision deformation parameters are stored in the first collider associated with the load-bearing object.

[0060] Specifically, for each load-bearing object, if the load-bearing object is a single-material load-bearing object, the sub-collision coefficient of that material is obtained, and the collision deformation parameter corresponding to the load-bearing object is the sub-collision deformation parameter of that material. If the load-bearing object is a composite material load-bearing object, the sub-collision deformation parameter corresponding to each material in the composite material is obtained respectively.

[0061] Step S220: Determine the collision deformation parameters according to the sub-collision deformation parameters corresponding to each material, and store the collision deformation parameters in the first collider.

[0062] For each load-bearing object, after obtaining at least one material contained in the load-bearing object, the collision deformation parameters of the load-bearing object are determined according to the sub-collision deformation parameters of at least one material, and the determined collision deformation parameters are stored in the first collider associated with the load-bearing object. If the first collider associated with the load-bearing object is activated later, the collision deformation parameters corresponding to the load-bearing object stored in the first collider are directly obtained to generate a virtual imprint.

[0063] When the load-bearing object is a composite material load-bearing object, in other words, when the load-bearing object includes multiple materials, the collision deformation parameters of the load-bearing object can be determined in various ways based on the sub-collision deformation parameters of the multiple materials.

[0064] In the first implementation, the sub-collision deformation parameters corresponding to different categories of materials among multiple materials are weighted and calculated, and the collision deformation parameters are determined based on the weighted calculation results. Based on the degree or proportion of deformation impact of different material categories, different weighting coefficients can be assigned to different material categories. For example, assuming the load-bearing object is a surface object, and the surface object contains multiple material categories: soft sand, hard sand, and water. When these three are mixed, the water category has the greatest impact on collision deformation, followed by the hard sand category. Therefore, the water category can be assigned the largest weighting coefficient, the hard sand category the second largest weighting coefficient, and the soft sand category the smallest weighting coefficient. As another example, assuming the load-bearing object is a surface object, and the surface object contains multiple material categories: stone, soft sand, and snow, with stone accounting for 60%, soft sand accounting for 10%, and snow accounting for 30%, then the stone category can be assigned the largest weighting coefficient, the snow category the second largest weighting coefficient, and the soft sand category the smallest weighting coefficient. Therefore, after obtaining the sub-collision coefficients of different types of materials contained in the load-bearing object, a weighted calculation is performed based on the sub-collision coefficients and weighting coefficients of different types of materials, and the collision deformation parameters of the load-bearing object are determined based on the weighted calculation results.

[0065] In the second implementation, the average value of the sub-collision deformation parameters corresponding to different categories of materials is calculated. In other words, the sub-collision deformation parameters corresponding to different categories of materials are summed and then divided by the number of different categories of materials to obtain the average value of the sub-collision deformation parameters. The average value of multiple sub-collision deformation parameters is used as the collision deformation parameter of the load-bearing object.

[0066] Of course, other methods can be used to determine the collision deformation parameters of the load-bearing object, which are not limited here.

[0067] It should be noted that the materials included in a load-bearing object are all materials encompassed by the area where the load-bearing object is located. In this invention, a load-bearing object includes at least one load-bearing object unit, and a load-bearing object unit may include only one material or multiple materials. Therefore, the materials included in a load-bearing object associated with a first collider are at least one material included in each of the at least one load-bearing object units included in that load-bearing object. For example, assuming the load-bearing object is a mesh object, each mesh is a load-bearing object unit, and a first collider can be set to correspond to one mesh or multiple meshes. The mesh resources in a mesh may include one material or multiple materials. A load-bearing object is defined as a load-bearing object containing one or more meshes, and the materials included in that load-bearing object are all materials included in the mesh resources of its one or more meshes. According to the above method, different collision deformation parameters are determined for load-bearing objects containing different materials, so that load-bearing objects containing different materials exhibit different visual collision deformations in response to the same collision action, resulting in a high degree of realism.

[0068] Steps S210 and S220 can be executed during initial configuration, pre-storing the collision deformation parameters corresponding to each load-bearing object into its associated first collider, or they can be executed when each first collider is activated. That is, when the activation of the first collider is detected, S210 and S220 are executed to obtain the collision deformation parameters corresponding to the load-bearing object associated with the first collider in real time.

[0069] Step S230: When at least one first collider is detected to be activated by a second collider, obtain the collision deformation parameters stored in each of the at least one first collider.

[0070] Collision deformation parameters describe the degree to which the surface of a load-bearing object's model is prone to collision deformation when an action object triggers a collision action against it. For example, the hardness of the load-bearing object's material. Different load-bearing objects correspond to different collision deformation parameters. When an action object triggers a collision action against a load-bearing object, a virtual imprint displaying the collision deformation can be generated based on the corresponding collision deformation parameters. A single collision action triggered by an action object may activate one or more first colliders. To facilitate understanding, a specific application scenario is given to illustrate the situation where multiple first colliders are activated by second colliders: Assume the load-bearing object is a ground object, and the ground object is a mesh object, with each load-bearing object containing one mesh. Accordingly, one first collider is associated with one mesh. Assume the action object is a character object, and the character object is associated with one second collider. The collision action is a walking action, and the virtual imprint is the footprint generated by the character object triggering the walking action on the ground object. When the character object's walking action is triggered at a mesh (i.e., a load-bearing object), the collision deformation parameter is generated by the character object triggering the walking action on the ground object. When the character object is in the middle region of a grid (i.e., a load-bearing object), only the first collider associated with the grid is activated by the second collider associated with the character object. In this case, S230 specifically involves obtaining the collision deformation parameters stored in one of the first colliders activated by the second collider associated with the character object. When the character object's walking action is triggered at the vertex region of a grid (i.e., a load-bearing object) and is located at the boundary between the grid and an adjacent grid, the first collider associated with the grid and the first collider associated with the adjacent grid are activated by the second collider associated with the character object. In this case, S230 specifically involves obtaining the collision deformation parameters stored in the two first colliders activated by the second collider associated with the character object.

[0071] Step S240: Determine the corresponding virtual imprint based on the obtained collision deformation parameters.

[0072] If a first collider is detected to be activated by a second collider, the collision deformation parameters stored in the first collider are obtained, and a corresponding virtual imprint is generated based on the collision deformation parameters; if multiple first colliders are detected to be activated by a second collider, the collision deformation parameters stored in the multiple first colliders are obtained, and a corresponding virtual imprint is generated based on the multiple collision deformation parameters.

[0073] Accordingly, the method for determining the corresponding virtual imprint can be achieved through at least one of the following methods:

[0074] In the first implementation, step S240 includes several sub-steps:

[0075] Sub-step 1: Determine the parameter range to which the obtained collision deformation parameters belong.

[0076] If S230 obtains a collision deformation parameter of a first collider, then the parameter range to which the collision deformation parameter belongs is determined; if S230 obtains multiple collision deformation parameters of the first collider, then an overall collision deformation parameter is determined based on the multiple collision deformation parameters, and then the parameter range to which the overall collision deformation parameter belongs is determined.

[0077] Sub-step two: Search for the virtual imprint that corresponds to the parameter range in the virtual imprint material library.

[0078] Virtual imprints corresponding to the collision deformation visual effects of different load-bearing objects can be pre-set in the virtual imprint material library. Specifically, virtual imprints with imprint depths ranging from shallow to deep and / or imprint ranges ranging from small to large can be set. Each virtual imprint corresponds to a parameter range, and each parameter range includes collision deformation parameters within a certain numerical range. After the collision deformation parameters are obtained in S230, the parameter range to which the collision deformation parameters belong is determined. Then, the virtual imprint corresponding to that parameter range is searched in the virtual imprint material library. The found virtual imprint can be directly loaded on the model surface of the load-bearing object at the position where the action object triggers the collision action. This method can quickly load virtual imprints, saving the calculation time of real-time generation of virtual imprints.

[0079] In the second implementation, when multiple first colliders are detected to be activated by the second collider, S240 includes several sub-steps:

[0080] Sub-step 1: Based on the collision deformation parameters stored in each of the multiple first colliders, generate the imprint depth value corresponding to each first collider.

[0081] In this implementation, the virtual imprint can be considered a filter, and the imprint depth value can be considered a filter parameter. Specifically, the imprint depth value can be represented as the color value of the virtual imprint. Therefore, the virtual imprint generated based on the imprint depth value is one whose color intensity matches the imprint depth value. As the collision deformation parameter changes from easily deformable to not easily deformable, the corresponding imprint depth value changes from large to small. Thus, the color of the virtual imprint generated based on the imprint depth value changes from dark to light. Based on the collision deformation parameters stored in each first collider, an imprint depth value corresponding to each first collider is generated so that subsequent virtual imprints with color intensity matching the imprint depth value can be generated.

[0082] Sub-step 2: Generate virtual imprints based on the imprint depth values ​​corresponding to each first collider.

[0083] Given the collision deformation parameters of multiple first colliders, and the corresponding generation of multiple imprint depth values, sub-step two can be implemented in several ways:

[0084] Method 1: Calculate the average imprint depth value based on the imprint depth value corresponding to each first collider, and generate a virtual imprint based on the average value. In other words, sum the imprint depth values ​​generated based on the sub-collision deformation parameters, and then divide by the number of imprint depth values ​​to obtain the average imprint depth value. The average imprint depth value is represented as the color value of the virtual imprint. Then, generate a virtual imprint whose color depth matches the average imprint depth value. The virtual imprint generated in this way can show the degree of collision deformation of the load-bearing object in response to the collision action after the materials of the load-bearing objects associated with multiple first colliders are merged. It achieves a virtual imprint generation effect with high realism and fast loading speed with less resource consumption.

[0085] Method 2: Based on the imprint depth value corresponding to each first collider, generate corresponding virtual imprints in the area of ​​the load-bearing object corresponding to each first collider. In some cases, the material deformability of the load-bearing objects associated with multiple activated first colliders varies greatly. Therefore, for a collision action, the collision deformation on the surface of a load-bearing object with a softer material (i.e., a larger collision deformation parameter) may be greater, while the collision deformation on the surface of a load-bearing object with a harder material (i.e., a smaller collision deformation parameter) may be smaller. To simulate this visual effect, for each load-bearing object corresponding to a first collider, the imprint depth value corresponding to the collision deformation parameter stored in the first collider can be used to generate a virtual imprint in the area of ​​the load-bearing object whose imprint color depth matches the imprint depth value corresponding to the collision deformation parameter of the load-bearing object. In Method 2, the imprint color depth of a complete virtual imprint in the area corresponding to different load-bearing objects matches the imprint depth value corresponding to the load-bearing object in that area.

[0086] The two methods described above can be selected according to different situations. For example, a step can be added between S230 and S240: calculate the difference degree of each obtained collision deformation parameter, compare the difference degree with a preset threshold, and determine the corresponding method based on the comparison result. Then, based on the determined method, S240 determines the corresponding virtual imprint according to the obtained collision deformation parameters. Specifically, for example, if the difference degree is greater than the preset threshold, it means that the material of the load-bearing object corresponding to different first colliders has a large difference in deformability, so the difference in the degree of collision deformation generated on different load-bearing objects is large, and the corresponding virtual imprint can be determined by method two; if the difference degree is less than or equal to the preset threshold, it means that the material of the load-bearing object corresponding to different first colliders has a small difference in deformability, so the difference in the degree of collision deformation generated on different load-bearing objects is small, and the corresponding virtual imprint can be determined by method one.

[0087] Those skilled in the art can flexibly adjust the execution order of the above steps, and can break down the above steps into more steps, or merge them into fewer steps, and can also delete some of the steps. Furthermore, Embodiment 1 and Embodiment 2 can be combined with each other, and the present invention does not limit this. Moreover, the above steps can be executed cyclically; for example, if the action object continuously triggers collision actions, corresponding virtual imprints will be continuously generated. In summary, the generation of virtual imprints can be dynamically executed following the collision actions triggered by the action object.

[0088] In summary, by storing the collision deformation parameters corresponding to the load-bearing object in the first collider associated with the load-bearing object, when an action object triggers a collision action against the load-bearing object—that is, when the first collider associated with the load-bearing object is activated by the second collider associated with the action object—the collision deformation parameters corresponding to the load-bearing object stored in the first collider can be directly obtained to determine the virtual imprint that displays the collision deformation effect. This eliminates the need for complex physical simulation calculations of the load-bearing object and then generating the virtual imprint based on the results of the physical simulation calculations. This achieves rapid virtual imprint generation with minimal resource consumption. Furthermore, in the virtual scene, for different load-bearing objects with composite materials, the collision deformation parameters corresponding to the composite material can be stored in the first collider associated with the load-bearing object. Therefore, when the first colliders of load-bearing objects with different composite materials are activated, different virtual imprints will be generated, thereby achieving a highly realistic simulation of collision deformation.

[0089] To facilitate understanding, a specific example will be used to describe the detailed implementation of this embodiment. This example uses a virtual game scene as an example. Specifically, taking the character object as the action object, the ground object as the load-bearing object, the collision action as the character object's walking action on the ground object, and the virtual imprint as a footprint as an example, in order to simulate a real-world scene, it is necessary to simulate the footprints created on the ground object when the character object walks on it. In traditional virtual imprint generation methods, physical simulation calculations are required for the material of the ground object to generate sunken footprints on the ground model, which consumes a lot of system resources and is slow. To solve the above problems, Figure 3 A method for generating virtual imprints is shown, such as Figure 3 As shown, this example includes the following steps:

[0090] Step S310: For a first collider, obtain at least one material of the ground object corresponding to the first collider, and determine the sub-collision deformation parameters corresponding to each material in the at least one material.

[0091] The material of the surface object can include at least one of the following: hard sand, snow, soft sand, stone, and grass. Each material is more prone to collision deformation to a different degree, that is, the corresponding sub-collision deformation parameters are different. The at least one material included in the surface object corresponding to the first collider, and the sub-collision deformation parameters corresponding to each material can be obtained in advance.

[0092] Step S320: Determine the collision deformation parameters according to the sub-collision deformation parameters corresponding to each material, and store the collision deformation parameters in the first collider.

[0093] Specifically, the collision deformation parameters of the surface objects are determined in advance based on the sub-collision deformation parameters of at least one material contained in each surface object, and the determined collision deformation parameters are stored in the first collider associated with the surface object.

[0094] Step S330: When a first collider is detected to be activated by a second collider, obtain the collision deformation parameters stored in each of the at least one first collider.

[0095] The first collider is associated with the ground object, and the second collider is associated with the character object. When the character object triggers a walking action on the ground object, the first collider detects that it is activated by the second collider. Then, it retrieves the collision deformation parameters of the corresponding ground object stored in the first collider. The collision deformation parameters are used to describe the degree to which the surface of the ground object is prone to sinking footprints (i.e., collision deformation) when the character object triggers a walking action on the ground object.

[0096] Step S340: Determine the corresponding footprint based on the obtained collision deformation parameters, wherein the footprint is used to load onto the model surface of the ground object at the position where the character object triggers the walking action.

[0097] After obtaining the collision deformation parameters of the ground object, the footprint depth value (i.e., imprint depth value) is determined based on the collision deformation parameters of the ground object. Then, a footprint matching the footprint depth value is generated and loaded onto the model surface of the ground object at the position corresponding to the position where the character object triggers the walking action. Alternatively, multiple footprint materials of various depths corresponding to footprints can be stored in the footprint material library in advance. Each footprint material corresponds to a parameter range. The parameter range to which the footprint belongs is determined based on the collision deformation parameters of the ground object. Then, the footprint material corresponding to that parameter range is searched in the material library, and the footprint material is directly obtained and loaded onto the model surface of the ground object at the position where the character object triggers the walking action.

[0098] Of course, it is understandable that in this example, the above steps can be executed continuously. For example, if the action object continuously triggers collision actions, virtual imprints corresponding to the collision actions will be continuously generated. In short, the generation of virtual imprints can be dynamically executed following the collision actions triggered by the action object.

[0099] The above example demonstrates how to quickly generate footprints with minimal resource consumption.

[0100] Example 3

[0101] Figure 4 This invention illustrates a virtual imprint generation device according to Embodiment 3, comprising:

[0102] The acquisition module 01 is adapted to acquire the collision deformation parameters stored in each of the at least one first colliders when it is detected that at least one first collider is activated by a second collider, wherein the first collider is the collider associated with the load-bearing object and the second collider is the collider associated with the action object.

[0103] The determination module 02 is adapted to determine the corresponding virtual imprint based on the obtained collision deformation parameters, wherein the virtual imprint is used to load the model surface of the load-bearing object at the position corresponding to the action object.

[0104] In some examples, the virtual imprint generation device also includes:

[0105] Sub-determination module 03 is adapted to obtain at least one material of the load-bearing object corresponding to each of the multiple first colliders, and determine the sub-collision deformation parameters corresponding to each of the at least one material.

[0106] Storage module 04 is adapted to determine the collision deformation parameters according to the sub-collision deformation parameters corresponding to each material, and store the collision deformation parameters in the first collider.

[0107] In some examples, at least one material is multiple materials. Accordingly, the sub-determination module is further adapted to: perform weighted calculation of sub-collision deformation parameters corresponding to different categories of materials among the multiple materials, and determine the collision deformation parameters based on the weighted calculation results.

[0108] In some examples, module 02 is also adapted to: determine the parameter range to which the acquired collision deformation parameters belong; and search for virtual imprints in the virtual imprint material library that correspond to the parameter range.

[0109] In some examples, at least one first collider is multiple first colliders, and accordingly, the determining module 02 is also adapted to: generate an imprint depth value corresponding to each first collider based on the collision deformation parameters stored in each of the multiple first colliders; and generate a virtual imprint based on the imprint depth value corresponding to each first collider.

[0110] In some examples, the determination module 02 can generate virtual imprints based on the imprint depth values ​​corresponding to each first collider in one of the following ways:

[0111] Method 1: Calculate the average imprint depth value based on the imprint depth value corresponding to each first collider, and generate a virtual imprint based on the average value.

[0112] Method 2: Based on the imprint depth value corresponding to each first collider, generate corresponding virtual imprints in the area where the load-bearing object corresponding to each first collider is located.

[0113] The specific structure and working principle of each of the above modules can be found in the description of the corresponding part of the method embodiment, and will not be repeated here.

[0114] Example 4

[0115] Embodiment 4 of this application provides a non-volatile computer storage medium storing at least one executable instruction that can execute the object loading method in the virtual scene of any of the above method embodiments. Specifically, the executable instruction can be used to cause the processor to perform the corresponding operations in the above method embodiments.

[0116] Example 5

[0117] Figure 5 The diagram shows a structural schematic of an electronic device according to Embodiment 5 of the present invention. The specific embodiments of the present invention do not limit the specific implementation of the electronic device.

[0118] like Figure 5 As shown, the electronic device may include: a processor 502, a communications interface 506, a memory 504, and a communications bus 508.

[0119] in:

[0120] The processor 502, communication interface 506, and memory 504 communicate with each other via communication bus 508.

[0121] Communication interface 506 is used to communicate with other network elements such as clients or other servers.

[0122] The processor 502 is used to execute program 510, specifically to execute the relevant steps in the above-described virtual imprint generation method embodiment.

[0123] Specifically, program 510 may include program code that includes computer operation instructions.

[0124] Processor 502 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The electronic device may include one or more processors of the same type, such as one or more CPUs; or it may include processors of different types, such as one or more CPUs and one or more ASICs.

[0125] Memory 504 is used to store program 510. Memory 504 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0126] Specifically, program 510 can be used to cause processor 502 to execute the corresponding operations in the above-described virtual imprint generation method embodiment.

[0127] The algorithms and displays provided herein are not inherently related to any particular computer, virtual device, or other equipment. Various general-purpose devices can also be used in conjunction with the teachings herein. The required structure for constructing such devices is apparent from the above description. Furthermore, this invention is not directed to any particular programming language. It should be understood that the contents of the invention described herein can be implemented using various programming languages, and the above description of specific languages ​​is for the purpose of disclosing the best mode of implementation of the invention.

[0128] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0129] Similarly, it should be understood that, in order to streamline this disclosure and aid in understanding one or more of the various aspects of the invention, features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof in the above description of exemplary embodiments of the invention. However, this method of disclosure should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim.

[0130] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.

[0131] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features but not others included in other embodiments, combinations of features from different embodiments are intended to be within the scope of the invention and form different embodiments. For example, any of the claimed embodiments can be used in any combination.

[0132] The various component embodiments of the present invention can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some or all of the components in the apparatus according to embodiments of the present invention. The present invention can also be implemented as a device or apparatus program (e.g., a computer program and computer program product) for performing part or all of the methods described herein. Such programs implementing the present invention can be stored on a computer-readable medium or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.

[0133] It should be noted that the above embodiments are illustrative of the invention and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.

Claims

1. A method for generating a virtual imprint, the method comprising: When at least one first collider is detected to be activated by a second collider, the collision deformation parameters stored in each of the at least one first collider are obtained, wherein the first collider is the collider associated with the load-bearing object and the second collider is the collider associated with the action object. The corresponding virtual imprint is determined based on the obtained collision deformation parameters, wherein the virtual imprint is used to be loaded onto the model surface of the load-bearing object at the position corresponding to the action object; The at least one first collider can be multiple first colliders; the step of determining the corresponding virtual imprint based on the acquired collision deformation parameters includes: Multiple first colliders are activated simultaneously from a second collider, the load-bearing object is a gridded surface object, each first collider is associated with a grid cell, and the grid cells associated with the multiple first colliders are adjacent to each other. Based on the collision deformation parameters stored in each of the plurality of first colliders, an imprint depth value corresponding to each first collider is generated. Virtual imprints are generated based on the imprint depth values ​​corresponding to each first collider: the difference between the obtained collision deformation parameters is calculated, and the difference is compared with a preset threshold. If the difference is greater than the preset threshold, then a corresponding virtual imprint is generated in the area of ​​the load-bearing object corresponding to each first collider based on the imprint depth values ​​corresponding to each first collider. If the difference is less than or equal to the preset threshold, the mean of the imprint depth values ​​is calculated based on the imprint depth values ​​corresponding to each first collider, and the virtual imprint is generated based on the mean.

2. The method according to claim 1, wherein, Before acquiring the collision deformation parameters stored in each of the at least one first colliders when at least one first collider is detected to be activated by a second collider, the method includes: For a given first collider, obtain at least one material of the load-bearing object corresponding to the first collider, and determine the sub-collision deformation parameters corresponding to each of the at least one material. The collision deformation parameters are determined based on the sub-collision deformation parameters corresponding to each material, and the collision deformation parameters are stored in the first collider.

3. The method according to claim 2, wherein, The at least one material can be multiple materials; determining the collision deformation parameter based on the sub-collision deformation parameter corresponding to each material includes: The collision deformation parameters are calculated by weighting the sub-collision deformation parameters corresponding to different categories of materials among the various materials, and the collision deformation parameters are determined based on the weighted calculation results.

4. The method according to any one of claims 1-3, wherein, The step of determining the corresponding virtual imprint based on the obtained collision deformation parameters includes: Determine the parameter range to which the obtained collision deformation parameters belong; Search the virtual imprint material library for the virtual imprint that corresponds to the parameter range.

5. A virtual imprint generation device, the device comprising: The acquisition module is adapted to acquire the collision deformation parameters stored in each of the at least one first colliders when it is detected that at least one first collider is activated by a second collider, wherein the first collider is a collider associated with a load-bearing object and the second collider is a collider associated with an action object. The determining module is adapted to determine the corresponding virtual imprint based on the obtained collision deformation parameters, wherein the virtual imprint is used to be loaded onto the model surface of the load-bearing object at the position corresponding to the action object; The at least one first collider can be multiple first colliders; the step of determining the corresponding virtual imprint based on the acquired collision deformation parameters includes: Multiple first colliders are activated simultaneously from a second collider, the load-bearing object is a gridded surface object, each first collider is associated with a grid cell, and the grid cells associated with the multiple first colliders are adjacent to each other. Based on the collision deformation parameters stored in each of the plurality of first colliders, an imprint depth value corresponding to each first collider is generated. Virtual imprints are generated based on the imprint depth values ​​corresponding to each first collider: the difference between the obtained collision deformation parameters is calculated, and the difference is compared with a preset threshold. If the difference is greater than the preset threshold, then a corresponding virtual imprint is generated in the area of ​​the load-bearing object corresponding to each first collider based on the imprint depth values ​​corresponding to each first collider. If the difference is less than or equal to the preset threshold, the mean of the imprint depth values ​​is calculated based on the imprint depth values ​​corresponding to each first collider, and the virtual imprint is generated based on the mean.

6. An electronic device, comprising: The processor, memory, communication interface, and communication bus are provided, wherein the processor, memory, and communication interface communicate with each other via the communication bus. The memory is used to store at least one executable instruction that causes the processor to perform the operation corresponding to any one of the virtual imprint generation methods as claimed in claims 1-4.

7. A computer storage medium storing at least one executable instruction that causes a processor to perform an operation corresponding to any one of the virtual imprint generation methods as claimed in claims 1-4.

Citation Information

Patent Citations

  • Collision trace display method and device in virtual scene, equipment and storage medium

    CN111282275A