UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
EngineDefines.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2//
3// Public defines form the Engine
4
5#pragma once
6
7#include "HAL/Platform.h"
8
9/*-----------------------------------------------------------------------------
10 Configuration defines
11-----------------------------------------------------------------------------*/
12
13#ifndef UE_ENABLE_DEBUG_DRAWING
14 // we can debug render data in Debug/Development builds, or the Editor in Shipping or Test builds (not a common situation, but it is possible)
15 #define UE_ENABLE_DEBUG_DRAWING (!(UE_BUILD_SHIPPING || UE_BUILD_TEST) || WITH_EDITOR)
16#endif
17
18#ifndef ENABLE_VISUAL_LOG
19 #define ENABLE_VISUAL_LOG (PLATFORM_DESKTOP && !NO_LOGGING && UE_ENABLE_DEBUG_DRAWING)
20#endif
21
22// Whether lightmass generates FSHVector2 or FSHVector3. Linked with VER_UE4_INDIRECT_LIGHTING_SH3
23#define NUM_INDIRECT_LIGHTING_SH_COEFFICIENTS 9
24
25// The number of lights to consider for sky/atmospheric light scattering
26#define NUM_ATMOSPHERE_LIGHTS 2
27
28// Enables StateStream for actor/component system
29// Set in .target.cs to enable
30#ifndef WITH_STATE_STREAM_ACTOR
31 #define WITH_STATE_STREAM_ACTOR 0
32#endif
33
34/*-----------------------------------------------------------------------------
35 Size of the world.
36-----------------------------------------------------------------------------*/
37#define UE_OLD_WORLD_MAX 2097152.0 /* UE4 maximum world size */
38#define UE_OLD_HALF_WORLD_MAX (UE_OLD_WORLD_MAX * 0.5) /* UE4 half maximum world size */
39#define UE_OLD_HALF_WORLD_MAX1 (UE_OLD_HALF_WORLD_MAX - 1) /* UE4 half maximum world size minus one */
40
41#define UE_LARGE_WORLD_MAX 8796093022208.0 /* LWC maximum world size, Approx 87,960,930.2 km across, or 43,980,465.1 km from the origin */
42#define UE_LARGE_HALF_WORLD_MAX (UE_LARGE_WORLD_MAX * 0.5) /* LWC half maximum world size */
43#define UE_LARGE_HALF_WORLD_MAX1 (UE_LARGE_HALF_WORLD_MAX - 1) /* LWC half maximum world size minus one */
44
45#ifndef UE_USE_UE4_WORLD_MAX
46#define UE_USE_UE4_WORLD_MAX 0 // Force UE4 WORLD_MAX for converted UE4 titles that explicitly rely on it.
47#endif
48
49// Note: Modifying WORLD_MAX affects UE_LWC_RENDER_TILE_SIZE in Engine\Source\Runtime\Core\Private\Misc\LargeWorldRenderPosition.cpp and may introduce precision issues in shaders using world coordinates.
50#if UE_USE_UE4_WORLD_MAX
51#define WORLD_MAX (UE_OLD_WORLD_MAX)
52#else
53#define WORLD_MAX (UE_LARGE_WORLD_MAX)
54#endif
55
56#define HALF_WORLD_MAX (WORLD_MAX * 0.5) /* Half the maximum size of the world */
57#define HALF_WORLD_MAX1 (HALF_WORLD_MAX - 1.0) /* Half the maximum size of the world minus one */
58
59#define UE_FLOAT_HUGE_DISTANCE 1048576.0 /* Maximum distance representable by a float whilst maintaining precision of at least 0.0625 units (1/16th of a cm) - Precision issues may occur for positions/distances represented by float types that exceed this value */
60#define UE_DOUBLE_HUGE_DISTANCE 562949953421312.0 /* Maximum distance representable by a double whilst maintaining precision of at least 0.0625 units (1/16th of a cm) - Precision issues may occur for positions/distances represented by double types that exceed this value */
61
62#define MIN_ORTHOZOOM 1.0 /* 2D ortho viewport zoom >= MIN_ORTHOZOOM */
63#define MAX_ORTHOZOOM 1e25 /* 2D ortho viewport zoom <= MAX_ORTHOZOOM */
64#define DEFAULT_ORTHOZOOM 10000.0 /* Default 2D ortho viewport zoom */
65#define DEFAULT_ORTHOWIDTH 1536.0f /* Default 2D ortho viewport width */
66#define DEFAULT_ORTHONEARPLANE -DEFAULT_ORTHOWIDTH/2.0f /* Default 2D ortho viewport nearplane */
67#define DEFAULT_ORTHOFARPLANE UE_OLD_WORLD_MAX /* Default 2D ortho viewport farplane */
68
70#define SDPG_NumBits 3