keywords:UE4, Lighting, API

LightComponentBase (the basic of LightComponent)

LightComponentBase’s API in common

Properties:

/** 
 * Total energy that the light emits.  
 */
UPROPERTY(BlueprintReadOnly, interp, Category=Light, meta=(DisplayName = "Intensity", UIMin = "0.0", UIMax = "20.0"))
float Intensity;

/** 
 * Filter color of the light.
 * Note that this can change the light's effective intensity.
 */
UPROPERTY(BlueprintReadOnly, interp, Category=Light, meta=(HideAlphaChannel))
FColor LightColor;

/** 
 * Whether the light can affect the world, or whether it is disabled.
 * A disabled light will not contribute to the scene in any way.  This setting cannot be changed at runtime and unbuilds lighting when changed.
 * Setting this to false has the same effect as deleting the light, so it is useful for non-destructive experiments.
 */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Light)
uint32 bAffectsWorld:1;

/**
 * Whether the light should cast any shadows.
 **/
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Light)
uint32 CastShadows:1;

/**
 * Whether the light should cast shadows from static objects.  Also requires Cast Shadows to be set to True.
 */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Light, AdvancedDisplay)
uint32 CastStaticShadows:1;

/**
 * Whether the light should cast shadows from dynamic objects.  Also requires Cast Shadows to be set to True.
 **/
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Light, AdvancedDisplay)
uint32 CastDynamicShadows:1;

/** Whether the light affects translucency or not.  Disabling this can save GPU time when there are many small lights. */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Light, AdvancedDisplay)
uint32 bAffectTranslucentLighting:1;

/** Whether light from this light transmits through surfaces with subsurface scattering profiles. Requires light to be movable. */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Light, AdvancedDisplay)
uint32 bTransmission : 1;

/** Whether the light shadows volumetric fog.  Disabling this can save GPU time. */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Light, AdvancedDisplay)
uint32 bCastVolumetricShadow : 1;

/** 
 * Scales the indirect lighting contribution from this light. 
 * A value of 0 disables any GI from this light. Default is 1.
 */
UPROPERTY(BlueprintReadOnly, interp, Category=Light, meta=(UIMin = "0.0", UIMax = "6.0"))
float IndirectLightingIntensity;

/** Intensity of the volumetric scattering from this light.  This scales Intensity and LightColor. */
UPROPERTY(BlueprintReadOnly, interp, Category=Light, meta=(UIMin = "0.25", UIMax = "4.0"))
float VolumetricScatteringIntensity;

LightComponent (the basic component of various Light)

Engine\Source\Runtime\Engine\Classes\Components\LightComponent.h

LightComponent’s API in common

Properties:

/** 
 * Whether to render light shaft bloom from this light. 
 * For directional lights, the color around the light direction will be blurred radially and added back to the scene.
 * for point lights, the color on pixels closer than the light's SourceRadius will be blurred radially and added back to the scene.
 */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=LightShafts, meta=(DisplayName = "Light Shaft Bloom"))
uint32 bEnableLightShaftBloom:1;

/** Scales the additive color. */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=LightShafts, meta=(UIMin = "0", UIMax = "10"))
float BloomScale;

/** Scene color must be larger than this to create bloom in the light shafts. */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=LightShafts, meta=(UIMin = "0", UIMax = "4"))
float BloomThreshold;

/** Multiplies against scene color to create the bloom color. */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=LightShafts)
FColor BloomTint;

Sky Light

Engine\Source\Runtime\Engine\Classes\Components\SkyLightComponent.h

Sky Light’s API in common

Properties:

/** Whether the light shadows volumetric fog.  Disabling this can save GPU time. */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Light, AdvancedDisplay)
uint32 bCastVolumetricShadow : 1;

/** 
 * Scales the indirect lighting contribution from this light. 
 * A value of 0 disables any GI from this light. Default is 1.
 */
UPROPERTY(BlueprintReadOnly, interp, Category=Light, meta=(UIMin = "0.0", UIMax = "6.0"))
float IndirectLightingIntensity;

/** Intensity of the volumetric scattering from this light.  This scales Intensity and LightColor. */
UPROPERTY(BlueprintReadOnly, interp, Category=Light, meta=(UIMin = "0.25", UIMax = "4.0"))
float VolumetricScatteringIntensity;

Functions:

/** Sets the cubemap used when SourceType is set to SpecifiedCubemap, and causes a skylight update on the next tick. */
UFUNCTION(BlueprintCallable, Category="SkyLight")
void SetCubemap(UTextureCube* NewCubemap);

/** 
 * Creates sky lighting from a blend between two cubemaps, which is only valid when SourceType is set to SpecifiedCubemap. 
 * This can be used to seamlessly transition sky lighting between different times of day.
 * The caller should continue to update the blend until BlendFraction is 0 or 1 to reduce rendering cost.
 * The caller is responsible for avoiding pops due to changing the source or destination.
 */
UFUNCTION(BlueprintCallable, Category="SkyLight")
void SetCubemapBlend(UTextureCube* SourceCubemap, UTextureCube* DestinationCubemap, float InBlendFraction);

/** Indicates that the capture needs to recapture the scene, adds it to the recapture queue. */
void SetCaptureIsDirty();
void SetBlendDestinationCaptureIsDirty();
void SanitizeCubemapSize();

/** Whether sky occlusion is supported by current feature level */
bool IsOcclusionSupported() const;

/** 
 * Recaptures the scene for the skylight. 
 * This is useful for making sure the sky light is up to date after changing something in the world that it would capture.
 * Warning: this is very costly and will definitely cause a hitch.
 */
UFUNCTION(BlueprintCallable, Category="Rendering|Components|SkyLight")
void RecaptureSky();

Exponential Height Fog

Engine\Source\Runtime\Engine\Classes\Components\ExponentialHeightFogComponent.h

Exponential Height Fog’s API in common

Properties:

/** Global density factor. */
UPROPERTY(BlueprintReadOnly, interp, Category=ExponentialHeightFogComponent, meta=(UIMin = "0", UIMax = ".05"))
float FogDensity;

UPROPERTY(BlueprintReadOnly, interp, Category=ExponentialHeightFogComponent)
FLinearColor FogInscatteringColor;

/** 
 * Controls the color of the directional inscattering, which is used to approximate inscattering from a directional light. 
 * Note: there must be a directional light with bUsedAsAtmosphereSunLight enabled for DirectionalInscattering to be used.
 */
UPROPERTY(BlueprintReadOnly, interp, Category=DirectionalInscattering)
FLinearColor DirectionalInscatteringColor;

正如对幸福的寻求是自我欺骗一样,一味追求一颗善的良心只会使我们失去发现它的机会,因为在追求的过程中,我们变成了伪善的人。──《弗兰克尔:意义与人生》