An OpenGL-based 3D liquid crystal instrument system control system and method

By using OpenGL image rendering technology and a depth buffer to record the depth relationship of objects, the problem of insufficient three-dimensionality in the rotation of the pointers on the full LCD instrument panel was solved, and the three-dimensional effect and real-time shadow effect of the LCD instrument pointers were realized.

CN117422814BActive Publication Date: 2026-11-06成都航盛智行科技有限公司 +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311343418.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-17
Publication Date
2026-11-06
Estimated Expiration
2043-10-17

AI Technical Summary

Technical Problem

In existing technologies, the pointers on fully digital instrument clusters lack a strong sense of depth when rotating, and the use of 2D images results in insufficient 3D effects.

Method used

Using OpenGL image rendering technology, the depth buffer records the depth relationship of objects, and the depth information and shadow edge band are obtained through two renderings to draw shadows to produce a three-dimensional effect.

Benefits of technology

It achieves real-time shadow and stereoscopic effects on the LCD instrument pointers, improving the 3D special effects performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117422814B_ABST
    Figure CN117422814B_ABST
Patent Text Reader

Abstract

This invention relates to the field of image rendering technology, specifically to a control system and method for a 3D LCD instrument system based on OpenGL. It employs OpenGL image rendering technology and cleverly utilizes the characteristic of a depth buffer to record the depth relationships of objects in a scene, thereby obtaining the relative occlusion relationships of objects. When drawing objects, this information is used; if an object is not occluded, it is drawn normally; otherwise, a shadow is drawn, thus producing a 3D effect. This invention uses two rendering stages: the first rendering obtains depth information based on the light source in the scene, and the second normal rendering references this depth information to draw shadows, thus producing a 3D effect. This method is primarily used for pointer drawing in LCD instruments, enabling real-time shadow and pointer-accompanied effects, greatly improving 3D special effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image rendering technology, and more specifically, to a control system and method for a 3D LCD instrument system based on OpenGL. Background Technology

[0002] As competition in the automotive market intensifies, major automakers are conducting research and development on fully digital instrument clusters. These clusters offer more intuitive and comprehensive information and are currently the most advanced automotive instrument clusters, representing the future direction and trend.

[0003] Traditional LCD instrument panel interfaces mostly use 2D images, even for the car model part, which is usually displayed using high-precision rendered images. However, if only 2D images are used for the pointer part, the three-dimensional effect will be weak when the pointer moves. Summary of the Invention

[0004] The purpose of this invention is to provide a control system and method for a 3D LCD instrument system based on OpenGL, in order to solve the problem that the existing technology, which only uses 2D images, will have a weak sense of three-dimensionality when the pointer rotates.

[0005] The embodiments of the present invention are achieved through the following technical solutions:

[0006] In a first aspect, the present invention provides a control method for a 3D liquid crystal instrument system based on OpenGL, comprising:

[0007] Prepare the scene, which includes the 3D model to be rendered, the position and number of light sources, and set the camera position to the position of the light sources;

[0008] Create a buffer the size of the screen resolution, and set the depth buffer in the OpenGL render target to the buffer;

[0009] The objects in the scene are sorted according to their distance from the light source and rendered in order from farthest to closest. The depth buffer stores the depth information of the face in the scene that is closest to the light source.

[0010] Perform edge detection on the depth buffer, extract the edge band of the shadow, and save it to the shadow edge band texture;

[0011] Set the OpenGL rendering target back to the buffer corresponding to the screen, restore the camera position to its initial position, render the object again from far to near, and draw the final shadow based on the depth information and shadow edge texture.

[0012] In one embodiment of the present invention, the edge detection includes edge detection using the Sobe l operator.

[0013] In one embodiment of the present invention, the use of the Sobe l operator includes:

[0014] Obtain the convolution kernels of the Sobe l operator in the X and Y directions;

[0015] Calculate the gradient of each pixel in the depth buffer;

[0016] Edge information in the depth buffer is obtained by comparing it with a set threshold.

[0017] In one embodiment of the present invention, the step of drawing shadows based on depth information and shadow edge texture includes:

[0018] If the current patch is at the edge of a shadow, the current texture color will be diluted;

[0019] If not at the edge, set the RGB color value to 0.1 for all values.

[0020] In one embodiment of the present invention, the light source is a point light source or a parallel light source.

[0021] In one embodiment of the present invention, the 3D model includes fixed points and normals.

[0022] Secondly, the present invention provides a 3D LCD instrument system based on OpenGL, comprising:

[0023] The scene preparation module is configured to prepare a scene, which includes a 3D model to be rendered, light source positions and the number of light sources, and sets the camera position as the light source position;

[0024] The module is created and configured to create a buffer the size of the screen resolution, setting the depth buffer in the OpenGL render target to the buffer.

[0025] The rendering module is configured to sort objects in the scene according to their distance from the light source and render them in order from farthest to closest. The depth buffer stores the depth information of the facet in the scene that is closest to the light source.

[0026] The edge detection module is configured to perform edge detection on the depth buffer, extract the edge bands of the shadow, and save them to the shadow edge band texture.

[0027] The shadow drawing module is configured to reset the OpenGL rendering target to the buffer corresponding to the screen, restore the camera position to the initial position, render the object again from far to near, and draw the final shadow based on the depth information and shadow edge texture.

[0028] The main control module is connected to the scene layout module, creation module, rendering module, edge detection module, and shadow drawing module, and is used to execute the above-mentioned OpenGL-based 3D LCD instrument system control method.

[0029] In one embodiment of the present invention, a Sobe l operator module is further included, which is configured to obtain the convolution kernel of the Sobe l operator in the X and Y directions, calculate the gradient of each pixel in the depth buffer, and obtain the edge information in the depth buffer by comparing it with a set threshold.

[0030] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described OpenGL-based 3D LCD instrument system control method.

[0031] Fourthly, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-described OpenGL-based 3D LCD instrument system control method.

[0032] The technical solutions of the embodiments of the present invention have at least the following advantages and beneficial effects:

[0033] This invention employs OpenGL image rendering technology, cleverly utilizing the depth buffer's ability to record the depth relationships of objects in a scene. This allows for the acquisition of relative occlusion relationships, which are then incorporated into the drawing process. If an object is not occluded, it is drawn normally; otherwise, a shadow is drawn, creating a 3D effect. This invention uses two rendering stages: the first render acquires depth information based on the light source, and the second normal render references this depth information to draw shadows, thus producing a 3D effect. This method is particularly useful for pointer drawing in LCD instruments, enabling real-time shadow and pointer-related effects, significantly enhancing 3D special effects. Attached Figure Description

[0034] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0035] Figure 1 This is a schematic diagram of the process of the present invention;

[0036] Figure 2 Let be the convolution kernel of the Sobe l operator in the XY direction. Detailed Implementation

[0037] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0038] The module division in this application is a logical division. In actual application, there may be other division methods. For example, multiple modules may be combined into or integrated into another system, or some features may be ignored or not executed.

[0039] The independently described modules or sub-modules may or may not be physically separated; they may be implemented in software or hardware, and some modules or sub-modules may be implemented in software, with the processor calling the software to implement the function of these modules or sub-modules, while other modules or sub-modules may be implemented in hardware, such as through hardware circuits. Furthermore, some or all of the modules can be selected to achieve the purpose of this application's solution according to actual needs.

[0040] Please refer to Figure 1 The present invention provides a control method for a 3D LCD instrument system based on OpenGL, characterized in that it includes:

[0041] Step S1: Prepare the scene, which includes the 3D model to be rendered, the position and number of light sources, and set the camera position to the position of the light sources;

[0042] Step S2: Create a buffer the size of the screen resolution and set the depth buffer in the OpenGL rendering target to the buffer;

[0043] Prepare the scene, including the 3D model to be rendered, the position and number of light sources. The 3D model should contain basic information such as vertices and normals. Light sources can be point lights or parallel lights. Create a buffer (BF_A) the size of the screen resolution, set the depth buffer in the OpenGL rendering target to buffer, and enable depth detection.

[0044] Step S3: Sort the objects in the scene according to their distance from the light source, and render them in order from farthest to closest. The depth buffer stores the depth information of the face closest to the light source in the scene.

[0045] Based on the principle of shadow formation, shadows are produced when incident light is blocked by objects in front. Therefore, the camera position in the scene is set as the position of the light source. The objects in the scene are sorted according to their distance from the light source and rendered in order from farthest to closest. Since depth detection is enabled, during rendering, the depth data of the face closer to the light source will cover the face farther away from the light source. Therefore, after rendering, the depth buffer stores the depth information of the face closest to the light source in the scene.

[0046] Step S4: Perform edge detection on the depth buffer, extract the edge band of the shadow, and save it to the shadow edge band texture;

[0047] Step S5: Reset the OpenGL rendering target to the buffer corresponding to the screen, restore the camera position to the initial position, render the object again from far to near, and draw the final shadow based on the depth information and shadow edge texture.

[0048] This invention employs OpenGL image rendering technology, cleverly utilizing the depth buffer's ability to record the depth relationships of objects in a scene. This allows for the acquisition of relative occlusion relationships, which are then incorporated into the drawing process. If an object is not occluded, it is drawn normally; otherwise, a shadow is drawn, creating a 3D effect. This invention uses two rendering stages: the first render acquires depth information based on the light source, and the second normal render references this depth information to draw shadows, thus producing a 3D effect. This method is particularly useful for pointer drawing in LCD instruments, enabling real-time shadow and pointer-related effects, significantly enhancing 3D special effects.

[0049] In this embodiment, the edge detection includes edge detection using the Sobe l operator.

[0050] The Sobe l operator is used to: obtain the convolution kernels of the Sobe l operator in the X and Y directions; calculate the gradient of each pixel in the depth buffer; and obtain the edge information in the depth buffer by comparing it with a set threshold.

[0051] More specifically, shadows in the real world are not uniformly dark; they are often darker closer to the center and slightly brighter at the edges due to the scattering of visible light. To achieve this effect, edge detection needs to be performed on the depth buffer to extract areas of abrupt depth changes, i.e., the edge bands of the shadow. The widely used Sobe L operator can be used for edge detection, such as... Figure 2 The image shows the convolution kernel of the Sobe l operator in the XY direction:

[0052] Using this operator, the gradient of each pixel in the depth buffer can be obtained. By comparing it with a set threshold, the edge information in the depth buffer can be obtained and stored in another texture (BF_Edge).

[0053] In this embodiment, drawing shadows based on depth information and shadow edge texture includes: if the current patch is at the edge of the shadow, then the current texture color is diluted; if it is not at the edge, then the RGB value of the color is set to a uniform value of 0.1.

[0054] In detail, the OpenGL rendering target is reset to the buffer corresponding to the screen, the camera position is restored to the initial position, and the object is rendered again from far to near. During rendering, the depth information in step S3 is taken into account. If the depth of the current face is greater than the value stored in the buffer, it means that the current face is occluded by the object in front. At the same time, the edge detection information in step S4 is referenced. If the current face is on the edge of the shadow, the current texture color is faded. If it is not on the edge, the RGB value of the color is directly set to (0.1,0.1,0.1) to achieve the characteristic that the shadow is darker as it gets closer to the center.

[0055] Furthermore, the present invention also provides a 3D LCD instrument system based on OpenGL, comprising:

[0056] The scene preparation module is configured to prepare a scene, which includes a 3D model to be rendered, light source positions and the number of light sources, and sets the camera position as the light source position;

[0057] The module is created and configured to create a buffer the size of the screen resolution, setting the depth buffer in the OpenGL render target to the buffer.

[0058] The rendering module is configured to sort objects in the scene according to their distance from the light source and render them in order from farthest to closest. The depth buffer stores the depth information of the facet in the scene that is closest to the light source.

[0059] The edge detection module is configured to perform edge detection on the depth buffer, extract the edge bands of the shadow, and save them to the shadow edge band texture.

[0060] The shadow drawing module is configured to reset the OpenGL rendering target to the buffer corresponding to the screen, restore the camera position to the initial position, render the object again from far to near, and draw shadows based on depth information and shadow edge texture.

[0061] The main control module is connected to the scene layout module, creation module, rendering module, edge detection module, and shadow drawing module, and is used to execute the above-mentioned OpenGL-based 3D LCD instrument system control method.

[0062] In this embodiment, a Sobe l operator module is also included, which is configured to obtain the convolution kernel of the Sobe l operator in the X and Y directions, calculate the gradient of each pixel in the depth buffer, and obtain the edge information in the depth buffer by comparing it with a set threshold.

[0063] Furthermore, the functional units in the various embodiments of the present invention 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.

[0064] 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. This computer software product, stored in a storage medium, 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 of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0065] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A control method for a 3D LCD instrument system based on OpenGL, characterized in that, include; Prepare the scene, which includes the 3D model to be rendered, the position and number of light sources, and set the camera position to the position of the light sources; Create a buffer the size of the screen resolution, and set the depth buffer in the OpenGL render target to the buffer; The objects in the scene are sorted according to their distance from the light source and rendered in order from farthest to closest. The depth buffer stores the depth information of the face in the scene that is closest to the light source. Perform edge detection on the depth buffer, extract the edge band of the shadow, and save it to the shadow edge band texture; Set the OpenGL rendering target back to the buffer corresponding to the screen, restore the camera position to its initial position, render the object again from far to near, and draw the final shadow based on the depth information and shadow edge texture.

2. The control method for a 3D LCD instrument system based on OpenGL according to claim 1, characterized in that, The edge detection includes edge detection using the Sobel operator.

3. The control method for a 3D LCD instrument system based on OpenGL according to claim 2, characterized in that, The use of the Sobel operator includes: Obtain the convolution kernels of the Sobel operator in the X and Y directions; Calculate the gradient of each pixel in the depth buffer; Edge information in the depth buffer is obtained by comparing it with a set threshold.

4. The control method for a 3D LCD instrument system based on OpenGL according to claim 1, characterized in that, The process of drawing the final shadow based on depth information and shadow edge texture includes: If the current patch is at the edge of a shadow, the current texture color will be diluted; If not at the edge, set the RGB values ​​of the color to 0.1 for all values.

5. The control method for a 3D LCD instrument system based on OpenGL according to claim 1, characterized in that, The light source is either a point light source or a parallel light source.

6. The control method for a 3D LCD instrument system based on OpenGL according to claim 1, characterized in that, The 3D model includes fixed points and normals.

7. A 3D LCD instrument system based on OpenGL, characterized in that, include; The scene preparation module is configured to prepare a scene, which includes a 3D model to be rendered, light source positions and the number of light sources, and sets the camera position as the light source position; The module is created and configured to create a buffer the size of the screen resolution, setting the depth buffer in the OpenGL render target to the buffer. The rendering module is configured to sort objects in the scene according to their distance from the light source and render them in order from farthest to closest. The depth buffer stores the depth information of the facet in the scene that is closest to the light source. The edge detection module is configured to perform edge detection on the depth buffer, extract the edge bands of the shadow, and save them to the shadow edge band texture. The shadow drawing module is configured to reset the OpenGL rendering target to the buffer corresponding to the screen, restore the camera position to the initial position, render the object again from far to near, and draw the final shadow based on the depth information and shadow edge texture. The main control module is connected to the scene layout module, creation module, rendering module, edge detection module and shadow drawing module, and is used to execute the OpenGL-based 3D LCD instrument system control method as described in any one of claims 1-6.

8. A 3D LCD instrument system based on OpenGL according to claim 7, characterized in that, It also includes a Sobel operator module, which is configured to obtain the convolution kernels of the Sobel operator in the X and Y directions, calculate the gradient of each pixel in the depth buffer, and obtain the edge information in the depth buffer by comparing it with a set threshold.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the OpenGL-based 3D LCD instrument system control method according to any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, it implements a 3D LCD instrument system control method based on OpenGL as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Instrument panel with a shadow pointer

    CN104648157A

  • Method, computer program product and system for rendering soft shadows in a frame representing a 3D-scene

    US20030112237A1