Search Issue Tracker

By Design

Votes

1

Found in

5.4.0b16

Issue ID

792633

Regression

No

Flare starts to flicker when rigidbody has certain velocity

Camera

-

Steps to reproduce:

1. Open attached project
2. Open scene "Scenes/MainScene"
3. Run it
4. Notice that once velocity is around 200 flare starts to flicker and around 300 completely disappears

Note: once velocity is around 1200 flare reappears

Reproduced with: 5.1.4f1, 5.2.4f1, 5.3.4p5, 5.4.0b17

Comments (2)

  1. karl_jones

    Feb 14, 2017 10:59

    The issue is not actually a bug but “by design”.
    The flare uses a raycast to determine its visibility; it does this by sampling the camera position and the flare position and constructing a ray, which it then fires. If the ray hits something then we know that the flare is blocked; and so gradually reduce the flares brightness. The problem is that when interpolation is enabled the position of the camera and visible objects are now interpolated between the last two simulated physics frames however the colliders in the world are not interpolated, they are only updated during a fixed update. This means that the camera is raycasting from an interpolated position to colliders that are not interpolated and so when travelling at high speeds the collider will jump ahead of the actual interpolated version of itself causing the rays to hit and the flare to flicker.

    We could fix this by only performing a raycast using the non-interpolated position or only during a fixed update, however this would significantly change the flares behaviour and cause it to appear to be less responsive. The use case presented here is quite niche and so the best solution is to use the tools already provided and simply place the collider onto a layer that is ignored by the flares raycasts. It is also possible to rectify the problem by using extrapolate instead of interpolate.

  2. xzbobzx

    Apr 29, 2016 21:13

    Note that this doesn't occur when Rigidbody's interpolation is set to "None".

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.