Skip to content

Commit ce9fefa

Browse files
committed
Minor fixes:
Fixed wrong copyright lines Fixed retrieving a tex coord channel Fixed various include issues Setup project to work alongside RMC-Pro
1 parent fd1696a commit ce9fefa

27 files changed

+174
-37
lines changed

.gitignore

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Git files
2+
.git/
3+
14
# Visual Studio 2015 user specific files
25
.vs/
36

@@ -49,7 +52,7 @@ SourceArt/**/*.png
4952
SourceArt/**/*.tga
5053

5154
# Binary Files
52-
Binaries/*
55+
Binaries/**
5356
Plugins/*/Binaries/*
5457

5558
# Builds
@@ -70,8 +73,26 @@ Build/*/**
7073
Saved/*
7174

7275
# Compiled source files for the engine to use
73-
Intermediate/*
76+
Intermediate/**
7477
Plugins/*/Intermediate/*
7578

7679
# Cache files for the editor to use
7780
DerivedDataCache/*
81+
82+
# Mac crap
83+
.DS_Store
84+
85+
# Un-Ignore All ThirdParty binary/libs etc.
86+
!ThirdParty/**
87+
88+
# Ignore Export directory
89+
Export/**
90+
91+
# Ignore VS Code files
92+
.vscode/**
93+
94+
# Unignore .github folder
95+
!.github/**
96+
97+
# Unignore .gitignore
98+
!.gitignore
File renamed without changes.
-6 KB
Binary file not shown.

Source/RuntimeMeshComponent/Private/Providers/RuntimeMeshProviderStatic.cpp

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "RuntimeMeshComponentPlugin.h"
55
#include "RuntimeMeshModifier.h"
66

7+
78
#define RMC_LOG_VERBOSE(Format, ...) \
89
UE_LOG(RuntimeMeshLog2, Verbose, TEXT("[RMPS:%d Thread:%d]: " Format), GetUniqueID(), FPlatformTLS::GetCurrentThreadId(), __VA_ARGS__);
910

@@ -295,6 +296,8 @@ void URuntimeMeshProviderStatic::SetShouldSerializeMeshData(bool bIsSerialized)
295296
StoreEditorGeneratedDataForGame = bIsSerialized;
296297
}
297298

299+
300+
298301
void URuntimeMeshProviderStatic::Initialize()
299302
{
300303
RMC_LOG_VERBOSE("Initializing...");
@@ -479,7 +482,6 @@ bool URuntimeMeshProviderStatic::GetCollisionMesh(FRuntimeMeshCollisionData& Col
479482
}
480483

481484

482-
483485
void URuntimeMeshProviderStatic::ConfigureLODs(const TArray<FRuntimeMeshLODProperties>& LODSettings)
484486
{
485487
check(LODSettings.Num() > 0 && LODSettings.Num() <= RUNTIMEMESH_MAXLODS);
@@ -634,6 +636,30 @@ void URuntimeMeshProviderStatic::Serialize(FArchive& Ar)
634636
LoadedMaterialSlots = MaterialSlots;
635637
}
636638
}
639+
640+
if (Ar.CustomVer(FRuntimeMeshVersion::GUID) >= FRuntimeMeshVersion::AddedDistanceField)
641+
{
642+
if (Ar.IsSaving())
643+
{
644+
bool bHasDistanceField = false;
645+
Ar << bHasDistanceField;
646+
if (bHasDistanceField)
647+
{
648+
FRuntimeMeshDistanceFieldData NullDistanceField;
649+
Ar << NullDistanceField;
650+
}
651+
}
652+
else if (Ar.IsLoading())
653+
{
654+
bool bHasDistanceField;
655+
Ar << bHasDistanceField;
656+
if (bHasDistanceField)
657+
{
658+
FRuntimeMeshDistanceFieldData NullDistanceField;
659+
Ar << NullDistanceField;
660+
}
661+
}
662+
}
637663
}
638664
}
639665
}

Source/RuntimeMeshComponent/Private/RuntimeMesh.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class FRuntimeMeshUpdateTask : public FNonAbandonableTask
5353
PinnedRef->HandleUpdate();
5454
//}
5555
}
56+
5657
}
5758
}
5859

@@ -602,6 +603,8 @@ void URuntimeMesh::QueueForDelayedInitialize()
602603
}
603604

604605

606+
607+
605608
void URuntimeMesh::QueueForUpdate()
606609
{
607610
FRuntimeMeshMisc::DoOnGameThread([MeshPtr = GetMeshReference()]()
@@ -899,6 +902,7 @@ void URuntimeMesh::HandleSingleSectionUpdate(const FRuntimeMeshProxyPtr& RenderP
899902
}
900903

901904

905+
902906
URuntimeMeshComponentEngineSubsystem* URuntimeMesh::GetEngineSubsystem()
903907
{
904908
URuntimeMeshComponentEngineSubsystem* RMCSubsystem = GEngine->GetEngineSubsystem<URuntimeMeshComponentEngineSubsystem>();
@@ -1163,6 +1167,7 @@ FRuntimeMeshProxyPtr URuntimeMesh::GetRenderProxy(ERHIFeatureLevel::Type InFeatu
11631167
}
11641168
}
11651169

1170+
11661171
return RenderProxy;
11671172
}
11681173

Source/RuntimeMeshComponent/Private/RuntimeMeshBlueprintFunctions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,10 @@ void URuntimeMeshBlueprintFunctions::AppendTexCoords(FRuntimeMeshVertexTexCoordS
210210
Stream.Append(InOther);
211211
}
212212

213-
void URuntimeMeshBlueprintFunctions::GetTexCoord(FRuntimeMeshVertexTexCoordStream& Stream, FRuntimeMeshVertexTexCoordStream& OutStream, int32 Index, FVector2D& OutTexCoord)
213+
void URuntimeMeshBlueprintFunctions::GetTexCoord(FRuntimeMeshVertexTexCoordStream& Stream, FRuntimeMeshVertexTexCoordStream& OutStream, int32 Index, int32 ChannelId, FVector2D& OutTexCoord)
214214
{
215215
OutStream = Stream;
216-
OutTexCoord = Stream.GetTexCoord(Index);
216+
OutTexCoord = Stream.GetTexCoord(Index, ChannelId);
217217
}
218218

219219
void URuntimeMeshBlueprintFunctions::SetTexCoord(FRuntimeMeshVertexTexCoordStream& Stream, FRuntimeMeshVertexTexCoordStream& OutStream, int32 Index, FVector2D NewTexCoord, int32 ChannelId /*= 0*/)

Source/RuntimeMeshComponent/Private/RuntimeMeshComponent.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ void URuntimeMeshComponent::ForceProxyRecreate()
9898
}
9999

100100

101-
102-
103101
FBoxSphereBounds URuntimeMeshComponent::CalcBounds(const FTransform& LocalToWorld) const
104102
{
105103
if (GetRuntimeMesh())

Source/RuntimeMeshComponent/Private/RuntimeMeshComponentEngineSubsystem.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ void URuntimeMeshComponentEngineSubsystem::Tick(float DeltaTime)
143143
{
144144
MeshRef->HandleUpdate();
145145
}
146+
146147
}
147148
}
148149
}

Source/RuntimeMeshComponent/Private/RuntimeMeshComponentPlugin.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "Serialization/CustomVersion.h"
55
#include "RuntimeMeshCore.h"
66

7+
78
// Register the custom version with core
89
FCustomVersionRegistration GRegisterRuntimeMeshCustomVersion(FRuntimeMeshVersion::GUID, FRuntimeMeshVersion::LatestVersion, TEXT("RuntimeMesh"));
910

@@ -20,12 +21,10 @@ IMPLEMENT_MODULE(FRuntimeMeshComponentPlugin, RuntimeMeshComponent)
2021

2122
void FRuntimeMeshComponentPlugin::StartupModule()
2223
{
23-
2424
}
2525

2626
void FRuntimeMeshComponentPlugin::ShutdownModule()
2727
{
28-
2928
}
3029

3130
DEFINE_LOG_CATEGORY(RuntimeMeshLog2);

Source/RuntimeMeshComponent/Private/RuntimeMeshComponentProxy.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "RayTracingDefinitions.h"
1414
#include "RayTracingInstance.h"
1515

16+
1617
DECLARE_CYCLE_STAT(TEXT("RuntimeMeshComponentSceneProxy - Create Mesh Batch"), STAT_RuntimeMeshComponentSceneProxy_CreateMeshBatch, STATGROUP_RuntimeMesh);
1718
DECLARE_CYCLE_STAT(TEXT("RuntimeMeshComponentSceneProxy - Get Dynamic Mesh Elements"), STAT_RuntimeMeshComponentSceneProxy_GetDynamicMeshElements, STATGROUP_RuntimeMesh);
1819
DECLARE_CYCLE_STAT(TEXT("RuntimeMeshComponentSceneProxy - Draw Static Mesh Elements"), STAT_RuntimeMeshComponentSceneProxy_DrawStaticMeshElements, STATGROUP_RuntimeMesh);
@@ -67,6 +68,8 @@ FRuntimeMeshComponentSceneProxy::FRuntimeMeshComponentSceneProxy(URuntimeMeshCom
6768
// We always use local vertex factory, which gets its primitive data from GPUScene, so we can skip expensive primitive uniform buffer updates
6869
bVFRequiresPrimitiveUniformBuffer = !UseGPUScene(GMaxRHIShaderPlatform, FeatureLevel);
6970
bStaticElementsAlwaysUseProxyPrimitiveUniformBuffer = true;
71+
bVerifyUsedMaterials = false;
72+
7073
}
7174

7275
FRuntimeMeshComponentSceneProxy::~FRuntimeMeshComponentSceneProxy()
@@ -119,14 +122,15 @@ void FRuntimeMeshComponentSceneProxy::CreateMeshBatch(FMeshBatch& MeshBatch, con
119122
const bool bWantsAdjacencyInfo = !bForRayTracing && !bRenderWireframe && RequiresAdjacencyInformation(Material, Section.Buffers->VertexFactory.GetType(), GetScene().GetFeatureLevel());
120123
check(!bWantsAdjacencyInfo || Section.bHasAdjacencyInfo);
121124

125+
122126
// No support for stateless dithered LOD transitions for movable meshes
123127
const bool bDitheredLODTransition = !IsMovable() && Material->IsDitheredLODTransition();
124128

125129

126130
const FRuntimeMeshIndexBuffer* CurrentIndexBuffer =
127131
(bWantsAdjacencyInfo ?
128132
&Section.Buffers->AdjacencyIndexBuffer :
129-
&Section.Buffers->IndexBuffer);
133+
&Section.Buffers->IndexBuffer);
130134

131135
int32 NumIndicesPerTriangle = bWantsAdjacencyInfo ? 12 : 3;
132136
int32 NumPrimitives = CurrentIndexBuffer->Num() / NumIndicesPerTriangle;
@@ -286,7 +290,6 @@ void FRuntimeMeshComponentSceneProxy::GetDynamicMeshElements(const TArray<const
286290
}
287291

288292

289-
290293
// This function was exposed on 4.24, previously it existed but wasn't public
291294
#if ENGINE_MAJOR_VERSION <= 4 && ENGINE_MINOR_VERSION < 24
292295
static float ComputeBoundsScreenRadiusSquared(const FVector4& BoundsOrigin, const float SphereRadius, const FVector4& ViewOrigin, const FMatrix& ProjMatrix)

0 commit comments

Comments
 (0)