Information processing method, device, storage medium and electronic device

By fusing the depth map of the virtual object in the virtual scene, generating the target depth map and creating the shadow map, the problem of low efficiency in shadow generation of virtual characters is solved and efficient shadow generation effect is achieved.

CN115814407BActive Publication Date: 2025-09-12NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211289377.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-20
Publication Date
2025-09-12
Estimated Expiration
2042-10-20

AI Technical Summary

Technical Problem

In the prior art, the shadow generation efficiency of dynamic objects in virtual scenes based on ShadowMask technology is low, and the inability to directly use depth maps leads to the problem of low efficiency in shadow generation of virtual characters.

Method used

By determining that a first virtual object moves to a sub-scene area in a virtual scene, a depth map of the first virtual object and a depth map of a second virtual object in a stationary state are fused to generate a target depth map, and a shadow map is created using the target depth map. The target shadow is rendered and displayed on the virtual character based on the shadow map.

Benefits of technology

This method enables the generation and updating of depth maps for static and dynamic objects in a virtual scene with minimal consumption, improves the efficiency of shadow generation for virtual characters, and avoids updating the depth maps of all objects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115814407B_ABST
    Figure CN115814407B_ABST
Patent Text Reader

Abstract

This application discloses an information processing method, apparatus, storage medium, and electronic device. The method includes: determining, within a scene area of ​​a virtual scene, that a first virtual object moves to a sub-scene area; in response to the first virtual object being between a virtual character in the virtual scene and a second virtual object in the sub-scene area, fusing a first depth map of the first virtual object with a second depth map of the second virtual object to obtain a target depth map, wherein the second virtual object is in a stationary state; creating a shadow map using the target depth map; and rendering and displaying a target shadow representation on the virtual character based on the shadow map, wherein the target shadow representation is a shadow formed by the first virtual object and the second virtual object on the virtual character. This application solves the technical problem of low efficiency in shadow generation for virtual characters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and more specifically, to an information processing method, device, storage medium, and electronic device. Background Art

[0002] In related technologies, traditional shadow mask technology is usually used to load the depth map obtained by shooting the scene depth of the virtual scene with a depth camera into the virtual character material system (Shader) in the virtual scene to achieve the purpose of generating shadows for the virtual character.

[0003] However, if there are dynamic objects in the virtual scene, the depth map of all objects in the virtual scene needs to be updated every frame, and the depth map obtained based on the Shadow Mask technology cannot be used directly, resulting in a technical problem of low efficiency in shadow generation of virtual characters.

[0004] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention

[0005] At least some embodiments of the present application provide an information processing method, apparatus, storage medium, and electronic device to at least solve the technical problem of low efficiency in shadow generation of virtual characters.

[0006] According to one embodiment of the present application, an information processing method is provided. The method may include: determining, in a scene area of ​​a virtual scene, that a first virtual object moves to a sub-scene area; in response to the first virtual object being between a virtual character in the virtual scene and a second virtual object in the sub-scene area, fusing a first depth map of the first virtual object and a second depth map of the second virtual object to obtain a target depth map, wherein the second virtual object is in a stationary state; creating a shadow map using the target depth map; and rendering and displaying a target shadow representation on the virtual character based on the shadow map, wherein the target shadow representation is a shadow cast by the first virtual object and the second virtual object on the virtual character.

[0007] According to one embodiment of the present application, an information processing device is also provided. The device may include: a determination unit for determining, in a scene area of ​​a virtual scene, that a first virtual object moves to a sub-scene area; a fusion processing unit for, in response to the first virtual object being between a virtual character in the virtual scene and a second virtual object in the sub-scene area, fusing a first depth map of the first virtual object and a second depth map of the second virtual object to obtain a target depth map, wherein the second virtual object is in a stationary state; a creation unit for creating a shadow map using the target depth map; and a rendering unit for rendering and displaying a target shadow representation on the virtual character based on the shadow map, wherein the target shadow representation is a shadow formed by the first virtual object and the second virtual object on the virtual character.

[0008] According to one embodiment of the present application, a computer-readable storage medium is further provided, in which a computer program is stored. When the computer program is executed by a processor, the device where the computer-readable storage medium is located is controlled to execute the information processing method of the embodiment of the present application.

[0009] According to one embodiment of the present application, an electronic device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute any of the above-mentioned information processing methods.

[0010] In at least some embodiments of the present application, in a scene area of ​​a virtual scene, it is determined that a first virtual object moves to a sub-scene area; in response to the first virtual object being between a virtual character in the virtual scene and a second virtual object in the sub-scene area, a first depth map of the first virtual object and a second depth map of the second virtual object are fused to obtain a target depth map; a shadow map is created using the target depth map; and a target shadow representation is rendered and displayed on the virtual character based on the shadow map. In other words, the embodiments of the present application determine that the first virtual object moves between the virtual character and a second virtual object in a sub-scene area, and fuse the depth map of the first virtual object and the depth map of the second virtual object, so as to achieve the purpose of generating and updating depth maps of static objects and dynamic objects in the virtual scene with minimal consumption, avoiding updating the depth maps of all objects and then projecting shadows onto the character, thereby solving the technical problem of low shadow generation efficiency of virtual characters and achieving the technical effect of improving shadow generation efficiency of virtual characters. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0012] Figure 1This is a hardware structure block diagram of a mobile terminal of an information processing method according to an embodiment of the present application;

[0013] Figure 2 is a flowchart of an information processing method according to an embodiment of the present application;

[0014] FIG3( a ) is a schematic diagram of a positional relationship among a first virtual object, a second virtual object, and a virtual character according to an embodiment of the present application;

[0015] FIG3( b ) is a schematic diagram of achieving a shadow effect according to an embodiment of the present application;

[0016] FIG3( c ) is a schematic diagram of another method for achieving a shadow effect according to an embodiment of the present application;

[0017] Figure 4 is a schematic diagram of a downsampling level according to an embodiment of the present application;

[0018] Figure 5 is a schematic diagram of an operating interface for determining the depth of an object's bounding box according to an embodiment of the present application;

[0019] FIG6( a ) is a schematic diagram of a depth map according to an embodiment of the present invention;

[0020] FIG6( b ) is a schematic diagram of another depth map according to an embodiment of the present invention;

[0021] Figure 7 is a schematic diagram of an information processing device according to an embodiment of the present application;

[0022] Figure 8 is a schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0023] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0025] First, some nouns or terms that appear in the description of the embodiments of the present application are explained as follows:

[0026] Unreal Engine 4 (UE4), a graphics engine used to develop 3D software and games;

[0027] The blueprint system, the business logic control layer of the UE4 engine, can write gameplay logic and pass parameter values ​​to the material system;

[0028] Shader, the rendering system of the UE4 engine, can write the rendering effects of objects through the shader language;

[0029] Shadow Mask (ShadowMask), a method of statically baking shadow maps through offline methods, which can be applied to character shaders to create shadows;

[0030] Hierarchical Z-buffer (HiZ-buffer), a method for accelerating occlusion queries while reducing query latency on the Graphics Processing Unit (GPU);

[0031] Render Target (RT), used to record information about drawn scene objects, such as the depth of scene objects;

[0032] Depth camera (Scene Capture 2D), used with RT, for example, to capture the depth of scene objects on RT;

[0033] Capture refers to the act of capturing the scene depth onto RT using a depth camera;

[0034] Static Mesh refers to objects that do not move or transform in a virtual scene;

[0035] Game characters (Character), objects that move in the virtual scene;

[0036] Ortho Projection Width, the width of the capture camera's shooting area;

[0037] Cell: The virtual scene is divided into regions, and each Cell represents a small rectangular area.

[0038] According to one embodiment of the present application, an embodiment of an information processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0039] The above method embodiments involved in this application can be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking running on a mobile terminal as an example, the mobile terminal can be a smart phone, a tablet computer, a PDA, a mobile Internet device, a PAD, a game console, or other terminal device. Figure 1 This is a hardware structure block diagram of a mobile terminal of an information processing method according to an embodiment of the present application. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown) a processor 102 (the processor 102 may include but is not limited to a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processing (DSP) chip, a microprocessor (MCU), a field-programmable logic device (FPGA), a neural network processor (NPU), a tensor processing unit (TPU), an artificial intelligence (AI) type processor, etc.) and a memory 104 for storing data. In one embodiment of the present application, it may also include: an input and output device 108 and a display device 110.

[0040] In some optional embodiments mainly based on gaming scenarios, the above-mentioned device can also provide a human-computer interaction interface with a touch-sensitive surface, which can sense finger contact and / or gestures to perform human-computer interaction with a graphical user interface (GUI). The human-computer interaction functions may include the following interactions: creating web pages, drawing, word processing, making electronic documents, games, video conferencing, instant messaging, sending and receiving emails, call interface, playing digital videos, playing digital music and / or web browsing, etc. The executable instructions for executing the above-mentioned human-computer interaction functions are configured / stored in a computer program product or readable storage medium executable by one or more processors.

[0041] Those skilled in the art will understand that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.

[0042] According to one embodiment of the present application, an embodiment of an information processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0043] In a possible implementation, an embodiment of the present application provides an information processing method. Figure 2 is a flow chart of an information processing method according to an embodiment of the present application, such as Figure 2 As shown, the method includes the following steps:

[0044] Step S202: In the scene area of ​​the virtual scene, determine whether the first virtual object moves to the sub-scene area.

[0045] In the technical solution provided in the above step S202 of the present application, a sub-scene area of ​​the scene area of ​​the virtual scene to which the first virtual object moves is determined, wherein the virtual scene may be a game scene, the scene area may be an area in the virtual scene where a depth map needs to be baked, the sub-scene area may be a grid area (Cell) where the first virtual object is located, and the first virtual object may be a movable object in motion in the scene area of ​​the virtual scene, for example, a box moving in the scene area or a game character controlled and moved by a player in the scene area, etc. This is only an example and is not specifically limited.

[0046] Step S204: In response to the first virtual object being between the virtual character in the virtual scene and the second virtual object in the sub-scene area, a first depth map of the first virtual object and a second depth map of the second virtual object are fused to obtain a target depth map, wherein the second virtual object is in a stationary state.

[0047] In the technical solution provided in step S204 of the present application, if the first virtual object is located between the virtual character and the second virtual object in the sub-scene area in the virtual scene, depth data of pixels in the first depth map of the first virtual object and depth data of pixels in the second depth map of the second virtual object are compared pixel by pixel to obtain multiple minimum depth data, and pixels corresponding to the multiple minimum depth data are fused to obtain a target depth map. The virtual character may be a virtual game character controlled by a player through a terminal device in the virtual scene, that is, a controlled virtual object in the virtual scene. The second virtual object may be a stationary object in a scene area of ​​the virtual scene, such as an object or a virtual character stationary in the scene area, such as a window, a vase, or a stationary game character. This is for illustrative purposes only and is not intended to be limiting. The first depth map may be a depth map of a dynamic object in the scene area, the second depth map may be a depth map of a stationary object in the sub-scene area, and the target depth map may be a depth map used to render a target shadow representation for the virtual character.

[0048] It should be noted that the above-mentioned virtual character can be a game character in a virtual scene controlled by a player, the above-mentioned first virtual object can be an object moving in the virtual scene, and the above-mentioned second virtual object can be an object stationary in the virtual scene. The first virtual object and the second virtual object can jointly generate a shadow for the virtual character. The first virtual object and the second virtual object can also be other game characters in the virtual scene controlled by other players. No specific limitation is made here.

[0049] Figure 3(a) is a schematic diagram of the positional relationship between a first virtual object, a second virtual object, and a virtual character according to an embodiment of the present application. As shown in Figure 3(a), the block drawn with dotted lines is the first virtual object 33 before it moves between the virtual character 31 and the second virtual object 32, and the block drawn with solid lines is the first virtual object 33 when it moves between the virtual character 31 and the second virtual object 32. The first virtual object 33 is between the virtual character 31 and the second virtual object 32, wherein the first virtual object 33 can be a moving box and the second virtual object 32 can be a window.

[0050] Optionally, by comparing the depth data of the bounding box of the first virtual object in the depth camera space with the maximum depth data (PreComputedMaxZ) of the second depth map of the second virtual object, it is determined whether the first virtual object is between the virtual character and the second virtual object; if the depth data of the bounding box of the first virtual object in the depth camera space is less than the PreComputedMaxZ of the second depth map of the second virtual object, it is determined that the first virtual object is between the virtual character and the second virtual object; if the depth data of the bounding box of the first virtual object in the depth camera space is greater than the PreComputedMaxZ of the second depth map of the second virtual object, it is determined that the first virtual object is not between the virtual character and the second virtual object.

[0051] Optionally, the above-mentioned bounding box may be an AABB bounding box (Axis-aligned bounding box).

[0052] Optionally, if the first virtual object is not between the virtual character in the virtual scene and the second virtual object in the sub-scene area, the baked second depth map of the second virtual object can be directly determined as the target depth map, without the need to recapture the depth map of the scene area, so as to save resources.

[0053] Optionally, a maximum depth data is first initialized through a HiZ-buffer-like method, and then a pixel shader is called to compare the depth data in the second depth map with the initialized maximum depth data pixel by pixel, thereby obtaining PreComputedMaxZ of the second depth map.

[0054] Step S206: Create a shadow map using the target depth map.

[0055] In the technical solution provided in the above step S206 of the present application, a shadow map can be created based on the target depth map obtained by fusing the first depth map of the first virtual object and the second depth map of the second virtual object, wherein the shadow map can be used to render and display the shadow formed by the first virtual object and the second virtual object on the virtual character.

[0056] Step S208 : rendering and displaying a target shadow representation on the virtual character based on the shadow map, wherein the target shadow representation is a shadow formed by the first virtual object and the second virtual object on the virtual character.

[0057] In the technical solution provided in the above step S208 of the present application, the target shadow representation is rendered and displayed on the virtual character through the created shadow map, wherein the target shadow representation can be the shadow display effect formed by the first virtual object and the second virtual object on the virtual character, for example, the shadow display effect generated by the window and the moving box on the virtual character.

[0058] Through the above steps S202 to S208 of the present application, in the scene area of ​​the virtual scene, it is determined that the first virtual object moves to the sub-scene area; in response to the first virtual object being between the virtual character in the virtual scene and the second virtual object in the sub-scene area, the first depth map of the first virtual object and the second depth map of the second virtual object are fused to obtain a target depth map; a shadow map is created using the target depth map; and the target shadow representation is rendered and displayed on the virtual character based on the shadow map. In other words, the embodiment of the present application determines that the first virtual object moves between the virtual character and the second virtual object in a sub-scene area, and fuses the depth map of the first virtual object and the depth map of the second virtual object, so as to achieve the purpose of generating and updating the depth map of static objects and dynamic objects in the virtual scene with minimal consumption, avoiding updating the depth map of all objects and then projecting the shadow onto the character, thereby solving the technical problem of low shadow generation efficiency of the virtual character and achieving the technical effect of improving the shadow generation efficiency of the virtual character.

[0059] The above method of this embodiment is further introduced below.

[0060] As an optional implementation, the method further includes: determining, based on maximum depth data of the second depth map, that the first virtual object is between the virtual character and the second virtual object.

[0061] In this embodiment, whether the first virtual object is between the virtual character and the second virtual object can be determined by comparing the maximum depth data of the second depth map of the second virtual object with the depth data of the AABB bounding box of the first virtual object. If the maximum depth data of the second depth map is greater than the depth of the AABB bounding box of the first virtual object, it is determined that the first virtual object is between the virtual character and the second virtual object, wherein the maximum depth data of the second depth map may be the maximum distance between the depth camera and the second virtual object.

[0062] As an optional embodiment, the method further includes: determining contour information of the first virtual object; and in response to depth data of the contour information in the depth camera space being less than the maximum depth data in the depth camera space, determining that the first virtual object is between the virtual character and the second virtual object.

[0063] In this embodiment, whether the first virtual object is between the virtual character and the second virtual object can be determined by comparing the depth data of the contour information of the first virtual object in the depth camera space with the maximum depth data in the depth camera space. If the depth data of the contour information in the depth camera space is less than the maximum depth data in the depth camera space, it is determined that the first virtual object is between the virtual character and the second virtual object, wherein the contour information can be used to characterize the geometric space that surrounds the first virtual character, for example, an AABB bounding box, the depth camera space can be the shooting area of ​​the depth camera, the depth data of the contour information in the depth camera space can be used to characterize the depth of the AABB bounding box of the first virtual object, and the maximum depth data in the depth camera space can be used to characterize the maximum depth that can be captured by the depth camera in the shooting area, which is not specifically limited here.

[0064] Optionally, if the depth data of the outline information of the first virtual object in the depth camera space is greater than the maximum depth data in the depth camera space, it is determined that the first virtual object is not between the virtual character and the second virtual object, so there is no need to re-capture the depth map of the scene area, and continue to use the baked ShadowMask depth map to create a shadow map, and render and display the shadow performance on the virtual character.

[0065] As an optional implementation, the method further includes, in response to depth data of the contour information in the depth camera space being less than maximum depth data in the depth camera space, acquiring a first depth map based on a depth camera corresponding to the depth camera space.

[0066] In this embodiment, if the depth data of the outline information of the first virtual object in the depth camera space is less than the maximum depth data in the depth camera space, indicating that the first virtual object is between the virtual character and the second virtual object, it is necessary to re-acquire the first depth map of the first virtual object based on the depth camera corresponding to the depth camera space.

[0067] As an optional implementation, the method further includes determining contour information of the first virtual object, including: determining a bounding box of the first virtual object in the virtual scene.

[0068] In this embodiment, a bounding box of the first virtual object in the virtual scene is determined, wherein the bounding box can be used to represent the contour information of the area occupied by the first virtual object in the virtual scene. For example, the bounding box can be an AABB bounding box or a directional bounding box, which is not specifically limited here.

[0069] As an optional implementation, the method further includes: calling a shader to compare the depth data in the second depth map with the initial maximum depth data to obtain maximum depth data.

[0070] In this embodiment, a HiZ-buffer-like method can be used to first set an initial maximum depth data, and then call the shader to compare the depth data in the second depth map with the initial maximum depth data pixel by pixel to obtain the maximum depth data, and store the obtained maximum depth data in an array, wherein the shader can be a vertex shader or a pixel shader, the initial maximum depth data can be an initialized maximum depth value, and the obtained maximum depth data is equivalent to the effect of downsampling the HiZ-Buffer algorithm to the last level.

[0071] Optionally, before calling the shader to compare the depth data in the second depth map with the initial maximum depth data pixel by pixel, a maximum depth value may be preset to achieve a technical effect of preventing the obtained maximum depth data from being invalid.

[0072] As an optional implementation, step S204, fusing the first depth map of the first virtual object and the second depth map of the second virtual object to obtain a target depth map, including: comparing the depth data on multiple first pixels in the first depth map with the depth data on multiple second pixels in the second depth map to obtain a comparison result; and generating a target depth map based on the comparison result.

[0073] In this embodiment, depth data on multiple first pixels in the first depth map and depth data on multiple second pixels in the second depth map can be compared pixel by pixel according to the processing logic of a shader or a central processing unit (CPU) to obtain multiple minimum depth data, and the multiple minimum depth data are fused to generate a target depth map, wherein a pixel can be an indivisible minimum element in an image, a first pixel can be a component element of the first depth map, and a second pixel can be a component element of the second depth map.

[0074] Optionally, the processing logic of the shader can be the pixel-by-pixel comparison processing logic of the compute shader, and the processing logic of the CPU can be the value-by-value comparison processing logic of the two-dimensional array. By comparing the depth data on multiple first pixels in the first depth map with the depth data on multiple second pixels in the second depth map through the processing logic of the shader or the CPU, it is possible to avoid the problem of re-capturing the depth map when the depth camera needs to update the depth map captured in each frame in the scene area, thereby achieving the technical effect of improving the shadow generation efficiency of the virtual character.

[0075] As an optional embodiment, the method also includes comparing the depth data on multiple first pixels in the first depth map with the depth data on multiple second pixels in the second depth map to obtain a comparison result, including: obtaining the minimum depth data between the depth data on each first pixel and the corresponding depth data on each second pixel to obtain multiple minimum depth data.

[0076] In this embodiment, the depth data on multiple first pixels in the first depth map and the depth data on multiple second pixels in the second depth map are compared, and the minimum depth data between the depth data on each first pixel and the depth data on each corresponding second pixel are obtained, and multiple minimum depth data are obtained, thereby achieving the technical effect of optimizing CPU sorting and CPU coarse-grained culling, wherein the position of each first pixel in the first depth map is the same as the position of each corresponding second pixel in the second depth map.

[0077] As an optional implementation manner, generating a target depth map based on the comparison result includes: determining each minimum depth data as depth data on a third pixel in the target depth map to obtain the target depth map.

[0078] In this embodiment, the depth data on multiple first pixels in the first depth map are compared with the depth data on multiple second pixels in the second depth map, and the obtained multiple minimum depth data are determined as the depth data on the third pixel in the target depth map. The depth data on the multiple third pixels are fused to obtain the target depth map, wherein the third pixel can be a component element of the target depth map.

[0079] As an optional implementation, the method further includes: in response to the first virtual object not being between the virtual character in the virtual scene and the second virtual object in the sub-scene area, determining the second depth map of the second virtual object as the target depth map.

[0080] In this embodiment, if the first virtual object is not between the virtual character in the virtual scene and the second virtual object in the sub-scene area, the second depth map of the second virtual object can be directly determined as the target depth map. That is, there is no need to re-capture the depth map of the scene area, and the baked ShadowMask depth map can be used to create the shadow map, and the shadow performance can be rendered on the virtual character.

[0081] As an optional implementation, the method further includes: statically baking the second virtual object to obtain a second depth map.

[0082] In this embodiment, ShadowMask technology can be used to statically bake the second virtual object contained in the scene area to obtain a second depth map. When it is determined that the first virtual object is not between the virtual character in the virtual scene and the second virtual object in the sub-scene area, the shadow effect can be directly achieved for the virtual character in the virtual scene through the second depth map. This can avoid the problem of re-capturing the depth map when the scene area needs to update the depth camera to capture the depth map every frame, thereby saving computing resources and achieving the technical effect of improving the shadow generation efficiency of the virtual character.

[0083] The technical solution of the embodiment of the present invention is further described below with reference to preferred implementation methods.

[0084] In the process of virtual scene development, shadows can be used to enhance the realism of the picture. However, implementing shadows is not only consuming a lot of game performance but also difficult to handle. Therefore, achieving a shadow effect that is both beautiful and low in performance has been a difficult problem that the industry has been optimizing and processing. For example, achieving a shadow without edge jaggedness or moiré, or improving shadow accuracy.

[0085] In a virtual scene, shadow effects can be divided into two types based on the definition criteria of emitter and receiver, namely, the shadow effect caused by the object on other objects and the shadow effect caused by other objects on the object. In this embodiment of the present invention, the performance optimization method of the shadow effect caused by other objects (for example, scene objects) on the object (for example, virtual character) is mainly analyzed.

[0086] Cartoon rendering is a relatively popular rendering style. Usually, cartoon rendering has some non-physically realistic performances. For example, the virtual character can receive the shadows cast by the scene objects, but at the same time, the scene objects themselves do not cast shadows on themselves, and the virtual character does not cast shadows on the scene objects. Figure 3(b) is a schematic diagram of realizing a shadow effect according to an embodiment of the present application. As shown in Figure 3(b), the black elliptical area on the virtual character 31 indicates that the virtual character 31 has shadows cast by the windows 32 and the walls 33 on itself, and the virtual character 31 does not cast a shadow on the ground 34. Figure 3(c) is another schematic diagram of realizing a shadow effect according to an embodiment of the present application. As shown in Figure 3(c), the black elliptical area on the virtual character 31 indicates the shadows cast by the windows 32 and the walls 33 on the virtual character 31 itself.

[0087] In a related technology, the Cast Shadow technology for setting scene objects in the UE4 engine is used to shoot the depth of the scene (for example, a window) on RT using a SceneCapture2D camera, and then the depth map is loaded into the character Shader when the game is running to create a shadow effect. However, if there are dynamic objects in the virtual scene, the depth information of the virtual scene needs to be updated every frame, and the depth map technology of the statically baked ShadowMask cannot achieve this effect.

[0088] In another related technology, the scene depth information is updated by using a technology that dynamically captures a new depth map for each frame. However, if the camera depth information is updated for each frame, all objects in the virtual scene need to be depth sorted, coarse-grained culling and other operations, which consumes significant energy. The depth camera is different from the main camera and does not have object sorting processing. Moreover, neither the main camera nor the depth camera performs CPU coarse-grained occlusion culling. Even though the UE4 engine has its own coarse-grained occlusion culling, there are still a large number of objects in the virtual scene and a CPU will have to sort the objects. The more objects there are, the more performance and time the sorting takes up, thereby affecting the shadow generation rate.

[0089] However, this embodiment of the present invention provides a shadow optimization method based on Shadow Mask, which can update the depth information of movable objects and mix it with the static Shadow Mask depth information. While achieving the above-mentioned shadow effect, it optimizes the shadow generation rate and reduces consumption, so as to achieve the purpose of allowing both static and dynamic objects in the virtual scene to generate and update depth maps with minimal consumption when the game is running, and project shadows onto virtual characters.

[0090] The following further introduces a shadow optimization method based on Shadow Mask provided by this embodiment of the present invention. The method may include the following two parts.

[0091] The first part is implemented in the offline editing state. According to the depth map information obtained by Shadow Mask, the maximum depth value data is solved using HiZ-buffer similar logic.

[0092] The purpose of solving the maximum depth value data is: when the game is running, if a movable object (for example, a box) appears in the virtual scene area and dynamically blocks the window and the virtual character, it is necessary to recapture the depth map of the virtual scene. However, since there are many scene objects in the virtual scene, recapturing the depth information of the objects in the virtual scene will result in high computational consumption.

[0093] Optionally, the maximum depth data (PreComputedMaxZ) can be obtained by the following method: first initialize a maximum depth value, then preset the minimum and maximum depth values ​​to avoid invalid depth data, and then extract the depth value pixel by pixel, compare the depth value with the minimum value to obtain the minimum depth of all pixels, and compare it with the maximum value to obtain the maximum depth. If the maximum depth is not the first pixel and not all pixels have the same value, it indicates that the ShadowMask depth map is valid, and the maximum depth value is returned, that is, the maximum depth value of the ShadowMask depth map of the virtual scene Cell, which is equivalent to the effect of downsampling to the last level by the HiZ-Buffer algorithm.

[0094] Optionally, when the Capture depth is calculated, if the maximum depth of the dynamic object (for example, a box) is greater than the maximum depth of the depth map statically baked for this Cell area, it proves that the dynamic object is not blocked between the virtual character and the window, and does not affect the original baked static depth map ShadowMask of the Cell. Therefore, there is no need to re-capture the depth and continue to use the baked ShadowMask depth map.

[0095] Figure 4 is a schematic diagram of a downsampling level according to an embodiment of the present application, such as Figure 4 As shown, HiZ-Buffer passes through four levels of downsampling Z-buffer, namely: level 0, level 1, level 2 and level 3. In the embodiment of the present application, the Z-buffer is also downsampled by HiZ-Buffer to obtain the maximum depth value in the camera viewport, so that it can cover the maximum AABB bounding box of the object. Therefore, in the embodiment of the present invention, the maximum depth value of the virtual scene captured by the depth camera can be calculated first, and then the maximum depth value can be used to determine whether the bounding boxes of static objects and dynamic objects are all after this maximum depth value. If so, it means that the object is completely blocked and does not affect the data of the shadowmask.

[0096] Implementing a similar algorithm to HiZ-Buffer may include: capturing the depth information of the virtual scene offline to obtain the depth data of the virtual scene, and then using the obtained ShadowMask depth data as a function input to process the depth data to obtain PreComputedMaxZ.

[0097] Optionally, the obtained maximum depth data is stored in an array in the current business logic, including: storing the maximum depth data in RT, reading the maximum depth data return function (float) from RT, storing the maximum depth of all Cell areas in the form of key-value pairs (for example, Cell Id, maximum depth value), and then creating a 1-pixel single-channel RT to store the maximum depth data in the Cell after HiZ-Buffer calculation, creating a new function in the blueprint function library to submit the rendering queue to RHI, creating a single floating-point value to record the maximum depth value of the Cell, reading the maximum depth data from the RT after HiZ-Buffer calculation, and storing it in the array.

[0098] The second part is implemented in the runtime state. According to the visibility and maximum depth value data obtained above, it is determined whether it is necessary to switch the dynamic Capture depth map, and the ShadowMask is mixed with the depth information of the dynamic object using the minimum depth algorithm.

[0099] For dynamic objects, the depth data obtained by the HiZ-like algorithm based on the Shadow Mask of the static virtual scene can be used to determine the AABB bounding box of the dynamic object contained in the Cell, and then converted to the depth camera projection space to further determine the depth, including: each Cell corresponds to a visible object, and determines whether the static object in the test scene is after the maximum depth. If so, it is invisible; traverse all static objects to determine the center point position of the object and the longest side of the object's AABB bounding box; call, if it returns true (True), it means that the static object is visible, and it is added to the array to obtain the visible list (VisibleActors) of each Cell. It should be noted that this method is also applicable to dynamic objects.

[0100] Figure 5 is a schematic diagram of an operating interface for determining the depth of an object bounding box according to an embodiment of the present application. Figure 5 As shown, the maximum value Z represents the maximum depth data, the X-axis, Y-axis, and Z-axis represent the position coordinates of the object whose depth needs to be judged, and the matrix transformation is used to determine whether the object AABB bounding box is before PrecomputedMaxZ. If it returns true, it proves that the current object is before the maximum depth and is saved in a list (for example, CellVisibleActors) as the data of the depth Capture camera (ShowOnlyActors). Then, when capturing the depth of each frame, only the object of CellVisibleActors is captured to obtain the depth map information of a dynamic object.

[0101] Optionally, coarse-grained culling is performed through the UE4 engine to exclude objects in the cell that are invisible to the depth camera and obtain visibility data.

[0102] Optionally, call ComputeShader to process each pixel in parallel, and min-blend the dynamic object depth map with the Shadow Mask shadow map statically baked by ShadowMask, including: when a dynamic object updates its position in the Cell, trigger the Cell to capture the depth of the dynamic object; obtain the Bounds bounding box of the dynamic object; convert the bounding box to the depth camera space through the matrix; determine whether the AABB bounding box is less than the maximum depth of PreComputedMaxZ; if no is returned, there is no need to capture the depth of the dynamic object, and there is no need to blend the minimum depth, and the Shadow Mask depth map is directly used as the depth information output of the Cell; if yes is returned, the dynamic object depth is recaptured to obtain the dynamic object depth map information containing all objects; the static object Shadow Mask depth map and the dynamic object depth map are blended according to the minimum depth information per pixel.

[0103] Figure 6(a) is a schematic diagram of a depth map according to an embodiment of the present invention. As shown in Figure 6(a), the arrow 61 points to the Renderdoc frame capture display of the depth map sampled by the virtual character Shader, and the arrow 62 points to the depth map of the virtual character. Figure 6(b) is a schematic diagram of another depth map according to an embodiment of the present invention. As shown in Figure 6(b), it can be an example of a depth map of a virtual character.

[0104] In an embodiment of the present invention, visibility and maximum depth value data are solved by using HiZ-buffer similar logic based on the depth map information obtained according to the shadow Mask; based on the visibility and maximum depth value data, it is determined whether it is necessary to switch the dynamic Capture depth map, and the minimum depth algorithm is used to mix the Shadow Mask and the depth information of the dynamic object, so as to achieve the purpose of generating and updating the depth map of static and dynamic objects in the scene with minimal consumption when the game is running, avoiding updating the depth of all objects, and then projecting the shadow onto the character, thereby solving the technical problem of low shadow generation efficiency of the virtual character and achieving the technical effect of improving the shadow generation efficiency of the virtual character.

[0105] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0106] In this embodiment, a method for executing Figure 2 The information processing device of the illustrated embodiment is used to implement the above-mentioned embodiments and preferred embodiments, and details already described will not be repeated. As used below, the terms "unit" and "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.

[0107] Figure 7 is a schematic diagram of an information processing device according to an embodiment of the present application, such as Figure 7 As shown, the information processing device 700 includes: a determination unit 701, a fusion processing unit 702, a creation unit 703 and a rendering unit 704.

[0108] The determining unit 701 is configured to determine, in a scene area of ​​a virtual scene, that a first virtual object moves to a sub-scene area.

[0109] The fusion processing unit 702 is used to fuse the first depth map of the first virtual object and the second depth map of the second virtual object in response to the first virtual object being between the virtual character and the second virtual object in the sub-scene area in the virtual scene to obtain a target depth map, wherein the second virtual object is in a stationary state.

[0110] The creating unit 703 is configured to create a shadow map using the target depth map.

[0111] The rendering unit 704 is configured to render and display a target shadow representation on the virtual character based on the shadow map, wherein the target shadow representation is a shadow formed by the first virtual object and the second virtual object on the virtual character.

[0112] Optionally, the device further includes: a first determining unit, configured to determine, based on maximum depth data of the second depth map, that the first virtual object is between the virtual character and the second virtual object.

[0113] Optionally, the first determination unit includes: a first determination module, used to determine the contour information of the first virtual object; a second determination module, used to determine that the first virtual object is between the virtual character and the second virtual object in response to the depth data of the contour information in the depth camera space being less than the maximum depth data in the depth camera space.

[0114] Optionally, the first determining unit further includes: a first acquiring module configured to acquire a first depth map based on a depth camera corresponding to the depth camera space in response to depth data of the contour information in the depth camera space being less than maximum depth data in the depth camera space.

[0115] Optionally, the first determining module includes: a first determining submodule, configured to determine a bounding box of the first virtual object in the virtual scene, wherein the bounding box is used to represent contour information of an area occupied by the first virtual object in the virtual scene.

[0116] Optionally, the apparatus further includes: a first comparison unit, configured to call a shader to compare the depth data in the second depth map with the initial maximum depth data to obtain maximum depth data.

[0117] Optionally, the fusion processing unit 702 includes: a first comparison module, used to compare the depth data on multiple first pixels in the first depth map with the depth data on multiple second pixels in the second depth map to obtain a comparison result; and a first generation module, used to generate a target depth map based on the comparison result.

[0118] Optionally, the first comparison module includes: a first acquisition submodule, used to obtain the minimum depth data between the depth data on each first pixel and the depth data on each corresponding second pixel, to obtain multiple minimum depth data, wherein the position of each first pixel in the first depth map is the same as the position of each corresponding second pixel in the second depth map.

[0119] Optionally, the first generating module includes: a second determining submodule, configured to determine each minimum depth data as depth data on a third pixel in the target depth map, to obtain the target depth map.

[0120] Optionally, the device further includes: a second determining unit, configured to determine the second depth map of the second virtual object as the target depth map in response to the first virtual object not being between the virtual character in the virtual scene and the second virtual object in the sub-scene area.

[0121] Optionally, the device further includes: a static baking unit, configured to perform static baking on the second virtual object to obtain a second depth map.

[0122] In the information processing device of this embodiment, a determination unit is used to determine that a first virtual object moves to a sub-scene area in a scene area of ​​a virtual scene; a fusion processing unit is used to fuse a first depth map of the first virtual object and a second depth map of the second virtual object in response to the first virtual object being between a virtual character in the virtual scene and a second virtual object in the sub-scene area to obtain a target depth map, wherein the second virtual object is in a stationary state; a creation unit is used to create a shadow map using the target depth map; a rendering unit is used to render and display a target shadow representation on the virtual character based on the shadow map, wherein the target shadow representation is a shadow formed by the first virtual object and the second virtual object on the virtual character, thereby solving the technical problem of low shadow generation efficiency of the virtual character and achieving the technical effect of improving the shadow generation efficiency of the virtual character.

[0123] It should be noted that the above-mentioned units and modules can be implemented through software or hardware. For the latter, it can be implemented in the following ways, but not limited to this: the above-mentioned units and modules are all located in the same processor; or the above-mentioned units and modules are located in different processors in any combination.

[0124] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above method embodiments when run.

[0125] Optionally, in this embodiment, the above-mentioned computer-readable storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.

[0126] Optionally, in this embodiment, the computer-readable storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.

[0127] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:

[0128] S1, in a scene area of ​​a virtual scene, determining that a first virtual object moves to a sub-scene area;

[0129] S2, in response to the first virtual object being between the virtual character in the virtual scene and the second virtual object in the sub-scene area, fusing the first depth map of the first virtual object and the second depth map of the second virtual object to obtain a target depth map, wherein the second virtual object is in a stationary state;

[0130] S3, creates a shadow map using the target depth map;

[0131] S4: Rendering and displaying a target shadow representation on the virtual character based on the shadow map, wherein the target shadow representation is a shadow formed by the first virtual object and the second virtual object on the virtual character.

[0132] Optionally, the computer-readable storage medium is further configured to store program code for executing the following steps: determining, based on maximum depth data of the second depth map, that the first virtual object is between the virtual character and the second virtual object.

[0133] Optionally, the computer-readable storage medium is further configured to store program code for executing the following steps: determining contour information of the first virtual object; and determining that the first virtual object is between the virtual character and the second virtual object in response to the depth data of the contour information in the depth camera space being less than the maximum depth data in the depth camera space.

[0134] Optionally, the above-mentioned computer-readable storage medium is also configured to store program code for executing the following steps: in response to the depth data of the contour information in the depth camera space being less than the maximum depth data in the depth camera space, obtaining a first depth map based on the depth camera corresponding to the depth camera space.

[0135] Optionally, the computer-readable storage medium is further configured to store program code for executing the following steps: determining a bounding box of the first virtual object in the virtual scene, wherein the bounding box is used to represent contour information of an area occupied by the first virtual object in the virtual scene.

[0136] Optionally, the computer-readable storage medium is further configured to store program code for executing the following steps: calling a shader to compare the depth data in the second depth map with the initial maximum depth data to obtain maximum depth data.

[0137] Optionally, the computer-readable storage medium is further configured to store program code for executing the following steps: comparing depth data on multiple first pixels in the first depth map with depth data on multiple second pixels in the second depth map to obtain a comparison result; and generating a target depth map based on the comparison result.

[0138] Optionally, the above-mentioned computer-readable storage medium is also configured to store program code for performing the following steps: obtaining the minimum depth data between the depth data on each first pixel and the depth data on each corresponding second pixel, and obtaining multiple minimum depth data, wherein the position of each first pixel in the first depth map is the same as the position of each corresponding second pixel in the second depth map.

[0139] Optionally, the computer-readable storage medium is further configured to store program code for executing the following steps: determining each minimum depth data as depth data on a third pixel in the target depth map to obtain the target depth map.

[0140] Optionally, the computer-readable storage medium is further configured to store program code for executing the following steps: when the first virtual object is not between the virtual character in the virtual scene and the second virtual object in the sub-scene area, determining the second depth map of the second virtual object as the target depth map.

[0141] Optionally, the computer-readable storage medium is further configured to store program codes for executing the following steps: static baking the second virtual object to obtain a second depth map.

[0142] In the computer-readable storage medium of this embodiment, in a scene area of ​​a virtual scene, it is determined that a first virtual object moves to a sub-scene area; in response to the first virtual object being between a virtual character in the virtual scene and a second virtual object in the sub-scene area, a first depth map of the first virtual object and a second depth map of the second virtual object are fused to obtain a target depth map; a shadow map is created using the target depth map; and a target shadow representation is rendered and displayed on the virtual character based on the shadow map, thereby solving the technical problem of low shadow generation efficiency of the virtual character and achieving the technical effect of improving the shadow generation efficiency of the virtual character.

[0143] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present application.

[0144] In an exemplary embodiment of the present application, a computer-readable storage medium stores a program product capable of implementing the above-described method of the present embodiment. In some possible implementations, various aspects of the present embodiment can also be implemented in the form of a program product, which includes program code. When the program product is executed on a terminal device, the program code is used to cause the terminal device to execute the steps described in the "Exemplary Method" section of the present embodiment according to various exemplary implementations of the present application.

[0145] According to the program product for implementing the above method according to the embodiment of the present application, it can adopt a portable compact disc read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the embodiment of the present application is not limited thereto. In the embodiment of the present application, the computer-readable storage medium can be any tangible medium containing or storing a program, and the program can be used by or in combination with an instruction execution system, apparatus, or device.

[0146] The program product may be implemented in any combination of one or more computer-readable media. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples (non-exhaustive) of computer-readable storage media include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0147] It should be noted that the program code contained in the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any appropriate combination of the above.

[0148] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0149] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0150] Optionally, in this embodiment, the processor may be configured to execute the following steps through a computer program:

[0151] S1, in a scene area of ​​a virtual scene, determining that a first virtual object moves to a sub-scene area;

[0152] S2, in response to the first virtual object being between the virtual character in the virtual scene and the second virtual object in the sub-scene area, fusing the first depth map of the first virtual object and the second depth map of the second virtual object to obtain a target depth map, wherein the second virtual object is in a stationary state;

[0153] S3, creates a shadow map using the target depth map;

[0154] S4: Rendering and displaying a target shadow representation on the virtual character based on the shadow map, wherein the target shadow representation is a shadow formed by the first virtual object and the second virtual object on the virtual character.

[0155] Optionally, the processor may be further configured to perform the following steps through a computer program: determining, based on maximum depth data of the second depth map, that the first virtual object is between the virtual character and the second virtual object.

[0156] Optionally, the above-mentioned processor can also be configured to perform the following steps through a computer program: determining contour information of the first virtual object; in response to the depth data of the contour information in the depth camera space being less than the maximum depth data in the depth camera space, determining that the first virtual object is between the virtual character and the second virtual object.

[0157] Optionally, the above-mentioned processor can also be configured to perform the following steps through a computer program: in response to the depth data of the contour information in the depth camera space being less than the maximum depth data in the depth camera space, obtaining a first depth map based on the depth camera corresponding to the depth camera space.

[0158] Optionally, the processor may be further configured to perform the following steps through a computer program: determining a bounding box of the first virtual object in the virtual scene, wherein the bounding box is used to represent contour information of an area occupied by the first virtual object in the virtual scene.

[0159] Optionally, the processor may be further configured to perform the following steps through a computer program: calling a shader to compare the depth data in the second depth map with the initial maximum depth data to obtain maximum depth data.

[0160] Optionally, the processor may be configured to perform the following steps through a computer program: comparing depth data on multiple first pixels in the first depth map with depth data on multiple second pixels in the second depth map to obtain a comparison result; and generating a target depth map based on the comparison result.

[0161] Optionally, the above-mentioned processor can also be configured to perform the following steps through a computer program: obtain the minimum depth data between the depth data on each first pixel and the depth data on each corresponding second pixel, and obtain multiple minimum depth data, wherein the position of each first pixel in the first depth map is the same as the position of each corresponding second pixel in the second depth map.

[0162] Optionally, the processor may be further configured to execute the following steps through a computer program: determining each minimum depth data as depth data on a third pixel in the target depth map to obtain the target depth map.

[0163] Optionally, the processor may be configured to execute the following steps through a computer program: when the first virtual object is not between the virtual character in the virtual scene and the second virtual object in the sub-scene area, determine the second depth map of the second virtual object as the target depth map.

[0164] Optionally, the processor may be further configured to execute the following steps through a computer program: statically bake the second virtual object to obtain a second depth map.

[0165] In the electronic device of this embodiment, in the scene area of ​​the virtual scene, it is determined that the first virtual object moves to the sub-scene area; in response to the first virtual object being between the virtual character in the virtual scene and the second virtual object in the sub-scene area, the first depth map of the first virtual object and the second depth map of the second virtual object are fused to obtain a target depth map; a shadow map is created using the target depth map; and the target shadow representation is rendered and displayed on the virtual character based on the shadow map, thereby solving the technical problem of low shadow generation efficiency of the virtual character and achieving the technical effect of improving the shadow generation efficiency of the virtual character.

[0166] Figure 8 Schematic diagram of an electronic device according to an embodiment of the present application. Figure 8 As shown, the electronic device 800 is merely an example and should not limit the functions and scope of use of the embodiments of the present application.

[0167] like Figure 8 As shown, electronic device 800 is implemented as a general-purpose computing device. Components of electronic device 800 may include, but are not limited to, at least one processor 810, at least one memory 820, a bus 830 connecting various system components (including memory 820 and processor 810), and a display 840.

[0168] The memory 820 stores program code, which can be executed by the processor 810, so that the processor 810 executes the steps described in the method section of the embodiment of the present application according to various exemplary embodiments of the present application.

[0169] The memory 820 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 8201 and / or a cache memory unit 8202, and may further include a read-only memory unit (ROM) 8203, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.

[0170] In some examples, the memory 820 may also include a program / utility 8204 having a set (at least one) of program modules 8205. Such program modules 8205 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. The memory 820 may further include a memory remotely located relative to the processor 810. These remote memories may be connected to the electronic device 800 via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0171] Bus 830 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a local bus to processor 810, or a bus using any of a variety of bus architectures.

[0172] The display 840 may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the electronic device 800 .

[0173] Optionally, the electronic device 800 may also communicate with one or more external devices 800 (e.g., a keyboard, a pointing device, a Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 800, and / or any device that enables the electronic device 800 to communicate with one or more other computing devices (e.g., a router, a modem, etc.). Such communication may be performed through an input / output (I / O) interface 850. Furthermore, the electronic device 800 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 860. Figure 8 As shown, the network adapter 860 communicates with other modules of the electronic device 800 via the bus 830. Figure 8Not shown, other hardware and / or software modules may be used in conjunction with electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0174] The electronic device 800 may further include: a keyboard, a cursor control device (such as a mouse), an input / output interface (I / O interface), a network interface, a power supply and / or a camera.

[0175] It can be understood by those skilled in the art that Figure 8 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 8 More or fewer components than shown, or with Figure 8 The memory 820 can be used to store computer programs and corresponding data, such as the computer program and corresponding data corresponding to the information processing method in the embodiments of the present application. The processor 810 executes the computer program stored in the memory 820 to perform various functional applications and data processing, that is, to implement the above-mentioned information processing method.

[0176] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0177] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0178] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0179] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0180] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0181] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0182] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. An information processing method, characterized in that: include: In a scene area of ​​the virtual scene, determining that the first virtual object moves to a sub-scene area; In response to the first virtual object being between the virtual character in the virtual scene and the second virtual object in the sub-scene area, fusing a first depth map of the first virtual object and a second depth map of the second virtual object to obtain a target depth map, wherein the second virtual object is in a stationary state; creating a shadow map using the target depth map; Rendering and displaying a target shadow representation on the virtual character based on the shadow map, wherein the target shadow representation is a shadow formed by the first virtual object and the second virtual object on the virtual character; The method further includes: determining outline information of the first virtual object; and in response to depth data of the outline information in a depth camera space being less than maximum depth data in the depth camera space, determining that the first virtual object is between the virtual character and the second virtual object; The method further includes: in response to depth data of the contour information in the depth camera space being less than the maximum depth data in the depth camera space, acquiring the first depth map based on a depth camera corresponding to the depth camera space; The method further includes: calling a shader to compare the depth data in the second depth map with the initial maximum depth data to obtain the maximum depth data.

2. The method according to claim 1, characterized in that Determining the outline information of the first virtual object includes: Determine a bounding box of the first virtual object in the virtual scene, wherein the bounding box is used to represent contour information of an area occupied by the first virtual object in the virtual scene.

3. The method according to claim 1, characterized in that Fusing the first depth map of the first virtual object and the second depth map of the second virtual object to obtain a target depth map, including: Comparing depth data of a plurality of first pixels in the first depth map with depth data of a plurality of second pixels in the second depth map to obtain a comparison result; The target depth map is generated based on the comparison result.

4. The method according to claim 3, characterized in that Comparing depth data of a plurality of first pixels in the first depth map with depth data of a plurality of second pixels in the second depth map to obtain a comparison result includes: Obtain minimum depth data between the depth data on each of the first pixels and the depth data on the corresponding each of the second pixels, to obtain a plurality of the minimum depth data, wherein a position of each of the first pixels in the first depth map is the same as a position of each of the corresponding second pixels in the second depth map.

5. The method according to claim 4, characterized in that Generating the target depth map based on the comparison result includes: Each minimum depth data is determined as depth data at a third pixel in the target depth map to obtain the target depth map.

6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: In response to the first virtual object not being between the virtual character in the virtual scene and the second virtual object in the sub-scene area, the second depth map of the second virtual object is determined as the target depth map.

7. The method according to any one of claims 1 to 5, characterized in that The method further comprises: Static baking is performed on the second virtual object to obtain the second depth map.

8. An information processing device, characterized in that include: a determining unit, configured to determine, in a scene area of ​​the virtual scene, that the first virtual object moves to a sub-scene area; a fusion processing unit, configured to, in response to the first virtual object being between the virtual character in the virtual scene and the second virtual object in the sub-scene area, fuse the first depth map of the first virtual object and the second depth map of the second virtual object to obtain a target depth map, wherein the second virtual object is in a stationary state; A creation unit, configured to create a shadow map using the target depth map; a rendering unit, configured to render and display a target shadow representation on the virtual character based on the shadow map, wherein the target shadow representation is a shadow formed by the first virtual object and the second virtual object on the virtual character; The device is further configured to: determine outline information of the first virtual object; and in response to depth data of the outline information in a depth camera space being less than maximum depth data in the depth camera space, determine that the first virtual object is between the virtual character and the second virtual object; The apparatus is further configured to: in response to depth data of the contour information in the depth camera space being less than the maximum depth data in the depth camera space, acquire the first depth map based on a depth camera corresponding to the depth camera space; The device is further configured to: call a shader to compare the depth data in the second depth map with the initial maximum depth data to obtain the maximum depth data.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 7 when executed by a processor.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Virtual reality occlusion handling method, based on virtual model pretreatment, in augmented reality system

    CN103489214A

  • Virtual object processing method, virtual object processing apparatus, medium and computing device

    CN108010118A