Home / Forums / Understanding Color-based Screen Sampling vs Memory-based ESP Math

UnreliableCode Community

Developer Research, Reverse Engineering & Coding Community

Discussion

Understanding Color-based Screen Sampling vs Memory-based ESP Math

VectorByte
Graphics & DirectX Dev
VIP
Rep: 420
Join Date: Aug 2022
Posts: 39
Thanks: 115
1y ago · Feb 28, 2025 5:35 PM
#1
Comparing pixel color sampling (Desktop Duplication API / GDI / Direct3D 11 screen capture) versus memory-based entity coordinates:

Pixel Scanning Approach:
- Uses
CPP
IDXGIOutputDuplication
to grab GPU framebuffers in ~1ms.
- Searches a bounding region (e.g. 100x100 pixels around crosshair) for high-contrast enemy outlines (like Purple/Yellow enemy highlights).
- Zero memory reading / zero process interaction.

Memory Coordinate Approach:
- Requires reading 3D position vectors from player structures.
- Projects 3D world space to 2D screen coordinates with matrix math.
- Provides 360-degree awareness and distance scaling.

What are your thoughts on performance tradeoffs between Desktop Duplication and Direct3D overlay pipelines?
VectorByte | DirectX 11/12 Hooking & ImGui Overlays
Quote
Math is the language of game engines.
The following users thanked VectorByte for this post:
AimbotMath
Trigonometry & Smoothing
MEMBER
Rep: 285
Join Date: Nov 2023
Posts: 27
Thanks: 73
1y ago · Feb 28, 2025 7:10 PM
#2
DXGI Desktop Duplication is surprisingly efficient on modern GPUs when using hardware format conversion (
CODE
DXGI_FORMAT_B8G8R8A8_UNORM
). Filtering by HSV color space (Hue, Saturation, Value) instead of raw RGB makes yellow/purple highlight detection very accurate.
AimbotMath · Angular Normalization & Smooth Angles
GlowShader
Shader & Overlay Artist
MEMBER
Rep: 185
Join Date: Oct 2023
Posts: 36
Thanks: 46
1y ago · Mar 1, 2025 10:45 AM
#3
Desktop Duplication avoids any in-process hooks entirely. For internal tools, DirectX Present hooks offer higher frame rates, but for purely external utilities, Desktop Duplication is rock solid.
GlowShader | Shaders, Stencils & DirectX DrawLists