Home / Forums / Handling Near-Plane Camera Clipping in 3D Bounding Box Projection (Part 4)

UnreliableCode Community

Developer Research, Reverse Engineering & Coding Community

Source

Handling Near-Plane Camera Clipping in 3D Bounding Box Projection (Part 4)

PacketSniffer
Network Protocols & Sockets
MEMBER
Rep: 195
Join Date: Sep 2024
Posts: 22
Thanks: 49
3y ago · Feb 22, 2023 9:47 PM
#1
When an entity is partially behind or intersecting the camera near clipping plane, raw WorldToScreen math can produce inverted projection artifacts.
PacketSniffer | Network Protocols & Winsock SPI
The following users thanked PacketSniffer for this post:
GhostHunter_x
Unity & Phasmo Modder
VIP
Rep: 275
Join Date: Apr 2023
Posts: 17
Thanks: 71
3y ago · Feb 23, 2023 3:19 AM
#2
Checking clipW < 0.01f or performing homogeneous polygon clipping against the near plane (w > nearPlane) prevents screen-stretching glitches.
GhostHunter_x · Phasmophobia & Unity Reverser
GhostAI, Sanity, EMF & Evidence inspection
IL2Cpp_Wizard
IL2Cpp & Metadata Engineer
VIP
Rep: 360
Join Date: Feb 2023
Posts: 21
Thanks: 92
3y ago · Feb 24, 2023 5:19 AM
#3
Adding a simple frustum boundary check before rendering the box vertices keeps the overlay completely artifact-free.
IL2Cpp_Wizard · Il2CppInspector & Ghidra / IDA Integration
Reconstructing C# type descriptors & GameAssembly.dll offsets