Files
UnrealEngineUWP/Engine/Plugins/Runtime/GeometryProcessing/Source/DynamicMesh/Public/Sampling/MeshResampleImageBaker.h

65 lines
1.2 KiB
C
Raw Normal View History

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Sampling/MeshImageBaker.h"
#include "Sampling/MeshImageBakingCache.h"
#include "Image/ImageBuilder.h"
namespace UE
{
namespace Geometry
{
class DYNAMICMESH_API FMeshResampleImageBaker : public FMeshImageBaker
{
public:
virtual ~FMeshResampleImageBaker() {}
//
// Required input data
//
TFunction<FVector4f(FVector2d)> SampleFunction = [](FVector2d Position) { return FVector4f::Zero(); };
const FDynamicMeshUVOverlay* DetailUVOverlay = nullptr;
GeometryProcessing improvements/additions - new correspondence-finding strategy in FMeshImageBakingCache. Added a global Thickness parameter, and now preferentially uses the ray-hit found by casting inwards from Point+Thickness*Normal. This handles the cases where a greeble/etc is just layered on top of base mesh. These kind of mesh elements are only intended to show up in the normal map, so they aren't stitched in. - expose Thickness and World-Space options in BakeMeshAttributeMapsTool - initialize image in Normal and ResampleImage Bakers, otherwise initial value is garbage - add TSampledScalarField2::BilinearSampleGradientClamped and fix typo in BilinearSampleClamped() that resulted in incorrect interpolation - add Texture2DUtil, contains functions for reading a TImageBuilder from a UTexture2D. Can read from source data if available. - ColorConstants now returns white for group 0 - add double version of FMeshDescriptionToDynamicMesh::CopyTangents() - add support for computing on subset of vertiecs in FMeshConvexHull - fix up template export in TMeshTangents - make mesh const in TImplicitMorphology, TImplicitSolidify - accessor/etc additions in TDenseGrid2, TImageBuilder, TSampledScalarField2, TIndexedWeightMap - add source UStaticMesh reference in FPhysicsDataCollection, function to initialize from a UStaticMesh - update Tools affected by above changes - add TSampleSetStatisticBuilder::ComputeMultiPass() helper function to compute stats for iterable collections in one line - remove dead code in UVLayoutOp.cpp #rb tyson.brochu #rnx #jira none [CL 14769759 by Ryan Schmidt in ue5-main branch]
2020-11-17 22:32:38 -04:00
FVector4f DefaultColor = FVector4f(0, 0, 0, 1);
//
// Compute functions
//
virtual void Bake() override;
//
// Output
//
const TUniquePtr<TImageBuilder<FVector4f>>& GetResult() const { return ResultBuilder; }
TUniquePtr<TImageBuilder<FVector4f>> TakeResult() { return MoveTemp(ResultBuilder); }
protected:
TUniquePtr<TImageBuilder<FVector4f>> ResultBuilder;
};
class DYNAMICMESH_API FMeshMultiResampleImageBaker : public FMeshResampleImageBaker
{
public:
TMap<int32, TSharedPtr<UE::Geometry::TImageBuilder<FVector4f>, ESPMode::ThreadSafe>> MultiTextures;
virtual void Bake() override;
protected:
void InitResult();
void BakeMaterial(int32 MaterialID);
};
} // end namespace UE::Geometry
} // end namespace UE