Methods, devices, equipment, and storage media for displaying vehicle light flow effects
By using a lighting control program to render the headlights on the vehicle's 3D model and simulating the flow of light, the problem of high hard drive resource consumption was solved, and efficient lighting display was achieved.
Patent Information
- Application Number
- CN202311187721.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-13
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2043-09-13
AI Technical Summary
In existing technologies, the large number of rendered light sequence maps results in significant disk resource consumption when storing and playing these rendered light sequence maps.
The system uses a preset lighting control program to render the headlights of the vehicle's 3D model. By changing the color of the vehicle's headlights using a black and white mask, it simulates the effect of flowing light and reduces the use of hard disk resources.
It reduces hard drive and memory usage, enhances vehicle display, and enriches the ways to display flowing light effects.
Smart Images

Figure CN117197324B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, device, and storage medium for displaying vehicle light flow effects. Background Technology
[0002] When displaying vehicles, to highlight their uniqueness and aesthetics, flowing effects can be added to the vehicle lights.
[0003] Currently, the common method is to play multiple rendered light sequence images consecutively to simulate the flow of light. However, this method consumes a lot of hard disk resources when storing and playing these rendered light sequence images because of the large number of rendered light sequence images. Summary of the Invention
[0004] This application provides a method, apparatus, device, and storage medium for displaying vehicle light flow effects, in order to solve the problem that the large number of rendered light sequence images results in a large amount of hard disk resources being consumed when storing and playing these rendered light sequence images.
[0005] Firstly, this application provides a method for displaying vehicle light flow effects, including:
[0006] Obtain at least one set of first headlight group models and at least one corresponding set of second headlight group models; the first headlight group model and the second headlight group model include multiple lamp post models; the color corresponding to the first headlight group model is the off-light color, and the color corresponding to the second headlight group model is the on-light color;
[0007] Obtain the preset lighting control program corresponding to each second vehicle headlight group model; the preset lighting control program includes movement speed parameters;
[0008] While displaying the first headlight group model, a preset lighting control program is used to render the corresponding second headlight group model, so as to control the displayable lamp post model in the second headlight group model using the moving speed parameter and the current display time.
[0009] The rendered second headlight model is overlaid on the first headlight model to display the vehicle light flow effect on the first headlight model based on the displayable light column model in the second headlight model. The current display time is the display time of the second headlight model.
[0010] Optionally, the generation steps of the lighting control program can be pre-set, including:
[0011] In the initial lighting control program, a black and white mask is configured, and the initial texture map coordinates corresponding to the black and white mask are determined; the movement speed parameter value of the initial texture map coordinates corresponding to the black and white mask is determined; the calculation formula for the texture map coordinates is configured to obtain the calculated texture map coordinates through the calculation formula; the parameters in the calculation formula for the texture map coordinates include: initial texture map coordinates, movement speed parameter, and time parameter; the black and white mask is associated with the corresponding calculated texture map coordinates to determine the acquisition area of the black and white mask based on the associated calculated texture map coordinates; the acquisition area of the black and white mask is the black and white mask area corresponding to the calculated texture map coordinates; the acquisition area of the black and white mask is determined to be used to display the corresponding second headlight group model.
[0012] Optionally, the black and white mask, from left to right, consists of: a rectangular black portion, a rectangular white portion, and a rectangular black portion; determining the initial texture map coordinates corresponding to the black and white mask includes: unfolding the texture coordinates of the second headlight assembly model to obtain the original texture map coordinates; converting the original texture map coordinates according to a preset mode to obtain the changed original texture map coordinates, wherein the changed original texture map coordinates present a horizontally distributed graphic corresponding to each light pillar, and each light pillar graphic is rectangular; determining the changed original texture map coordinates as the initial texture map coordinates corresponding to the black and white mask; configuring the calculation formula for the texture map coordinates includes: in configuring the calculation formula for the texture map coordinates, the vertical coordinate of the initial texture map coordinates remains unchanged, and the horizontal coordinate changes with the value of the time parameter.
[0013] Optionally, the step of rendering the corresponding second vehicle headlight group model using a preset lighting control program, and controlling the displayable lamppost models in the second vehicle headlight group model using moving speed parameters and the currently displayed time, includes:
[0014] The currently displayed time is determined as the current time parameter value; the current time parameter value, the movement speed parameter value, and the initial texture map coordinates corresponding to the second headlight group model are substituted into the texture map coordinate calculation formula, and the calculation result is determined as the calculated texture map coordinates; the black and white mask area corresponding to the calculated texture map coordinates is determined as the black and white mask acquisition area, and the acquisition area of the black and white mask is used to determine whether each lamp post model in the second headlight group model is transparent; the second headlight group model is rendered according to whether each lamp post model is transparent, so as to determine that the opaque lamp post model is the displayable lamp post model.
[0015] Optionally, the white portion of the black and white mask corresponds to a value of 1, and the black portion corresponds to a value of 0; a preset lighting control program is used to render the corresponding second vehicle headlight group model, and the displayable lamppost models in the second vehicle headlight group model are controlled by the moving speed parameter and the current displayed time, including:
[0016] The currently displayed time is determined as the current time parameter value; the current time parameter value, the movement speed parameter value, and the initial texture map coordinates corresponding to the second headlight group model are substituted into the texture map coordinate calculation formula, and the calculation result is determined as the calculated texture map coordinates; the black and white mask area corresponding to the calculated texture map coordinates is determined as the black and white mask acquisition area; the corresponding value of the black and white mask is multiplied by the corresponding value of the light-on color to update the corresponding value of the black and white mask; the second headlight group model is rendered using the updated black and white mask acquisition area corresponding value to determine that the white part of the acquisition area of the black and white mask in the second headlight group model corresponds to the light pole model color as the light-on color, and the black part corresponds to the light pole model color as the transparent color.
[0017] Optionally, before rendering the corresponding second vehicle headlight group model using a preset lighting control program, the method further includes:
[0018] Based on a preset parameter control script and the currently displayed time, the current scaling factor and current starting position coordinates of the corresponding initial texture map are determined; the preset parameter control script is used to change the scaling factor and starting position coordinates of the black and white mask over time; the current scaling factor and current starting position coordinates of the initial texture map are used to update the corresponding initial texture map coordinates in the preset light control program.
[0019] Optionally, after overlaying the rendered second headlight model on the position of the first headlight model to display the vehicle light flow effect on the first headlight model based on the displayable lamp post model in the second headlight model, the method further includes:
[0020] In response to the operation of turning off the vehicle lighting effect of a certain headlight group, the display operation of the second headlight group model corresponding to that headlight group is stopped, and the first headlight group model corresponding to that headlight group is displayed instead.
[0021] Secondly, this application provides a vehicle light flow effect display device, comprising:
[0022] The model acquisition module is used to acquire at least one set of first headlight group models and at least one set of corresponding second headlight group models; the first headlight group model and the second headlight group model include multiple lamp post models; the color corresponding to the first headlight group model is the off-light color, and the color corresponding to the second headlight group model is the on-light color.
[0023] The program acquisition module is used to acquire the preset lighting control program corresponding to each second vehicle light group model; the preset lighting control program includes a moving speed parameter.
[0024] The display module is used to display the first headlight group model while simultaneously rendering the corresponding second headlight group model using a preset lighting control program. It controls the displayable lamp post models in the second headlight group model using movement speed parameters and the current displayed time. The rendered second headlight group model is then overlaid on the position of the first headlight group model to display the vehicle light flow effect on the first headlight group model based on the displayable lamp post models in the second headlight group model. The current displayed time is the displayed time of the second headlight group model.
[0025] Thirdly, this application provides an electronic device, including: a processor, and a memory and a transceiver communicatively connected to the processor;
[0026] The memory stores computer-executed instructions; the transceiver is used for sending and receiving data.
[0027] The processor executes computer execution instructions stored in the memory to implement the vehicle light flow effect display method described in any of the above aspects.
[0028] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the vehicle light flow effect display method described in any of the above aspects.
[0029] Fifthly, this application provides a computer program product, including computer execution instructions, which, when executed by a processor, implement the vehicle light flow effect display method described in any of the above aspects.
[0030] The vehicle light flow effect display method, apparatus, equipment, and storage medium provided in this application acquire at least one set of first vehicle headlight group models and at least one corresponding set of second vehicle headlight group models; acquire a preset lighting control program corresponding to each second vehicle headlight group model; while displaying the first vehicle headlight group model, render the corresponding second vehicle headlight group model using the preset lighting control program, and overlay the rendered second vehicle headlight group model at the position of the first vehicle headlight group model. By rendering the second vehicle headlight group model through the preset lighting control program, control is achieved over the displayable lamp post models in the second vehicle headlight group, causing the displayable lamp post models in the second vehicle headlight group model to change with the current display time; by overlaying the first vehicle headlight group model with the second vehicle headlight group model, the color of the lamp posts in the three-dimensional vehicle model is changed using the displayable lamp post models, thereby displaying the flow of vehicle lights on the three-dimensional vehicle model, enhancing the display effect of the vehicle. Furthermore, since the simulation of the vehicle light flow effect is achieved using a lighting control program, there is no need to store a large number of 2D image sequence frames, thus reducing the amount of hard disk space and memory required. Attached Figure Description
[0031] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0032] Figure 1 A flowchart illustrating a method for displaying vehicle light flow effects as provided in this application embodiment;
[0033] Figure 2 This is a schematic diagram of the initial texture map coordinates provided in the embodiments of this application;
[0034] Figure 3 This is a flowchart of the rendering process for the corresponding second headlight assembly model provided in this embodiment;
[0035] Figure 4 This is a schematic diagram of a vehicle light flow effect provided in an embodiment of this application;
[0036] Figure 5 This is a schematic diagram of the structure of the vehicle light flow effect display device provided in the embodiments of this application;
[0037] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0038] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0039] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0040] The terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. In the following descriptions of embodiments, "a plurality of" means two or more, unless otherwise explicitly defined.
[0041] First, the prior art involved in this invention will be described and analyzed in detail.
[0042] One existing method for simulating the flowing effect of vehicle lights involves: acquiring vehicle images; changing the color of the headlight pillars frame-by-frame based on the desired light flow effect to specify the vehicle images where the headlight pillars are illuminated; and creating a 2D image sequence of these illuminated headlight pillar images in the order they illuminate, thus forming a 2D animation of the flowing vehicle lights. This animation is then played to simulate the flowing effect of the vehicle lights. However, because the number of 2D image sequences in the flowing vehicle lights animation is large, storing and playing these rendered light sequence images consumes significant disk resources.
[0043] The inventors discovered during their research that since shader programs can change the display effect of 3D models, a lighting control program can be generated in the shader program. In the lighting control program, a black and white mask can be set to change the color of the headlights of the 3D vehicle model, thereby simulating the flowing effect of vehicle lights. Furthermore, the lighting control program occupies far less memory than 2D image sequence frames, which can reduce the amount of hard disk space required.
[0044] Furthermore, the inventor discovered that a 3D model of a vehicle can be used to display the vehicle during the production and sales process. However, existing methods cannot display the flow of vehicle lights on the 3D model. Therefore, a lighting control program is used to render the headlights on the 3D model, thereby displaying the flow of vehicle lights on the 3D model and enhancing the display effect of the vehicle.
[0045] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0046] Figure 1 This is a flowchart illustrating a method for displaying vehicle light flow effects according to an embodiment of this application. This embodiment addresses the problem of high disk resource consumption when storing and playing a large number of rendered light sequence images, thus necessitating their large number. The method in this embodiment is applied to a vehicle light flow effect display device, which can be located in an electronic device. This electronic device can be a digital computer of various forms, such as a laptop computer, desktop computer, workbench, personal digital assistant, server, blade server, mainframe computer, and other suitable computers.
[0047] like Figure 1 As shown, the specific steps of this method are as follows:
[0048] Step S101: Obtain at least one set of first headlight group models and at least one set of corresponding second headlight group models.
[0049] The second headlight assembly model includes multiple light pole models; the vehicle 3D model includes at least one first headlight assembly model; the first headlight assembly model corresponds to the color when the lights are off, and the second headlight assembly model corresponds to the color when the lights are on.
[0050] Optionally, the first headlight assembly model is the model corresponding to the headlight portion in the vehicle's 3D model, thereby enabling the display of the vehicle's headlights' flowing effect on the vehicle's 3D model.
[0051] In this embodiment, the headlight assembly consists of multiple light columns that can independently display the flow of light. The headlight assembly model is a three-dimensional model of a vehicle headlight assembly. For example, the light columns can be divided into 5 to 7 headlight groups based on whether the light from the multiple light columns can flow independently, and the flow of light from the light columns in each headlight group is independent.
[0052] In this embodiment of the application, the second headlight group model has the same shape and number as the corresponding first headlight group model.
[0053] This application does not limit the method of obtaining the second headlight assembly model. For example, a vehicle 3D model can be copied, the vehicle body part can be removed from the copied vehicle 3D model, the first headlight assembly model in the vehicle 3D model can be retained, and the color of the first headlight assembly model can be changed from the first headlight assembly model to the headlight color to obtain the second headlight assembly model; alternatively, at least one set of second headlight assemblies of the vehicle can be modeled based on the first headlight assembly model in the vehicle 3D model to obtain the second headlight assembly model.
[0054] Step S102: Obtain the preset lighting control program corresponding to each second vehicle headlight group model.
[0055] The preset lighting control program includes movement speed parameters.
[0056] At least one black-and-white masking procedure is provided, and the movement speed parameters of the texture map coordinates corresponding to the black-and-white masking are configured. This embodiment does not display the number of black-and-white masking procedures included in the preset lighting control procedure; this number can be determined based on the desired lighting flow effect.
[0057] It should be understood that a shader program (or shader) is an editable program that can be used to render the second headlight assembly, replacing a fixed rendering pipeline. The shader program includes a pixel shader; the pixel shader is primarily responsible for calculating fragment colors, etc. Therefore, the shader program can pre-determine whether each headlight column model in the second headlight assembly can be displayed by changing its color or transparency. In this embodiment, the lighting control program can be a shader program.
[0058] In this embodiment, each second headlight assembly model corresponds to a preset lighting control program. The preset lighting control program is used to control the display of the light flow effect of the corresponding headlight assembly model.
[0059] Optionally, at least one black and white mask can be set in the preset lighting control program. The white and black parts of the black and white mask are used to determine the displayable and non-displayable lamp post models. Furthermore, the movement speed parameters of the texture map coordinates corresponding to the black and white mask are configured in the preset lighting control program, thereby causing relative movement of the texture map corresponding to the black and white mask and changing the headlight assembly models corresponding to the white and black parts of the black and white mask, respectively.
[0060] The texture mapping coordinates are UV mapping coordinates, or simply UV coordinates. UV coordinates are two-dimensional coordinates associated with each vertex on the surface of the 3D model. By assigning UV coordinates to the vertices of the model, the corresponding position of the model on the image can be determined, thereby correctly applying textures to the model. In this embodiment, the UV coordinates are used to determine the corresponding position of each lamp post model in the second vehicle headlight assembly model on the black and white mask, thereby determining whether each lamp post model corresponds to the white or black part of the black and white mask.
[0061] Step S103: While displaying the first headlight group model, the corresponding second headlight group model is rendered using a preset lighting control program, and the rendered second headlight group model is overlaid on the position of the first headlight group model.
[0062] In this embodiment, when rendering the corresponding second vehicle headlight group model using a preset lighting control program, the displayable lamp post models in the second vehicle headlight group model are controlled by the movement speed parameter and the currently displayed time. Furthermore, the rendered second vehicle headlight group model is overlaid on the position of the first vehicle headlight group model, allowing the displayable lamp post models in the second vehicle headlight group model to showcase the vehicle's light flow effect on the 3D vehicle model.
[0063] The currently displayed time is the time already displayed for the second headlight group model.
[0064] In this embodiment of the application, while displaying the first vehicle headlight group model, the displayable lamp post model in the second vehicle headlight group model is also displayed. The displayable lamp post model in the second vehicle headlight group model covers the corresponding displayable lamp post model in the vehicle three-dimensional model, so that the lamp post color corresponding to the displayable lamp post model in the displayed vehicle headlight group is the on-light color, and the lamp post color corresponding to the non-displayable lamp post model is the off-light color.
[0065] In this embodiment of the application, when displaying the second vehicle headlight group model, the second vehicle headlight group model is rendered at certain time intervals and according to the display time of the second vehicle headlight group model, so as to update the displayable lamp post model in the second vehicle headlight group model, and the second vehicle headlight group model is displayed according to the updated displayable lamp post model.
[0066] The vehicle light flow effect display method provided in this application embodiment obtains at least one set of first vehicle headlight group models and at least one corresponding set of second vehicle headlight group models; obtains a preset lighting control program corresponding to each second vehicle headlight group model; while displaying the first vehicle headlight group model, the preset lighting control program is used to render the corresponding second vehicle headlight group model, and the rendered second vehicle headlight group model is overlaid on the position of the first vehicle headlight group model. By rendering the second vehicle headlight group model through the preset lighting control program, the displayable light column models are controlled, causing the displayable light column models in the second vehicle headlight group model to change with the current display time; by overlaying the first vehicle headlight group model with the second vehicle headlight group model, the color of the light column is changed using the displayable light column models, thereby displaying the flow of vehicle lights and enhancing the display effect of the vehicle. Furthermore, since the simulation of the vehicle light flow effect is achieved using a lighting control program, and since there is no need to store a large number of 2D image sequence frames, the amount of hard disk space and memory occupied is reduced.
[0067] In one application scenario, a 3D model of the vehicle can be used to display the vehicle. Specifically, this can include: displaying the 3D model of the vehicle on a user terminal; in response to the operation of turning on the vehicle lighting effects, obtaining at least one set of second headlight group models corresponding to the 3D model of the vehicle, and obtaining the preset lighting control program corresponding to each second headlight group model; rendering the corresponding second headlight group model using each preset lighting control program, and overlaying the rendered second headlight group model on the position of the first headlight group model of the displayed 3D model of the vehicle, so as to display the vehicle lighting flow effect on the 3D model of the vehicle based on the change of the displayable lamp post model in the second headlight group model.
[0068] Based on the above embodiments, after displaying the second vehicle headlight assembly model, it may further include:
[0069] In response to the operation of turning off the vehicle lighting effect of a certain headlight group, the display operation of the second headlight group model corresponding to that headlight group is stopped, and the first headlight group model corresponding to that headlight group is displayed instead.
[0070] In this embodiment of the application, after stopping the display operation of the second headlight group model corresponding to the headlight group, the position of the first headlight group model of the vehicle three-dimensional model will not cover the second headlight group model, so that the color of the headlight group is displayed as the color of the first headlight group model, that is, the color when the lights are off.
[0071] The vehicle light flow effect display method provided in this application embodiment, in response to the operation of turning off the vehicle light effect of a certain light group, stops the display operation of the second light group model corresponding to that light group, and displays the first light group model corresponding to that light group. This allows for the display of vehicle light flow effects only for a portion of the light groups, increasing the richness of vehicle light flow effect display methods.
[0072] Based on the above embodiments, before step S101, a lighting control program needs to be pre-set. The steps for generating the pre-set lighting control program can be as follows:
[0073] Step S201: Configure a black and white mask in the initial lighting control program and determine the initial texture map coordinates corresponding to the black and white mask.
[0074] Specifically, a black and white mask can be created and initialized, the image of the black and white mask can be obtained, and the image of the black and white mask can be configured as the image of the initialized black and white mask, so as to realize the configuration of the initialized black and white mask.
[0075] It should be understood that this example describes the steps for configuring a black and white mask. If the preset lighting control program includes multiple black and white mask programs, steps S201 to S205 can be repeated to configure multiple black and white masks.
[0076] Step S202: Determine the movement speed parameter value of the initial texture map coordinates corresponding to the black and white mask.
[0077] In this embodiment, the movement speed parameter value of the initial texture map coordinates corresponding to the black and white mask can be determined based on the speed of the light flow.
[0078] For example, the speed of the vehicle's light flow in a 2D animation can be determined by parsing the light flow, and the movement speed parameter value of the initial texture map coordinates corresponding to the black and white mask can be determined based on the speed of the light flow and the calculation formula of the texture map coordinates. Alternatively, the movement speed parameter value of the initial texture map coordinates can be determined based on user input.
[0079] Step S203: Configure the calculation formula for texture map coordinates to obtain the calculated texture map coordinates through the calculation formula.
[0080] The parameters in the formula for calculating texture map coordinates include: initial texture map coordinates, movement speed parameter, and time parameter.
[0081] In this embodiment of the application, the formula for calculating the texture map coordinates can be based on changing the initial texture map coordinates based on the movement speed parameter and the time parameter. For example, the initial texture map coordinates can be accumulated based on the product of the movement speed parameter and the time parameter.
[0082] Step S204: Associate the black and white mask with the corresponding calculated texture map coordinates, and determine the sampling area of the black and white mask based on the associated calculated texture map coordinates.
[0083] Step S205: Determine the acquisition area using a black and white mask to display the corresponding second vehicle headlight model.
[0084] The black and white masking area is the black and white masking area corresponding to the calculated texture map coordinates.
[0085] In this embodiment, the graphic corresponding to the texture map coordinates is the graphic of each lamp post in the second headlight group model. By associating the black and white mask with the corresponding calculated texture map coordinates, the corresponding area of the graphic of each lamp post model in the second headlight group model on the black and white mask can be determined by the calculated texture map coordinates. The corresponding area of the graphic of each lamp post model on the black and white mask is determined as the acquisition area of the black and white mask, and the acquisition area of the black and white mask is used to display the corresponding second headlight group model.
[0086] The vehicle light flow effect display method provided in this application embodiment pre-sets a light control program, including: configuring a black and white mask in the initial light control program and determining the initial texture map coordinates corresponding to the black and white mask; determining the movement speed parameter value of the initial texture map coordinates corresponding to the black and white mask; configuring a calculation formula for the texture map coordinates to obtain the calculated texture map coordinates through the calculation formula; the parameters in the calculation formula for the texture map coordinates include: the initial texture map coordinates, the movement speed parameter, and the time parameter; associating the black and white mask with the corresponding calculated texture map coordinates to determine the acquisition area of the black and white mask based on the associated calculated texture map coordinates; the acquisition area of the black and white mask is the black and white mask area corresponding to the calculated texture map coordinates; and determining to use the acquisition area of the black and white mask to display the corresponding second vehicle light group model. The movement speed parameter and time parameter of the initial texture map coordinates corresponding to the black and white mask are used to calculate the texture map coordinates corresponding to the black and white mask. This makes the acquisition area of the black and white mask change with time, so that the black and white mask can control the displayable lamp post model in the second vehicle headlight group model. This allows the vehicle light flow effect to be displayed on the vehicle 3D model, enhancing the display effect of the vehicle.
[0087] In one optional implementation, the black and white mask can be arranged from left to right as: a rectangular black portion, a rectangular white portion, and a rectangular black portion; then the step of determining the initial texture map coordinates corresponding to the black and white mask in step S201 may include:
[0088] Step S2011: Unfold the texture coordinates of the second headlight assembly model to obtain the original texture coordinates.
[0089] Step S2012: Convert the original texture map coordinates according to a preset mode to obtain the changed original texture map coordinates. The changed original texture map coordinates present the horizontal distribution of the corresponding graphics of each lamp post, and make each lamp post graphic rectangular.
[0090] Step S2013: Determine the coordinates of the changed original texture map as the coordinates of the initial texture map corresponding to the black and white mask.
[0091] Furthermore, in the formula for calculating the initial texture map coordinates, the vertical coordinate of the initial texture map coordinates remains unchanged, while the horizontal coordinate changes with the value of the time parameter.
[0092] It should be understood that UV unwrapping of the second headlight assembly model can obtain the original texture map coordinates of the second headlight assembly model. The shapes and arrangements of the lamp posts corresponding to the original texture map coordinates are similar to those in the second headlight assembly model. Since the distribution of the lamp posts in the second headlight assembly model is curved, the arrangement of the shapes corresponding to the lamp posts corresponding to the original texture map coordinates is also curved.
[0093] In this embodiment, the original texture map coordinates are transformed according to a preset mode, so that the corresponding graphics of each lamp post are horizontally distributed and each lamp post graphic is rectangular. For example... Figure 2 As shown, the UV unwrapping of the second car headlight group model, where each lamp post is distributed in a curved shape, is performed to obtain the original texture map coordinates. After organizing the original texture map coordinates, the horizontal distribution of the corresponding graphic of each lamp post can be obtained, and the initial texture map coordinates of each lamp post graphic can be made into a rectangle.
[0094] In this embodiment, the black and white parts in the black and white mask are horizontally distributed, and the graphics corresponding to each lamp post presented by the initial texture map coordinates are horizontally distributed. Therefore, by changing the horizontal coordinate of the initial texture map coordinates based on the time parameter, the displayable lamp post corresponding to the white part in the black and white mask can change with time.
[0095] It should be understood that, in another alternative implementation, the black and white parts in the black and white mask can be vertically distributed, and the corresponding graphics of each lamp post presented by the initial texture map coordinates are vertically distributed. Furthermore, in the calculation formula for configuring the texture map coordinates, the horizontal coordinate of the initial texture map coordinates remains unchanged, while the vertical coordinate changes with the value of the time parameter.
[0096] Based on the above embodiments, when pre-setting the lighting control program, it is also necessary to set the color mixing method of the black and white mask. Figure 3 This embodiment provides a flowchart for rendering the corresponding second headlight assembly model. A step for rendering the corresponding second headlight assembly model using a preset lighting control program may include:
[0097] Step S301: Determine the currently displayed time as the current time parameter value.
[0098] In this embodiment of the application, when displaying the second vehicle headlight assembly model, the model can be rendered at certain time intervals. During the rendering of the second vehicle headlight assembly model, the current displayed time is determined and set as the current time parameter value.
[0099] Step S302: Substitute the current time parameter value, the movement speed parameter value, and the initial texture map coordinates corresponding to the second headlight group model into the texture map coordinate calculation formula, and determine the calculation result as the calculated texture map coordinates.
[0100] Step S303: Determine the black and white masking area corresponding to the calculated texture map coordinates as the black and white masking sampling area.
[0101] In this embodiment, the current time parameter value, the moving speed parameter value, and the initial texture map coordinates corresponding to the second vehicle headlight group model are substituted into the texture map coordinate calculation formula. This allows the calculated texture map coordinates to change with the current time parameter value. Since the acquisition area of the black and white mask is determined by the calculated texture map coordinates, the acquisition area of the fixed black and white mask can change with the current time parameter value, that is, the change of the currently displayed time.
[0102] Step S304A: Use the black and white mask to determine whether each lamp post model in the second vehicle headlight group model is transparent.
[0103] Step S305A: Render the second vehicle headlight assembly model according to whether each light pillar model is transparent, so as to determine the opaque light pillar models as the displayable light pillar models.
[0104] It should be understood that the color of the second headlight assembly model can be determined by the corresponding RGBA channel. RGBA is a color space model consisting of the RGB color space and the Alpha channel. RGBA represents Red, Green, Blue, and the Alpha channel. The RGB color space uses the colors employed by RGBA, while the Alpha channel represents the image's opacity parameter.
[0105] In this embodiment, the acquisition area of the black and white mask can be applied to the Alpha channel of the second vehicle headlight assembly model. This allows the value of the acquisition area of the black and white mask to determine the transparency of the second vehicle headlight assembly model, determine whether each lamp post model in the second vehicle headlight assembly model is transparent, make the opaque lamp post model a displayable lamp post model, and make the transparent lamp post model a non-displayable lamp post model.
[0106] Another step in rendering the corresponding second headlight assembly model using a preset lighting control program may include:
[0107] Step S301: Determine the currently displayed time as the current time parameter value.
[0108] Step S302: Substitute the current time parameter value, the movement speed parameter value, and the initial texture map coordinates corresponding to the second headlight group model into the texture map coordinate calculation formula, and determine the calculation result as the calculated texture map coordinates.
[0109] Step S303: Determine the black and white masking area corresponding to the calculated texture map coordinates as the black and white masking sampling area.
[0110] In this embodiment of the application, steps S301 to S303 are similar to the steps S301 to S303 described above, and will not be repeated here.
[0111] Step S304B: Multiply the corresponding value of the black and white mask by the corresponding value of the light-on color to update the corresponding value of the black and white mask.
[0112] Step S305B: Render the second headlight assembly model using the updated black and white mask's corresponding acquisition area values to determine that the white part of the acquisition area of the black and white mask in the second headlight assembly model corresponds to the light pole model color as the light-on color, and the black part corresponds to the light pole model color as the transparent color.
[0113] It should be understood that the embodiments of this application do not limit the execution order of steps S303 and S304B, and they can be executed simultaneously or sequentially.
[0114] The value corresponding to the light-on color can be the RGB value of the light-on color.
[0115] In this embodiment, since the white portion of the black and white mask corresponds to a value of 1 and the black portion corresponds to a value of 0, after multiplying the corresponding value of the black and white mask by the corresponding value of the light-on color, the corresponding value of the black portion remains 0, while the corresponding value of the white portion is the RGB value corresponding to the light-on color. This allows the acquisition area of the black and white mask to be applied to the RGB color space of the second vehicle headlight model, thereby making the white portion of the light column model corresponding to the light column model the light-on color, and the black portion corresponding to the light column model the transparent color. This makes the light column models with the light-on color visible, and the light column models with the transparent color invisible.
[0116] In one optional implementation, before rendering the corresponding second headlight assembly model using a preset lighting control program, the following may also be included:
[0117] Step S401: Based on the preset parameter control script and the currently displayed time, determine the current scaling factor and the current starting position coordinates of the corresponding initial texture map coordinates.
[0118] Step S402: Update the corresponding initial texture map coordinates in the preset light control program using the current scaling factor and the current starting position coordinates of the initial texture map coordinates.
[0119] The preset parameter control script is used to change the scaling factor and starting position coordinates of the black and white mask over time. The scaling factor parameter is called Tiling, and the starting position coordinate parameter is called Offset. Offset refers to the starting position of the texture, with a value range of 0-1. Tiling refers to the size of the area sampled from the Offset position. The value range of Tiling is generally (-1, 1). If it exceeds this range, a new area will be generated proportionally and stitched onto the original.
[0120] In this embodiment, by adjusting the scaling factor and the starting position coordinates, the number of light pillar models corresponding to the white part of the acquisition area of the black and white mask can be changed, thereby changing the number of displayable light pillar models and enriching the displayable light flow effects.
[0121] The following example illustrates the method for displaying vehicle light flow effects provided in the above embodiments. Figure 4 This is a schematic diagram of a vehicle light flow effect provided in an embodiment of this application, such as... Figure 4 As shown, starting from the right-hand starting column of the second vehicle headlight model, the columns are lit up sequentially. After the lit column becomes the last column, the last column is kept lit continuously. Again, starting from the right-hand starting column, the columns are lit up sequentially. After the lit column becomes the last column, a constantly lit column is added at the end.
[0122] Therefore, the light flow effect can be broken down into a light flow effect and a light accumulation effect. For the light flow effect, a first black-and-white mask can be set in the preset light control program of the second vehicle headlight model. The movement speed parameter of the first black-and-white mask should not be 0, and the white portion of the first black-and-white mask should correspond to only one lamppost model, thus achieving the light flow effect. For the light accumulation effect, a second black-and-white mask can be set. The movement speed parameter of the second black-and-white mask can be set to 0, so that the white portion of the second black-and-white mask does not correspond to a lamppost model at the start of display. Using a preset parameter control script, when displaying the second vehicle headlight model, the number of lamppost models corresponding to the white portion of the second black-and-white mask is increased by updating the current scaling factor and the current starting position coordinates, thus achieving the light accumulation effect.
[0123] Figure 5This is a schematic diagram of the vehicle light flow effect display device provided in an embodiment of this application. The vehicle light flow effect display device provided in this embodiment can execute the processing flow provided in the vehicle light flow effect display method embodiment. For example... Figure 5 As shown, the vehicle light flow effect display device 50 includes: a model acquisition module 501, a program acquisition module 502, and a display module 503.
[0124] Specifically, the model acquisition module 501 is used to acquire at least one set of first vehicle headlight group models and at least one set of corresponding second vehicle headlight group models; the first vehicle headlight group model and the second vehicle headlight group model include multiple lamp post models; the color corresponding to the first vehicle headlight group model is the off color, and the color corresponding to the second vehicle headlight group model is the on color;
[0125] The program acquisition module 502 is used to acquire the preset lighting control program corresponding to each second vehicle light group model; the preset lighting control program includes the movement speed parameter.
[0126] The display module 503 is used to display the first vehicle headlight group model while simultaneously rendering the corresponding second vehicle headlight group model using a preset lighting control program. It controls the displayable lamp post models in the second vehicle headlight group model using movement speed parameters and the current displayed time. The rendered second vehicle headlight group model is then overlaid on the position of the first vehicle headlight group model to display the vehicle light flow effect on the first vehicle headlight group model based on the displayable lamp post models in the second vehicle headlight group model. The current displayed time is the displayed time of the second vehicle headlight group model.
[0127] The apparatus provided in this application embodiment can be specifically used to execute the method embodiment provided in the above embodiment, and the specific functions will not be repeated here.
[0128] Optionally, the vehicle light flow effect display device also includes: a program generation module, which is used for:
[0129] In the initial lighting control program, a black and white mask is configured, and the initial texture map coordinates corresponding to the black and white mask are determined; the movement speed parameter value of the initial texture map coordinates corresponding to the black and white mask is determined; the calculation formula for the texture map coordinates is configured to obtain the calculated texture map coordinates through the calculation formula; the parameters in the calculation formula for the texture map coordinates include: initial texture map coordinates, movement speed parameter, and time parameter; the black and white mask is associated with the corresponding calculated texture map coordinates to determine the acquisition area for the black and white mask based on the associated calculated texture map coordinates; the acquisition area of the black and white mask is the black and white mask area corresponding to the calculated texture map coordinates; the acquisition area of the black and white mask is used to display the corresponding second headlight group model.
[0130] Optionally, the black and white mask, from left to right, consists of: a rectangular black portion, a rectangular white portion, and a rectangular black portion. The program generation module is specifically used for: unfolding the texture coordinates of the second headlight assembly model to obtain the original texture coordinates; transforming the original texture coordinates according to a preset mode to obtain the changed original texture coordinates, where the changed original texture coordinates present a horizontally distributed graphic corresponding to each light pillar, and each light pillar graphic is rectangular; determining the changed original texture coordinates as the initial texture coordinates corresponding to the black and white mask; configuring the formula for calculating the texture coordinates so that the vertical coordinate of the initial texture coordinates remains unchanged, while the horizontal coordinate changes with the value of the time parameter.
[0131] Optionally, the display module is specifically used for: determining the currently displayed time as the current time parameter value; substituting the current time parameter value, the movement speed parameter value, and the initial texture map coordinates corresponding to the second headlight group model into the texture map coordinate calculation formula, and determining the calculation result as the calculated texture map coordinates; determining the black and white mask area corresponding to the calculated texture map coordinates as the black and white mask acquisition area, and using the black and white mask acquisition area to determine whether each lamp post model in the second headlight group model is transparent; rendering the second headlight group model according to whether each lamp post model is transparent, so as to determine the opaque lamp post model as the displayable lamp post model.
[0132] Optionally, in the black and white mask, the white portion corresponds to a value of 1, and the black portion corresponds to a value of 0; the display module is further used for:
[0133] The currently displayed time is determined as the current time parameter value; the current time parameter value, the movement speed parameter value, and the initial texture map coordinates corresponding to the second headlight group model are substituted into the texture map coordinate calculation formula, and the calculation result is determined as the calculated texture map coordinates; the black and white mask area corresponding to the calculated texture map coordinates is determined as the black and white mask acquisition area; the corresponding value of the black and white mask is multiplied by the corresponding value of the light-on color to update the corresponding value of the black and white mask; the updated black and white mask acquisition area corresponding value is used to render the second headlight group model, so that the white part of the acquisition area of the black and white mask in the second headlight group model corresponds to the light pole model color as the light-on color, and the black part corresponds to the light pole model color as the transparent color.
[0134] Optionally, the display module is also used to: determine the current scaling factor and current starting position coordinates of the corresponding initial texture map coordinates based on a preset parameter control script and the current displayed time; the preset parameter control script is used to change the scaling factor and starting position coordinates of the black and white mask over time; and update the corresponding initial texture map coordinates in the preset light control program using the current scaling factor and current starting position coordinates of the initial texture map coordinates.
[0135] Optionally, the display module is further configured to: in response to the operation of turning off the vehicle lighting effect of a certain vehicle light group, stop the display operation of the second vehicle light group model corresponding to that vehicle light group, so as to display the first vehicle light group model corresponding to that vehicle light group.
[0136] The apparatus provided in this application embodiment can be specifically used to execute the above method embodiments, and its specific functions will not be described in detail here.
[0137] Figure 6 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application, such as... Figure 6 As shown, this application also provides an electronic device 60, including: a processor 601, and a memory 602 and a transceiver 603 communicatively connected to the processor 601. The memory 602 stores computer-executable instructions; the transceiver 603 is used for sending and receiving data; the processor 601 executes the computer-executable instructions stored in the memory 602 to implement the method provided in any embodiment of this application.
[0138] Specifically, the program may include program code, which includes computer-executable instructions. Memory 602 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device. The computer-executable instructions are stored in memory 602 and configured to be executed by processor 601 to implement the method provided in any embodiment of this application. Related descriptions can be understood by referring to the relevant descriptions and effects corresponding to the steps in the accompanying drawings, and will not be elaborated upon here.
[0139] In this embodiment, the memory 602 and the processor 601 are connected via a bus. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 6 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0140] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method provided in any embodiment of this application.
[0141] This application also provides a computer program product, including computer execution instructions, which, when executed by a processor, implement the method provided in any embodiment of this application.
[0142] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.
[0143] The modules described as separate components may or may not be physically separate. Similarly, the components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0144] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated module can be implemented in hardware or in a combination of hardware and software functional modules.
[0145] The program code used to implement the methods of this application may be written in any combination of one or more programming languages. This program code may be provided to the processor or controller of a general-purpose computer, special-purpose computer, or other programmable full-path fusion device, such that when executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0146] In the context of this application, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0147] Furthermore, although the operations are described in a specific order, this should be understood as requiring that such operations be performed in the specific order shown or in sequential order, or requiring that all illustrated operations be performed to achieve the desired result. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this application. Certain features described in the context of individual embodiments may also be implemented in combination in a single implementation. Conversely, various features described in the context of a single implementation may also be implemented individually or in any suitable sub-combination in multiple implementations.
[0148] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0149] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for displaying vehicle light flow effects, characterized in that, include: Obtain at least one set of first headlight group models and at least one corresponding set of second headlight group models; the first headlight group model and the second headlight group model include multiple lamp post models; the color corresponding to the first headlight group model is the off-light color, and the color corresponding to the second headlight group model is the on-light color; Obtain the preset lighting control program corresponding to each second vehicle headlight group model; the preset lighting control program includes movement speed parameters; While displaying the first headlight group model, a preset lighting control program is used to render the corresponding second headlight group model, so as to control the displayable lamp post model in the second headlight group model using the moving speed parameter and the current display time. The rendered second headlight model is overlaid on the first headlight model to display the vehicle light flow effect on the first headlight model based on the displayable light column model in the second headlight model. The current display time is the display time of the second headlight model.
2. The method according to claim 1, characterized in that, The steps for generating a preset lighting control program include: Configure a black and white mask in the initial lighting control program and determine the initial texture map coordinates corresponding to the black and white mask; Determine the movement speed parameter value of the initial texture map coordinates corresponding to the black and white mask; Configure the calculation formula for texture map coordinates to obtain the calculated texture map coordinates; the parameters in the calculation formula for texture map coordinates include: initial texture map coordinates, movement speed parameter, and time parameter; The black and white mask is associated with the corresponding calculated texture map coordinates, and the sampling area of the black and white mask is determined based on the associated calculated texture map coordinates; the sampling area of the black and white mask is the black and white mask area corresponding to the calculated texture map coordinates. The corresponding second vehicle headlight assembly model is displayed using a black-and-white masked acquisition area.
3. The method according to claim 2, characterized in that, The black and white mask, from left to right, consists of: a rectangular black area, a rectangular white area, and a rectangular black area. Determining the initial texture map coordinates corresponding to the black and white mask includes: The texture coordinates of the second headlight assembly model are unfolded to obtain the original texture coordinates. The original texture map coordinates are transformed according to a preset mode to obtain the changed original texture map coordinates. The changed original texture map coordinates present the horizontal distribution of the corresponding graphics of each lamp post, and make each lamp post graphic rectangular. The coordinates of the original texture map after the change are determined as the coordinates of the initial texture map corresponding to the black and white mask; The formula for calculating texture map coordinates includes: In the formula for calculating the texture map coordinates, the ordinate of the initial texture map coordinates remains unchanged, while the abscissa changes with the value of the time parameter.
4. The method according to claim 2, characterized in that, The step of rendering the corresponding second vehicle headlight group model using a preset lighting control program, and controlling the displayable lamp post model in the second vehicle headlight group model using movement speed parameters and the currently displayed time, includes: Set the currently displayed time as the current time parameter value; Substitute the current time parameter value, the moving speed parameter value, and the initial texture map coordinates corresponding to the second headlight group model into the texture map coordinate calculation formula, and determine the calculation result as the calculated texture map coordinates; The black and white mask area corresponding to the calculated texture map coordinates is determined as the black and white mask acquisition area, and the black and white mask acquisition area is used to determine whether each lamp post model in the second headlight group model is transparent. The second vehicle headlight assembly model is rendered based on whether each headlight column model is transparent, in order to determine which opaque headlight column models are the ones that can be displayed.
5. The method according to claim 2, characterized in that, The white portion of the black and white mask corresponds to a value of 1, and the black portion corresponds to a value of 0. A preset lighting control program is used to render the corresponding second vehicle headlight assembly model. The displayable light pillar models within the second vehicle headlight assembly model are controlled using movement speed parameters and the current displayed time, including: Set the currently displayed time as the current time parameter value; Substitute the current time parameter value, the moving speed parameter value, and the initial texture map coordinates corresponding to the second headlight group model into the texture map coordinate calculation formula, and determine the calculation result as the calculated texture map coordinates; The black and white mask area corresponding to the calculated texture map coordinates is determined as the sampling area of the black and white mask; Multiply the value corresponding to the black and white mask by the value corresponding to the light-on color to update the value corresponding to the black and white mask; The updated black and white mask's acquisition area values are used to render the second headlight assembly model, so that the white part of the acquisition area of the black and white mask in the second headlight assembly model corresponds to the color of the lamp post model as the light-on color, and the black part corresponds to the color of the lamp post model as the transparent color.
6. The method according to any one of claims 1-5, characterized in that, Before rendering the corresponding second headlight group model using a preset lighting control program, the process also includes: Based on a preset parameter control script and the currently displayed time, the current scaling factor and current starting position coordinates of the corresponding initial texture map are determined; the preset parameter control script is used to change the scaling factor and starting position coordinates of the black and white mask over time. The initial texture map coordinates in the preset lighting control program are updated using the current scaling factor and the current starting position coordinates of the initial texture map coordinates.
7. The method according to any one of claims 1-5, characterized in that, After overlaying the rendered second headlight model on the position of the first headlight model to display the vehicle light flow effect on the first headlight model based on the displayable lamp post model in the second headlight model, the method further includes: In response to the operation of turning off the vehicle lighting effect of a certain headlight group, the display operation of the second headlight group model corresponding to that headlight group is stopped, and the first headlight group model corresponding to that headlight group is displayed instead.
8. A vehicle light flow effect display device, characterized in that, include: The model acquisition module is used to acquire at least one set of first headlight group models and at least one set of corresponding second headlight group models; the first headlight group model and the second headlight group model include multiple lamp post models; the color corresponding to the first headlight group model is the off-light color, and the color corresponding to the second headlight group model is the on-light color. The program acquisition module is used to acquire the preset lighting control program corresponding to each second vehicle light group model; the preset lighting control program includes a moving speed parameter. The display module is used to display the first vehicle headlight group model while rendering the corresponding second vehicle headlight group model using a preset lighting control program. The displayable lamp post model in the second vehicle headlight group model is controlled by the moving speed parameter and the current display time. The rendered second headlight model is overlaid on the first headlight model to display the vehicle light flow effect on the first headlight model based on the displayable light column model in the second headlight model. The current display time is the display time of the second headlight model.
9. An electronic device, characterized in that, include: A processor, and a memory and a transceiver communicatively connected to the processor; The memory stores computer-executed instructions; the transceiver is used for sending and receiving data. The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-7.
Citation Information
Patent Citations
Atmosphere lamp equipment, lamp effect projection playing method and device, medium and product
CN117794021A
