Methods, apparatus, storage media and electronic devices for projection processing of virtual objects

By using pseudo-light sources and projection decals in game scenes, the problem of weak projection of virtual objects was solved, improving the realism of virtual objects and the efficiency of projection processing, thus enhancing the user experience.

CN115970275BActive Publication Date: 2026-05-26NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NETEASE (HANGZHOU) NETWORK CO LTD
Filing Date
2022-12-01
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

In existing technologies, only one or two main light sources are retained in game scenes to reduce the performance consumption of light and shadow rendering, resulting in weak or absent ground projections of virtual objects, which reduces the realism of virtual objects in the scene and the user experience.

Method used

By using pseudo-light sources to simulate the position of real light sources in an indoor game scene, the projection position and angle are determined based on the position information of the virtual object and the pseudo-light source information. Then, projection decal technology is used for rendering to generate the projection of the virtual object, simulating its projection on the ground.

Benefits of technology

It improves the realism and movement of virtual objects in the scene, reduces the performance overhead of projection processing, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115970275B_ABST
    Figure CN115970275B_ABST
Patent Text Reader

Abstract

This disclosure provides a method, apparatus, computer-readable storage medium, and electronic device for processing the projection of virtual objects, relating to the field of computer technology. The method includes: in response to a controlled virtual object entering an indoor game scene, acquiring first position information of the controlled virtual object in the indoor game scene and second position information of a specified pseudo-light source in the indoor game scene; determining the projection position and projection angle of the controlled virtual object in the indoor game scene based on the first and second position information; displaying a projection decal at the projection position and according to the projection angle in the indoor game scene to simulate the projection of the controlled virtual object in the indoor game scene; wherein the projection decal is generated by rendering based on scene information in the indoor game scene and a specified projection material. This disclosure improves the realism of virtual object projection and enhances the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a method for processing the projection of virtual objects, a device for processing the projection of virtual objects, a computer-readable storage medium, and an electronic device. Background Technology

[0002] In game development, ground projections are typically generated for virtual objects based on the light sources in the game scene to enhance the realism of the virtual objects on the ground.

[0003] In related technologies, after constructing the lighting for the game scene, only one or two main light sources are retained or even completely removed to reduce the performance consumption caused by lighting and shadow rendering. However, this method makes the ground projection of virtual objects very weak or even non-existent, which reduces the realism of virtual objects moving in the scene and thus reduces the user experience. Summary of the Invention

[0004] This disclosure provides a method for processing the projection of virtual objects, a device for processing the projection of virtual objects, a computer-readable storage medium, and an electronic device, thereby improving, at least to some extent, the problem of low realism in the projection of virtual objects.

[0005] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part from practice of this disclosure.

[0006] According to a first aspect of this disclosure, a method for processing the projection of a virtual object is provided, applied in an indoor game scene. The indoor game scene includes static virtual objects, and the projection of the static virtual objects is calculated and generated in one go through scene baking. The method includes: in response to a controlled virtual object entering the indoor game scene, acquiring first position information of the controlled virtual object in the indoor game scene and second position information of a specified pseudo-light source in the indoor game scene; wherein the pseudo-light source refers to a light source in the indoor game scene used to simulate the position of a real light source without producing a lighting effect; determining the projection position and projection angle of the controlled virtual object in the indoor game scene based on the first position information and the second position information; displaying a projection decal in the indoor game scene at the projection position and according to the projection angle to simulate the projection of the controlled virtual object in the indoor game scene; wherein the projection decal is generated by rendering based on scene information and a specified projection material in the indoor game scene.

[0007] According to a second aspect of this disclosure, a projection processing apparatus for virtual objects is provided, applied in an indoor game scene, the indoor game scene including static virtual objects, the projection of which is calculated and generated in one go through scene baking; comprising: a position information acquisition module configured to, in response to a controlled virtual object entering the indoor game scene, acquire first position information of the controlled virtual object in the indoor game scene and second position information of a specified pseudo light source in the indoor game scene; wherein, the pseudo light source refers to a light source in the indoor game scene used to simulate the position of a real light source without producing a lighting effect; a projection position and projection angle determination module configured to, based on the first position information and the second position information, determine the projection position and projection angle of the controlled virtual object in the indoor game scene; and a projection generation module configured to display a projection decal in the indoor game scene at the projection position and according to the projection angle to simulate the projection of the controlled virtual object in the indoor game scene; wherein, the projection decal is generated by rendering based on scene information in the indoor game scene and a specified projection material.

[0008] According to a third aspect of this disclosure, a computer-readable storage medium is provided, on which a computer program is stored, wherein when the computer program is executed by a processor, it implements the projection processing method for the virtual object of the first aspect described above, and possible implementations thereof.

[0009] According to a fourth aspect of this disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor. The processor is configured to execute the projection processing method for a virtual object as described in the first aspect, and possible implementations thereof, by executing the executable instructions.

[0010] The technical solution disclosed herein has the following beneficial effects:

[0011] Based on the above method, on the one hand, the projection position and angle of the controlled virtual object are determined based on the position information of the controlled virtual object and the pseudo-light source in the indoor game scene. Projection decals are then displayed at the projection position according to the projection angle, improving the problem of weak projection caused by obtaining the projection of the controlled virtual object based on the main light source. Projection decals are generated by rendering based on the scene information of the game scene and the specified projection material. The projection of the virtual object is then generated based on the projection decals. This eliminates the need for continuous lighting construction based on the movement of the controlled virtual object, reducing the performance overhead of the projection processing while ensuring the realism of the controlled virtual object's projection, thus improving the overall efficiency of the virtual object's projection processing. On the other hand, the controlled virtual object can still generate ground projections based on the pseudo-light source even in low-light conditions, enhancing the realism of the controlled virtual object's movement in the scene, improving the quality of the virtual object's projection, and enhancing the user experience.

[0012] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0013] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0014] Figure 1 This illustrates the system architecture of the exemplary real-time operating environment;

[0015] Figure 2 A schematic diagram illustrating the flow of a projection processing method for a virtual object in this exemplary embodiment is shown.

[0016] Figure 3 This illustration shows a flowchart of obtaining the projection position and projection angle in this exemplary embodiment;

[0017] Figure 4 A schematic diagram is shown of a controlled virtual object being illuminated by a light source to generate a ground projection;

[0018] Figure 5 A schematic diagram of a projection decal is shown in this exemplary embodiment;

[0019] Figure 6 This illustration shows a flowchart of generating a projection decal in this exemplary embodiment;

[0020] Figure 7This illustration shows a flowchart of a process for obtaining scene information in this exemplary embodiment;

[0021] Figure 8 A schematic diagram of the sampling process in Kawase Blur processing is shown;

[0022] Figure 9 (a) A schematic diagram illustrating the transparency variation of a projection decal in this exemplary embodiment;

[0023] Figure 9 (b) A schematic diagram showing the change of a projection decal blur effect in this exemplary embodiment;

[0024] Figure 10 This diagram illustrates a flowchart of generating a projection decal in this exemplary embodiment;

[0025] Figure 11 This illustrates another flowchart for generating projected decals in this exemplary embodiment;

[0026] Figure 12 A flowchart illustrating a projection processing method for a virtual object in this exemplary embodiment is shown.

[0027] Figure 13 A schematic diagram showing the virtual illumination range of a pseudo-light source in this exemplary embodiment is provided.

[0028] Figure 14 This illustration shows a schematic diagram of loading a projection blueprint in this exemplary embodiment;

[0029] Figure 15 This diagram illustrates a projection processing apparatus for a virtual object in this exemplary embodiment.

[0030] Figure 16 A schematic diagram of the structure of an electronic device in this exemplary embodiment is shown. Detailed Implementation

[0031] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.

[0032] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0033] In related technologies, after constructing the lighting of the game scene, only one or two main light sources are retained to reduce the performance consumption caused by lighting and shadow rendering. However, this method can easily cause the ground projection of movable virtual objects in scenes far from the main light source to be very weak or even disappear. This makes players feel from a visual perspective that the virtual object is not standing on the ground, resulting in a low sense of realism in the movement of virtual objects in the scene, thereby reducing the player's immersive experience.

[0034] In view of one or more of the above-mentioned problems, this disclosure first provides a method for processing the projection of virtual objects, and then combines the following exemplary embodiments. Figure 1 The system architecture of the operating environment for this exemplary embodiment will be described.

[0035] refer to Figure 1As shown, the system architecture 100 may include a terminal device 110 and a server 120. The terminal device 110 may be an electronic device such as a desktop computer, laptop computer, or smartphone, and can be used to obtain scene information about the area where the controlled virtual object is located in the game scene. The server 120 generally refers to a backend system that provides services related to the projection processing of virtual objects in this exemplary embodiment, such as a server that implements the projection processing method for virtual objects. The server 120 may be a single server or a cluster of multiple servers; this disclosure does not limit this. The terminal device 110 and the server 120 can be connected via a wired or wireless communication link for data interaction.

[0036] In one embodiment, the projection processing method for virtual objects in this exemplary embodiment can be executed by the terminal device 110. For example, in a game scene where a controlled virtual object is standing on the ground, the terminal device 110 can be a device running the current game, and its display screen can show the game scene. When the controlled virtual object enters the indoor game scene, the terminal device 110 can determine the projection position and projection angle of the controlled virtual object based on the position information of the controlled virtual object and the position information of the pseudo light source in the indoor game scene, and render according to the scene information of the game scene and the specified projection material to generate a projection decal; finally, the projection decal is displayed at the projection position according to the projection angle to form the projection of the controlled virtual object.

[0037] In one implementation, the terminal device 110 can run the game and, after the controlled virtual object enters the indoor game scene, acquire the position information of the controlled virtual object in the indoor game scene in real time. This position information, along with the position information of the pseudo light source in the indoor game scene, is sent to the server. After receiving the position information of the controlled virtual object and the position information of the pseudo light source sent by the terminal device 110, the server 120 can determine the projection position and projection angle of the controlled virtual object based on the above two position information, and perform rendering according to the scene information of the indoor game scene and the specified projection material to generate a projection decal. The projection position, projection angle, and projection decal are then sent to the terminal device 110. After receiving the projection position and projection angle, the terminal device 110 displays the projection decal at the projection position and according to the projection angle to form the projection of the controlled virtual object.

[0038] The following is combined with Figure 2 The method for handling projection of virtual objects is explained. Figure 2 An exemplary flow of a projection processing method for virtual objects is shown, including the following steps S210 to S230:

[0039] Step S210: In response to the controlled virtual object entering the indoor game scene, obtain the first position information of the controlled virtual object in the indoor game scene and the second position information of the pseudo light source specified in the indoor game scene; wherein, the pseudo light source refers to a light source in the indoor game scene used to simulate the position of a real light source without producing a lighting effect;

[0040] Step S220: Based on the first position information and the second position information, determine the projection position and projection angle of the controlled virtual object in the indoor game scene;

[0041] Step S230: Display a projection decal in the indoor game scene at the projection position and according to the projection angle to simulate the projection of the controlled virtual object in the indoor game scene; wherein, the projection decal is generated by rendering based on the scene information in the indoor game scene and the specified projection material.

[0042] Based on the above method, on the one hand, the projection position and angle of the controlled virtual object are determined based on the position information of the controlled virtual object and the pseudo-light source in the indoor game scene. Projection decals are then displayed at the projection position according to the projection angle, improving the problem of weak projection caused by obtaining the projection of the controlled virtual object based on the main light source. Projection decals are generated by rendering based on the scene information of the game scene and the specified projection material. The projection of the virtual object is then generated based on the projection decals. This eliminates the need for continuous lighting construction based on the movement of the controlled virtual object, reducing the performance overhead of the projection processing while ensuring the realism of the controlled virtual object's projection, thus improving the overall efficiency of the virtual object's projection processing. On the other hand, the controlled virtual object can still generate ground projections based on the pseudo-light source even in low-light conditions, enhancing the realism of the controlled virtual object's movement in the scene, improving the quality of the virtual object's projection, and enhancing the user experience.

[0043] The following is about Figure 2 Each step in the process will be explained in detail.

[0044] Step S210: In response to the controlled virtual object entering the indoor game scene, obtain the first position information of the controlled virtual object in the indoor game scene and the second position information of the pseudo light source specified in the indoor game scene; wherein, the pseudo light source refers to a light source used in the indoor game scene to simulate the position of a real light source without producing a lighting effect.

[0045] The virtual object can include virtual objects in the game. This disclosure does not specifically limit the content of the virtual object; for example, a virtual object can include a character in the game, virtual items in the game, etc. The controlled virtual object can be a virtual object controlled by the user or the aforementioned terminal device 110. For example, a controlled virtual object can include a game character controlled by the player. The first location information can be the position of the controlled virtual object in the indoor game scene. For example, the first location information can include the coordinates of the controlled virtual object in a three-dimensional coordinate system constructed according to the indoor game scene. The second location information can represent the orientation of the pseudo-light source in the indoor game scene. For example, the second location information can include the coordinates and illumination direction of the pseudo-light source in the indoor game scene. A pseudo-light source is a type of light source in a game scene that does not produce lighting effects. It has a virtual illumination range. If a virtual object enters the virtual illumination range of the pseudo-light source, a projection processing method is triggered to generate a projection of the controlled virtual object through projection decals. This disclosure does not impose any special limitations on the shape of the illumination range of the pseudo-light source. For example, considering that the controlled virtual object can fly or walk in the game, the illumination range of the pseudo-light source can be a spherical illumination range to monitor whether the controlled virtual object has entered the illumination range of the pseudo-light source from all angles.

[0046] For example, the virtual illumination range of the pseudo-light source can include the aforementioned indoor game scene. In response to the controlled virtual object entering the indoor game scene, the first position information of the controlled virtual object in the indoor game scene and the second position information of the pseudo-light source specified in the indoor game scene can be obtained immediately, thereby generating the projection of the controlled virtual object.

[0047] After obtaining the first and second location information, continue to refer to... Figure 2 In step S220, the projection position and projection angle of the controlled virtual object in the indoor game scene can be determined based on the first position information and the second position information.

[0048] The projection position is the position where the projection of the controlled virtual object is displayed, and the projection angle can include the display angle of the projection.

[0049] In one implementation, determining the projection position and projection angle of the controlled virtual object in the indoor game scene based on the first position information and the second position information may include steps S310 to S320:

[0050] Step S310: Determine the projection position of the controlled virtual object based on the first position information;

[0051] Step S320: Determine the projection angle of the controlled virtual object based on the positional relationship between the first position information and the second position information.

[0052] In step S310, the projection position can be determined based on the first position information. In step S320, the projection angle can be adjusted in real time according to the positional relationship between the first position information and the second position information, so that the projection display is more in line with the placement posture of the controlled virtual object, thereby improving the realism of the projection of the controlled virtual object and improving the user's viewing experience.

[0053] After determining the projection position and angle, continue to refer to... Figure 2 In step S230, a projection decal can be displayed at the projection position and at the projection angle in the indoor game scene to simulate the projection of a controlled virtual object in the indoor game scene; wherein the projection decal is generated by rendering based on the scene information in the indoor game scene and the specified projection material.

[0054] The scene information can be image information of one or more frames in the game scene. This disclosure does not make any special limitations on the specific content and acquisition method of the scene information. For example, scene information can be captured in real time by SceneCaptureComponent2D. Its principle is similar to receiving images from a camera. SceneCaptureComponent2D can capture scene information from a virtual camera and store the scene information as an image to generate the material of the virtual object. The scene information can include RGB information and Alpha information.

[0055] Rendering is a process in game development that visually presents game effects. This disclosure does not specifically limit the details of the rendering process; for example, such as... Figure 4 As shown, it can be rendered using the UE4 engine. Figure 4 In game scenes where light sources illuminate virtual objects to create ground projections, stylized rendering is often used to achieve better artistic effects. In such cases, the default rendering method of the UE4 engine cannot be used. Rendering logic needs to be manually written according to the rendering requirements. Manually writing rendering logic can be done by modifying the rendering pipeline at the bottom layer of the UE4 engine, or the rendering logic can be directly written into the material surface layer.

[0056] Decals are materials that can be projected onto meshes (including static and skeletal meshes). Decals can be projected onto meshes regardless of whether they are static or movable. Rendering many decals simultaneously can result in better game effects without significantly degrading performance. In game content creation, decals are often used to depict stains on object surfaces, such as rust on metal surfaces, moss on damp walls, or bloodstains on walls in horror games. Projected decals can be materials used to project the image of controlled virtual objects, such as... Figure 5As shown, the projection decals of the controlled virtual object can include the shadowed part on the ground. In this solution, the projection of the virtual character is generated by the decals, so that the controlled virtual object has a clear projection on the ground. This improves the realism of the controlled virtual object moving in the scene while reducing performance overhead.

[0057] The following describes the specific process of generating projection decals by rendering based on scene information and specified projection materials in an indoor game scene.

[0058] In one embodiment, the process of generating projection decals by rendering based on scene information and specified projection materials in an indoor game scene may include steps S610 to S620:

[0059] Step S610: Obtain scene information;

[0060] Step S620: Import scene information into the rendering component, render the projection material through the rendering component, and generate projection decals.

[0061] The rendering component can be a game production component that renders projected materials based on scene information. This disclosure does not specifically limit the content of the rendering component. For example, the rendering component may include a rendering target, which is a special texture that stores color information. Unlike regular textures, this special texture can both write and read data.

[0062] In step S610, scene information can be obtained first. In one embodiment, obtaining scene information may include the following steps S710 to S720:

[0063] Step S710: Acquire one or more frames of scene images of the area where the controlled virtual object is located in the game scene, captured by the virtual camera viewport;

[0064] Step S720: Extract color and transparency information from one or more scene images to obtain scene information.

[0065] The aforementioned color information can represent the color and transparency in one or more frames of scene images. This disclosure does not limit the specific content of the color information and transparency information. For example, the color information can include the RGB information of one or more frames of scene images, and the transparency information can include the alpha information in one or more frames of scene images.

[0066] In step S710, one or more frames of scene images of the area where the controlled virtual object is located in the game scene captured by the virtual camera viewport can be obtained; in step S720, color information and transparency information in the scene images can be extracted to obtain scene information.

[0067] For example, the CaptureSource option of the SceneCaptureComponent2D component can be set to "SceneColor (HDR) in RGB, inv Opacity in A" to capture RGB and Alpha information from one or more frames of scene images from the virtual camera viewport, which can then be used as scene information. Furthermore, staff can specify the types of information from the virtual camera viewport to be captured to obtain richer scene information.

[0068] After obtaining the scene information, in step S620, the scene information can be imported into the rendering component, and the projection material can be rendered through the rendering component to generate the projection decal.

[0069] Importing scene information into the rendering component allows for temporary storage and image processing to create projected decals. For example, scene information may include RGB and alpha data, and the rendering component may include a Render Target from the UE4 engine; the RGB and alpha information can be written to the Render Target for temporary storage.

[0070] In one implementation, the above-mentioned method of rendering projection materials using a rendering component to generate projection decals may include the following steps:

[0071] By applying one or more of the following processing methods to the projection material through the rendering component: blurring, color adjustment, and transparency adjustment, projection decals are generated.

[0072] The blurring process can blur the obtained projection material to make its display effect closer to the projection. This disclosure does not specifically limit the specific operation of the blurring process. For example, the projection material can be blurred by Kawase Blur or Gaussian blur. The blurring effect of Kawase Blur is very close to that of Gaussian blur.

[0073] like Figure 8 As shown, the principle of Kawase Blur is to sample the four corner points that are increasingly farther away from the current pixel, and to perform ping-pong-style bit block transfer between two textures of equal size; and to use a blur kernel that moves with the number of iterations, rather than a fixed blur kernel like Gaussian blur or fast mean blur (Box Blur).

[0074] Gaussian blur, also known as Gaussian smoothing, is a classic blurring algorithm. In image processing, Gaussian blur is commonly used to reduce image noise and blur images, creating a visual effect similar to viewing an image through a semi-transparent screen. The essence of image blurring is filtering high-frequency signals while retaining low-frequency signals. A common method for filtering high-frequency signals is convolution filtering; therefore, the Gaussian blurring process can be approximated by convolving the image with a normal distribution. Since the normal distribution is also called the "Gaussian distribution," this technique is called Gaussian blur. Because the Fourier transform of the Gaussian function is a Gaussian function, the process of applying Gaussian blur to an image is similar to inputting the image into a low-pass filter.

[0075] Color and transparency adjustments can be further adjusted in the rendering component to modify the color and transparency of the projection material. This disclosure does not specifically limit the specific steps for color and transparency adjustments. For example, the color and transparency of the projection material can be adjusted based on the color and transparency of the ground projection generated when the controlled virtual object in the game scene is in the direct range of the light source, so as to obtain a clearer projection decal.

[0076] In one implementation, scene information RGB and Alpha information can be temporarily saved through the rendering component Render Target. Then, a new material is created, and the scene information in the Render Target is read in the material. After the scene information is kawase-blurred, the blurred scene information is obtained. The Alpha information in the blurred scene information is extracted, and then the Alpha information is displayed using a decal to obtain the projection decal of the controlled virtual object.

[0077] In one implementation, upon receiving player commands such as "modify projection color," "modify projection blur," and "modify projection transparency," the following can be added: Figure 9 As shown in (a), the blurriness of the projected decal is dynamically adjusted, such as... Figure 9 (b) The transparency is dynamically adjusted, as is the color of the projection decal, to enable players to personalize the projection of the controlled virtual object and improve the user experience.

[0078] based on Figure 6 The method generates projection decals for controlled virtual objects based on scene information, which improves the problem of weak projection effects of controlled virtual objects when scene light sources are limited. By using decal technology to fake the projection of controlled virtual objects, the movement of characters in the scene becomes more realistic.

[0079] In addition, shadow maps can be used to generate projection decals for controlled virtual objects.

[0080] In one implementation, such as Figure 10 As shown, generating the projection decal of the controlled virtual object may further include steps S1010 to S1020:

[0081] Step S1010: Obtain the first depth value of the feature points of the controlled virtual object in the light source coordinate system and the second depth value in the eye coordinate system; the light source coordinate system is a coordinate system constructed with the pseudo light source as the viewpoint;

[0082] Step S1020: Generate a projection decal of the controlled virtual object based on the comparison result of the first depth value and the second depth value.

[0083] In this system, the feature points of the controlled virtual object are one or more points on the controlled virtual object. For example, feature points may include pixels or voxels of the controlled virtual object. The depth value can characterize the distance between the virtual camera and the virtual object. For example, in this solution, the viewpoint, the position of the virtual camera, and the origin of the light source coordinate system can be the same point. Therefore, the depth value of the feature point can include the distance between the origin of the light source coordinate system and the feature point. The light source coordinate system can be a coordinate system constructed with the position of the pseudo-light source as the viewpoint and the illumination direction of the pseudo-light source as the observation direction. The eye coordinate system is a coordinate system constructed with the direction the user looks towards the terminal device screen as the viewing angle. For example, in a game scene, the eye coordinate system can be constructed with the direction the player looks towards the computer screen running the game as the observation direction and the player's eye position as the origin of the coordinate system.

[0084] For example, a first depth value can be obtained first based on the distance between the feature points of the controlled virtual object and the origin of the light source coordinate system; then, the second depth value of the feature point in the eye coordinate system is compared with the first depth value. If the first depth value of the feature point is greater than the second depth value, it is determined that the feature point belongs to the projection decal. All feature points belonging to the projection decal are set to the preset shadow color to obtain the projection decal of the controlled virtual object.

[0085] based on Figure 10 The method can generate projected decals by comparing the depth values ​​of feature points of controlled virtual objects in different spaces. The calculation process is relatively simple, which helps to improve the overall running efficiency of the method.

[0086] In one implementation, such as Figure 11 As shown, projection decals of controlled virtual objects can also be generated through steps S1110 to S1140:

[0087] Step S1110: Obtain the first depth map of the indoor game scene in the light source coordinate system and the second depth map in the eye coordinate system; the light source coordinate system is a coordinate system constructed with the pseudo light source as the viewpoint;

[0088] Step S1120: Map the second depth map to the light source coordinate system to obtain the third depth map;

[0089] Step S1130: Obtain the intermediate shaded map based on the comparison results of the depth values ​​of the first depth map and the third depth map;

[0090] Step S1140: Based on the position information of the controlled virtual object in the light source coordinate system, sample the intermediate shadow map to generate the projection decal of the controlled virtual object.

[0091] The depth map can include the depth value of each point in the indoor game scene.

[0092] For example, in the Unity game engine, the LightMode value can be set to "ShadowCaster" to obtain the shadow mapping texture of the indoor game scene in the light source coordinate system. Based on this shadow mapping texture, a first depth map is obtained. Then, a second depth map of the indoor game scene in the eye coordinate system is obtained, and the points in the second depth map are mapped to the light source coordinate system to obtain a third depth map. An intermediate shadow map is obtained based on the points in the first depth map whose depth values ​​are greater than those in the third depth map. The intermediate shadow map is sampled based on the coordinates of the controlled virtual object in the light source coordinate system to generate the projection decal of the controlled virtual object.

[0093] based on Figure 11 The proposed method generates projection decals for controlled virtual objects based on the depth map generated in the indoor game scene where the controlled virtual object is located. This simplifies the projection decal generation process, improves the generation speed of projection decals, and thus enhances the overall operating efficiency of the method.

[0094] The following explains the specific process of displaying projected decals in an indoor game scene according to the projection position and angle.

[0095] In one implementation, if the controlled virtual object enters the virtual illumination range of the pseudo light source, a projection blueprint is created, and a projection decal is displayed at the projection position in the projection blueprint according to the projection angle; if the controlled virtual object leaves the virtual illumination range of the pseudo light source, the projection blueprint is destroyed to cancel the display of the projection decal.

[0096] The projection blueprint may include the logic for generating projection decals. This disclosure does not specifically limit the content of the projection blueprint. For example, it may include scene information acquisition logic, and update the color, transparency and blur effect of the projection material according to the scene information. It may also include binding events to bind the projection blueprint to the corresponding controlled virtual object, so that the projection blueprint and the controlled virtual object are synchronized in position.

[0097] In one implementation, determining the projection position and projection angle of the controlled virtual object in the indoor game scene based on the first position information and the second position information may include the following steps:

[0098] The projection blueprint is bound to the controlled virtual object to determine the projection position and projection angle in real time based on the first position information and the second position information.

[0099] In this exemplary embodiment, binding the projection blueprint to the controlled virtual object allows the projection blueprint and the controlled virtual object to synchronize their positions in real time. The projection angle is determined by the positions of the controlled virtual object and the pseudo light source, and the projection angle can be updated in real time, making the projection effect more in line with the movements of the controlled virtual object and enhancing the player's immersion in the game.

[0100] For example, if the virtual illumination range of a pseudo-light source can be a spherical illumination range, then a spherical collision component can be added to the pseudo-light source, and spherical collision logic can be written. When a controlled virtual object enters the virtual illumination range of the pseudo-light source, the spherical collision logic is triggered to create a projection blueprint, and the projection blueprint is bound to the controlled virtual object. The projection material is rendered according to the scene information to generate a projection decal. The position of the projection decal is synchronized according to the position of the controlled virtual object, and the projection angle is adjusted in real time according to the positional relationship between the controlled virtual object and the pseudo-light source. If the controlled virtual object leaves the virtual illumination range, the spherical collision logic is also triggered, the projection blueprint is destroyed, and the projection decal of the controlled virtual object is canceled.

[0101] Based on the above method, to address the issue of weak projection effects of controlled virtual objects due to limited scene light sources, decal technology is used to forge the projection of controlled virtual objects based on scene information in the game scene. This not only improves the realism of the movement of controlled virtual objects in the game scene but also reduces performance overhead, thereby improving the projection processing efficiency of controlled virtual objects.

[0102] In one implementation, an exemplary flow of the virtual object projection processing method of this disclosure is as follows: Figure 12 As shown, the projection processing of the virtual object can be performed according to steps S1201 to S1210.

[0103] Step S1201: When the controlled virtual object enters the virtual illumination range of the pseudo light source, a projection blueprint is created.

[0104] Step S1202: In the projection blueprint, acquire one or more frames of scene images of the area where the controlled virtual object is located in the game scene captured by the virtual camera viewport.

[0105] Step S1203: Extract color and transparency information from one or more frames of scene images to obtain scene information;

[0106] Step S1204: Import scene information into the rendering component;

[0107] Step S1205: The projection material is processed by the rendering component through one or more of the following methods: blurring, color adjustment, and transparency adjustment, to generate a projection decal.

[0108] Step S1206: Bind the projection blueprint to the controlled virtual object;

[0109] Step S1207: Determine the projection position based on the position of the controlled virtual object;

[0110] Step S1208: Determine the projection angle based on the positional relationship between the controlled virtual object and the pseudo light source;

[0111] Step S1209: Display the projection decal at the projection position according to the projection angle to form a projection of the controlled virtual object;

[0112] Step S1210: When the controlled virtual object leaves the virtual illumination range of the pseudo light source, destroy the projection blueprint.

[0113] In one implementation, after performing light baking, the static light source is deleted. The game scene can include the light-baked scene, and the pseudo light source can include the aforementioned static light source. The virtual illumination range of the pseudo light source can be as follows: Figure 13 As shown, if the controlled virtual object enters the virtual illumination range of the pseudo-light source, it can be as follows: Figure 14As shown, the projection blueprint creation method is triggered to load the projection blueprint. Within the projection blueprint, one or more frames of scene images of the area where the controlled virtual object is located in the game scene, captured by the virtual camera viewport, are obtained. Color and transparency information from these frames are then extracted to obtain scene information. After importing the scene information into the rendering component, the projection material can be processed using one or more methods, such as blurring, color adjustment, and transparency adjustment, to generate a projection decal. The projection decal is bound to the controlled virtual object to determine the projection position based on the controlled virtual object's location, and the projection angle is determined based on the positional relationship between the controlled virtual object and the pseudo-light source. The projection decal is displayed at the projection position according to the projection angle to form the projection of the controlled virtual object. When the controlled virtual object leaves the virtual illumination range of the pseudo-light source, the projection blueprint is destroyed to cancel the display of the projection decal.

[0114] Exemplary embodiments of this disclosure also provide a projection processing apparatus for virtual objects. For example... Figure 15 As shown, the projection processing device 1500 for the virtual object may include:

[0115] The location information acquisition module 1510 is configured to, in response to a controlled virtual object entering an indoor game scene, acquire first location information of the controlled virtual object in the indoor game scene and second location information of a specified pseudo light source in the indoor game scene; wherein, a pseudo light source refers to a light source in the indoor game scene used to simulate the location of a real light source without producing a lighting effect;

[0116] The projection position and projection angle determination module 1520 is configured to determine the projection position and projection angle of a controlled virtual object in an indoor game scene based on first position information and second position information.

[0117] The projection generation module 1530 is configured to display a projection decal in the indoor game scene at the projection position and according to the projection angle to simulate the projection of a controlled virtual object in the indoor game scene; wherein, the projection decal is generated by rendering based on the scene information in the indoor game scene and the specified projection material.

[0118] In one implementation, determining the projection position and projection angle of the controlled virtual object in the indoor game scene based on the first position information and the second position information may include:

[0119] The projection position of the controlled virtual object is determined based on the first position information;

[0120] The projection angle of the controlled virtual object is determined based on the positional relationship between the first position information and the second position information.

[0121] In one embodiment, the above-mentioned apparatus may further include:

[0122] Obtain scene information;

[0123] Import the scene information into the rendering component, render the projection material through the rendering component, and generate the projection decal.

[0124] In one implementation, the above-mentioned acquisition of scene information may include:

[0125] Acquire one or more frames of scene images of the area where the controlled virtual object is located in the game scene, captured by the virtual camera viewport;

[0126] Extract color and transparency information from one or more frames of scene images to obtain scene information.

[0127] In one implementation, the above-mentioned method of rendering projection materials using a rendering component to generate projection decals may include:

[0128] By applying one or more of the following processing methods to the projection material through the rendering component: blurring, color adjustment, and transparency adjustment, projection decals are generated.

[0129] In one embodiment, the above-mentioned apparatus may further include:

[0130] Obtain the first depth value of the feature points of the controlled virtual object in the light source coordinate system and the second depth value in the eye coordinate system; the light source coordinate system is a coordinate system constructed with the pseudo light source as the viewpoint;

[0131] A projection decal of a controlled virtual object is generated based on the comparison between the first depth value and the second depth value.

[0132] In one embodiment, the above-mentioned apparatus may further include:

[0133] Obtain the first depth map of the indoor game scene in the light source coordinate system and the second depth map in the eye coordinate system; the light source coordinate system is a coordinate system constructed with the pseudo light source as the viewpoint;

[0134] Map the second depth map to the light source coordinate system to obtain the third depth map;

[0135] Based on the comparison of depth values ​​between the first and third depth maps, the intermediate shaded map is obtained;

[0136] Based on the position information of the controlled virtual object in the light source coordinate system, the intermediate shadow image is sampled to generate the projection decal of the controlled virtual object.

[0137] In one embodiment, the projection processing device for the virtual object may include a projection blueprint creation module, configured to create a projection blueprint if the controlled virtual object enters the virtual illumination range of the pseudo light source, and display projection decals at the projection position in the projection blueprint according to the projection angle, wherein the projection decals are generated by rendering based on scene information in the indoor game scene and a specified projection material.

[0138] The aforementioned virtual object projection processing device may further include a projection blueprint destruction module, configured to destroy the projection blueprint if the controlled virtual object leaves the virtual illumination range of the pseudo light source, thereby canceling the display of the projection decal.

[0139] In one implementation, determining the projection position and projection angle of the controlled virtual object in the indoor game scene based on the first position information and the second position information may include:

[0140] The projection blueprint is bound to the controlled virtual object to determine the projection position and projection angle in real time based on the first and second position information.

[0141] The specific details of each part of the above-mentioned device have been described in detail in the method section of the implementation, and therefore will not be repeated here.

[0142] Exemplary embodiments of this disclosure also provide a computer-readable storage medium that can be implemented as a program product including program code, which, when run on an electronic device, causes the electronic device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure. In an alternative embodiment, the program product can be implemented as a portable compact disc read-only memory (CD-ROM) including program code and can run on an electronic device, such as a personal computer. However, the program product of this disclosure is not limited thereto. In this document, the readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

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

[0144] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.

[0145] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0146] Program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing devices can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0147] Exemplary embodiments of this disclosure also provide an electronic device. The electronic device may include a processor and a memory. The memory stores executable instructions for the processor, such as program code. The processor executes the executable instructions to perform the methods of this exemplary embodiment.

[0148] The following is for reference. Figure 16 The electronic device is illustrated by way of a general-purpose computing device. It should be understood that... Figure 16 The electronic device 1600 shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.

[0149] like Figure 16 As shown, the electronic device 1600 may include: a processor 1610, a memory 1620, a bus 1630, an I / O (input / output) interface 1640, and a network adapter 1650.

[0150] The processor 1610 may include one or more processing units, such as a central processing unit (CPU), an application processor (AP), a modem processor, a display processing unit (DPU), a graphics processing unit (GPU), an image signal processor (ISP), a controller, an encoder, a decoder, a digital signal processor (DSP), a baseband processor, an artificial intelligence processor, etc. In one embodiment, the CPU, in response to a controlled virtual object entering an indoor game scene, acquires first position information of the controlled virtual object in the indoor game scene and second position information of a specified pseudo-light source in the indoor game scene. Based on the first and second position information, it determines the projection position and projection angle of the controlled virtual object in the indoor game scene. Finally, it displays a projection decal at the projection position and according to the projection angle in the indoor game scene to simulate the projection of the controlled virtual object in the indoor game scene. The projection decal is generated by rendering based on scene information and a specified projection material in the indoor game scene.

[0151] Memory 1620 may include volatile memory, such as RAM 1621 and cache unit 1622, and may also include non-volatile memory, such as ROM 1623. Memory 1620 may also include one or more program modules 1624, such program modules 1624 including, but not limited to: 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. For example, program module 1624 may include the modules in the above-described device 1500.

[0152] Bus 1630 is used to connect different components of electronic device 1600, and may include data bus, address bus and control bus.

[0153] Electronic device 1600 can communicate with one or more external devices 1700 (such as keyboard, mouse, external controller, etc.) through I / O interface 1640.

[0154] Electronic device 1600 can communicate with one or more networks via network adapter 1650. For example, network adapter 1650 can provide mobile communication solutions such as 3G / 4G / 5G, or wireless communication solutions such as wireless LAN, Bluetooth, and near-field communication. Network adapter 1650 can communicate with other modules of electronic device 1600 via bus 1630.

[0155] although Figure 16 As not shown in the diagram, other hardware and / or software modules may also be configured in the electronic device 1600, including but not limited to: a display, microcode, device driver, redundant processor, external disk drive array, RAID system, tape drive, and data backup storage system.

[0156] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to exemplary embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0157] Those skilled in the art will understand that various aspects of this disclosure can be implemented as systems, methods, or program products. Therefore, various aspects of this disclosure can be embodied in entirely hardware implementations, entirely software implementations (including firmware, microcode, etc.), or implementations combining hardware and software aspects, collectively referred to herein as “circuit,” “module,” or “system.” Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.

[0158] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is defined only by the appended claims.

Claims

1. A method for processing the projection of a virtual object, characterized in that, Applied to indoor game scenarios, the indoor game scenario includes static virtual objects, the projection of which is calculated and generated in one go through scene baking; the method includes: In response to a controlled virtual object entering the indoor game scene, the system acquires first position information of the controlled virtual object in the indoor game scene and second position information of a specified pseudo light source in the indoor game scene; wherein, the pseudo light source refers to a light source in the indoor game scene used to simulate the position of a real light source without producing a lighting effect; Based on the first location information and the second location information, the projection position and projection angle of the controlled virtual object in the indoor game scene are determined; A projection decal is displayed in the indoor game scene at the projection position and according to the projection angle to simulate the projection of the controlled virtual object in the indoor game scene; wherein, the projection decal is generated by rendering based on scene information in the indoor game scene and a specified projection material; generating the projection decal of the controlled virtual object includes: obtaining a first depth value of the feature points of the controlled virtual object in the light source coordinate system and a second depth value in the eye coordinate system; the light source coordinate system is a coordinate system constructed with the pseudo light source as the viewpoint; generating the projection decal of the controlled virtual object based on the comparison result of the first depth value and the second depth value.

2. The method according to claim 1, characterized in that, Determining the projection position and projection angle of the controlled virtual object in the indoor game scene based on the first position information and the second position information includes: The projection position of the controlled virtual object is determined based on the first location information; The projection angle of the controlled virtual object is determined based on the positional relationship between the first position information and the second position information.

3. The method according to claim 1, characterized in that, The method further includes: Obtain the scene information; The scene information is imported into the rendering component, and the projection material is rendered by the rendering component to generate the projection decal.

4. The method according to claim 3, characterized in that, The acquisition of the scene information includes: Acquire one or more frames of scene images of the area where the controlled virtual object is located in the game scene, captured by the virtual camera viewport; Extract color and transparency information from one or more frame-by-frame scene images to obtain the scene information.

5. The method according to claim 3, characterized in that, The step of rendering the projection material through the rendering component to generate the projection decal includes: The projection decal is generated by performing one or more of the following processes on the projection material using the rendering component: blurring, color adjustment, and transparency adjustment.

6. The method according to claim 1, characterized in that, The method further includes: Obtain the first depth map of the indoor game scene in the light source coordinate system and the second depth map in the eye coordinate system; the light source coordinate system is a coordinate system constructed with the pseudo light source as the viewpoint; The second depth map is mapped to the light source coordinate system to obtain the third depth map; Based on the comparison results of the depth values ​​of the first depth map and the third depth map, an intermediate shaded map is obtained; Based on the position information of the controlled virtual object in the light source coordinate system, the intermediate shadow map is sampled to generate the projection decal of the controlled virtual object.

7. The method according to claim 1, characterized in that, The step of displaying a projected decal in the indoor game scene at the projected position and according to the projected angle includes: If the controlled virtual object enters the virtual illumination range of the pseudo light source, a projection blueprint is created, and the projection decal is displayed at the projection position in the projection blueprint according to the projection angle. The projection decal is generated by rendering based on the scene information in the indoor game scene and the specified projection material. The method further includes: If the controlled virtual object leaves the virtual illumination range of the pseudo light source, the projection blueprint is destroyed to cancel the display of the projection decal.

8. The method according to claim 7, characterized in that, Determining the projection position and projection angle of the controlled virtual object in the indoor game scene based on the first position information and the second position information includes: The projection blueprint is bound to the controlled virtual object to determine the projection position and projection angle in real time based on the first position information and the second position information.

9. A projection processing device for virtual objects, characterized in that, Applied to indoor game scenarios, the indoor game scenario includes static virtual objects, the projections of which are calculated and generated in one go through scene baking; including: The location information acquisition module is configured to, in response to a controlled virtual object entering the indoor game scene, acquire first location information of the controlled virtual object in the indoor game scene and second location information of a pseudo light source specified in the indoor game scene; wherein, the pseudo light source refers to a light source in the indoor game scene used to simulate the location of a real light source without producing a lighting effect; The projection position and projection angle determination module is configured to determine the projection position and projection angle of the controlled virtual object in the indoor game scene based on the first position information and the second position information. A projection generation module is configured to display a projection decal in the indoor game scene at the projection position and according to the projection angle to simulate the projection of the controlled virtual object in the indoor game scene; wherein, the projection decal is generated by rendering based on scene information in the indoor game scene and a specified projection material; generating the projection decal of the controlled virtual object includes: obtaining a first depth value of the feature points of the controlled virtual object in the light source coordinate system and a second depth value in the eye coordinate system; the light source coordinate system is a coordinate system constructed with the pseudo light source as the viewpoint; generating the projection decal of the controlled virtual object based on the comparison result of the first depth value and the second depth value.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 8.

11. An electronic device, characterized in that, include: processor; Memory for storing the executable instructions of the processor; The processor is configured to execute the method of any one of claims 1 to 8 by executing the executable instructions.