Skybox rendering method and device, and storage medium
By dynamically adjusting the intensity and area of the light spot display in real time, the problem of large memory consumption in existing technologies has been solved, achieving a smoother sunrise and sunset simulation effect.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-10
- Publication Date
- 2026-04-10
AI Technical Summary
Existing technologies require pre-storing a large number of simulated images when simulating sunrise and sunset effects, which consumes a lot of memory.
By dynamically adjusting the intensity and area of the light spot display in real time, the skybox is rendered in real time to simulate sunrise and sunset, reducing the storage requirements for simulated images.
It saves memory space and the dynamic display of light spots is smoother, resulting in a better display effect.
Smart Images

Figure CN116310016B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of geographic information, and particularly relate to a skybox rendering method and device and storage medium. BACKGROUND
[0002] Currently, in order to improve the driving experience of users, a sunrise and sunset simulation effect picture can be displayed on a display interface of a vehicle-mounted device or a mobile terminal.
[0003] The existing way of obtaining a sunrise and sunset simulation effect picture generally involves pre-rendering a large number of sunrise and sunset simulation pictures for each time period, and replacing a simulation picture corresponding to a current time from the large number of simulation pictures during vehicle driving, thereby obtaining a dynamically changing sunrise and sunset simulation effect picture.
[0004] However, in the above process of obtaining a sunrise and sunset simulation effect picture, a large number of simulation pictures need to be pre-stored, which occupies a large amount of memory. SUMMARY
[0005] The present application provides a skybox rendering method, device and storage medium, which can simulate sunrise and sunset through real-time dynamic rendering of a skybox, thereby reducing the memory occupation.
[0006] To achieve the above purpose, the present application adopts the following technical solutions:
[0007] In a first aspect, the present application provides a skybox rendering method, comprising: in the process of driving a target vehicle, obtaining a first relative position between a light source and the target vehicle in real time; dynamically adjusting a light spot display area on a skybox based on the first relative position; constructing the skybox based on the position of the target vehicle; dynamically adjusting the light spot display intensity of each point in the light spot display area based on the first relative position and the second relative position between each point in the light spot display area and the target vehicle; and rendering the skybox based on the light spot display intensity and the light spot display area.
[0008] In the technical solution provided in the present application, the first relative position between the light source and the target vehicle is different at different times, and the display area of the light spot on the sky box is different at different times. Therefore, the first relative position between the light source and the target vehicle can be obtained in real time, and the display area of the light spot on the sky box is dynamically adjusted based on the first relative position. In addition, the distance between the light spot display area and the center of the light source is different, and the display intensity of the light spot is also different. Therefore, the display intensity of the light spot in the light spot display area can be dynamically adjusted based on the first relative position and the second relative position between the points in the light spot display area and the target vehicle, so that the sky box can be dynamically rendered in real time according to the display intensity of the light spot and the light spot display area, and the sunrise and sunset can be simulated. It can be seen that, in the technical solution provided in the present application, the sunrise and sunset are simulated by dynamically adjusting the display intensity of the light spot and the light spot display area to render the sky box in real time, without the need to store a large number of simulation images in advance, thereby saving memory space. Moreover, since the sky box is rendered in real time, the dynamic display of the light spot on the sky box is smoother (i.e., the continuity of the dynamic display process of the light spot is improved) and the display effect is better compared with the prior art.
[0009] Optionally, in a possible design, the “dynamically adjusting the display area of the light spot on the sky box based on the first relative position” can include:
[0010] determining a first deviation parameter of the target point according to the second relative position between the target point and the target vehicle and the first relative position; the target point is any point on the sky box; and the first deviation parameter is used to represent the deviation degree of the target point from the light source;
[0011] in a case where the first deviation parameter belongs to a preset deviation parameter range, determining the target point as a point in the light spot display area.
[0012] Optionally, in another possible design, before the “dynamically adjusting the display intensity of the light spot of each point in the light spot display area based on the first relative position and the second relative position between each point in the light spot display area and the target vehicle”, the following steps can also be included:
[0013] obtaining a target floodlight parameter corresponding to the first relative position; the target floodlight parameter is used to represent the concentration degree of the light spot display in the light spot display area; and the greater the target floodlight parameter, the higher the concentration degree;
[0014] dynamically adjusting the display intensity of the light spot of each point in the light spot display area based on the first relative position, the target floodlight parameter and the second relative position between each point in the light spot display area and the target vehicle.
[0015] Optionally, in another possible design, the above-mentioned "dynamically adjusting the spot display intensity of each point in the spot display area based on the first relative position, the target floodlight parameter, and the second relative position of each point in the spot display area to the target vehicle" can include:
[0016] determining a second deviation parameter of each point in the spot display area based on the first relative position and the second relative position of each point in the spot display area to the target vehicle; the second deviation parameter is used to represent the deviation degree of each point in the spot display area to the light source;
[0017] determining the spot display intensity of each point in the spot display area based on the target floodlight parameter and the second deviation parameter of each point in the spot display area.
[0018] Optionally, in another possible design, the above-mentioned "obtaining the target floodlight parameter corresponding to the first relative position" can include:
[0019] obtaining a first floodlight parameter when the light source moves to a first preset position on the skybox, and obtaining a second floodlight parameter when the light source moves to a second preset position on the skybox;
[0020] determining the target floodlight parameter according to the first floodlight parameter, the second floodlight parameter, and the first relative position.
[0021] Optionally, in another possible design, the above-mentioned "obtaining a first floodlight parameter when the light source moves to a first preset position on the skybox, and obtaining a second floodlight parameter when the light source moves to a second preset position on the skybox" includes:
[0022] obtaining a first preset deviation parameter and a second preset deviation parameter;
[0023] determining the first floodlight parameter based on the first preset deviation parameter, and determining the second floodlight parameter based on the second preset deviation parameter.
[0024] Optionally, in another possible design, the above-mentioned "determining the target floodlight parameter according to the first floodlight parameter, the second floodlight parameter, and the first relative position" includes:
[0025] when it is determined that the change of the current local time meets a first preset condition, determining the target floodlight parameter according to the first floodlight parameter, the second floodlight parameter, the first relative position, and a first reference position;
[0026] when it is determined that the change of the current local time meets a second preset condition, determining the target floodlight parameter according to the first floodlight parameter, the second floodlight parameter, the first relative position, and a second reference position.
[0027] In a second aspect, the present application provides a skybox rendering device, comprising: an acquisition module, an adjustment module, and a rendering module;
[0028] The acquisition module is configured to acquire, in real time, a first relative position between the light source and the target vehicle during driving of the target vehicle.
[0029] The adjustment module is configured to dynamically adjust a light spot display area on the skybox based on the first relative position.
[0030] The adjustment module is further configured to dynamically adjust light spot display intensities of points in the light spot display area based on the first relative position and second relative positions between the points and the target vehicle.
[0031] The rendering module is configured to render the skybox based on the light spot display intensities and the light spot display area.
[0032] Optionally, in a possible design, the adjustment module is specifically configured to:
[0033] determine a first deviation parameter of the target point based on the second relative position between the target point and the target vehicle and the first relative position; the target point is any point on the skybox; and the first deviation parameter is used to represent a deviation degree of the target point from the light source.
[0034] In a case where the first deviation parameter belongs to a preset deviation parameter range, the target point is determined as a point in the light spot display area.
[0035] Optionally, in another possible design, the skybox rendering device provided by the present application can further comprise an acquisition module.
[0036] The acquisition module is configured to acquire a target floodlight parameter corresponding to the first relative position before the adjustment module dynamically adjusts the light spot display intensities of the points in the light spot display area based on the first relative position and the second relative positions between the points and the target vehicle; the target floodlight parameter is used to represent a concentration degree of the light spot display in the light spot display area; and the greater the target floodlight parameter is, the higher the concentration degree is.
[0037] The adjustment module is specifically configured to dynamically adjust the light spot display intensities of the points in the light spot display area based on the first relative position, the target floodlight parameter, and the second relative positions between the points and the target vehicle.
[0038] Optionally, in another possible design, the adjustment module is specifically configured to:
[0039] determine a second deviation parameter of each point in the spot display area based on the first relative position and a second relative position of each point in the spot display area to the target vehicle, the second deviation parameter being used to represent a deviation degree of each point in the spot display area to the light source;
[0040] determine a spot display intensity of each point in the spot display area based on the target floodlight parameter and the second deviation parameter of each point in the spot display area.
[0041] Optionally, in another possible design, the obtaining module is specifically configured to:
[0042] obtain a first floodlight parameter when the light source moves to a first preset position on the skybox, and obtain a second floodlight parameter when the light source moves to a second preset position on the skybox;
[0043] determine the target floodlight parameter according to the first floodlight parameter, the second floodlight parameter and the first relative position.
[0044] Optionally, in another possible design, the obtaining module is specifically further configured to:
[0045] obtain a first preset deviation parameter and a second preset deviation parameter;
[0046] determine the first floodlight parameter based on the first preset deviation parameter, and determine the second floodlight parameter based on the second preset deviation parameter.
[0047] Optionally, in another possible design, the obtaining module is specifically further configured to:
[0048] determine the target floodlight parameter according to the first floodlight parameter, the second floodlight parameter, the first relative position and the first reference position when it is determined that a change of the current local time meets a first preset condition;
[0049] determine the target floodlight parameter according to the first floodlight parameter, the second floodlight parameter, the first relative position and the second reference position when it is determined that a change of the current local time meets a second preset condition.
[0050] In a third aspect, the present application provides a skybox rendering device, which comprises a memory, a processor, a bus and a communication interface; the memory is used to store computer execution instructions, the processor is connected with the memory through the bus; when the skybox rendering device is running, the processor executes the computer execution instructions stored in the memory, so that the skybox rendering device executes the skybox rendering method provided in the first aspect.
[0051] Optionally, the skybox rendering apparatus can further include a transceiver configured to perform the step of receiving, transmitting or processing data, signaling or information under the control of the processor of the skybox rendering apparatus, for example, obtaining the first relative position between the light source and the target vehicle.
[0052] Further optionally, the skybox rendering apparatus can be a physical machine for implementing the skybox rendering, or can be a part of the physical machine, for example, can be a chip system in the physical machine. The chip system is configured to support the skybox rendering apparatus to implement the functions involved in the first aspect, for example, receiving, transmitting or processing the data and / or information involved in the skybox rendering method. The chip system includes a chip, and can further include other discrete devices or circuit structures.
[0053] In a fourth aspect, the present application provides a computer readable storage medium, and the computer readable storage medium stores instructions, when the instructions are executed by a computer, the computer executes the skybox rendering method provided in the first aspect.
[0054] In a fifth aspect, the present application provides a computer program product, and the computer program product includes computer instructions, when the computer instructions are executed on a computer, the computer executes the skybox rendering method provided in the first aspect.
[0055] It should be noted that the above computer instructions can be stored on the computer readable storage medium in whole or in part. The computer readable storage medium can be packaged together with the processor of the skybox rendering apparatus, or can be packaged separately from the processor of the skybox rendering apparatus, and the present application does not limit the same.
[0056] The second aspect, the third aspect, the fourth aspect and the fifth aspect of the present application can refer to the detailed description of the first aspect, and the beneficial effects of the second aspect, the third aspect, the fourth aspect and the fifth aspect can refer to the beneficial effect analysis of the first aspect, which will not be described here.
[0057] In the present application, the name of the above-mentioned skybox rendering apparatus does not constitute a limitation on the device or functional module itself, and in actual implementation, these devices or functional modules can appear with other names. As long as the functions of each device or functional module are similar to those of the present application, they belong to the scope of the claims of the present application and equivalent technologies.
[0058] These aspects or other aspects of the present application will be more apparent in the following description. BRIEF DESCRIPTION OF DRAWINGS
[0059] Figure 1 A flowchart of a skybox rendering method provided by an embodiment of the present application is shown in the figure;
[0060] Figure 2 A schematic diagram of a skybox provided by an embodiment of the present application;
[0061] Figure 3 A cosine curve schematic diagram provided by an embodiment of the present application;
[0062] Figure 4 A schematic diagram of another skybox provided by an embodiment of the present application;
[0063] Figure 5 A flowchart of a rendering method of another skybox provided by an embodiment of the present application;
[0064] Figure 6 A structural schematic diagram of a rendering device of a skybox provided by an embodiment of the present application;
[0065] Figure 7 A structural schematic diagram of a rendering device of another skybox provided by an embodiment of the present application. DETAILED DESCRIPTION
[0066] The rendering method, device and storage medium of the skybox provided by the embodiments of the present application are described in detail below with reference to the drawings.
[0067] The term “and / or” in this document merely describes an association relationship of associated objects, and can represent three relationships, for example, A and / or B can represent three cases of existence of A alone, existence of A and B simultaneously, and existence of B alone.
[0068] The terms “first” and “second” and the like in the description of the present application and the drawings are used to distinguish different objects, or to distinguish different processing of the same object, and are not used to describe a specific order of the object.
[0069] In addition, the terms “include” and “have” and any variations thereof mentioned in the description of the present application are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but can optionally include other steps or units not listed or can optionally include other steps or units inherent to the process, method, product or device.
[0070] It should be noted that in the embodiments of the present application, the words “exemplary” or “for example” are used to represent an example, illustration or description. Any embodiment or design scheme described as “exemplary” or “for example” in the embodiments of the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, the words “exemplary” or “for example” are intended to present the relevant concept in a specific manner.
[0071] In the description of the present application, the meaning of "a plurality of" refers to two or more, unless otherwise specified.
[0072] At present, in order to improve the driving experience of users, the display interface of a vehicle-mounted device or a mobile terminal can display a sunrise and sunset simulation effect picture.
[0073] The existing way to obtain a sunrise and sunset simulation effect picture is generally to pre-render a large number of sunrise and sunset simulation pictures of each time period, and to replace the simulation picture corresponding to the current time from the large number of simulation pictures during vehicle driving, so as to obtain a dynamically changing sunrise and sunset simulation effect picture.
[0074] However, in the above process of obtaining a sunrise and sunset simulation effect picture, a large number of simulation pictures need to be pre-stored, which occupies a large amount of memory.
[0075] In view of the problems existing in the prior art, the present application provides a sky box rendering method, which renders a sky box in real time by dynamically adjusting the display intensity and display area of the light spot, realizes the simulation of sunrise and sunset, does not need to pre-store a large number of simulation pictures, and saves memory space. Moreover, since the sky box is rendered in real time, the dynamic display of the light spot on the sky box is smoother and the display effect is better compared with the existing technical solutions.
[0076] The sky box rendering method provided by the present application can be applied to a sky box rendering device. In a possible implementation manner, the sky box rendering device can be a mobile terminal or a vehicle-mounted device. For example, the mobile terminal or the vehicle-mounted device can determine the first relative position of the light source and the target vehicle according to real-time positioning during vehicle driving, and dynamically adjust the display area of the light spot on the sky box based on the first relative position.
[0077] The mobile terminal can be a mobile phone, a tablet computer, a notebook computer, an ultra-mobile personal computer (UMPC), a handheld computer, a netbook, a personal digital assistant (PDA), a wearable electronic device, a virtual reality device, and different types of user terminals.
[0078] In another possible implementation, the skybox rendering apparatus can be a physical machine (such as a server) or a virtual machine (VM) deployed on a physical machine. Taking a server as an example, the skybox rendering apparatus can acquire a first relative position of a light source relative to a target vehicle in real time during driving of the target vehicle, dynamically adjust a light spot display area on the skybox according to the first relative position, and obtain a simulation of sunrise and sunset based on real-time rendering of the light spot display area. In addition, the skybox rendering apparatus can send the simulation of sunrise and sunset obtained by real-time rendering to a mobile terminal or a vehicle-mounted device.
[0079] The skybox rendering method provided in the present application is described in detail below.
[0080] With reference to Figure 1 , the skybox rendering method provided in the embodiments of the present application includes S101-S104:
[0081] S101, a first relative position of a light source relative to a target vehicle is acquired in real time during driving of the target vehicle.
[0082] In the embodiments of the present application, the simulation of sunrise and sunset can be achieved by rendering a skybox. The skybox can be constructed based on a position of the target vehicle. For example, the skybox can be constructed with a center position of the target vehicle as a viewpoint position of the skybox. The specific construction method of the skybox can refer to the related description in the prior art, which will not be described herein again.
[0083] Since the position of the light source on the skybox changes over time, and the light spot display area of the light source at different positions on the skybox is also different. Therefore, in order to more accurately and dynamically adjust the light spot display area of the light source on the skybox in real time, the first relative position of the light source relative to the target vehicle can be acquired in real time during driving of the target vehicle.
[0084] Optionally, in a possible implementation, with reference to Figure 2 , a schematic diagram of a skybox is provided. As shown in Figure 2 , the center position of the target vehicle can be represented by point o, the sunrise position can be represented by point a, and the sunset position can be represented by point b. When the light source is located at point a, the angle between the direction of the light source and the due east direction is 0 degrees, and when the light source is located at point b, the angle between the direction of the light source and the due east direction is 180 degrees. During the day, as time changes, the light source can move from point a to point b along the direction of the arrow in Figure 2 , the longitude and latitude information of point o can be acquired during driving of the target vehicle, and the first relative position of the light source relative to point o can be determined according to the longitude and latitude information of point o. For example, the first relative position can be represented by a vector, and the vector corresponds toFigure 2 When the light source moves to point c, the first relative position between the light source and the target vehicle can be represented by the vector oc.
[0085] It is understandable that, in practical applications, the distance between the light source and the target vehicle is very far, and the size of the light source is much larger than the size of the target vehicle. Therefore, the change in the position of the target vehicle can be ignored relative to the change in the position of the light source. Thus, in determining the change in the first relative position, this embodiment can be based on the change in the position of the light source, ignoring the change in the position of the target vehicle.
[0086] S102. Dynamically adjust the light spot display area on the skybox based on the first relative position.
[0087] The light spot display area is used to characterize the size of the light spot displayed on the skybox. In this embodiment, the light spot is the simulated sun on the skybox. The larger the light spot display area, the larger the final displayed light spot; the smaller the light spot display area, the smaller the final displayed light spot.
[0088] Optionally, in one possible implementation, a first deviation parameter of the target point can be determined based on the second relative position of the target point and the target vehicle, as well as the first relative position; if the first deviation parameter is within a preset deviation parameter range, the target point is determined as a point within the spot display area.
[0089] The target point is any point on the skybox; the first deviation parameter is used to characterize the degree of deviation between the target point and the light source.
[0090] To simulate sunrise and sunset more realistically, in this embodiment, instead of rendering the entire skybox, the light spot display area is dynamically adjusted based on the degree of deviation between each point in the sky and the light source, and then rendered in real time in the light spot display area.
[0091] For example, such as Figure 2 As shown, target point e is any point on the skybox. Taking the current position of the light source at point c as an example, the first relative position can be represented by the unit vector normalize(oc), and the second relative position can be represented by the unit vector normalize(oe). Then, the degree of deviation between target point e and the light source can be determined according to expression (1):
[0092] cos(∠eoc)=normalize(oc)*normalize(oe) (1)
[0093] The preset deviation parameter range can be a range of deviation parameters determined in advance by a person. For example, the preset deviation parameter range can be [0, 1]. Then, when cos(∠eoc) belongs to [0, 1], point e can be determined as a point within the spot display area. Similarly, the first deviation parameter of any point on the skybox can be determined, and then the area on the skybox of all points whose first deviation parameter belongs to the preset deviation parameter range can be determined as the spot display area.
[0094] Taking a preset deviation parameter range of [0, 1] as an example. Figure 2 As shown, if we take the direction of oa as the reference line at 0°, and take oa as the reference, rotating counterclockwise is the positive direction. Then, when the light source is at position a, since the skybox only has the upper half, the position farthest from the light source on the skybox is point b, and the angle formed by ob and oa is the largest, which is 180°. At this time, if we take cos(∠eoc) belonging to [0, 1] as the standard for determining the light spot display area, then combined with... Figure 3 The provided diagram of a cosine curve (the horizontal axis can be the angle formed by the first and second relative positions, and the vertical axis is the cosine value corresponding to the angle) indicates that, under this constraint, the spot display area should be... Figure 2 The arc segment ac in the diagram. Similarly, when the light source is at position b, if cos(∠eoc) belonging to [0, 1] is used as the standard for determining the light spot display area, then combined with... Figure 2 Under these constraints, the area of the light spot display should be Figure 2 The circular arc segment bc in the middle.
[0095] Understandable, Figure 2 To clearly describe the positional relationships, a two-dimensional coordinate diagram is used, where the light spot display area corresponds to a segment of an arc. In practical applications, however, the light spot display area is a region corresponding to the arc. Furthermore, in this embodiment, for ease of demonstration, the skybox is represented by an arc; in practical applications, a cube is generally used to simulate the sky.
[0096] S103. Based on the first relative position and the second relative position of each point in the light spot display area with respect to the target vehicle, dynamically adjust the light spot display intensity of each point in the light spot display area.
[0097] To make the simulated sunrise and sunset on the skybox closer to the actual sunrise and sunset, and to further improve the realism of the simulation, the embodiments of this application can determine the light spot display intensity of each point in the light spot display area based on the distance between each point and the center of the light source, so as to achieve the effect that the farther away from the center of the light source, the smaller the light spot display intensity.
[0098] Optionally, in a possible implementation, the target floodlight parameter corresponding to the first relative position can be acquired in the embodiment of the present application; then the spot display intensity of each point in the spot display region is dynamically adjusted based on the first relative position, the target floodlight parameter, and the second relative position of each point in the spot display region to the target vehicle.
[0099] The target floodlight parameter is used to represent the concentration degree of the spot display in the spot display region; and the greater the target floodlight parameter is, the higher the concentration degree is.
[0100] In actual application, the sun has a larger light circle in the sky in the morning and in the afternoon, and has a smaller light circle in the sky at noon, that is, the concentration degree is higher, from the visual effect. In order to further improve the reality based on the sky box simulation, in the embodiment of the present application, the position of the light source on the sky box is different at different times, the target floodlight parameter can be different, and the concentration degree of the light source display is different. For example, the target floodlight parameter at noon is greater than the target floodlight parameter in the morning, so that the effect that the light source is displayed more concentrated on the sky box at noon than in the morning can be realized.
[0101] Optionally, in the embodiment of the present application, the second deviation parameter of each point in the spot display region can be determined based on the first relative position and the second relative position of each point in the spot display region to the target vehicle; then the spot display intensity of each point in the spot display region is determined based on the target floodlight parameter and the second deviation parameter of each point in the spot display region.
[0102] The second deviation parameter is used to represent the deviation degree of each point in the spot display region to the light source.
[0103] For example, the second deviation parameter of each point in the spot display region can be determined based on the first relative position and the second relative position of each point in the spot display region to the target vehicle. Figure 4 Taking the schematic diagram of the sky box provided as an example, if the light source moves to the d position, t is any point in the spot display region at this time, then the second deviation parameter corresponding to the t point can be determined according to expression (2):
[0104] cos(∠tod)=normalize(ot)*normalize(od) (2)
[0105] Wherein, the unit vector normalize(od) represents the first relative position, and the unit vector normalize(ot) represents the second relative position. If N represents the target floodlight parameter, then the spot display intensity y of the t point in the spot display region at this time can be determined based on expression (3) in the embodiment of the present application:
[0106] y=cos(∠tod) N (3)
[0107] To verify that the technical solution provided in this application can achieve a more concentrated light source display on the skybox at noon compared to the morning, an example is described below. For example, using... Figure 4 Taking the provided skybox diagram as an example, if the N value is 3.5 when the light source moves to position d, and the N value is 6 when the light source moves to position c, then when the light source moves to position d, if t is any point within the light spot display area at this time, and the angle between ot and od is 45°, then the light spot display intensity at point t is y = cos(45°). 3.5 , approximately equal to 0.088. When the light source moves to position c, if m is any point within the spot display area, and the angle between om and oc is also 45°, then the spot display intensity at point m is y = cos(45°). 6 The value is approximately 0.015. It can be seen that as the light source moves from position d to position c, the intensity of the light spot at the same distance from the light source (i.e., with the same second deviation parameter) gradually decreases as the target floodlight parameter gradually increases. Therefore, this embodiment of the application can achieve a more concentrated effect on the skybox at noon compared to the morning by adjusting the target floodlight parameter at different positions.
[0108] Optionally, the target floodlight parameters can be determined in the following manner in the embodiments of this application: obtain the first floodlight parameters when the light source moves to the first preset position on the skybox, and obtain the second floodlight parameters when the light source moves to the second preset position on the skybox; then determine the target floodlight parameters based on the first floodlight parameters, the second floodlight parameters and the first relative position.
[0109] The first preset position can be the position of the light source with the largest target floodlight parameter, and the second preset position can be the position of the light source with the smallest target floodlight parameter. For example, the first preset position can be... Figure 4 The position of midpoint c, the second preset position may include Figure 4 The target floodlight parameters at the positions of midpoint a and point b, that is, at the positions of points a and b, are the same.
[0110] For example, such as Figure 4 As shown, if the second floodlight parameter of the light source at point a is 1, and the first floodlight parameter of the light source at point c is 6, assuming that when the light source moves to a certain position n, ∠noa = 45°, then the target floodlight parameter x of the light source at n can be expressed by the formula... It is confirmed that x = 3.5 through calculation.
[0111] Optionally, in one possible implementation, a first preset deviation parameter and a second preset deviation parameter can be obtained; then, a first floodlight parameter can be determined based on the first preset deviation parameter, and a second floodlight parameter can be determined based on the second preset deviation parameter.
[0112] The first preset deviation parameter and the second preset deviation parameter can be deviation parameters that are determined in advance by humans according to the requirements.
[0113] For example, at a first preset position Figure 4 Taking point c as an example, if the user's requirement is that when the light source moves to point c, the light spot display area is a point on the skybox forming an angle of 10° with oc, then the first preset deviation parameter = log(0.001, cos10°), which is the exponent corresponding to 0.001 with cos10° as the base. Similarly, the second preset deviation parameter can be determined according to the light spot display area when the light source moves to point a or b according to the user's requirements. Here, 0.001 can be a decimal that is close to 0 but not zero, determined in advance. It is understood that 0.001 in this embodiment is only an example; in practical applications, it can also be other decimals that are close to 0 but not zero.
[0114] Optionally, in one possible implementation, when it is determined that the change in the current local time meets the first preset condition, the target floodlight parameter is determined based on the first floodlight parameter, the second floodlight parameter, the first relative position, and the first reference position; when it is determined that the change in the current local time meets the second preset condition, the target floodlight parameter is determined based on the first floodlight parameter, the second floodlight parameter, the first relative position, and the second reference position.
[0115] For example, the first preset condition could be that the current local time changes gradually from morning to noon, such as after sunrise at 7:00 AM, the current local time gradually approaches noon, and this can be determined as meeting the first preset condition. Similarly, the second preset condition could be that the current local time changes gradually from noon to evening, such as after noon, the current local time gradually approaches sunset, and this can be determined as meeting the second preset condition.
[0116] In practical applications, as the light source moves from point a to point b, the concentration of the light spot first increases and then decreases, and the concentration of the light spot is the same when the light source moves to points a and b; that is, the floodlight parameters are the same when the light source moves to points a and b. Therefore, in this embodiment, a reference position can be determined based on the change in the current local time, and then the target floodlight parameters of each point within the light spot area can be determined based on the deviation parameters of each point relative to the reference position.
[0117] For example, when the current local time changes from morning to noon, the target floodlight parameters are determined based on the first floodlight parameter, the second floodlight parameter, the first relative position, and the first reference position. The first reference position at this time can be...Figure 4 ob in the case that the change of the current local time is from noon to evening. Figure 4 ob in the case that the change of the current local time is from noon to evening.
[0118] S104, rendering the skybox based on the spot display intensity and the spot display area.
[0119] Exemplarily, the spot display area on the skybox can be rendered in real time by using a shader, and the brightness of the color of different points can be rendered according to the spot display intensity of the different points. The stronger the spot display intensity is, the brighter the color is.
[0120] In the technical scheme provided by the embodiments of the present application, because the first relative position between the light source and the target vehicle is different at different moments, and the display area of the spot on the skybox is different at different moments, the first relative position between the light source and the target vehicle can be acquired in real time, and the display area of the spot on the skybox can be dynamically adjusted based on the first relative position. In addition, for each point in the display area of the spot, the distance from the center of the light source is different, and the spot display intensity is also different, so the spot display intensity of each point in the display area of the spot can be dynamically adjusted based on the first relative position and the second relative position between each point in the display area of the spot and the target vehicle, so that the skybox can be dynamically rendered in real time according to the spot display intensity and the display area of the spot, and the sunrise and sunset can be simulated. It can be seen that in the technical scheme provided by the embodiments of the present application, the sunrise and sunset are simulated by dynamically adjusting the spot display intensity and the display area of the spot to render the skybox in real time, without the need to store a large number of simulation images in advance, thereby saving the memory space. Moreover, because the skybox is rendered in real time, compared with the prior art, the dynamic display of the spot on the skybox is smoother (i.e. the continuity of the process of dynamically displaying the spot is improved), and the display effect is better.
[0121] In summary, as shown in Figure 5 The embodiments of the present application also provide a rendering method of a skybox, comprising S501-S508:
[0122] S501, acquiring the first relative position between the light source and the target vehicle in real time during the driving of the target vehicle.
[0123] S502, dynamically adjusting the display area of the spot on the skybox based on the first relative position.
[0124] S503, acquiring the first preset deviation parameter and the second preset deviation parameter.
[0125] S504, determine the first floodlight parameter based on the first preset deviation parameter, and determine the second floodlight parameter based on the second preset deviation parameter.
[0126] S505, when it is determined that the change of the current local time meets the first preset condition, determine the target floodlight parameter corresponding to the first relative position according to the first floodlight parameter, the second floodlight parameter, the first relative position and the first reference position; when it is determined that the change of the current local time meets the second preset condition, determine the target floodlight parameter corresponding to the first relative position according to the first floodlight parameter, the second floodlight parameter, the first relative position and the second reference position.
[0127] S506, determine the second deviation parameter of each point in the light spot display area based on the first relative position and the second relative position of each point in the light spot display area and the target vehicle.
[0128] S507, dynamically adjust the light spot display intensity of each point in the light spot display area based on the target floodlight parameter and the second deviation parameter of each point in the light spot display area.
[0129] S508, render the skybox based on the light spot display intensity and the light spot display area.
[0130] As shown in Figure 6 The embodiment of the present application also provides a skybox rendering device, which can include: an acquisition module 11, an adjustment module 12 and a rendering module 13.
[0131] The acquisition module 11 performs S101 in the above method embodiment, the adjustment module 12 performs S102 and S103 in the above method embodiment, and the rendering module 13 performs S104 in the above method embodiment.
[0132] Specifically, the acquisition module 11 is configured to acquire the first relative position between the light source and the target vehicle in real time during driving of the target vehicle.
[0133] The adjustment module 12 is configured to dynamically adjust the light spot display area on the skybox based on the first relative position; the skybox is constructed based on the position of the target vehicle.
[0134] The adjustment module 12 is further configured to dynamically adjust the light spot display intensity of each point in the light spot display area based on the first relative position and the second relative position of each point in the light spot display area and the target vehicle.
[0135] The rendering module 13 is configured to render the skybox based on the light spot display intensity and the light spot display area.
[0136] Optionally, in a possible design manner, the adjustment module 12 is specifically configured to:
[0137] determine a first deviation parameter of the target point according to the second relative position of the target point and the target vehicle and the first relative position; the target point is any point on the skybox; and the first deviation parameter is used to represent a degree of deviation of the target point from the light source;
[0138] In a case where the first deviation parameter belongs to a preset deviation parameter range, the target point is determined as a point in the spot display region.
[0139] Optionally, in another possible design, the rendering device of the skybox provided in the present application can further include an obtaining module 11.
[0140] The obtaining module 11 is configured to obtain a target floodlight parameter corresponding to the first relative position before the adjusting module 12 dynamically adjusts the spot display intensity of each point in the spot display region based on the first relative position and the second relative position of each point in the spot display region and the target vehicle; the target floodlight parameter is used to represent a concentration degree of the spot display in the spot display region; and the greater the target floodlight parameter is, the higher the concentration degree is.
[0141] The adjusting module 12 is specifically configured to dynamically adjust the spot display intensity of each point in the spot display region based on the first relative position, the target floodlight parameter and the second relative position of each point in the spot display region and the target vehicle.
[0142] Optionally, in another possible design, the adjusting module 12 is specifically configured to:
[0143] determine a second deviation parameter of each point in the spot display region based on the first relative position and the second relative position of each point in the spot display region and the target vehicle; the second deviation parameter is used to represent a degree of deviation of each point in the spot display region from the light source;
[0144] determine the spot display intensity of each point in the spot display region based on the target floodlight parameter and the second deviation parameter of each point in the spot display region.
[0145] Optionally, in another possible design, the obtaining module 11 is specifically configured to:
[0146] obtain a first floodlight parameter when the light source moves to a first preset position on the skybox, and obtain a second floodlight parameter when the light source moves to a second preset position on the skybox;
[0147] determine the target floodlight parameter according to the first floodlight parameter, the second floodlight parameter and the first relative position.
[0148] Optionally, in another possible design, the obtaining module 11 is specifically configured to:
[0149] obtaining a first preset offset parameter and a second preset offset parameter;
[0150] determining a first floodlight parameter based on the first preset offset parameter and determining a second floodlight parameter based on the second preset offset parameter.
[0151] Optionally, in another possible design, the obtaining module 11 is specifically further configured to:
[0152] when it is determined that the change of the current local time meets the first preset condition, determining a target floodlight parameter according to the first floodlight parameter, the second floodlight parameter, the first relative position, and the first reference position;
[0153] when it is determined that the change of the current local time meets the second preset condition, determining a target floodlight parameter according to the first floodlight parameter, the second floodlight parameter, the first relative position, and the second reference position.
[0154] Optionally, the skybox rendering apparatus can further include a storage module configured to store program codes and the like of the skybox rendering apparatus.
[0155] As shown in Figure 7 , the present application also provides a skybox rendering apparatus, which includes a memory 41, a processor 42 (42-1 and 42-2), a bus 43, and a communication interface 44; the memory 41 is configured to store computer execution instructions, the processor 42 is connected with the memory 41 through the bus 43; when the skybox rendering apparatus is running, the processor 42 executes the computer execution instructions stored in the memory 41, so that the skybox rendering apparatus executes the skybox rendering method provided in the above embodiments.
[0156] In a specific implementation, as an example, the processor 42 can include one or more central processing units (CPUs), such as the CPU0 and the CPU1 shown in Figure 7 . And as an example, the skybox rendering apparatus can include multiple processors 42, such as the processor 42-1 and the processor 42-2 shown in Figure 7 . Each CPU in these processors 42 can be a single-CPU or a multi-CPU. Here, the processor 42 can refer to one or more devices, circuits, and / or processing cores for processing data (for example, computer program instructions).
[0157] The memory 41 can be read-only memory (ROM) or other type of static storage devices that can store static information and instructions, random access memory (RAM) or other type of dynamic storage device that can store information and instructions, electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium capable of storing desired program code in form of instructions or data structures and that can be accessed by a computer, but not limited to. The memory 41 can exist independently, and is connected with the processor 42 through the bus 43. The memory 41 can also be integrated with the processor 42.
[0158] In a specific implementation, the memory 41 is configured to store data in the present application and computer execution instructions corresponding to software programs for implementing the present application. The processor 42 can realize various functions of the skybox rendering device by running or executing the software programs stored in the memory 41 and calling the data stored in the memory 41.
[0159] The communication interface 44 is configured to communicate with other devices or communication networks, such as a control system, a radio access network (RAN), a wireless local area network (WLAN), etc., using any transceiver-like device. The communication interface 44 can include a receiving unit configured to realize a receiving function and a sending unit configured to realize a sending function.
[0160] The bus 43 can be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, an extended industry standard architecture (EISA) bus, etc. The bus 43 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus.
[0161] As an example, in combination withFigure 6 The function implemented by the acquisition module in the skybox rendering device is the same as the function implemented by the receiving unit in Figure 7 The function implemented by the rendering module in the skybox rendering device is the same as the function implemented by the processor in Figure 7 The function implemented by the storage module in the skybox rendering device is the same as the function implemented by the memory in Figure 7 The function implemented by the storage module in the skybox rendering device is the same as the function implemented by the memory in
[0162] The explanation of the related content in the embodiment can refer to the above method embodiments, which will not be repeated here.
[0163] Through the description of the above embodiments, those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above division of functional modules is taken as an example for illustration, and in actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.
[0164] The embodiment of the present application also provides a computer readable storage medium, and the computer readable storage medium stores instructions, when the computer executes the instructions, the computer executes the skybox rendering method provided by the above embodiment.
[0165] The computer readable storage medium may, for example, be but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples (a non-exhaustive list) of the computer readable storage medium include an electrical connection having one or more wires, a portable computer diskette, a hard disk, a RAM, a ROM, an erasable programmable read only memory (EPROM), a register, a hard disk, an optical fiber, a CD-ROM, an optical storage device, a magnetic storage device, or any suitable combination of the above, or any other form of computer readable storage medium known in the art. An exemplary storage medium is coupled to the processor, so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). In the embodiment of the present application, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or apparatus.
[0166] The above description is provided as an enabling teaching of the application and is not intended to limit its scope in any way. Any modification of the teachings of the application in light of the various embodiments disclosed herein intended to be within the scope of the application.
Claims
1. A method of rendering a skybox, the method comprising: The method comprises the following steps: acquiring a first relative position between a light source and a target vehicle in real time during driving of the target vehicle; adjusting a light spot display area on a skybox based on the first relative position, the skybox being constructed based on a position of the target vehicle; acquiring a first floodlight parameter when the light source moves to a first preset position on the skybox, and acquiring a second floodlight parameter when the light source moves to a second preset position on the skybox; determining a target floodlight parameter corresponding to the first relative position according to the first floodlight parameter, the second floodlight parameter, the first relative position and a first reference position when a change of a current local time meets a first preset condition; determining a target floodlight parameter corresponding to the first relative position according to the first floodlight parameter, the second floodlight parameter, the first relative position and a second reference position when a change of a current local time meets a second preset condition; the target floodlight parameter is used to represent a concentration degree of light spot display in the light spot display area; and the greater the target floodlight parameter is, the higher the concentration degree is; adjusting light spot display intensity of each point in the light spot display area based on the first relative position, the target floodlight parameter and a second relative position between each point in the light spot display area and the target vehicle, the farther each point in the light spot display area is from the light source, the smaller the light spot display intensity of the corresponding point is; rendering the skybox based on the light spot display intensity and the light spot display area.
2. The method of rendering a skybox of claim 1, wherein, The method of adjusting the light spot display area on the skybox based on the first relative position comprises the following steps: determining a first deviation parameter of a target point according to a second relative position between the target point and the target vehicle and the first relative position; the target point is any point on the skybox; the first deviation parameter is used to represent a deviation degree of the target point from the light source; determining the target point as a point in the light spot display area when the first deviation parameter belongs to a preset deviation parameter range.
3. The method of rendering a skybox of claim 1, wherein, The method of adjusting the light spot display intensity of each point in the light spot display area based on the first relative position, the target floodlight parameter and a second relative position between each point in the light spot display area and the target vehicle comprises the following steps: determining a second deviation parameter of each point in the light spot display area based on the first relative position and a second relative position between each point in the light spot display area and the target vehicle; the second deviation parameter is used to represent a deviation degree of each point in the light spot display area from the light source; determining the light spot display intensity of each point in the light spot display area based on the target floodlight parameter and the second deviation parameter of each point in the light spot display area.
4. The method of Claim 1, wherein, The method of acquiring the first floodlight parameter when the light source moves to the first preset position on the skybox, and acquiring the second floodlight parameter when the light source moves to the second preset position on the skybox comprises the following steps: acquiring a first preset deviation parameter and a second preset deviation parameter; The first preset offset parameter is used to determine the first spotlight parameter, and the second preset offset parameter is used to determine the second spotlight parameter.
5. An apparatus for rendering a skybox, the apparatus comprising: The method comprises the steps of: The acquisition module is configured to acquire a first relative position between a light source and a target vehicle in real time during driving of the target vehicle; The adjustment module is configured to dynamically adjust a light spot display area on a skybox based on the first relative position, wherein the skybox is constructed based on a position of the target vehicle; The acquisition module is further configured to acquire a first spotlight parameter when the light source moves to a first preset position on the skybox, and acquire a second spotlight parameter when the light source moves to a second preset position on the skybox; when it is determined that a change condition of a current local time meets a first preset condition, determine a target spotlight parameter corresponding to the first relative position based on the first spotlight parameter, the second spotlight parameter, the first relative position, and a first reference position; When it is determined that a change condition of a current local time meets a second preset condition, determine a target spotlight parameter corresponding to the first relative position based on the first spotlight parameter, the second spotlight parameter, the first relative position, and a second reference position; The target spotlight parameter is used to represent a concentration degree of light spot display in the light spot display area; and the greater the target spotlight parameter is, the higher the concentration degree is; The adjustment module is further configured to dynamically adjust light spot display intensity of each point in the light spot display area based on the first relative position, the target spotlight parameter, and a second relative position between each point in the light spot display area and the target vehicle, wherein the farther each point in the light spot display area is from the light source, the smaller the light spot display intensity of a corresponding point is; The rendering module is configured to render the skybox based on the light spot display intensity and the light spot display area.
6. An apparatus for rendering a skybox, the apparatus comprising: The device comprises a memory, a processor, a bus, and a communication interface; the memory is used to store computer execution instructions; the processor is connected to the memory through the bus; When the rendering device of the skybox is running, the processor executes the computer execution instructions stored in the memory, so that the rendering device of the skybox executes the rendering method of the skybox according to any one of claims 1-4.
7. A computer-readable storage medium, characterized in that, The computer readable storage medium stores instructions, when the computer executes the instructions, the computer executes the rendering method of the skybox according to any one of claims 1-4.
Citation Information
Patent Citations
Method, device and mobile terminal for illumination rendering in augmented reality
CN107808409A
Rendering method of virtual illuminant and related equipment
CN113592999A