You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
A new lit vertex color material is added and used if the ModelingComponents module is loaded (to avoid adding a new engine material, if only GeometryFramework is loaded, then the engine-default vertex color material is used). This class-wide vertex color material can be overridden via UBaseDynamicMeshComponent::SetDefaultVertexColorMaterial() Facet Normals / Flat Shading is now separately configurable, this overrides the normals at the vertexbuffer setup level, so it works independently of material. Support also added for configuring the wireframe material used for BaseDynamicMeshComponent, and also for setting the wireframe color. #preflight 62aa2330a40a4dc3a04052c6 #rb tyson.brochu [CL 20676782 by Ryan Schmidt in ue5-main branch]
36 lines
1.3 KiB
C++
36 lines
1.3 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "ModelingComponentsModule.h"
|
|
#include "Components/BaseDynamicMeshComponent.h"
|
|
|
|
|
|
#define LOCTEXT_NAMESPACE "FModelingComponentsModule"
|
|
|
|
void FModelingComponentsModule::StartupModule()
|
|
{
|
|
FCoreDelegates::OnPostEngineInit.AddRaw(this, &FModelingComponentsModule::OnPostEngineInit);
|
|
|
|
// Ensure that the GeometryFramework module is loaded so that UBaseDynamicMeshComponent materials are configured
|
|
FModuleManager::Get().LoadModule(TEXT("GeometryFramework"));
|
|
}
|
|
|
|
void FModelingComponentsModule::OnPostEngineInit()
|
|
{
|
|
// Replace the standard UBaseDynamicMeshComponent vertex color material with something higher quality.
|
|
// This is done in ModelingComponents module (ie part of MeshModelingToolset plugin) to avoid having to
|
|
// make this Material a special "engine material", which has various undesirable implication
|
|
UMaterial* VertexColorMaterial = LoadObject<UMaterial>(nullptr, TEXT("/MeshModelingToolset/Materials/M_DynamicMeshComponentVtxColor"));
|
|
if (ensure(VertexColorMaterial))
|
|
{
|
|
UBaseDynamicMeshComponent::SetDefaultVertexColorMaterial(VertexColorMaterial);
|
|
}
|
|
}
|
|
|
|
void FModelingComponentsModule::ShutdownModule()
|
|
{
|
|
FCoreDelegates::OnPostEngineInit.RemoveAll(this);
|
|
}
|
|
|
|
#undef LOCTEXT_NAMESPACE
|
|
|
|
IMPLEMENT_MODULE(FModelingComponentsModule, ModelingComponents) |