UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
PrimitiveUniformShaderParameters.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
8#include "SceneTypes.h"
9#include "RenderResource.h"
10#include "ShaderParameters.h"
11#include "UniformBuffer.h"
12
20 SHADER_PARAMETER(uint32, InstanceSceneDataOffset)
21 SHADER_PARAMETER(uint32, NumInstanceSceneDataEntries)
22 SHADER_PARAMETER(int32, SingleCaptureIndex) // Should default to 0 if no reflection captures are provided, as there will be a default black (0,0,0,0) cubemap in that slot
23 SHADER_PARAMETER(FVector3f, PositionHigh)
24 SHADER_PARAMETER(uint32, PrimitiveComponentId) // TODO: Refactor to use PersistentPrimitiveIndex, ENGINE USE ONLY - will be removed
25 SHADER_PARAMETER(FMatrix44f, LocalToRelativeWorld) // Always needed
27 SHADER_PARAMETER(FMatrix44f, PreviousLocalToRelativeWorld) // Used to calculate velocity
28 SHADER_PARAMETER(FMatrix44f, PreviousRelativeWorldToLocal) // Rarely used when calculating velocity, if material uses vertex offset along with world->local transform
29 SHADER_PARAMETER(FMatrix44f, WorldToPreviousWorld) // Used when calculating instance prev local->world for static instances that do not store it (calculated via doubles to resolve precision issues)
31 SHADER_PARAMETER(float, ObjectBoundsX) // Only needed for editor/development
33 SHADER_PARAMETER(FVector3f, ObjectWorldPositionLow) // Needed by some materials
38 SHADER_PARAMETER(uint32, LightmapUVIndex) // Only needed if static lighting is enabled
40 SHADER_PARAMETER(uint32, LightmapDataIndex) // Only needed if static lighting is enabled
42 SHADER_PARAMETER(FVector3f, PreSkinnedLocalBoundsMin) // Local space min bounds, pre-skinning
43 SHADER_PARAMETER(uint32, NaniteResourceID)
44 SHADER_PARAMETER(FVector3f, PreSkinnedLocalBoundsMax) // Local space bounds, pre-skinning
45 SHADER_PARAMETER(uint32, NaniteHierarchyOffset)
48 SHADER_PARAMETER(FVector3f, LocalObjectBoundsMin) // This is used in a custom material function (ObjectLocalBounds.uasset)
49 SHADER_PARAMETER(float, ObjectBoundsY) // Only needed for editor/development
50 SHADER_PARAMETER(FVector3f, LocalObjectBoundsMax) // This is used in a custom material function (ObjectLocalBounds.uasset)
51 SHADER_PARAMETER(float, ObjectBoundsZ) // Only needed for editor/development
53 SHADER_PARAMETER(uint32, InstancePayloadDataOffset)
55 SHADER_PARAMETER(uint32, InstancePayloadDataStride)
57 SHADER_PARAMETER(FVector2f, WireframeAndPrimitiveColor) // Only needed for editor/development
59 SHADER_PARAMETER(int32, PersistentPrimitiveIndex)
63 SHADER_PARAMETER(float, MaterialDisplacementFadeOutSize)
64 SHADER_PARAMETER(float, AnimationMinScreenSize)
65 SHADER_PARAMETER(FUintVector2, MeshPaintTextureDescriptor)
66 SHADER_PARAMETER(uint32, MaterialCacheDescriptor)
68 SHADER_PARAMETER(float, MaxWPOExtent)
71 SHADER_PARAMETER_ARRAY(FVector4f, CustomPrimitiveData, [FCustomPrimitiveData::NumCustomPrimitiveDataFloat4s]) // Custom data per primitive that can be accessed through material expression parameters and modified through UStaticMeshComponent
73
75 const FMatrix& LocalToWorld,
76 const FBoxSphereBounds& WorldBounds,
77 const FBoxSphereBounds& LocalBounds,
78 const FBoxSphereBounds& PreSkinnedLocalBounds,
79 bool bReceivesDecals,
80 bool bOutputVelocity
81);
82
84
96
99
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
ENGINE_API FPrimitiveUniformShaderParameters GetIdentityPrimitiveParameters()
Definition PrimitiveUniformShaderParameters.cpp:236
ENGINE_API TGlobalResource< FIdentityPrimitiveUniformBuffer > GIdentityPrimitiveUniformBuffer
Definition SceneView.cpp:390
ENGINE_API TUniformBufferRef< FPrimitiveUniformShaderParameters > CreatePrimitiveUniformBufferImmediate(const FMatrix &LocalToWorld, const FBoxSphereBounds &WorldBounds, const FBoxSphereBounds &LocalBounds, const FBoxSphereBounds &PreSkinnedLocalBounds, bool bReceivesDecals, bool bOutputVelocity)
Definition PrimitiveUniformShaderParameters.cpp:211
#define END_GLOBAL_SHADER_PARAMETER_STRUCT
Definition ShaderParameterMacros.h:1669
#define SHADER_PARAMETER_ARRAY(MemberType, MemberName, ArrayDecl)
Definition ShaderParameterMacros.h:1696
#define SHADER_PARAMETER_EX(MemberType, MemberName, Precision)
Definition ShaderParameterMacros.h:1687
#define BEGIN_GLOBAL_SHADER_PARAMETER_STRUCT
Definition ShaderParameterMacros.h:1663
#define SHADER_PARAMETER(MemberType, MemberName)
Definition ShaderParameterMacros.h:1684
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition PrimitiveUniformShaderParameters.h:89
void InitContents()
Definition PrimitiveUniformShaderParameters.h:91
static RENDERCORE_API FRHICommandListBase & GetImmediateCommandList()
Definition RenderResource.cpp:173
Definition RenderResource.h:543
Definition ShaderParameterMacros.h:136
Definition UniformBuffer.h:29
@ Half
Definition ShaderParameterMetadata.h:40
static constexpr int32 NumCustomPrimitiveDataFloat4s
Definition SceneTypes.h:38
Definition BoxSphereBounds.h:25