Header file of Pointlightcomponent
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "PointLightComponent.generated.h"
/**
* A light component which emits light from a single point equally in all directions.
*/
UCLASS(ClassGroup=Lights, hidecategories=(Object, LightShafts), editinlinenew, meta=(BlueprintSpawnableComponent))
class ENGINE_API UPointLightComponent : public ULightComponent
{
GENERATED_UCLASS_BODY()
UPROPERTY()
float Radius_DEPRECATED;
/**
* Bounds the light's visible influence.
* This clamping of the light's influence is not physically correct but very important for performance, larger lights cost more.
*/
UPROPERTY(interp, BlueprintReadOnly, Category=Light, meta=(UIMin = "8.0", UIMax = "16384.0", SliderExponent = "5.0"))
float AttenuationRadius;
/**
* Whether to use physically based inverse squared distance falloff, where AttenuationRadius is only clamping the light's contribution.
* Disabling inverse squared falloff can be useful when placing fill lights (don't want a super bright spot near the light).
* When enabled, the light's Intensity is in units of lumens, where 1700 lumens is a 100W lightbulb.
* When disabled, the light's Intensity is a brightness scale.
*/
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Light, AdvancedDisplay)
uint32 bUseInverseSquaredFalloff:1;
/**
* Controls the radial falloff of the light when UseInverseSquaredFalloff is disabled.
* 2 is almost linear and very unrealistic and around 8 it looks reasonable.
* With large exponents, the light has contribution to only a small area of its influence radius but still costs the same as low exponents.
*/
UPROPERTY(interp, BlueprintReadOnly, Category=Light, AdvancedDisplay, meta=(UIMin = "2.0", UIMax = "16.0"))
float LightFalloffExponent;
/**
* Radius of light source shape.
* Note that light sources shapes which intersect shadow casting geometry can cause shadowing artifacts.
*/
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Light)
float SourceRadius;
/**
* Length of light source shape.
* Note that light sources shapes which intersect shadow casting geometry can cause shadowing artifacts.
*/
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Light)
float SourceLength;
/** The Lightmass settings for this object. */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Light, meta=(ShowOnlyInnerProperties))
struct FLightmassPointLightSettings LightmassSettings;
UFUNCTION(BlueprintCallable, Category="Rendering|Lighting")
void SetAttenuationRadius(float NewRadius);
UFUNCTION(BlueprintCallable, Category="Rendering|Lighting")
void SetLightFalloffExponent(float NewLightFalloffExponent);
UFUNCTION(BlueprintCallable, Category="Rendering|Lighting")
void SetSourceRadius(float bNewValue);
protected:
// Begin UActorComponent Interface
virtual void SendRenderTransform_Concurrent() override;
// End UActorComponent Interface
public:
// ULightComponent interface.
virtual bool AffectsBounds(const FBoxSphereBounds& Bounds) const;
virtual FVector4 GetLightPosition() const;
virtual FBox GetBoundingBox() const;
virtual FSphere GetBoundingSphere() const;
virtual ELightComponentType GetLightType() const;
virtual FLightSceneProxy* CreateSceneProxy() const override;
// Begin UObject Interface
virtual void Serialize(FArchive& Ar) override;
virtual void PostLoad() override;
#if WITH_EDITOR
virtual bool CanEditChange(const UProperty* InProperty) const override;
virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
#endif // WITH_EDITOR
// End UObject Interface
/**
* This is called when property is modified by InterpPropertyTracks
*
* @param PropertyThatChanged Property that changed
*/
virtual void PostInterpChange(UProperty* PropertyThatChanged);
private:
/** Pushes the value of radius to the rendering thread. */
void PushRadiusToRenderThread();
};
Source file of Pointlightcomponent
/**
* Sets up a projected shadow initializer for shadows from the entire scene.
* @return True if the whole-scene projected shadow should be used.
*/
virtual bool GetWholeSceneProjectedShadowInitializer(const FSceneViewFamily& ViewFamily, TArray<FWholeSceneProjectedShadowInitializer, TInlineAllocator<6> >& OutInitializers) const
{
if (ViewFamily.GetFeatureLevel() >= ERHIFeatureLevel::SM4
&& GAllowPointLightCubemapShadows != 0)
{
FWholeSceneProjectedShadowInitializer& OutInitializer = *new(OutInitializers) FWholeSceneProjectedShadowInitializer;
OutInitializer.bDirectionalLight = false;
OutInitializer.bOnePassPointLightShadow = true;
OutInitializer.PreShadowTranslation = -GetLightToWorld().GetOrigin();
OutInitializer.WorldToLight = GetWorldToLight().RemoveTranslation();
OutInitializer.Scales = FVector(1, 1, 1);
OutInitializer.FaceDirection = FVector(0,0,1);
OutInitializer.SubjectBounds = FBoxSphereBounds(FVector(0, 0, 0),FVector(Radius,Radius,Radius),Radius);
OutInitializer.WAxis = FVector4(0,0,1,0);
OutInitializer.MinLightW = 0.1f;
OutInitializer.MaxDistanceToCastInLightW = Radius;
OutInitializer.SplitIndex = INDEX_NONE;
OutInitializer.bRayTracedDistanceFieldShadow = UseRayTracedDistanceFieldShadows() && DoesPlatformSupportDistanceFieldShadowing(ViewFamily.GetShaderPlatform());
return true;
}
return false;
}
FPointLightSceneProxy(const UPointLightComponent* Component)
: TPointLightSceneProxy<FPointLightPolicy>(Component)
{}
};
I have two questions
- GetWholeSceneProjectedShadowInitializer() function is not defined in header file and how this function is present in source file?
- And when OutInitializer object is being created using new operator the argument (OutInitializers) is passed before FWholeSceneProjectedShadowInitializer why not after?
Please help!!