Rain Exclusion Zone for Cars
Requirements
- The exclusion zone should have 12 triangles
- The exclusion zone can be something different than a perfect cube (the sides can be at a different angle than 90 degree).
- If you're having issue with an exclusion zone that is not a cube, try reverting to a cube for a test, check if that works
- Test that the exclusion zone is working both in a static position and while the car is moving at a high speed
Dimensions
You should initially create the exclusion zone to fit the cockpit. After the previous point a good rule of thumb is to add 1 meter to each size (height, width, length) of the exclusion zone.
The rationale behind this is explained in the following section:
- The single rain drop is considered as a rectangle
- For performance reason we're checking in the vertex shader if a vertex is inside or not an exclusion zone
- When a vertex is inside an exclusion zone the opacity is set to 0, when it's outside it is set to 1
- In the pixel shader the opacity is interpolated between the vertices
- The previous point causes the issue in the picture above, this means that the drop half in, half out of the exclusion zone will be visible due to interpolation.
- Empirically i noticed that adding 1 meter to the size of the exclusion zone solve this issue.
Example
This is the Bentley with a (tested and working) NoRainZone, using this extra size as suggested above. Please use the same technique, or just reuse the box from the Bentley model.