Skip to content

fix(render): render coronas and shadows for offscreen vehicles in drawingEvent - #356

Open
CanerKaraca23 wants to merge 1 commit into
user-grinch:mainfrom
CanerKaraca23:fix/render-offscreen-shadows
Open

CanerKaraca23 wants to merge 1 commit into
user-grinch:mainfrom
CanerKaraca23:fix/render-offscreen-shadows

Conversation

@CanerKaraca23

Copy link
Copy Markdown
Collaborator

Summary

Fixes vehicle headlight/taillight ground shadows and light coronas instantly vanishing and popping in when looking away from a vehicle or when the vehicle hull is off-screen.

Details

  • Previously, ModelInfoMgr::OnRender was triggered solely inside MEEvents::vehRenderEvent.before (hooked into CVehicle::Render). When the vehicle's model bounding box leaves the camera frustum / viewport (GetIsOnScreen() == false), the game skips calling CVehicle::Render, causing projected ground shadows and light effects to instantly pop out of existence even when their ground area or light cones are clearly visible to the camera.
  • Hooks Events::drawingEvent to iterate through active vehicles within reasonable camera distance ($120\text{m}$) that are not currently in the viewport (!pVeh->GetIsOnScreen()) and renders their light coronas and ground shadows.
  • Skips BMX, boats, and trailers to prevent unnecessary processing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant