Virtual object display method, device, apparatus, and storage medium
By acquiring parallel light and additional light data to adjust the brightness of virtual objects and generate projections, the problem of inaccurate brightness and projection in character display was solved, and normal display effects were achieved under different configurations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-28
- Publication Date
- 2026-04-07
AI Technical Summary
Existing technologies do not provide accurate brightness and projection effects for character displays, especially with low-configuration devices where lighting is abnormal, affecting the display quality.
By acquiring parallel light data perpendicular to the virtual object and additional light data at a preset angle, the brightness is adjusted and the projection is generated, ensuring normal display under both high and low configurations.
Under various performance configurations, the accuracy of lighting and projection effects of virtual objects has been improved, ensuring that characters can be displayed normally under both high and low configurations.
Smart Images

Figure CN116531749B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of computer graphics rendering, and in particular to a virtual object display method, device, equipment and storage medium. BACKGROUND
[0002] There is usually a character equipment interface or a shopping mall dress interface in the game to show the character dress effect. In order to make the character more stereoscopic, the character is added with projection and lighting, and the projection of the character to the ground will make the player feel that the character is stepping on the ground. The existing technology in unity includes the following two schemes to add projection and lighting to the character: the first is to generate projection of the character by parallel light, and to illuminate the character by additional light such as point light. The second is to generate projection and illuminate the character by parallel light at the same time. However, since the two schemes use parallel light to generate projection, the first scheme will consider illuminating the character, which will make the angle setting of the parallel light unreasonable, resulting in poor projection effect, and the second scheme needs additional light to illuminate the character, which will result in abnormal lighting when the additional light is turned off in low configuration mode. SUMMARY
[0003] The main purpose of the present application is to solve the technical problem that the existing character display method is not accurate enough in the display effect of character brightness and character projection.
[0004] The first aspect of the present application provides a virtual object display method, comprising: obtaining light source information acting on a virtual object, the light source information comprising parallel light data generated by a parallel light source perpendicular to the virtual object and parallel to the ground, and additional light data generated by an additional light source at a preset angle to the virtual object; adjusting the brightness of the virtual object by using the parallel light data and the additional light data, and generating a projection of the virtual object by using the additional light data, and displaying the virtual object after brightness adjustment and the projection.
[0005] The second aspect of the present application provides a virtual object display device, comprising: an acquisition module for obtaining light source information acting on a virtual object, the light source information comprising parallel light data generated by a parallel light source parallel to the virtual object, and additional light data generated by a light source at a preset angle to the virtual object; an adjustment and display module for adjusting the brightness of the virtual object by using the parallel light data and the additional light data, and generating a projection of the virtual object by using the additional light data, and displaying the virtual object after brightness adjustment and the projection.
[0006] The third aspect of the present application provides a virtual object display device, comprising: a memory and at least one processor, the memory storing instructions; the at least one processor invoking the instructions in the memory to enable the virtual object display device to perform the virtual object display method described above.
[0007] The fourth aspect of the present application provides a computer readable storage medium, the computer readable storage medium storing instructions, when the instructions are run on a computer, enabling the computer to perform the virtual object display method described above.
[0008] In the technical solution provided by the present application, the parallel light illuminating the virtual object can form a better illumination effect because it is parallel to the virtual object, and will not produce a projection because it is perpendicular to the ground. The projection generated by the additional light is not affected by the parallel light and can be generated correctly by adjusting the appropriate angle. The projection and the illuminated character are both normal in the high configuration mode with the parallel light and the additional light turned on, and the character can be correctly illuminated in the low configuration mode with the additional light turned off. BRIEF DESCRIPTION OF DRAWINGS
[0009] Figure 1 An embodiment of the virtual object display method in the embodiments of the present application is shown;
[0010] Figure 2 An embodiment of the virtual object light source irradiation effect in the embodiments of the present application is shown;
[0011] Figure 3 Another embodiment of the virtual object display method in the embodiments of the present application is shown;
[0012] Figure 4 An embodiment of the virtual object display device in the embodiments of the present application is shown;
[0013] Figure 5 Another embodiment of the virtual object display device in the embodiments of the present application is shown;
[0014] Figure 6 An embodiment of the virtual object display device in the embodiments of the present application is shown. DETAILED DESCRIPTION
[0015] The embodiment of the present application provides a virtual object display method, device, equipment and storage medium, light source information acting on a virtual object is acquired, the light source information includes parallel light data generated by a parallel light source which is perpendicular to the virtual object and parallel to the ground, and additional light data generated by an additional light source which is at a preset angle with the virtual object; the virtual object is adjusted in brightness by using the parallel light data and the additional light data, and a projection of the virtual object is generated by using the additional light data, and the virtual object after brightness adjustment and the projection are displayed. The present application improves the accuracy of the lighting effect and the projection effect of the virtual object in various performance configurations.
[0016] The terms "first", "second", "third", "fourth" and the like in the description, claims, and drawings of the present application, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the use of the terms so termed is interchangeable under appropriate circumstances such that the embodiments of the description are, for example, capable of proper
[0017] For the convenience of understanding, the specific flow of the embodiment of the present application is described below, please refer to Figure 1 One embodiment of the virtual object display method in the embodiment of the present application includes:
[0018] 101, acquiring light source information acting on a virtual object, the light source information includes parallel light data generated by a parallel light source which is perpendicular to the virtual object and parallel to the ground, and additional light data generated by an additional light source which is at a preset angle with the virtual object;
[0019] It can be understood that the execution subject of the present application can be a virtual object display device, and can also be a terminal or a server, and the specific place is not limited. The terminal device is taken as the execution subject for example in the embodiment of the present application.
[0020] In the embodiment, the main light source generating the parallel light data is taken as the parallel light source, and the additional light source generating the additional light data is taken as the auxiliary light source. Since the frame rate will be reduced on the low configuration mobile phone, the display mode of high configuration and low configuration is provided. The parallel light source and the additional light source will be started at the same time in the display mode of high configuration, and only the parallel light source will be started in the display mode of low configuration. It should be noted that since tools such as Unity urp only support one parallel light source, the additional light source here is a non-parallel light source, such as a probe light source.
[0021] Specifically, as shown in Figure 2 The parallel light data acting on the virtual object will not hit the ground because the parallel light source is parallel to the ground and perpendicular to the virtual object, and will only be used to illuminate the virtual object, without generating a projection. In addition, the virtual object will not be improperly illuminated due to the lack of additional light data in the low configuration mode. The additional light data acting on the virtual object will not affect the projection of the virtual object because the additional light source is at a preset angle, such as 60° above the virtual object. A better preset angle will allow the virtual object to maintain a normal projection, and the projection of the virtual object will not be elongated due to the illumination of the parallel light in the high configuration mode.
[0022] 102. Adjust the brightness of the virtual object using the parallel light data and the additional light data, and generate a projection of the virtual object using the additional light data, and display the brightness-adjusted virtual object and the projection.
[0023] In this embodiment, when calculating the projection of the virtual object on the ground, only the parallel light data generated by the additional light source acting on the virtual object at a preset angle will be used to generate a pre-projection. Because the parallel light source is parallel to the ground, it will not generate a projection on the ground, so it is not necessary to use parallel light data to calculate the projection. Here, the angle of the parallel light data is set to distinguish the parallel light data from the additional light data used to generate the projection, in order to ensure that the projection is only related to the parallel light data and the projection information is only related to the additional light data, and the generated projection will not be elongated when the display mode of the terminal device is switched between high and low configurations.
[0024] In this embodiment, the parallel light data is used to illuminate the virtual object, and the virtual object can be properly illuminated in the presence or absence of additional light data, i.e., the brightness of the virtual object can be properly displayed when the display mode of the terminal device is switched between high and low configurations.
[0025] In this embodiment, lighting maps can be generated by the parallel light data and the additional light data, and rendered onto a two-dimensional or three-dimensional model of the virtual object, to adjust the brightness of the virtual object and make the virtual object appear to be illuminated. Then, a projection mask is generated by the additional light data, and rendered at the projection position of the virtual object. The projection mask is rendered into the game scene, such as on the ground directly below the virtual object or on the ground at a preset distance from the virtual object, mainly depending on the size of the preset angle of the additional light source. The projection position is set according to the intersection position of the connecting straight line between the light source at the preset angle and the virtual object and the ground. After the lighting map and the projection mask are rendered, they can be displayed on the interface of the mobile terminal, including the virtual object and the projection on the ground.
[0026] In the embodiment of the present application, the parallel light illuminating the virtual object can form a better illumination effect because it is parallel to the virtual object, and will not produce a projection because it is perpendicular to the ground. The projection is generated by adjusting the appropriate angle and is not affected by the parallel light, so the correct projection can be generated. The high configuration mode simultaneously turns on the parallel light and the additional light, so that the projection and the illuminated character are normal, and the low configuration mode turns off the additional light to correctly illuminate the character.
[0027] Referring to Figure 3 Another embodiment of the virtual object display method in the embodiment of the present application includes:
[0028] 201. Detecting a display performance mode set for the virtual object;
[0029] 202. When it is detected that the display performance mode set for the virtual object is a high configuration mode, controlling the parallel light source to emit light and controlling the additional light source to emit light and acting on the virtual object;
[0030] 203. When it is detected that the display performance mode set for the virtual object is a low configuration mode, controlling the parallel light source to emit light and acting on the virtual object;
[0031] In the embodiment, in the high configuration mode, the additional light source is controlled to emit light to generate the projection of the virtual object, and the parallel light source is controlled to emit light to illuminate the virtual object in combination with the additional light source. In the low configuration mode, only the parallel light source is controlled to emit light to illuminate the virtual object, and no projection is generated, in order to reduce consumption.
[0032] 204. Obtaining light source information acting on the virtual object, the light source information including parallel light data generated by a parallel light source which is perpendicular to the virtual object and parallel to the ground, and additional light data generated by an additional light source which is at a preset angle to the virtual object;
[0033] 205. Adjusting attribute parameters of the projection sheet by using the additional light data, and generating the projection of the virtual object based on the projection sheet with the adjusted attribute parameters;
[0034] In this embodiment, a projection sheet is arranged at the projection position of the virtual object, which is specially used to receive the projection of the virtual object and display it, so as to prevent the parallel light source reflection or other forms of illumination from affecting the projection generation, and the projection sheet is directly superimposed on the background without the need to process the joint problem, and the effect of the virtual object standing in the scene is better simulated (directly forming a projection on the ground is easy to appear a joint in the connection between the ground and the background plate). Meanwhile, a new projection function is written, which is only used to calculate the additional light data and not to calculate the parallel light data, so that the projection generated and displayed on the projection sheet is only related to the additional light data. Through the projection sheet, the isolation of the additional light data and the parallel light data can also be realized.
[0035] Specifically, a new Shader (shader) can be written for the projection sheet in a three-dimensional software such as Unity or UE4, and a semi-transparent blending mode of the new Shader is set to mix the projection of the additional light data on the Shader. According to the additional light data, the property parameters of the projection sheet such as color and transparency are changed, so as to display the projection area of the additional light data on the projection sheet, generate a projection style, and make other areas of the projection sheet transparent to hide the display of other areas.
[0036] In an embodiment, the adjusting the property parameters of the projection sheet according to the additional light data includes that a blending mode of the projection sheet is a semi-transparent blending mode, and an initial property of the projection sheet is set as a transparent property; a preset projection function is used to calculate a projection pixel where the projection sheet is located according to a preset angle corresponding to the additional light data; and color values and transparency of the projection pixel are adjusted according to the additional light data.
[0037] In an embodiment, the adjusting the color values and the transparency of the projection pixel according to the additional light data includes that whether an illumination amount of light acting on the virtual object at a preset angle is greater than a preset number is judged according to the additional light data; if the illumination amount is greater than the preset number, first color values and first transparency of the projection pixel are calculated according to the additional light data; and if the illumination amount is not greater than the preset number, the projection pixel is adjusted to preset second color values and preset second transparency.
[0038] In this embodiment, taking Unity as an example, the Shader RenderType of the Shader written for the projection sheet can be directly set to Transparent, that is, the rendering mode of the Shader is set to full transparent Shader: Tags {"RenderType" = "Transparent" "Queue" = "Transparent" "RenderPipeline" = "LightweightPipeline" "IgnoreProjector" = "True"}. Then by setting the Shader to BlendSrcAlpha OneMinusSrcAlpha, that is, the traditional semi-transparent mixing mode, it can be used to mix the light source data of the high configuration mode.
[0039] Specifically, by writing a new projection function PixelAdditionalShadow, the parallel light data is not calculated in the projection function. When checking whether the light amount of the additional light data is greater than a preset number, such as 0, it is judged whether the light amount is greater than 0, and if it is not greater than 0, 0 is directly returned: UNITY_BRANCH; if(_AdditionalLightsCount.x<=0); return 0; at this time, the corresponding second color value can be preset as any value or without changing the color value of the projection sheet, and then the corresponding second transparency is preset as 100%, that is, the projection sheet is hidden, so that the virtual object has no projection.
[0040] Specifically, all additional light data is traversed to determine the projection pixel where the light source data is located in the projection sheet, and then the projection of the additional light data is superimposed, which can be controlled by adding the parameter_BaseColor to control the color and transparency of the projection pixel: Light light=(Light)0; ForEachAdditionalLight(light); {shadow+=light.shadowAttenuation;}; return shadow*_BaseColor.
[0041] In one embodiment, if the initial attribute of the projection sheet is set to a non-transparent attribute, after adjusting the color value and transparency on the projection pixel according to the additional light data, it further includes: obtaining other non-projection pixels in the projection sheet except the projection pixel, and adjusting the non-projection pixel from a non-transparent attribute to a transparent attribute to hide the area where the non-projection pixel is located.
[0042] As mentioned above, if the slide's blending mode is semi-transparent and its property is transparent, the non-projection pixels in the slide will not display a projection. In this case, the slide's property parameter is transparent (transparency = 1), and the slide is already hidden and invisible; therefore, no operation is required. If the initial setting of the slide's property parameter is non-transparent, the transparency of the non-projection pixels is less than 1, and they are visible by default on the terminal device's interface. In this case, the property parameter of the non-projection pixels needs to be adjusted from non-transparent to transparent, i.e., the transparency of the non-projection pixels is adjusted to 1, thus hiding the non-projection pixels.
[0043] 206. Using the parallel light data and the additional light data, calculate the lighting information on the surface of the virtual object and determine the shadow occlusion relationship in each region of the surface of the virtual object;
[0044] 207. Based on the lighting information and the shadow occlusion relationship, adjust the brightness on the surface of the virtual object, generate the projection of the virtual object using the additional light data, and display the virtual object with adjusted brightness and the projection.
[0045] In this embodiment, the virtual object is illuminated in both the high and low configuration display modes of the terminal device to make its display more natural, realistic, and clear. This means the light source information includes at least parallel light data. Here, the illumination information of the virtual object is calculated based on the parallel light data to adjust the brightness of the virtual object's surface. The virtual object's display is more natural and realistic under parallel lighting; therefore, adjusting the parallel light illumination of the virtual object is preferred.
[0046] Specifically, parallel light projection can be enabled using parallel light data. When viewing the character in the character interface with parallel light at eye level, the parallel light projection will not be projected onto the ground, but only onto the virtual object. This provides shadow occlusion relationships between each part of the virtual object; for example, the face is occluded by hair, and limbs are occluded by clothing, creating shadows in the occluded areas. In this way, even in the low-spec mode of the terminal device, when additional light data is turned off, the virtual object can still receive uniform lighting.
[0047] The virtual object display method in the embodiments of the present invention has been described above. The virtual object display device in the embodiments of the present invention will be described below. Please refer to [link / reference]. Figure 4 One embodiment of the virtual object display device in this invention includes:
[0048] The acquisition module 301 is used to acquire light source information acting on the virtual object. The light source information includes parallel light data generated by a light source parallel to the virtual object and additional light data generated by a light source at a preset angle to the virtual object.
[0049] The adjusting and displaying module 302 is configured to adjust the brightness of the virtual object by using the parallel light data and the additional light data, generate a projection of the virtual object by using the additional light data, and display the virtual object after brightness adjustment and the projection.
[0050] In the embodiment of the present application, the parallel light illuminating the virtual object can form a better illumination effect because the parallel light is parallel to the virtual object, and the projection is not generated because the parallel light is perpendicular to the ground. The projection is generated by adjusting the appropriate angle and is not affected by the parallel light, so the correct projection can be generated. The parallel light and the additional light are both turned on in the high configuration mode, so that the projection and the illuminated character are both normal. The additional light is turned off in the low configuration mode, so that the character can be correctly illuminated.
[0051] Please refer to Figure 5 Another embodiment of the virtual object display device in the embodiment of the present application includes:
[0052] The obtaining module 301 is configured to obtain light source information acting on the virtual object, the light source information including parallel light data generated by a light source parallel to the virtual object and additional light data generated by a light source at a preset angle to the virtual object;
[0053] The adjusting and displaying module 302 is configured to adjust the brightness of the virtual object by using the parallel light data and the additional light data, generate a projection of the virtual object by using the additional light data, and display the virtual object after brightness adjustment and the projection.
[0054] Specifically, a projection sheet is arranged at the projection position of the virtual object; the adjusting and displaying module 302 includes a projection sheet adjusting unit 3021 configured to:
[0055] Adjust the attribute parameters of the projection sheet by using the additional light data, and generate the projection of the virtual object based on the projection sheet after adjusting the attribute parameters.
[0056] Specifically, the mixing mode of the projection sheet is a semi-transparent mixing mode, and the initial attribute of the projection sheet is set as a transparent attribute; the projection sheet adjusting unit 3021 is further configured to:
[0057] According to the preset angle corresponding to the additional light data, the projection function is used to calculate the projection pixel of the projection sheet.
[0058] According to the additional light data, the color value and the transparency of the projection pixel are adjusted.
[0059] Specifically, the projection sheet adjusting unit 3021 is further configured to:
[0060] Based on the additional light data, determine whether the amount of light acting on the virtual object at a preset angle is greater than a preset quantity;
[0061] If the amount of light is greater than a preset amount, then the first color value and the first transparency on the projected pixel are calculated based on the additional light data;
[0062] If the amount of light is not greater than a preset number, the projected pixels are adjusted to a preset second color value and a preset second transparency.
[0063] Specifically, if the initial property of the projection sheet is set to non-transparent, the adjustment display module 302 further includes a hiding unit 3022, used for:
[0064] Obtain the non-projected pixels in the projection sheet other than the projected pixels, and adjust the non-projected pixels from non-transparent to transparent to hide the area where the non-projected pixels are located.
[0065] Specifically, the display adjustment module 302 further includes a brightness adjustment unit 3023, used for:
[0066] Using the parallel light data and the additional light data, the illumination information on the surface of the virtual object is calculated, and the shadow occlusion relationship in each region of the virtual object surface is determined;
[0067] Based on the lighting information and the shadow occlusion relationship, the brightness on the surface of the virtual object is adjusted.
[0068] Specifically, the virtual object display device further includes a light source control module 303, used for:
[0069] Detect the display performance mode set for the virtual object;
[0070] When it is detected that the display performance mode set for the virtual object is high-configuration mode, the parallel light source is controlled to emit light, and the additional light source is controlled to emit light, which is then applied to the virtual object.
[0071] When it is detected that the display performance mode set for the virtual object is low-configuration mode, the parallel light source is controlled to emit light and act on the virtual object.
[0072] above Figure 4 and Figure 5 The virtual object display device in the embodiments of the present invention will be described in detail from the perspective of modular functional entities. The virtual object display device in the embodiments of the present invention will be described in detail from the perspective of hardware processing.
[0073] Figure 6This is a schematic diagram of the structure of a virtual object display device 500 provided in an embodiment of the present invention. The virtual object display device 500 can vary significantly due to different configurations or performance characteristics. It may include one or more central processing units (CPUs) 510 (e.g., one or more processors) and a memory 520, and one or more storage media 530 (e.g., one or more mass storage devices) for storing application programs 533 or data 532. The memory 520 and storage media 530 can be temporary or persistent storage. The program stored in the storage media 530 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the virtual object display device 500. Furthermore, the processor 510 may be configured to communicate with the storage media 530 and execute the series of instruction operations in the storage media 530 on the virtual object display device 500.
[0074] The virtual object display device 500 may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input / output interfaces 560, and / or one or more operating systems 531, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 6 The virtual object display device structure shown does not constitute a limitation on the virtual object display device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0075] The present invention also provides a virtual object display device, wherein the computer device includes a memory and a processor, the memory storing computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor performs the steps of the virtual object display method described below:
[0076] Acquire light source information acting on a virtual object, the light source information including parallel light data generated by a parallel light source that is perpendicular to the virtual object and parallel to the ground, and additional light data generated by an additional light source that is at a preset angle to the virtual object;
[0077] The brightness of the virtual object is adjusted using the parallel light data and the additional light data, and a projection of the virtual object is generated using the additional light data. The adjusted virtual object and the projection are then displayed.
[0078] Optionally, generating the projection of the virtual object using the additional light data includes:
[0079] A slide is provided at the projection position of the virtual object;
[0080] The additional light data is used to adjust the attribute parameters of the projection sheet, and the projection of the virtual object is generated based on the adjusted attribute parameters of the projection sheet.
[0081] Optionally, adjusting the property parameters of the projection sheet using the additional light data includes:
[0082] The projection sheet has a semi-transparent blending mode, and its initial property is set to transparent.
[0083] Based on the preset angle corresponding to the additional light data, the projection pixel of the additional light data on the projection sheet is calculated using a preset projection function;
[0084] Based on the additional light data, adjust the color values and transparency of the projected pixels.
[0085] Optionally, adjusting the color value and transparency on the projected pixel based on the additional light data includes:
[0086] Based on the additional light data, determine whether the amount of light acting on the virtual object at a preset angle is greater than a preset quantity;
[0087] If the amount of light is greater than a preset amount, then the first color value and the first transparency on the projected pixel are calculated based on the additional light data;
[0088] If the amount of light is not greater than a preset number, the projected pixels are adjusted to a preset second color value and a preset second transparency.
[0089] Optionally, if the initial properties of the projection sheet are set to non-transparent, then after adjusting the color values and transparency of the projection pixels according to the additional light data, the method further includes:
[0090] Obtain the non-projected pixels in the projection sheet other than the projected pixels, and adjust the non-projected pixels from non-transparent to transparent to hide the area where the non-projected pixels are located.
[0091] Optionally, adjusting the brightness of the virtual object using the parallel light data and the additional light data includes:
[0092] Using the parallel light data and the additional light data, the illumination information on the surface of the virtual object is calculated, and the shadow occlusion relationship in each region of the virtual object surface is determined;
[0093] Based on the lighting information and the shadow occlusion relationship, the brightness on the surface of the virtual object is adjusted.
[0094] Optionally, before obtaining the light source information acting on the virtual object, the method further includes:
[0095] Detect the display performance mode set for the virtual object;
[0096] When it is detected that the display performance mode set for the virtual object is high-configuration mode, the parallel light source is controlled to emit light, and the additional light source is controlled to emit light, which is then applied to the virtual object.
[0097] When it is detected that the display performance mode set for the virtual object is low-configuration mode, the parallel light source is controlled to emit light and act on the virtual object.
[0098] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the steps of the virtual object display method described below:
[0099] Acquire light source information acting on a virtual object, the light source information including parallel light data generated by a parallel light source that is perpendicular to the virtual object and parallel to the ground, and additional light data generated by an additional light source that is at a preset angle to the virtual object;
[0100] The brightness of the virtual object is adjusted using the parallel light data and the additional light data, and a projection of the virtual object is generated using the additional light data. The adjusted virtual object and the projection are then displayed.
[0101] Optionally, generating the projection of the virtual object using the additional light data includes:
[0102] A slide is provided at the projection position of the virtual object;
[0103] The additional light data is used to adjust the attribute parameters of the projection sheet, and the projection of the virtual object is generated based on the adjusted attribute parameters of the projection sheet.
[0104] Optionally, adjusting the property parameters of the projection sheet using the additional light data includes:
[0105] The projection sheet has a semi-transparent blending mode, and its initial property is set to transparent.
[0106] Based on the preset angle corresponding to the additional light data, the projection pixel of the additional light data on the projection sheet is calculated using a preset projection function;
[0107] Based on the additional light data, adjust the color values and transparency of the projected pixels.
[0108] Optionally, adjusting the color value and transparency on the projected pixel based on the additional light data includes:
[0109] Based on the additional light data, determine whether the amount of light acting on the virtual object at a preset angle is greater than a preset quantity;
[0110] If the amount of light is greater than a preset amount, then the first color value and the first transparency on the projected pixel are calculated based on the additional light data;
[0111] If the amount of light is not greater than a preset number, the projected pixels are adjusted to a preset second color value and a preset second transparency.
[0112] Optionally, if the initial properties of the projection sheet are set to non-transparent, then after adjusting the color values and transparency of the projection pixels according to the additional light data, the method further includes:
[0113] Obtain the non-projected pixels in the projection sheet other than the projected pixels, and adjust the non-projected pixels from non-transparent to transparent to hide the area where the non-projected pixels are located.
[0114] Optionally, adjusting the brightness of the virtual object using the parallel light data and the additional light data includes:
[0115] Using the parallel light data and the additional light data, the illumination information on the surface of the virtual object is calculated, and the shadow occlusion relationship in each region of the virtual object surface is determined;
[0116] Based on the lighting information and the shadow occlusion relationship, the brightness on the surface of the virtual object is adjusted.
[0117] Optionally, before obtaining the light source information acting on the virtual object, the method further includes:
[0118] Detect the display performance mode set for the virtual object;
[0119] When it is detected that the display performance mode set for the virtual object is high-configuration mode, the parallel light source is controlled to emit light, and the additional light source is controlled to emit light, which is then applied to the virtual object.
[0120] When it is detected that the display performance mode set for the virtual object is low-configuration mode, the parallel light source is controlled to emit light and act on the virtual object.
[0121] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0122] If the integrated unit is implemented as 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 invention, in essence, 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. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0123] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for displaying virtual objects, characterized in that, The virtual object display method includes: Acquire light source information acting on a virtual object, the light source information including parallel light data generated by a parallel light source that is perpendicular to the virtual object and parallel to the ground, and additional light data generated by an additional light source that is at a preset angle to the virtual object; The brightness of the virtual object is adjusted using the parallel light data and the additional light data, and a projection of the virtual object is generated using the additional light data. The adjusted virtual object and the projection are then displayed. The step of generating the projection of the virtual object using the additional light data includes: A slide is provided at the projection position of the virtual object; The additional light data is used to adjust the attribute parameters of the projection sheet, and the projection of the virtual object is generated based on the adjusted attribute parameters of the projection sheet; The adjustment of the projection sheet's property parameters using the additional light data includes: The projection sheet has a semi-transparent blending mode, and its initial property is set to transparent. Based on the preset angle corresponding to the additional light data, the projection pixel of the additional light data on the projection sheet is calculated using a preset projection function; Based on the additional light data, adjust the color values and transparency of the projected pixels.
2. The virtual object display method according to claim 1, characterized in that, The step of adjusting the color value and transparency on the projected pixel based on the additional light data includes: Based on the additional light data, determine whether the amount of light acting on the virtual object at a preset angle is greater than a preset quantity; If the amount of light is greater than a preset amount, then the first color value and the first transparency on the projected pixel are calculated based on the additional light data; If the amount of light is not greater than a preset number, the projected pixels are adjusted to a preset second color value and a preset second transparency.
3. The virtual object display method according to claim 1 or 2, characterized in that, If the initial properties of the projection sheet are set to non-transparent, then after adjusting the color values and transparency of the projection pixels according to the additional light data, the method further includes: Obtain the non-projected pixels in the projection sheet other than the projected pixels, and adjust the non-projected pixels from non-transparent to transparent to hide the area where the non-projected pixels are located.
4. The virtual object display method according to any one of claims 1-2, characterized in that, The step of adjusting the brightness of the virtual object using the parallel light data and the additional light data includes: Using the parallel light data and the additional light data, the illumination information on the surface of the virtual object is calculated, and the shadow occlusion relationship in each region of the virtual object surface is determined; Based on the lighting information and the shadow occlusion relationship, the brightness on the surface of the virtual object is adjusted.
5. The virtual object display method according to any one of claims 1-2, characterized in that, Before acquiring the light source information acting on the virtual object, the method further includes: Detect the display performance mode set for the virtual object; When it is detected that the display performance mode set for the virtual object is high-configuration mode, the parallel light source is controlled to emit light, and the additional light source is controlled to emit light, which is then applied to the virtual object. When it is detected that the display performance mode set for the virtual object is low-configuration mode, the parallel light source is controlled to emit light and act on the virtual object.
6. A virtual object display device, characterized in that, The virtual object display device includes: The acquisition module is used to acquire light source information acting on the virtual object. The light source information includes parallel light data generated by a light source parallel to the virtual object and additional light data generated by a light source at a preset angle to the virtual object. The adjustment display module is used to adjust the brightness of the virtual object using the parallel light data and the additional light data, and to generate a projection of the virtual object using the additional light data, and to display the virtual object with adjusted brightness and the projection. A slide is positioned at the projection location of the virtual object; the display adjustment module includes a slide adjustment unit for: The additional light data is used to adjust the attribute parameters of the projection sheet, and the projection of the virtual object is generated based on the adjusted attribute parameters of the projection sheet; The projection sheet has a semi-transparent blending mode, and its initial property is set to transparent. The projection sheet adjustment unit is further configured to: Based on the preset angle corresponding to the additional light data, the projection pixel of the additional light data on the projection sheet is calculated using a preset projection function; Based on the additional light data, adjust the color values and transparency of the projected pixels.
7. A virtual object display device, characterized in that, The virtual object display device includes: a memory and at least one processor, wherein the memory stores instructions; The at least one processor invokes the instructions in the memory to cause the virtual object display device to perform the steps of the virtual object display method as described in any one of claims 1-5.
8. A computer-readable storage medium storing instructions thereon, characterized in that, When the instructions are executed by the processor, they implement the steps of the virtual object display method as described in any one of claims 1-5.
Citation Information
Patent Citations
3D rendering method and apparatus
US20170193690A1