Files
UnrealEngineUWP/Engine/Shaders/Shared/LightDefinitions.h
chris kulla fffb652a2e RayTracing: Implement a new light grid used in raytracing passes (Translucency and Lumen Hit Lighting) based on the method used in the Path Tracer
The new light grid can localize the influcence of each light much better despite being built only in 2D. Some logic is duplicated between the path tracer and decals which use a similar system.  It should be possible to share some of the logic with future refactors.

This refactor also allows more than 256 lights (no code was actively depending on this limit anymore after the removal of RTR and RTGI). However there is still a fixed number of lights available per grid cell. Using the "Light Grid Occupancy" debug mode can help visualize where this might be occurring.

The following cvars can be used to control memory usage and performance:
 * r.RayTracing.LightGridResolution: Resolution of the 2D grid which holds lights
 * r.RayTracing.LightGridMaxCount: Maximum number of lights per grid cell (if there are fewer lights than this in the scene, that number will be used instead)

Code cleanup: Refactor  LIGHT_TYPE_* definitions to be shared across shaders and C++ code and remove duplicated definitions.

#jira UE-170690
#rb Aleksander.Netzel

[CL 29508005 by chris kulla in ue5-main branch]
2023-11-06 20:11:26 -05:00

10 lines
220 B
C

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#define LIGHT_TYPE_DIRECTIONAL 0
#define LIGHT_TYPE_POINT 1
#define LIGHT_TYPE_SPOT 2
#define LIGHT_TYPE_RECT 3
#define LIGHT_TYPE_MAX 4