Driving simulator Unity scene rendering method considering eye disorder
By creating two driving scenes in Unity and configuring the rendering, the visual effects of eye impairment are simulated, which solves the problem of traditional driving simulators failing to consider the experience of people with eye impairment, and achieves efficient visual scene rendering and data support.
Patent Information
- Application Number
- CN202411070769.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2024-10-01
AI Technical Summary
Traditional driving simulators fail to effectively consider the driving experience of people with special eye impairments when rendering visual effects, and it is difficult to simulate the driving scenarios of special people such as astigmatism, ghosting, color weakness and color blindness.
Create two driving scenes in Unity, and perform rendering configuration by projecting the scene color of the camera and the target layer to simulate eye-impairment visual scenes, including configuring road surface recognition scripts, data transmission scripts and post-processing configuration files to achieve color weakness and color blindness. Simulation of visual effects such as floaters, astigmatism, etc.
It realizes the simulation of visual scenes with eye impairments. It is simple to operate and easy to adjust. It provides data support for driving simulation of people with eye impairments. At the same time, it reduces the occupation of processor resources by scene rendering and improves rendering efficiency.
Smart Images

Figure CN118736094A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of simulator rendering, and in particular to a driving simulator Unity scene rendering method taking eye impairment into consideration. Background Art
[0002] Driving simulators are increasingly used in driving behavior research and human-vehicle closed-loop system research. When using Unity for rendering, driving simulators can use Unity's powerful 3D rendering capabilities to create realistic driving environments and vehicle dynamic models, thereby enhancing the immersion and authenticity of driving simulations. Unity's rendering technology can simulate various lighting conditions, weather conditions, and road conditions, such as day, night, sunny days, rainy days, cracked roads, unclear markings, etc., thereby providing highly realistic visual effects for driving simulators.
[0003] However, traditional driving simulators are mainly aimed at normal people with driving qualifications and use a single rendering method. The rendered visual effects are suitable for normal drivers, but rarely consider the driving experience of special people with eye impairments. It is difficult to simulate the rendering of driving scenes for special groups such as astigmatism, color deficiency and color blindness. Summary of the invention
[0004] In order to solve the above problems, the present invention provides a driving simulator Unity scene rendering method taking eye impairment into consideration to achieve simulation of eye impairment scenes.
[0005] The technical solution of the present invention is: a driving simulator Unity scene rendering method considering eye impairment, comprising the following steps: Create the first driving scene in Unity and configure the rendering of the scene to transmit road parameter information to the vehicle dynamics model and receive wheel information transmitted by the vehicle dynamics model; A second driving scene is created in Unity. The second driving scene is consistent with the first driving scene. The second driving scene is rendered and configured to receive vehicle information transmitted by the vehicle dynamics model. The interaction frequency between the first driving scene and the vehicle dynamics model is greater than the interaction frequency between the second driving scene and the vehicle dynamics model. Rendering configurations for scene colors and / or target layers of projection cameras to simulate eye-impaired vision scenarios.
[0006] In an optional implementation, rendering configuration of the first driving scene so as to transmit road surface parameter information to the vehicle dynamics model and receive wheel information transmitted by the vehicle dynamics model specifically includes: Delete the camera and lights of the first driving scene, and turn off all rendering modules; Configuring a road surface recognition script, including configuring a first data transmission step length, so that the first driving scene receives wheel information from the vehicle dynamics model at each first data transmission step length, detects road surface parameter information in real time, and sends the road surface parameter information to the vehicle dynamics model at each first data transmission step length; Create an empty object in Unity; The road surface recognition script is attached to the empty object, and the road surface parameter information and wheel information are sent to the monitoring station in real time for monitoring.
[0007] In an optional implementation, the wheel information includes real-time position information of four wheels, and the road surface parameter information includes the highest point of the road surface grid and the layer physical parameter information under the positions of the four wheels.
[0008] In an optional implementation, configuring the road surface recognition script also includes configuring the data transmission mode to be UDP transmission, configuring the data transmission and reception to be triggered, and configuring the road surface parameter information to be detected using a laser probe method.
[0009] In an optional embodiment, the second driving scene is rendered and configured to receive vehicle information transmitted by the vehicle dynamics model, specifically including; Configuring a data transmission script, including configuring a second data transmission step length, and configuring data content as vehicle information; the vehicle information includes six-way position parameters of the vehicle body and positioning parameters of four wheels; Attach the data transfer script to the vehicle dynamics model.
[0010] In an optional implementation, configuring the data transmission script further includes configuring the data transmission mode to be Udp transmission.
[0011] In an optional implementation, the first data transmission step length is 1 ms, and the second data transmission step length is 16 ms.
[0012] In an optional embodiment, the scene color and / or target layer of the projection camera is rendered to simulate the visual scene of eye impairment, including the rendering configuration of simulating the scene of color weakness and color blindness, specifically including: Add a post-processing layer component to the camera and set it as the main camera; Create a post-processing profile and add Depth of Field and Color Grading effects to it; Configure "Depth of Field" to achieve local area blur, and configure "Color Grading" to simulate color weakness and color blindness effects; Apply the configured post-processing profile to the post-processing volume component and add the component to the camera or global object to make it effective in the scene.
[0013] In an optional embodiment, the scene color and / or target layer of the projection camera is rendered to simulate an eye disorder visual scene, including a rendering configuration for simulating a floater scene, specifically including: Write a shader script to overlay a floating speckled texture on the screen; Create a material and apply the shader you wrote. In the Intensity window, set the material's shader to Custom / Floating shader and drag a floating spot texture onto the _Texture Editor properties. Adjust the Intensity parameter to set the intensity of the floaters effect. Write an image effect script and attach it to the projection camera. The image effect script applies the material effect when rendering the image, thus simulating the visual effect of floaters.
[0014] In an optional embodiment, the scene color and / or target layer of the projection camera is rendered to simulate an eye-impaired visual scene, including a rendering configuration for simulating an astigmatism scene, specifically including: Write a shader script to copy the original scene into two, and set the intensity of diffuse light by setting the offset size of the two scene images and the transparency of the layer.
[0015] The Unity scene rendering method for a driving simulator taking into account visual impairment provided by the present invention has the following beneficial effects compared to the prior art: by rendering and configuring the scene color and / or target layer of the projection camera, the effect of simulating the visual scene of visual impairment is achieved, the operation is simple, the adjustment is convenient, and data support is provided for driving simulation of visually impaired persons. At the same time, the Unity road program and the Unity scene program are separated and operated in parallel, which reduces the processor resources occupied by the scene rendering while allowing the simulation accuracy of the dynamic model to meet the requirements and improve the rendering efficiency. BRIEF DESCRIPTION OF THE DRAWINGS In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0016] Figure 1 It is a flowchart of a Unity scene rendering method for a driving simulator taking into account eye impairments provided by an embodiment of the present invention.
[0017] Figure 2 It is a functional principle diagram of a specific embodiment of a method for rendering a scene in Unity for a driving simulator taking into account eye impairment. DETAILED DESCRIPTION
[0018] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0020] Figure 1 is a flowchart of a Unity scene rendering method for a driving simulator taking into account eye impairments provided by an embodiment of the present invention, such as Figure 1 As shown, the method includes the following steps.
[0021] S1, create the first driving scene in Unity, and configure the rendering of the scene so that it transmits road parameter information to the vehicle dynamics model and receives wheel information transmitted by the vehicle dynamics model.
[0022] The purpose of this step is to create a Unity road program that interacts with the vehicle dynamics model to achieve data interaction between road surface information and wheel information.
[0023] S2, creating a second driving scene in Unity, the second driving scene is consistent with the first driving scene, and the second driving scene is rendered and configured to receive vehicle information transmitted by the vehicle dynamics model; wherein the interaction frequency between the first driving scene and the vehicle dynamics model is greater than the interaction frequency between the second driving scene and the vehicle dynamics model.
[0024] The purpose of this step is to create a Unity scene program that interacts with the vehicle dynamics model and enables the vehicle dynamics model to transmit vehicle information to the program for driving simulation.
[0025] This embodiment separates the Unity road program and the Unity scene program and operates them in parallel, which reduces the processor resources occupied by scene rendering while ensuring that the simulation accuracy of the dynamic model meets the requirements.
[0026] S3, rendering configuration of scene colors and / or target layers of the projection camera to simulate an eye-impaired visual scene.
[0027] The purpose of this step is to achieve the rendering of visual scenes for people with visual impairments, which is achieved by rendering and configuring the scene color and / or target layer of the projection camera. It is simple to operate and easy to adjust, providing data support for driving simulations for people with visual impairments.
[0028] A specific embodiment is provided below to further explain the present invention in detail. Figure 2 It is a schematic diagram of the functional principle of this specific embodiment, including the creation of a Unity road surface and a Unity scene, both of which interact with the vehicle dynamics model, and the rendering configuration of the projection camera to display the eye obstruction visual effect on the projection scene.
[0029] (1) Unity pavement.
[0030] Create the first driving scene in Unity and configure the rendering of the scene to transmit road parameter information to the vehicle dynamics model and receive wheel information transmitted by the vehicle dynamics model.
[0031] Step 1: Delete the camera and lights of the first driving scene and turn off all rendering modules.
[0032] The created scene contains information such as road roughness and road physical parameters. Then delete the camera and lights in the scene and turn off all the render modules, so that you get a Unity project with only road information.
[0033] Step 2, configure the road surface recognition script, including configuring the first data transmission step, so that the first driving scene receives wheel information from the vehicle dynamics model every first data transmission step, and detects road surface parameter information in real time, and sends road surface parameter information to the vehicle dynamics model every first data transmission step.
[0034] In this embodiment, the wheel information includes the real-time position information of the four wheels, and the road surface parameter information includes the highest point of the road surface grid and the physical parameter information of the layer under the four wheel positions. In order to achieve the real-time data transmission, the data transmission mode is configured as Udp transmission, the data transmission and reception are configured to adopt the trigger mode, and the road surface parameter information is detected by the laser probe method. At the same time, the first data transmission step is configured as 1ms.
[0035] Specifically, a C# script for road surface recognition is configured to receive the real-time position information of the four wheels of the vehicle dynamics model every 1ms through Udp transmission, and the highest point of the road surface grid and the physical parameter information of the layer under the four-wheel position are detected in real time using the laser probe method. To ensure the continuity of data, the script uses a triggering method to send and receive data. Each time a set of four-wheel parameters is received, the next set of four-wheel parameter information is triggered to ensure the real-time transmission of data.
[0036] Step 3, create an empty object in Unity.
[0037] Step 4: Attach the road surface recognition script to the empty object, and send the road surface parameter information and wheel information to the monitoring station in real time for monitoring.
[0038] After the script is configured, create an empty object in Unity, attach the script to the empty object, and send the data to the monitoring station in real time for monitoring. The final effect is that the Unity road surface transmits road parameter information to the vehicle dynamics model at a rate of 1ms, and receives wheel information transmitted by the vehicle dynamics model at a rate of 1ms. Ensure that the vehicle dynamics model can obtain high-precision real-time data and perform accurate calculations. Through high-frequency data transmission, the dynamics model can more accurately simulate the movement of the vehicle under different road conditions.
[0039] (2) Unity scene.
[0040] Create a second driving scene in Unity. The second driving scene is consistent with the first driving scene. Configure the rendering of the second driving scene so that it receives the vehicle information transmitted by the vehicle dynamics model.
[0041] Step 1, configure the data transmission script, including configuring the second data transmission step length, and the configured data content is vehicle information; the vehicle information includes the six-way position parameters of the vehicle body and the positioning parameters of the four wheels.
[0042] Step 2: Attach the data transfer script to the vehicle dynamics model.
[0043] In this embodiment, configuring the data transmission script further includes configuring the data transmission mode to be Udp transmission, and the second data transmission step length to be 16 ms.
[0044] On the premise that the calculation accuracy of the vehicle dynamics model is guaranteed, a scene consistent with the Unity road surface is established. Udp transmission is also used, and a data transmission script is written. The transmission step is set to 16ms. The data content includes the six-way position parameters of the vehicle body and the positioning parameters of the four wheels. The script is attached to the Unity vehicle model. The smoothing method is used to control the movement of the vehicle model. The final effect is that the dynamics model will transmit the position parameters of the vehicle and tires to the Unity scene at a rate of 16ms. This rate selection takes into account the high calculation accuracy of the dynamics model and balances the rendering requirements of the Unity scene. This separate transmission method ensures the real-time and accuracy of the dynamics calculation, and enables the scene rendering to proceed smoothly without occupying too many processor resources.
[0045] (3) Simulation of eye impairment.
[0046] Simulating special eye conditions is mainly divided into two categories: scene color adjustment and adding special layers. Special conditions such as color weakness and color blindness can be achieved by adjusting the color of the rendered scene. Special conditions such as floaters and the appearance of opaque foreign objects or blur in the field of vision can be achieved by adding special coloring.
[0047] (3.1) Simulate special scenarios such as color weakness and color blindness.
[0048] Step 1, add a post-processing layer component to the camera and set it as the main camera.
[0049] Step 2, create a post-processing profile and add Depth of Field and Color Grading effects to it.
[0050] Step 3. Configure "Depth of Field" to achieve local area blur, and configure "Color Grading" to simulate color weakness and color blindness effects.
[0051] Step 4: Apply the post-processing volume component to the configured post-processing profile and add the component to the camera or global object to make it effective in the scene.
[0052] This example adds a Post-Process Layer component to the camera and sets it to MainCamera; creates a Post-Process Profile and adds the "Depth of Field" and "Color Grading" effects to it; configures "Depth of Field" to achieve local area blur, and configures "Color Grading" to simulate special effects such as color weakness and color blindness; finally, applies the configured Post-Process Profile to the Post-ProcessVolume component, and adds the component to the camera or global object to make it effective in the scene. Through these steps, special scenes that simulate color-deficient driving can be implemented in Unity.
[0053] (3.2) Simulate effects such as floaters.
[0054] Step 1, write a shader script to overlay a floating speckled texture on the screen.
[0055] Step 2, create a material and apply the shader you wrote. In the Intensity window, set the material's shader to Custom / Floating Shader and drag a floating spot texture onto the _Texture Editor properties. Adjust the Intensity parameter to set the intensity of the floaters effect.
[0056] Step 3, write an image effect script and attach it to the projection camera. The image effect script applies material effects when rendering the image to simulate the visual effect of floaters.
[0057] This example is done by creating a custom Shader and material, and writing an image effect script. First, write a Shader script to overlay a floating spot texture on the screen, then create a material and apply the Shader, set the material's Shader to Custom / FloatersShader in the Inspector window, and drag a floating spot texture to the _FloaterTex property, and adjust the Intensity parameter to set the intensity of the floater effect. Next, write an image effect script and attach it to the camera, which applies the material effect when rendering the image, thereby simulating the visual effect of floaters.
[0058] (3.3) Simulate blur effects such as astigmatism.
[0059] Write a shader script to copy the original scene into two, and set the intensity of diffuse light by setting the offset size of the two scene images and the transparency of the layer.
[0060] This embodiment achieves the effect of simulating visual scenes with visual impairment by rendering and configuring the scene color and / or target layer of the projection camera. The operation is simple and the adjustment is convenient, thus providing data support for driving simulation of people with visual impairment.
[0061] The above disclosure is only a preferred embodiment of the present invention, but the present invention is not limited thereto. Any non-creative changes that can be thought of by a person skilled in the art, as well as several improvements and modifications made without departing from the principle of the present invention, should fall within the protection scope of the present invention.
Claims
1. A driving simulator Unity scene rendering method considering eye impairment, characterized in that: The following steps are involved: Create the first driving scene in Unity and configure the rendering of the scene to transmit road parameter information to the vehicle dynamics model and receive wheel information transmitted by the vehicle dynamics model; Create a second driving scene in Unity. The second driving scene is the same as the first driving scene. Configure the rendering of the second driving scene so that it receives the vehicle information transmitted by the vehicle dynamics model. The interaction frequency between the first driving scenario and the vehicle dynamics model is greater than that between the second driving scenario and the vehicle dynamics model; Rendering configurations for scene colors and / or target layers of projection cameras to simulate eye-impaired vision scenarios.
2. The method for rendering a driving simulator Unity scene considering eye impairment according to claim 1, characterized in that: The first driving scene is rendered and configured to transmit road parameter information to the vehicle dynamics model and receive wheel information transmitted by the vehicle dynamics model, including: Delete the camera and lights of the first driving scene, and turn off all rendering modules; Configuring a road surface recognition script, including configuring a first data transmission step length, so that the first driving scene receives wheel information from the vehicle dynamics model at each first data transmission step length, detects road surface parameter information in real time, and sends the road surface parameter information to the vehicle dynamics model at each first data transmission step length; Create an empty object in Unity; The road surface recognition script is attached to the empty object, and the road surface parameter information and wheel information are sent to the monitoring station in real time for monitoring.
3. The method for rendering a driving simulator Unity scene considering eye impairment according to claim 2, characterized in that: The wheel information includes the real-time position information of the four wheels, and the road surface parameter information includes the highest point of the road surface grid under the four-wheel position and the layer physical parameter information.
4. The method for rendering a driving simulator Unity scene considering eye impairment according to claim 2, characterized in that: Configuring the road surface recognition script also includes configuring the data transmission method to be UDP transmission, configuring the data transmission and reception to be triggered, and configuring the use of a laser probe method to detect road surface parameter information.
5. The method for rendering a driving simulator Unity scene considering eye impairment according to claim 2, characterized in that: The second driving scene is rendered and configured to receive vehicle information transmitted by the vehicle dynamics model, including: Configuring a data transmission script, including configuring a second data transmission step length, and configuring data content as vehicle information; the vehicle information includes six-way position parameters of the vehicle body and positioning parameters of four wheels; Attach the data transfer script to the vehicle dynamics model.
6. The method for rendering a driving simulator Unity scene considering eye impairment according to claim 5, characterized in that: Configuring the data transmission script also includes configuring the data transmission mode to be Udp transmission.
7. The method for rendering a driving simulator Unity scene considering eye impairment according to claim 5, characterized in that: The first data transmission step length is 1 ms, and the second data transmission step length is 16 ms.
8. The method for rendering a driving simulator Unity scene considering eye impairment according to any one of claims 1 to 7, characterized in that: Rendering configuration of the scene color and / or target layer of the projection camera to simulate visual scenes with eye impairment, including rendering configuration for simulating color weakness and color blindness scenes, specifically including: Add a post-processing layer component to the camera and set it as the main camera; Create a post-processing profile and add Depth of Field and Color Grading effects to it; Configure "Depth of Field" to achieve local area blur, and configure "Color Grading" to simulate color weakness and color blindness effects; Apply the configured post-processing profile to the post-processing volume component and add the component to the camera or global object to make it effective in the scene.
9. The method for rendering a driving simulator Unity scene considering eye impairment according to claim 8, characterized in that: Rendering configuration of the scene color and / or target layer of the projection camera to simulate the visual scene of eye impairment, including rendering configuration of the scene simulating floaters, specifically including: Write a shader script to overlay a floating speckled texture on the screen; Create a material and apply the shader you wrote. In the Intensity window, set the material's shader to Custom / Floating shader and drag a floating spot texture onto the _Texture Editor properties. Adjust the Intensity parameter to set the intensity of the floaters effect. Write an image effect script and attach it to the projection camera. The image effect script applies the material effect when rendering the image, thus simulating the visual effect of floaters.
10. The method for rendering a driving simulator Unity scene considering eye impairment according to claim 9, characterized in that: Rendering configuration of the scene color and / or target layer of the projection camera to simulate the visual scene of eye impairment, including rendering configuration of simulating astigmatism scene, specifically including: Write a shader script to copy the original scene into two, and set the intensity of diffuse light by setting the offset size of the two scene images and the transparency of the layer.
