- Status
- Offline
- Joined
- Mar 3, 2026
- Messages
- 142
- Reaction score
- 7
Anyone else messing with Pavlov VR internals lately? Trying to get a solid ESP going, but my WorldToScreen math is giving me a headache. I am pulling the actor list and trying to map locations through the Canvas, but the projection in VR space is clearly fighting me—likely due to the stereo rendering or just how the viewport handles the transform matrices compared to standard desktop builds.
I have been testing the following logic, but the boxes are jumping around like crazy or simply not aligning with the actual pawn position:
The technical roadblock:
Has anyone here managed to hook the VR view matrices properly for Pavlov, or are you guys using a custom overlay for the world-to-screen conversion? I am tempted to try grabbing the view matrix directly from the GEngine, but I want to avoid the extra overhead if there is a cleaner way to handle this via the Canvas.
If you have a better approach for drawing ESP in a VR environment, drop your thoughts below. Not looking for a full paste, just trying to fix this projection math so the boxes don't look like they are floating in Narnia.
I have been testing the following logic, but the boxes are jumping around like crazy or simply not aligning with the actual pawn position:
Code:
void __stdcall PostRenderHook( UGameViewportClient* GameViewportClient, UCanvas* Canvas ) {
SDK::TArray<SDK::AActor*>& Actors = SDK::UWorld::GetWorld( )->PersistentLevel->Actors;
{
for ( SDK::AActor* Actor : Actors ) {
if ( !Actor || !Actor->IsA( SDK::EClassCastFlags::Pawn ) || !Actor->IsA( SDK::APawn::StaticClass( ) ) )
continue;
auto Pawn = ( SDK::APavlovPawn* ) Actor;
SDK::FVector ActorLoc = Pawn->K2_GetActorLocation();
SDK::FVector TempV = Canvas->K2_Project( ActorLoc );
SDK::FVector2D Size( 65.0f, 65.0f );
SDK::FVector2D Pos( TempV.X - Size.X / 2, TempV.Y - Size.Y / 2 );
Canvas->K2_DrawBox( Pos, Size, 2.0f, SDK::FLinearColor( 255.f, 255.f, 255.f, 255.f ) );
}
}
exit:
PostRenderOriginal( GameViewportClient, Canvas );
}
The technical roadblock:
- ViewMatrix issues: K2_Project usually assumes a single camera perspective. In VR, with the dual-view setup, the projection matrix isn't consistently hitting the depth buffer correctly for the overlay.
- Pawn iteration: The actor loop is fine for a test, but once the lobby fills up, I suspect I am going to hit some serious frame-time spikes if I don't move this to a dedicated thread or optimize the actor caching.
- Drawing: The standard Canvas drawing is hit-or-miss depending on the current rendering pass.
Has anyone here managed to hook the VR view matrices properly for Pavlov, or are you guys using a custom overlay for the world-to-screen conversion? I am tempted to try grabbing the view matrix directly from the GEngine, but I want to avoid the extra overhead if there is a cleaner way to handle this via the Canvas.
If you have a better approach for drawing ESP in a VR environment, drop your thoughts below. Not looking for a full paste, just trying to fix this projection math so the boxes don't look like they are floating in Narnia.