![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <VirtualShadowMapClipmap.h>
Inheritance diagram for FVirtualShadowMapClipmap:Static Public Member Functions | |
| static float | GetLevelRadius (float AbsoluteLevel) |
| FVirtualShadowMapClipmap::FVirtualShadowMapClipmap | ( | FVirtualShadowMapArray & | VirtualShadowMapArray, |
| const FLightSceneInfo & | InLightSceneInfo, | ||
| const FViewMatrices & | CameraViewMatrices, | ||
| FIntPoint | CameraViewRectSize, | ||
| const FViewInfo * | InDependentView, | ||
| float | LightMobilityFactor, | ||
| const FVirtualShadowMapClipmapConfig & | Config = FVirtualShadowMapClipmapConfig::GetGlobal() |
||
| ) |
Orthographic cameras have uniform depth, so basing the LodScale on the width alone can cause issues when selecting the clipmap area to resolve at larger scale views. Instead we use the OrthoWidth. This gives a larger area for the shadows to be drawn to and ensures shadows further away/in the corners of the view rect have the correct LOD resolution. We default to the viewport as a minimum.
If enabled, use the ViewTarget location as the WorldOrigin location, this helps with scaling VSMs in Ortho as the clipmaps emanate more evenly from the focus of the view. A ViewTarget is not always necessarily present, but there isn't really an alternative way to estimate the best WorldOrigin for this effect to work well right now without the ViewTarget set.
For Ortho projections, this branch bases the first level VSM on the set OrthoWidth. This reduces the number of clipmaps generated and also scales the precision of the clipmaps depending on the scene.
To be on the safe side, we output -1 FirstLevel compared to what the full OrthoWidth would output. The InvProjectionMatrix outputs half the OrthoWidth in the [0][0] position, and as we are using Log2, we can just use that raw value, rather than multiplying it then subtracting a level.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| float FVirtualShadowMapClipmap::GetMaxRadius | ( | ) | const |
| const FVirtualShadowMapProjectionShaderData & FVirtualShadowMapClipmap::GetProjectionShaderData | ( | int32 | ClipmapIndex | ) | const |
|
inline |
| FViewMatrices FVirtualShadowMapClipmap::GetViewMatrices | ( | int32 | ClipmapIndex | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
Whether the clipmap is for casting shadow of FirstPersonWorldSpaceRepresentation primitives onto the scene.
| void FVirtualShadowMapClipmap::OnPrimitiveRendered | ( | const FPrimitiveSceneInfo * | PrimitiveSceneInfo | ) |
Called when a primitive passes CPU-culling, note that this applies to non-nanite primitives only. Not thread safe in general.
| void FVirtualShadowMapClipmap::UpdateCachedFrameData | ( | ) |
Called to push any cache data to cache entry at the end of the frame.