Car model rendering method and device, electronic equipment and storage medium

CN115457184BActive Publication Date: 2026-09-29BEIJING CO WHEELS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210236359.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-11
Publication Date
2026-09-29
Estimated Expiration
2042-03-11

AI Technical Summary

Technical Problem

然而,在目前的车载环视系统中,用户无法查看车辆底部的环境,因此可能因无法查看车辆底部的环境导致行车或泊车过程中存在不安全隐患

Benefits of technology

[0025]本申请实施例提供的技术方案与现有技术相比具有如下优点:本申请实施例中,基于目标变换矩阵,将车辆对应的车模的各个车轮部分和环境数据渲染到第一初始帧缓存对象FBO,得到第一FBO;基于该目标变换矩阵,将该车模的车身部分渲染到第二初始FBO,得到第二FBO,第二初始FBO的大小与第一初始FBO的大小相同;将第二FBO所绑定的纹理渲染到第一FBO,得到目标FBO,该目标FBO所绑定的纹理中,该车身部分的透明度为第一透明度,第一透明度小于或等于透明度阈值;将该目标FBO输出到屏幕。本方案中,通过将车模分为各个车轮部分和车身部分,然后分别对各个车轮部分和车身部分进行渲染,再将渲染后的车身部分,渲染到渲染后的各个车轮部分上,以实现车身部分的透明度小于或等于透明度阈值,即车身部分具有一定的透明度,如此可以透过具有一定透明度的车身部分查看车辆底部的环境,进而可以提高行车安全和泊车安全。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115457184B_ABST
    Figure CN115457184B_ABST
Patent Text Reader

Abstract

The application relates to a vehicle model rendering method and device, electronic equipment and a storage medium. The method comprises the following steps: rendering each wheel part of a vehicle model corresponding to a vehicle and environment data to a first initial FBO based on a target transformation matrix to obtain a first FBO; rendering a body part of the vehicle model to a second initial FBO based on the target transformation matrix to obtain a second FBO, the size of the second initial FBO being the same as that of the first initial FBO; rendering a texture bound by the second FBO to the first FBO to obtain a target FBO, in the texture bound by the target FBO, the transparency of the body part is a first transparency, and the first transparency is less than or equal to a transparency threshold; and outputting the target FBO to a screen. The method can realize the effect that the body part of the rendered vehicle model has a certain transparency, so that the environment under the vehicle can be viewed through the body part with a certain transparency, and the driving safety and parking safety are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of automotive technology, and in particular to a method, apparatus, electronic device, and storage medium for rendering car models. Background Technology

[0002] With the continuous development of science and technology and the continuous improvement of people's living standards, driving safety and parking safety have received increasing attention.

[0003] Currently, while driving, users can use in-vehicle surround view systems to view the environment around their vehicle, enabling safe driving or parking. However, current in-vehicle surround view systems do not allow users to view the environment under the vehicle, potentially leading to safety hazards during driving or parking due to this lack of visibility. Summary of the Invention

[0004] This application provides a vehicle model rendering method, apparatus, electronic device, and storage medium, which can achieve a certain degree of transparency in the body part of the rendered vehicle model, thereby allowing the environment under the vehicle to be viewed through the transparent body part, thus improving driving safety and parking safety.

[0005] In a first aspect, this application provides a vehicle model rendering method, comprising: rendering each wheel part and environment data of the vehicle model corresponding to the vehicle to a first initial FBO based on a target transformation matrix, to obtain a first FBO; rendering the body part of the vehicle model to a second initial FBO based on the target transformation matrix, to obtain a second FBO, wherein the size of the second initial FBO is the same as that of the first initial FBO; rendering the texture bound to the second FBO to the first FBO, to obtain a target FBO, wherein the transparency of the body part in the texture bound to the target FBO is a first transparency, wherein the first transparency is less than or equal to a transparency threshold; and outputting the target FBO to the screen.

[0006] Optionally, the first transparency is greater than or equal to 0.2 and less than or equal to 0.8.

[0007] Optionally, before rendering the texture bound to the second FBO to the first FBO to obtain the target FBO, the method further includes: determining the transparency corresponding to the user instruction as the first transparency.

[0008] Optionally, before rendering the texture bound to the second FBO to the first FBO to obtain the target FBO, the method further includes: if the road conditions on which the vehicle is traveling include the target object, determining the transparency corresponding to the target object as the first transparency.

[0009] Optionally, the method further includes: setting the transparency of the pixels corresponding to the body part to a first transparency among all pixels after texture sampling in the fragment shader during the process of rendering the texture bound to the second FBO to the first FBO, and the transparency of pixels other than the body part to 0.

[0010] Optionally, in the texture bound to the second FBO, except for the body part, the pixel value of each pixel is a first default value; the pixel corresponding to the body part is a pixel whose pixel value is greater than or equal to a preset threshold, and the pixel outside the body part is a pixel whose pixel value is less than the preset threshold.

[0011] Optionally, before rendering the body portion of the car model to the second initial FBO based on the target transformation matrix and obtaining the second FBO, the method further includes setting the pixel values ​​of all pixels in the viewport area of ​​the screen corresponding to the second initial FBO to a first default value.

[0012] Optionally, the setting, during the process of rendering the texture bound to the second FBO to the first FBO, includes setting the transparency of the pixels corresponding to the body portion of all pixels after texture sampling in the fragment shader to a first transparency, and setting the transparency of pixels other than the body portion to 0. This includes setting the transparency of all pixels after texture sampling in the fragment shader to a first transparency during the process of rendering the texture bound to the second FBO to the first FBO, and setting the transparency of pixels whose pixel value is less than the first default value and whose transparency is less than the preset threshold to 0.

[0013] Secondly, this application provides a vehicle model rendering apparatus, comprising: a rendering module and an output module; the rendering module is used to render the wheel parts and environment data of the vehicle model corresponding to the vehicle to a first initial frame buffer object (FBO) based on a target transformation matrix, to obtain a first FBO; based on the target transformation matrix, render the body part of the vehicle model to a second initial FBO, to obtain a second FBO, the size of the second initial FBO being the same as the size of the first initial FBO; and render the texture bound to the second FBO to the first FBO, to obtain a target FBO, wherein the transparency of the body part in the texture bound to the target FBO is a first transparency, the first transparency being less than or equal to a transparency threshold; the output module is used to output the target FBO to a screen.

[0014] Optionally, the first transparency is greater than or equal to 0.2 and less than or equal to 0.8.

[0015] Optionally, the vehicle model rendering device further includes: a determining module; the determining module is used to determine the transparency corresponding to the user instruction as the first transparency before the rendering module renders the texture bound to the second FBO to the first FBO to obtain the target FBO.

[0016] Optionally, the vehicle model rendering device further includes: a determining module; the determining module is used to determine the transparency corresponding to the target object as the first transparency before the rendering module renders the texture bound to the second FBO to the first FBO to obtain the target FBO, if the road conditions on which the vehicle is traveling include the target object.

[0017] Optionally, the vehicle model rendering device further includes: a setting module; the setting module is used to set the transparency of the pixels corresponding to the vehicle body part to a first transparency among all pixels after texture sampling in the fragment shader during the process of rendering the texture bound to the second FBO to the first FBO, and the transparency of pixels other than the vehicle body part to 0.

[0018] Optionally, in the texture bound to the second FBO, except for the body part, the pixel value of each pixel is a first default value; the pixel corresponding to the body part is a pixel whose pixel value is greater than or equal to a preset threshold, and the pixel outside the body part is a pixel whose pixel value is less than the preset threshold.

[0019] Optionally, the setting module is also used to set the pixel values ​​of all pixels in the viewport area of ​​the screen corresponding to the second initial FBO to the first default value before the rendering module renders the body part of the car model to the second initial FBO based on the target transformation matrix to obtain the second FBO.

[0020] Optionally, the setting module is specifically used to set the transparency of all pixels after texture sampling in the fragment shader to a first transparency during the process of rendering the texture bound to the second FBO to the first FBO, and to set the transparency of pixels whose pixel value after texture sampling in the fragment shader is less than the first default value to 0.

[0021] Thirdly, this application provides an electronic device, including: a processor, the processor being configured to execute a computer program stored in a memory, the computer program being executed by the processor to implement the steps of any of the vehicle model rendering methods provided in the first aspect.

[0022] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of any of the vehicle model rendering methods provided in the first aspect.

[0023] A fifth aspect of this application provides a computer program product, wherein the computer program product includes a computer program or instructions, and when the computer program product is run on a processor, the processor executes the computer program or instructions to implement the steps of the car model rendering method as described in the first aspect.

[0024] A sixth aspect of this application provides a chip including a processor, a memory, and a communication interface. The communication interface is coupled to the processor. The memory is used to store a program or instructions that can be run on the processor. The processor is used to execute the program or instructions to implement the steps of the vehicle model rendering method as described in the first aspect.

[0025] Compared with the prior art, the technical solution provided in this application has the following advantages: In this application embodiment, based on the target transformation matrix, the wheel parts and environmental data of the vehicle model are rendered to a first initial frame buffer object (FBO) to obtain a first FBO; based on the target transformation matrix, the body part of the vehicle model is rendered to a second initial FBO to obtain a second FBO, the size of which is the same as that of the first initial FBO; the texture bound to the second FBO is rendered to the first FBO to obtain a target FBO, wherein the transparency of the body part in the texture bound to the target FBO is a first transparency, which is less than or equal to a transparency threshold; the target FBO is then output to the screen. In this solution, by dividing the vehicle model into wheel parts and body parts, and then rendering each wheel part and body part separately, and then rendering the rendered body part onto the rendered wheel parts, the transparency of the body part is less than or equal to the transparency threshold, that is, the body part has a certain transparency. This allows the environment under the vehicle to be viewed through the body part with a certain transparency, thereby improving driving safety and parking safety. Attached Figure Description

[0026] 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.

[0027] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0028] Figure 1 A flowchart illustrating a vehicle model rendering method provided in this application;

[0029] Figure 2A flowchart illustrating another car model rendering method provided in this application;

[0030] Figure 3 A flowchart illustrating another car model rendering method provided in this application;

[0031] Figure 4 A flowchart illustrating another vehicle model rendering method provided in this application;

[0032] Figure 5 A flowchart illustrating another vehicle model rendering method provided in this application;

[0033] Figure 6 A flowchart illustrating another method for rendering a car model provided in this application;

[0034] Figure 7 This application provides a rendering diagram of a car model.

[0035] Figure 8 This is a schematic diagram of the structure of a car model rendering device provided in this application;

[0036] Figure 9 This is a schematic diagram of the hardware structure of an electronic device provided in this application. Detailed Implementation

[0037] To better understand the above-mentioned objectives, features, and advantages of this application, the solution of this application will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.

[0038] Many specific details are set forth in the following description in order to provide a full understanding of this application, but this application may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some embodiments of this application, and not all embodiments.

[0039] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and are not limited in number; for example, a first object can be one or more.

[0040] The following is an explanation of some of the terms or concepts used in the claims and description of this invention.

[0041] Frame Buffer Objects (FBOs) allow us to shift rendering from the window's framebuffer to one or more off-screen framebuffers that we create. Recommended for rendering data to texture objects, FBOs are more efficient and easier to implement than other similar techniques such as data copying or buffer swapping. FBOs are not limited by window size; textures can be attached to FBOs, allowing direct rendering to textures without needing to display `glCopyTexImage`; and FBOs can contain multiple color buffers that can be written to simultaneously from a fragment shader.

[0042] Transparency refers to the degree to which light passes through. The transparency value ranges from 0 to 1, where 0 represents complete transparency and 1 represents complete opacity.

[0043] RGB is an industry color standard that uses variations in the three color channels—red (R), green (G), and blue (B)—and their superposition to create a wide variety of colors. RGB represents the colors of the red, green, and blue channels. This standard covers almost all colors that can be perceived by human vision and is one of the most widely used color systems.

[0044] This application is applied to vehicle model rendering scenarios for vehicles including in-vehicle surround view systems. The electronic devices in the embodiments of this application can be in-vehicle terminals, or mobile phones, laptops, computers, etc. that communicate with the vehicle. The specific devices can be determined according to the actual situation and are not limited here.

[0045] The technical solution of this application will be explained in detail below through several specific embodiments.

[0046] Figure 1 This is a flowchart illustrating a car model rendering method provided in this application, as shown below. Figure 1 As shown, the car model rendering method may include the following steps 101 to 104:

[0047] 101. Based on the target transformation matrix, render the wheel parts and environmental data of the vehicle model corresponding to the vehicle to the first initial FBO to obtain the first FBO.

[0048] The target transformation matrix is ​​the matrix used to transform coordinates from one coordinate system to another. The target transformation matrix can include three matrices: the model matrix, the view matrix, and the projection matrix. It can also include other feasible matrices, which can be determined according to the actual situation and are not limited here.

[0049] The descriptions of the model matrix, view matrix, and projection matrix can refer to existing related technologies and are not limited here.

[0050] The environmental data may include surround view stitching data around the vehicle, trajectory lines, and other data. The specific data can be determined based on the actual situation and is not limited here.

[0051] 102. Based on the target transformation matrix, render the body part of the car model to the second initial FBO to obtain the second FBO.

[0052] The size of the second initial FBO is the same as the size of the first initial FBO.

[0053] 103. Render the texture bound to the second FBO to the first FBO to obtain the target FBO.

[0054] In the texture bound to the target FBO, the transparency of the body part is the first transparency, which is less than or equal to the transparency threshold.

[0055] The first transparency can be dynamically configured and can be determined based on the actual situation; no limitation is made here.

[0056] The transparency threshold can be determined based on the actual situation, and is not limited here.

[0057] In this embodiment, two initial Frame-Based Objects (FBOs) of the same size can be created first, namely a first initial FBO and a second initial FBO. The car model is divided into wheel parts and body parts. Using the same target transformation matrix, the wheel parts of the car model are rendered to the first initial FBO to obtain the first FBO, and the body parts of the car model are rendered to the second initial FBO to obtain the second FBO. Then, the texture bound to the second FBO is rendered to the first FBO. By using the same target transformation matrix to render the wheel parts and body parts of the car model separately, it can be ensured that when the texture bound to the second FBO is rendered to the first FBO, the body parts can accurately fall on the wheel parts.

[0058] 104. Output the target FBO to the screen.

[0059] For example, a rectangular model can be created, and the texture in the target FBO can be rendered to the screen.

[0060] In this embodiment, based on the target transformation matrix, the wheel parts and environmental data of the vehicle model are rendered to a first initial frame buffer object (FBO) to obtain a first FBO. Based on the target transformation matrix, the body part of the vehicle model is rendered to a second initial FBO to obtain a second FBO, the size of which is the same as that of the first initial FBO. The texture bound to the second FBO is rendered to the first FBO to obtain a target FBO. In the texture bound to the target FBO, the transparency of the body part is a first transparency, which is less than or equal to a transparency threshold. The target FBO is then output to the screen. In this solution, by dividing the vehicle model into wheel parts and body parts, rendering each wheel part and body part separately, and then rendering the rendered body part onto the rendered wheel parts, the transparency of the body part is made less than or equal to the transparency threshold. This allows the environment under the vehicle to be viewed through the body part with a certain degree of transparency, thereby improving driving and parking safety.

[0061] Optionally, the first transparency is greater than or equal to 0.2 and less than or equal to 0.8.

[0062] It is understandable that the first transparency can be any value greater than or equal to 0.2 and less than or equal to 0.8. For example, the first transparency can be 0.2, 0.4, 0.5, 0.6 or 0.8, etc.

[0063] In this embodiment of the disclosure, a first transparency greater than or equal to 0.2 ensures that the features of the vehicle body remain clearly visible to the user, thus allowing for better determination of their location within the vehicle's underside environment based on the location of these features. A first transparency less than or equal to 0.8 ensures that the environment beneath the vehicle body can be clearly viewed through the vehicle body.

[0064] Optionally, the first transparency is dynamically configurable, meaning that a different first transparency can be used when rendering each frame of the car model image. For example, the first transparency can be adjusted according to user instructions, the environmental conditions under the vehicle, or other methods; no limitations are specified here.

[0065] Optionally, combined Figure 1 ,like Figure 2 As shown, before step 103 above, the car model rendering method provided in this application embodiment may further include step 105 below.

[0066] 105. Set the transparency corresponding to the user command as the first transparency.

[0067] Optionally, if a user needs to view the environment under the vehicle by reducing the vehicle's transparency, the user can enable the "Transparent Vehicle Rendering" mode and trigger the setting of the transparency corresponding to the "Transparent Vehicle Rendering" mode as the first transparency.

[0068] Optionally, if a user needs to view the environment under the vehicle by reducing the vehicle's transparency, the user can select the desired transparency by operating the "transparency adjustment button," triggering the selection of the user's transparency as the first transparency.

[0069] In this embodiment of the disclosure, the first transparency can be dynamically configured according to user needs, and then the car model can be rendered based on the first transparency so that the screen displays a transparent car model, thereby making it easier for users to view the environment under the vehicle, and thus improving driving safety and parking safety.

[0070] Optionally, combined Figure 1 ,like Figure 3 As shown, before step 103 above, the car model rendering method provided in this application embodiment may further include step 106 below.

[0071] 106. If the road conditions on which the vehicle is traveling include the target object, the transparency corresponding to the target object shall be determined as the first transparency.

[0072] The target object can be an obstacle, a trajectory line, etc., and the specific object can be determined according to the actual situation. Different objects can correspond to different levels of transparency. This can be understood as pre-storing the correspondence between different objects and their corresponding transparency levels. When a target object is detected, the transparency level corresponding to the target object is obtained and set as the first level of transparency.

[0073] It is understandable that by taking pictures of the front of the vehicle through cameras installed on the vehicle, and analyzing the pictures, it can be predicted that when the vehicle reaches a certain position, the bottom of the vehicle will contain the target object. Then, when rendering the car model in the current frame, the transparency of the target object can be set to the first transparency. This makes it easier for the screen to display a transparent car model, thus making it easier for users to see the target object under the vehicle, thereby improving driving safety and parking safety.

[0074] In this embodiment of the disclosure, the first transparency can be automatically determined according to the road conditions of the vehicle. Without user operation, a transparent vehicle model can be automatically displayed, which can help users to know the environment under the vehicle in a timely manner and effectively improve driving safety and parking safety.

[0075] Optionally, combined Figure 1 ,like Figure 4As shown, before step 103 above, the car model rendering method provided in this application embodiment may further include step 107 below.

[0076] 107. In the process of rendering the texture bound to the second FBO to the first FBO, the transparency of the pixels corresponding to the body part in the fragment shader after texture sampling is the first transparency, and the transparency of the pixels other than the body part is 0.

[0077] It is understandable that during the process of rendering the texture bound to the second FBO to the first FBO, the transparency of the pixels corresponding to the body part is the first transparency. Then, after the target FBO is output to the screen, the environment under the vehicle can be viewed through the body. The transparency of the pixels other than the body part is 0, that is, the pixels other than the body part are completely transparent. Therefore, after the target FBO is output to the screen, the various wheel parts and the environment around the vehicle can be seen.

[0078] Optionally, in this embodiment of the application, the position information of the vehicle body part in the second FBO can be obtained, and then in the process of rendering the texture bound to the second FBO to the first FBO, the transparency of the pixels located in the position information among all pixels after texture sampling in the fragment shader is the first transparency, and the transparency of the remaining pixels is 0.

[0079] Optionally, in the texture bound to the second FBO, except for the body part, the pixel value of each pixel is a first default value; the pixel corresponding to the body part is a pixel whose pixel value is greater than or equal to a preset threshold, and the pixel outside the body part is a pixel whose pixel value is less than the preset threshold.

[0080] The first default value can be a value different from the pixel value of any pixel in the vehicle body. For example, the first default value can be 0, 255, or other values, which can be determined according to the actual situation and are not limited here.

[0081] The preset threshold can be determined according to the actual situation and is not limited here. For example, the preset threshold can be 0, 0.01, or 0.001, etc.

[0082] It should be noted that in the embodiments of this disclosure, the pixel value of a pixel can be the gray value of the pixel, the value of each color component of the pixel, the sum of the values ​​of each color component of the pixel, or other values. The specific value can be determined according to the actual situation and is not limited here.

[0083] It should be noted that since the rendering method provided in this application embodiment supports images in the RGB color space, the pixels are pixels in the RGB color space. If the car model is in another color space, it needs to be converted to the RGB color space first.

[0084] In this embodiment, the pixel value of each pixel in the texture bound to the second FBO, excluding the vehicle body, is set to a first default value. Then, during the process of rendering the texture bound to the second FBO to the first FBO, the transparency of pixels whose pixel value differs from the first default value by a preset threshold (i.e., pixels in the vehicle body) after the texture is sampled in the fragment shader is set to a first transparency, and the transparency of pixels whose pixel value differs from the first default value by a preset threshold (i.e., pixels excluding the vehicle body) is set to 0. This allows the environment under the vehicle to be viewed through the vehicle body after the target FBO is output to the screen, and the various wheel parts and the environment around the vehicle can be seen.

[0085] Optionally, the initial values ​​of each pixel in the second initial FBO can be set to the first default value, and then the body part of the car model can be rendered to the second initial FBO based on the target transformation matrix to obtain the second FBO, so that the pixel value of each pixel in the texture bound to the second FBO, except for the body part, is the first default value.

[0086] Optionally, combined Figure 4 ,like Figure 5 As shown, before step 102 above, the car model rendering method provided in this application embodiment may further include the following step 108.

[0087] 108. Set the pixel values ​​of all pixels in the viewport area of ​​the screen corresponding to the second initial FBO to the first default value.

[0088] It can be understood that by using steps 108 and 102 above, the pixel value of each pixel in the texture bound to the second FBO, except for the body part, can be the first default value.

[0089] In this embodiment, by setting the pixel values ​​of all pixels in the viewport area of ​​the screen corresponding to the second initial FBO to the first default value, it is possible to ensure that the pixel values ​​of each pixel in the texture bound to the second FBO, except for the vehicle body part, are the first default value. This facilitates setting the transparency of all pixels after texture sampling in the fragment shader based on the difference between the pixel values ​​and the first default value. This allows the environment under the vehicle to be viewed through the vehicle body after the target FBO is output to the screen, and the various wheel parts and the environment around the vehicle can be seen.

[0090] Optionally, combined Figure 5 ,like Figure 6 As shown, step 107 above can be implemented through step 107a below.

[0091] 107a. In the process of rendering the texture bound to the second FBO to the first FBO, the transparency of all pixels after texture sampling in the fragment shader is set to the first transparency. The transparency of pixels whose pixel value after texture sampling in the fragment shader is less than the first default value is set to 0.

[0092] It is understandable that by setting the transparency of all pixels after texture sampling in the fragment shader to the first transparency during the process of rendering the texture bound to the second FBO to the first FBO, and setting the transparency of pixels whose pixel value after texture sampling in the fragment shader is less than the first default value (i.e., pixels other than the body part) to 0 (i.e., refreshing the transparency of pixels other than the body part), it is possible to achieve that during the process of rendering the texture bound to the second FBO to the first FBO, the transparency of pixels in the body part is the first transparency, and the transparency of pixels other than the body part is 0. In this way, after the target FBO is output to the screen, the environment under the vehicle can be viewed through the vehicle body, and the various wheel parts and the environment around the vehicle can be seen.

[0093] Optionally, in this embodiment, the car model can be a model with the body and wheels separated, or it can be a model with the body and wheels not separated. The specific model can be determined according to the actual situation and is not limited here.

[0094] Optionally, when the car model is a model in which the body and individual wheels are not separated, the car model can be input into a machine learning model, and the output can be a model in which the body and individual wheels are separated.

[0095] The machine learning model is trained on a base model using historical sample data. Each sample in the historical sample data includes a complete historical model car and separate models of the corresponding body and wheels. The base model can be based on any machine learning algorithm; its specific implementation can be determined based on the actual situation and is not limited here.

[0096] For example, for a 4-wheeled car model, a 3D modeler designs a vehicle model with separate wheels and body; two FBO1 and FBO2 of the same size are created, with FBO1 used to render the 4-wheeled portion and FBO2 used to render the body portion. Figure 7The process involves rendering the four-wheel portion, surround view stitching data, trajectory lines, and other data to FBO1 based on view, model, and projection matrices. The viewport corresponding to FBO2 is cleared to pure black (R, G, B are all set to 0, and the opacity is set to 1 by default). Then, the vehicle body portion is rendered to FBO2 based on the view, model, and projection matrices. It's important to note that to ensure the vehicle body portion accurately lands on the four wheels, the view, model, and projection matrices used when rendering the vehicle body portion must be consistent with those used when rendering the vehicle body portion. The texture bound to the vehicle body FBO2 is rendered to the wheel FBO1. Simultaneously, in the fragment shader, the opacity of all points after texture sampling is set to a predetermined value (i.e., the first opacity, a specified value between 0.2 and 0.8), and the opacity of points with R+G+B < 0.01 is set to 0. Because the viewport's R, G, and B values ​​were set to 0 in the steps described above before rendering the car body, the texture bound to the car body FBO2 has R+G+B values ​​of 0 except for the car body itself. This allows the car body's transparency to be set, while other parts remain completely transparent. Therefore, the contents of the wheel FBO1 (the four wheels and the surrounding environment) can be directly seen. Furthermore, the car body has a certain degree of transparency, allowing you to see the environment underneath the vehicle through it. At this point, the four wheels, the car body, and other content have all been rendered into FBO1. Then, create a rectangular model and render the textures from FBO1 to the screen.

[0097] In this embodiment, by rendering the vehicle body and each wheel separately, and then rendering the rendered vehicle body onto the rendered wheel parts, the transparency of the vehicle body can be dynamically adjusted. This eliminates the need for designers to create multiple vehicle models with different transparency levels, reducing the complexity of vehicle model design. Furthermore, based on the vehicle model rendering method provided in this embodiment, it can be combined with vehicle bottom filling technology to allow the driver to view the environment under the vehicle when the transparency of the vehicle body is below a transparency threshold, thereby improving driving safety.

[0098] This disclosure also provides a vehicle model rendering device. Figure 8 This is a schematic diagram of the structure of a car model rendering device provided in this disclosure, such as... Figure 8As shown, the car model rendering device includes a rendering module 801 and an output module 802. The rendering module 801 is used to render the wheel parts and environment data of the car model corresponding to the vehicle to a first initial frame buffer object (FBO) based on a target transformation matrix to obtain a first FBO; based on the target transformation matrix, it renders the body part of the car model to a second initial FBO to obtain a second FBO, the size of which is the same as that of the first initial FBO; and renders the texture bound to the second FBO to the first FBO to obtain a target FBO, wherein the transparency of the body part in the texture bound to the target FBO is a first transparency, which is less than or equal to a transparency threshold; the output module 802 is used to output the target FBO to the screen.

[0099] Optionally, the first transparency is greater than or equal to 0.2 and less than or equal to 0.8.

[0100] Optionally, the vehicle model rendering device further includes: a determining module; the determining module is used to determine the transparency corresponding to the user instruction as the first transparency before the rendering module renders the texture bound to the second FBO to the first FBO to obtain the target FBO.

[0101] Optionally, the vehicle model rendering device further includes: a determining module; the determining module is used to determine the transparency corresponding to the target object as the first transparency before the rendering module renders the texture bound to the second FBO to the first FBO to obtain the target FBO, if the road conditions on which the vehicle is traveling include the target object.

[0102] Optionally, the vehicle model rendering device further includes: a setting module; the setting module is used to set the transparency of the pixels corresponding to the vehicle body part to a first transparency among all pixels after texture sampling in the fragment shader during the process of rendering the texture bound to the second FBO to the first FBO, and the transparency of pixels other than the vehicle body part to 0.

[0103] Optionally, in the texture bound to the second FBO, except for the body part, the pixel value of each pixel is a first default value; the pixel corresponding to the body part is a pixel whose pixel value is greater than or equal to a preset threshold, and the pixel outside the body part is a pixel whose pixel value is less than the preset threshold.

[0104] Optionally, the setting module is also used to set the pixel values ​​of all pixels in the viewport area of ​​the screen corresponding to the second initial FBO to the first default value before the rendering module renders the body part of the car model to the second initial FBO based on the target transformation matrix to obtain the second FBO.

[0105] Optionally, the setting module is specifically used to set the transparency of all pixels after texture sampling in the fragment shader to a first transparency during the process of rendering the texture bound to the second FBO to the first FBO, and to set the transparency of pixels whose pixel value after texture sampling in the fragment shader is less than the first default value to 0.

[0106] It should be noted that the above-mentioned car model rendering device can be the electronic device in the above method embodiment of this application, or it can be a functional module and / or functional entity in the electronic device that can realize the function of the device embodiment. This application embodiment does not limit it.

[0107] In this embodiment, each module can implement the car model rendering method provided in the above method embodiment and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0108] This application also provides an electronic device, such as... Figure 9 As shown, the electronic device may include: a processor 901, a memory 902, and a program or instructions stored in the memory 902 and executable on the processor 901. When the program or instructions are executed by the processor 901, they can implement the various processes of the car model rendering method provided in the above method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0109] The processor 901 can be a modem, a baseband processor, a baseband chip, or one or more chips (or chip systems) for executing the scheme of this application. The processor 901 connects to various parts of the terminal device using various interfaces and lines. By running or executing software programs and / or modules stored in the memory 902, and by calling data stored in the memory 902, it performs various functions of the terminal device and processes data, thereby providing overall monitoring of the terminal device. The memory 902 can be used to store software programs and modules. The processor 901 executes various functional applications and data processing of the terminal device by running the software programs and modules stored in the memory 902. The memory 902 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the terminal device (such as audio data, phonebook, etc.). Furthermore, the memory 902 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0110] This application provides a vehicle including the electronic device described above. This vehicle can implement each process of the vehicle model rendering method provided in the above method embodiments and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0111] This application provides a computer-readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the car model rendering method provided in the above-described method embodiments and achieve the same technical effect. To avoid repetition, further details are omitted here.

[0112] This application also provides a computer program product, which includes a computer program or instructions. When the computer program product is run on a processor, the processor executes the computer program or instructions to implement the various processes of the car model rendering method provided in the above method embodiments and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0113] This application embodiment also provides a chip, which includes a processor, a memory, and a communication interface. The communication interface is coupled to the processor. The memory is used to store programs or instructions that can be run on the processor. The processor is used to execute the programs or instructions to implement the various processes of the above-described car model rendering method embodiment and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0114] The processor may be, for example, a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application. The memory may be a single storage device or a collective term for multiple storage elements, and may include random access memory (RAM) or non-volatile memory, such as disk storage or flash memory.

[0115] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0116] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, servers, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units 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 an indirect coupling or communication connection between devices or units through some interfaces, and may be electrical, mechanical, or other forms.

[0117] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0118] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0119] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0120] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for rendering a car model, characterized in that, The method includes: Based on the target transformation matrix, the wheel parts and environmental data of the vehicle model corresponding to the vehicle are rendered into the first initial frame buffer object (FBO) to obtain the first FBO; Based on the target transformation matrix, the body part of the car model is rendered to the second initial FBO to obtain the second FBO. The size of the second initial FBO is the same as the size of the first initial FBO. In the process of rendering the texture bound to the second FBO to the first FBO, the transparency of all pixels after texture sampling in the fragment shader is set to the first transparency. The transparency of pixels whose pixel value is less than the first default value and whose pixel value is less than the preset threshold is set to 0. Pixels other than the body part are pixels whose pixel value is less than the preset threshold. or, Obtain the position information of the vehicle body in the second FBO, and set that during the process of rendering the texture bound to the second FBO to the first FBO, the transparency of the pixels located in the position information among all pixels after texture sampling in the fragment shader is the first transparency, and the transparency of the remaining pixels is 0. The texture bound to the second FBO is rendered onto the first FBO to obtain the target FBO. In the texture bound to the target FBO, the transparency of the body part is the first transparency, and the first transparency is less than or equal to the transparency threshold. Output the target FBO to the screen.

2. The method according to claim 1, characterized in that, The first transparency is greater than or equal to 0.2 and less than or equal to 0.

8.

3. The method according to claim 1, characterized in that, Before rendering the texture bound to the second FBO onto the first FBO to obtain the target FBO, the method further includes: The transparency corresponding to the user command is determined as the first transparency.

4. The method according to claim 1, characterized in that, Before rendering the texture bound to the second FBO onto the first FBO to obtain the target FBO, the method further includes: If the road conditions on which the vehicle is traveling include a target object, the transparency corresponding to the target object is determined as the first transparency.

5. The method according to claim 1, characterized in that, In the texture bound to the second FBO, except for the body part, the pixel value of each pixel is the first default value; The pixels corresponding to the vehicle body portion are those whose pixel values ​​differ from the first default value by a value greater than or equal to a preset threshold.

6. The method according to claim 5, characterized in that, Before rendering the body portion of the car model to the second initial FBO based on the target transformation matrix to obtain the second FBO, the method further includes: Set the pixel values ​​of all pixels in the viewport area of ​​the screen corresponding to the second initial FBO to the first default value.

7. A vehicle model rendering device, characterized in that, include: Rendering module and output module; The rendering module is used to render the wheel parts and environmental data of the vehicle model corresponding to the vehicle to the first initial frame buffer object (FBO) based on the target transformation matrix, so as to obtain the first FBO. Based on the target transformation matrix, the body portion of the car model is rendered to a second initial FBO to obtain a second FBO, the size of which is the same as the size of the first initial FBO; during the process of rendering the texture bound to the second FBO to the first FBO, the transparency of the pixels corresponding to the body portion in all pixels after texture sampling in the fragment shader is set to a first transparency; and the texture bound to the second FBO is rendered to the first FBO to obtain a target FBO, the transparency of the body portion in the texture bound to the target FBO is the first transparency, and the first transparency is less than or equal to a transparency threshold; The output module is used to output the target FBO to the screen; The vehicle model rendering device implements the steps of the vehicle model rendering method as described in any one of claims 1-6.

8. An electronic device, characterized in that, include: A processor for executing a computer program stored in a memory, wherein the computer program, when executed by the processor, implements the steps of the vehicle model rendering method according to any one of claims 1-6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the vehicle model rendering method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Autonomous on-road vehicle with shock-absorbing energy dissipation padding placed at eye level

    CN108349455A

  • Managing rendering targets for graphics processing units

    US9928637B1