Virtual character display method and device, equipment and storage medium
By switching to a 3D virtual character animation after triggering an operation on a 2D image, the 3D spatial hierarchy of the virtual character is displayed, which solves the problems of insufficient stereoscopic sense of 2D virtual characters and high performance overhead of 3D virtual characters. This achieves the stereoscopic realism and dynamic adaptability of the virtual character, balancing the display effect and performance consumption.
Patent Information
- Application Number
- CN202610216363.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-13
- Publication Date
- 2026-05-15
AI Technical Summary
In existing technologies, two-dimensional virtual character displays lack a sense of three-dimensionality, while three-dimensional virtual character models have high performance overhead, making it difficult to balance display effect and performance consumption.
By triggering an operation on a 2D image, canceling the 2D virtual character image and displaying a 3D virtual character animation, the 3D spatial hierarchy of the virtual character is shown. Adapted 2D data information is generated using a virtual engine and rendering target technology, thus achieving the switching of the virtual character from a 2D to a 3D display.
While maintaining low resource consumption, the key features and spatial hierarchy of the 3D character model were restored, improving the three-dimensional realism and dynamic adaptability of the virtual character, and avoiding the lack of three-dimensionality in 2D virtual character images and the problem of additional resource loading for 3D virtual character models.
Smart Images

Figure CN122032081A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet technology, and in particular to a method, apparatus, device, and storage medium for displaying virtual characters. Background Technology
[0002] With the continuous development of internet technology, the variety of video games is increasing. During gameplay, at least one virtual character can be displayed on the interactive interface, and the display effect of the virtual character directly affects the player's visual experience and sense of immersion.
[0003] In related technologies, the virtual characters displayed in the interactive interface are either two-dimensional or three-dimensional. Two-dimensional virtual characters are mostly presented as static images or simple frame animations, relying on pre-rendered fixed-angle images, making it difficult to fully present the detailed information of the virtual character (such as back texture and side profile), and their dynamic adaptability is also poor. Three-dimensional virtual characters, on the other hand, are rendered directly in a 3D virtual scene, resulting in a larger performance overhead. Summary of the Invention
[0004] This application provides a method, apparatus, device, and storage medium for displaying virtual characters, balancing the display effect and performance overhead in the process of displaying virtual characters. The technical solution is as follows: On one hand, embodiments of this application provide a method for displaying a virtual character, the method comprising: Display a two-dimensional image, the two-dimensional image including a background image and a two-dimensional virtual character image on the background image; In response to the triggering operation of the two-dimensional image, the two-dimensional virtual character image is de-displayed on the background image and a virtual character animation is displayed in a three-dimensional virtual character image. The virtual character animation is used to display the three-dimensional spatial hierarchy of the virtual character.
[0005] On the other hand, embodiments of this application provide a display device for virtual characters, the device comprising: A display module is used to display a two-dimensional image, the two-dimensional image including a background image and a two-dimensional virtual character image on the background image; The display module is also configured to, in response to the triggering operation of the two-dimensional image, cancel the display of the two-dimensional virtual character image on the background image and display the virtual character animation in the form of a three-dimensional virtual character image, wherein the virtual character animation is used to display the three-dimensional spatial hierarchy of the virtual character.
[0006] In one possible implementation, the display module is further configured to display decorative elements associated with the three-dimensional virtual character image, the decorative elements including at least one of borders, special effects, stickers or achievement icons, and each decorative element being at a different display level from the three-dimensional virtual character image.
[0007] In one possible implementation, the display module is further configured to display an updated background image, an updated 3D virtual character image, and updated decorative elements when the interaction trigger position indicated by the trigger operation of the 2D image changes. The updated background image, the updated 3D virtual character image, and the updated decorative elements are determined based on the interaction trigger position.
[0008] In one possible implementation, the device further includes a determining module and a generating module. The determining module is used to determine adjustment parameters based on the trigger operation indication interaction trigger position of the two-dimensional image. The adjustment parameters include at least one of viewpoint adjustment parameters, texture sampling parameters, or lighting adaptation parameters. The sampling resolution is determined based on the rendering resolution, where the rendering resolution refers to the resolution of the area displaying the virtual character, and the sampling resolution is the resolution used to sample the three-dimensional character model to obtain two-dimensional texture data. The generation module is used to generate the updated background image, the updated 3D virtual character image, and the updated decorative elements based on the sampling resolution and the adjustment parameters.
[0009] In one possible implementation, the display module is further configured to display a corresponding three-dimensional virtual character image in a display area indicated by layout information when there are multiple virtual characters. The three-dimensional virtual character image is determined based on two-dimensional data information adapted to the rendering resolution of the display area. The two-dimensional data information is used to reflect the three-dimensional spatial hierarchy of the virtual character to determine the three-dimensional virtual character image. The layout information indicates the display area of each virtual character in the interactive interface and is determined based on the number of virtual characters to be displayed.
[0010] In one possible implementation, the apparatus further includes a determining module and a generating module, wherein the determining module is configured to determine first shared texture information based on the three-dimensional character models of each virtual character, the first shared texture information representing the texture information of the same rendering target corresponding to multiple virtual characters; The generation module is used to generate multiple two-dimensional data information adapted to the rendering resolution of the display area based on the first shared texture information; and to generate the three-dimensional virtual character image using the multiple two-dimensional data information adapted to the rendering resolution of the display area.
[0011] In one possible implementation, the device further includes a calibration module, which is used to perform rendering calibration on the plurality of three-dimensional virtual character images adapted to the rendering resolution of the display area using a first rendering calibration parameter and a second rendering calibration parameter to obtain a calibrated three-dimensional virtual character image. The first rendering calibration parameter is used to calibrate the rendering depth range of the display area corresponding to the three-dimensional virtual character image, and the second rendering calibration parameter is used to calibrate the sampling resolution for generating two-dimensional data information. The display module is used to display the corresponding calibrated 3D virtual character image in the display area indicated by the layout information.
[0012] In one possible implementation, the device further includes a determining module, which is configured to determine the first rendering calibration parameters based on the rendering range of a first clipping plane and a second clipping plane corresponding to the display area of the 3D virtual character image of each virtual character, wherein in a direction perpendicular to the display area, a first distance between the first clipping plane and the display area is less than a second distance between the second clipping plane and the display area; and to determine the rendering resolution based on the size information corresponding to the display area of the 3D virtual character image of each virtual character, thereby obtaining the second rendering calibration parameters.
[0013] In one possible implementation, the device further includes a sampling module, a processing module, a generation module, and a determination module; The sampling module is used to perform two-dimensional sampling on the three-dimensional character model of the virtual character that has completed the interaction, so as to obtain two-dimensional sampling data when the virtual character completes the interaction. The processing module is used to merge the two-dimensional sampled data to obtain merged data; and to perform unified processing on the merged data to obtain second shared texture information, wherein the second shared texture information represents the texture information of the same rendering target corresponding to the multiple virtual characters that have completed the interaction; The generation module is used to generate multiple two-dimensional data information adapted to the rendering resolution of the settlement display area based on the second shared texture information. The two-dimensional data information is used to reflect the three-dimensional spatial hierarchy of the virtual character in order to determine the three-dimensional virtual character image. The settlement display area is the area used to display the virtual character after the virtual character completes the interaction. The determining module is used to determine the three-dimensional virtual character image based on the multiple two-dimensional data information adapted to the rendering resolution of the settlement display area.
[0014] In one possible implementation, the display module is further configured to display a 3D virtual character image of the virtual character at a first display layer and display settlement elements at a second display layer, wherein the settlement elements are determined based on the interactive settlement data of the virtual character, and the first display layer and the second display layer are different display layers in the interactive interface.
[0015] In one possible implementation, the apparatus further includes an acquisition module and a determination module; The acquisition module is used to acquire layer rendering information and lighting projection information. The layer rendering information represents the texture data and layer occlusion relationship of the 3D character model at different layers. The lighting projection information represents at least one of the following: the highlight distribution, shadow outline, or semi-transparent light and shadow superposition effect of the 3D character model at the interaction trigger position corresponding to the interaction viewpoint. The determining module is used to determine the two-dimensional data information based on the layer rendering information and the lighting projection information. The two-dimensional data information is used to reflect the three-dimensional spatial hierarchy of the virtual character in order to determine the three-dimensional virtual character image.
[0016] In one possible implementation, the determining module is further configured to determine the interaction trigger position based on the trigger operation of the two-dimensional image; determine a position offset using the interaction trigger position and a reference display position, wherein the reference display position is the position of the virtual character in the display area of the two-dimensional image; and determine the layer rendering information and the lighting projection information based on the position offset and the three-dimensional character model corresponding to the virtual character.
[0017] In one possible implementation, the layer rendering information includes background layer rendering information and character layer rendering information. The determining module is configured to determine a first displacement parameter and a second displacement parameter based on the position offset. The first displacement parameter is used to adjust the texture sampling offset of the background image, and the second displacement parameter is used to adjust the texture sampling offset of the 3D character model of the virtual character. The background layer rendering information is determined based on the first displacement parameter and the background image. The background layer rendering information indicates the flash rendering mode of the background image and the texture sampling offset relationship corresponding to the first rendering layer, the second rendering layer, and the third rendering layer of the background image. The texture sampling offset amplitude of the first rendering layer is smaller than that of the second rendering layer, and the texture sampling offset amplitude of the second rendering layer is smaller than that of the third rendering layer. The character layer rendering information is determined based on the second displacement parameter and the 3D character model corresponding to the virtual character.
[0018] In one possible implementation, the apparatus further includes an optimization module and a determination module; The optimization module is used to perform optimization processing on the texture data of the two-dimensional virtual character image to obtain optimized texture data; The determining module is used to determine the three-dimensional virtual character image based on the optimized texture data and the texture mapping strategy corresponding to the three-dimensional character model corresponding to the virtual character. The texture mapping strategy is used to indicate at least one of the attachment position, attachment range, or attachment angle of the optimized texture data on the three-dimensional character model.
[0019] In one possible implementation, the optimization process includes at least one of anti-aliasing, color difference repair, or directional rendering. The anti-aliasing is used to eliminate jagged edges on the texture of the two-dimensional image, the color difference repair is used to correct texture color deviations in the two-dimensional image, and the directional rendering is used to adjust rendering parameters according to the display perspective of the three-dimensional character model.
[0020] On the other hand, embodiments of this application provide a computer device, which includes a processor and a memory. The memory stores at least one piece of program code, which is loaded and executed by the processor to enable the computer device to implement any of the above-described methods for displaying virtual characters.
[0021] On the other hand, a computer-readable storage medium is also provided, wherein at least one piece of program code is stored in the computer-readable storage medium, the at least one piece of program code being loaded and executed by a processor to enable a computer to implement any of the above-described methods for displaying virtual characters.
[0022] On the other hand, a computer program or computer program product is also provided, wherein the computer program or computer program product stores at least one computer instruction, which is loaded and executed by a processor to enable the computer to implement any of the above-mentioned methods for displaying virtual characters.
[0023] The technical solution provided in this application has at least the following beneficial effects: This application embodiment displays a two-dimensional image containing a background image and a two-dimensional virtual character image. After the two-dimensional image is triggered, the display of the two-dimensional virtual character image is canceled on the same background image, and the virtual character animation is displayed as a three-dimensional virtual character image. The virtual character animation can display the spatial hierarchy of the virtual character. It can realize the switching of the virtual character display from two-dimensional to three-dimensional without switching the overall display interface and loading new background resources. The spatial hierarchy of the virtual character is presented on the two-dimensional display interface, which improves the three-dimensional realism of the virtual character display. It avoids the problem of insufficient three-dimensionality of two-dimensional virtual character image display and the problem of additional resource loading required for three-dimensional virtual character model display. It retains the low resource consumption advantage of two-dimensional display and restores the key features and spatial hierarchy of three-dimensional character model. It makes the display of virtual character dynamically adaptable to the virtual character, with detailed expression, and balances the display effect and performance overhead of virtual character. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a structural block diagram of a computer system provided in an embodiment of this application; Figure 2 This is a flowchart illustrating a method for displaying a virtual character according to an embodiment of this application; Figure 3 This is a schematic diagram of an interactive interface for displaying two-dimensional images provided in an embodiment of this application; Figure 4 This is a schematic diagram of an interactive interface for displaying a three-dimensional virtual character image provided in an embodiment of this application; Figure 5 This is a schematic diagram of different levels provided in the embodiments of this application; Figure 6 This is a schematic diagram of an interactive interface for displaying multiple virtual characters provided in an embodiment of this application; Figure 7 This is a schematic diagram of an interactive interface for displaying multiple virtual characters provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of a virtual character display device provided in an embodiment of this application; Figure 9 This is a structural block diagram of a terminal device provided in an embodiment of this application; Figure 10This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0027] It should be noted that the terms "first," "second," etc., used in this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0028] Before introducing the technical solution of this application, the abbreviations and key terms involved in the embodiments of this application will be defined.
[0029] Unreal Engine is a 3D creation and rendering engine widely used in game development, virtual digital humans, film and animation, architectural visualization, simulation training, and other fields. Unreal Engine provides complete functions for 3D scene construction, model loading, lighting calculation, material rendering, animation control, and post-processing, supporting high-fidelity visuals and real-time interactivity, and capable of creating highly realistic 3D virtual worlds and visual effects. For example, in this embodiment, the rendering of a 3D character model, scene capture, and image output are implemented based on Unreal Engine.
[0030] SceneCapture is a scene capture component provided in the virtual engine. It is used to capture real-time images of a 3D scene or a specified object from a specified camera position, viewpoint, and range, and output the capture results as texture data. The SceneCapture component can work independently of the main viewport and supports custom capture resolution, depth range, rendering level, and rendering target. It is commonly used in scenes such as image capture, real-time texture generation, multi-view rendering, and interface display. SceneCapture can include SceneCaptureComponent2D (2D scene capture component, used for 2D rendering) and SceneCaptureComponent3D (3D scene capture component, used for 3D rendering). For example, in this embodiment, the SceneCapture component is used to perform 2D sampling and texture output of a 3D virtual character.
[0031] A render target (RT) is a texture-based rendering output carrier used to store image data output by the rendering pipeline in the graphics card's memory. This data can be read and used as textures in subsequent rendering processes. Render targets can receive drawing results from cameras, scene capture components, or custom rendering pipelines, supporting off-screen rendering, multi-channel rendering, texture sharing, post-processing, and other functions. It is a key resource type for implementing complex rendering logic and performance optimization. For example, embodiments of this application use render targets to uniformly store the rendering results of multiple virtual characters, achieving texture data sharing and merging.
[0032] Figure 1 This is a structural block diagram of a computer system provided in an embodiment of this application. The computer system includes a terminal device 101 and a server 102. The terminal device 101 has a client installed and running, and the client has a user 103's account logged in; that is, the terminal device 101 is the terminal device used by user 103.
[0033] For example, the client of terminal device 101 may include, but is not limited to, clients for massively multiplayer online role-playing games (MMOPGG), open-world games, first-person shooters (FPS), third-person shooters (TPS), multiplayer online battle arenas (MOBA), multiplayer shooting survival games, action role-playing games (ARPG), virtual reality (VR), augmented reality (AR), 3D map clients, map simulation clients, social clients, and interactive entertainment clients.
[0034] Server 102 provides background services for the client installed on terminal device 101. In one possible implementation, server 102 undertakes the main computing work, and terminal device 101 undertakes the secondary computing work. Alternatively, server 102 undertakes the secondary computing work, and terminal device 101 undertakes the main computing work. Or, terminal device 101 and server 102 collaborate on computing using a distributed computing architecture.
[0035] Optionally, the terminal device 101 can be any electronic device product capable of human-computer interaction with the user through one or more methods such as a keyboard, touchpad, remote control, voice interaction, or handwriting device. For example, the terminal device can be a smartphone, tablet computer, laptop computer, desktop computer, smartwatch, PC (Personal Computer), mobile phone, PDA (Personal Digital Assistant), wearable device, PPC (Pocket PC), smart car system, smart TV, etc.
[0036] Terminal device 101 can refer to one of a plurality of terminal devices, or it can refer to a plurality of terminal devices. The number of terminals is not limited in this embodiment. Server 102 can be a single server, a server cluster consisting of multiple servers, or any of a cloud computing platform and a virtualization center. The number of terminals is not limited in this embodiment.
[0037] In one embodiment of this application, after the user 103 logs into the account of the terminal device 101, a two-dimensional image 104 is displayed on the terminal device 101. The two-dimensional image 104 includes a background image 105 and a two-dimensional virtual character image 106 on the background image 105.
[0038] After detecting the trigger operation on the two-dimensional image 104, the terminal device 101 generates a request to acquire the three-dimensional virtual character image of the virtual character. The request to acquire the three-dimensional virtual character image of the virtual character carries the account information of the user 103, the character identifier corresponding to the two-dimensional virtual character image 106, the interactive trigger location information of the trigger operation indication, and the display parameters of the terminal device 101, and sends the request to acquire the three-dimensional virtual character image of the virtual character to the server 102.
[0039] After receiving a request to acquire a 3D virtual character image, server 102 parses the character identifier corresponding to the 2D virtual character image 106 carried in the request, retrieves the 3D character model of the virtual character corresponding to the character identifier, determines the 2D data information used to display the spatial hierarchy of the 3D character model based on the 3D character model, and then performs rendering processing based on the 2D data information to obtain the 3D virtual character image. Based on the obtained 3D virtual character image, server 102 generates a 3D virtual character image display instruction, which carries the 3D virtual character image data and display control parameters. Server 102 then sends the 3D virtual character image display instruction to terminal device 101.
[0040] After receiving the three-dimensional virtual character image display instruction, the terminal device 101 parses the three-dimensional virtual character image data and display control parameters of the virtual character carried in the three-dimensional virtual character image display instruction, adjusts the display settings according to the display control parameters, cancels the display of the two-dimensional virtual character image, and displays the virtual character animation 107 with the three-dimensional virtual character image of the virtual character.
[0041] Those skilled in the art should understand that the terminal device 101 and server 102 described above are merely illustrative examples. Other existing or future terminal devices or servers that are applicable to this application should also be included within the scope of protection of this application, and are hereby incorporated by reference.
[0042] The virtual character display method provided in this application embodiment can be applied to the above. Figure 1 The computer system shown, for example, the method can be derived from... Figure 1 The method can be executed by terminal device 101, or it can be executed interactively by terminal device 101 and server 102. Taking the execution of this method by terminal device 101 as an example, such as... Figure 2 As shown, the method includes the following steps 201 to 202.
[0043] In step 201, a two-dimensional image is displayed, which includes a background image and a two-dimensional virtual character image on the background image.
[0044] In an exemplary embodiment of this application, a client capable of providing image display is installed and running on the terminal device. The image display client includes, but is not limited to, game clients, application clients, interactive entertainment clients, and virtual reality clients.
[0045] Let's take the game client installed on the terminal device as an example. The game client includes multiple virtual characters, which are virtual images in the game that users can control, display, or interact with.
[0046] The virtual character display method provided in this application can be used in various scenarios within a game client, including the shop, display, preview, checkout, and character display scenarios. The shop scenario will be used as an example. The shop scenario can display an interactive interface (i.e., the shop interface), which can display at least one two-dimensional image, occupying part or all of the interactive interface's area.
[0047] For example, multiple two-dimensional images can be displayed simultaneously in the interactive interface. Each two-dimensional image corresponds to an independent virtual character display card and occupies part of the interactive interface area. Multiple two-dimensional images can display the two-dimensional images of different virtual characters or different appearance skins of the same virtual character.
[0048] Two-dimensional images refer to images presented in a planar format. The display methods of two-dimensional images include, but are not limited to, static image display, animated image display, video frame display, sequential frame animation display, and vector graphics display. Static images can be pre-drawn character portraits, card images, icons, etc.; animated images can be GIFs (Graphics Interchange Format) images with looping animations, sequential frame images, etc.; video frame display can be a planar image formed by rendering short video streams frame by frame; sequential frame animation display can be a dynamic display effect formed by continuously switching multiple planar images; vector graphics display can be scalable planar graphics drawn based on paths and color blocks. All of the above display methods present content in a planar format and do not rely on the rendering and calculation of three-dimensional models.
[0049] The two-dimensional images include background images and two-dimensional virtual character images. Background images form the visual base of the interactive interface and provide the scene atmosphere; two-dimensional virtual character images are pre-made images that display the appearance of virtual characters in a flat form.
[0050] Optionally, the background image supports pseudo-3D (three-dimensional) materials. Pseudo-3D materials are a virtual engine material technology that simulates 3D spatial effects on the basis of 2D (two-dimensional) textures. It can make flat visuals present a sense of three-dimensional space without the need for a complete 3D model.
[0051] Figure 3 This is a schematic diagram of an interactive interface for displaying two-dimensional images provided in an embodiment of this application. For example... Figure 3 As shown, the interactive interface of the e-commerce scene can display multiple two-dimensional images 301. For example, two-dimensional image 301 is a card-style image used to display different virtual characters. Multiple two-dimensional images 301 are arranged horizontally in the interactive interface, each corresponding to a different virtual character. For example, the interactive interface displays three virtual character cards, namely virtual character A, virtual character B, and virtual character C.
[0052] Each two-dimensional image 301 includes a background image 302 and a two-dimensional virtual character image 303. The background image 302 serves as the base layer of the two-dimensional image 301, providing visual support and scene atmosphere. The two-dimensional virtual character image 303 is overlaid on the background image 302, used to display the appearance of the corresponding virtual character in a planar form.
[0053] The interactive interface can also display introductory information 304 of the virtual character. The introductory information 304 of the virtual character can be displayed below, above or to the side of the corresponding two-dimensional image 301, and is used to display at least one of the following information: the virtual character's name, price, attributes, rarity, and appearance description.
[0054] In step 202, in response to the triggering operation of the two-dimensional image, the two-dimensional virtual character image is de-displayed on the background image and the virtual character animation is displayed in the form of a three-dimensional virtual character image. The virtual character animation is used to display the spatial hierarchy of the three-dimensional character model.
[0055] In the exemplary embodiments of this application, the triggering operations for the two-dimensional image include, but are not limited to, hovering, clicking, double-clicking, long-pressing, and swiping operations on the display area of any two-dimensional image. The triggering operations for the two-dimensional image are used to trigger a switch from a two-dimensional virtual character image to a three-dimensional virtual character image with stereoscopic visual effects for display.
[0056] The animation of a virtual character is displayed using a 3D virtual character image, derived from 2D data information determined by a 3D character model. For example, after detecting a trigger operation on a 2D image, the 3D character model of the virtual character corresponding to the triggered 2D image is obtained. Here, the 3D character model refers to virtual character model data with a complete 3D spatial structure, constructed using 3D modeling software. The 3D character model includes, but is not limited to, 3D vertex data, patch topology, texture coordinate information, normal data, material parameters, skeletal data, and hierarchical structure data; the 3D character model can reflect the shape, proportion, volume, occlusion relationships, and spatial positional relationships between various body parts and decorative components of the virtual character in 3D space, and can present corresponding stereoscopic visual effects under different viewing angles and lighting conditions. 3D character models are typically designed and created in advance by the game client during the planning and development phase.
[0057] After obtaining the 3D character model, it is processed to obtain the corresponding 2D data information. 2D data information refers to the planar display data obtained after the 3D character model has undergone 2D processing, used to convert the 3D spatial structure into visual data that can be presented on a 2D interface.
[0058] For example, two-dimensional data information can reflect the occlusion relationship between the various parts of a three-dimensional character model, the concave and convex structure of the model surface, the spatial distance relationship between different parts, the light and shadow levels produced by lighting, and the three-dimensional outline of the model from the interactive perspective, so that the final displayed three-dimensional virtual character image presents a display screen with spatial depth, layer changes and stereoscopic visual effects on the two-dimensional screen.
[0059] In an exemplary embodiment of this application, the process of determining the two-dimensional data information of the virtual character includes, but is not limited to, steps A1 to A2.
[0060] In step A1, hierarchical rendering information and lighting projection information are obtained. Hierarchical rendering information represents the texture data and hierarchical occlusion relationship of the 3D character model at different levels. Lighting projection information represents at least one of the following: the specular distribution, shadow outline, or semi-transparent light and shadow overlay effect of the 3D character model at the interaction trigger position corresponding to the interaction viewpoint.
[0061] For example, layered rendering information is rendering data obtained by rendering a 3D character model in layers, representing the texture hierarchy and occlusion relationships between different parts of the 3D character model itself, as well as between the character model and the background image.
[0062] Lighting projection information is visual effect data obtained by performing lighting calculations and light and shadow projection processing on a 3D character model. It is used to reflect the realistic lighting and shadow performance of the 3D character model from the viewpoint. Lighting projection information represents at least one of the following: highlight distribution, shadow outline, or translucent light and shadow overlay effect of the 3D character model at the interaction trigger location and corresponding interaction viewpoint.
[0063] In an exemplary embodiment of this application, generating hierarchical rendering information and lighting projection information includes steps A11 to A13.
[0064] In step A11, the interactive trigger position is determined based on the triggering operation of the two-dimensional image.
[0065] For example, when a specified trigger operation is detected in the display area of a 2D image, the specific coordinates of the trigger operation on the interactive interface are determined as the interaction trigger position. The display area of the 2D image can also be referred to as the character drawing frame.
[0066] A virtual engine (such as Unreal Engine 4, or UE4 for short) can include multiple core components, each carrying different functional modules. These components enable processes such as interaction, rendering, and positioning. For example, UE4's core components can include the CapsuleComponent. The CapsuleComponent provides collision detection and raycasting capabilities to determine the interaction trigger location corresponding to an interactive operation. For instance, the CapsuleComponent can be mounted under the component hierarchy of a blueprint file (such as BP_HallCharacter). It uses collision detection to perceive user actions (such as hovering or clicking) on a 2D image display area and uses raycasting to capture the interaction coordinates on the interface, determining these coordinates as the interaction trigger location.
[0067] Blueprint files are asset files created in Unreal Engine 4 (UE4) using a visual programming approach. They eliminate the need for traditional text-based code, allowing users to define the behavioral logic and interaction rules of game objects, characters, interfaces, or systems through drag-and-drop node configuration and connection logic. Blueprint files can contain various component mounting, event responses, parameter configurations, and flow control logic, serving as the core carrier for functional development and logic orchestration within Unreal Engine. Different blueprint files correspond to different functional modules (e.g., character control, interface interaction, scene logic). For example, the BP_HallCharacter blueprint file is typically used to define the basic attributes of virtual characters, component mounting relationships, and interaction response logic.
[0068] In step A12, the position offset is determined using the interactive trigger position and the reference display position, where the reference display position is the position of the virtual character in the display area of the two-dimensional image.
[0069] For example, the reference display position refers to a pre-defined reference point located within the display area of the virtual character in the two-dimensional image. The reference display position is a reference standard for calculating the offset magnitude and direction of the interaction trigger position. For instance, the reference display position is the center position of the display area of the virtual character in the two-dimensional image (e.g., the virtual character displaying a card, a character drawing frame).
[0070] After determining the interaction trigger position, the position offset is calculated based on the first coordinate of the interaction trigger position and the second coordinate of the reference display position. By performing horizontal and vertical difference calculations on the first and second coordinates, the horizontal offset and vertical offset are obtained respectively. The horizontal offset and vertical offset together constitute the complete position offset.
[0071] The position offset can include the offset direction and the offset magnitude. The offset direction is used to characterize the specific offset direction of the interaction trigger position relative to the reference display position (e.g., the center point of the virtual character display area), such as upper left, lower right, etc.; the offset magnitude is used to quantify the distance difference between the interaction trigger position and the reference display position.
[0072] In step A13, the layer rendering information and lighting projection information are determined based on the position offset and the 3D character model corresponding to the virtual character.
[0073] For example, by using position offsets and combining them with the 3D character model corresponding to the virtual character, the relevant parameters of the core rendering components of the UE4 virtual engine (such as SceneCaptureComponent2D) are adjusted to determine the hierarchical rendering information and lighting projection information adapted to the current interactive viewpoint. The relevant parameters of the core rendering components include, but are not limited to, the sampling camera position and the rendering viewpoint.
[0074] The sampling camera position refers to the spatial coordinates of the virtual camera in the SceneCaptureComponent2D of the UE4 engine, which is used to capture the rendering of the 3D character model. It controls the capture angle and the range of the 3D character model.
[0075] The rendering perspective refers to the display angle and viewing direction of the 3D character model, which is determined by adjusting the pose of the virtual camera in SceneCaptureComponent2D. The rendering perspective and the sampling camera position work together to determine the final rendering effect of the 3D character model.
[0076] The rendering viewpoint needs to be adjusted specifically based on the position offset. For example, the offset direction of the interaction trigger position relative to the reference display position corresponds to the deflection direction of the rendering viewpoint, and the offset magnitude corresponds to the deflection angle of the rendering viewpoint.
[0077] For example, by dynamically adding SceneCaptureComponent2D drawing objects (i.e., rendering instances used to carry out the rendering and acquisition tasks of the 3D character model), the ShowOnlyActorComponents component of the SceneCaptureComponent2D component is called to add the 3D character model to the visible array of the SceneCaptureComponent2D rendering component. The visible array stores the objects to be rendered and acquired, ensuring that only the target 3D character model is rendered. Then, the texture sampling offset relationship of each layer is adjusted based on the position offset to ensure that the layer rendering information adapts to the current interactive viewpoint.
[0078] For example, the position offset represents the user's trigger position shifting to the upper right relative to the reference display position (the center point of the character's drawing frame). At this time, the texture sampling offset parameters of the virtual character's main body layer, clothing layer, and hair layer are adjusted accordingly. The texture sampling coordinates of each layer are shifted to the upper right by a corresponding amount, and the occlusion priority of each layer is adjusted so that the occlusion relationship of the hair layer relative to the face layer and the occlusion relationship of the clothing layer relative to the background layer can adapt to the interaction view that is shifted to the upper right, ensuring that the layer rendering information can realistically present the layer structure of the 3D character model in the current view.
[0079] In an exemplary embodiment of this application, the layer rendering information includes background layer rendering information and character layer rendering information, and the process of determining the layer rendering information includes steps A131 to A133.
[0080] In step A131, a first displacement parameter and a second displacement parameter are determined based on the position offset. The first displacement parameter is used to adjust the texture sampling offset of the background image, and the second displacement parameter is used to adjust the texture sampling offset of the three-dimensional character model of the virtual character.
[0081] For example, the background image may include multiple layers. A layer refers to an independent image layer obtained by splitting the background image according to visual depth and display priority. Each layer corresponds to unique texture data. The layers are superimposed to form a complete background image. The texture sampling offset of different layers can be set independently to present the 3D depth and layering of the background image.
[0082] The first displacement parameter is used to adjust the texture sampling offset of the background image. The first displacement parameter includes, but is not limited to, the first offset direction and the first offset magnitude. The first offset direction is used to indicate the offset orientation of the texture sampling of each layer of the background image, and the first offset magnitude is used to quantify the offset distance of the texture sampling of each layer of the background image.
[0083] Obtain the offset direction and offset magnitude of the position offset, with the offset direction of the first displacement parameter consistent with the offset direction of the position offset. Based on the number of layers in the background image, the visual hierarchy relationship between the background image and the virtual character, and the corresponding offset ratio of the background image, multiply the offset magnitude of the position offset by the offset ratio to obtain the offset magnitude of the first displacement parameter.
[0084] For example, the position offset direction is upward to the right, and the offset magnitude is 15 pixels. The background image is divided into 3 layers. The background image is behind the virtual character and belongs to the secondary visual layer (the virtual character is the core visual layer). Therefore, the preset offset ratio of the background image is 0.4 (less than 1 to avoid the background offset being too large and overshadowing the virtual character). Multiply the position offset magnitude of 15 pixels by the offset ratio of 0.4 to get 15 × 0.4 = 6 pixels. That is, the offset magnitude of the first displacement parameter is 6 pixels. Combined with the upward to the right offset direction, the first displacement parameter can be determined.
[0085] The second displacement parameter is used to adjust the texture sampling offset of the 3D character model of the virtual character. The second displacement parameter includes, but is not limited to, the second offset direction and the second offset magnitude. The second offset direction is used to indicate the offset orientation of the texture sampling of each component layer of the 3D character model of the virtual character, and the second offset magnitude is used to quantify the offset distance of the texture sampling of each component layer of the 3D character model of the virtual character.
[0086] The offset direction and magnitude of the position offset are obtained, and the offset direction of the second displacement parameter is consistent with the offset direction of the position offset. Based on the number of component layers in the 3D character model corresponding to the virtual character, the visual hierarchy relationship between the 3D character model and the background image, and the offset ratio corresponding to the 3D character model, the offset magnitude of the position offset and the offset ratio are multiplied to obtain the offset magnitude of the second displacement parameter. The offset ratio corresponding to the 3D character model is a fixed ratio (close to or equal to 1) pre-set according to the rendering accuracy requirements and component layer priority of the 3D character model, used to ensure that the texture sampling offset of the 3D character model matches the user's interaction intent.
[0087] For example, the position offset direction is upward to the right, and the offset magnitude is 15 pixels. The 3D character model corresponding to the virtual character is divided into 4 component levels (hair level, face level, clothing level, and accessory level). The 3D character model is in front of the background image and belongs to the core visual level (the background image is a secondary visual level). Therefore, the preset offset ratio corresponding to the 3D character model is 0.9 (close to 1, to ensure that the texture sampling offset of the 3D character model is adapted to the interactive trigger position and highlight the stereo effect). Multiply the position offset magnitude of 15 pixels by the offset ratio of 0.9 to get 15 × 0.9 = 13.5 pixels, that is, the offset magnitude of the second displacement parameter is 13.5 pixels. Combined with the upward to the right offset direction, the complete second displacement parameter can be determined.
[0088] In step A132, background layer rendering information is determined based on the first displacement parameter and the background image. The background layer rendering information indicates the flash rendering mode of the background image and the texture sampling offset relationship corresponding to the first rendering layer, the second rendering layer, and the third rendering layer of the background image. The texture sampling offset amplitude of the first rendering layer is less than that of the second rendering layer, and the texture sampling offset amplitude of the second rendering layer is less than that of the third rendering layer.
[0089] For example, after determining the first displacement parameter, the background image is processed in layers and rendering parameters are set using the first displacement parameter to obtain background layer rendering information. The background layer rendering information indicates the flashcard rendering mode of the background image. The flashcard rendering mode of the background image refers to the layering and superimposing of multiple rendering layers of the background image, and each rendering layer can present a synchronous and differentiated dynamic offset effect according to the offset direction and offset magnitude corresponding to the first displacement parameter, simulating the three-dimensional flipping visual experience of a "flashcard" in reality, thereby highlighting the 3D depth and dynamic interactive effect of the background image.
[0090] For example, when the first displacement parameter indicates an upward and rightward offset of 6 pixels, the background image's flash rendering mode will control the three rendering levels to shift synchronously to the upward and rightward. Each level will then exhibit a dynamic effect based on its own offset magnitude, giving the background image a slight sense of three-dimensional flipping.
[0091] Background layer rendering information indicates the texture sampling offset relationship between the first, second, and third rendering layers of the background image. A rendering layer refers to an independent image layer obtained by splitting the background image into layers according to visual depth, display priority, and spatial position. Each rendering layer corresponds to unique texture data, and the texture sampling offset of each rendering layer can be set independently. These layers work together to form a complete background image and present a 3D sense of depth. Multiple rendering layers work independently and collaboratively, stacking and combining according to a preset spatial order (from inside to outside, from near to far).
[0092] For example, the first rendering layer is the background base layer (e.g., the background sky texture in the mall scene, the background decorative texture in the character frame), with the smallest texture sampling offset, offset by 30% of the first displacement parameter offset; the second rendering layer is the mid-ground decorative layer (e.g., the decorative texture of the virtual character in the mall scene, the border decorative texture in the character frame), corresponding to the middle layer of the background image, with the texture sampling offset in the middle, offset by 60% of the first displacement parameter offset; the third rendering layer is the foreground core layer (e.g., the virtual character base texture in the mall scene, the background texture in the character frame), corresponding to the innermost layer of the background image, with the largest texture sampling offset, offset by the full offset of the first displacement parameter (6 pixel units), following the texture sampling offset rule of "first rendering layer < second rendering layer < third rendering layer", and combined with the upper right offset direction of the first displacement parameter, ensuring that the texture sampling offset of the three rendering layers adapts to the current interactive viewpoint, highlighting the 3D depth of the background image.
[0093] In step A133, the character hierarchy rendering information is determined based on the second displacement parameter and the 3D character model corresponding to the virtual character.
[0094] For example, after determining the second displacement parameter, the second displacement parameter is used to perform component layering processing and rendering parameter settings on the 3D character model corresponding to the virtual character, thereby obtaining character layer rendering information. The character layer rendering information indicates the stereo rendering mode of the 3D character model of the virtual character and the texture sampling offset relationship corresponding to different layers of the 3D character model.
[0095] The character layer rendering information indicates the stereo rendering mode of the three-dimensional character model of the virtual character. The stereo rendering mode of the three-dimensional character model refers to the layering and superimposing of multiple component layers of the three-dimensional character model. Each component layer can present a synchronous and differentiated dynamic offset effect according to the offset direction and offset magnitude corresponding to the second displacement parameter, simulating the stereoscopic turning visual experience of the character in reality, thereby highlighting the stereoscopic spatial sense and dynamic interactive effect of the three-dimensional character model.
[0096] For example, when the second displacement parameter indicates an upward and rightward offset of 13.5 pixels, the stereo rendering mode of the 3D character model will control the four component layers to shift synchronously to the upward and rightward, and each component layer will present a dynamic effect according to its own offset difference, so that the 3D character model as a whole presents a stereoscopic sense of rotation.
[0097] The character layer rendering information indicates the texture sampling offset relationships corresponding to the hair layer, face layer, clothing layer, and accessory layer of the virtual character's 3D model. The component layer refers to the independent component layers obtained after splitting the virtual character's 3D model into layers according to component function, visual depth, display priority, and spatial position. Each component layer corresponds to unique texture data, and the texture sampling offset amplitude of each component layer can be independently set. These layers are used to collectively construct a complete 3D character model and present a sense of three-dimensional space. Multiple component layers are independent yet collaborative, superimposed and combined according to a preset spatial order (from inside to outside, from near to far). The texture sampling offset amplitude of each component layer follows the rule "hair layer < face layer < clothing layer < accessory layer," ensuring a realistic and harmonious stereoscopic visual effect of the 3D character model and forming a reasonable hierarchical relationship with the background image.
[0098] This application embodiment determines the first and second displacement parameters based on the position offset, realizing the differentiated decomposition of the displacement parameters. This provides a precise basis for the texture sampling offset of the background image and the 3D character model, avoiding the problems of inconsistency and misfitting between the texture offset of the background and the character. Based on the first displacement parameter and the background image, the background layer rendering information is determined. Through the flash card rendering mode and the differentiated texture sampling offset setting of the three-level rendering layer, the background image presents a clear 3D depth and improves the dynamic display effect of the background image. Based on the second displacement parameter and the 3D character model, the character layer rendering information is determined, ensuring that the texture sampling offset of the 3D character model is adapted to the user's interactive intent and presents the spatial hierarchical structure of the 3D character model itself.
[0099] The interactive viewpoint is determined based on the position offset. Combined with the surface material of the 3D character model (e.g., glossy clothing, semi-transparent hair), lighting calculations and shadow casting are performed using the SceneCaptureComponent2D component to obtain lighting casting information. The lighting casting information represents at least one of the following: specular distribution, shadow outline, and semi-transparent light and shadow overlay effect of the 3D character model under the current interactive viewpoint.
[0100] Highlight distribution refers to the area and intensity of highlight reflection on the surface of a 3D character model caused by light source illumination, and is related to the surface material properties of the 3D character model. For example, the highlight distribution area of glossy clothing is relatively concentrated and the reflection intensity is high, while the highlight distribution area of matte material parts is dispersed and the reflection intensity is low.
[0101] Shadow outlines refer to the boundary shapes of shadows created by light source occlusion between different parts of a 3D character model and between the 3D character model and the scene hierarchy. They clearly delineate the three-dimensional outline of the 3D character model. The shape and clarity of the shadow outlines need to be adjusted in conjunction with the interactive viewpoint corresponding to the positional offset to ensure that the shadow presentation matches the occlusion relationship under the current viewpoint.
[0102] The semi-transparent light and shadow overlay effect refers to the visual effect of light and shadow penetration and overlay produced by semi-transparent material parts (such as semi-transparent hair and gauze clothing) in a 3D character model under the illumination of a light source. It is necessary to combine the light transmittance parameters of the semi-transparent material and the current interactive viewpoint to simulate the logic of real light and shadow overlay.
[0103] For example, in the ShowFlag component of the UE4 virtual engine, motion blur and postprocess material are turned off to avoid irrelevant lighting effects from interfering with the accuracy of layer rendering information and lighting projection information, and to ensure that the reflection intensity of the highlight distribution, the boundary clarity of the shadow outline, and the naturalness of the semi-transparent light and shadow overlay effect are not disturbed.
[0104] Optionally, the UE4 virtual engine can also enable anti-aliasing (AA) to specifically optimize the edge smoothness of highlight distribution, the boundary detail of shadow outlines, and the display clarity of translucent light and shadow overlay effects.
[0105] The complete lighting calculation and rendering process is implemented through SceneCaptureComponent2D. Anti-aliasing (AA) is used to process the alpha channel to solve the edge jaggedness problem when the light and shadow are superimposed on the semi-transparent material parts, ensuring a natural transition of the semi-transparent light and shadow superimposition effect. The color space is converted through the tone mapping stage to accurately calibrate the color intensity of the specular distribution and the brightness and contrast of the shadow outline, so as to obtain complete lighting projection information that is adapted to the current interactive viewpoint, fits the surface material characteristics of the 3D character model, and includes specular distribution, shadow outline, and semi-transparent light and shadow superimposition effect.
[0106] This application embodiment determines the interaction trigger position based on the trigger operation of a two-dimensional image, and determines the position offset using the interaction trigger position and the reference display position. The position offset accurately represents the offset of the interaction trigger position relative to the reference position of the virtual character display area, providing a data foundation for the subsequent determination of hierarchical rendering information and lighting projection information. Based on the position offset and the three-dimensional character model corresponding to the virtual character, the hierarchical rendering information and lighting projection information are determined, which enables the hierarchical rendering information and lighting projection information to accurately adapt to the current user interaction perspective, presenting the spatial hierarchy and light and shadow details of the three-dimensional character model corresponding to the virtual character, thereby improving the stereoscopic visual expression of the virtual character in the two-dimensional image.
[0107] In step A2, two-dimensional data information is determined based on the hierarchical rendering information and the lighting projection information. The two-dimensional data information is used to reflect the three-dimensional spatial hierarchical structure of the virtual character in order to determine the three-dimensional virtual character image.
[0108] In the exemplary embodiments of this application, after determining the layer rendering information and lighting projection information, the layer rendering information and lighting projection information are integrated and collaboratively rendered using SceneCaptureComponent2D of the UE4 virtual engine to obtain a three-dimensional virtual character image. For example, the stacking order and texture sampling parameters of each rendering layer corresponding to the background layer rendering information and each component layer corresponding to the character layer rendering information are determined. Then, the specular distribution, shadow outline, and semi-transparent light and shadow overlay effect represented by the lighting projection information are mapped to the texture data of each component in the corresponding layer and the virtual character to obtain a three-dimensional virtual character image. The three-dimensional virtual character image is two-dimensional data.
[0109] This application embodiment determines the 3D virtual character image by using hierarchical rendering information and lighting projection information. It can accurately integrate the hierarchical stereoscopic features of the 3D character model with the lighting and shadow details, so that the generated 3D virtual character image can not only fully retain the texture differences and hierarchical occlusion relationships of different levels of the 3D character model reflected by the hierarchical rendering information, but also realistically present the lighting and shadow effects reflected by the lighting projection information, avoiding the problems of missing stereoscopic layers and distorted lighting and shadow in the 3D virtual character image.
[0110] Optionally, after determining the hierarchical rendering information and lighting projection information, the texture data of the two-dimensional virtual character image can be optimized to obtain optimized texture data; the three-dimensional virtual character image is determined based on the optimized texture data and the texture mapping strategy corresponding to the three-dimensional character model of the virtual character, and the texture mapping strategy is used to indicate at least one of the attachment position, attachment range or attachment angle of the optimized texture data on the three-dimensional character model.
[0111] In the exemplary embodiments of this application, the texture data of a two-dimensional virtual character image refers to the appearance display data constituting the two-dimensional virtual character image. The texture data includes, but is not limited to, the color information, grayscale information, texture information, outline information, and detailed feature information of the two-dimensional virtual character. The texture data can be determined based on the texture data and hierarchical occlusion relationships of different levels of the three-dimensional character model represented by the hierarchical rendering information, as well as the specular distribution, shadow outline, or semi-transparent light and shadow overlay effect represented by the lighting projection information, so that the texture data is adapted to the hierarchical structure and lighting performance of the three-dimensional character model.
[0112] For example, the optimization processing of texture data includes at least one of anti-aliasing processing, color difference repair processing, or directional rendering processing. Anti-aliasing processing is used to eliminate jagged edges of textures in two-dimensional images, color difference repair processing is used to correct texture color deviations in two-dimensional images, and directional rendering processing is used to adjust rendering parameters according to the display perspective of the three-dimensional character model.
[0113] Anti-aliasing refers to smoothing the texture edges of a 2D virtual character image by filtering it to eliminate jagged distortions in texture contours, component boundaries, and line areas, thereby improving the edge detail of the texture data and making the optimized texture data clearer and more natural when mapped and displayed on a 3D character model.
[0114] For example, when rendering 2D virtual character image textures based on SceneCaptureComponent2D, post-processing functions such as multisample anti-aliasing (MSAA) or fast approximate anti-aliasing (FXAA) can be enabled.
[0115] Color difference repair processing refers to the correction and calibration of the texture and color of two-dimensional virtual character images, eliminating color shift, color distortion, and abnormal brightness caused by image acquisition, compression, or rendering, so that the color representation of texture data matches the material properties and lighting environment of the three-dimensional character model, ensuring the display effect of the three-dimensional virtual character image is realistic and consistent.
[0116] For example, in the UE4 virtual engine, by combining the highlight distribution and shadow outline data in the lighting projection information, the color deviation of the texture of the two-dimensional virtual character image can be repaired through the color correction node, gamma correction, brightness and contrast adjustment in the material editor.
[0117] Targeted rendering refers to adaptively adjusting the rendering direction, detail weight, and display ratio of texture data based on the current display perspective of the 3D character model and the interaction perspective corresponding to the interaction trigger position. This allows the optimized texture data to fit the spatial posture of the 3D character model, improving the matching degree between texture mapping and the 3D model.
[0118] For example, after optimizing the texture data using the above method, optimized texture data is obtained. The texture mapping strategy corresponding to the 3D character model of the virtual character is then invoked, and the optimized texture data is combined to generate a 3D virtual character image.
[0119] The texture mapping strategy for the 3D character model corresponding to the virtual character is a set of rules pre-defined based on the component hierarchy of the 3D character model, the texture distribution characteristics of the 2D virtual character image, and the hierarchical occlusion relationships represented by the hierarchical rendering information. This strategy clarifies the specific attachment rules for the optimized 2D virtual character image texture data on each component (hair, face, clothing, accessories) of the 3D character model. The texture mapping strategy includes, but is not limited to, the attachment position and range of textures on each component, and the attachment angle adapted to the spatial pose of the 3D character model. This ensures that the texture mapping accurately reproduces the appearance features of the 2D virtual character while conforming to the three-dimensional structure of the 3D character model.
[0120] The generation process of texture mapping strategy requires combining the hierarchical rendering information and lighting projection information of the 3D character model with the texture data features of the 2D virtual character image. For example, the spatial position and contour shape data of each component of the 3D character model are obtained to determine the area where textures can be attached to each component; the hierarchical occlusion relationship in the hierarchical rendering information is combined to determine the attachment priority of textures on different components (to avoid over-rendering of textures on occluded components); the light and shadow distribution characteristics in the lighting projection information are combined to adjust the attachment angle of textures on each component, ensuring that the texture mapping can adapt to the lighting and shadow performance of the 3D character model; and the positioning parameters of SceneBuoy (scene offset anchor point) and CaptureRoot (capture rotation anchor point) in the blueprint file (e.g., BP_HallCharacter) are associated to generate a texture mapping strategy that adapts to the dynamic adjustment of the interactive viewpoint, which is stored in the associated configuration file of the 3D character model for subsequent use.
[0121] SceneBuoy is an anchor point object in the virtual engine used to locate the reference position and offset of a 3D character model in the scene. It is used to determine the spatial position reference of the character model during texture mapping and scene capture, and is equivalent to the "fixed coordinate origin" of the entire character in the scene. CaptureRoot is the rotation and view reference anchor point in the scene capture and texture mapping process. It is used to determine the rotation center, orientation, and viewing angle of the scene capture component and the texture mapping view.
[0122] For example, in the UE4 virtual engine, based on the interaction viewpoint determined by the position offset, and combined with SceneBuoy and CaptureRoot in the blueprint file (e.g., BP_HallCharacter), the texture (UV) coordinates and projection method of the 2D virtual character image texture are dynamically adjusted so that the optimized texture data is attached to the corresponding parts of the 3D character model according to the texture mapping strategy: if the texture mapping strategy indicates that the 2D texture needs to be attached to the facial area of the 3D character model, covering the complete facial contour and the attachment angle is adapted to the current interaction viewpoint, then the offset reference of the facial area is determined by SceneBuoy, the rendering viewpoint is adjusted by CaptureRoot, and the UV coordinates are adjusted synchronously to make the texture accurately fit the facial contour, ensuring that there is no offset, stretching or occlusion abnormality after texture mapping. Combined with the optimized texture data and mapping effect, a 3D virtual character image that fits the stereoscopic features of the 3D character model is generated.
[0123] This application embodiment optimizes the texture data of a two-dimensional virtual character image, effectively eliminating defects such as jagged edges and color deviations, improving the fineness and realism of the texture data, and providing a high-quality data foundation for subsequent texture mapping. Combined with the texture mapping strategy of the corresponding three-dimensional character model, the attachment position, attachment range, and attachment angle of the optimized texture data on the three-dimensional character model are clearly defined. This ensures that the optimized texture data can accurately fit the component hierarchy structure of the three-dimensional character model, adapt to the spatial hierarchy relationship represented by the layer rendering information and the light and shadow effects reflected by the lighting projection information, so that the determined three-dimensional virtual character image can more realistically and clearly present the three-dimensional features of the three-dimensional character model and the appearance details of the two-dimensional virtual character, improve the display quality and three-dimensional expression of the three-dimensional virtual character image, enhance the visual experience during user interaction, and reduce the adaptation difficulty of texture mapping.
[0124] In the exemplary embodiments of this application, after determining the two-dimensional data information, a three-dimensional feature mapping image, i.e., a three-dimensional virtual character image, can be generated based on the two-dimensional data information. The process of generating a three-dimensional virtual character image based on two-dimensional data information involves converting the two-dimensional data information, which includes hierarchical occlusion relationships, specular distribution, shadow contours, semi-transparent light and shadow overlay effects, and optimized texture data, into a screen that can be displayed on a two-dimensional interface through rendering processing. This allows the final displayed three-dimensional virtual character image to present the spatial hierarchical structure of the three-dimensional character model and to have a stereoscopic visual effect on the two-dimensional screen.
[0125] After determining the 3D virtual character image, the 2D virtual character image is hidden from the background image, and the virtual character animation is displayed as a 3D virtual character image.
[0126] For example, virtual character animation refers to an animation sequence that uses 3D virtual character images and displays the texture data, hierarchical rendering information, or lighting projection information of the 3D virtual character images frame by frame to drive the virtual character to present dynamic actions, expressions, or special effects.
[0127] Displaying virtual character animations on a background image in the form of three-dimensional virtual character images can include two cases: (1) displaying static three-dimensional virtual character images on a background image; (2) displaying virtual character animations composed of multiple static three-dimensional virtual character images on a background image.
[0128] After obtaining the 3D virtual character image, based on the preset frame rate or interactive events, the texture data, layer rendering information and lighting projection information are adjusted in sequence to generate multiple consecutive 3D virtual character images. Arranging the multiple 3D virtual character images in chronological order forms a playable animation sequence, i.e., virtual character animation.
[0129] It should be noted that the image can be a single static 3D virtual character image or a dynamic animation sequence composed of multiple 3D virtual character images. This application does not impose any restrictions on this.
[0130] After determining the 3D virtual character image, the terminal device triggers operations and interaction trigger positions based on the detected 2D image. Relying on the display board rendering logic carried by the blueprint file (BP_HeroDisplayBoard), while maintaining the normal display of the background image, it uniformly manages the display status of the virtual character through BP_HallAvatarSubsystem.lua (the system script of the virtual character).
[0131] The core control class for displaying characters inside and outside the game is BP_HallCharacterAgent.lua (Lobby Character Agent Script). It dynamically creates and mounts subclass objects of BP_HallHeroBase (Lobby Character Base Class) (e.g., BP_Hall_Hero_2), and completes the instantiation and loading of the 3D character model through the SpawnSkinAvatar (Generate Character Image) function.
[0132] While maintaining the normal display of the background image, stop rendering the 2D virtual character image output by the rendering target RT corresponding to the SceneCapture layer in the WBP_HeroDisplayBoard2D of UMG (Unreal Motion Graphics), and release the related image resources occupied by the 2D virtual character image. Here, WBP_HeroDisplayBoard2D is a general-purpose 2D display board based on UMG; RT is the specified rendering target for the SceneCapture output content. For example, RT includes texture data corresponding to each rendering layer.
[0133] The system dynamically adds a subclass of BP_HallHeroBase (e.g., BP_Hall_Hero_2) to the already generated 2D data information BP_HallCharacterAgent.lua, and then uses the SpawnSkinAvatar function (which generates a character instance with skin) to generate and load the 3D character instance. When the SpawnSkinAvatar function is called, it receives the type of hero character to be displayed (e.g., BP_Hall_Hero_2), and automatically loads the virtual character's skin, appearance, and other resources.
[0134] Then, the SceneCaptureComponent2D rendering component in the UE4 engine is used to complete the drawing and output of the 3D virtual character image. The 3D virtual character image is rendered to the display area of the original 2D virtual character image in WBP_HeroDisplayBoard2D, realizing the replacement of the 2D display board with the 3D display board and completing the switch from flat display to three-dimensional display on the background image.
[0135] Figure 4 This is a schematic diagram of an interactive interface for displaying a three-dimensional virtual character image, provided in an embodiment of this application. For example... Figure 4As shown, after the two-dimensional image is triggered, the two-dimensional virtual character image is de-displayed in the interactive interface, and a three-dimensional virtual character image 402 is displayed on the background image 401. The three-dimensional virtual character image 402 is essentially two-dimensional data, but it can display the control hierarchy of the three-dimensional character model.
[0136] This application embodiment displays a two-dimensional image containing a background image and a two-dimensional virtual character image. After the two-dimensional image is triggered, the display of the two-dimensional virtual character image is canceled on the same background image, and the virtual character animation is displayed as a three-dimensional virtual character image. The virtual character animation can display the spatial hierarchy of the virtual character. It can realize the switching of the virtual character display from two-dimensional to three-dimensional without switching the overall display interface and loading new background resources. The spatial hierarchy of the virtual character is presented on the two-dimensional display interface, which improves the three-dimensional realism of the virtual character display. It avoids the problem of insufficient three-dimensionality of two-dimensional virtual character image display and the problem of additional resource loading required for three-dimensional virtual character model display. It retains the low resource consumption advantage of two-dimensional display and restores the key features and spatial hierarchy of three-dimensional character model. It makes the display of virtual character dynamically adaptable to the virtual character, with detailed expression, and balances the display effect and performance overhead of virtual character.
[0137] In an exemplary embodiment of this application, the virtual character display area of the interactive interface may also display decorative elements associated with the three-dimensional virtual character image. The decorative elements include at least one of borders, special effects, stickers, or achievement icons, and each decorative element is at a different display level from the three-dimensional virtual character image.
[0138] For example, decorative elements are used to enrich the display effect of 3D virtual character images. Decorative elements include, but are not limited to, borders, effects, stickers, and achievement icons.
[0139] Borders are used to surround the 3D virtual character image, defining the display area of the virtual character. Borders can have different styles, such as minimalist, elaborate, or limited edition.
[0140] Special effects are used to create dynamic lighting and shadow effects around or on the surface of 3D virtual character images, enhancing their three-dimensionality and visual impact. Examples of special effects include, but are not limited to, halos, particles, and flickering effects.
[0141] Stickers are applied to designated areas of 3D virtual character images to create personalized decorative effects. They can be selected by the user or automatically matched based on the virtual character's attributes.
[0142] Achievement icons are used to display the achievements of the user corresponding to the virtual character. Examples include level achievements, quest achievements, and competition achievements. Achievement icons can be presented as icons, text, or a combination thereof.
[0143] A 3D virtual character image can be associated with at least one decorative element. That is, a 3D virtual character image can be paired with multiple decorative elements such as borders, special effects, and achievement icons. Each decorative element and the 3D virtual character image are located at different display levels. This hierarchical distinction ensures that the core three-dimensional features of the 3D virtual character image are always in the visual focus position. The decorative elements only play a supporting role in decoration and information supplementation, and do not interfere with the normal display of the 3D virtual character image.
[0144] It should be noted that the content of the decorative elements in this application is illustrative only. Other decorative elements for virtual characters can also be set according to the actual situation, and this application does not limit this.
[0145] Display hierarchy refers to the display priority and spatial stacking order of various display elements (including 3D virtual character images and various decorative elements) in the interactive interface. It is used to determine the vertical stacking relationship of different display elements. Elements in higher priority display hierarchies will be stacked on top of elements in lower priority display hierarchies to avoid occlusion and confusion between different display elements and ensure that each display element can be displayed clearly and orderly.
[0146] Each display layer contains a class of display elements or multiple display elements with the same display priority. The elements in the same display layer do not obscure each other and are presented collaboratively. The priority of each display layer can be preset based on actual display needs and can be dynamically adjusted according to the display status of the virtual character.
[0147] For example, the display hierarchy priority can be preset from high to low as follows: achievement icon level, special effects level, 3D virtual character image level, and border level. In this case, the achievement icon will be superimposed on the top, the border will be superimposed on the bottom, and the 3D virtual character image will be in the middle core level. This ensures both the visibility of the achievement icon and that the core three-dimensional features of the 3D virtual character image are not obscured.
[0148] Figure 5 This is a schematic diagram illustrating different levels provided in an embodiment of this application. For example... Figure 5 As shown, the display layers from high to low are achievement icon layer, sticker layer, border layer, virtual character layer (3D feature virtual character layer), special effects layer, and background image layer. Each display layer is stacked and displayed in a preset priority order. The higher the priority of the display layer, the closer its corresponding display elements are to the user's visual level.
[0149] This application's embodiments enrich the display format of 3D virtual character images by associating decorative elements such as borders, special effects, stickers, or achievement icons with the 3D virtual character image. This highlights the personalized content of the virtual character and enhances the visual aesthetics and fun of the interactive interface. By setting each decorative element and the 3D virtual character image to different display levels, the decorative elements avoid obscuring the core three-dimensional features and detailed textures of the 3D virtual character image. This ensures a clear spatial hierarchy of the 3D character model presented by the 3D virtual character image, and that the decorative elements do not interfere with each other. This approach retains the three-dimensional display advantages of the 3D virtual character image while simultaneously enriching the displayed information of the virtual character through decorative elements.
[0150] In an exemplary embodiment of this application, when the trigger operation of the two-dimensional image indicates a change in the interactive trigger position, an updated background image, an updated three-dimensional virtual character image, and updated decorative elements are displayed. The updated background image, the updated three-dimensional virtual character image, and the updated decorative elements are determined based on the interactive trigger position.
[0151] For example, when an interactive trigger operation occurs (such as the mouse moving over the virtual character display area, clicking different interactive points on the interface, or sliding to adjust the view), the corresponding interactive position will also change. The process of determining the interactive trigger position has already been explained in step 202 and will not be repeated here.
[0152] The process of generating the updated background image, the updated 3D virtual character image, and the updated decorative elements includes, but is not limited to, steps B1 to B3.
[0153] In step B1, the adjustment parameters are determined based on the trigger operation indication interactive trigger position of the two-dimensional image. The adjustment parameters include at least one of the following: viewpoint adjustment parameters, texture sampling parameters, or lighting adaptation parameters.
[0154] For example, the adjustment parameters are a set of core parameters used to adjust the rendering state and presentation effects of various display elements. These adjustment parameters include, but are not limited to, viewpoint adjustment parameters, texture sampling parameters, and lighting adaptation parameters. Viewpoint adjustment parameters are used to adjust the display angle of the 3D character model, the capture viewpoint of SceneCaptureComponent2D, and the spatial pose of the drawing frame. Viewpoint adjustment parameters include, but are not limited to, the rotation angle of the drawing frame Actor (object), and the offset of the virtual camera attached to SceneCaptureComponent2D relative to anchor points (e.g., SceneBuoy, CaptureRoot). Texture sampling parameters are used to adjust the sampling precision and range of the 3D character model texture, background texture, and decorative element texture to ensure clear texture rendering and adaptation to the sampling resolution. Lighting adaptation parameters are used to adjust the lighting effects of the 3D virtual character image and decorative elements to adapt to the lighting environment corresponding to the current interactive position.
[0155] After detecting a change in the interaction trigger position (e.g., a change in the mouse hover position on the character drawing frame), the position offset is determined using the interaction trigger position and the reference display position. The process of determining the position offset is explained in detail in step A12 and will not be repeated here.
[0156] Based on the position offset and the preset parameters of the camera anchor point of SceneCaptureComponent2D in the Actor blueprint, a correlation is established between the position offset and various adjustment parameters. For example, for the viewpoint adjustment parameters, the rotation angle of the Actor and the camera anchor point offset of SceneCaptureComponent2D are calculated according to a preset ratio based on the X / Y / Z axis offset data of the position offset (the larger the position offset, the greater the adjustment range of the corresponding rotation angle and anchor point offset, ensuring the viewpoint adapts to the interaction position). For the texture sampling parameters, the precision and range of texture sampling are adjusted according to the interaction area range corresponding to the position offset. If the position offset causes the interaction viewpoint to move closer, the texture sampling precision is increased; if the viewpoint moves further away, the sampling precision is decreased. For the lighting adaptation parameters, the lighting intensity, lighting direction, and other parameters are adjusted according to the lighting environment of the interaction position corresponding to the position offset. For example, when the mouse hover position is biased towards the left side of the character's frame, the lighting direction is adjusted to the left to simulate realistic lighting effects, ensuring that the lighting adapts to the current interaction position.
[0157] In step B2, the sampling resolution is determined based on the rendering resolution, which refers to the resolution of the area where the virtual character is displayed, and the sampling resolution is the resolution used to sample the 3D character model to obtain 2D texture data.
[0158] For example, rendering resolution refers to the actual display resolution of the virtual character display area (i.e., the character frame) in the interactive interface. The overall resolution of the current interactive interface is obtained, and the actual rendering resolution of the character frame is calculated based on the preset proportion and layout parameters of the character frame within the interactive interface, combined with the display requirements corresponding to the interaction trigger position. The rendering resolution directly determines the display clarity of the virtual character, background, and decorative elements in the interface, and can be dynamically adapted according to the size of the interactive interface.
[0159] For example, if the overall resolution of the current interactive interface is 2560×1440, and the default proportion of the character's drawing frame in the interactive interface is 40%, then based on the layout parameters, the rendering resolution of the character's drawing frame can be calculated to be 1024×576. If the interaction trigger is an interface zoom-in operation, and the clarity of the character's display needs to be improved, then the proportion of the character's drawing frame can be dynamically adjusted to 50%, and the corresponding rendering resolution will be updated to 1280×720, thus achieving dynamic adaptation of the rendering resolution.
[0160] Sampling resolution is the resolution used when performing texture sampling on a 3D character model to generate 2D texture data. Sampling resolution is positively correlated with rendering resolution. After determining the rendering resolution, the sampling resolution is determined based on the rendering resolution and the stereoscopic display requirements of the 3D virtual character image, according to a preset ratio (e.g., 1:1, 1.2:1, etc.).
[0161] For example, if the rendering resolution is 1080×1920, the sampling resolution can be set to 1080×1920 at a 1:1 ratio. If you need to enhance texture details, you can adjust the sampling resolution to 1440×2560.
[0162] In step B3, an updated background image, an updated 3D virtual character image, and updated decorative elements are generated based on the sampling resolution and adjustment parameters.
[0163] For example, after determining the sampling resolution and adjustment parameters, the three-dimensional character model resource is called, and the three-dimensional character model is subjected to texture sampling operation using the sampling resolution to obtain two-dimensional texture data; then the two-dimensional texture data obtained by sampling is adapted and adjusted using the adjustment parameters to obtain the updated three-dimensional virtual character image.
[0164] For example, by applying viewpoint adjustment parameters and combining the camera anchor point position of SceneCaptureComponent2D with the rotation angle of the drawing frame Actor, the display viewpoint of the 3D character model can be adjusted to simulate a pseudo-3D effect. When the mouse hovers, the rotation angle of the drawing frame Actor and the position of SceneCaptureComponent2D are adjusted to tilt the drawing frame towards the mouse direction, generating a 3D virtual character image adapted to the current viewpoint. Lighting and shadow adaptation parameters are applied to adjust the lighting and shadow effects of the 3D virtual character image to match the lighting and shadow environment corresponding to the interaction trigger position. Texture sampling parameters are applied to optimize texture details.
[0165] For the updated background image: Based on the viewpoint adjustment parameters and lighting adaptation parameters in the adjustment parameters, the viewpoint offset and lighting intensity of the original background image are adjusted to adapt it to the pseudo-3D viewpoint of the 3D virtual character image, and the background texture is optimized in combination with the sampling resolution to obtain the updated background image.
[0166] For the updated decorative elements: Based on the adjustment parameters and sampling resolution, the display style, position, and details of the borders, effects, stickers, and achievement icons are adjusted respectively. For example, the border size is adjusted to adapt to the sampling resolution, the light and shadow intensity and particle density of the effects are adjusted to adapt to the current lighting environment, the attachment position of the stickers is adjusted to adapt to the perspective of the 3D virtual character image, and the display angle of the achievement icons is adjusted to adapt to the pseudo-3D pose of the drawing frame, resulting in the updated decorative elements.
[0167] This application's embodiments determine at least one adjustment parameter among perspective adjustment parameters, texture sampling parameters, or lighting and shadow adaptation parameters based on the trigger operation indication interaction trigger position of a two-dimensional image. This enables subsequent generated display elements to accurately adapt to the interaction trigger position, improving the linkage between interactive operations and displayed content. Determining the sampling resolution based on the rendering resolution ensures that the sampling resolution matches the resolution of the area displaying the virtual character, controlling rendering resource consumption and avoiding rendering anomalies caused by excessively high or low sampling resolutions. Based on the sampling resolution and adjustment parameters, updated background images, updated 3D virtual character images, and updated decorative elements are generated. This ensures that the generated display elements are coordinated and unified in terms of resolution, perspective, texture, and lighting and shadow effects. Consequently, the updated 3D virtual character image stably presents the spatial hierarchy of the 3D character model, and the updated background image and updated decorative elements adapt to display requirements, thereby improving the stability, smoothness, and visual presentation effect of the virtual character display.
[0168] In the exemplary embodiment of this application, after generating the updated background image, the updated 3D virtual character image, and the updated decorative elements, the rendering of the original display elements is stopped and the corresponding image resources are released based on the SpineRuntime component and rendering component in the UE4 engine to avoid the overlapping and disorder of the old and new elements; then, according to the preset display hierarchy rules, the updated background image, the updated 3D virtual character image of the virtual character, and the updated decorative elements are loaded and rendered in sequence.
[0169] The SpineRuntime component is an engine plugin for rendering Spine skeletal animations. It supports importing 2D skeletal animation resources into the virtual engine to achieve smooth character effects, sticker animations, and other dynamic effects. For dynamic effects and stickers in decorative elements, SpineRuntime enables smooth animation rendering, allowing the particle movement of dynamic effects and the animation effects of stickers to coordinate with the pseudo-3D perspective of the 3D virtual character image and the background image. Furthermore, based on the rendering capabilities of SceneCaptureComponent2D, the generated 3D virtual character image is accurately rendered to the specified area of the character's drawing frame.
[0170] In an exemplary embodiment of this application, when there are multiple virtual characters, the corresponding three-dimensional virtual character image is displayed in the display area indicated by the layout information. The three-dimensional virtual character image is determined based on two-dimensional data information adapted to the rendering resolution of the display area. The two-dimensional data information is used to reflect the three-dimensional spatial hierarchy of the virtual character to determine the three-dimensional virtual character image. The layout information indicates the display area of each virtual character in the interactive interface. The layout information is determined based on the number of virtual characters to be displayed.
[0171] For example, multiple virtual characters can be displayed simultaneously in the interactive interface. When there are multiple virtual characters to be displayed, the layout information is determined based on the number of virtual characters to be displayed. The layout information indicates the display area of each virtual character in the interactive interface. The layout information includes, but is not limited to, the position information, size information, arrangement information, and rendering resolution information of each display area.
[0172] For example, when there are four virtual characters to be displayed, a four-grid layout can be used to divide the interactive interface into four display areas, each of which is used to display the 3D virtual character image corresponding to one virtual character.
[0173] After determining the layout information, the corresponding 3D virtual character image is determined within the display area indicated by the layout information. The process of determining the corresponding 3D virtual character image within the display area indicated by the layout information includes, but is not limited to, steps C1 to C3.
[0174] In step C1, first shared texture information is determined based on the 3D character model of each virtual character. The first shared texture information represents the texture information of the same rendering target corresponding to multiple virtual characters.
[0175] The first shared texture information refers to the set of intermediate texture data corresponding to and belonging to the same main rendering target after multiple virtual characters have undergone basic rendering. It is used to realize the unified scheduling and merging of rendering resources for multiple virtual characters.
[0176] The method for determining the first shared texture information is as follows: assign an independent scene capture unit to each virtual character, perform a basic rendering process on the corresponding 3D character model through each scene capture unit to obtain the basic rendering texture corresponding to each virtual character, and assign the basic rendering textures corresponding to multiple virtual characters to the same rendering target for unified management to form the first shared texture information.
[0177] For example, when there are 4 virtual characters to be displayed, the terminal device creates and assigns an independent scene capture unit for each of the 4 virtual characters in the virtual engine, with corresponding identifiers as Scene Capture0, SceneCapture1, Scene Capture2, and Scene Capture3. Each scene capture unit is attached to an independent character drawing frame Actor and corresponds to a 3D character model of a virtual character.
[0178] Each scene capture unit performs a basic rendering process only on the 3D character model it is bound to. The basic rendering process includes model drawing, basic texture sampling, and initial lighting and shadow calculation, but does not include post-processing. This results in basic rendering textures for the four virtual characters. The terminal device assigns the basic rendering textures for the four virtual characters to the same rendering target (RT) for management. The rendering target RT uniformly carries and stores the four basic rendering textures, forming the first shared texture information.
[0179] In step C2, multiple two-dimensional data information adapted to the rendering resolution of the display area are generated based on the first shared texture information.
[0180] For example, two-dimensional data information refers to texture data information that has undergone unified post-processing and is adapted to the rendering resolution of the corresponding display area, and is used to finally render and present a three-dimensional virtual character image.
[0181] The process of generating two-dimensional data information based on the first shared texture information is as follows: the basic rendering textures corresponding to each virtual character in the first shared texture information are merged, and the unified main viewport performs post-processing on the merged rendering result to obtain two-dimensional data information adapted to the rendering resolution of each display area.
[0182] For example, the rendering results output by the four scene capture units (Scene Capture 0~3) (i.e., four base rendering textures without post-processing, all stored in the same rendering target RT) are merged into the rendering buffer of the main viewport at once through the rendering buffer interface of the UE4 engine. During the merging, the main viewport allocates the rendering results of the four scene capture units to the four independent partitions of the buffer according to the four-grid layout partitioning rules. The coordinate range and size parameters of each partition correspond one-to-one with the screen coordinates and size of the four display areas in the four-grid.
[0183] The main viewport uses a preset post-processing workflow to perform post-processing on the rendering results of the four partitions in the render buffer. The post-processing workflow includes, but is not limited to, anti-aliasing, lighting and shadow optimization, texture sharpening, color adjustment, and resolution calibration.
[0184] In the resolution calibration process, the main viewport will fine-tune the resolution of the corresponding partition according to the preset rendering resolution of each display area in the four-grid (e.g., 540×960) to ensure that the resolution of the processed rendering result of each partition is adapted to the rendering resolution of the corresponding display area.
[0185] After the post-processing workflow is completed, the main viewport outputs four independent final rendering information sets. Each final rendering information set corresponds to a virtual character, and the resolution matches the rendering resolution of the corresponding display area in the four-grid. The final rendering information is two-dimensional data information, and the four sets of two-dimensional data information sets correspond to the virtual character display requirements of the four display areas in the four-grid.
[0186] In step C3, a three-dimensional virtual character image is generated using multiple two-dimensional data information adapted to the rendering resolution of the display area.
[0187] For example, the terminal device, based on the position, size, and rendering resolution of each display area determined by the layout information, calls the corresponding two-dimensional data information and, combined with the rendering capabilities of the display area, generates a three-dimensional virtual character image that is adapted to the display area.
[0188] For example, in a four-grid layout, the 2D data information corresponding to Scene Capture0 corresponds to the first display area, the 2D data information corresponding to Scene Capture1 corresponds to the second display area, and so on. The main viewport directly calls the merged rendering result after post-processing, and renders the 2D data information corresponding to each virtual character to the corresponding display area according to the screen coordinates and size parameters of the display area indicated by the layout information. During the rendering process, the main viewport calls the SpineRuntime engine plugin, and based on the perspective parameters of SceneCaptureComponent2D, converts the final rendered texture corresponding to the 2D data information into an image with a pseudo-3D perspective effect, that is, generates a 3D virtual character image from the 2D data information adapted to the rendering resolution of the display area.
[0189] This application embodiment determines the first shared texture information representing the texture information of multiple virtual characters corresponding to the same rendering target based on the three-dimensional character models of each virtual character. This enables the unified carrying, management and sharing of rendering texture resources for multiple virtual characters, effectively reducing the occupation of rendering resources, improving rendering efficiency, and avoiding resource waste and rendering lag caused by rendering multiple virtual characters individually. Based on the first shared texture information, multiple two-dimensional data information adapted to the rendering resolution of the display area are generated. The two-dimensional data information is combined to generate three-dimensional virtual character images, so that the three-dimensional virtual character images of each virtual character are accurately matched with the rendering resolution of the corresponding display area. This takes into account both the uniformity and individual adaptability of rendering multiple virtual characters, ensuring that the three-dimensional virtual character images can clearly present the spatial hierarchical structure of the corresponding three-dimensional character model, and realizing the efficient, orderly and clear display of multiple virtual characters.
[0190] After obtaining multiple 3D virtual character images adapted to the rendering resolution of the display area, the 3D virtual character images can be displayed in the corresponding display areas. The process of displaying the 3D virtual character images has already been explained above and will not be repeated here.
[0191] Figure 6 This is a schematic diagram of an interactive interface for displaying multiple virtual characters, provided in an embodiment of this application. Figure 6 As shown, the interactive interface can display a dividing line 601, which divides the interactive interface into four display areas 602. In any display area 602, a three-dimensional virtual character image 603 adapted to the rendering resolution of the display area is displayed.
[0192] In this embodiment, when there are multiple virtual characters, the layout information is determined based on the number of virtual characters to be displayed. Then, the corresponding three-dimensional virtual character image is displayed in the display area indicated by the layout information. The three-dimensional virtual character image is determined based on two-dimensional data information adapted to the rendering resolution of the display area. This enables the orderly layout and adaptive display of multiple virtual characters in the interactive interface, avoiding the problems of overlapping, occlusion, or display chaos of the three-dimensional virtual character images of multiple virtual characters. It ensures that the three-dimensional virtual character image is adapted to the rendering resolution of the corresponding display area, and guarantees the clarity and visual coordination of the display of multiple virtual characters.
[0193] Optionally, before displaying the corresponding 3D virtual character image in the display area indicated by the layout information, the 3D virtual character image can be calibrated, and the calibrated 3D virtual character image can be displayed. The process of displaying the calibrated 3D virtual character image includes, but is not limited to, steps D1 to D2.
[0194] In step D1, rendering calibration is performed on multiple 3D virtual character images adapted to the rendering resolution of the display area using the first rendering calibration parameter and the second rendering calibration parameter to obtain calibrated 3D virtual character images. The first rendering calibration parameter is used to calibrate the rendering depth range of the display area corresponding to the 3D virtual character image, and the second rendering calibration parameter is used to calibrate the sampling resolution for generating 2D data information.
[0195] In the exemplary embodiments of this application, the first rendering calibration parameters refer to a set of parameters used to limit and calibrate the rendering depth range of the 3D virtual character image within the display area; the first rendering calibration parameters include, but are not limited to, the near clipping plane distance, the far clipping plane distance, the depth test threshold, and the depth buffer accuracy corresponding to the display area. The first rendering calibration parameters are used to calibrate the rendering depth range of the display area corresponding to the 3D virtual character image, avoiding problems such as clipping, truncation, blurring, or inability to properly overlay and display the 3D virtual character image due to an excessively large or small depth range.
[0196] For example, based on the rendering range of the first clipping plane and the second clipping plane corresponding to the display area of the 3D virtual character image of each virtual character, a first rendering calibration parameter is obtained. In the direction perpendicular to the display area, the first distance between the first clipping plane and the display area is less than the second distance between the second clipping plane and the display area.
[0197] In a direction perpendicular to the display area, multiple clipping planes can be included. These clipping planes are used to spatially truncate the rendered content in 3D space, retaining the rendered content between the clipping planes for rendering. The first clipping plane is the near clipping plane, which is closer to the display area and the camera's viewpoint, and is used to remove invalid rendered content that is too close to the camera. The second clipping plane is the far clipping plane, which is farther from the display area and the camera's viewpoint.
[0198] Based on the actual space occupied by the 3D character model within the display area, the model size, and the camera anchor point position of SceneCaptureComponent2D, determine the minimum near clipping distance and the maximum far clipping distance required for the 3D character model to be fully displayed. The range between the minimum near clipping distance and the maximum far clipping distance is the rendering range.
[0199] The determined near clipping plane distance and far clipping plane distance are used as the near clipping value and far clipping value in the first rendering calibration parameters, respectively. The depth buffer accuracy is determined by combining the depth value of the rendering range, thereby obtaining the first rendering calibration parameters.
[0200] For example, the rendering resolution is determined based on the size information corresponding to the display area of the 3D virtual character image of each virtual character, and the second rendering calibration parameters are obtained.
[0201] Each virtual character corresponds to an independent display area, which has corresponding size information such as width, height, and number of pixels. After determining the size information of the virtual character's display area, the width and height pixel values of the display area are directly determined as the rendering resolution corresponding to the display area.
[0202] The sampling resolution is determined using the rendering resolution, and the sampling resolution, preset scale, and texture sampling precision are set as the second rendering calibration parameters. The process of determining the sampling resolution using the rendering resolution, as well as the relevant content of the preset scale and texture sampling precision, have been explained in steps B1 and B2, and will not be repeated here.
[0203] After determining the first and second rendering calibration parameters, the first parameter is passed to the depth rendering pipeline of SceneCaptureComponent2D to calibrate the depth range of the 3D virtual character image, ensuring the 3D character model lies completely between the near and far clipping planes. The second parameter is then applied to the texture sampling process, adjusting the sampling resolution according to the rendering resolution to match the sampled 2D texture data with the display area resolution. After calibration, the 3D virtual character image is re-rendered and integrated to obtain the calibrated 3D virtual character image.
[0204] In step D2, the corresponding calibrated 3D virtual character image is displayed in the display area indicated by the layout information.
[0205] For example, according to the display area position, arrangement and size of each virtual character indicated by the layout information, the calibrated 3D virtual character images are rendered into the corresponding display areas.
[0206] This application embodiment determines the first rendering calibration parameters by the rendering range of the first and second clipping planes corresponding to the display area, and determines the rendering resolution based on the size information of the display area to obtain the second rendering calibration parameters. Then, the first rendering calibration parameters are used to calibrate the rendering depth range of the display area corresponding to the 3D virtual character image, and the second rendering calibration parameters are used to calibrate the sampling resolution of the generated 2D data information. This enables the calibrated 3D virtual character image to match the rendering depth with the display area, avoiding depth truncation, model clipping, or image anomalies. Furthermore, it keeps the sampling resolution adapted to the rendering resolution of the display area, ensuring the texture clarity and image integrity of the 3D virtual character image. As a result, when the corresponding calibrated 3D virtual character image is displayed in the display area indicated by the layout information, the display effect of multiple virtual characters is more stable, clear, and visually consistent.
[0207] In an exemplary embodiment of this application, when the virtual character completes an interaction, a 3D virtual character image adapted to the rendering resolution of the settlement display area is determined. The process of determining the 3D virtual character image adapted to the rendering resolution of the settlement display area includes, but is not limited to, steps E1 to E5.
[0208] In step E1, when the virtual character completes the interaction, the three-dimensional character model of the virtual character that has completed the interaction is sampled in two dimensions to obtain two-dimensional sampling data.
[0209] For example, there can be multiple virtual characters that complete the interaction. These multiple virtual characters can be virtual characters from the same team or virtual characters from opposing teams. When a virtual character completes the interaction, an independent scene capture unit is assigned to each virtual character that has completed the interaction based on the virtual engine. The scene capture unit is bound to the corresponding 3D character model. The scene capture unit performs a basic rendering process on the bound 3D character model, including model drawing, basic texture sampling, and initial lighting and shadow calculation. In the basic rendering process, the 2D projection and texture acquisition of the 3D character model are completed, thereby obtaining the corresponding 2D sampling data.
[0210] For example, when there are 4 virtual characters that have completed the interaction, each of the 4 characters is assigned an independent scene capture unit (Scene Capture 0~3). Each scene capture unit only performs the basic rendering process on the 3D character model of the virtual character that it is bound to and has completed the interaction. The basic rendering process includes model drawing, basic texture sampling, and initial lighting and shadow calculation, but does not include post-processing. This results in the 2D sampling data corresponding to the 4 virtual characters that have completed the interaction.
[0211] In step E2, the two-dimensional sampled data is merged to obtain merged data.
[0212] For example, merged data refers to the texture data set obtained by centrally integrating the two-dimensional sampling data corresponding to multiple virtual characters that have completed interactions, which is used to realize the unified scheduling and centralized processing of multi-character sampling data.
[0213] For example, by specifying a scene capture unit (e.g., the last scene capture unit, i.e. Scene Capture3), the two-dimensional sampling data corresponding to the four virtual characters can be merged in a unified manner, integrating the four independent two-dimensional sampling data into a whole texture data set, thus obtaining the merged data.
[0214] In step E3, the merged data is processed uniformly to obtain the second shared texture information. The second shared texture information represents the texture information of the same rendering target corresponding to multiple virtual characters that have completed the interaction.
[0215] For example, the second shared texture information refers to the final rendered texture information corresponding to and belonging to the same rendering target after multiple virtual characters that have completed the interaction have undergone merging and unified post-processing, which is used to realize the unified management and reuse of multi-character settlement display texture resources.
[0216] For example, a unified post-processing workflow is performed on the merged data by a designated scene capture unit. The post-processing workflow includes anti-aliasing, lighting optimization, texture sharpening, color adjustment and resolution calibration. The final rendered texture after processing is output to a shared rendering target (RT), which uniformly carries and stores it to form a second shared texture information.
[0217] In step E4, multiple two-dimensional data information adapted to the rendering resolution of the settlement display area are generated based on the second shared texture information. The two-dimensional data information is used to reflect the three-dimensional spatial hierarchy of the virtual character in order to determine the three-dimensional virtual character image. The settlement display area is the area used to display the virtual character after the virtual character completes the interaction.
[0218] For example, two-dimensional data information refers to the final texture data information that has been uniformly processed and adapted to the rendering resolution of the settlement display area, and is used to present a three-dimensional virtual character image on the settlement interface.
[0219] The process of generating two-dimensional data information based on the second shared texture information is as follows: read the second shared texture information from the shared rendering target (RT), and perform partition adaptation and resolution calibration on the second shared texture information according to the rendering resolution of the settlement display area corresponding to each completed virtual character, and generate multiple sets of two-dimensional data information adapted to the rendering resolution of the corresponding settlement display area.
[0220] In step E5, a three-dimensional virtual character image is determined based on multiple two-dimensional data information adapted to the rendering resolution of the settlement display area.
[0221] For example, based on the location, size, and rendering resolution of the settlement display area, the corresponding two-dimensional data information is called, and combined with the rendering capabilities of the settlement display area, a three-dimensional virtual character image adapted to the rendering resolution of the settlement display area is determined.
[0222] For example, the terminal device reads the final rendering result from the shared rendering target and maps each set of two-dimensional data information to the independent settlement display area of each character. During the rendering process, based on the perspective parameters of the scene capture unit, the final rendering texture corresponding to the two-dimensional data information is transformed into an image with a pseudo-3D perspective effect, thus obtaining a three-dimensional virtual character image that is adapted to the rendering resolution of the settlement display area.
[0223] This application embodiment obtains second shared texture information by performing two-dimensional sampling, data merging, and unified processing on the three-dimensional character model of the virtual character after the virtual character completes the interaction. This enables unified carrying, management, and sharing of rendering texture resources for multiple virtual characters that have completed the interaction, effectively reducing the rendering resource occupation during the settlement stage and improving the loading and rendering efficiency of the settlement screen. Based on the second shared texture information, two-dimensional data information adapted to the rendering resolution of the settlement display area is generated, and three-dimensional virtual character images are determined accordingly. This ensures that the three-dimensional virtual character images of each virtual character displayed during the settlement stage match the rendering resolution of the corresponding settlement display area, guaranteeing the clarity, visual coordination, and pseudo-3D effect of the virtual characters displayed in the settlement interface, and improving the display efficiency and display quality of multiple virtual characters that have completed the interaction in the settlement display area.
[0224] In an exemplary embodiment of this application, when displaying a 3D virtual character image of a virtual character in the settlement interface, the 3D virtual character image of the virtual character is displayed at a first display layer, and settlement elements are displayed at a second display layer. The settlement elements are determined based on the interactive settlement data of the virtual character. The first display layer and the second display layer are different display layers in the interactive interface.
[0225] For example, the interactive interface can be configured with multiple display layers, each with different rendering priorities and display overlay relationships. These display layers are used to distinguish the drawing order and occlusion relationships of different types of displayed content. Higher-priority display layers are overlaid on lower-priority display layers. The first display layer is the underlying character display layer where the 3D virtual character image resides, used to independently support and display the pseudo-3D image of the virtual character, ensuring the character image is fully presented and not obscured by other interface elements. The second display layer is the upper-level information display layer where the settlement elements reside, used to overlay and display various settlement-related interface elements, ensuring that settlement information is clearly displayed on top of the character image.
[0226] Settlement elements are informational elements used to display the results of virtual character interactions, including but not limited to settlement scores, win / loss indicators, character data, reward icons, and battle statistics. The process of determining settlement elements based on virtual character interaction settlement data is as follows: The interaction settlement data generated after the virtual character completes the interaction is obtained; based on the numerical values, types, and status information in the settlement data, the corresponding settlement element resources are matched; and the content, style, and arrangement of the settlement elements are determined, ultimately generating the settlement elements to be displayed.
[0227] Figure 7 This is a schematic diagram of an interactive interface for displaying multiple virtual characters, provided in an embodiment of this application. Figure 7 As shown, the interactive interface (settlement interface) may include settlement display areas 701 corresponding to multiple virtual characters. The settlement display area 701 includes a background image 702 and a 3D virtual character image 703 of the virtual character. Among them, the background image 702 is a special background texture adapted to the settlement scene, used to highlight the 3D virtual character image 703 of the virtual character. The 3D virtual character image 703 presents a pseudo-3D image of the virtual character.
[0228] Each settlement display area 701 corresponds to a set of exclusive settlement elements 704. Settlement element 704 is the settlement result of the interaction of the virtual character in that area. For example, settlement element 704 is the MVP identifier.
[0229] This application embodiment displays the 3D virtual character image and the settlement element in different first and second display layers, respectively, so that the display of the virtual character image and the display of settlement information are independent of each other and the rendering does not interfere with each other. This ensures that the 3D virtual character image can present a complete and stable pseudo-3D effect, and that the settlement element can clearly and intuitively display the interactive settlement data. It realizes the layered rendering and layered display of character display and settlement information, which improves the display clarity, visual hierarchy and user experience of the settlement interface.
[0230] It should be noted that the application scenario of the virtual character display method in this application is illustrated using a game scenario as an example. It can also be applied to digital human interaction scenarios, virtual dress-up scenarios, social platform character preview scenarios, and other scenarios. The application of each scenario will be explained below.
[0231] I. Digital Human Interaction Scenarios.
[0232] In scenarios such as digital human live streaming assistance and enterprise digital human demonstrations, two-dimensional images are displayed. These two-dimensional images include background images such as live streaming backgrounds and corporate promotional backgrounds, as well as two-dimensional images of the digital human superimposed on the background images (e.g., a two-dimensional cover of a digital human anchor, a two-dimensional introduction image of an enterprise digital human). When a viewer or user triggers an action on the two-dimensional image (e.g., clicking on the two-dimensional image), the display of the digital human's two-dimensional image is canceled while the background image remains displayed, and a three-dimensional virtual character image of the digital human is displayed (this can be a single three-dimensional virtual character image or a virtual character animation composed of three-dimensional virtual character images). The three-dimensional virtual character image is generated based on the two-dimensional data information determined by the three-dimensional character model corresponding to the digital human, and can clearly display the spatial hierarchical structure of the digital human's three-dimensional model (e.g., facial contours, limb lines, clothing details), allowing viewers or users to quickly experience the three-dimensional interactivity of the digital human and enriching the form of digital human demonstration.
[0233] II. Virtual Dress-Up Scenarios.
[0234] In scenarios such as virtual dress-up clients and online styling platforms, two-dimensional images are displayed. These images include a dress-up background image (e.g., a styling scene background or a solid color background) and a two-dimensional image of the dressed virtual character superimposed on the background image (e.g., a two-dimensional effect image of the character after the user selects clothing). When the user triggers an action on the two-dimensional image (e.g., clicking "3D Preview" or long-pressing the two-dimensional image), the two-dimensional dress-up character image is de-displayed while the background image remains displayed, and a three-dimensional virtual character image of the dressed-up character is displayed (this can be a single three-dimensional virtual character image or a virtual character animation composed of three-dimensional virtual character images). The three-dimensional virtual character image is derived from the two-dimensional data information determined by the three-dimensional character model (the three-dimensional model carrying the selected clothing) corresponding to the dressed-up virtual character. It can clearly display the spatial hierarchy of the three-dimensional character model after the dress-up (e.g., the three-dimensionality of the clothing's cut, the fit of the clothing to the body, and the spatial position of accessories), helping users to more intuitively judge the dress-up effect and enhancing the virtual dress-up experience.
[0235] III. Social Platform Role Preview Scenarios
[0236] In scenarios such as social media platforms and virtual communities, two-dimensional images are displayed. These images include background images such as the social media platform background and the virtual community scene background, as well as two-dimensional images of the user's virtual character superimposed on the background images (e.g., user avatars, two-dimensional images of virtual community characters). When other users or the user themselves trigger an action on the two-dimensional image (e.g., clicking on an avatar, triggering a command to view character details), while the background image remains displayed, the two-dimensional virtual character image is de-displayed, and a three-dimensional virtual character image of the user's virtual character is displayed (this can be a single three-dimensional virtual character image or a virtual character animation composed of three-dimensional virtual character images). The three-dimensional virtual character image is generated based on the two-dimensional data information determined by the three-dimensional character model corresponding to the user's virtual character. It can clearly display the spatial hierarchical structure of the three-dimensional character model (e.g., the three-dimensional details of the character's hairstyle, clothing, and decorations), enriching the character display format on the social media platform and enhancing the interactive fun between users.
[0237] It should be noted that the application scenario of the virtual character display method in this application is illustrative and can also be applied to other scenarios, and this application does not limit it.
[0238] This application also provides a display device for virtual characters. Figure 8 This is a schematic diagram of the structure of a virtual character display device provided in an embodiment of this application, such as... Figure 8 As shown, the device includes: Display module 801 is used to display a two-dimensional image, which includes a background image and a two-dimensional virtual character image on the background image; The display module 801 is also used to respond to the triggering operation of the two-dimensional image, cancel the display of the two-dimensional virtual character image on the background image and display the virtual character animation with the three-dimensional virtual character image. The virtual character animation is used to display the three-dimensional spatial hierarchy of the virtual character.
[0239] In one possible implementation, the display module 801 is also used to display decorative elements associated with the 3D virtual character image. The decorative elements include at least one of borders, special effects, stickers, or achievement icons, and each decorative element is at a different display level from the 3D virtual character image of the virtual character.
[0240] In one possible implementation, the display module 801 is further configured to display an updated background image, an updated 3D virtual character image, and updated decorative elements when the trigger operation indication of the 2D image changes. The updated background image, the updated 3D virtual character image, and the updated decorative elements are determined based on the interaction trigger position.
[0241] In one possible implementation, the device further includes a determining module and a generating module. The determining module is used to determine adjustment parameters based on the trigger operation indication interactive trigger position of the two-dimensional image. The adjustment parameters include at least one of view adjustment parameters, texture sampling parameters, or lighting adaptation parameters. The sampling resolution is determined based on the rendering resolution. The rendering resolution refers to the resolution of the area where the virtual character is displayed, while the sampling resolution is the resolution used to sample the 3D character model to obtain 2D texture data. The generation module is used to generate updated background images, updated 3D virtual character images, and updated decorative elements based on sampling resolution and adjustment parameters.
[0242] In one possible implementation, the display module 801 is further configured to display a corresponding three-dimensional virtual character image in a display area indicated by the layout information when there are multiple virtual characters. The three-dimensional virtual character image is determined based on two-dimensional data information adapted to the rendering resolution of the display area. The two-dimensional data information is used to reflect the three-dimensional spatial hierarchy of the virtual character to determine the three-dimensional virtual character image. The layout information indicates the display area of each virtual character in the interactive interface. The layout information is determined based on the number of virtual characters to be displayed.
[0243] In one possible implementation, the apparatus further includes a determining module and a generating module. The determining module is used to determine first shared texture information based on the three-dimensional character models of each virtual character. The first shared texture information represents the texture information of the same rendering target corresponding to multiple virtual characters. The generation module is used to generate multiple two-dimensional data information adapted to the rendering resolution of the display area based on the first shared texture information; and to generate a three-dimensional virtual character image using the multiple two-dimensional data information adapted to the rendering resolution of the display area.
[0244] In one possible implementation, the device further includes a calibration module, which is used to perform rendering calibration on multiple three-dimensional virtual character images adapted to the rendering resolution of the display area using a first rendering calibration parameter and a second rendering calibration parameter to obtain a calibrated three-dimensional virtual character image. The first rendering calibration parameter is used to calibrate the rendering depth range of the display area corresponding to the three-dimensional virtual character image, and the second rendering calibration parameter is used to calibrate the sampling resolution for generating two-dimensional data information. Display module 801 is used to display the corresponding calibrated 3D virtual character image in the display area indicated by the layout information.
[0245] In one possible implementation, the apparatus further includes a determining module, which is used to determine a first rendering calibration parameter based on the rendering range of a first clipping plane and a second clipping plane corresponding to the display area of the 3D virtual character image of each virtual character, wherein in a direction perpendicular to the display area, a first distance between the first clipping plane and the display area is less than a second distance between the second clipping plane and the display area; and to determine a rendering resolution based on the size information corresponding to the display area of the 3D virtual character image of each virtual character, thereby obtaining a second rendering calibration parameter.
[0246] In one possible implementation, the device further includes a sampling module, a processing module, a generation module, and a determination module; The sampling module is used to perform two-dimensional sampling on the three-dimensional character model of the virtual character after the virtual character has completed the interaction, so as to obtain two-dimensional sampling data. The processing module is used to merge the two-dimensional sampled data to obtain merged data; and to perform unified processing on the merged data to obtain second shared texture information. The second shared texture information represents the texture information of the same rendering target corresponding to multiple virtual characters that have completed the interaction. The generation module is used to generate multiple two-dimensional data information adapted to the rendering resolution of the settlement display area based on the second shared texture information. The two-dimensional data information is used to reflect the three-dimensional spatial hierarchy of the virtual character in order to determine the three-dimensional virtual character image. The settlement display area is the area used to display the virtual character after the virtual character completes the interaction. The determination module is used to determine the three-dimensional virtual character image based on multiple two-dimensional data information adapted to the rendering resolution of the settlement display area.
[0247] In one possible implementation, the display module 801 is further configured to display a 3D virtual character image of the virtual character at a first display layer and display settlement elements at a second display layer. The settlement elements are determined based on the interactive settlement data of the virtual character. The first display layer and the second display layer are different display layers in the interactive interface.
[0248] In one possible implementation, the device further includes an acquisition module and a determination module; The acquisition module is used to acquire layer rendering information and lighting projection information. The layer rendering information represents the texture data and layer occlusion relationship of the 3D character model at different layers. The lighting projection information represents at least one of the following: the specular distribution, shadow outline, or semi-transparent light and shadow overlay effect of the 3D character model at the interaction trigger position and corresponding interaction viewpoint. The determination module is used to determine two-dimensional data information based on hierarchical rendering information and lighting projection information. The two-dimensional data information is used to reflect the three-dimensional spatial hierarchy of the virtual character in order to determine the three-dimensional virtual character image.
[0249] In one possible implementation, the determining module is further configured to determine the interaction trigger position based on the trigger operation of the two-dimensional image; determine the position offset using the interaction trigger position and the reference display position, where the reference display position is the position of the virtual character in the display area of the two-dimensional image; and determine the layer rendering information and lighting projection information based on the position offset and the three-dimensional character model corresponding to the virtual character.
[0250] In one possible implementation, the layered rendering information includes background layered rendering information and character layered rendering information. A determining module is used to determine a first displacement parameter and a second displacement parameter based on position offsets. The first displacement parameter is used to adjust the texture sampling offset of the background image, and the second displacement parameter is used to adjust the texture sampling offset of the 3D character model of the virtual character. Background layered rendering information is determined based on the first displacement parameter and the background image. This background layered rendering information indicates the flash rendering mode of the background image and the texture sampling offset relationship between the first, second, and third rendering layers of the background image. The texture sampling offset amplitude of the first rendering layer is smaller than that of the second rendering layer, and the texture sampling offset amplitude of the second rendering layer is smaller than that of the third rendering layer. Character layered rendering information is determined based on the second displacement parameter and the 3D character model corresponding to the virtual character.
[0251] In one possible implementation, the device further includes an optimization module and a determination module; The optimization module is used to perform optimization processing on the texture data of the two-dimensional virtual character image to obtain optimized texture data; The determination module is used to determine the 3D virtual character image based on the optimized texture data and the texture mapping strategy corresponding to the 3D character model of the virtual character. The texture mapping strategy is used to indicate at least one of the attachment position, attachment range or attachment angle of the optimized texture data on the 3D character model.
[0252] In one possible implementation, the optimization process includes at least one of anti-aliasing, color difference repair, or directional rendering. Anti-aliasing is used to eliminate jagged edges on the texture of the 2D image, color difference repair is used to correct texture color deviations in the 2D image, and directional rendering is used to adjust rendering parameters according to the display perspective of the 3D character model.
[0253] This application embodiment displays a two-dimensional image containing a background image and a two-dimensional virtual character image. After the two-dimensional image is triggered, the display of the two-dimensional virtual character image is canceled on the same background image, and the virtual character animation is displayed as a three-dimensional virtual character image. The virtual character animation can display the spatial hierarchy of the virtual character. It can realize the switching of the virtual character display from two-dimensional to three-dimensional without switching the overall display interface and loading new background resources. The spatial hierarchy of the virtual character is presented on the two-dimensional display interface, which improves the three-dimensional realism of the virtual character display. It avoids the problem of insufficient three-dimensionality of two-dimensional virtual character image display and the problem of additional resource loading required for three-dimensional virtual character model display. It retains the low resource consumption advantage of two-dimensional display and restores the key features and spatial hierarchy of three-dimensional character model. It makes the display of virtual character dynamically adaptable to the virtual character, with detailed expression, and balances the display effect and performance overhead of virtual character.
[0254] It should be understood that the above-described apparatus is only illustrated by the division of the functional modules described above when implementing its functions. In practical applications, the functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.
[0255] Figure 9This is a structural block diagram of a terminal device provided in an embodiment of this application. The terminal device 2000 can be any electronic device product capable of human-computer interaction with a user through one or more methods such as a keyboard, touchpad, remote control, voice interaction, or handwriting device. Examples include PCs (Personal Computers), mobile phones, smartphones, PDAs (Personal Digital Assistants), wearable devices, PPCs (Pocket PCs), tablet computers, smart car systems, smart TVs, and smartwatches.
[0256] Typically, terminal device 2000 includes a processor 2001 and a memory 2002.
[0257] Processor 2001 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 2001 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 2001 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 2001 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the screen. In some embodiments, processor 2001 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0258] The memory 2002 may include one or more computer-readable storage media, which may be non-transitory. The memory 2002 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 2002 are used to store at least one instruction, which is executed by the processor 2001 to implement the virtual character display method provided in the method embodiments of this application.
[0259] In some embodiments, the terminal device 2000 may also optionally include a peripheral device interface 2003 and at least one peripheral device. The processor 2001, memory 2002, and peripheral device interface 2003 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 2003 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of the following: radio frequency circuitry 2004, display screen 2005, camera assembly 2006, audio circuitry 2007, and power supply 2008.
[0260] Peripheral device interface 2003 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 2001 and memory 2002. In some embodiments, processor 2001, memory 2002 and peripheral device interface 2003 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 2001, memory 2002 and peripheral device interface 2003 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0261] The radio frequency (RF) circuit 2004 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 2004 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 2004 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the RF circuit 2004 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 2004 can communicate with other terminal devices through at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 2004 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.
[0262] Display screen 2005 is used to display a UI (User Interface). This UI may include graphics, text, icons, video, and any combination thereof. When display screen 2005 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 2001 for processing. In this case, display screen 2005 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 2005, disposed on the front panel of terminal device 2000; in other embodiments, there may be at least two display screens, disposed on different surfaces of terminal device 2000 or in a folded design; in still other embodiments, display screen 2005 may be a flexible display screen, disposed on a curved or folded surface of terminal device 2000. Furthermore, display screen 2005 may also be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. The display screen 2005 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0263] The camera assembly 2006 is used to acquire images or videos. Optionally, the camera assembly 2006 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is located on the front panel of the terminal device 2000, and the rear-facing camera is located on the back of the terminal device 2000. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions. In some embodiments, the camera assembly 2006 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm-light flash and a cool-light flash, which can be used for light compensation at different color temperatures.
[0264] The audio circuit 2007 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, converting them into electrical signals that are input to the processor 2001 for processing, or to the radio frequency circuit 2004 for voice communication. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each located at a different part of the terminal device 2000. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert electrical signals from the processor 2001 or the radio frequency circuit 2004 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, the audio circuit 2007 may also include a headphone jack.
[0265] Power supply 2008 is used to supply power to the various components in terminal device 2000. Power supply 2008 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 2008 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged via a wired line, while a wireless rechargeable battery is a battery that is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0266] In some embodiments, the terminal device 2000 further includes one or more sensors 2010. The one or more sensors 2010 include, but are not limited to: an acceleration sensor 2011, a gyroscope sensor 2012, a pressure sensor 2013, an optical sensor 2014, and a proximity sensor 2015.
[0267] Accelerometer 2011 can detect the magnitude of acceleration along the three coordinate axes of a coordinate system established by terminal device 2000. For example, accelerometer 2011 can be used to detect the components of gravitational acceleration along the three coordinate axes. Processor 2001 can control display screen 2005 to display the user interface in either a landscape or portrait view based on the gravitational acceleration signal acquired by accelerometer 2011. Accelerometer 2011 can also be used for games or for acquiring user motion data.
[0268] The gyroscope sensor 2012 can detect the orientation and rotation angle of the terminal device 2000. The gyroscope sensor 2012, in conjunction with the accelerometer sensor 2011, can collect the user's 3D movements on the terminal device 2000. Based on the data collected by the gyroscope sensor 2012, the processor 2001 can perform the following functions: motion sensing (e.g., changing the UI based on the user's tilt), image stabilization during shooting, game control, and inertial navigation.
[0269] The pressure sensor 2013 can be installed on the side bezel of the terminal device 2000 and / or on the lower layer of the display screen 2005. When the pressure sensor 2013 is installed on the side bezel of the terminal device 2000, it can detect the user's grip signal on the terminal device 2000, and the processor 2001 can perform left / right hand recognition or quick operation based on the grip signal collected by the pressure sensor 2013. When the pressure sensor 2013 is installed on the lower layer of the display screen 2005, the processor 2001 can control the operable controls on the UI interface based on the user's pressure operation on the display screen 2005. The operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.
[0270] An optical sensor 2014 is used to collect ambient light intensity. In one embodiment, a processor 2001 can control the display brightness of a display screen 2005 based on the ambient light intensity collected by the optical sensor 2014. Specifically, when the ambient light intensity is high, the display brightness of the display screen 2005 is increased; when the ambient light intensity is low, the display brightness of the display screen 2005 is decreased. In another embodiment, the processor 2001 can also dynamically adjust the shooting parameters of a camera assembly 2006 based on the ambient light intensity collected by the optical sensor 2014.
[0271] The proximity sensor 2015, also known as a distance sensor, is typically installed on the front panel of the terminal device 2000. The proximity sensor 2015 is used to detect the distance between the user and the front of the terminal device 2000. In one embodiment, when the proximity sensor 2015 detects that the distance between the user and the front of the terminal device 2000 is gradually decreasing, the processor 2001 controls the display screen 2005 to switch from a screen-on state to a screen-off state; when the proximity sensor 2015 detects that the distance between the user and the front of the terminal device 2000 is gradually increasing, the processor 2001 controls the display screen 2005 to switch from a screen-off state to a screen-on state.
[0272] Those skilled in the art will understand that Figure 9 The structure shown does not constitute a limitation on the terminal device 2000, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0273] Figure 10This is a schematic diagram of the server structure provided in the embodiments of this application. The server 2100 can vary considerably due to different configurations or performance. It may include one or more processors 2101 and one or more memories 2102, wherein the one or more memories 2102 store at least one piece of program code. This at least one piece of program code is loaded and executed by the one or more processors 2101 to implement the virtual character display method provided in the above-described method embodiments. Of course, the server 2100 may also have wired or wireless network interfaces, keyboards, and input / output interfaces for input and output. The server 2100 may also include other components for implementing device functions, which will not be elaborated here.
[0274] In an exemplary embodiment, a computer-readable storage medium is also provided, which stores at least one piece of program code that is loaded and executed by a processor to enable a computer to implement any of the above-described methods for displaying virtual characters.
[0275] Optionally, the aforementioned computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, floppy disk, and optical data storage device, etc.
[0276] In an exemplary embodiment, a computer program or computer program product is also provided, which stores at least one computer instruction, which is loaded and executed by a processor to enable the computer to implement any of the above-described methods for displaying virtual characters.
[0277] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, data stored, data displayed, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0278] Furthermore, the triggering operation of the control mentioned in this application is an illustrative example. You can also interact with virtual objects (characters) or other interactive elements in the virtual scene through keyboard, voice commands, and specific gesture commands. This application does not limit the interaction method.
[0279] It should be understood that "multiple" as used in this article refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0280] The above description is merely an exemplary embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.
Claims
1. A method for displaying a virtual character, characterized in that, The method includes: Display a two-dimensional image, the two-dimensional image including a background image and a two-dimensional virtual character image on the background image; In response to the triggering operation of the two-dimensional image, the two-dimensional virtual character image is de-displayed on the background image and a virtual character animation is displayed in a three-dimensional virtual character image. The virtual character animation is used to display the three-dimensional spatial hierarchy of the virtual character.
2. The method according to claim 1, characterized in that, The method further includes: The decorative elements associated with the 3D virtual character image are displayed. The decorative elements include at least one of borders, special effects, stickers, or achievement icons, and each decorative element is at a different display level from the 3D virtual character image.
3. The method according to claim 2, characterized in that, The method further includes: When the trigger operation indication of the two-dimensional image changes, an updated background image, an updated three-dimensional virtual character image, and updated decorative elements are displayed. The updated background image, the updated three-dimensional virtual character image, and the updated decorative elements are determined based on the interaction trigger position.
4. The method according to claim 3, characterized in that, The method further includes: The adjustment parameters are determined based on the trigger operation indication interaction trigger position of the two-dimensional image, and the adjustment parameters include at least one of the following: view adjustment parameters, texture sampling parameters, or lighting adaptation parameters; The sampling resolution is determined based on the rendering resolution, where the rendering resolution refers to the resolution of the area displaying the virtual character, and the sampling resolution is the resolution used to sample the three-dimensional character model to obtain two-dimensional texture data. The updated background image, the updated 3D virtual character image, and the updated decorative elements are generated based on the sampling resolution and the adjustment parameters.
5. The method according to claim 1, characterized in that, The method further includes: When there are multiple virtual characters, the corresponding three-dimensional virtual character image is displayed in the display area indicated by the layout information. The three-dimensional virtual character image is determined based on two-dimensional data information adapted to the rendering resolution of the display area. The two-dimensional data information is used to reflect the three-dimensional spatial hierarchy of the virtual character to determine the three-dimensional virtual character image. The layout information indicates the display area of each virtual character in the interactive interface. The layout information is determined based on the number of virtual characters to be displayed.
6. The method according to claim 5, characterized in that, The method further includes: Based on the 3D character models of each virtual character, a first shared texture information is determined, wherein the first shared texture information represents the texture information of the same rendering target corresponding to multiple virtual characters; Based on the first shared texture information, generate multiple two-dimensional data information that are adapted to the rendering resolution of the display area; The three-dimensional virtual character image is generated using the multiple two-dimensional data information adapted to the rendering resolution of the display area.
7. The method according to claim 5, characterized in that, Before displaying the corresponding 3D virtual character image in the display area indicated by the layout information, the method further includes: Rendering calibration is performed on the plurality of 3D virtual character images adapted to the rendering resolution of the display area using a first rendering calibration parameter and a second rendering calibration parameter to obtain calibrated 3D virtual character images. The first rendering calibration parameter is used to calibrate the rendering depth range of the display area corresponding to the 3D virtual character image, and the second rendering calibration parameter is used to calibrate the sampling resolution for generating 2D data information. The step of displaying the corresponding 3D virtual character image in the display area indicated by the layout information includes: The corresponding calibrated 3D virtual character image is displayed in the display area indicated by the layout information.
8. The method according to claim 7, characterized in that, The method further includes: The first rendering calibration parameters are determined based on the rendering range of the first clipping plane and the second clipping plane corresponding to the display area of the 3D virtual character image of each virtual character. In the direction perpendicular to the display area, the first distance between the first clipping plane and the display area is less than the second distance between the second clipping plane and the display area. The rendering resolution is determined based on the size information corresponding to the display area of the 3D virtual character image of each virtual character, and the second rendering calibration parameter is obtained.
9. The method according to claim 1, characterized in that, The method further includes: When the virtual character completes the interaction, the three-dimensional character model of the virtual character that has completed the interaction is sampled in two dimensions to obtain two-dimensional sampling data; The two-dimensional sampled data is merged to obtain merged data; The merged data is processed uniformly to obtain second shared texture information, which represents the texture information of the same rendering target corresponding to the multiple virtual characters that have completed the interaction; Based on the second shared texture information, multiple two-dimensional data information adapted to the rendering resolution of the settlement display area are generated. The two-dimensional data information is used to reflect the three-dimensional spatial hierarchy of the virtual character in order to determine the three-dimensional virtual character image. The settlement display area is the area used to display the virtual character after the virtual character completes the interaction. The three-dimensional virtual character image is determined based on the multiple two-dimensional data information adapted to the rendering resolution of the settlement display area.
10. The method according to claim 9, characterized in that, The method further includes: The first display layer displays a 3D virtual character image of the virtual character, and the second display layer displays settlement elements. The settlement elements are determined based on the interactive settlement data of the virtual character. The first display layer and the second display layer are different display layers in the interactive interface.
11. The method according to any one of claims 1 to 10, characterized in that, The method further includes: Acquire layer rendering information and lighting projection information. The layer rendering information represents the texture data and layer occlusion relationship of the 3D character model at different layers. The lighting projection information represents at least one of the following: the highlight distribution, shadow outline, or semi-transparent light and shadow overlay effect of the 3D character model at the interaction trigger position and corresponding interaction viewpoint. Two-dimensional data information is determined based on the hierarchical rendering information and the lighting projection information. The two-dimensional data information is used to reflect the three-dimensional spatial hierarchical structure of the virtual character in order to determine the three-dimensional virtual character image.
12. The method according to claim 11, characterized in that, Before obtaining the layer rendering information and the lighting projection information, the process also includes: The interaction trigger position is determined based on the triggering operation of the two-dimensional image; The position offset is determined using the interaction trigger position and the reference display position, where the reference display position is the position of the virtual character in the display area of the two-dimensional image; The layer rendering information and the lighting projection information are determined based on the position offset and the 3D character model corresponding to the virtual character.
13. The method according to claim 12, characterized in that, The layered rendering information includes background layered rendering information and character layered rendering information. Determining the layered rendering information based on the position offset and the 3D character model corresponding to the virtual character includes: A first displacement parameter and a second displacement parameter are determined based on the position offset. The first displacement parameter is used to adjust the texture sampling offset of the background image, and the second displacement parameter is used to adjust the texture sampling offset of the three-dimensional character model of the virtual character. Based on the first displacement parameter and the background image, the background layer rendering information is determined. The background layer rendering information indicates the flash rendering mode of the background image and the texture sampling offset relationship corresponding to the first rendering layer, the second rendering layer, and the third rendering layer of the background image. The texture sampling offset amplitude of the first rendering layer is smaller than that of the second rendering layer, and the texture sampling offset amplitude of the second rendering layer is smaller than that of the third rendering layer. The character hierarchy rendering information is determined based on the second displacement parameter and the 3D character model corresponding to the virtual character.
14. The method according to any one of claims 1 to 10, characterized in that, The method further includes: The texture data of the two-dimensional virtual character image is optimized to obtain optimized texture data; The three-dimensional virtual character image is determined based on the optimized texture data and the texture mapping strategy corresponding to the three-dimensional character model of the virtual character. The texture mapping strategy is used to indicate at least one of the attachment position, attachment range or attachment angle of the optimized texture data on the three-dimensional character model.
15. The method according to claim 14, characterized in that, The optimization process includes at least one of anti-aliasing, color difference repair, or directional rendering. The anti-aliasing is used to eliminate jagged edges on the texture of the two-dimensional image. The color difference repair is used to correct the texture color deviation of the two-dimensional image. The directional rendering is used to adjust the rendering parameters according to the display perspective of the three-dimensional character model.
16. A display device for a virtual character, characterized in that, The device includes: A display module is used to display a two-dimensional image, the two-dimensional image including a background image and a two-dimensional virtual character image on the background image; The display module is also configured to, in response to the triggering operation of the two-dimensional image, cancel the display of the two-dimensional virtual character image on the background image and display the virtual character animation in the form of a three-dimensional virtual character image, wherein the virtual character animation is used to display the three-dimensional spatial hierarchy of the virtual character.
17. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one piece of program code, the at least one piece of program code being loaded and executed by the processor to enable the computer device to implement the virtual character display method as described in any one of claims 1 to 15.
18. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one piece of program code, which is loaded and executed by a processor to enable the computer to implement the method for displaying a virtual character as described in any one of claims 1 to 15.
19. A computer program product, characterized in that, The computer program product stores at least one computer instruction, which is loaded and executed by a processor to enable the computer to implement the method for displaying a virtual character as described in any one of claims 1 to 15.