Virtual object interaction method and device, computer equipment and storage medium

Through part-zoned texture mapping and texture location recognition technology, the problem of low interaction accuracy in traditional virtual object interaction is solved, and more refined interaction part recognition and higher interaction accuracy are achieved.

CN118534995APending Publication Date: 2024-08-23TENCENT TECH SHANGHAI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310146611.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-21
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

In traditional virtual object interaction methods, there is a problem of low interaction accuracy through capsule collision identification of interaction parts.

Method used

Part-partitioned texture maps are used to assign different color values ​​to different parts of the virtual object. By obtaining the part-partitioned texture map of the virtual object, color value recognition is performed on the screen rendering texture map based on texture coordinates to determine the interactive parts.

Benefits of technology

It improves the recognition accuracy of interactive parts and enhances the accuracy of interactive operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118534995A
    Figure CN118534995A
Patent Text Reader

Abstract

The invention relates to a virtual object interaction method and device, computer equipment, a storage medium and a computer program product. The method comprises the steps of obtaining a part partition texture map corresponding to a virtual object, and rendering the virtual object based on the part partition texture map to obtain a color texture map; the part partition texture map comprises color values of all parts of the virtual object, and the color values of all the parts are different; in response to the interaction triggering operation, converting an interaction triggering position indicated by the interaction triggering operation into a texture coordinate, and rendering the color texture map to a pre-configured screen rendering texture map; performing color value identification on the screen rendering texture map according to the texture coordinates to obtain color values corresponding to the texture coordinates; and according to the color value corresponding to the texture coordinate, determining a part corresponding to the color value corresponding to the texture coordinate from a pre-configured corresponding relationship between the part and the color value. By adopting the method, the recognition accuracy of the interaction part can be improved, so that the interaction accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a virtual object interaction method, apparatus, computer equipment, storage medium, and computer program product. Background Art

[0002] With the development of computer technology, virtual object interaction applications have emerged. When performing virtual object interaction in virtual object interaction applications, it is necessary to identify the interactive parts of the virtual object. For example, when the virtual object is a virtual animal, the interactive parts may specifically be the virtual animal's eyes, tail, ears, etc.

[0003] In conventional technology, when identifying interactive parts of a virtual object, multiple capsules are bound to different bones of the virtual object in advance, so as to identify the interactive parts of the virtual object through capsule collision.

[0004] However, the method of identifying the interaction parts of virtual objects through capsule collision is not precise enough and has the problem of low interaction accuracy. Summary of the Invention

[0005] Based on this, it is necessary to provide a virtual object interaction method, device, computer equipment, computer-readable storage medium and computer program product that can improve the interaction accuracy in response to the above technical problems.

[0006] In a first aspect, the present application provides a virtual object interaction method. The method comprises:

[0007] Obtaining a part partition texture map corresponding to the virtual object, and rendering the virtual object based on the part partition texture map to obtain a color texture map; the part partition texture map includes color values ​​of each part of the virtual object, and the color values ​​of each part are different;

[0008] In response to the interaction triggering operation, converting the interaction triggering position indicated by the interaction triggering operation into texture coordinates, and rendering the color texture map to a preconfigured screen rendering texture map;

[0009] Perform color value recognition on the screen rendering texture map according to the texture coordinates to obtain the color value corresponding to the texture coordinates;

[0010] According to the color value corresponding to the texture coordinate, the part corresponding to the color value corresponding to the texture coordinate is determined from the pre-configured correspondence between the part and the color value.

[0011] In a second aspect, the present application further provides a virtual object interaction device. The device comprises:

[0012] A texture rendering module is used to obtain a part partition texture map corresponding to the virtual object, and render the virtual object based on the part partition texture map to obtain a color texture map; the part partition texture map includes the color value of each part of the virtual object, and the color value of each part is different;

[0013] A texture map rendering module is used to convert the interaction trigger position indicated by the interaction trigger operation into texture coordinates in response to the interaction trigger operation, and render the color texture map to a preconfigured screen rendering texture map;

[0014] A color value recognition module is used to perform color value recognition on the screen rendering texture map according to the texture coordinates to obtain the color value corresponding to the texture coordinates;

[0015] The part identification module is used to determine the part corresponding to the color value corresponding to the texture coordinate from the pre-configured correspondence between the part and the color value according to the color value corresponding to the texture coordinate.

[0016] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are performed:

[0017] Obtaining a part partition texture map corresponding to the virtual object, and rendering the virtual object based on the part partition texture map to obtain a color texture map; the part partition texture map includes color values ​​of each part of the virtual object, and the color values ​​of each part are different;

[0018] In response to the interaction triggering operation, converting the interaction triggering position indicated by the interaction triggering operation into texture coordinates, and rendering the color texture map to a preconfigured screen rendering texture map;

[0019] Perform color value recognition on the screen rendering texture map according to the texture coordinates to obtain the color value corresponding to the texture coordinates;

[0020] According to the color value corresponding to the texture coordinate, the part corresponding to the color value corresponding to the texture coordinate is determined from the pre-configured correspondence between the part and the color value.

[0021] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:

[0022] Obtaining a part partition texture map corresponding to the virtual object, and rendering the virtual object based on the part partition texture map to obtain a color texture map; the part partition texture map includes color values ​​of each part of the virtual object, and the color values ​​of each part are different;

[0023] In response to the interaction triggering operation, converting the interaction triggering position indicated by the interaction triggering operation into texture coordinates, and rendering the color texture map to a preconfigured screen rendering texture map;

[0024] Perform color value recognition on the screen rendering texture map according to the texture coordinates to obtain the color value corresponding to the texture coordinates;

[0025] According to the color value corresponding to the texture coordinate, the part corresponding to the color value corresponding to the texture coordinate is determined from the pre-configured correspondence between the part and the color value.

[0026] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the following steps:

[0027] Obtaining a part partition texture map corresponding to the virtual object, and rendering the virtual object based on the part partition texture map to obtain a color texture map; the part partition texture map includes color values ​​of each part of the virtual object, and the color values ​​of each part are different;

[0028] In response to the interaction triggering operation, converting the interaction triggering position indicated by the interaction triggering operation into texture coordinates, and rendering the color texture map to a preconfigured screen rendering texture map;

[0029] Perform color value recognition on the screen rendering texture map according to the texture coordinates to obtain the color value corresponding to the texture coordinates;

[0030] According to the color value corresponding to the texture coordinate, the part corresponding to the color value corresponding to the texture coordinate is determined from the pre-configured correspondence between the part and the color value.

[0031] The above-mentioned virtual object interaction method, device, computer equipment, storage medium and computer program product use part-partition texture mapping to partition virtual objects, assign different color values ​​to different parts of the virtual object, and obtain the part-partition texture mapping corresponding to the virtual object and render the virtual object based on the part-partition texture mapping to obtain a color texture map with different color values ​​for different parts. Therefore, in response to the interaction trigger operation, the interaction trigger position indicated by the interaction trigger operation is converted into texture coordinates, and the color texture map is rendered to a preconfigured screen rendering texture map. The texture coordinates are used to perform color value recognition on the screen rendering texture map with different color values ​​for different parts to obtain the color values ​​corresponding to the texture coordinates. Therefore, according to the color values ​​corresponding to the texture coordinates, the part corresponding to the color value corresponding to the texture coordinate can be determined from the preconfigured correspondence between the part and the color value. The entire process can improve the recognition accuracy of the interaction part by using color value partitioning to identify the part, thereby improving the interaction accuracy.

[0032] In a sixth aspect, the present application provides a virtual object interaction method. The method comprises:

[0033] Displaying a virtual object obtained by shaping the original model; the virtual object retains the parts of the original model;

[0034] In response to an interaction triggering operation on a virtual object, displaying an interaction triggering position of the interaction triggering operation;

[0035] When the interaction trigger position belongs to any part of the virtual object, the virtual object is displayed to perform a feedback action mapped to the part where the interaction trigger position is located.

[0036] In a seventh aspect, the present application further provides a virtual object interaction device. The device comprises:

[0037] A virtual object display module is used to display a virtual object obtained by shaping the original model; the virtual object retains the parts of the original model;

[0038] A trigger position display module, configured to display an interaction trigger position of the interaction trigger operation in response to the interaction trigger operation on the virtual object;

[0039] The feedback action display module is used to display the feedback action mapped to the part where the interaction trigger position is located when the interaction trigger position belongs to any part of the virtual object.

[0040] In an eighth aspect, the present application further provides a computer device. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0041] Displaying a virtual object obtained by shaping the original model; the virtual object retains the parts of the original model;

[0042] In response to an interaction triggering operation on a virtual object, displaying an interaction triggering position of the interaction triggering operation;

[0043] When the interaction trigger position belongs to any part of the virtual object, the virtual object is displayed to perform a feedback action mapped to the part where the interaction trigger position is located.

[0044] In a ninth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:

[0045] Displaying a virtual object obtained by shaping the original model; the virtual object retains the parts of the original model;

[0046] In response to an interaction triggering operation on a virtual object, displaying an interaction triggering position of the interaction triggering operation;

[0047] When the interaction trigger position belongs to any part of the virtual object, the virtual object is displayed to perform a feedback action mapped to the part where the interaction trigger position is located.

[0048] In a tenth aspect, the present application further provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the following steps:

[0049] Displaying a virtual object obtained by shaping the original model; the virtual object retains the parts of the original model;

[0050] In response to an interaction triggering operation on a virtual object, displaying an interaction triggering position of the interaction triggering operation;

[0051] When the interaction trigger position belongs to any part of the virtual object, the virtual object is displayed to perform a feedback action mapped to the part where the interaction trigger position is located.

[0052] The above-mentioned virtual object interaction method, device, computer equipment, storage medium and computer program product can realize intuitive feedback of the interaction trigger operation by displaying the virtual object obtained by the original model through the shaping operation, and displaying the interaction trigger position of the interaction trigger operation in response to the interaction trigger operation on the virtual object. Furthermore, when the interaction trigger position belongs to any part of the virtual object, the feedback action mapped to the part where the interaction trigger position is located can be displayed, thereby realizing accurate feedback of the interaction trigger operation and improving the interaction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 A diagram of an application environment of a virtual object interaction method in one embodiment;

[0054] Figure 2 1 is a flow chart of a virtual object interaction method according to an embodiment;

[0055] Figure 3 A schematic diagram of a part-region texture map in one embodiment;

[0056] Figure 4 is a schematic diagram of a color texture map in one embodiment;

[0057] Figure 5 A schematic diagram illustrating an expansion effect in one embodiment;

[0058] Figure 6 is a schematic diagram of a real-time posture in one embodiment;

[0059] Figure 7A schematic diagram of a flow chart of a virtual object interaction method applied to virtual pet interaction in one embodiment;

[0060] Figure 8 A schematic diagram of an interaction triggering position indicated by an interaction triggering operation in one embodiment;

[0061] Figure 9 A schematic diagram of obtaining color values ​​corresponding to texture coordinates in one embodiment;

[0062] Figure 10 A diagram illustrating an application environment of a virtual object interaction method in another embodiment;

[0063] Figure 11 is a flowchart of a virtual object interaction method in another embodiment;

[0064] Figure 12 Schematic diagram of virtual cats of various shapes obtained through a kneading operation in one embodiment;

[0065] Figure 13 A schematic diagram showing a virtual cat and a virtual background corresponding to the virtual cat in one embodiment;

[0066] Figure 14 A schematic diagram showing an interaction triggering position in one embodiment;

[0067] Figure 15 A schematic diagram of a virtual object interaction method applied to virtual pet interaction in one embodiment;

[0068] Figure 16 is a structural block diagram of a virtual object interaction device in one embodiment;

[0069] Figure 17 is a structural block diagram of a virtual object interaction device in another embodiment;

[0070] Figure 18 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0071] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0072] The virtual object interaction method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store data that server 104 needs to process. The data storage system can be integrated with server 104, or placed on a cloud or other server. Terminal 102 is installed with a client for implementing virtual object interaction. The client can be an application, a web client, or a sub-application running in the runtime environment of a parent application. Terminal 102 obtains a part-partitioned texture map corresponding to the virtual object from server 104, renders the virtual object based on the part-partitioned texture map, and obtains a color texture map. The part-partitioned texture map includes color values ​​for each part of the virtual object, and the color values ​​of each part are different. In response to an interaction trigger operation, the interaction trigger position indicated by the interaction trigger operation is converted into texture coordinates, and the color texture map is rendered to a preconfigured screen rendering texture map. Color value recognition is performed on the screen rendering texture map based on the texture coordinates to obtain the color value corresponding to the texture coordinate. Based on the color value corresponding to the texture coordinate, the part corresponding to the color value corresponding to the texture coordinate is determined from the preconfigured correspondence between the part and the color value.

[0073] Terminal 102 may include, but is not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices may include smart speakers, smart TVs, smart air conditioners, and smart car devices. Portable wearable devices may include smart watches, smart bracelets, and head-mounted devices. Server 104 may be implemented as a standalone server, a server cluster consisting of multiple servers, or a cloud server. It may also be a node on a blockchain.

[0074] In one embodiment, Figure 2 As shown, a virtual object interaction method is provided, which can be executed by a terminal or a server alone, or by a terminal and a server in collaboration. In the embodiment of the present application, the method is applied to a terminal as an example for explanation, and includes the following steps:

[0075] Step 202 , obtain the part partition texture map corresponding to the virtual object, render the virtual object based on the part partition texture map, and obtain a color texture map; the part partition texture map includes the color value of each part of the virtual object, and the color value of each part is different.

[0076] A virtual object refers to an active object in a virtual environment, such as a virtual character or animal. A virtual environment is a virtual environment provided by a client when it runs on a terminal. This virtual environment can be a simulation of the real world, a semi-simulated and semi-imaginary environment, or a purely imaginary environment. For example, a virtual environment can be a three-dimensional virtual environment. For another example, in a three-dimensional virtual environment, a virtual object refers to a virtual character or animal displayed within the three-dimensional virtual environment. A virtual object has its own shape and volume within the three-dimensional virtual environment and occupies a portion of the space within the three-dimensional virtual environment.

[0077] A part-partitioned texture map refers to a model map used to render the surface texture of a virtual object. Each pixel in the part-partitioned texture map corresponds to the surface of the virtual object. In this embodiment, the part-partitioned texture map includes color values ​​for each part of the virtual object, and each part has a different color value. That is, pixels belonging to the same part in the part-partitioned texture map have the same color value, while pixels belonging to different parts have different color values. In this way, different parts of the virtual object can be distinguished using color values. A color value refers to the color value corresponding to a color in a color model. For example, the value corresponding to red in the RGB (red, green, blue) color model is 255, 0, 0; the value corresponding to green in the RGB color model is 0, 255, 0; and the value corresponding to blue in the RGB color model is 0, 0, 255. In this embodiment, a color value can specifically refer to the color value corresponding to a color in a single-channel model. That is, each pixel in the part-partitioned texture map has only one value to represent the color. Therefore, the part-partitioned texture map only uses a single channel to store information, which can reduce memory consumption.

[0078] Specifically, when entering an interactive scene for a virtual object, the terminal retrieves the virtual object's corresponding part-part texture map, assigns it to the virtual object's corresponding rendering material, and renders the virtual object based on the rendering material, generating a color texture map. The part-part texture map includes the color values ​​of each part of the virtual object, and each part has a different color value. A rendering material is information that describes the surface appearance of a virtual object, including appearance, color, texture, smoothness, transparency, and more. It is essentially an instance of a shader.

[0079] In specific applications, the part partitioning method of the virtual object can be configured according to the actual application scenario. For example, the virtual object can be a virtual animal, such as a virtual cat, which can be divided into six parts: eyes, ears, face, front paws, body and tail. The part partitioning texture map corresponding to the virtual cat can be as follows: Figure 3 The color texture map obtained by rendering the virtual cat based on the part partition texture map can be as follows Figure 4 As shown (it should be noted that the color value of the part is not in Figure 4 shown in ).

[0080] In specific applications, the color values ​​of each part in the part-area texture map can be configured according to the actual application scenario. In a specific application, smaller and more important parts have larger color values, so the importance of parts can be prioritized based on color value. For example, small and important parts such as eyes and ears can have higher color values ​​than parts such as the face and body.

[0081] Step 204 : In response to the interaction triggering operation, convert the interaction triggering position indicated by the interaction triggering operation into texture coordinates, and render the color texture map to a preconfigured screen rendering texture map.

[0082] Among them, the interaction triggering operation refers to the operation triggered by the interactive object when interacting. For example, the interaction triggering operation may specifically refer to a click operation triggered by the interactive object when interacting. For example, the interaction triggering operation may specifically refer to a click operation triggered by the interactive object through an input device when interacting, and the input device may specifically be a mouse, a stylus, etc. For another example, the interaction triggering operation may specifically refer to a touch screen operation triggered by the interactive object when interacting. The interaction triggering position refers to the position when the interaction triggering operation is triggered. For example, when the interaction triggering operation is a click operation, the interaction triggering position may specifically refer to the clicked position. For another example, when the interaction triggering operation is a touch screen operation, the interaction triggering position may specifically refer to the touched screen position.

[0083] Texture coordinates refer to UV coordinates, which indicate where to sample from a texture image, i.e., collect pixel colors. U refers to the horizontal direction and V refers to the vertical direction. Texture coordinates can be understood as percentage coordinates on the texture image. Texture coordinates range from 0 to 1. Typically, UV(0,0) refers to the top-left corner of the texture image, and UV(1,1) refers to the bottom-right corner of the texture image. A screen-rendered texture is a type of texture, also known as a RenderTexture. It is a special type of texture in Unity (a real-time 3D interactive content creation and operation platform) that defines a texture object on the server side. Drawing directly to this texture is equivalent to drawing directly to this texture during drawing, which saves copying time.

[0084] Specifically, if the interactive object wants to interact, it will initiate an interaction trigger operation. In response to the interaction trigger operation, the terminal can determine the interaction trigger position indicated by the interaction trigger operation, convert the interaction trigger position indicated by the interaction trigger operation into texture coordinates, and render the color texture map to a preconfigured screen rendering texture map.

[0085] In a specific application, the terminal can call the rendering interface to render the color texture to the pre-configured screen rendering texture. In a specific application, the called rendering interface can be specifically a command buffer (rendering command buffer), which is a new encapsulated rendering interface newly added by Unity. Its most important function is to predefine a series of rendering instructions and then execute these rendering instructions at the desired time, that is, these rendering instructions can be executed when the rendering interface is called.

[0086] Step 206 : Perform color value recognition on the screen rendering texture map according to the texture coordinates to obtain the color value corresponding to the texture coordinates.

[0087] Specifically, based on the texture coordinates, the terminal can find the texture color value corresponding to the texture coordinates on the screen-rendered texture map in the texture coordinate system, and then determine the color value corresponding to the texture coordinates based on the texture color value. In specific applications, the process of finding the corresponding texture color value on the screen-rendered texture map based on the texture coordinates can be called texture sampling.

[0088] Step 208 : According to the color value corresponding to the texture coordinate, the part corresponding to the color value corresponding to the texture coordinate is determined from the pre-configured correspondence between the part and the color value.

[0089] Among them, the correspondence between the pre-configured parts and the color values ​​refers to the mapping relationship between the pre-configured parts and the color values. The color values ​​of different parts are different and can be configured according to the actual application scenario.

[0090] Specifically, the terminal can determine the part corresponding to the color value of the texture coordinate from the preconfigured correspondence between parts and color values ​​based on the color value corresponding to the texture coordinate. In a specific application, the virtual object can be a virtual animal, such as a virtual cat, which can be divided into six parts: eyes, ears, face, front paws, body, and tail. The preconfigured correspondence between parts and color values ​​can be: eyes corresponding to color value 1, ears corresponding to color value 2, face corresponding to color value 3, front paws corresponding to color value 4, body corresponding to color value 5, and tail corresponding to color value 6. If the color value corresponding to the texture coordinate is color value 3, based on the preconfigured correspondence between parts and color values, it can be determined that the part corresponding to the color value of the texture coordinate is the face.

[0091] The above-mentioned virtual object interaction method uses a part partition texture map to partition the virtual object, and assigns different color values ​​to different parts of the virtual object. By obtaining the part partition texture map corresponding to the virtual object and rendering the virtual object based on the part partition texture map, a color texture map with different color values ​​for different parts can be obtained. Therefore, in response to the interaction trigger operation, the interaction trigger position indicated by the interaction trigger operation is converted into texture coordinates, and the color texture map is rendered to a preconfigured screen rendering texture map. The texture coordinates are used to perform color value recognition on the screen rendering texture map with different color values ​​for different parts to obtain the color values ​​corresponding to the texture coordinates. Therefore, according to the color values ​​corresponding to the texture coordinates, the part corresponding to the color value corresponding to the texture coordinate can be determined from the correspondence between the preconfigured part and the color value. The whole process can improve the recognition accuracy of the interaction part by using the color value partitioning to identify the part, thereby improving the interaction accuracy.

[0092] In one embodiment, color value recognition is performed on a screen-rendered texture map according to texture coordinates to obtain color values ​​corresponding to the texture coordinates, including:

[0093] Perform texture sampling on the screen rendering texture map according to the texture coordinates to obtain the texture color value corresponding to the texture coordinates;

[0094] Determines the color value corresponding to the texture coordinate based on the texture color value.

[0095] Texture sampling refers to the process of obtaining the color of the corresponding position in the texture map according to the texture coordinates. In this embodiment, it refers to the process of obtaining the color of the corresponding position in the screen rendering texture map according to the texture coordinates.

[0096] Specifically, the terminal will map the texture coordinates to the corresponding pixel coordinates on the screen rendering texture map based on the size of the screen rendering texture map, use the pixel value at the pixel coordinate as the texture color value corresponding to the texture coordinate, and then determine the color value corresponding to the texture coordinate based on the texture color value. In a specific application, assuming that the size of the screen rendering texture map is X*Y, and the texture coordinates are (U, V) = (A1, B1), the texture coordinates are mapped to the screen rendering texture map, and the corresponding pixel coordinates obtained are (A1*X, B1*Y). For example, assuming that the size of the screen rendering texture map is 256*256, and the texture coordinates are (U, V) = (0.5, 0.5), the texture coordinates are mapped to the screen rendering texture map, and the corresponding pixel coordinates obtained are (128, 128). In a specific application, the terminal will directly use the texture color value as the color value corresponding to the texture coordinate. In this way, complex calculations are avoided and the color value corresponding to the texture coordinate can be quickly determined.

[0097] In specific applications, texture coordinates may not necessarily yield pixel coordinates that completely correspond to them in the screen-rendered texture map. In this case, strategies are needed to ensure that texture sampling proceeds sequentially. Commonly used strategies include nearest point sampling and linear sampling. Nearest point sampling involves rounding off the texture coordinates to the nearest pixel coordinates in the screen-rendered texture map. For example, if the pixel coordinates obtained by calculation are (127.6, 127.6), the texture coordinates can be mapped to the pixel coordinates (128, 128) by rounding off. Linear sampling can specifically be bilinear sampling, which works by taking the four texture elements closest to the texture coordinates and calculating a weighted average. In this embodiment, the four texture elements closest to the texture coordinates are taken, and the pixel values ​​corresponding to these four texture elements are obtained. The weighted average of the pixel values ​​corresponding to these four texture elements is then used as the texture color value corresponding to the texture coordinate. The weights of the four texture elements used in the weighted average calculation can be configured according to the actual application scenario.

[0098] In this embodiment, by performing texture sampling on the screen rendering texture map according to the texture coordinates, the texture color value corresponding to the texture coordinate can be obtained, so that the color value corresponding to the texture coordinate can be determined based on the texture color value, thereby achieving accurate color value recognition.

[0099] In one embodiment, determining a color value corresponding to a texture coordinate based on the texture color value includes:

[0100] Get the color value selection range corresponding to the texture coordinates;

[0101] Based on the color value selection range, obtaining at least one candidate color value corresponding to the color value selection range from the screen rendering texture map;

[0102] A color value comparison is performed on at least one candidate color value and a texture color value, and a color value corresponding to the texture coordinate is obtained according to the comparison result.

[0103] The color value selection range refers to the range for selecting color values ​​determined based on the texture coordinates and can be configured according to the actual application scenario. For example, the color value selection range can specifically be at least one pixel position adjacent to the pixel coordinate position mapped by the texture coordinates.

[0104] Specifically, the terminal obtains a color value selection range corresponding to the texture coordinates. This color value selection range can be pre-configured based on the actual application scenario. Once the color value selection range is obtained, the terminal retrieves at least one candidate color value corresponding to the color value selection range from the screen-rendered texture image based on the color value selection range, compares the at least one candidate color value with the texture color value, and obtains the color value corresponding to the texture coordinate based on the comparison result.

[0105] In a specific application, for each candidate color value in at least one candidate color value, the candidate color value may be the same size as the texture color value, or may be different in size from the texture color value. If the candidate color value and the texture color value correspond to the same part, the candidate color value and the texture color value have the same size. If the candidate color value and the texture color value correspond to different parts, the candidate color value and the texture color value have different sizes. By performing a color value comparison on at least one candidate color value and the texture color value, the maximum color value among the at least one candidate color value and the texture color value can be determined based on the comparison result, and the color value that appears the most times among the at least one candidate color value and the texture color value, i.e., the color value mode, can also be determined.

[0106] In a specific application, the terminal uses the maximum color value among at least one candidate color value and the texture color value as the color value corresponding to the texture coordinate. It should be noted that in interactive scenarios involving virtual objects, when the interactive object triggers an interactive operation on the terminal, the operation area may sometimes be inaccurate. For example, the area where the virtual object's eyes and other parts are located is too small, making it difficult for the interactive object to accurately trigger the operation. Therefore, after determining the texture color value, the terminal compares the at least one candidate color value with the texture color value. For each candidate color value in the at least one candidate color value, the size of the candidate color value may be the same as or different from the texture color value. By comparing the at least one candidate color value with the texture color value, the size of the at least one candidate color value and the texture color value can be sorted, and the maximum color value, i.e., the maximum color value, can be determined from the at least one candidate color value and the texture color value. After determining the maximum color value, the terminal uses the maximum color value as the color value corresponding to the texture coordinate.

[0107] It should be noted that by determining the maximum color value and using the maximum color value as the color value corresponding to the texture coordinate, it is equivalent to enlarging the range of the area where the part corresponding to the maximum color value is located, which can achieve the effect of expanding the area where the eyes and other parts are located. The expansion in this embodiment is a problem that the pointer is small for the area where the eyes and other parts are located. By using the color value as the priority, the smaller and more important the part, the larger the color value. The maximum color value is used as the color value corresponding to the texture coordinate, and the area where the eyes and other parts are located is enlarged, so as to achieve accurate part recognition, which can improve the recognition accuracy of the interactive parts, thereby improving the interaction accuracy.

[0108] In a specific application, such as Figure 5 As shown in the figure, taking a virtual cat as an example, the effect of expanding the area where the eyes and other parts are located in this embodiment is explained. The principle of expansion in this embodiment is that the color value is given priority, and the smaller and more important parts have larger color values ​​(such as eyes, ears, etc.). During the expansion process, the areas with higher priority will erode the areas with lower priority. The virtual cat before expansion is as follows: Figure 5As shown in (1), the expanded virtual cat is as follows Figure 5 As shown in (2), the eyes and ears will erode the facial area after they expand, and the front leg area will erode the body area after they expand, etc. This expansion method can make the area where the eyes, ears and other parts are located larger, thereby reducing the problem that the area where the eyes and other parts of the virtual object are located is too small and is usually difficult to be accurately triggered by the interactive object.

[0109] In a specific application, the terminal will use the color value that appears most frequently among at least one candidate color value and the texture color value, that is, the color value mode, as the color value corresponding to the texture coordinate. It should be noted that in the interactive scenario of virtual objects, when the interactive object performs an interactive triggering operation on the terminal, sometimes the operation area may be inaccurate. For example, if the operation area of ​​the interactive object is adjacent to two parts of the virtual object, the operation area is usually difficult to be accurately triggered by the interactive object. Therefore, after determining the texture color value, the terminal will compare at least one candidate color value and the texture color value, and use the color value that appears most frequently, that is, the color value mode, as the color value corresponding to the texture coordinate. In this way, the color value corresponding to the texture coordinate can be accurately determined by using at least one candidate color value around the texture color value as a reference, so as to achieve accurate part recognition, improve the recognition accuracy of the interactive part, and thus improve the interaction accuracy.

[0110] In this embodiment, by obtaining the color value selection range corresponding to the texture coordinates, it is possible to obtain at least one candidate color value from the screen rendering texture map based on the color value selection range, so that by comparing at least one candidate color value and the texture color value and referring to at least one candidate color value, the color value corresponding to the texture coordinates can be accurately determined, which can improve the accuracy of color value recognition, thereby improving the accuracy of recognition of interaction parts, and further improving the interaction accuracy.

[0111] In one embodiment, the color value selection range includes at least one pixel position adjacent to the pixel coordinate position mapped by the texture coordinate; and based on the color value selection range, obtaining at least one candidate color value corresponding to the color value selection range from the screen rendering texture map includes:

[0112] For each pixel position in the at least one pixel position, a pixel value at the pixel position on the screen rendering texture map is used as a candidate color value.

[0113] The pixel coordinates mapped by the texture coordinates refer to the pixel coordinates obtained by mapping the texture coordinates to the screen rendering texture map.

[0114] Specifically, the color value selection range includes at least one pixel position adjacent to the pixel coordinate position mapped by the texture coordinates. In the screen rendering texture map, there is a pixel value at each pixel position, and the pixel value is the color value. When obtaining at least one candidate color value corresponding to the color value selection range, for each pixel position in the at least one pixel position, the terminal will use the pixel value at the targeted pixel position on the screen rendering texture map as the candidate color value.

[0115] In specific applications, the color value selection range can be configured according to the actual application scenario. For example, the color value selection range can specifically be at least one pixel position that is a preconfigured distance away from the pixel coordinates mapped by the texture coordinates, where the preconfigured distance can be configured according to the actual application scenario. For example, the preconfigured distance can specifically be one pixel, and the color value selection range is at least one pixel position that is one pixel away from the pixel coordinates mapped by the texture coordinates.

[0116] In this embodiment, when the color value selection range includes at least one pixel position adjacent to the pixel coordinate position mapped by the texture coordinates, for each pixel position in the at least one pixel position, the pixel value at the targeted pixel position on the screen rendering texture map is used as the candidate color value, so that the candidate color value can be accurately obtained.

[0117] In one embodiment, the virtual object interaction method further includes:

[0118] When the color value corresponding to the texture coordinate meets the virtual object part interaction condition, the trigger operation for each frame of the virtual scene picture is responded to in sequence, the virtual object interaction part indicated by the trigger operation of the virtual scene picture is obtained, and the virtual object is controlled to perform the feedback action of the virtual object interaction part mapping.

[0119] Among them, the virtual object part interaction condition refers to the condition for entering the virtual object part interaction, which can be configured according to the actual application scenario. For example, the virtual object part interaction condition can specifically be that the color value corresponding to the texture coordinate is greater than the color value threshold, wherein the color value threshold can be configured according to the actual application scenario. For example, the color value threshold can specifically be 0, which means that when the color value corresponding to the texture coordinate is greater than 0, it is determined to enter the virtual object part interaction. It should be noted that since the color values ​​of each part of the virtual object are included in the part partition texture map, and the color values ​​of each part are different, as long as the color values ​​of each part are set to a value other than 0, it can be determined whether to enter the virtual object part interaction by the color value corresponding to the texture coordinate.

[0120] The triggering operation on the virtual scene screen refers to the operation triggered by the interactive object when interacting with the virtual scene screen. For example, the triggering operation on the virtual scene screen may specifically refer to a click operation triggered by the interactive object when interacting with the virtual scene screen. For example, the click operation may be triggered by an input device, which may specifically be a mouse, stylus, etc. For another example, the triggering operation on the virtual scene screen may specifically refer to a touch screen operation triggered by the interactive object when interacting with the virtual scene screen.

[0121] The virtual object interaction part refers to the part selected by the interactive object for interaction. For example, the virtual object interaction part may be eyes, face, ears, body, etc. The feedback action mapped to the virtual object interaction part refers to the interaction action generated by the virtual object in response to the interaction with the virtual object interaction part. For example, the feedback action mapped to the virtual object interaction part may be a posture change action. For example, the posture change action may be the virtual object changing from standing to lying down, sitting, sideways, or lying down. For another example, the feedback action mapped to the virtual object interaction part may be a part change action. For example, when the virtual object interaction part is the head, the feedback action mapped to the head may be shaking the head, lowering the head, etc.

[0122] Specifically, after obtaining the color value corresponding to the texture coordinate, the terminal will determine whether the color value corresponding to the texture coordinate meets the virtual object part interaction condition. If the color value corresponding to the texture coordinate meets the virtual object part interaction condition, it indicates that the virtual object part interaction has begun. At this time, the terminal will identify the virtual object interaction part for each frame of the virtual scene. When identifying the virtual object interaction part for each frame of the virtual scene, the terminal will respond to the trigger operation for each frame of the virtual scene in sequence and obtain the virtual object interaction part indicated by the trigger operation for the virtual scene. If the virtual object interaction part is determined, the terminal will control the virtual object to perform the feedback action of the virtual object interaction part mapping.

[0123] In specific applications, the virtual object interaction parts indicated by the triggering operation of two adjacent frames of virtual scene pictures may be the same or different. In the case where the virtual object interaction parts indicated by the triggering operation of two adjacent frames of virtual scene pictures are different, the terminal will not directly use the virtual object interaction part indicated by the triggering operation of the latter frame of virtual scene picture as the new interaction part. It is necessary to judge whether there is an erroneous operation. Only when the virtual object interaction parts identified within the pre-configured time period are all the virtual object interaction parts indicated by the triggering operation of the latter frame of virtual scene picture, will it be confirmed that the virtual object interaction part indicated by the triggering operation of the latter frame of virtual scene picture is used as the new interaction part. Among them, the pre-configured time period can be configured according to the actual application scenario. For example, the pre-configured time period can be specifically 0.3 seconds.

[0124] In a specific application, assuming that the virtual object interaction part indicated by the trigger operation of the first frame of the virtual scene picture is the head, and the virtual object interaction part indicated by the trigger operation of the second frame of the virtual scene picture is the body, the terminal will not directly use the body as the new interaction part. It needs to determine whether there is an erroneous operation. It will continue to respond to the trigger operation for the next frame of the virtual scene picture and obtain the virtual object interaction part indicated by the trigger operation of the next frame of the virtual scene picture. When the virtual object interaction parts identified within the preconfigured time period are all the body, the body will be used as the new interaction part.

[0125] In this embodiment, by responding to the trigger operation for each frame of the virtual scene picture in turn, the virtual object interaction part indicated by the trigger operation of the virtual scene picture can be obtained, thereby controlling the virtual object to perform the feedback action of the virtual object interaction part mapping to achieve interactive feedback.

[0126] In one embodiment, in response to the trigger operation on each frame of the virtual scene image, obtaining the virtual object interaction part indicated by the trigger operation on the virtual scene image includes:

[0127] In response to the trigger operation for each frame of the virtual scene image, color value recognition is performed based on the trigger position indicated by the trigger operation of the virtual scene image, and the color value of the interaction part corresponding to the trigger position indicated by the trigger operation of the virtual scene image is obtained;

[0128] According to the color value of the interaction part, the interaction part of the virtual object indicated by the triggering operation of the virtual scene picture is obtained from the corresponding relationship between the part and the color value.

[0129] Specifically, in response to the trigger operation of each frame of the virtual scene picture in turn, the terminal will determine the trigger position indicated by the trigger operation of the virtual scene picture, convert the trigger position indicated by the trigger operation into corresponding texture coordinates, and render the new color texture map corresponding to the virtual scene picture to the preconfigured screen rendering texture map to obtain a new screen rendering texture map, and perform color value recognition on the new screen rendering texture map according to the texture coordinates corresponding to the trigger position to obtain the color value of the interaction part corresponding to the trigger position indicated by the trigger operation of the virtual scene picture. According to the color value of the interaction part, the virtual object interaction part indicated by the trigger operation of the virtual scene picture is obtained from the correspondence between the preconfigured part and the color value.

[0130] In a specific application, the terminal will map the texture coordinates corresponding to the trigger position to the corresponding pixel coordinates on the new screen rendering texture map according to the size of the new screen rendering texture map, and use the pixel value at the mapped corresponding pixel coordinate as the texture color value of the texture coordinate corresponding to the trigger position, and then determine the color value of the interactive part corresponding to the trigger position indicated by the trigger operation of the virtual scene screen based on the texture color value of the texture coordinate corresponding to the trigger position.

[0131] In a specific application, when mapping the texture coordinates corresponding to the trigger position to the corresponding pixel coordinates on the new screen rendering texture map, it is not necessarily possible to obtain pixel coordinates on the new screen rendering texture map that completely correspond to the texture coordinates corresponding to the trigger position. At this time, some strategies need to be adopted so that texture sampling can proceed sequentially. The commonly used strategies are nearest point sampling and linear sampling.

[0132] In a specific application, the terminal can directly use the texture color value of the texture coordinate corresponding to the trigger position as the color value of the interactive part corresponding to the trigger position indicated by the trigger operation of the virtual scene screen. In a specific application, the terminal will obtain the color value selection range corresponding to the texture coordinate corresponding to the touch position, and based on the corresponding color value selection range, obtain at least one candidate color value corresponding to the corresponding color value selection range from the new screen rendering texture map, perform color value comparison on the at least one candidate color value and the texture color value of the texture coordinate corresponding to the trigger position, and obtain the color value of the interactive part corresponding to the trigger position indicated by the trigger operation of the virtual scene screen according to the comparison result. Among them, the corresponding color value selection range can be configured according to the actual application scenario.

[0133] In a specific application, the terminal uses the maximum color value among at least one candidate color value and the texture color value of the texture coordinate corresponding to the trigger position as the color value of the interactive part corresponding to the trigger position indicated by the trigger operation of the virtual scene image. In a specific application, the terminal uses the color value that appears most frequently among at least one candidate color value and the texture color value of the texture coordinate corresponding to the trigger position, that is, the color value mode, as the color value of the interactive part corresponding to the trigger position indicated by the trigger operation of the virtual scene image.

[0134] In this embodiment, by performing color value recognition based on the trigger position indicated by the trigger operation of the targeted virtual scene screen, the interaction part color value corresponding to the trigger position indicated by the trigger operation of the targeted virtual scene screen can be obtained, so that the virtual object interaction part indicated by the trigger operation of the targeted virtual scene screen can be obtained from the correspondence between the part and the color value based on the interaction part color value, and the interaction part color value is used to realize accurate determination of the virtual object interaction part.

[0135] In one embodiment, the virtual object interaction method further includes:

[0136] Obtaining a real-time posture of the virtual object, and determining a feedback action for mapping the part corresponding to the color value corresponding to the texture coordinate based on the real-time posture and the part corresponding to the color value corresponding to the texture coordinate;

[0137] The virtual object is controlled to perform a feedback action of mapping the color value corresponding to the texture coordinate to the corresponding part.

[0138] The real-time posture refers to the posture of the virtual object when the color value corresponding to the texture coordinate is determined. For example, the real-time posture can be one of standing, squatting, lying, sideways, and flipping. For example, when the virtual object is a virtual cat, the possible real-time postures can be as follows: Figure 6 As shown, including standing, squatting, lying down and sideways.

[0139] Specifically, for the same part, when the posture of the virtual object is different, the feedback action mapped to it may be different. Therefore, when the part corresponding to the color value corresponding to the texture coordinate is determined, the terminal will obtain the real-time posture of the virtual object, and based on the real-time posture and the part corresponding to the color value corresponding to the texture coordinate, determine the feedback action mapped to the part corresponding to the color value corresponding to the texture coordinate, and control the virtual object to perform the feedback action mapped to the part corresponding to the color value corresponding to the texture coordinate. The mapping relationship between posture-part-feedback action can be configured according to the actual application scenario. For example, when the real-time posture is standing and the part is the head, the feedback action can be squatting. For another example, when the real-time posture is squatting and the part is the head, the feedback action can be lying down.

[0140] In this embodiment, by obtaining the real-time posture of the virtual object, the real-time posture and the part corresponding to the color value corresponding to the texture coordinate can be combined to determine the feedback action of mapping the part corresponding to the color value corresponding to the texture coordinate, so that the virtual object can be controlled to execute the feedback action of mapping the part corresponding to the color value corresponding to the texture coordinate, thereby realizing interactive feedback.

[0141] In one embodiment, the virtual object interaction method further includes:

[0142] When the color value corresponding to the texture coordinates meets the virtual scene lens switching condition, the interaction mode corresponding to the color value corresponding to the texture coordinates is determined to be the virtual scene lens switching interaction, and the virtual scene lens switching operation of the interaction triggering position mapping is performed.

[0143] The virtual scene shot cut condition refers to the conditions for entering a virtual scene shot cut, and can be configured based on the actual application scenario. For example, the virtual scene shot cut condition can specifically be that the color value corresponding to the texture coordinate is equal to the color value threshold. The color value threshold can be configured based on the actual application scenario. For example, the color value threshold can specifically be 0, indicating that the virtual scene shot cut is determined to have occurred when the color value corresponding to the texture coordinate is 0.

[0144] The lens is a tool for viewing a virtual scene. It captures a portion of the virtual scene and displays it on the terminal. For example, in a game, the game screen is captured by capturing a portion of the virtual scene through the lens. Interactive users can control the movement of the lens to view different areas of the virtual scene. A virtual scene lens switch operation refers to a change in the lens' direction in response to a virtual scene lens switch interaction. By changing the lens' direction, the interactive user can view different areas of the virtual scene.

[0145] Specifically, after obtaining the color value corresponding to the texture coordinate, the terminal determines whether the color value corresponding to the texture coordinate satisfies the virtual scene lens switching condition. If the color value corresponding to the texture coordinate satisfies the virtual scene lens switching condition, the virtual scene lens switching operation is initiated. At this time, the terminal executes the virtual scene lens switching operation mapped to the interaction trigger position according to the mapping relationship between the interaction trigger position and the virtual scene lens switching direction. In specific applications, the mapping relationship between the interaction trigger position and the virtual scene lens switching direction can be configured according to the actual application scenario. Through this configuration, a 360° rotation lens can be achieved.

[0146] In this embodiment, when the color value corresponding to the texture coordinate meets the virtual scene lens switching condition, the interaction mode corresponding to the color value corresponding to the texture coordinate is determined to be the virtual scene lens switching interaction, and the virtual scene lens switching operation of the interaction trigger position mapping is executed, so that interactive feedback on the virtual scene lens switching can be achieved.

[0147] In one embodiment, the virtual object includes at least one mesh; rendering the virtual object based on the part partition texture map to obtain a color texture map includes:

[0148] According to a preconfigured mapping relationship between at least one mesh and the part partition texture map, the part partition texture map is set to a rendering material corresponding to the at least one mesh;

[0149] Render the virtual object based on the rendering material to obtain a color texture map.

[0150] Among them, the virtual object includes multiple parts, each part has a corresponding mesh, so the virtual object includes at least one mesh. The mesh includes at least a set of vertices (these vertices are some coordinates in three-dimensional space) and a set of triangles connecting these points (the most basic 2D shape). These triangles together constitute the surface shape represented by any mesh. For example, the mesh can be a skeletal mesh, which contains several vertices, each vertex is assigned a corresponding bone point weight, and is a mesh body whose vertex movement is driven by the bone point. Rendering material is information that describes the surface appearance of a virtual object, including appearance, color, texture, smoothness, transparency, etc. Its essence is an instance of a shader.

[0151] Specifically, by adjusting the rendering material corresponding to at least one mesh, the representation of the at least one mesh can be changed, thereby changing the virtual object and rendering the virtual object. Therefore, when rendering a virtual object based on a part-partitioned texture map, the terminal can assign the part-partitioned texture map to the rendering material corresponding to the at least one mesh according to a preconfigured mapping relationship between the at least one mesh and the part-partitioned texture map. The terminal then renders the virtual object based on the rendering material to obtain a color texture map.

[0152] In specific applications, a part-partitioned texture map can be used to represent the basic color of a rendered material. Part-partitioned texture maps have only two dimensions: length and width. However, a virtual object consisting of at least one mesh is often a three-dimensional object. When projecting the part-partitioned texture map onto triangles within the at least one mesh, two-dimensional texture coordinates must be added to the vertices within the at least one mesh, essentially establishing a mapping relationship between the at least one mesh and the part-partitioned texture map. In a specific application, the mapping relationship between the at least one mesh and the part-partitioned texture map can be configured based on the actual application scenario.

[0153] In a specific application, when the virtual object is a virtual cat, at least one grid includes grids corresponding to six parts respectively: eyes, ears, face, front paws, body and tail, and the part partitioned texture map also includes partial maps corresponding to the six parts respectively: eyes, ears, face, front paws, body and tail. The mapping relationship established between the at least one grid and the part partitioned texture map refers to the mapping relationship between the grids and partial maps corresponding to the six parts respectively: eyes, ears, face, front paws, body and tail.

[0154] In this embodiment, by setting the part partition texture map to the rendering material corresponding to at least one grid according to the pre-configured mapping relationship between at least one grid and the part partition texture map, the rendering material can be used to render the virtual object and obtain a color texture map.

[0155] In one embodiment, the virtual object interaction method further includes:

[0156] Establish the coordinate mapping relationship between the screen coordinate system and the texture coordinate system;

[0157] In response to the interaction triggering operation, converting the interaction triggering position indicated by the interaction triggering operation into texture coordinates includes:

[0158] In response to the interaction triggering operation, determining an interaction triggering position indicated by the interaction triggering operation;

[0159] Based on the coordinate mapping relationship, the interaction trigger position is converted into texture coordinates.

[0160] Among them, the screen coordinate system is a two-dimensional coordinate system established on the screen, which can be based on pixels. The origin of the screen coordinate system can be the upper left corner of the screen or the lower left corner of the screen. For example, when the origin of the screen coordinate system is the lower left corner of the screen, the coordinates of the lower left corner are (0,0) and the coordinates of the upper right corner are (X, Y), where X is the screen width and Y is the screen height. The texture coordinate system is a two-dimensional coordinate system established on the image, consisting of the U axis representing the horizontal direction of the image and the V axis representing the vertical direction of the image. The texture coordinates in the texture coordinate system are the mapping relationship between the texture and the image. The texture coordinates in the texture coordinate system can start from the upper left corner or the upper left corner. For example, when the texture coordinates in the texture coordinate system start from the lower left corner, the coordinates of the lower left corner are (0,0) and the coordinates of the upper right corner are (1,1).

[0161] Specifically, the terminal will establish a coordinate mapping relationship between the screen coordinate system and the texture coordinate system, corresponding the origin of the screen coordinate system to the starting point (0,0) in the texture coordinate system, and corresponding the coordinate point with coordinates (X, Y) in the screen coordinate system to the coordinate point (1,1) in the texture coordinate system, where X is the screen width and Y is the screen height.

[0162] Specifically, in response to the interaction trigger operation, the terminal can determine the interaction trigger position indicated by the interaction trigger operation, and thus can determine the texture coordinates mapped by the interaction trigger position based on the coordinate mapping relationship, and convert the interaction trigger position into texture coordinates. In a specific application, the way to determine the texture coordinates mapped by the interaction trigger position is to calculate the coordinate ratios of the coordinates (M, N) of the interaction trigger position and the coordinates (X, Y) in the screen coordinate system in the X-axis direction and the Y-axis direction, respectively, and use the coordinate ratio in the X-axis direction as the coordinate in the U-axis direction of the texture coordinates, and use the coordinate ratio in the Y-axis direction as the coordinate in the V-axis direction of the texture coordinates, that is, the texture coordinates corresponding to the interaction trigger position are (M / X, N / Y). In a specific application, assuming that the interaction trigger position is the center of the screen, the texture coordinates corresponding to the interaction trigger position can be obtained as (0.5, 0.5).

[0163] In this embodiment, a coordinate mapping relationship is established between the screen coordinate system and the texture coordinate system. In response to the interaction trigger operation, the interaction trigger position indicated by the interaction trigger operation is determined. The coordinate mapping relationship can be used to achieve the correct transformation of the interaction trigger position and obtain accurate texture coordinates.

[0164] In one embodiment, the virtual object interaction method of the present application is described by applying it to virtual pet interaction.

[0165] The inventor believes that the common practice for 3D action game character collisions is to bind multiple capsules to different bones. This method can roughly achieve part partitioning and can move with animation. However, the disadvantage is that it is not precise enough, especially for parts such as the tail of a virtual pet. In addition, usually the various parts of a virtual pet can be sculpted according to the needs of the interactive object, that is, the size of each part is not fixed, and it is not easy to dynamically generate a capsule of a suitable shape based on the sculpted mesh. In addition, there is a fine mesh collider that involves real-time and accurate automatic generation logic of skeleton skinning animation collision. Its main feature is that it has a skeleton-based mesh collider that can change accordingly with the animation. The principle is that after the skinning is completed on the graphics processor side, the information is transmitted back to the central processing unit for testing and updating the collision data, which has the problem of high CPU consumption.

[0166] Based on this, in order to improve the accuracy of interaction and reduce the consumption of the central processing unit, the present application proposes a virtual object interaction method, namely a solution for virtual pet partition identification, which can be applied to the partition interaction of pets in games (such as the partition interaction of pet cats). The overall concept of the solution is to partition the virtual pet with a partition texture map, assign different color values ​​to different parts, obtain the rendered screen rendering texture map after skinning, and then obtain the interaction trigger position indicated by the interaction trigger operation to determine the part.

[0167] In one embodiment, Figure 7 As shown, taking the application of virtual pet interaction based on Unity as an example, the virtual object interaction method in this application specifically includes the following steps:

[0168] Before entering the interactive scene for the displayed virtual object, the terminal will pre-add a new partition shader to the pet shader. The partition shader is used to render the virtual object with a partition texture (i.e., the texture for rendering the virtual object). At the same time, the terminal will prepare two tables, one is the mapping of the grid to the part partition texture map (Table 1), that is, pre-configuring the mapping relationship between at least one grid and the part partition texture map, and the other is the correspondence between the part and the color value (Table 2), that is, pre-configuring the correspondence between the part and the color value.

[0169] When entering an interactive scene for a displayed virtual object, the terminal sets the partition map for the skeletal animation according to Table 1. Specifically, it obtains the corresponding partition texture map for the virtual object's parts, sets the partition map for at least one mesh of the virtual object based on a preconfigured mapping relationship between at least one mesh and the partition texture map, and then applies the partition texture map to the corresponding rendering material of the at least one mesh to obtain a texture for rendering the virtual object. The virtual object is then rendered based on the texture of the rendered virtual object to obtain a color texture map. After rendering is complete, the terminal begins monitoring for interactive triggering operations.

[0170] When an interaction trigger operation is detected, the central processing unit in the terminal responds to the interaction trigger operation by converting the interaction trigger position indicated by the interaction trigger operation into texture coordinates and transmitting them to the graphics processor. The graphics processor uses a partition shader to render the virtual object's skeletal animation (i.e., color rendering map) to a preconfigured render texture (i.e., screen render texture map) through a rendering interface (specifically, Camere.AddCommandBuffer). The graphics processor performs color value recognition on the screen render texture map based on the texture coordinates to obtain the color value corresponding to the texture coordinate. The color value corresponding to the texture coordinate is rendered to the render texture (RenderTexture) of a pixel. The central processing unit reads back the render texture of the pixel in the next frame, parses it, obtains the color value corresponding to the texture coordinate, queries Table 2 (i.e., the correspondence between preconfigured parts and color values), determines the part corresponding to the color value corresponding to the texture coordinate, and performs interaction processing based on the part corresponding to the color value corresponding to the texture coordinate, i.e., obtains the real-time posture of the virtual object. Based on the real-time posture and the part corresponding to the color value corresponding to the texture coordinate, the graphics processor determines a feedback action for mapping the part corresponding to the color value corresponding to the texture coordinate, and controls the virtual object to execute the feedback action for mapping the part corresponding to the color value corresponding to the texture coordinate. Among them, the part partition texture map only needs to use one channel to store information, and the recognition rate does not need to be so fine. The screen rendering texture map used can be a quarter of the screen size, which can reduce memory consumption.

[0171] In one embodiment, if the color value corresponding to the texture coordinate can be determined from the pre-configured correspondence between the part and the color value, indicating that the color value corresponding to the texture coordinate meets the virtual object part interaction condition, the terminal will continue to monitor the interaction trigger operation, respond to the trigger operation for each frame of the virtual scene image in sequence, perform color value recognition based on the trigger position indicated by the trigger operation of the virtual scene image, obtain the color value of the interaction part corresponding to the trigger position indicated by the trigger operation of the virtual scene image, and obtain the virtual object interaction part indicated by the trigger operation of the virtual scene image based on the color value of the interaction part from the correspondence between the part and the color value, and control the virtual object to perform the feedback action of the virtual object interaction part mapping. When exiting the interactive scene for the displayed virtual object, the partition texture and the render texture (RenderTexture) are released.

[0172] In one embodiment, after obtaining the color value corresponding to the texture coordinate, if the color value corresponding to the texture coordinate meets the virtual scene lens switching condition, it means that the interaction method corresponding to the color value corresponding to the texture coordinate is a virtual scene lens switching interaction, rather than a virtual object part interaction, and the terminal will execute the virtual scene lens switching operation of the interaction trigger position mapping.

[0173] In one embodiment, the terminal is preconfigured with a color value threshold. Based on the magnitude relationship between the color value threshold and the color value corresponding to the texture coordinate, it can determine whether the color value corresponding to the texture coordinate satisfies the virtual object part interaction condition or the virtual scene shot switching condition. When the color value corresponding to the texture coordinate is greater than the color value threshold, it indicates that the color value corresponding to the texture coordinate satisfies the virtual object part interaction condition. When the color value corresponding to the texture coordinate is equal to the color value threshold, it indicates that the color value corresponding to the texture coordinate satisfies the virtual scene shot switching condition. The color value threshold can be configured according to the actual application scenario. For example, the color value threshold can be specifically set to 0, indicating that only the corresponding color value exists for each part of the virtual object.

[0174] In one embodiment, Figure 8 As shown, assuming that the virtual object is a virtual cat, if the interaction triggering position indicated by the interaction triggering operation is the area where the virtual cat is located ( Figure 8 As shown in FIG802, the area where the virtual cat's head is located is shown in FIG803. Since the color value of the area where the head is located is configured in the part partition texture map, it can be determined that the color value of the texture coordinates corresponding to the area where the head is located is not 0, which satisfies the virtual object part interaction condition. If the interaction trigger position is not the area where the virtual cat is located ( Figure 8 As shown in FIG, the background area 804 is located. Since no color value is configured for the background area, it can be determined that the color value of the texture coordinates corresponding to the background area is 0, which meets the virtual scene lens switching condition.

[0175] In one embodiment, Figure 9 As shown, in response to the interaction trigger operation, the central processing unit will convert the interaction trigger position indicated by the interaction trigger operation into texture coordinates and transmit them to the graphics processor. The graphics processor uses a partition shader to render the skeletal animation of the virtual object (i.e., the color rendering map) to a preconfigured rendering texture (RenderTexture) (i.e., the screen rendering texture map) through the rendering interface, and performs texture sampling on the screen rendering texture map according to the texture coordinates. The maximum color value around the texture coordinates is taken, and the maximum color value is saved to the rendering texture of a pixel, i.e., the rendering texture of the pixel, to achieve an expansion effect (i.e., the maximum color value around the texture coordinates is taken to achieve the expansion effect). The central processing unit then reads back the rendering texture of a pixel and obtains the corresponding color value of the texture coordinate through analysis, which can reduce memory consumption.

[0176] The virtual object interaction method provided in this application implements the virtual object partition recognition function with minimal performance consumption. Due to the low performance consumption, the partition recognition function can be achieved in each frame. For example, the interaction position can be switched during sliding interaction. Moreover, this virtual object interaction method has no restrictions on the state of the virtual object. The virtual object can be in any orientation and can also be in motion. Even after the virtual object is squeezed into various shapes, the location can still be accurately identified, which can improve the accuracy of interaction.

[0177] In one embodiment, the virtual object interaction method of the present application is explained by taking the selection of interactive objects in a virtual scene as an example, wherein the virtual objects are all interactive objects that can be selected in the virtual scene, the part partition texture map is a different area partition texture map including the area texture map corresponding to each interactive object, and the preconfigured correspondence between the parts and the color values ​​refers to the correspondence between the area corresponding to each interactive object and the color value.

[0178] Specifically, the terminal will obtain the different area partition texture maps corresponding to all interactive objects that can be selected in the virtual scene, and render all interactive objects that can be selected in the virtual scene based on the different area partition texture maps to obtain a color texture map. The different area partition texture maps include the color values ​​of the corresponding areas of each interactive object, and the color values ​​of the corresponding areas of each interactive object are different. In response to the interaction trigger operation (i.e., the operation of selecting an interactive object), the terminal will convert the interaction trigger position indicated by the interaction trigger operation into texture coordinates, and render the color texture map to a preconfigured screen rendering texture map. According to the texture coordinates, color value recognition is performed on the screen rendering texture map to obtain the color value corresponding to the texture coordinates. According to the color value corresponding to the texture coordinates, the area corresponding to the color value corresponding to the texture coordinates is determined from the preconfigured correspondence between the area corresponding to each interactive object and the color value. In this way, the selected interactive object can be identified.

[0179] In one embodiment, the virtual object interaction method in the present application is explained by taking the application to map interaction as an example, wherein the virtual object is an electronic map, and the part partition texture map is the partition texture map of different areas in the electronic map. The different areas here can be divided according to administrative areas or according to actual application scenarios. The correspondence between the pre-configured parts and color values ​​refers to the correspondence between areas and color values.

[0180] Specifically, the terminal obtains texture maps corresponding to different regions of the electronic map and renders the electronic map based on the texture maps to obtain a color texture map. The texture maps include color values ​​for each region of the electronic map, and the color values ​​for each region are different. In response to an interactive trigger operation (i.e., an operation to select a region in the electronic map), the terminal converts the interactive trigger position indicated by the interactive trigger operation into texture coordinates and renders the color texture map to a preconfigured screen rendering texture map. Color values ​​are identified on the screen rendering texture map based on the texture coordinates to obtain the color values ​​corresponding to the texture coordinates. Based on the color values ​​corresponding to the texture coordinates, the terminal determines the region corresponding to the color value corresponding to the texture coordinates from the preconfigured correspondence between regions and color values. In this way, the selected region in the electronic map can be accurately identified.

[0181] The virtual object interaction method provided in the embodiment of the present application can be applied to Figure 10 In the application environment shown. Among them, a client for realizing virtual object interaction is installed on the terminal 1002. The client can be an application, a web client, or a sub-application running in the running environment of the parent application. The terminal 1002 displays the virtual object obtained by the original model through the shaping operation. The virtual object retains the parts of the original model. In response to the interactive trigger operation for the virtual object, the interactive trigger position of the interactive trigger operation is displayed. When the interactive trigger position belongs to any part of the virtual object, the feedback action mapped to the part where the interactive trigger position is located is displayed. Figure 10 The feedback action shown in the figure is lying down. The terminal 1002 may be, but is not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices may include smart speakers, smart TVs, smart air conditioners, and smart car devices. Portable wearable devices may include smart watches, smart bracelets, and head-mounted devices.

[0182] In one embodiment, Figure 11 As shown, a virtual object interaction method is provided, which can be executed by a terminal or a server alone, or by a terminal and a server in collaboration. In the embodiment of the present application, the method is applied to a terminal as an example for explanation, and includes the following steps:

[0183] Step 1102: Display a virtual object obtained by shaping the original model; the virtual object retains the parts of the original model.

[0184] The original model refers to a model that has not been sculpted. The virtual object refers to an active object obtained by sculpting the original model in the virtual environment. The active object can be a virtual character, virtual animal, etc. For example, the original model can be an animal model that has not been sculpted, and the virtual object is a virtual animal obtained by sculpting the original model. For example, the original model can be a cat model that has not been sculpted, and the virtual object is a cat obtained by sculpting the original model. To further illustrate, Figure 12 As shown, by performing a shaping operation on a cat model that has not been sculpted, virtual cats of various body shapes can be obtained.

[0185] Specifically, the terminal will display the virtual object obtained by the kneading operation of the original model, and the virtual object retains the parts of the original model. In a specific application, the original model includes multiple parts, and the sizes of the multiple parts can be changed through the kneading operation, such as Figure 12As shown, different virtual cats have different body shapes, which actually means that the sizes of different cat parts are not exactly the same, but different virtual cats all have six parts: eyes, ears, face, front paws, body and tail. In a specific application, while displaying the virtual object obtained by the original model through the shaping operation, the terminal will also display the virtual background corresponding to the virtual object. The virtual background can be configured according to the actual application scenario. In a specific application, when the virtual object is a virtual cat, such as Figure 13 As shown, the terminal displays the virtual cat obtained by the kneading operation and also displays the virtual background corresponding to the virtual cat (i.e. Figure 13 Other areas besides the virtual cat).

[0186] Step 1104 : In response to an interaction triggering operation on the virtual object, display an interaction triggering position of the interaction triggering operation.

[0187] Among them, the interaction triggering operation refers to the operation triggered by the interactive object when interacting. For example, the interaction triggering operation may specifically refer to a click operation triggered by the interactive object when interacting. For example, the interaction triggering operation may specifically refer to a click operation triggered by the interactive object through an input device when interacting, and the input device may specifically be a mouse, a stylus, etc. For another example, the interaction triggering operation may specifically refer to a touch screen operation triggered by the interactive object when interacting. The interaction triggering position refers to the position when the interaction triggering operation is triggered. For example, when the interaction triggering operation is a click operation, the interaction triggering position may specifically refer to the clicked position. For another example, when the interaction triggering operation is a touch screen operation, the interaction triggering position may specifically refer to the touched screen position.

[0188] Specifically, when displaying a virtual object created through sculpting of an original model, if an interactive scene for the displayed virtual object is entered, the terminal will obtain the corresponding part-partition texture map of the virtual object, render the virtual object based on the part-partition texture map, obtain a color texture map, and wait for a response to an interactive trigger operation for the virtual object. If the interactive object wishes to interact, it will initiate an interactive trigger operation. In response to the interactive trigger operation, the terminal will display the interaction trigger position of the interaction trigger operation, so that the interactive object can intuitively understand the interaction trigger position they have selected.

[0189] In a specific application, the interactive trigger operation may be a sliding trigger operation, and the terminal will display the sliding trigger position of the sliding trigger operation. In a specific application, the virtual object may be a virtual cat, such as Figure 14As shown, when the sliding trigger operation is a sliding operation on the body of the virtual cat, the terminal will display the corresponding sliding trigger position in the area where the virtual cat's body is located. When the sliding trigger operation is a sliding operation on the area where the virtual cat's head is located, the terminal will display the sliding trigger position in the area where the virtual cat's head is located.

[0190] Step 1106 : When the interaction triggering position belongs to any part of the virtual object, the virtual object is displayed to perform a feedback action mapped to the part where the interaction triggering position is located.

[0191] Among them, the part where the interaction trigger position is located refers to the part selected by the interactive object for interaction. For example, the part where the interaction trigger position is located can be specifically the eyes, face, ears, body, etc. The feedback action mapped to the part where the interaction trigger position is located refers to the interactive action generated by the virtual object in response to the interaction with the part where the interaction trigger position is located. For example, the feedback action mapped to the part where the interaction trigger position is located can be specifically a posture change action. For example, the posture change action can be specifically the virtual object changing from standing to lying, sitting, sideways, lying, etc. For another example, the feedback action mapped to the part where the interaction trigger position is located can be specifically a part change action. For example, when the part where the interaction trigger position is located is the head, the feedback action mapped to the head can be specifically shaking the head, lowering the head, etc.

[0192] Specifically, when the interaction trigger location is located at any part of the virtual object, the terminal displays the virtual object performing a feedback action mapped to the part where the interaction trigger location is located. In specific applications, once the interaction trigger location is determined, the terminal converts the interaction trigger location into texture coordinates and renders a color texture map onto a preconfigured screen-rendered texture map. Color value recognition is performed on the screen-rendered texture map based on the texture coordinates to obtain the color values ​​corresponding to the texture coordinates. Based on the color values ​​corresponding to the texture coordinates, the part where the interaction trigger location is located is determined from the preconfigured part-color value correspondence. When the interaction trigger location is located at any part of the virtual object, the terminal displays the virtual object performing a feedback action mapped to the part where the interaction trigger location is located. In specific applications, when the interaction trigger location is located at any part of the virtual object, the terminal obtains the real-time posture of the virtual object, determines the feedback action mapped to the part where the interaction trigger location is located based on the real-time posture and the part where the interaction trigger location is located, and displays the virtual object performing the feedback action mapped to the part where the interaction trigger location is located. The mapping relationship between posture, part, and feedback action can be configured according to the actual application scenario. For example, if the real-time posture is standing and the part is the head, the feedback action can be squatting. For example, when the real-time posture is squatting and the body part is the head, the feedback action can be lying down.

[0193] The above-mentioned virtual object interaction method, by displaying the virtual object obtained by the shaping operation of the original model, responds to the interaction trigger operation on the virtual object and displays the interaction trigger position of the interaction trigger operation, thereby realizing intuitive feedback on the interaction trigger operation. Furthermore, when the interaction trigger position belongs to any part of the virtual object, the feedback action mapped to the part where the interaction trigger position is located of the virtual object can be displayed, thereby realizing accurate feedback on the interaction trigger operation and improving the interaction accuracy.

[0194] In one embodiment, the virtual object interaction method further includes:

[0195] When entering an interactive scene for a displayed virtual object, the steps of the above-mentioned virtual object interaction method are executed; the interaction trigger position belongs to the position determined in the above-mentioned virtual object interaction method.

[0196] Specifically, when displaying a virtual object obtained by sculpting the original model, when entering an interactive scene for the displayed virtual object, the terminal will obtain the corresponding part partition texture map of the virtual object, render the virtual object based on the part partition texture map, obtain a color texture map, and wait for a response to an interactive trigger operation for the virtual object. If the interactive object wants to interact, it will initiate an interactive trigger operation. In response to the interactive trigger operation, the terminal will display the interactive trigger position of the interactive trigger operation, convert the interactive trigger position into texture coordinates, and render the color texture map to a pre-configured screen rendering texture map. Color value recognition is performed on the screen rendering texture map based on the texture coordinates to obtain the color value corresponding to the texture coordinates. Based on the color value corresponding to the texture coordinates, the location of the interactive trigger position is determined from the pre-configured correspondence between the part and the color value.

[0197] In a specific application, the terminal will perform texture sampling on the screen rendering texture map according to the texture coordinates, obtain the texture color value corresponding to the texture coordinates, and obtain the color value selection range corresponding to the texture coordinates. The color value selection range includes at least one pixel position adjacent to the pixel coordinate position mapped by the texture coordinates. For each pixel position in the at least one pixel position, the pixel value at the targeted pixel position on the screen rendering texture map is used as a candidate color value, and the maximum color value among the at least one candidate color value and the texture color value is used as the color value corresponding to the texture coordinate.

[0198] In this embodiment, when entering an interactive scene for a displayed virtual object, the location of the interaction trigger position can be accurately determined by executing the steps of the above-mentioned virtual object interaction method, thereby improving the interaction accuracy.

[0199] In one embodiment, the virtual object interaction method further includes:

[0200] displaying a virtual object interaction portal for the displayed virtual object;

[0201] In response to a triggering operation on a virtual object interaction entrance, an interaction scene for the displayed virtual object is entered.

[0202] Specifically, when displaying a virtual object obtained by a shaping operation of the original model, the terminal will display a virtual object interaction entrance for the displayed virtual object. The virtual object interaction entrance is used to instruct the interactive object to interact with the virtual object. In response to a triggering operation on the virtual object interaction entrance, an interactive scene for the displayed virtual object will be entered.

[0203] In specific applications, the trigger operation may be a click, press, touch, or other operation. In a specific application, the terminal may sense a pressure signal applied by an interactive object to the terminal screen through a pressure sensor. When the pressure sensor senses the pressure signal, it determines the screen coordinates of the pressure point pointed to by the pressure signal. If the screen coordinates of the pressure point are within the display area corresponding to the virtual object interaction entrance on the terminal screen, it is determined that a trigger operation for the virtual object interaction entrance has been detected.

[0204] In a specific application, the trigger operation can be a voice command. When the terminal receives a voice command input by the interactive object at the virtual object interaction entrance of the displayed virtual object, it performs voice recognition on the voice command to obtain a recognized text. If the recognized text includes expressions related to the virtual object interaction, it is determined that a trigger operation for the virtual object interaction entrance is monitored.

[0205] In this embodiment, by displaying a virtual object interaction entrance for the displayed virtual object, it is possible to indicate interaction with the virtual object. By responding to a trigger operation for the virtual object interaction entrance, it is possible to enter an interaction scene for the displayed virtual object so that the interactive object can start interacting with the virtual object, thereby improving the accuracy of the interaction.

[0206] In one embodiment, the virtual object interaction method of the present application is described by applying it to virtual pet interaction. Figure 15 As shown, the virtual pet may specifically be a virtual cat.

[0207] The terminal displays the virtual cat obtained by the original model through the shaping operation (such as Figure 15 Assume that the real-time posture of the cat is squatting), and display the virtual object interaction entrance for the displayed virtual cat, respond to the trigger operation for the virtual object interaction entrance, enter the interaction scene for the displayed virtual cat, respond to the interaction trigger operation for the virtual cat, display the interaction trigger position of the interaction trigger operation, when the interaction trigger position belongs to any part of the virtual cat (such as Figure 15As shown, assuming it is a virtual cat's head), the virtual cat is shown to perform feedback actions mapped to the part where the interaction trigger position is located (such as Figure 15 As shown, it is assumed that the feedback action of the head mapping is lying down).

[0208] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0209] Based on the same inventive concept, embodiments of the present application also provide a virtual object interaction device for implementing the aforementioned virtual object interaction method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more virtual object interaction device embodiments provided below can be found in the above-described limitations of the virtual object interaction method and will not be further elaborated here.

[0210] In one embodiment, Figure 16 As shown, a virtual object interaction device is provided, including: a map rendering module 1602, a texture map rendering module 1604, a color value recognition module 1606 and a part recognition module 1608, wherein:

[0211] The texture rendering module 1602 is used to obtain a part-partition texture map corresponding to the virtual object, and render the virtual object based on the part-partition texture map to obtain a color texture map; the part-partition texture map includes the color value of each part of the virtual object, and the color value of each part is different;

[0212] The texture map rendering module 1604 is configured to convert the interaction trigger position indicated by the interaction trigger operation into texture coordinates in response to the interaction trigger operation, and render the color texture map to a preconfigured screen rendering texture map;

[0213] Color value recognition module 1606, for performing color value recognition on the screen rendering texture map according to the texture coordinates to obtain the color value corresponding to the texture coordinates;

[0214] The part identification module 1608 is configured to determine the part corresponding to the color value corresponding to the texture coordinate from the pre-configured correspondence between the part and the color value according to the color value corresponding to the texture coordinate.

[0215] The above-mentioned virtual object interaction device uses a part-partitioned texture map to partition the virtual object, and assigns different color values ​​to different parts of the virtual object. By obtaining the part-partitioned texture map corresponding to the virtual object and rendering the virtual object based on the part-partitioned texture map, a color texture map with different color values ​​for different parts can be obtained. Therefore, in response to the interaction trigger operation, the interaction trigger position indicated by the interaction trigger operation is converted into texture coordinates, and the color texture map is rendered to a preconfigured screen rendering texture map. The texture coordinates are used to perform color value recognition on the screen rendering texture map with different color values ​​for different parts to obtain the color values ​​corresponding to the texture coordinates. Therefore, according to the color values ​​corresponding to the texture coordinates, the part corresponding to the color value corresponding to the texture coordinate can be determined from the correspondence between the preconfigured part and the color value. The whole process can improve the recognition accuracy of the interaction part by using the color value partitioning to identify the part, thereby improving the interaction accuracy.

[0216] In one embodiment, the color value recognition module is further configured to perform texture sampling on a screen rendering texture map according to texture coordinates, obtain texture color values ​​corresponding to the texture coordinates, and determine color values ​​corresponding to the texture coordinates based on the texture color values.

[0217] In one embodiment, the color value recognition module is further configured to use the texture color value as the color value corresponding to the texture coordinate.

[0218] In one embodiment, the color value recognition module is also used to obtain the color value selection range corresponding to the texture coordinates, and based on the color value selection range, obtain at least one candidate color value corresponding to the color value selection range from the screen rendering texture map, perform color value comparison on the at least one candidate color value and the texture color value, and obtain the color value corresponding to the texture coordinates according to the comparison result.

[0219] In one embodiment, the color value selection range includes at least one pixel position adjacent to the pixel coordinate position mapped by the texture coordinate; the color value recognition module is further used to use the pixel value at the targeted pixel position on the screen rendering texture map as a candidate color value for each pixel position in the at least one pixel position.

[0220] In one embodiment, the color value recognition module is further configured to use the maximum color value among the at least one candidate color value and the texture color value as the color value corresponding to the texture coordinate.

[0221] In one embodiment, the virtual object interaction device also includes an interaction identification module, which is used to respond to the trigger operation for each frame of the virtual scene picture in sequence when the color value corresponding to the texture coordinate meets the virtual object part interaction condition, obtain the virtual object interaction part indicated by the trigger operation of the virtual scene picture, and control the virtual object to perform the feedback action of the virtual object interaction part mapping.

[0222] In one embodiment, the interaction identification module is also used to respond to the trigger operation for each frame of the virtual scene picture in sequence, perform color value identification based on the trigger position indicated by the trigger operation of the virtual scene picture, obtain the interaction part color value corresponding to the trigger position indicated by the trigger operation of the virtual scene picture, and according to the interaction part color value, obtain the virtual object interaction part indicated by the trigger operation of the virtual scene picture from the correspondence between the part and the color value.

[0223] In one embodiment, the virtual object interaction device also includes a feedback module, which is used to obtain the real-time posture of the virtual object, determine the feedback action of mapping the part corresponding to the color value corresponding to the texture coordinate based on the real-time posture and the part corresponding to the color value corresponding to the texture coordinate, and control the virtual object to perform the feedback action of mapping the part corresponding to the color value corresponding to the texture coordinate.

[0224] In one embodiment, the virtual object interaction device also includes a lens switching module, which is used to determine that the interaction mode corresponding to the color value corresponding to the texture coordinate is a virtual scene lens switching interaction when the color value corresponding to the texture coordinate meets the virtual scene lens switching condition, and execute the virtual scene lens switching operation of the interaction trigger position mapping.

[0225] In one embodiment, the virtual object includes at least one mesh; the texture rendering module is further used to set the part partition texture map to the rendering material corresponding to the at least one mesh according to the pre-configured mapping relationship between the at least one mesh and the part partition texture map, and render the virtual object based on the rendering material to obtain a color texture map.

[0226] In one embodiment, the texture map rendering module is also used to establish a coordinate mapping relationship between the screen coordinate system and the texture coordinate system, determine the interaction trigger position indicated by the interaction trigger operation in response to the interaction trigger operation, and convert the interaction trigger position into texture coordinates based on the coordinate mapping relationship.

[0227] In one embodiment, Figure 17 As shown, a virtual object interaction device is provided, including: a virtual object display module 1702, a trigger position display module 1704 and a feedback action display module 1706, wherein:

[0228] The virtual object display module 1702 is used to display a virtual object obtained by shaping the original model; the virtual object retains the parts of the original model;

[0229] A trigger position display module 1704 is configured to display an interaction trigger position of the interaction trigger operation in response to the interaction trigger operation on the virtual object;

[0230] The feedback action display module 1706 is configured to display the feedback action of the virtual object mapped to the part where the interaction trigger position is located when the interaction trigger position belongs to any part of the virtual object.

[0231] The above-mentioned virtual object interaction device displays the virtual object obtained by the shaping operation of the original model, and responds to the interaction trigger operation on the virtual object by displaying the interaction trigger position of the interaction trigger operation, thereby realizing intuitive feedback on the interaction trigger operation. Furthermore, when the interaction trigger position belongs to any part of the virtual object, the feedback action of the virtual object executing the mapping of the part where the interaction trigger position is located can be displayed, thereby realizing accurate feedback on the interaction trigger operation and improving the interaction accuracy.

[0232] In one embodiment, when entering an interactive scene for the displayed virtual object, the steps of the above-mentioned virtual object interaction method are executed, and the interaction trigger position belongs to the position determined in the above-mentioned virtual object interaction method.

[0233] In one embodiment, the virtual object interaction device further includes an interaction entrance display module, which is used to display a virtual object interaction entrance for the displayed virtual object, and enter an interaction scene for the displayed virtual object in response to a triggering operation on the virtual object interaction entrance.

[0234] Each module in the aforementioned virtual object interaction device may be implemented in whole or in part through software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a computer device memory in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0235] In one embodiment, a computer device is provided. The computer device can be a terminal or a server. Taking the computer device as a terminal as an example, its internal structure diagram can be as follows: Figure 18As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a virtual object interaction method is implemented. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.

[0236] Those skilled in the art will understand that Figure 18 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0237] In one embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.

[0238] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0239] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0240] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.

[0241] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0242] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A virtual object interaction method, It is characterized in that The method comprises: Obtaining a part partition texture map corresponding to the virtual object, and rendering the virtual object based on the part partition texture map to obtain a color texture map; the part partition texture map includes color values ​​of each part of the virtual object, and the color values ​​of each part are different; In response to an interaction triggering operation, converting an interaction triggering position indicated by the interaction triggering operation into texture coordinates, and rendering the color texture map to a preconfigured screen rendering texture map; Performing color value recognition on the screen rendering texture map according to the texture coordinates to obtain color values ​​corresponding to the texture coordinates; According to the color value corresponding to the texture coordinate, the part corresponding to the color value corresponding to the texture coordinate is determined from the pre-configured correspondence between the part and the color value.

2. The method according to claim 1, It is characterized in that The performing color value recognition on the screen rendering texture map according to the texture coordinates to obtain the color value corresponding to the texture coordinates comprises: Performing texture sampling on the screen rendering texture map according to the texture coordinates to obtain texture color values ​​corresponding to the texture coordinates; A color value corresponding to the texture coordinate is determined based on the texture color value.

3. The method according to claim 2, It is characterized in that Determining the color value corresponding to the texture coordinate based on the texture color value comprises: The texture color value is used as the color value corresponding to the texture coordinate.

4. The method according to claim 2, It is characterized in that Determining the color value corresponding to the texture coordinate based on the texture color value comprises: Obtaining a color value selection range corresponding to the texture coordinates; Based on the color value selection range, obtaining at least one candidate color value corresponding to the color value selection range from the screen rendering texture map; A color value comparison is performed on the at least one candidate color value and the texture color value, and a color value corresponding to the texture coordinate is obtained according to the comparison result.

5. The method according to claim 4, It is characterized in that The color value selection range includes at least one pixel position adjacent to the pixel coordinate position mapped by the texture coordinate; and obtaining at least one candidate color value corresponding to the color value selection range from the screen rendering texture map based on the color value selection range includes: For each pixel position of the at least one pixel position, a pixel value at the pixel position on the screen rendering texture map is used as a candidate color value.

6. The method according to claim 4, It is characterized in that The color value comparison of the at least one candidate color value and the texture color value, and obtaining the color value corresponding to the texture coordinate according to the comparison result comprises: The maximum color value among the at least one candidate color value and the texture color value is used as the color value corresponding to the texture coordinate.

7. The method according to any one of claims 1 to 6, It is characterized in that The method further comprises: When the color value corresponding to the texture coordinate meets the virtual object part interaction condition, the trigger operation for each frame of the virtual scene picture is responded to in sequence, the virtual object interaction part indicated by the trigger operation of the virtual scene picture is obtained, and the virtual object is controlled to perform the feedback action of the virtual object interaction part mapping.

8. The method according to claim 7, It is characterized in that The step of sequentially responding to the trigger operation for each frame of the virtual scene picture to obtain the virtual object interaction part indicated by the trigger operation for the virtual scene picture comprises: In response to the trigger operation for each frame of the virtual scene picture in sequence, color value recognition is performed based on the trigger position indicated by the trigger operation for the virtual scene picture, and the color value of the interaction part corresponding to the trigger position indicated by the trigger operation for the virtual scene picture is obtained; According to the color value of the interaction part, the interaction part of the virtual object indicated by the triggering operation of the virtual scene picture is obtained from the corresponding relationship between the part and the color value.

9. The method according to claim 1, It is characterized in that The method further comprises: Acquire a real-time posture of the virtual object, and determine a feedback action of mapping the part corresponding to the color value corresponding to the texture coordinate based on the real-time posture and the part corresponding to the color value corresponding to the texture coordinate; The virtual object is controlled to perform the feedback action of mapping the part corresponding to the color value corresponding to the texture coordinate.

10. The method according to claim 1, It is characterized in that The method further comprises: When the color value corresponding to the texture coordinates meets the virtual scene lens switching condition, the interaction mode corresponding to the color value corresponding to the texture coordinates is determined to be a virtual scene lens switching interaction, and the virtual scene lens switching operation of the interaction triggering position mapping is performed.

11. The method according to any one of claims 1 to 10, It is characterized in that The virtual object includes at least one grid; and rendering the virtual object based on the part partition texture map to obtain a color texture map includes: According to the preconfigured mapping relationship between the at least one mesh and the part partition texture map, the part partition texture map is set to the rendering material corresponding to the at least one mesh; The virtual object is rendered based on the rendering material to obtain a color texture map.

12. The method according to any one of claims 1 to 10, It is characterized in that The method further comprises: Establish the coordinate mapping relationship between the screen coordinate system and the texture coordinate system; In response to the interaction triggering operation, converting the interaction triggering position indicated by the interaction triggering operation into texture coordinates comprises: In response to an interaction triggering operation, determining an interaction triggering position indicated by the interaction triggering operation; Based on the coordinate mapping relationship, the interaction trigger position is converted into texture coordinates.

13. A virtual object interaction method, It is characterized in that The method comprises: Displaying a virtual object obtained by shaping the original model; the virtual object retains the parts of the original model; In response to an interaction triggering operation on the virtual object, displaying an interaction triggering position of the interaction triggering operation; When the interaction trigger position belongs to any part of the virtual object, the virtual object is displayed to perform a feedback action mapped to the part where the interaction trigger position is located.

14. The method according to claim 13, It is characterized in that The method further comprises: When entering an interactive scene for the displayed virtual object, the steps of the virtual object interaction method as described in any one of claims 1 to 12 are executed; the interaction trigger position belongs to the position determined in the virtual object interaction method as described in any one of claims 1 to 12.

15. The method according to claim 13 or 14, It is characterized in that The method further comprises: displaying a virtual object interaction entrance for the displayed virtual object; In response to a triggering operation on the virtual object interaction entrance, an interaction scene for the displayed virtual object is entered.

16. A virtual object interaction device, It is characterized in that The device comprises: A texture rendering module, used to obtain a part partition texture map corresponding to the virtual object, and render the virtual object based on the part partition texture map to obtain a color texture map; the part partition texture map includes color values ​​of each part of the virtual object, and the color values ​​of each part are different; A texture map rendering module, configured to, in response to an interaction triggering operation, convert an interaction triggering position indicated by the interaction triggering operation into texture coordinates, and render the color texture map to a preconfigured screen rendering texture map; A color value recognition module, used to perform color value recognition on the screen rendering texture map according to the texture coordinates to obtain a color value corresponding to the texture coordinates; The part identification module is used to determine the part corresponding to the color value corresponding to the texture coordinate from the pre-configured correspondence between the part and the color value according to the color value corresponding to the texture coordinate.

17. A virtual object interaction device, It is characterized in that The device comprises: A virtual object display module, used to display a virtual object obtained by shaping the original model; the virtual object retains the parts of the original model; A trigger position display module, configured to display an interaction trigger position of the interaction trigger operation in response to the interaction trigger operation on the virtual object; The feedback action display module is used to display the feedback action mapped to the part where the interaction trigger position is located by the virtual object when the interaction trigger position belongs to any part of the virtual object.

18. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 15 are implemented.

19. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 15 are implemented.

20. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 15 are implemented.