WO2023116396A1 - 一种渲染显示方法、装置、计算机设备及存储介质 - Google Patents

一种渲染显示方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2023116396A1
WO2023116396A1 PCT/CN2022/136375 CN2022136375W WO2023116396A1 WO 2023116396 A1 WO2023116396 A1 WO 2023116396A1 CN 2022136375 W CN2022136375 W CN 2022136375W WO 2023116396 A1 WO2023116396 A1 WO 2023116396A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual
scene
light
light source
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2022/136375
Other languages
English (en)
French (fr)
Inventor
王骁玮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Publication of WO2023116396A1 publication Critical patent/WO2023116396A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/00Three-dimensional [3D] image rendering
    • G06T15/50Lighting effects
    • G06T15/506Illumination models
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three-dimensional [3D] modelling for computer graphics
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating three-dimensional [3D] models or images for computer graphics
    • G06T19/006Mixed reality

Definitions

  • the present disclosure relates to the technical field of computer technology, in particular, to a rendering and display method, device, computer equipment, storage medium, computer program product and computer program.
  • real people can control virtual characters to perform relevant actions, and present the behaviors of virtual characters in real time on live broadcast screens or other display screens.
  • virtual character there may be many other scene objects in the picture, such as some virtual props in the scene.
  • Embodiments of the present disclosure at least provide a rendering display method, device, computer equipment, storage medium, computer program product, and computer program.
  • an embodiment of the present disclosure provides a rendering and display method for displaying virtual scene information; a virtual light source and a plurality of virtual objects are included in the virtual scene corresponding to the virtual scene information; the method includes: acquiring real A scene image of the scene, and constructing the virtual scene based on the scene image; based on the first illumination parameter information of the virtual light source in the virtual scene, and the poses of each of the virtual objects in the virtual scene information to determine illumination influence information between different virtual objects; the illumination influence information includes: under the first illumination parameter information, for at least one virtual object, other virtual objects affect the light receiving parameter of the at least one virtual object Influence information; based on the illumination influence information, determine the display effect of each of the virtual objects in the virtual scene under the virtual light source; render each of the virtual objects based on the determined display effect to display The virtual scene information.
  • rendering each of the virtual objects based on the determined display effect to display the virtual scene information includes: rendering each of the virtual objects based on the determined display effect Rendering is performed, and each of the rendered virtual objects is superimposed on the scene image of the real scene for augmented reality AR display.
  • rendering each of the virtual objects based on the determined display effect to display the virtual scene information includes: rendering the virtual scene in the virtual scene based on the determined display effect Perform real-time rendering of each of the virtual objects to obtain a real-time rendered virtual scene image; replace the currently acquired scene image of the real scene with the real-time rendered virtual scene image to perform real-time display of the virtual reality VR scene.
  • the first illumination parameter information of the virtual light source in the virtual scene includes at least one of the following: a setting height and a setting angle of the virtual light source in the virtual scene, Light source radiation range, light source color, light source intensity.
  • the first illumination parameter information of the virtual light source in the virtual scene is determined according to the following steps: based on the scene image, determine the corresponding value of the real light source in the real scene second irradiation parameter information; determining the first irradiation parameter information based on the second irradiation parameter information.
  • the first illumination parameter information of the virtual light source in the virtual scene is determined according to the following steps: according to the attribute characteristics of each of the virtual objects contained in the virtual scene, determine The first illumination parameter information of the virtual light source in the virtual scene.
  • the light receiving parameter includes the light receiving range of the virtual object, and at least one of the light receiving intensity and light receiving color within the light receiving range;
  • the lighting influence information between the first virtual object and the second virtual object is determined according to the following steps: based on the first virtual object being in the The first pose information in the virtual scene, and the second pose information of the second virtual object in the virtual scene, determine the first pose information between the first virtual object and the second virtual object Relative pose relationship: based on the first relative pose relationship and the illumination parameter information of the virtual light source, determine the first light-receiving range and the first light-receiving range where the second virtual object affects the first virtual object Influence intensity, and a second light-affected range and second light-affected intensity in which the first virtual object affects the second virtual object; objects within the second light-affected range based on the second virtual object Part of the first color information, the first light-affected intensity, and the first illumination parameter information of the virtual
  • the first virtual object is a virtual character
  • the second virtual object is a virtual item
  • the first virtual object is a virtual item
  • the second virtual object is a virtual character
  • both the first virtual object and the second virtual object are virtual characters
  • both the first virtual object and the second virtual object are virtual items.
  • the light-receiving parameters include the light-receiving range of the virtual object, and at least one of the light-receiving intensity and initial light-receiving color within the light-receiving range;
  • the first illumination parameter information in the virtual scene and the pose information of each virtual object in the virtual scene, before determining the illumination influence information between different virtual objects further includes: based on the first illumination parameter information , and the pose information corresponding to each of the virtual objects, determining a second relative pose relationship between the virtual light source and each of the virtual objects; based on the relationship between the virtual light source and each of the virtual objects
  • the second relative pose relationship is to determine the light-receiving range of each virtual object and the initial light-receiving intensity within the light-receiving range when the virtual light source irradiates each virtual object;
  • the initial light-receiving intensity is The received light intensity without being affected by other virtual objects; based on the received light intensity and the illumination parameter information, determine the initial light received color of each virtual object within
  • the determining the display effect of each of the virtual objects in the virtual scene under the virtual light source based on the illumination influence information includes: based on the illumination influence information, and For the scene special effect data generated in the virtual scene, the display effect of each of the virtual objects in the virtual scene under the virtual light source is determined.
  • the scene special effect data includes at least one of the following: rain and snow special effect data, icing special effect data, wind field special effect data, fog special effect data, falling leaf special effect data, and follow spot light special effect data.
  • the constructing the virtual scene based on the scene image includes: performing three-dimensional space reconstruction on the scene image by using SLAM to obtain the constructed virtual scene.
  • the embodiment of the present disclosure also provides a rendering and display device, including: an acquisition module, configured to acquire a scene image of a real scene, and construct the virtual scene based on the scene image, and the virtual scene includes a virtual A light source and multiple virtual objects; a first determination module, configured to determine based on the first illumination parameter information of the virtual light source in the virtual scene and the pose information of each of the virtual objects in the virtual scene Illumination influence information between different virtual objects; the illumination influence information includes: under the first illumination parameter information, for at least one virtual object, the influence of other virtual objects on the light receiving parameter of the at least one virtual object information; a second determination module, configured to determine the display effect of each of the virtual objects in the virtual scene under the virtual light source based on the illumination influence information; a display module, configured to determine the display effect based on the determined display effect Each of the virtual objects is rendered to display the information of the virtual scene.
  • an acquisition module configured to acquire a scene image of a real scene, and construct the virtual scene based on the scene image
  • the display module when the display module renders each of the virtual objects based on the determined display effect to display the virtual scene information, it is configured to: Each of the virtual objects is rendered, and the rendered virtual objects are superimposed on the scene image of the real scene for augmented reality AR display.
  • the display module when the display module renders each of the virtual objects based on the determined display effect to display the virtual scene information, it is configured to: Each of the virtual objects in the virtual scene is rendered in real time to obtain a virtual scene image after real-time rendering; the scene image of the real scene currently acquired is replaced by the virtual scene image after real-time rendering to perform a virtual reality VR scene real-time display of .
  • the first illumination parameter information of the virtual light source in the virtual scene includes at least one of the following: a setting height and a setting angle of the virtual light source in the virtual scene, Light source radiation range, light source color, light source intensity.
  • the first illumination parameter information of the virtual light source in the virtual scene is determined according to the following steps: based on the scene image, determine the corresponding value of the real light source in the real scene second irradiation parameter information; determining the first irradiation parameter information based on the second irradiation parameter information.
  • the first illumination parameter information of the virtual light source in the virtual scene is determined according to the following steps: according to the attribute characteristics of each of the virtual objects contained in the virtual scene, determine The first illumination parameter information of the virtual light source in the virtual scene.
  • the light receiving parameter includes the light receiving range of the virtual object, and at least one of the light receiving intensity and light receiving color within the light receiving range;
  • the first virtual object and the second virtual object that generate lighting influence on each other, the first determination module determines the lighting influence information between the first virtual object and the second virtual object according to the following steps: based on the The first pose information of the first virtual object in the virtual scene and the second pose information of the second virtual object in the virtual scene determine the relationship between the first virtual object and the second virtual A first relative pose relationship between objects; based on the first relative pose relationship and the illumination parameter information of the virtual light source, determine the first light received by the second virtual object that affects the first virtual object The range of influence and the first intensity affected by light, and the second range affected by light and the second intensity affected by light that the first virtual object affects the second virtual object; based on the second virtual object being in the second The first color information of the object part within the light-affected range, the first light-affected intensity, and the first illumination parameter information of the virtual light source, determine
  • the first virtual object is a virtual character
  • the second virtual object is a virtual item
  • the first virtual object is a virtual item
  • the second virtual object is a virtual character
  • both the first virtual object and the second virtual object are virtual characters
  • both the first virtual object and the second virtual object are virtual items.
  • the light-receiving parameters include the light-receiving range of the virtual object, and at least one of the light-receiving intensity and initial light-receiving color within the light-receiving range;
  • the initial light receiving intensity is the receiving light intensity without being affected by other virtual objects; based on the light receiving intensity and the first illumination parameter information, determine the light receiving intensity of each virtual object within the
  • the second determination module determines the display effect of each of the virtual objects in the virtual scene under the virtual light source based on the illumination influence information, it is configured to: The lighting influence information and the scene special effect data generated for the virtual scene determine the display effect of each of the virtual objects in the virtual scene under the virtual light source.
  • the scene special effect data includes at least one of the following: rain and snow special effect data, icing special effect data, wind field special effect data, fog special effect data, falling leaf special effect data, and follow spot light special effect data.
  • the acquisition module constructs the virtual scene based on the scene image, it is configured to: perform three-dimensional space reconstruction on the scene image by using synchronous localization and mapping SLAM to obtain the constructed virtual scene. Describe the virtual scene.
  • an optional implementation manner of the present disclosure further provides a computer device, a processor, and a memory, the memory stores machine-readable instructions executable by the processor, and the processor is used to execute the instructions stored in the memory. machine-readable instructions, when the machine-readable instructions are executed by the processor, when the machine-readable instructions are executed by the processor, the above-mentioned first aspect is executed, or any possible implementation of the first aspect steps in the method.
  • an optional implementation manner of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed, the above-mentioned first aspect, or any one of the first aspects in the first aspect, may be executed. Steps in one possible implementation.
  • an optional implementation mode of the present disclosure further provides a computer program product, the computer program product carries a program code, and the instructions included in the program code are executed by a processor to execute the above-mentioned first aspect, or the first aspect Steps in any of the possible implementations.
  • an optional implementation manner of the present disclosure further provides a computer program, which executes the steps in the above first aspect or any possible implementation manner of the first aspect when the computer program is run by a processor.
  • the rendering and display method, device, computer equipment, storage medium, computer program product, and computer program provided by the embodiments of the present disclosure can use the illumination parameter information of the virtual light source and the position of each virtual object in the virtual scene after the virtual scene is constructed. Attitude information, to determine whether there is lighting influence between each virtual object under the illumination of the virtual light source, and determine the lighting influence information between different virtual objects accordingly, so as to determine the display effect of each virtual object under the virtual light source and perform rendering show. In this way, when rendering and displaying virtual objects, the details of mutual lighting effects between virtual objects are supplemented, which is more in line with the display logic in real situations, and can make the rendering and display more realistic.
  • FIG. 1 shows a flow chart of a rendering and display method provided by an embodiment of the present disclosure
  • Fig. 2 shows a schematic diagram of a scene image provided by an embodiment of the present disclosure
  • Fig. 3 shows a specific flow chart of determining illumination influence information between a first virtual object and a second virtual object provided by an embodiment of the present disclosure
  • FIG. 4 shows a schematic diagram of virtual objects that interact with each other in lighting effects provided by an embodiment of the present disclosure
  • Fig. 5 shows a flow chart of determining light receiving parameters under a virtual light source provided by an embodiment of the present disclosure
  • FIG. 6 shows a schematic diagram of displaying virtual scene information by way of AR display provided by an embodiment of the present disclosure
  • FIG. 7 shows a schematic diagram of a rendering display device provided by an embodiment of the present disclosure
  • Fig. 8 shows a schematic diagram of a computer device provided by an embodiment of the present disclosure.
  • the virtual objects are usually displayed in a constructed virtual scene. Specifically, after determining the corresponding display positions of each virtual object in the virtual scene, each virtual object will be rendered and displayed together.
  • each virtual object will be rendered and displayed together.
  • the light source shines on different virtual objects, there will be mutual influence among different virtual objects, especially between virtual objects at close positions. If you ignore the details of the mutual lighting effects between virtual objects in reality, the reality after rendering will be poor.
  • the present disclosure provides a rendering and display method. After constructing a virtual scene, it can be judged that under the illumination of the virtual light source, the Whether each virtual object has lighting influence, and correspondingly determine the lighting influence information between different virtual objects, so as to determine the display effect of each virtual object under the virtual light source and perform rendering and display. In this way, when rendering and displaying virtual objects, the details of mutual lighting effects between virtual objects are supplemented, which is more in line with the display logic in real situations, and can make the rendering and display more realistic.
  • the rendering and display method provided in the embodiments of the present disclosure is generally executed by a computer device with certain computing capabilities.
  • the computer equipment for example, may include but is not limited to a computer that can support AR display Devices, such as mobile devices such as mobile phones and tablets; or AR wearable devices, such as AR glasses.
  • AR display Devices such as mobile devices such as mobile phones and tablets
  • AR wearable devices such as AR glasses.
  • devices for supporting VR display such as a VR all-in-one machine, may also be included.
  • the rendering and display method may be implemented in a manner in which a processor invokes computer-readable instructions stored in a memory.
  • the rendering display method provided by the embodiment of the present disclosure is used for displaying virtual scene information.
  • the virtual scene information is used to express the virtual scene; when the virtual scene information is displayed, the user can watch the virtual scene.
  • the virtual scene can show a virtual space consistent with the visual expression of the real scene.
  • the virtual scene may specifically include a virtual light source and multiple virtual objects.
  • the virtual objects may include, for example, virtual characters and virtual items described below.
  • the virtual light source includes, for example, the light source that produces lighting effects on the virtual object in the virtual scene; in addition, the virtual light source in the virtual scene can include one or more, and the timing of adding the virtual light source in the virtual scene can also be determined according to actual needs. This is not limited.
  • the virtual character may include a character or animation character controlled by a virtual character control object and displayed in a virtual scene;
  • the virtual character control object may be a real person in a real scene.
  • the behavior of the object controlled by the virtual character can be captured by the behavior capture device, and the behavior data of the object controlled by the virtual character can be generated; further, the behavior of the virtual character in the virtual scene can be controlled by using the behavior data.
  • virtual items may include item models corresponding to items that actually exist in the real scene, such as item models corresponding to furniture and accessories placed in the real scene; or other items added in the virtual scene, such as virtual Character pets etc.
  • the rendering and display method provided by the embodiments of the present disclosure can be applied to different application scenarios, such as live broadcast scenarios.
  • the rendering and display method provided by the embodiments of the present disclosure may be implemented through AR technology or VR technology.
  • the rendering display method provided by the embodiments of the present disclosure can be applied to live broadcast scenes or other display scenes through AR technology; the rendering display method provided by the embodiments of the present disclosure can also be applied to live broadcast scenes or other display scenes through VR technology , to display multiple virtual objects affected by virtual light sources in the virtual scene.
  • AR technology or VR technology is used to display virtual scene information, it is expected that the virtual objects therein will have the effect of existing in the real space when displayed, so that the reality of rendering and display can be further improved.
  • FIG. 1 it is a flowchart of a rendering and display method provided by an embodiment of the present disclosure, the method includes steps S101 to S104, wherein:
  • S101 Acquire a scene image of a real scene, and construct the virtual scene based on the scene image;
  • the illumination influence information includes: under the first illumination parameter information, for at least one virtual object, other virtual objects influence information on the light receiving parameter of the at least one virtual object;
  • S103 Based on the illumination influence information, determine the display effect of each of the virtual objects in the virtual scene under the virtual light source;
  • S104 Render each of the virtual objects based on the determined display effect, so as to display the virtual scene information.
  • a virtual scene may be constructed by acquiring scene images of the real scene.
  • an image acquisition device such as a color camera, a depth camera, a binocular camera, etc.
  • an AR device or a VR device may be used to collect images of the real scene to obtain a scene image.
  • FIG. 2 is a schematic diagram of a scene image provided by an embodiment of the present disclosure.
  • a table and a decorative picture on the left wall are shown.
  • the virtual scene constructed can be obtained by reconstructing the scene image in three-dimensional space through Simultaneous Localization and Mapping (SLAM). Specifically, when the virtual scene is constructed according to the scene image, a virtual scene consistent with the real scene can be obtained according to the scene image; After the scene image is created, a virtual scene corresponding to the area can also be constructed in real time based on the new scene image.
  • SLAM Simultaneous Localization and Mapping
  • the virtual light source can be a virtual light source model (or virtual light source object) made based on the illumination parameters of the real light source in the real scene, so that the illumination parameters of the virtual light source model match the real light source.
  • the virtual light source may also be a virtual light source model designed based on the display effect of the virtual scene without considering the real light source.
  • a virtual light source can be added to the virtual scene according to actual needs, so that the virtual object can be displayed in harmony with the scene image
  • the styles tend to be consistent, so that virtual objects can be blended and displayed on the scene image, thereby improving the realism of displaying virtual objects.
  • a virtual light source can be considered as a light source that exists in a virtual scene, but it is not necessarily necessary to display the virtual light source itself in the current display screen. What is displayed in the display screen can be only the virtual objects in the virtual light source. The display effect under illumination. Of course, in some scenes that need to reflect the light source itself, the virtual light source itself can also be rendered and displayed.
  • the first illumination parameter information of the virtual light source in the virtual scene may specifically include at least one of the following: the setting height of the virtual light source in the virtual scene, the setting angle, and the radiation of the light source Range, light source color, light source intensity.
  • the first illumination parameter information may be used to determine the illumination influence of the virtual light source on the virtual object in the virtual scene.
  • the setting height of the virtual light source in the virtual scene is, for example, 3 meters, and the setting angle is, for example, 30 degrees to the northeast direction.
  • the radiation range of the light source for example, represents a circular area of 20 square meters on the ground. White, strong light source intensity.
  • the virtual light source can restore the real light source in the real scene, so that the superimposed virtual object has the same lighting effect as in the real scene.
  • the second illumination parameter information corresponding to the real light source in the real scene may be determined based on the scene image;
  • the second irradiation parameter information is determined to determine the first irradiation parameter information.
  • the scene image can be analyzed, for example, at least one object, such as a table, a glass, etc., can be identified through object recognition, and then displayed in the scene image through these objects
  • the second illumination parameter information of the real light source in the real scene is determined based on light and shadow information such as shadows or reflected light.
  • the determined second illumination parameter information may be directly used as the first illumination parameter information of the virtual light source in the virtual scene.
  • each virtual object in the virtual scene does not actually exist in the real scene. Since the illumination parameter information of the virtual light source is the same as that of the real light source in the real scene, through the influence of the virtual light source on different virtual objects in the same virtual scene, it can be shown that each virtual object is affected by the real light of the real scene. The light and shadow effect shown.
  • the virtual light source may also be set to other light sources different from the real light source according to actual needs, and correspondingly determine the first illumination parameter information corresponding to the virtual light source.
  • the first illumination parameter information of the virtual light source can be set accordingly.
  • the corresponding light source radiation range is larger, the light source intensity is stronger, and the light source color is light yellow.
  • the corresponding light source radiation range is smaller, the light source intensity is weaker, and the light source color is gray.
  • the first illumination parameter information of the virtual light source can also be determined according to other information such as the action change of the virtual character, so as to better match the behavior of the virtual character, which is not limited here. .
  • the first illumination parameter information of the virtual light source in the virtual scene may also be determined according to the attribute characteristics of each virtual object included in the virtual scene.
  • virtual objects include virtual characters and virtual items.
  • the attribute characteristics of the virtual character may include, for example, the clothing characteristics of the virtual character, specifically the color and material of the clothing. For example, if the clothing feature of the virtual character is a sweater in a warmer color, the virtual light source can choose a softer yellow light and increase the light intensity to highlight the cute clothing characteristics of the virtual character. If the character's clothing feature is a dress made of cool-colored silk and satin, the virtual light source can select a more elegant cold light and reduce the light intensity to highlight the more elegant clothing characteristics of the virtual character. In this way, the virtual light source can be selected according to the attribute characteristics of the virtual character, which can be more matched with the virtual character, and the display effect is also better.
  • the attribute characteristics of the virtual item may include, for example, the item type of the virtual item.
  • the type of the scene expressed by the virtual scene can be deduced by using the item type of the virtual item, and then a matching virtual light source can be determined according to the scene type.
  • the item type of the virtual item includes a wine glass, a wine bottle, a bar counter, etc.
  • the virtual scene is a bar.
  • the light source in the bar usually has low illumination intensity, low installation height, small light source radiation range, and light source color is cooler, so the first illumination parameter information in the virtual scene can be determined according to such illumination parameter information. In this way, when the virtual scene is displayed, the light and shadow effect can be coordinated with the scene expressed by the virtual item, which is more realistic.
  • the illumination influence information between different virtual objects under the virtual light source can also be determined according to the pose information of each virtual object in the virtual scene.
  • the illumination influence information includes under the first illumination parameter information, for any virtual object, other virtual objects influence information on the light receiving parameter of the virtual object. That is to say, under the influence of the virtual light source, there will be mutual lighting influence among the virtual objects.
  • the virtual object includes at least one virtual character and at least one virtual item. That is to say, when there is a mutual lighting influence between virtual objects, it may be that two different virtual items have a mutual lighting influence, or two different virtual characters have a mutual lighting influence, Or it may also be that a virtual character and a virtual item have mutual lighting effects.
  • the light receiving parameter is used to represent a virtual object affected by light from other virtual objects, a corresponding light receiving range, and at least one of light receiving intensity and light receiving color within the light receiving range.
  • the poses of the two virtual objects will affect the range affected by the light.
  • the ranges affected by the light of the two virtual objects are at their respective predecessor positions; when the virtual characters stand side by side, the range affected by the light is At the side of the two close to each other.
  • the closer the distance between the two the larger the area affected by light, the greater the intensity of light, and the higher the brightness of the displayed light color.
  • FIG. 3 is a specific flow chart for determining the illumination influence information between the first virtual object and the second virtual object provided by the embodiment of the present disclosure.
  • S301 Based on the first pose information of the first virtual object in the virtual scene and the second pose information of the second virtual object in the virtual scene, determine the relationship between the first virtual object and the virtual scene. A first relative pose relationship between the second virtual objects.
  • a corresponding scene coordinate system may be determined for the virtual scene.
  • the scene coordinate system in a possible case, since the virtual scene corresponds to the real scene, the world coordinate system corresponding to the real scene can be used to determine the scene coordinate system of the virtual scene. Or, in another possible situation, since the virtual scene is constructed based on the scene image, the scene coordinate system of the virtual scene can also be determined correspondingly according to the camera coordinate system corresponding to the image acquisition device that captures the scene image.
  • the first pose information of the first virtual object in the virtual scene and the second pose information of the second virtual object in the virtual scene can be determined.
  • the pose information may reflect the position information and attitude information of the virtual object in the virtual scene. Since the first pose information and the second pose information are determined in the same scene coordinate system, the first pose information and the second pose information can be used to determine the first virtual object and the second virtual object.
  • a relative pose relationship According to the above description of the light receiving parameters, it can be known that according to the relative pose relationship between the two virtual objects, the corresponding light receiving parameters can be determined, so as to determine the lighting influence information between the first virtual object and the second virtual object.
  • S302 Based on the first relative pose relationship and the illumination parameter information of the virtual light source, determine a first light-influenced range and a first light-influenced intensity where the second virtual object affects the first virtual object, And a second light-affected range and a second light-affected intensity in which the first virtual object affects the second virtual object.
  • the determination of the light-affected range of a virtual object will be described.
  • the closer parts of the two can be determined.
  • the first virtual object as a virtual character and the second virtual object as a virtual item as an example, if the second virtual object is a table and the virtual object stands on one side of the table, then according to the first relative pose relationship, the first virtual object can be determined
  • the left side of the left waist of the virtual object is close to the right edge of the desktop of the second virtual object, and the distance between the two is relatively close.
  • the first light-affected range where the second virtual object affects the first virtual object is: the left waist range of the first virtual object; and it can be determined that the first virtual object affects the second virtual object
  • the second range affected by light is: the range of the right edge of the desktop of the second virtual object.
  • the determined shape of the area affected by light is related to the shape of the part of the virtual object that is affected by light.
  • the light-affected area affected by the right edge area shows a square shape; on the right edge of the desktop of the second virtual object, the light-influenced area affected by the left waist area of the first virtual object shows an ellipse.
  • FIG. 4 is a schematic diagram of virtual objects interacting with each other in lighting effects provided by an embodiment of the present disclosure.
  • the first virtual object is a virtual character
  • the second virtual object is a virtual item
  • the virtual character stands on the right side of the desktop.
  • Fig. 4 separately shows the first light-affected range 41 determined by the influence of the desktop on the virtual character, represented by a dotted line; and the second light-affected range 41 determined by the influence of the virtual character on the desktop
  • the range 42 is likewise indicated with a dotted line.
  • the first relative pose relationship can be determined according to the distance between the first light-receiving range of the first virtual object reflected in the first relative pose relationship and the second light-receiving range of the second virtual object.
  • the first light-affected intensity of the virtual object, and the second light-affected intensity of the second virtual object may be determined by using the furthest distance that can generate the influence of light, and the intensity of the influence of light determined in different distance intervals is different.
  • the farthest distance is 15 cm, which can be divided into three intervals.
  • the intensity of the influence of light is the weakest; the farthest distance is 5 cm When the distance is between 8 cm and 8 cm, the intensity of light influence is strong; when the farthest distance is less than 5 cm, the intensity of light influence is the strongest.
  • the intensity affected by light is also affected by the illumination parameter information of the virtual light source. For example, if the light source intensity of the virtual light source itself is relatively weak, the intensity affected by the light of the virtual object will be correspondingly weakened; if the light source of the virtual light source If the intensity is stronger, the intensity of the virtual object affected by light will also increase accordingly.
  • S303 Based on the first color information of the object part of the second virtual object within the second light-affected range, the first light-affected intensity, and the first illumination parameter information of the virtual light source, determine the The first light-receiving color of the first virtual object in the first light-affected range; and, based on the second color information of the object part of the first virtual object in the first light-affected range, the second The light-affected intensity and the first illumination parameter information of the virtual light source determine a second light-receiving color of the second virtual object within the second light-affected range.
  • the light-receiving color is determined by the color information of the virtual object within the light-receiving range. Since the way of determining the first light-receiving color for the first virtual object is similar to the way of determining the second light-receiving color for the second virtual object, the method of determining the first light-receiving color of the first virtual object will be described in detail below.
  • the determined first light-receiving color is the light-receiving color within the first light-receiving range.
  • the factors that affect the first light-receiving color include the first color information of the object part of the second virtual object that affects the first virtual object within the second light-receiving range, the first light-receiving intensity, and the illumination parameter information of the virtual light source .
  • the first virtual object is a virtual character
  • the second light-affected range is the right edge range of the desktop of the second virtual object.
  • the table is mahogany
  • the table part within the second light-affected range is mahogany color
  • the first color information includes mahogany color.
  • the mahogany color when displayed in the left waist area of the virtual character, it is also affected by the intensity of the first light influence correspondingly. For example, the stronger the light influence intensity, the higher the brightness of the displayed mahogany color, or the clearer Exhibits Mahogany.
  • the first illumination parameter information of the virtual light source will also affect the first light-receiving color. When the first illumination parameter information reflects that the intensity of the light source is strong, the first light-receiving color can show a brighter effect; When the parameter information reflects that the intensity of the light source is weak, the first light-receiving color may show a dimmer effect.
  • the virtual objects before determining the lighting influence information between different virtual objects, may also be affected by the lighting of the virtual light source to generate corresponding light and shadow effects.
  • FIG. 5 is a flow chart for determining light receiving parameters under a virtual light source provided by an embodiment of the present disclosure.
  • S501 Based on the first illumination parameter information and pose information corresponding to each of the virtual objects, determine a second relative pose relationship between the virtual light source and each of the virtual objects.
  • the second relative pose relationship For the manner of determining the second relative pose relationship, reference may be made to the description of S301 in FIG. 3 , and details will not be repeated here.
  • the second relative pose relationship when the virtual light source irradiates each virtual object, the light-receiving range, initial light-receiving intensity and light-receiving color of the virtual object can be determined.
  • S502 Based on the second relative pose relationship between the virtual light source and each of the virtual objects, determine the light-receiving range of the virtual object and within the light-receiving range when the virtual light source irradiates each virtual object The initial received light intensity; the initial received light intensity refers to the received light intensity without being affected by other virtual objects.
  • the illumination direction of the virtual light source when illuminating the virtual object can be determined.
  • the virtual object as the virtual character as an example
  • the relative pose relationship between the virtual light source and the virtual character for example, it can be determined that the virtual light source can only illuminate the predecessor of the virtual character, that is, the light receiving range of the virtual object is the predecessor.
  • the initial light receiving intensity of the virtual object Before it is affected by the lighting of other virtual objects, only the virtual light source has the influence on the virtual object. In this case, if the distance between the virtual light source and the virtual object is relatively long, the initial light intensity of the virtual object is low; if the distance between the virtual light source and the virtual object is short, the initial light intensity of the virtual object is high.
  • S503 Determine the initial light-receiving color of each virtual object within the corresponding light-receiving range based on the light-receiving intensity and the first illumination parameter information; the initial light-receiving color refers to the condition that it is not affected by other virtual objects color of light received.
  • the virtual object in the case of determining the light-receiving range, since the virtual light source itself has a light source color, the virtual object will be affected by the light source color within the light-receiving range, and present a color different from the color of the object itself. That is, the initial light color.
  • This phenomenon is similar to the color difference caused by clothing in different environments in real scenes.
  • the display difference of the initial received light color due to the color of the light source can be determined. For example, when the intensity of light received is strong, the color of the light source has a greater influence; when the intensity of light received is weak, the color of the light source has less influence.
  • the display effect of each virtual object in the virtual scene in the virtual light source can be determined based on the illumination influence information, such as described in the above S102 Display effects under the influence of lighting from other virtual objects or virtual light sources.
  • the display effect of the virtual character for example, the lighting effect of the virtual object only under the virtual light source may be presented.
  • the display of each virtual object under the virtual light source in the virtual scene can be determined according to the initial light receiving intensity and initial light receiving color of each virtual object contained in the light receiving parameter under the above virtual light source, as well as the illumination influence information Effect.
  • the display effect of the virtual object under the virtual light source can be determined directly according to the illumination impact information.
  • additional scene special effects may also be added when displaying the virtual object.
  • the display effect of each of the virtual objects in the virtual scene under the virtual light source may be determined based on the illumination influence information and the scene special effect data generated for the virtual scene.
  • the scene special effect data includes at least one of the following: rain and snow special effect data, icing special effect data, wind field special effect data, fog special effect data, falling leaves special effect data, follow spot light special effect data.
  • the additional scene special effects for example, in response to the selection of the virtual character control object, it may be determined to add the scene special effects to be displayed.
  • the scene special effect displayed on the user terminal may also be determined in response to the selection of the user watching the live broadcast, which may be determined according to the actual situation, and is not limited here.
  • the virtual scene corresponds to the real scene, and the information that can be expressed in the real scene is limited, for example, the real scene includes a bar, and the corresponding constructed virtual scene can only express the same information about the bar.
  • the virtual scene can be correspondingly produced with additional scene expressions. For example, adding follow-spot light effects can determine the stage area where the virtual character can sing and perform in the virtual scene expressing the bar, that is, an additional stage scene can be added to the virtual scene corresponding to the bar.
  • the virtual objects include virtual objects that do not actually exist in the real scene, and item models in the virtual scene that correspond to some items that actually exist in the real scene. For example, if there is an item in the real scene, but its corresponding item model in the virtual scene is affected by the virtual object or the illumination of the virtual light source, the item model corresponding to the item is also included in the virtual object.
  • each of the virtual objects may be rendered based on the determined display effect, and the rendered virtual objects are superimposed on the scene image of the real scene for AR display.
  • FIG. 6 is a schematic diagram of displaying virtual scene information in an AR presentation manner provided by an embodiment of the present disclosure.
  • the virtual light source in FIG. 6 is set to a gray light, so the overall picture appears gray.
  • the table and the avatar have mutual lighting influences, so they have darker light-affected areas.
  • each virtual object in the virtual scene can be rendered in real time based on the determined display effect to obtain a virtual scene rendered in real time Image: replace the currently acquired scene image of the real scene with the virtual scene image rendered in real time, so as to perform real-time display of the virtual reality VR scene.
  • the obtained virtual scene image is similar to the real scene image, is a complete image, and can express current information of the real scene.
  • This process is a real-time display process, that is, the displayed virtual scene image can express the current state information of the real scene through real-time rendering. If the scene image of the real scene changes with time, the corresponding virtual scene image after real-time rendering also expresses a synchronous image that changes with time.
  • the virtual scene image also includes the virtual object and the light and shadow information of the virtual object affected by the light.
  • the generated virtual scene images can be displayed directly. Since the virtual scene image can also express the current information of the real scene, the authenticity of the display can also be guaranteed.
  • the rendering and display method provided by the embodiments of the present disclosure, after constructing the virtual scene, it can be judged that the relationship between each virtual object under the illumination of the virtual light source can be judged by the illumination parameter information of the virtual light source and the pose information of each virtual object in the virtual scene. Whether there is lighting influence between different virtual objects, and correspondingly determine the lighting influence information between different virtual objects, so as to determine the display effect of each virtual object under the virtual light source and perform rendering and display. In this way, when rendering and displaying virtual objects, the details of mutual lighting effects between virtual objects are supplemented, which is more in line with the display logic in real situations, and can make the rendering and display more realistic.
  • the writing order of each step does not mean a strict execution order and constitutes any limitation on the implementation process.
  • the specific execution order of each step should be based on its function and possible
  • the inner logic is OK.
  • the embodiment of the present disclosure also provides a rendering display device corresponding to the rendering display method. Since the problem-solving principle of the device in the embodiment of the present disclosure is similar to the above-mentioned rendering display method in the embodiment of the present disclosure, the implementation of the device Reference can be made to the implementation of the method, and repeated descriptions will not be repeated.
  • the device includes: an acquisition module 71, a first determination module 72, a second determination module 73, and a display module 74; wherein,
  • An acquisition module 71 configured to acquire a scene image of a real scene, and construct the virtual scene based on the scene image, including a virtual light source and a plurality of virtual objects in the virtual scene;
  • the first determination module 72 is configured to determine the relationship between different virtual objects based on the first illumination parameter information of the virtual light source in the virtual scene and the pose information of each of the virtual objects in the virtual scene.
  • Illumination influence information includes: under the first illumination parameter information, for at least one virtual object, other virtual objects influence information on the light receiving parameter of the at least one virtual object;
  • the second determination module 73 is configured to determine the display effect of each of the virtual objects in the virtual scene under the virtual light source based on the illumination influence information;
  • the display module 74 is configured to render each of the virtual objects based on the determined display effect, so as to display the virtual scene information.
  • the display module 74 when the display module 74 renders each of the virtual objects based on the determined display effect to display the virtual scene information, it is configured to: based on the determined display effect Each of the virtual objects is rendered, and the rendered virtual objects are superimposed on the scene image of the real scene for augmented reality AR display.
  • the display module 74 when the display module 74 renders each of the virtual objects based on the determined display effect to display the virtual scene information, it is configured to: based on the determined display effect performing real-time rendering on each of the virtual objects in the virtual scene to obtain a virtual scene image after real-time rendering; using the virtual scene image after real-time rendering to replace the currently acquired scene image of the real scene to perform virtual reality VR Real-time display of the scene.
  • the first illumination parameter information of the virtual light source in the virtual scene includes at least one of the following: a setting height and a setting angle of the virtual light source in the virtual scene, Light source radiation range, light source color, light source intensity.
  • the first illumination parameter information of the virtual light source in the virtual scene is determined according to the following steps: based on the scene image, determine the corresponding value of the real light source in the real scene second irradiation parameter information; determining the first irradiation parameter information based on the second irradiation parameter information.
  • the first illumination parameter information of the virtual light source in the virtual scene is determined according to the following steps: according to the attribute characteristics of each of the virtual objects contained in the virtual scene, determine The first illumination parameter information of the virtual light source in the virtual scene.
  • the light receiving parameter includes the light receiving range of the virtual object, and at least one of the light receiving intensity and light receiving color within the light receiving range;
  • the first determination module 72 determines the lighting effect information between the first virtual object and the second virtual object according to the following steps: based on the The first pose information of the first virtual object in the virtual scene, and the second pose information of the second virtual object in the virtual scene, determine the relationship between the first virtual object and the second A first relative pose relationship between virtual objects; based on the first relative pose relationship and the illumination parameter information of the virtual light source, determine the first position of the influence of the second virtual object on the first virtual object The range affected by light and the first intensity affected by light, and the second range affected by light and the second intensity affected by light in which the first virtual object affects the second virtual object; 2.
  • the first color information of the object part within the range affected by light, the first intensity affected by light, and the first illumination parameter information of the virtual light source to determine that the first virtual object is within the first range affected by light and, based on the second color information of the object part of the first virtual object within the first light-affected range, the second light-affected intensity, and the first illumination of the virtual light source
  • the parameter information determines the second light-receiving color of the second virtual object within the second light-receiving range.
  • the first virtual object is a virtual character
  • the second virtual object is a virtual item
  • the first virtual object is a virtual item
  • the second virtual object is a virtual character
  • both the first virtual object and the second virtual object are virtual characters
  • both the first virtual object and the second virtual object are virtual items.
  • the light-receiving parameters include the light-receiving range of the virtual object, and at least one of the light-receiving intensity and initial light-receiving color within the light-receiving range;
  • the first illumination parameter information in the virtual scene, and the pose information of each of the virtual objects in the virtual scene, before determining the illumination influence information between different virtual objects the first determination module 72 is also used for: Based on the first illumination parameter information and the pose information corresponding to each of the virtual objects, determine a second relative pose relationship between the virtual light source and each of the virtual objects; based on the virtual light source and each of the virtual objects, The second relative pose relationship between the virtual objects, determining the light-receiving range of each virtual object and the initial light-receiving intensity within the light-receiving range when the virtual light source irradiates each virtual object ;
  • the initial light receiving intensity refers to the light receiving intensity without being affected by other virtual objects; based on the light receiving intensity and the first illumination parameter information, determine the
  • the second determination module 73 determines the display effect of each of the virtual objects in the virtual scene under the virtual light source based on the illumination influence information, it is used to: Based on the illumination influence information and the scene special effect data generated for the virtual scene, the display effect of each of the virtual objects in the virtual scene under the virtual light source is determined.
  • the scene special effect data includes at least one of the following: rain and snow special effect data, icing special effect data, wind field special effect data, fog special effect data, falling leaf special effect data, and follow spot light special effect data.
  • the acquisition module 71 when the acquisition module 71 constructs the virtual scene based on the scene image, it is configured to: perform three-dimensional space reconstruction on the scene image by using synchronous positioning and mapping SLAM to obtain the constructed the virtual scene.
  • FIG. 8 is a schematic structural diagram of the computer device provided by the embodiment of the present disclosure, including:
  • processor 10 and memory 20; the memory 20 stores machine-readable instructions executable by the processor 10, the processor 10 is used to execute the machine-readable instructions stored in the memory 20, and the machine-readable instructions are executed by the processor 10 During execution, the processor 10 performs the following steps:
  • the illumination influence information includes: under the first illumination parameter information, for at least one virtual Object, other virtual objects influence information on the light receiving parameters of the at least one virtual object; based on the illumination influence information, determine the display effect of each of the virtual objects in the virtual scene under the virtual light source; based on determining The display effect renders each of the virtual objects to display the virtual scene information.
  • memory 20 comprises memory 210 and external memory 220;
  • Memory 210 here is also called internal memory, is used for temporarily storing the operation data in processor 10, and the data exchanged with external memory 220 such as hard disk, processor 10 communicates with memory 210 through memory 210.
  • the external memory 220 performs data exchange.
  • Embodiments of the present disclosure further provide a computer-readable storage medium, on which a computer program is stored.
  • the storage medium may be a volatile or non-volatile computer-readable storage medium.
  • Embodiments of the present disclosure also provide a computer program product, the computer program product carries a program code, and the instructions included in the program code can be used to execute the steps of the rendering and display method described in the above method embodiment, for details, please refer to the above method The embodiment will not be repeated here.
  • the above-mentioned computer program product may be specifically implemented by means of hardware, software or a combination thereof.
  • the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK) etc. wait.
  • a software development kit Software Development Kit, SDK
  • Embodiments of the present disclosure further provide a computer program, which executes the steps of the rendering and display method described in the foregoing method embodiments when the computer program is run by a processor.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium executable by a processor.
  • the technical solution of the present disclosure is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present disclosure.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disc and other media that can store program codes. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Graphics (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Computer Hardware Design (AREA)
  • Geometry (AREA)
  • Processing Or Creating Images (AREA)

Abstract

本公开提供了一种渲染显示方法、装置、计算机设备、存储介质、计算机程序产品及计算机程序,其中,该方法包括:获取现实场景的场景图像,并基于所述场景图像构建所述虚拟场景;基于所述虚拟光源在所述虚拟场景中的第一照射参数信息、以及各个所述虚拟对象在所述虚拟场景中的位姿信息,确定不同虚拟对象之间的光照影响信息;所述光照影响信息包括:在所述第一照射参数信息下,针对至少一个虚拟对象,其它虚拟对象对所述至少一个虚拟对象的受光参数的影响信息;基于所述光照影响信息,确定所述虚拟场景中对各个所述虚拟对象在所述虚拟光源下的展示效果;基于确定的所述展示效果对各个所述虚拟对象进行渲染,以展示所述虚拟场景信息。

Description

一种渲染显示方法、装置、计算机设备及存储介质
相关申请交叉引用
本公开要求于2021年12月23日提交的、申请号为202111593935.1、名称为“一种渲染显示方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本公开中。
技术领域
本公开涉及计算机技术技术领域,具体而言,涉及一种渲染显示方法、装置、计算机设备、存储介质、计算机程序产品及计算机程序。
背景技术
在虚拟直播等场景下,真实人物可以控制虚拟角色执行相关动作,并在直播画面或其他展示画面中,实时呈现虚拟角色的行为动作。除虚拟角色外,画面中还可以有很多其他的场景对象,比如场景中的一些虚拟道具。
一般地,在现实场景中,不管是在室内还是室外都会有自然光或人造光源照射现实场景中的对象,由此会有现实场景对象在这些光源下的一些展示效果。而在虚拟场景下,一般都不会考虑光源对各场景对象的渲染展示的影响,这导致在虚拟直播等场景中,对于场景对象的渲染效果的真实性较差。
发明内容
本公开实施例至少提供一种渲染显示方法、装置、计算机设备、存储介质、计算机程序产品及计算机程序。
第一方面,本公开实施例提供了一种渲染显示方法,用于显示虚拟场景信息;在所述虚拟场景信息对应的虚拟场景中包含虚拟光源和多个虚拟对象;所述方法包括:获取现实场景的场景图像,并基于所述场景图像构建所述虚拟场景;基于所述虚拟光源在所述虚拟场景中的第一照射参数信息、以及各个所述虚拟对象在所述虚拟场景中的位姿信息,确定不同虚拟对象之间的光照影响信息;所述光照影响信息包括:在所述第一照射参数信息下,针对至少一个虚拟对象,其它虚拟对象对所述至少一个虚拟对象的受光参数的影响信息;基于所述光照影响信息,确定所述虚拟场景中对各个所述虚拟对象在所述虚拟光源下的展示效果;基于确定的所述展示效果对各个所述虚拟对象进行渲染,以展示所述虚拟场景信息。
一种可选的实施方式中,所述基于确定的所述展示效果对各个所述虚拟对象进行渲染,以展示所述虚拟场景信息,包括:基于确定的所述展示效果对各个所述虚拟对象进行渲染,并将渲染后的所述各个所述虚拟对象叠加在所述现实场景的场景图像中进行增强现实AR展示。
一种可选的实施方式中,所述基于确定的所述展示效果对各个所述虚拟对象进行渲染,以展示所述虚拟场景信息,包括:基于确定的所述展示效果对所述虚拟场景中的各个所述虚 拟对象进行实时渲染,得到实时渲染后的虚拟场景图像;采用实时渲染后的虚拟场景图像替换当前获取的所述现实场景的场景图像,以进行虚拟现实VR场景的实时展示。
一种可选的实施方式中,所述虚拟光源在所述虚拟场景中的第一照射参数信息,包括下述至少一种:所述虚拟光源在所述虚拟场景中的设置高度,设置角度,光源辐射范围,光源颜色,光源强度。
一种可选的实施方式中,所述虚拟光源在所述虚拟场景中的第一照射参数信息为根据以下步骤确定的:基于所述场景图像,确定在所述现实场景中的真实光源对应的第二照射参数信息;基于所述第二照射参数信息,确定所述第一照射参数信息。
一种可选的实施方式中,所述虚拟光源在所述虚拟场景中的第一照射参数信息为根据以下步骤确定的:根据所述虚拟场景中包含的各个所述虚拟对象的属性特征,确定所述虚拟光源在所述虚拟场景中的第一照射参数信息。
一种可选的实施方式中,所述受光参数包括所述虚拟对象的受光影响范围、以及在所述受光影响范围内的受光影响强度和受光颜色中至少一种;针对在所述虚拟对象中相互之间产生光照影响的第一虚拟对象和第二虚拟对象,根据以下步骤确定所述第一虚拟对象和所述第二虚拟对象之间的光照影响信息:基于所述第一虚拟对象在所述虚拟场景中的第一位姿信息、以及所述第二虚拟对象在所述虚拟场景中的第二位姿信息,确定所述第一虚拟对象与所述第二虚拟对象之间的第一相对位姿关系;基于所述第一相对位姿关系和所述虚拟光源的照射参数信息,确定所述第二虚拟对象对所述第一虚拟对象产生影响的第一受光影响范围和第一受光影响强度、以及所述第一虚拟对象对所述第二虚拟对象产生影响的第二受光影响范围和第二受光影响强度;基于所述第二虚拟对象在所述第二受光影响范围内的对象部分的第一颜色信息、所述第一受光影响强度、和所述虚拟光源的第一照射参数信息,确定所述第一虚拟对象在所述第一受光影响范围内的第一受光颜色;以及,基于所述第一虚拟对象在所述第一受光影响范围内的对象部分的第二颜色信息、所述第二受光影响强度、和所述虚拟光源的第一照射参数信息,确定所述第二虚拟对象在所述第二受光影响范围内的第二受光颜色。
一种可选的实施方式中,所述第一虚拟对象为虚拟角色,所述第二虚拟对象为虚拟物品;或者,所述第一虚拟对象为虚拟物品,所述第二虚拟对象为虚拟角色;或者,所述第一虚拟对象和所述第二虚拟对象都为虚拟角色;或者,所述第一虚拟对象和所述第二虚拟对象都为虚拟物品。
一种可选的实施方式中,所述受光参数包括所述虚拟对象的受光范围、以及在所述受光范围内的受光强度和初始受光颜色中至少一种;在基于所述虚拟光源在所述虚拟场景中的第一照射参数信息、以及各个所述虚拟对象在所述虚拟场景中的位姿信息,确定不同虚拟对象之间的光照影响信息之前,还包括:基于所述第一照射参数信息、以及各个所述虚拟对象分别对应的位姿信息,确定所述虚拟光源与各个所述虚拟对象之间的第二相对位姿关系;基于所述虚拟光源与每个所述虚拟对象之间的第二相对位姿关系,确定所述虚拟光源在照射每个所述虚拟对象时,每个所述虚拟对象的受光范围以及在所述受光范围内的初始受光强度;所述初始受光强度为在未受到其它所述虚拟对象影响的情况下的受光强度;基于所述受光强度以及所述照射参数信息,确定每个所述虚拟对象在对应的受光范围内的初始受光颜色;所述初始受光颜色为在未受到其它所述虚拟对象影响的情况下的受光颜色;所述基于所述光照影 响信息,确定所述虚拟场景中对各个所述虚拟对象在所述虚拟光源下的展示效果,包括:基于所述光照影响信息,以及各个所述虚拟对象的所述初始受光强度和初始受光颜色,确定所述虚拟场景中对各个所述虚拟对象在所述虚拟光源下的展示效果。
一种可选的实施方式中,所述基于所述光照影响信息,确定所述虚拟场景中对各个所述虚拟对象在所述虚拟光源下的展示效果,包括:基于所述光照影响信息、以及为所述虚拟场景生成的场景特效数据,确定在所述虚拟场景中各个所述虚拟对象在所述虚拟光源下的展示效果。
一种可选的实施方式中,所述场景特效数据包括下述至少一种:雨雪特效数据、结冰特效数据、风场特效数据、雾气特效数据、落叶特效数据、追光灯特效数据。
一种可选的实施方式中,所述基于所述场景图像构建所述虚拟场景,包括:利用同步定位与建图SLAM对所述场景图像进行三维空间重建,得到构建的所述虚拟场景。
第二方面,本公开实施例还提供一种渲染显示装置,包括:获取模块,用于获取现实场景的场景图像,并基于所述场景图像构建所述虚拟场景,在所述虚拟场景中包含虚拟光源和多个虚拟对象;第一确定模块,用于基于所述虚拟光源在所述虚拟场景中的第一照射参数信息、以及各个所述虚拟对象在所述虚拟场景中的位姿信息,确定不同虚拟对象之间的光照影响信息;所述光照影响信息包括:在所述第一照射参数信息下,针对至少一个虚拟对象,其它所述虚拟对象对所述至少一个虚拟对象的受光参数的影响信息;第二确定模块,用于基于所述光照影响信息,确定所述虚拟场景中对各个所述虚拟对象在所述虚拟光源下的展示效果;显示模块,用于基于确定的所述展示效果对各个所述虚拟对象进行渲染,以展示所述虚拟场景信息。
一种可选的实施方式中,所述显示模块在基于确定的所述展示效果对各个所述虚拟对象进行渲染,以展示所述虚拟场景信息时,用于:基于确定的所述展示效果对各个所述虚拟对象进行渲染,并将渲染后的所述各个所述虚拟对象叠加在所述现实场景的场景图像中进行增强现实AR展示。
一种可选的实施方式中,所述显示模块在基于确定的所述展示效果对各个所述虚拟对象进行渲染,以展示所述虚拟场景信息时,用于:基于确定的所述展示效果对所述虚拟场景中的各个所述虚拟对象进行实时渲染,得到实时渲染后的虚拟场景图像;采用实时渲染后的虚拟场景图像替换当前获取的所述现实场景的场景图像,以进行虚拟现实VR场景的实时展示。
一种可选的实施方式中,所述虚拟光源在所述虚拟场景中的第一照射参数信息,包括下述至少一种:所述虚拟光源在所述虚拟场景中的设置高度,设置角度,光源辐射范围,光源颜色,光源强度。
一种可选的实施方式中,所述虚拟光源在所述虚拟场景中的第一照射参数信息为根据以下步骤确定的:基于所述场景图像,确定在所述现实场景中的真实光源对应的第二照射参数信息;基于所述第二照射参数信息,确定所述第一照射参数信息。
一种可选的实施方式中,所述虚拟光源在所述虚拟场景中的第一照射参数信息为根据以下步骤确定的:根据所述虚拟场景中包含的各个所述虚拟对象的属性特征,确定所述虚拟光源在所述虚拟场景中的第一照射参数信息。
一种可选的实施方式中,所述受光参数包括所述虚拟对象的受光影响范围、以及在所述受光影响范围内的受光影响强度和受光颜色中至少一种;针对在所述虚拟对象中相互之间产生光照影响的第一虚拟对象和第二虚拟对象,所述第一确定模块根据以下步骤确定所述第一虚拟对象和所述第二虚拟对象之间的光照影响信息:基于所述第一虚拟对象在所述虚拟场景中的第一位姿信息、以及所述第二虚拟对象在所述虚拟场景中的第二位姿信息,确定所述第一虚拟对象与所述第二虚拟对象之间的第一相对位姿关系;基于所述第一相对位姿关系和所述虚拟光源的照射参数信息,确定所述第二虚拟对象对所述第一虚拟对象产生影响的第一受光影响范围和第一受光影响强度、以及所述第一虚拟对象对所述第二虚拟对象产生影响的第二受光影响范围和第二受光影响强度;基于所述第二虚拟对象在所述第二受光影响范围内的对象部分的第一颜色信息、所述第一受光影响强度、和所述虚拟光源的第一照射参数信息,确定所述第一虚拟对象在所述第一受光影响范围内的第一受光颜色;以及,基于所述第一虚拟对象在所述第一受光影响范围内的对象部分的第二颜色信息、所述第二受光影响强度、和所述虚拟光源的第一照射参数信息,确定所述第二虚拟对象在所述第二受光影响范围内的第二受光颜色。
一种可选的实施方式中,所述第一虚拟对象为虚拟角色,所述第二虚拟对象为虚拟物品;或者,所述第一虚拟对象为虚拟物品,所述第二虚拟对象为虚拟角色;或者,所述第一虚拟对象和所述第二虚拟对象都为虚拟角色;或者,所述第一虚拟对象和所述第二虚拟对象都为虚拟物品。
一种可选的实施方式中,所述受光参数包括所述虚拟对象的受光范围、以及在所述受光范围内的受光强度和初始受光颜色中至少一种;在基于所述虚拟光源在所述虚拟场景中的第一照射参数信息、以及各个所述虚拟对象在所述虚拟场景中的位姿信息,确定不同虚拟对象之间的光照影响信息之前,所述第一确定模块还用于:基于所述第一照射参数信息、以及各个所述虚拟对象分别对应的位姿信息,确定所述虚拟光源与各个所述虚拟对象之间的第二相对位姿关系;基于所述虚拟光源与每个所述虚拟对象之间的第二相对位姿关系,确定所述虚拟光源在照射每个所述虚拟对象时,每个所述虚拟对象的受光范围以及在所述受光范围内的初始受光强度;所述初始受光强度为在未受到其它所述虚拟对象影响的情况下的受光强度;基于所述受光强度以及所述第一照射参数信息,确定每个所述虚拟对象在对应的受光范围内的初始受光颜色;所述初始受光颜色为在未受到其它所述虚拟对象影响的情况下的受光颜色;所述第二确定模块在基于所述光照影响信息,确定所述虚拟场景中对各个所述虚拟对象在所述虚拟光源下的展示效果时,用于:基于所述光照影响信息,以及各个所述虚拟对象的所述初始受光强度和初始受光颜色,确定所述虚拟场景中对各个所述虚拟对象在所述虚拟光源下的展示效果。
一种可选的实施方式中,所述第二确定模块在基于所述光照影响信息,确定所述虚拟场景中对各个所述虚拟对象在所述虚拟光源下的展示效果时,用于:基于所述光照影响信息、以及为所述虚拟场景生成的场景特效数据,确定在所述虚拟场景中各个所述虚拟对象在所述虚拟光源下的展示效果。
一种可选的实施方式中,所述场景特效数据包括下述至少一种:雨雪特效数据、结冰特效数据、风场特效数据、雾气特效数据、落叶特效数据、追光灯特效数据。
一种可选的实施方式中,所述获取模块在基于所述场景图像构建所述虚拟场景时,用于:利用同步定位与建图SLAM对所述场景图像进行三维空间重建,得到构建的所述虚拟场景。
第三方面,本公开可选实现方式还提供一种计算机设备,处理器、存储器,所述存储器存储有所述处理器可执行的机器可读指令,所述处理器用于执行所述存储器中存储的机器可读指令,所述机器可读指令被所述处理器执行时,所述机器可读指令被所述处理器执行时执行上述第一方面,或第一方面中任一种可能的实施方式中的步骤。
第四方面,本公开可选实现方式还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被运行时执行上述第一方面,或第一方面中任一种可能的实施方式中的步骤。
第五方面,本公开可选实现方式还提供一种计算机程序产品,所述计算机程序产品承载有程序代码,所述程序代码包括的指令被处理器运行时执行上述第一方面,或第一方面中任一种可能的实施方式中的步骤。
第六方面,本公开可选实现方式还提供一种计算机程序,所述计算机程序被处理器运行时执行上述第一方面,或第一方面中任一种可能的实施方式中的步骤。
关于上述渲染显示装置、计算机设备、计算机可读存储介质、计算机程序产品及计算机程序的效果描述参见上述渲染显示方法的说明,这里不再赘述。
本公开实施例提供的渲染显示方法、装置、计算机设备、存储介质、计算机程序产品及计算机程序,在构建虚拟场景后,可以通过虚拟光源的照射参数信息、以及各个虚拟对象在虚拟场景中的位姿信息,判断在虚拟光源的照射下,各个虚拟对象之间是否具有光照影响,并相应的确定不同虚拟对象之间的光照影响信息,以确定各个虚拟对象在虚拟光源下的展示效果并进行渲染显示。这样,在渲染显示虚拟对象时补充了虚拟对象之间产生的相互光照影响的细节,更符合在现实情况下的显示逻辑,可以使渲染显示时的真实性更强。
为使本公开的上述目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附附图,作详细说明如下。
附图说明
为了更清楚地说明本公开实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,此处的附图被并入说明书中并构成本说明书中的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。应当理解,以下附图仅示出了本公开的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。
图1示出了本公开实施例所提供的一种渲染显示方法的流程图;
图2示出了本公开实施例所提供的一种场景图像的示意图;
图3示出了本公开实施例所提供的一种确定第一虚拟对象和第二虚拟对象之间的光照影响信息的具体流程图;
图4示出了本公开实施例所提供的一种虚拟对象在相互产生光照影响时的示意图;
图5示出了本公开实施例所提供的一种确定在虚拟光源下的受光参数的流程图;
图6示出了本公开实施例所提供的一种通过AR展示的方式展示虚拟场景信息的示意图;
图7示出了本公开实施例所提供的一种渲染显示装置的示意图;
图8示出了本公开实施例所提供的一种计算机设备的示意图。
具体实施方式
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本公开一部分实施例,而不是全部的实施例。通常在此处描述和示出的本公开实施例的组件可以以各种不同的配置来布置和设计。因此,以下对本公开的实施例的详细描述并非旨在限制要求保护的本公开的范围,而是仅仅表示本公开的选定实施例。基于本公开的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本公开保护的范围。
在展示虚拟角色和虚拟物品等虚拟对象的场景下,通常会将虚拟对象在构建出的虚拟场景中进行展示。具体地,在确定各个虚拟对象在虚拟场景中分别对应的展示位置后,随即会将各个虚拟对象一并渲染显示出。而在现实情况下,在光源照射在不同虚拟对象上时,不同虚拟对象之间、尤其位置临近的虚拟对象之间会产生相互的影响。如果忽略这种在现实情况下虚拟对象之间相互产生光照影响的细节,在渲染显示后的真实性就会较差。
基于上述研究,本公开提供了一种渲染显示方法,在构建虚拟场景后,可以通过虚拟光源的照射参数信息、以及各个虚拟对象在虚拟场景中的位姿信息,判断在虚拟光源的照射下,各个虚拟对象之间是否具有光照影响,并相应的确定不同虚拟对象之间的光照影响信息,以确定各个虚拟对象在虚拟光源下的展示效果并进行渲染显示。这样,在渲染显示虚拟对象时补充了虚拟对象之间产生的相互光照影响的细节,更符合在现实情况下的显示逻辑,可以使渲染显示时的真实性更强。
针对以上方案所存在的缺陷,均是发明人在经过实践并仔细研究后得出的结果,因此,上述问题的发现过程以及下文中本公开针对上述问题所提出的解决方案,都应该是发明人在本公开过程中对本公开做出的贡献。
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。
为便于对本实施例进行理解,首先对本公开实施例所公开的一种渲染显示方法进行详细介绍,本公开实施例所提供的渲染显示方法的执行主体一般为具有一定计算能力的计算机设备。具体地,由于本公开实施例提供的渲染显示方法可以应用于增强现实(Augmented Reality,AR)场景或者虚拟现实(Virtual Reality,VR)场景,因此计算机设备例如可以包括但不限于可以支持AR显示的设备,例如手机、平板电脑等移动设备;或者AR穿戴设备,例如AR眼镜。或者,还可以包括用于支持VR显示的设备,例如VR一体机。在一些可能的实现方式中,该渲染显示方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。
本公开实施例提供的渲染显示方法,用于显示虚拟场景信息。其中,虚拟场景信息用于表达虚拟场景;在展示虚拟场景信息时,即可以使用户观看到虚拟场景。虚拟场景可以展示出与现实场景在视觉表达上一致的虚拟空间。在虚拟场景中,具体可以包括虚拟光源和多个虚拟对象。其中,虚拟对象例如可以包括下文中说明的虚拟角色和虚拟物品。虚拟光源例如 包括在虚拟场景中对虚拟对象产生光照影响的光源;另外,在虚拟场景中的虚拟光源可以包括一个或多个,虚拟光源添加在虚拟场景中的时机也可以根据实际需求确定,在此并不做出限定。
示例性的,虚拟角色可以包括由虚拟角色控制对象进行控制、并在虚拟场景中展示出的人物角色或者动漫角色等;虚拟角色控制对象可以为现实场景中的真实人物。利用行为捕捉设备对虚拟角色控制对象的行为进行捕捉,可以生成虚拟角色控制对象的行为数据;进一步的,利用行为数据可以控制虚拟角色在虚拟场景中的行为。虚拟物品例如可以包括与现实场景中实际存在的物品对应的物品模型,例如与现实场景对应摆放的家具和饰品对应的物品模型;或者也可以是另外添加在虚拟场景中的其他物品,例如虚拟角色的宠物等。
另外,本公开实施例提供的渲染显示方法可以应用于不同的应用场景中,例如直播场景中。并且,本公开实施例提供的渲染显示方法可以通过AR技术或者VR技术实现。具体地,通过AR技术可以将本公开实施例提供的渲染显示方法应用于直播场景或其他展示场景中;通过VR技术也可以将本公开实施例提供的渲染显示方法应用于直播场景或其他展示场景中,以显示出虚拟场景中由虚拟光源影响的多个虚拟对象。而无论通过AR技术还是VR技术展示虚拟场景信息时,均期望其中的虚拟对象在展示时,具有存在于现实空间中的效果,从而可以进一步提高在渲染显示时的真实性。
下面对本公开实施例提供的渲染显示方法加以说明。
参见图1所示,为本公开实施例提供的一种渲染显示方法的流程图,所述方法包括步骤S101~S104,其中:
S101:获取现实场景的场景图像,并基于所述场景图像构建所述虚拟场景;
S102:基于所述虚拟光源在所述虚拟场景中的第一照射参数信息、以及各个所述虚拟对象在所述虚拟场景中的位姿信息,确定不同虚拟对象之间的光照影响信息;所述光照影响信息包括:在所述第一照射参数信息下,针对至少一个虚拟对象,其它虚拟对象对所述至少一个虚拟对象的受光参数的影响信息;
S103:基于所述光照影响信息,确定所述虚拟场景中对各个所述虚拟对象在所述虚拟光源下的展示效果;
S104:基于确定的所述展示效果对各个所述虚拟对象进行渲染,以展示所述虚拟场景信息。
下面对上述S101~S104加以详细说明。
针对上述S101,为了采用AR技术或者VR技术在展示虚拟场景信息时,提高其中的虚拟对象在展示时的真实性,可以通过获取现实场景的场景图像的方式,构建虚拟场景。其中,在获取现实场景图像时,可以采用AR设备或者VR设备等携带的图像采集设备(例如彩色相机、深度相机、双目相机等)对现实场景进行图像采集,以得到场景图像。
示例性的,参见图2所示,为本公开实施例提供的一种场景图像的示意图。在图2中示出的场景图像中,示出了一张桌子以及在左侧墙面上的装饰画。
在获取到场景图像的情况下,通过同步定位与建图(Simultaneous Localization and Mapping,SLAM)对场景图像进行三维空间重建,可以得到构建的虚拟场景。具体地,在根据场景图像构建虚拟场景时,可以根据场景图像得到与现实场景一致的虚拟场景;并且,在 图像采集设备在现实场景中移动,并采集到现实场景中未被拍摄到的区域对应的场景图像后,也可以即时的根据新的场景图像构建出该区域部分对应的虚拟场景。
上述步骤中,虚拟光源可以是基于现实场景中的真实光源的照射参数制作的虚拟光源模型(或者虚拟光源对象),使得该虚拟光源模型的照射参数与真实光源匹配。或者,虚拟光源也可以是在不考虑真实光源的情况下,基于虚拟场景的展示效果的需要,所设计出的虚拟光源模型。例如,在确定虚拟角色的情感发生变化(比如通过识别虚拟角色的面部表情,确定虚拟角色由开心的心情转变为伤心的心情)而改变虚拟场景中的环境基调的场景中,或者在用户或虚拟角色控制对象选取新的光照环境的场景中,又或者在根据虚拟物品的风格调整光照环境等场景中,可以根据实际需求在虚拟场景中添加虚拟光源,以使虚拟对象在进行显示时与场景图像的风格趋于一致,使虚拟对象可以融合显示在场景图像上,从而提升显示虚拟对象时的真实性。
需要说明的是,虚拟光源可以认为是在虚拟场景中存在的光源,但不一定需要在当前的展示画面中展示出该虚拟光源本身,在展示画面中展示出的可以只是各个虚拟对象在虚拟光源照射下的展示效果。当然,在某些需要体现光源本身的场景下,也可以对虚拟光源本身进行渲染展示。
对于存在虚拟光源的虚拟场景,虚拟光源在虚拟场景中的第一照射参数信息,具体例如可以包括下述至少一种:所述虚拟光源在所述虚拟场景中的设置高度,设置角度,光源辐射范围,光源颜色,光源强度。第一照射参数信息可以用于确定虚拟光源在虚拟场景中对虚拟对象的光照影响。
示例性的,虚拟光源在虚拟场景中的设置高度例如为3米,设置角度例如为偏向东北方向30度,光源辐射范围例如表征可以照射到在地面上20平方米的圆形区域,光源颜色为白色,光源强度较强。
根据上述描述可知,在一种可能的情况下,虚拟光源可以还原现实场景中的真实光源,以使叠加显示后的虚拟对象具有与在现实场景中相同的光照效果。在该种情况下,在确定虚拟光源在虚拟场景中的第一照射参数信息时,可以基于所述场景图像,确定在所述现实场景中的真实光源对应的第二照射参数信息;并基于所述第二照射参数信息,确定所述第一照射参数信息。
具体地,利用上述步骤S101获取场景图像后,可以对场景图像做出分析,例如通过对象识别的方式识别出其中的至少一个对象,例如桌子、玻璃杯等,再通过这些对象在场景图像中显示出的影子或者反射出的光照等光影信息,确定在现实场景中的真实光源的第二照射参数信息。在确定真实光源对应的第二照射参数信息后,可以直接将确定出的该第二照射参数信息,作为虚拟光源在虚拟场景中的第一照射参数信息。
这样,对于虚拟场景中的各个虚拟对象,其并不实际存在于现实场景中。而由于虚拟光源的照射参数信息与现实场景中真实光源的照射参数信息相同,因此通过在同一虚拟场景中虚拟光源对不同虚拟对象的光照影响,可以展示出各个虚拟对象由于现实场景的真实光照而表现出的光影效果。
在另一种可能的情况下,虚拟光源也可以根据实际的需求设置为有别于真实光源的其他光源,并相应的确定虚拟光源对应的第一照射参数信息。例如在上述示例中,在确定虚拟角 色的情感发生变化的情况下,比如虚拟角色由开心的心情转变为伤心的心情时,相应的可以设置虚拟光源的第一照射参数信息由虚拟角色在开心时对应的光源辐射范围较大、光源强度较强、光源颜色为鹅黄色,转变为虚拟角色在伤心时对应的光源辐射范围较小、光源强度较弱、光源颜色为灰色。
此处仅提供了一种通过虚拟对象的情感变化确定虚拟光源的示例,由于虚拟角色具有多种不同表现形式的变化,比如在表达情感上的变化,或者行为上的变化,因此除了根据虚拟角色的情感变化确定虚拟光源的第一照射参数信息外,还可以根据虚拟角色的动作变化等其他信息确定虚拟光源的第一照射参数信息,以更加配合虚拟角色的行为,在此并不做出限定。
另外,还可以根据虚拟场景中包含的各个虚拟对象的属性特征,确定虚拟光源在所述虚拟场景中的第一照射参数信息。其中,虚拟对象包括虚拟角色和虚拟物品。以虚拟角色为例,虚拟角色的属性特征例如可以包括虚拟角色的服装特征,具体可以包括服装的颜色、材质等。比如,若虚拟角色的服装特征为较为暖色系的毛衣,则虚拟光源可以选取较为柔和的黄色光,并加强光照强度,以突显出虚拟角色较为可爱的着装特点。若角色的服装特征为冷色系的绸缎材质的礼服,则虚拟光源可以选取较为优雅的冷光,并减弱光照强度,以突显出虚拟角色较为高雅的着装特点。这样,通过虚拟角色的属性特征选取虚拟光源,可以与虚拟角色较为搭配,显示效果也更好。
而对于虚拟对象中的虚拟物品,虚拟物品的属性特征例如可以包括虚拟物品的物品类型。具体地,利用虚拟物品的物品类型可以推断出虚拟场景所表达的场景类型,然后根据场景类型可以确定相匹配的虚拟光源。示例性的,若虚拟物品的物品类型包括酒杯、酒瓶、吧台等,则可以确定虚拟场景为酒吧。在酒吧中的光源通常光照强度较低,设置高度较低、光源辐射范围较小、且光源颜色偏冷色系,因此可以按照这样的照射参数信息确定虚拟场景中的第一照射参数信息。这样,虚拟场景在展示时,光影效果可以与虚拟物品表达出的场景协调统一,更具有真实感。
在确定虚拟光源在虚拟场景中的第一照射参数信息后,还可以根据各个虚拟对象在虚拟场景中的位姿信息,确定在虚拟光源下不同虚拟对象之间的光照影响信息。其中,光照影响信息包括在第一照射参数信息下,针对任一虚拟对象,其他虚拟对象对该虚拟对象的受光参数的影响信息。也即,在虚拟光源的影响下,虚拟对象之间会产生互相之间的光照影响。
此处,虚拟对象包括至少一个虚拟角色以及至少一个虚拟物品。也就是说,在虚拟对象之间产生互相的光照影响时,可以是两个不同的虚拟物品之间产生了互相的光照影响,或者是两个不同的虚拟角色之间产生了互相的光照影响,或者也可以是一个虚拟角色与一个虚拟物品之间产生了互相的光照影响。
另外,受光参数用于表示受到其他虚拟对象光照影响的虚拟对象,相对应的受光影响范围,以及在受光影响范围内的受光影响强度和受光颜色中至少一种。
具体地,在两个虚拟对象之间的距离较近时,可能会出现产生互相的光照影响的现象。其中,两个虚拟对象的位姿会影响受光影响范围,例如包括两个虚拟对象相对站立时,两个虚拟对象的受光影响范围在各自的前身位置;而虚拟角色并肩站立时,受光影响范围则在二者接近的身侧位置。另外,在二者之间的距离越近时,受光影响范围就越大,受光影响强度也越大,显示出的受光颜色的亮度也越高。
在具体实施中,参见图3所示,为本公开实施例提供的一种确定第一虚拟对象和第二虚拟对象之间的光照影响信息的具体流程图;其中,
S301:基于所述第一虚拟对象在所述虚拟场景中的第一位姿信息、以及所述第二虚拟对象在所述虚拟场景中的第二位姿信息,确定所述第一虚拟对象与所述第二虚拟对象之间的第一相对位姿关系。
其中,为了可以确定出在虚拟场景中第一虚拟对象和第二虚拟对象分别对应的位姿信息,例如可以为虚拟场景确定对应的场景坐标系。在构建场景坐标系时,在一种可能的情况下,由于虚拟场景对应于现实场景,因此可以利用现实场景对应的世界坐标系,确定虚拟场景的场景坐标系。或者,在另一种可能的情况下,由于虚拟场景是根据场景图像构建的,因此也可以根据采集场景图像的图像采集设备对应的相机坐标系,相应的确定虚拟场景的场景坐标系。
在确定场景坐标系后,即可以确定虚拟对象中的第一虚拟对象在虚拟场景中的第一位姿信息,以及第二虚拟对象在虚拟场景中的第二位姿信息。其中,位姿信息可以反应虚拟对象在虚拟场景中的位置信息和姿态信息。由于第一位姿信息和第二位姿信息是在同一场景坐标系下确定的,因此可以利用第一位姿信息和第二位姿信息确定第一虚拟对象和第二虚拟对象之间的第一相对位姿关系。根据上述对受光参数的说明可以知道,根据两个虚拟对象之间的相对位姿关系,即可以判断出相应的受光参数,从而确定第一虚拟对象和第二虚拟对象之间的光照影响信息。
S302:基于所述第一相对位姿关系和所述虚拟光源的照射参数信息,确定所述第二虚拟对象对所述第一虚拟对象产生影响的第一受光影响范围和第一受光影响强度、以及所述第一虚拟对象对所述第二虚拟对象产生影响的第二受光影响范围和第二受光影响强度。
首先,对确定虚拟对象的受光影响范围进行说明。对于虚拟对象中互相之间可以产生光照影响的第一虚拟对象和第二虚拟对象,根据第一相对位姿关系,可以确定二者较为靠近的部分。以第一虚拟对象为虚拟角色,第二虚拟对象为虚拟物品为例,若第二虚拟对象为桌子,虚拟对象站在桌子的一边,则根据第一相对位姿关系,可以确定第一虚拟对象的左腰侧靠近第二虚拟对象的桌面右边缘位置,并且二者之间的距离较近。因此,可以确定出第二虚拟对象对第一虚拟对象产生影响的第一受光影响范围为:第一虚拟对象的左腰侧范围;并可以确定出第一虚拟对象对第二虚拟对象产生影响的第二受光影响范围为:第二虚拟对象的桌面右边缘范围。
另外,与现实中的显示逻辑相似的,确定的受光影响范围的形状,与虚拟对象产生光照影响的部分的形状相关,例如在第一虚拟对象的左腰侧范围,被第二虚拟对象的桌面右边缘范围影响的受光影响范围展示出方形;在第二虚拟对象的桌面右边缘,被第一虚拟对象的左腰侧范围影响的受光影响范围展示出椭圆形。
示例性的,参见图4所示,为本公开实施例提供的一种虚拟对象在相互产生光照影响时的示意图。其中,图4中(a)示出了第一虚拟对象和第二虚拟对象,第一虚拟对象为虚拟角色,第二虚拟对象为虚拟物品,虚拟角色站在桌面的右侧。图4中(b)单独示出了在虚拟角色上受桌面的影响而确定出的第一受光影响范围41,以虚线表示;以及在桌面上的受虚拟角色的影响确定出的第二受光影响范围42,同样利用虚线表示。
其次,对在受光影响范围内的受光影响强度进行说明。在确定第一相对位姿关系后,可以根据第一相对位姿关系中反映出的第一虚拟对象的第一受光范围,与第二虚拟对象的第二受光范围之间的距离,确定第一虚拟对象的第一受光影响强度、以及第二虚拟对象的第二受光影响强度。具体地,可以利用可以产生光照影响的最远距离确定多个区间,在不同的距离区间中确定的受光影响强度不同。例如,最远距离为15厘米,可以划分为三个区间,例如第一相对位姿关系表征的最远距离在8厘米至15厘米之间时,受光影响强度最弱;最远距离在5厘米至8厘米之间时,受光影响强度较强;最远距离小于5厘米时,受光影响强度最强。
另外,受光影响强度也受到虚拟光源的照射参数信息的影响,例如,在虚拟光源的光源强度本身就较弱的情况下,则虚拟对象的受光影响强度也会相应的减弱;若虚拟光源的光源强度较强,则虚拟对象的受光影响强度也会相应的增强。
S303:基于所述第二虚拟对象在所述第二受光影响范围内的对象部分的第一颜色信息、所述第一受光影响强度、和所述虚拟光源的第一照射参数信息,确定所述第一虚拟对象在所述第一受光影响范围内的第一受光颜色;以及,基于所述第一虚拟对象在所述第一受光影响范围内的对象部分的第二颜色信息、所述第二受光影响强度、和所述虚拟光源的第一照射参数信息,确定所述第二虚拟对象在所述第二受光影响范围内的第二受光颜色。
在该步骤中,受光颜色由虚拟对象在受光影响范围内的颜色信息确定。由于为第一虚拟对象确定第一受光颜色的方式,与为第二虚拟对象确定第二受光颜色的方式相似,因此下面以确定第一虚拟对象的第一受光颜色的方式进行详细说明。
由于第一虚拟对象在第一受光范围内,会存在受光颜色上的影响,因此确定的第一受光颜色为第一受光影响范围内的受光颜色。另外,影响第一受光颜色的因素,包括影响第一虚拟对象的第二虚拟对象在第二受光影响范围内的对象部分的第一颜色信息、第一受光影响强度、以及虚拟光源的照射参数信息。
承接上述S302中的示例,第一虚拟对象为虚拟角色,第二受光影响范围为第二虚拟对象的桌面右边缘范围,若桌子为红木色,并且在第二受光影响范围内的桌子部分也为红木色,则第一颜色信息包括红木色。在桌面右边缘范围影响虚拟角色的左腰侧范围时,会使左腰侧范围中显示出红木色。
而实际在虚拟角色的左腰侧范围中显示红木色时,也相应的受到第一受光影响强度的影响,例如受光影响强度越强,显示出的红木色的亮度越高,或者可以越清楚的展示出红木色。另外,虚拟光源的第一照射参数信息也会对第一受光颜色产生影响,在第一照射参数信息反映光源强度较强时,第一受光颜色可以表现出更明亮的效果;而在第一照射参数信息反映光源强度较弱时,第一受光颜色可以表现出更昏暗的效果。
确定第二受光颜色的方式可以参见上述确定第一受光颜色的说明,在此不再重复赘述。
在本公开另一实施例中,在确定不同虚拟对象之间的光照影响信息之前,虚拟对象还可以受到虚拟光源的光照影响,产生相应的光影效果。
在具体实施中,参见图5所示,为本公开实施例提供的一种确定在虚拟光源下的受光参数的流程图;其中,
S501:基于所述第一照射参数信息、以及各个所述虚拟对象分别对应的位姿信息,确定所述虚拟光源与各个所述虚拟对象之间的第二相对位姿关系。
其中,确定第二相对位姿关系的方式,可以参见对图3中S301的说明,具体在此不再重复赘述。利用第二相对位姿关系,即可以判断出虚拟光源在照射每个虚拟对象时,虚拟对象的受光范围、初始受光强度和受光颜色。
S502:基于所述虚拟光源与每个所述虚拟对象之间的第二相对位姿关系,确定所述虚拟光源在照射每个虚拟对象时,该虚拟对象的受光范围以及在所述受光范围内的初始受光强度;所述初始受光强度是指在未受到其它虚拟对象影响情况下的受光强度。
首先,对虚拟对象的受光范围进行说明。根据上述S501中确定的第二相对位姿关系,可以确定虚拟光源在照射虚拟对象时的光照方向。以虚拟对象为虚拟角色为例,根据虚拟光源与虚拟角色之间的相对位姿关系,例如可以确定虚拟光源仅能照射到虚拟角色的前身,也即虚拟对象的受光范围为前身。
其次,对虚拟对象的初始受光强度进行说明。在未受到其他虚拟对象的光照影响前,仅有虚拟光源对虚拟对象的影响。在该种情况下,若虚拟光源与虚拟对象之间的距离较远,则虚拟对象初始受光强度较低;若虚拟光源与虚拟对象之间的距离较近,则虚拟对象初始受光强度较高。
S503:基于所述受光强度以及所述第一照射参数信息,确定每个所述虚拟对象在对应的受光范围内的初始受光颜色;所述初始受光颜色是指在未受到其它虚拟对象影响情况下的受光颜色。
具体地,在确定受光范围的情况下,由于虚拟光源本身具有光源颜色,因此虚拟对象在受光范围内会被光源颜色影响,而呈现与对象部分本身的颜色相异的颜色,这样显示出的颜色也即初始受光颜色。这种现象类似于在现实场景中,由于衣物处于不同的环境中而产生的色差。通过受光强度,可以确定初始受光颜色由于光源颜色而产生的显示差异。例如,在受光强度较强时,光源颜色的影响较大;在受光强度较弱时,光源颜色的影响较小。
针对上述S103,在根据上述S102确定了不同虚拟对象之间的光照影响信息后,可以基于光照影响信息,确定虚拟场景中各个虚拟对象的在虚拟光源中的展示效果,例如在上述S102中说明的在其他虚拟对象或者虚拟光源的光照影响下的展示效果。
在一种可能的情况下,若虚拟对象未受到其它虚拟对象的光照影响,在确定虚拟角色的展示效果时,例如可以呈现虚拟对象仅在虚拟光源下产生的光照影响。在具体实施中,可以根据上述虚拟光源下的受光参数中包含的各个虚拟对象的初始受光强度和初始受光颜色、以及光照影响信息,可以确定出虚拟场景中对各个虚拟对象在虚拟光源下的展示效果。
在另一种可能的情况下,若虚拟对象受到其他虚拟对象和虚拟光源的光照影响,则可以直接根据光照影响信息,确定出虚拟对象在虚拟光源下的展示效果。
在又一种可能的情况下,为了使展示效果更加丰富,还可以在展示虚拟对象时额外添加场景特效。具体地,可以基于所述光照影响信息、以及为所述虚拟场景生成的场景特效数据,确定在所述虚拟场景中各个所述虚拟对象在所述虚拟光源下的展示效果。其中,场景特效数据包括下述至少一种:雨雪特效数据、结冰特效数据、风场特效数据、雾气特效数据、落叶特效数据、追光灯特效数据。
其中,在确定额外添加的场景特效时,例如可以响应于虚拟角色控制对象的选取,确定添加展示的场景特效。另外,在直播场景中,也可以响应于观看直播的用户的选择,以确定在用户端展示的场景特效,具体可以根据实际情况确定,在此并不做出限定。
这样,通过展示出不同的场景特效,可以表达出更多样的场景,例如雨雪特效等表达出的户外场景,或者落叶特效等表达出的不同季节的场景,或者利用追光灯等表达出的舞台场景等。由于虚拟场景对应于真实场景,而真实场景实际可以表达的信息有限,例如真实场景包括酒吧,则对应构建的虚拟场景也仅能同样地表达出酒吧的信息。通过添加额外的场景特效则可以相应的使虚拟场景产生额外的场景表达。例如,添加追光灯特效,则可以在表达酒吧的虚拟场景中,确定虚拟角色可以进行唱歌表演的舞台区域,也即在酒吧对应的虚拟场景中额外可以添加出舞台场景。
针对上述S104,在根据确定的展示效果对各个虚拟对象进行渲染,以展示虚拟场景信息时,具体可以选取AR技术进行展示,也可以选取VR技术进行展示。
在一种可能的情况下,若采用AR技术展示虚拟场景信息,也即最终显示出的效果为在采集得到的场景图像中叠加显示出了虚拟对象。因此可以仅渲染显示出虚拟场景中的虚拟对象,但并不会显示出通过三维空间重建得到的与现实场景一致的其他场景内容。其中,虚拟对象包括并不真实存在于现实场景中的虚拟对象,以及在虚拟场景中与真实场景中实际存在的部分物品对应的物品模型。例如,若在真实场景中存在某一物品,但其在虚拟场景中对应的物品模型会受到虚拟对象、或者虚拟光源的光照影响,则这个物品对应的物品模型也包括在虚拟对象之中。
在具体实施中,可以基于确定的所述展示效果对各个所述虚拟对象进行渲染,并将渲染后的所述各个所述虚拟对象叠加在所述现实场景的场景图像中进行AR展示。
而对于其他在真实场景中存在的物品,其在虚拟场景中也可以具有对应的虚拟模型,但由于这些虚拟模型并不受到其他虚拟对象或者虚拟光源的光照影响,其在展示时例如可以以“透明”的状态进行显示。
这样,在将虚拟对象叠加在现实场景的场景图像中进行展示时,可以展示出其中的虚拟对象,以及现实场景中存在的物品,由于相同的光源而产生的影响,以及虚拟对象与现实场景中存在的物品之间相互产生光照影响的效果,因此可以在展示时更具有真实性。
示例性的,参见图6所示,为本公开实施例提供的一种通过AR展示的方式展示虚拟场景信息的示意图。相较于图2中示出的场景图像,在图6中的虚拟光源设置为灰色的灯光,因此整体画面呈现出灰色。而其中的桌子与虚拟角色之间具有相互的光照影响,因此具有更暗的受光影响区域。
在另一种可能的情况下,若采用VR技术展示虚拟场景信息,则可以基于确定的所述展示效果对所述虚拟场景中的各个所述虚拟对象进行实时渲染,得到实时渲染后的虚拟场景图像;采用实时渲染后的虚拟场景图像替换当前获取的所述现实场景的场景图像,以进行虚拟现实VR场景的实时展示。
其中,得到的虚拟场景图像类似于真实场景图像,为完整的图像,并可以表达出真实场景的当前信息。该过程为实时展示的过程,也即显示出的虚拟场景图像通过实时渲染,可以表达现实场景的当前状态信息。若现实场景的场景图像随时间发生变化,则相应在实时渲染 后的虚拟场景图像也表达出同步的跟随时间产生变化的图像。另外,在虚拟场景图像上,也包括了虚拟对象、以及虚拟对象受到光照影响后的光影信息。
在这种方式下,可以将生成的虚拟场景图像直接进行展示。由于虚拟场景图像也可以表达真实场景的当前信息,因此也可以保证在展示时的真实性。
本公开实施例提供的渲染显示方法,在构建虚拟场景后,可以通过虚拟光源的照射参数信息、以及各个虚拟对象在虚拟场景中的位姿信息,判断在虚拟光源的照射下,各个虚拟对象之间是否具有光照影响,并相应的确定不同虚拟对象之间的光照影响信息,以确定各个虚拟对象在虚拟光源下的展示效果并进行渲染显示。这样,在渲染显示虚拟对象时补充了虚拟对象之间产生的相互光照影响的细节,更符合在现实情况下的显示逻辑,可以使渲染显示时的真实性更强。
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。
基于同一发明构思,本公开实施例中还提供了与渲染显示方法对应的渲染显示装置,由于本公开实施例中的装置解决问题的原理与本公开实施例上述渲染显示方法相似,因此装置的实施可以参见方法的实施,重复之处不再赘述。
参照图7所示,为本公开实施例提供的一种渲染显示装置的示意图,所述装置包括:获取模块71、第一确定模块72、第二确定模块73、以及显示模块74;其中,
获取模块71,用于获取现实场景的场景图像,并基于所述场景图像构建所述虚拟场景,在所述虚拟场景中包含虚拟光源和多个虚拟对象;
第一确定模块72,用于基于所述虚拟光源在所述虚拟场景中的第一照射参数信息、以及各个所述虚拟对象在所述虚拟场景中的位姿信息,确定不同虚拟对象之间的光照影响信息;所述光照影响信息包括:在所述第一照射参数信息下,针对至少一个虚拟对象,其它所述虚拟对象对所述至少一个虚拟对象的受光参数的影响信息;
第二确定模块73,用于基于所述光照影响信息,确定所述虚拟场景中对各个所述虚拟对象在所述虚拟光源下的展示效果;
显示模块74,用于基于确定的所述展示效果对各个所述虚拟对象进行渲染,以展示所述虚拟场景信息。
一种可选的实施方式中,所述显示模块74在基于确定的所述展示效果对各个所述虚拟对象进行渲染,以展示所述虚拟场景信息时,用于:基于确定的所述展示效果对各个所述虚拟对象进行渲染,并将渲染后的所述各个所述虚拟对象叠加在所述现实场景的场景图像中进行增强现实AR展示。
一种可选的实施方式中,所述显示模块74在基于确定的所述展示效果对各个所述虚拟对象进行渲染,以展示所述虚拟场景信息时,用于:基于确定的所述展示效果对所述虚拟场景中的各个所述虚拟对象进行实时渲染,得到实时渲染后的虚拟场景图像;采用实时渲染后的虚拟场景图像替换当前获取的所述现实场景的场景图像,以进行虚拟现实VR场景的实时展示。
一种可选的实施方式中,所述虚拟光源在所述虚拟场景中的第一照射参数信息,包括下述至少一种:所述虚拟光源在所述虚拟场景中的设置高度,设置角度,光源辐射范围,光源颜色,光源强度。
一种可选的实施方式中,所述虚拟光源在所述虚拟场景中的第一照射参数信息为根据以下步骤确定的:基于所述场景图像,确定在所述现实场景中的真实光源对应的第二照射参数信息;基于所述第二照射参数信息,确定所述第一照射参数信息。
一种可选的实施方式中,所述虚拟光源在所述虚拟场景中的第一照射参数信息为根据以下步骤确定的:根据所述虚拟场景中包含的各个所述虚拟对象的属性特征,确定所述虚拟光源在所述虚拟场景中的第一照射参数信息。
一种可选的实施方式中,所述受光参数包括所述虚拟对象的受光影响范围、以及在所述受光影响范围内的受光影响强度和受光颜色中至少一种;针对在所述虚拟对象中相互之间产生光照影响的第一虚拟对象和第二虚拟对象,所述第一确定模块72根据以下步骤确定所述第一虚拟对象和所述第二虚拟对象之间的光照影响信息:基于所述第一虚拟对象在所述虚拟场景中的第一位姿信息、以及所述第二虚拟对象在所述虚拟场景中的第二位姿信息,确定所述第一虚拟对象与所述第二虚拟对象之间的第一相对位姿关系;基于所述第一相对位姿关系和所述虚拟光源的照射参数信息,确定所述第二虚拟对象对所述第一虚拟对象产生影响的第一受光影响范围和第一受光影响强度、以及所述第一虚拟对象对所述第二虚拟对象产生影响的第二受光影响范围和第二受光影响强度;基于所述第二虚拟对象在所述第二受光影响范围内的对象部分的第一颜色信息、所述第一受光影响强度、和所述虚拟光源的第一照射参数信息,确定所述第一虚拟对象在所述第一受光影响范围内的第一受光颜色;以及,基于所述第一虚拟对象在所述第一受光影响范围内的对象部分的第二颜色信息、所述第二受光影响强度、和所述虚拟光源的第一照射参数信息,确定所述第二虚拟对象在所述第二受光影响范围内的第二受光颜色。
一种可选的实施方式中,所述第一虚拟对象为虚拟角色,所述第二虚拟对象为虚拟物品;或者,所述第一虚拟对象为虚拟物品,所述第二虚拟对象为虚拟角色;或者,所述第一虚拟对象和所述第二虚拟对象都为虚拟角色;或者,所述第一虚拟对象和所述第二虚拟对象都为虚拟物品。
一种可选的实施方式中,所述受光参数包括所述虚拟对象的受光范围、以及在所述受光范围内的受光强度和初始受光颜色中至少一种;在基于所述虚拟光源在所述虚拟场景中的第一照射参数信息、以及各个所述虚拟对象在所述虚拟场景中的位姿信息,确定不同虚拟对象之间的光照影响信息之前,所述第一确定模块72还用于:基于所述第一照射参数信息、以及各个所述虚拟对象分别对应的位姿信息,确定所述虚拟光源与各个所述虚拟对象之间的第二相对位姿关系;基于所述虚拟光源与每个所述虚拟对象之间的第二相对位姿关系,确定所述虚拟光源在照射每个所述虚拟对象时,每个所述虚拟对象的受光范围以及在所述受光范围内的初始受光强度;所述初始受光强度是指在未受到其它所述虚拟对象影响的情况下的受光强度;基于所述受光强度以及所述第一照射参数信息,确定每个所述虚拟对象在对应的受光范围内的初始受光颜色;所述初始受光颜色是指在未受到其它所述虚拟对象影响的情况下的受光颜色;所述第二确定模块73在基于所述光照影响信息,确定所述虚拟场景中对各个所述虚 拟对象在所述虚拟光源下的展示效果时,用于:基于所述光照影响信息,以及各个所述虚拟对象的所述初始受光强度和初始受光颜色,确定所述虚拟场景中对各个所述虚拟对象在所述虚拟光源下的展示效果。
一种可选的实施方式中,所述第二确定模块73在基于所述光照影响信息,确定所述虚拟场景中对各个所述虚拟对象在所述虚拟光源下的展示效果时,用于:基于所述光照影响信息、以及为所述虚拟场景生成的场景特效数据,确定在所述虚拟场景中各个所述虚拟对象在所述虚拟光源下的展示效果。
一种可选的实施方式中,所述场景特效数据包括下述至少一种:雨雪特效数据、结冰特效数据、风场特效数据、雾气特效数据、落叶特效数据、追光灯特效数据。
一种可选的实施方式中,所述获取模块71在基于所述场景图像构建所述虚拟场景时,用于:利用同步定位与建图SLAM对所述场景图像进行三维空间重建,得到构建的所述虚拟场景。
关于装置中的各模块的处理流程、以及各模块之间的交互流程的描述可以参照上述方法实施例中的相关说明,这里不再详述。
本公开实施例还提供了一种计算机设备,如图8所示,为本公开实施例提供的计算机设备的结构示意图,包括:
处理器10和存储器20;所述存储器20存储有处理器10可执行的机器可读指令,处理器10用于执行存储器20中存储的机器可读指令,所述机器可读指令被处理器10执行时,处理器10执行下述步骤:
获取现实场景的场景图像,并基于所述场景图像构建所述虚拟场景,所述虚拟场景中包含虚拟光源和多个虚拟对象;基于所述虚拟光源在所述虚拟场景中的第一照射参数信息、以及各个所述虚拟对象在所述虚拟场景中的位姿信息,确定不同虚拟对象之间的光照影响信息;所述光照影响信息包括:在所述第一照射参数信息下,针对至少一个虚拟对象,其它虚拟对象对所述至少一个虚拟对象的受光参数的影响信息;基于所述光照影响信息,确定所述虚拟场景中对各个所述虚拟对象在所述虚拟光源下的展示效果;基于确定的所述展示效果对各个所述虚拟对象进行渲染,以展示所述虚拟场景信息。
上述存储器20包括内存210和外部存储器220;这里的内存210也称内存储器,用于暂时存放处理器10中的运算数据,以及与硬盘等外部存储器220交换的数据,处理器10通过内存210与外部存储器220进行数据交换。
上述指令的具体执行过程可以参考本公开实施例中所述的渲染显示方法的步骤,此处不再赘述。
本公开实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述方法实施例中所述的渲染显示方法的步骤。其中,该存储介质可以是易失性或非易失性的计算机可读取存储介质。
本公开实施例还提供一种计算机程序产品,该计算机程序产品承载有程序代码,所述程序代码包括的指令可用于执行上述方法实施例中所述的渲染显示方法的步骤,具体可参见上述方法实施例,在此不再赘述。
其中,上述计算机程序产品可以具体通过硬件、软件或其结合的方式实现。在一个可选实施例中,所述计算机程序产品具体体现为计算机存储介质,在另一个可选实施例中,计算机程序产品具体体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。
本公开实施例还提供一种计算机程序,该计算机程序被处理器运行时执行上述方法实施例中所述的渲染显示方法的步骤。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统和装置的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。在本公开所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,又例如,多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些通信接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本公开各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个处理器可执行的非易失的计算机可读取存储介质中。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是:以上所述实施例,仅为本公开的具体实施方式,用以说明本公开的技术方案,而非对其限制,本公开的保护范围并不局限于此,尽管参照前述实施例对本公开进行了详细的说明,本领域的普通技术人员应当理解:任何熟悉本技术领域的技术人员在本公开揭露的技术范围内,其依然可以对前述实施例所记载的技术方案进行修改或可轻易想到变化,或者对其中部分技术特征进行等同替换;而这些修改、变化或者替换,并不使相应技术方案的本质脱离本公开实施例技术方案的精神和范围,都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应以所附权利要求的保护范围为准。

Claims (17)

  1. 一种渲染显示方法,用于显示虚拟场景信息;其中,在所述虚拟场景信息对应的虚拟场景中包含虚拟光源和多个虚拟对象;所述方法包括:
    获取现实场景的场景图像,并基于所述场景图像构建所述虚拟场景;
    基于所述虚拟光源在所述虚拟场景中的第一照射参数信息、以及各个所述虚拟对象在所述虚拟场景中的位姿信息,确定不同虚拟对象之间的光照影响信息;所述光照影响信息包括:在所述第一照射参数信息下,针对至少一个虚拟对象,其它虚拟对象对所述至少一个虚拟对象的受光参数的影响信息;
    基于所述光照影响信息,确定所述虚拟场景中对各个所述虚拟对象在所述虚拟光源下的展示效果;
    基于确定的所述展示效果对各个所述虚拟对象进行渲染,以展示所述虚拟场景信息。
  2. 根据权利要求1所述的渲染显示方法,其中,所述基于确定的所述展示效果对各个所述虚拟对象进行渲染,以展示所述虚拟场景信息,包括:
    基于确定的所述展示效果对各个所述虚拟对象进行渲染,并将渲染后的所述各个所述虚拟对象叠加在所述现实场景的场景图像中进行增强现实AR展示。
  3. 根据权利要求2所述的渲染显示方法,其中,所述基于确定的所述展示效果对各个所述虚拟对象进行渲染,以展示所述虚拟场景信息,包括:
    基于确定的所述展示效果对所述虚拟场景中的各个所述虚拟对象进行实时渲染,得到实时渲染后的虚拟场景图像;
    采用实时渲染后的虚拟场景图像替换当前获取的所述现实场景的场景图像,以进行虚拟现实VR场景的实时展示。
  4. 根据权利要求1至3中任一项所述的渲染显示方法,其中,所述虚拟光源在所述虚拟场景中的第一照射参数信息,包括下述至少一种:
    所述虚拟光源在所述虚拟场景中的设置高度,设置角度,光源辐射范围,光源颜色,光源强度。
  5. 根据权利要求4所述的渲染显示方法,其中,所述虚拟光源在所述虚拟场景中的第一照射参数信息为根据以下步骤确定的:
    基于所述场景图像,确定在所述现实场景中的真实光源对应的第二照射参数信息;
    基于所述第二照射参数信息,确定所述第一照射参数信息。
  6. 根据权利要求4所述的渲染显示方法,其中,所述虚拟光源在所述虚拟场景中的第一照射参数信息为根据以下步骤确定的:
    根据所述虚拟场景中包含的各个所述虚拟对象的属性特征,确定所述虚拟光源在所述虚拟场景中的第一照射参数信息。
  7. 根据权利要求1至6中任一项所述的渲染显示方法,其中,所述受光参数包括所述虚拟对象的受光影响范围、以及在所述受光影响范围内的受光影响强度和受光颜色中至少一种;
    针对在所述虚拟对象中相互之间产生光照影响的第一虚拟对象和第二虚拟对象,根据以下步骤确定所述第一虚拟对象和所述第二虚拟对象之间的光照影响信息:
    基于所述第一虚拟对象在所述虚拟场景中的第一位姿信息、以及所述第二虚拟对象在所 述虚拟场景中的第二位姿信息,确定所述第一虚拟对象与所述第二虚拟对象之间的第一相对位姿关系;
    基于所述第一相对位姿关系和所述虚拟光源的照射参数信息,确定所述第二虚拟对象对所述第一虚拟对象产生影响的第一受光影响范围和第一受光影响强度、以及所述第一虚拟对象对所述第二虚拟对象产生影响的第二受光影响范围和第二受光影响强度;
    基于所述第二虚拟对象在所述第二受光影响范围内的对象部分的第一颜色信息、所述第一受光影响强度、和所述虚拟光源的第一照射参数信息,确定所述第一虚拟对象在所述第一受光影响范围内的第一受光颜色;以及,基于所述第一虚拟对象在所述第一受光影响范围内的对象部分的第二颜色信息、所述第二受光影响强度、和所述虚拟光源的第一照射参数信息,确定所述第二虚拟对象在所述第二受光影响范围内的第二受光颜色。
  8. 根据权利要求7所述的渲染显示方法,其中,所述第一虚拟对象为虚拟角色,所述第二虚拟对象为虚拟物品;或者,所述第一虚拟对象为虚拟物品,所述第二虚拟对象为虚拟角色;或者,所述第一虚拟对象和所述第二虚拟对象都为虚拟角色;或者,所述第一虚拟对象和所述第二虚拟对象都为虚拟物品。
  9. 根据权利要求1至8中任一项所述的渲染显示方法,其中,所述受光参数包括所述虚拟对象的受光范围、以及在所述受光范围内的受光强度和初始受光颜色中至少一种;
    在基于所述虚拟光源在所述虚拟场景中的第一照射参数信息、以及各个所述虚拟对象在所述虚拟场景中的位姿信息,确定不同虚拟对象之间的光照影响信息之前,还包括:
    基于所述第一照射参数信息、以及各个所述虚拟对象分别对应的位姿信息,确定所述虚拟光源与各个所述虚拟对象之间的第二相对位姿关系;
    基于所述虚拟光源与每个所述虚拟对象之间的第二相对位姿关系,确定所述虚拟光源在照射每个所述虚拟对象时,每个所述虚拟对象的受光范围以及在所述受光范围内的初始受光强度;所述初始受光强度为在未受到其它所述虚拟对象影响的情况下的受光强度;
    基于所述受光强度以及所述第一照射参数信息,确定每个所述虚拟对象在对应的受光范围内的初始受光颜色;所述初始受光颜色为在未受到其它所述虚拟对象影响的情况下的受光颜色;
    所述基于所述光照影响信息,确定所述虚拟场景中对各个所述虚拟对象在所述虚拟光源下的展示效果,包括:
    基于所述光照影响信息,以及各个所述虚拟对象的所述初始受光强度和初始受光颜色,确定所述虚拟场景中对各个所述虚拟对象在所述虚拟光源下的展示效果。
  10. 根据权利要求1至9中任一项所述的渲染显示方法,其中,所述基于所述光照影响信息,确定所述虚拟场景中对各个所述虚拟对象在所述虚拟光源下的展示效果,包括:
    基于所述光照影响信息、以及为所述虚拟场景生成的场景特效数据,确定在所述虚拟场景中各个所述虚拟对象在所述虚拟光源下的展示效果。
  11. 根据权利要求10所述的渲染显示方法,其中,所述场景特效数据包括下述至少一种:雨雪特效数据、结冰特效数据、风场特效数据、雾气特效数据、落叶特效数据、追光灯特效数据。
  12. 根据权利要求1至11中任一项所述的渲染显示方法,其中,所述基于所述场景图像 构建所述虚拟场景,包括:
    利用同步定位与建图SLAM对所述场景图像进行三维空间重建,得到构建的所述虚拟场景。
  13. 一种渲染显示装置,包括:
    获取模块,用于获取现实场景的场景图像,并基于所述场景图像构建虚拟场景,在所述虚拟场景中包含虚拟光源和多个虚拟对象;
    第一确定模块,用于基于所述虚拟光源在所述虚拟场景中的第一照射参数信息、以及各个所述虚拟对象在所述虚拟场景中的位姿信息,确定不同虚拟对象之间的光照影响信息;所述光照影响信息包括:在所述第一照射参数信息下,针对至少一个虚拟对象,其它所述虚拟对象对所述至少一个虚拟对象的受光参数的影响信息;
    第二确定模块,用于基于所述光照影响信息,确定所述虚拟场景中对各个所述虚拟对象在所述虚拟光源下的展示效果;
    显示模块,用于基于确定的所述展示效果对各个所述虚拟对象进行渲染,以展示所述虚拟场景信息。
  14. 一种计算机设备,包括:处理器、存储器,所述存储器存储有所述处理器可执行的机器可读指令,所述处理器用于执行所述存储器中存储的机器可读指令,所述机器可读指令被所述处理器执行时,所述处理器执行如权利要求1至12中任一项所述的渲染显示方法的步骤。
  15. 一种计算机可读存储介质,其中,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被计算机设备运行时,所述计算机设备执行如权利要求1至12中任一项所述的渲染显示方法的步骤。
  16. 一种计算机程序产品,其中,所述计算机程序产品承载有程序代码,所述程序代码包括的指令被处理器运行时执行如权利要求1至12中任一项所述的渲染显示方法的步骤。
  17. 一种计算机程序,其中,所述计算机程序被处理器运行时执行如权利要求1至12中任一项所述的渲染显示方法的步骤。
PCT/CN2022/136375 2021-12-23 2022-12-02 一种渲染显示方法、装置、计算机设备及存储介质 Ceased WO2023116396A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111593935.1A CN114385289B (zh) 2021-12-23 2021-12-23 一种渲染显示方法、装置、计算机设备及存储介质
CN202111593935.1 2021-12-23

Publications (1)

Publication Number Publication Date
WO2023116396A1 true WO2023116396A1 (zh) 2023-06-29

Family

ID=81197309

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/136375 Ceased WO2023116396A1 (zh) 2021-12-23 2022-12-02 一种渲染显示方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN114385289B (zh)
WO (1) WO2023116396A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117424970A (zh) * 2023-10-23 2024-01-19 神力视界(深圳)文化科技有限公司 灯光控制方法、装置、移动终端及存储介质

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114385289B (zh) * 2021-12-23 2024-01-23 北京字跳网络技术有限公司 一种渲染显示方法、装置、计算机设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107705353A (zh) * 2017-11-06 2018-02-16 太平洋未来科技(深圳)有限公司 应用于增强现实的虚拟对象光影效果的渲染方法和装置
CN107845132A (zh) * 2017-11-03 2018-03-27 太平洋未来科技(深圳)有限公司 虚拟对象色彩效果的渲染方法和装置
CN110310356A (zh) * 2019-06-26 2019-10-08 北京奇艺世纪科技有限公司 一种场景渲染方法和装置
US20200380790A1 (en) * 2019-06-03 2020-12-03 Eidos Interactive Corp. Systems and methods for augmented reality applications
CN114385289A (zh) * 2021-12-23 2022-04-22 北京字跳网络技术有限公司 一种渲染显示方法、装置、计算机设备及存储介质

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107025683A (zh) * 2017-03-30 2017-08-08 联想(北京)有限公司 一种信息处理方法及电子设备
CN110503711B (zh) * 2019-08-22 2023-02-21 三星电子(中国)研发中心 在增强现实中渲染虚拟物体的方法及装置
CN113313622A (zh) * 2021-04-26 2021-08-27 广州三七互娱科技有限公司 虚拟场景中的光照模拟方法、装置及电子设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107845132A (zh) * 2017-11-03 2018-03-27 太平洋未来科技(深圳)有限公司 虚拟对象色彩效果的渲染方法和装置
CN107705353A (zh) * 2017-11-06 2018-02-16 太平洋未来科技(深圳)有限公司 应用于增强现实的虚拟对象光影效果的渲染方法和装置
US20200380790A1 (en) * 2019-06-03 2020-12-03 Eidos Interactive Corp. Systems and methods for augmented reality applications
CN110310356A (zh) * 2019-06-26 2019-10-08 北京奇艺世纪科技有限公司 一种场景渲染方法和装置
CN114385289A (zh) * 2021-12-23 2022-04-22 北京字跳网络技术有限公司 一种渲染显示方法、装置、计算机设备及存储介质

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117424970A (zh) * 2023-10-23 2024-01-19 神力视界(深圳)文化科技有限公司 灯光控制方法、装置、移动终端及存储介质

Also Published As

Publication number Publication date
CN114385289A (zh) 2022-04-22
CN114385289B (zh) 2024-01-23

Similar Documents

Publication Publication Date Title
US10380803B1 (en) Methods and systems for virtualizing a target object within a mixed reality presentation
US9659381B2 (en) Real time texture mapping for augmented reality system
CN105278905B (zh) 显示具有视觉效果的对象的装置和方法
AU2012352273B2 (en) Display of shadows via see-through display
US11087529B2 (en) Introducing real-time lighting effects to illuminate real-world physical objects in see-through augmented reality displays
CN115016642A (zh) 用于混合现实的现实混合器
JP2020526860A (ja) トレーニングデータの生成方法、生成装置及びその画像のセマンティックセグメンテーション方法
CN111145330A (zh) 人体模型渲染方法、装置、电子设备及存储介质
CN109255841A (zh) Ar图像呈现方法、装置、终端及存储介质
US11818325B2 (en) Blended mode three dimensional display systems and methods
WO2023116396A1 (zh) 一种渲染显示方法、装置、计算机设备及存储介质
CN119919569A (zh) 混合现实中的实时合成
CN115049803A (zh) 增强现实画面的展示方法、装置、计算机设备及存储介质
CN111862866A (zh) 图像显示方法、装置、设备及计算机可读存储介质
EP3652617A1 (en) Mixed reality object rendering based on ambient light conditions
Nóbrega et al. Nari: Natural augmented reality interface-interaction challenges for ar applications
WO2019228969A1 (en) Displaying a virtual dynamic light effect
KR102197504B1 (ko) 사전 계산된 조명으로 증강 현실 환경을 구성하는 기법
US20250126227A1 (en) Two-dimensional video presented in three-dimensional environment
CN117726405A (zh) 产品详情页的生成方法、装置、电子设备及存储介质
Zhang Developing an augmented reality framework with embedded objects and adaptive optical models for advanced lighting simulation: Q. Zhang
Weng et al. Graphics, Audio-visuals and Interaction (GAI) based handheld augmented reality system
CN114758041A (zh) 虚拟对象展示方法、装置、电子设备及存储介质
Schmidt Blended spaces: perception and interaction in projection-based spatial augmented reality environments
KR102854027B1 (ko) 시뮬레이터를 이용한 조명기기 배치 방법 및 장치

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22909711

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 02.10.2024)

122 Ep: pct application non-entry in european phase

Ref document number: 22909711

Country of ref document: EP

Kind code of ref document: A1