racerr-io / racerr

🏎️ racerr.io - Massively Multiplayer Online Racing
http://racerr.io
3 stars 0 forks source link

Improving Transparent Building Raycasting #71

Closed tonytangio closed 5 years ago

tonytangio commented 5 years ago

Improving the Transparent Building Raycasting feature introduced in #60

image

  1. Right now the implementation is to draw a single line from the camera to the centre of the player car, which does solve the primary issue. However, as seen in the picture, a single raycast to the centre of the car doesn't account for partial building coverage, when the buildings don't necessarily cover the exact centre of the car.

Perhaps we need a bit more advanced raycasting to point to the two ends of the player car, rather than just one raycast to the centre?

  1. Additionally, the transition from the opaque buildings to nearly fully transparent buildings is very abrupt.

It would feel much smoother if it was a smooth transition (say, the building gradually goes from 0% transparency to 50% transparency).