Skip to content

Commit 426f25b

Browse files
committed
Revert "Replace Enigne version to 4.22.3, change configuration to VS2019"
This reverts commit 9b8dbaf.
1 parent aef97d6 commit 426f25b

27 files changed

+205
-190
lines changed

Config/DefaultEditor.ini

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
[/Script/SourceCodeAccess.SourceCodeAccessSettings]
2-
PreferredAccessor=VisualStudio2019
1+
32

GenerateVisualStudioProject.bat

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@ SET LOCAL
33

44
:FindUE4InstallationDirectory
55
rem Find UE4 installation directory
6-
set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\EpicGames\Unreal Engine\4.22"
6+
set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\EpicGames\Unreal Engine\4.20"
77
set VALUE_NAME=InstalledDirectory
88

99
echo Search in Windows Register for : %KEY_NAME%
1010

1111
set UE4Path=""
1212

1313
FOR /F "usebackq skip=2 tokens=1,2*" %%A IN (`reg query %KEY_NAME% /v %VALUE_NAME%`) DO (
14-
14+
1515
echo %%C
1616
echo Installation found at : %%C
1717
call :GenerateVisualStudioProject "%%C"
1818
)
1919
goto :LabelExit
2020

2121
:GenerateVisualStudioProject
22-
call %1\Engine\Binaries\DotNET\UnrealBuildTool.exe -2019 -projectfiles -project="%CD%\RPR.uproject" -game
22+
call %1\Engine\Binaries\DotNET\UnrealBuildTool.exe -projectfiles -project="%CD%\RPR.uproject" -game
2323

2424
:LabelExit
2525
ENDLOCAL

Plugins/RPRPlugin/RPRPlugin.uplugin

+6
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@
8585
"LoadingPhase": "Default",
8686
"WhitelistPlatforms": [ "Win64" ]
8787
},
88+
{
89+
"Name": "RPR_GLTF",
90+
"Type": "Runtime",
91+
"LoadingPhase": "Default",
92+
"WhitelistPlatforms": [ "Win64" ]
93+
},
8894
{
8995
"Name": "RPRMaterialImporter",
9096
"Type": "Editor",

Plugins/RPRPlugin/Source/GLTF/Private/RPR_GLTFModule.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,4 @@ void FRPR_GLTFModule::ShutdownModule()
4646
dllHandles.Empty();
4747
}
4848

49-
IMPLEMENT_MODULE(FRPR_GLTFModule, RPR_GLTF);
50-
// IMPLEMENT_MODULE(FRPR_GLTFModule, RPR_GLTFModule);
49+
IMPLEMENT_MODULE(FRPR_GLTFModule, RPR_GLTFModule);

Plugins/RPRPlugin/Source/Outliners/Private/OutlinersModule.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,14 @@
2222

2323
void FOutlinersModule::StartupModule()
2424
{
25-
25+
2626
}
2727

2828
void FOutlinersModule::ShutdownModule()
2929
{
30-
30+
3131
}
3232

3333
#undef LOCTEXT_NAMESPACE
3434

35-
//IMPLEMENT_MODULE(FOutlinersModule, OutlinersModule);
36-
IMPLEMENT_MODULE(FOutlinersModule, Outliners);
35+
IMPLEMENT_MODULE(FOutlinersModule, OutlinersModule);

Plugins/RPRPlugin/Source/RPRCore/Private/Material/RPRUberMaterialParameters.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ FRPRUberMaterialParameters::FRPRUberMaterialParameters()
4747

4848
, Reflection_Metalness( TEXT("reflection.metalness"), RPRX_UBER_MATERIAL_REFLECTION_METALNESS, ESupportMode::FullySupported, 1.0f, ERPRMCoMapC1InterpretationMode::AsFloat4, FCanUseParameter::CreateStatic(CanUseOnlyIfValidModeSet, &Reflection_Mode, (uint8) ERPRReflectionMode::Metalness))
4949
, Reflection_Ior( TEXT("reflection.ior"), RPRX_UBER_MATERIAL_REFLECTION_IOR, ESupportMode::PreviewNotSupported, 1.5f, ERPRMCoMapC1InterpretationMode::AsFloat4, FCanUseParameter::CreateStatic(CanUseOnlyIfValidModeSet, &Reflection_Mode, (uint8) ERPRReflectionMode::PBR))
50-
50+
5151
, Reflection_Mode(FRPRMaterialEnum::Create<ERPRReflectionMode>(TEXT("reflection.mode"), RPRX_UBER_MATERIAL_REFLECTION_MODE, ESupportMode::PreviewNotSupported, ERPRReflectionMode::PBR))
5252

5353
// Refraction
54-
, Refraction_Weight( TEXT("refraction.weight"), RPRX_UBER_MATERIAL_REFRACTION_WEIGHT, ESupportMode::PreviewNotSupported, 0.0f, ERPRMCoMapC1InterpretationMode::AsFloat4)
5554
, Refraction_Color( TEXT("refraction.color"), RPRX_UBER_MATERIAL_REFRACTION_COLOR, ESupportMode::PreviewNotSupported, 1.0f)
55+
, Refraction_Weight( TEXT("refraction.weight"), RPRX_UBER_MATERIAL_REFRACTION_WEIGHT, ESupportMode::PreviewNotSupported, 0.0f, ERPRMCoMapC1InterpretationMode::AsFloat4)
5656
, Refraction_Roughness( TEXT("refraction.roughness"), RPRX_UBER_MATERIAL_REFRACTION_ROUGHNESS, ESupportMode::PreviewNotSupported, 0.5f, ERPRMCoMapC1InterpretationMode::AsFloat4)
5757
, Refraction_Absorption_Color( TEXT("refraction.absorptionColor"), RPRX_UBER_MATERIAL_REFRACTION_ABSORPTION_COLOR, ESupportMode::PreviewNotSupported, 0.0f)
5858
, Refraction_Absorption_Distance( TEXT("refraction.absorptionDistance"), RPRX_UBER_MATERIAL_REFRACTION_ABSORPTION_DISTANCE, ESupportMode::PreviewNotSupported, 0.0f, ERPRMCoMapC1InterpretationMode::AsFloat4)
@@ -61,18 +61,20 @@ FRPRUberMaterialParameters::FRPRUberMaterialParameters()
6161
, Refraction_IsThinSurface( TEXT("refraction.thinSurface"), RPRX_UBER_MATERIAL_REFRACTION_THIN_SURFACE, ESupportMode::PreviewNotSupported, false)
6262

6363
// Coating
64-
, Coating_Weight( TEXT("coating.weight"), RPRX_UBER_MATERIAL_COATING_WEIGHT, ESupportMode::PreviewNotSupported, 0.0f, ERPRMCoMapC1InterpretationMode::AsFloat4)
6564
, Coating_Color( TEXT("coating.color"), RPRX_UBER_MATERIAL_COATING_COLOR, ESupportMode::PreviewNotSupported, 1.0f)
6665
, Coating_Transmission_Color( TEXT("coating.transmissioncolor"), RPRX_UBER_MATERIAL_COATING_TRANSMISSION_COLOR, ESupportMode::PreviewNotSupported, 1.0f)
6766
, Coating_Normal( TEXT("coating.normal"), RPRX_UBER_MATERIAL_COATING_NORMAL, ESupportMode::PreviewNotSupported, FCanUseParameter())
6867
, Coating_Thickness( TEXT("coating.thickness"), RPRX_UBER_MATERIAL_COATING_THICKNESS, ESupportMode::PreviewNotSupported, 1.0f)
68+
, Coating_Weight( TEXT("coating.weight"), RPRX_UBER_MATERIAL_COATING_WEIGHT, ESupportMode::PreviewNotSupported, 0.0f, ERPRMCoMapC1InterpretationMode::AsFloat4)
6969
, Coating_Roughness( TEXT("coating.roughness"), RPRX_UBER_MATERIAL_COATING_ROUGHNESS, ESupportMode::PreviewNotSupported, 0.5f, ERPRMCoMapC1InterpretationMode::AsFloat4)
7070
, Coating_Ior( TEXT("coating.ior"), RPRX_UBER_MATERIAL_COATING_IOR, ESupportMode::PreviewNotSupported, 1.5f, ERPRMCoMapC1InterpretationMode::AsFloat4)
71+
7172
, Coating_Mode(FRPRMaterialEnum::Create<ERPRCoatingMode>(TEXT("coating.mode"), RPRX_UBER_MATERIAL_COATING_MODE, ESupportMode::PreviewNotSupported, ERPRCoatingMode::PBR))
7273

7374
// Emission
74-
, Emission_Weight( TEXT("emission.weight"), RPRX_UBER_MATERIAL_EMISSION_WEIGHT, ESupportMode::FullySupported, 0.0f, ERPRMCoMapC1InterpretationMode::AsFloat4)
7575
, Emission_Color( TEXT("emission.color"), RPRX_UBER_MATERIAL_EMISSION_COLOR, ESupportMode::FullySupported, 1.0f)
76+
, Emission_Weight( TEXT("emission.weight"), RPRX_UBER_MATERIAL_EMISSION_WEIGHT, ESupportMode::FullySupported, 0.0f, ERPRMCoMapC1InterpretationMode::AsFloat4)
77+
7678
, Emission_Mode(FRPRMaterialEnum::Create<ERPREmissionMode>(TEXT("emission.mode"), RPRX_UBER_MATERIAL_EMISSION_MODE, ESupportMode::FullySupported, ERPREmissionMode::SingleSided))
7779

7880
// Miscs

Plugins/RPRPlugin/Source/RPRCore/Private/Material/RPRXMaterial.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@
1818
DECLARE_LOG_CATEGORY_CLASS(LogRPRXMaterial, Log, Verbose)
1919

2020
RPR::FRPRXMaterial::FRPRXMaterial(const URPRMaterial* InUE4MaterialLink)
21-
: UE4MaterialLink(InUE4MaterialLink)
22-
, Material(nullptr)
21+
: Material(nullptr)
22+
, UE4MaterialLink(InUE4MaterialLink)
2323
{
2424
check(InUE4MaterialLink);
2525

2626
auto rprxContext = IRPRCore::GetResources()->GetRPRXSupportContext();
2727
RPR::FResult status = RPRX::FMaterialHelpers::CreateMaterial(rprxContext, RPRX::EMaterialType::Uber, Material);
2828
if (RPR::IsResultFailed(status))
2929
{
30-
UE_LOG(LogRPRXMaterial, Warning,
31-
TEXT("Native RPRX Material could not be created for material '%s'"),
30+
UE_LOG(LogRPRXMaterial, Warning,
31+
TEXT("Native RPRX Material could not be created for material '%s'"),
3232
*UE4MaterialLink->GetName());
3333
}
3434
}

Plugins/RPRPlugin/Source/RPRCore/Private/Material/UberMaterialParameters/RPRUberMaterialParameterBase.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ FRPRUberMaterialParameterBase::FRPRUberMaterialParameterBase()
2323
{}
2424

2525
FRPRUberMaterialParameterBase::FRPRUberMaterialParameterBase(
26-
const FString& InParamName,
27-
RPRX::FParameterType InRprxParamType,
28-
ESupportMode InPreviewSupportMode,
26+
const FString& InParamName,
27+
RPRX::FParameterType InRprxParamType,
28+
ESupportMode InPreviewSupportMode,
2929
FCanUseParameter InCanUseParameter,
3030
FApplyParameter InApplyParameterDelegate)
31-
: SupportMode(InPreviewSupportMode)
32-
, ParamName(InParamName)
31+
: ParamName(InParamName)
3332
, RprxParamType(InRprxParamType)
33+
, SupportMode(InPreviewSupportMode)
3434
, CanUseParameterDelegate(InCanUseParameter)
3535
, ApplyParameterDelegate(InApplyParameterDelegate)
3636
{}

Plugins/RPRPlugin/Source/RPRCore/Private/RPRCoreSystemResources.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ FRPRCoreSystemResources::FRPRCoreSystemResources()
3232
, RPRContext(nullptr)
3333
, RPRMaterialSystem(nullptr)
3434
, RPRXSupportCtx(nullptr)
35-
, RPRIContext(nullptr)
3635
, RPRImageManager(nullptr)
36+
, RPRIContext(nullptr)
3737
{}
3838

3939
bool FRPRCoreSystemResources::Initialize()
@@ -315,7 +315,7 @@ bool FRPRCoreSystemResources::InitializeRPRXContext()
315315
void FRPRCoreSystemResources::Shutdown()
316316
{
317317
NumDevicesCompatible = 0;
318-
318+
319319
DestroyRPRXMaterialLibrary();
320320
DestroyRPRImageManager();
321321
DestroyMaterialSystem();
@@ -333,8 +333,8 @@ bool FRPRCoreSystemResources::IsInitialized() const
333333
}
334334

335335
void FRPRCoreSystemResources::SetRPRILoggers(
336-
RPRI::FRPRILogCallback InfoCallback,
337-
RPRI::FRPRILogCallback WarningCallback,
336+
RPRI::FRPRILogCallback InfoCallback,
337+
RPRI::FRPRILogCallback WarningCallback,
338338
RPRI::FRPRILogCallback ErrorCallback)
339339
{
340340
if (!RPRI::SetLoggers(RPRIContext, InfoCallback, WarningCallback, ErrorCallback))

Plugins/RPRPlugin/Source/RPRCore/Public/Material/RPRUberMaterialParameters.h

+13-13
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ struct RPRCORE_API FRPRUberMaterialParameters
4545

4646
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Material|Diffuse")
4747
FRPRMaterialNormalMap Diffuse_Normal;
48-
48+
4949
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Material|Diffuse")
5050
FRPRMaterialCoMChannel1 Diffuse_Roughness;
51-
51+
5252

5353
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Material|Reflection")
5454
FRPRMaterialCoMChannel1 Reflection_Weight;
@@ -69,23 +69,20 @@ struct RPRCORE_API FRPRUberMaterialParameters
6969
FRPRMaterialCoMChannel1 Reflection_AnisotropyRotation;
7070

7171
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Material|Reflection")
72-
FRPRMaterialCoMChannel1 Reflection_Metalness;
73-
74-
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Material|Reflection")
75-
FRPRMaterialCoMChannel1 Reflection_Ior;
72+
FRPRMaterialEnum Reflection_Mode;
7673

7774
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Material|Reflection")
78-
FRPRMaterialEnum Reflection_Mode;
75+
FRPRMaterialCoMChannel1 Reflection_Metalness;
7976

8077

8178
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Material|Refraction")
8279
FRPRMaterialCoMChannel1 Refraction_Weight;
8380

84-
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Material|Refraction")
85-
FRPRMaterialCoM Refraction_Color;
81+
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Material|Reflection")
82+
FRPRMaterialCoMChannel1 Reflection_Ior;
8683

8784
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Material|Refraction")
88-
FRPRMaterialCoMChannel1 Refraction_Roughness;
85+
FRPRMaterialCoM Refraction_Color;
8986

9087
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Material|Refraction")
9188
FRPRMaterialCoM Refraction_Absorption_Color;
@@ -94,15 +91,18 @@ struct RPRCORE_API FRPRUberMaterialParameters
9491
FRPRMaterialCoMChannel1 Refraction_Absorption_Distance;
9592

9693
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Material|Refraction")
97-
FRPRMaterialBool Refraction_Caustics;
94+
FRPRMaterialCoMChannel1 Refraction_Roughness;
9895

9996
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Material|Refraction")
10097
FRPRMaterialCoMChannel1 Refraction_Ior;
10198

99+
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Material|Refraction")
100+
FRPRMaterialBool Refraction_Caustics;
101+
102102
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Material|Refraction")
103103
FRPRMaterialBool Refraction_IsThinSurface;
104104

105-
105+
106106
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Material|Coating")
107107
FRPRMaterialCoMChannel1 Coating_Weight;
108108

@@ -141,7 +141,7 @@ struct RPRCORE_API FRPRUberMaterialParameters
141141

142142
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Material|Miscs")
143143
FRPRMaterialCoMChannel1 Transparency;
144-
144+
145145
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Material|Miscs")
146146
FRPRMaterialMap Displacement;
147147

Plugins/RPRPlugin/Source/RPRCore/Public/Material/UberMaterialParameters/RPRUberMaterialParameterBase.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ enum class ESupportMode : uint8
3838
* Base for all parameters used in the Uber material.
3939
* It contains extra datas to import datas from the .rprmat
4040
* and make links with the UE4 materials.
41-
* If you want to add a new type for the Uber material,
41+
* If you want to add a new type for the Uber material,
4242
* you should start from here.
4343
*/
4444
USTRUCT(BlueprintType)
@@ -50,9 +50,9 @@ struct RPRCORE_API FRPRUberMaterialParameterBase
5050

5151
FRPRUberMaterialParameterBase();
5252
FRPRUberMaterialParameterBase(
53-
const FString& InParamName,
53+
const FString& InParamName,
5454
RPRX::FParameterType InRprxParamType,
55-
ESupportMode InPreviewSupportMode,
55+
ESupportMode InPreviewSupportMode,
5656
FCanUseParameter InCanUseParameter = FCanUseParameter(),
5757
FApplyParameter InApplyParameterDelegate = FApplyParameter());
5858

@@ -81,10 +81,10 @@ struct RPRCORE_API FRPRUberMaterialParameterBase
8181
private:
8282

8383
UPROPERTY()
84-
FString ParamName;
84+
uint32 RprxParamType;
8585

8686
UPROPERTY()
87-
uint32 RprxParamType;
87+
FString ParamName;
8888

8989
FCanUseParameter CanUseParameterDelegate;
9090
FApplyParameter ApplyParameterDelegate;

Plugins/RPRPlugin/Source/RPREditorTools/Private/DynamicSelectionMeshVisualizer.cpp

+16-13
Original file line numberDiff line numberDiff line change
@@ -118,19 +118,19 @@ class FDSMVisualizerProxy : public FPrimitiveSceneProxy
118118

119119
FDSMVisualizerProxy(UDynamicSelectionMeshVisualizerComponent* InComponent)
120120
: FPrimitiveSceneProxy(InComponent)
121-
, VertexFactory(GetScene().GetFeatureLevel())
122121
, MaterialRenderProxy(nullptr)
123122
, MaterialRelevance(InComponent->GetMaterialRelevance(GetScene().GetFeatureLevel()))
123+
, VertexFactory(GetScene().GetFeatureLevel())
124124
{
125125
UMaterialInterface* material = InComponent->GetMaterial(0);
126126
if (material)
127127
{
128-
MaterialRenderProxy = material->GetRenderProxy();
128+
MaterialRenderProxy = material->GetRenderProxy(IsSelected(), IsHovered());
129129
}
130130

131131
if (MaterialRenderProxy == nullptr)
132132
{
133-
MaterialRenderProxy = UMaterial::GetDefaultMaterial(MD_Surface)->GetRenderProxy();
133+
MaterialRenderProxy = UMaterial::GetDefaultMaterial(MD_Surface)->GetRenderProxy(IsSelected(), IsHovered());
134134
}
135135

136136
InitializeMesh(InComponent);
@@ -154,7 +154,7 @@ class FDSMVisualizerProxy : public FPrimitiveSceneProxy
154154
void AddTriangles(const TArray<uint32>& Triangles, const TArray<uint32>& NewTriangles)
155155
{
156156
check(NewTriangles.Num() % 3 == 0);
157-
157+
158158
IndexBuffer.ReleaseResource();
159159
IndexBuffer.Indices.Append(NewTriangles);
160160
IndexBuffer.InitResource();
@@ -224,7 +224,7 @@ class FDSMVisualizerProxy : public FPrimitiveSceneProxy
224224
}
225225
}
226226
}
227-
227+
228228
virtual FPrimitiveViewRelevance GetViewRelevance(const FSceneView* View) const override
229229
{
230230
FPrimitiveViewRelevance Result;
@@ -263,7 +263,7 @@ class FDSMVisualizerProxy : public FPrimitiveSceneProxy
263263
FDSMVertexBuffer VertexBuffer;
264264
FDSMIndexBuffer IndexBuffer;
265265
FDSMVertexFactory VertexFactory;
266-
266+
267267
FStaticMeshVertexBuffers VertexBuffers;
268268

269269
FMaterialRenderProxy* MaterialRenderProxy;
@@ -453,9 +453,11 @@ void UDynamicSelectionMeshVisualizerComponent::AddTriangle_RenderThread(const TA
453453
{
454454
if (SceneProxy && NewTriangles.Num() > 0)
455455
{
456-
ENQUEUE_RENDER_COMMAND(FUDynamicSelectionMeshVisualizer_AddTriangle_RenderThread)
457-
(
458-
[this, InitialTriangles, NewTriangles](FRHICommandListImmediate& RHICmdList)
456+
ENQUEUE_UNIQUE_RENDER_COMMAND_THREEPARAMETER(
457+
FUDynamicSelectionMeshVisualizer_AddTriangle_RenderThread,
458+
FDSMVisualizerProxy*, SceneProxy, SceneProxy,
459+
TArray<uint32>, InitialTriangles, InitialTriangles,
460+
TArray<uint32>, NewTriangles, NewTriangles,
459461
{
460462
SceneProxy->AddTriangles(InitialTriangles, NewTriangles);
461463
}
@@ -467,11 +469,12 @@ void UDynamicSelectionMeshVisualizerComponent::UpdateIndices_RenderThread()
467469
{
468470
if (SceneProxy)
469471
{
470-
ENQUEUE_RENDER_COMMAND(FUDynamicSelectionMeshVisualizer_AddTriangle_RenderThread)
471-
(
472-
[this](FRHICommandListImmediate& RHICmdList)
472+
ENQUEUE_UNIQUE_RENDER_COMMAND_TWOPARAMETER(
473+
FUDynamicSelectionMeshVisualizer_AddTriangle_RenderThread,
474+
FDSMVisualizerProxy*, SceneProxy, SceneProxy,
475+
UDynamicSelectionMeshVisualizerComponent*, Component, this,
473476
{
474-
SceneProxy->UpdateIndices(this);
477+
SceneProxy->UpdateIndices(Component);
475478
}
476479
);
477480
}

0 commit comments

Comments
 (0)