You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
54 lines
1.0 KiB
Plaintext
54 lines
1.0 KiB
Plaintext
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "RectLight.ush"
|
|
|
|
struct FAreaLight
|
|
{
|
|
float SphereSinAlpha;
|
|
float SphereSinAlphaSoft;
|
|
float LineCosSubtended;
|
|
|
|
float3 FalloffColor;
|
|
|
|
FRect Rect;
|
|
FRectTexture Texture;
|
|
bool bIsRect;
|
|
};
|
|
|
|
struct FAreaLightIntegrateContext
|
|
{
|
|
FAreaLight AreaLight;
|
|
float3 L;
|
|
float NoL;
|
|
float Falloff;
|
|
};
|
|
|
|
bool IsAreaLight(FAreaLight AreaLight)
|
|
{
|
|
return (
|
|
AreaLight.bIsRect ||
|
|
AreaLight.SphereSinAlpha > 0.0f ||
|
|
AreaLight.SphereSinAlphaSoft > 0.0f ||
|
|
AreaLight.LineCosSubtended < 1.0f
|
|
) ? true : false;
|
|
}
|
|
|
|
FAreaLightIntegrateContext InitAreaLightIntegrateContext()
|
|
{
|
|
// Manual initialization of the area light as the compiler is unhappy otherwise
|
|
FAreaLightIntegrateContext Out;
|
|
Out.AreaLight.SphereSinAlpha = 0;
|
|
Out.AreaLight.SphereSinAlphaSoft = 0;
|
|
Out.AreaLight.LineCosSubtended = 0;
|
|
Out.AreaLight.FalloffColor = 0;
|
|
Out.AreaLight.Rect = (FRect)0;
|
|
Out.AreaLight.bIsRect = false;
|
|
// Out.AreaLight.Texture;
|
|
Out.L = 0;
|
|
Out.NoL = 0;
|
|
Out.Falloff = 0;
|
|
return Out;
|
|
}
|