You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Sparse Volume Texture asset from imported OpenVDB (only a single float channel for now). Static or animated sequence. It will be possible to generate SVT at runtime from GPU later. Using FEditorBulkData for handling raw source without loading everything when not caching or cooking. BulkData used at runtime for loading. No streaming yet. Importer with dependency on OpenVDB is in a SparseVolumeTexture module only loaded when in editor Sparse volume texture can be sampled from any materials (sample, sample parameter) and overridden on material instance and material instance dynamic. Added support for uint in compiler (fetch from page table, see SparseVolumeTextureGetVoxelCoord) Volume texture with u8 VirtualTextureLayerIndex!=255 (INDEX_NONE) are sparse texture. The layer index then represent what texture/attribute to sample. #preflight https://horde.devtools.epicgames.com/job/6346a466f93be0f6345af86c #rb Patrick.Kelly, Charles.deRousiers [CL 22551963 by sebastien hillaire in ue5-main branch]
100 lines
3.2 KiB
C++
100 lines
3.2 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Components/SceneComponent.h"
|
|
#include "Components/PrimitiveComponent.h"
|
|
#include "EngineDefines.h"
|
|
#include "GameFramework/Info.h"
|
|
|
|
#include "SparseVolumeTexture/SparseVolumeTexture.h"
|
|
|
|
#include "SparseVolumeTextureViewerComponent.generated.h"
|
|
|
|
|
|
class FSparseVolumeTextureViewerSceneProxy;
|
|
|
|
|
|
/**
|
|
* A component used to inspect sparse volume textures.
|
|
*/
|
|
UCLASS(ClassGroup = Rendering, collapsecategories, hidecategories = (Object, Mobility, Activation, "Components|Activation"), editinlinenew, meta = (BlueprintSpawnableComponent), MinimalAPI)
|
|
class USparseVolumeTextureViewerComponent : public UPrimitiveComponent
|
|
{
|
|
GENERATED_UCLASS_BODY()
|
|
|
|
~USparseVolumeTextureViewerComponent();
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category= "Asset Preview")
|
|
TObjectPtr<class USparseVolumeTexture> SparseVolumeTexturePreview;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Asset Preview")
|
|
uint32 bAnimate : 1;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Asset Preview", meta = (UIMin = 0.0, UIMax = 1.0, ClampMin = 0.0, ClampMax = 1.0, EditCondition = "!bAnimate"))
|
|
float AnimationFrame;
|
|
|
|
//~ Begin UPrimitiveComponent Interface.
|
|
virtual bool SupportsStaticLighting() const override { return false; }
|
|
//~ End UPrimitiveComponent Interface.
|
|
|
|
//~ Begin USceneComponent Interface.
|
|
virtual FBoxSphereBounds CalcBounds(const FTransform& LocalToWorld) const override;
|
|
//~ End USceneComponent Interface.
|
|
|
|
|
|
//~ Begin UActorComponent Interface.
|
|
virtual void CreateRenderState_Concurrent(FRegisterComponentContext* Context) override;
|
|
virtual void DestroyRenderState_Concurrent() override;
|
|
virtual void SendRenderTransform_Concurrent() override;
|
|
virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
|
|
//~ End UActorComponent Interface.
|
|
|
|
protected:
|
|
|
|
public:
|
|
|
|
//~ Begin UObject Interface.
|
|
virtual void PostInterpChange(FProperty* PropertyThatChanged) override;
|
|
virtual void Serialize(FArchive& Ar) override;
|
|
#if WITH_EDITOR
|
|
virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
|
|
#endif // WITH_EDITOR
|
|
//~ End UObject Interface
|
|
|
|
//~ Begin UActorComponent Interface.
|
|
#if WITH_EDITOR
|
|
virtual void CheckForErrors() override;
|
|
#endif // WITH_EDITOR
|
|
//~ End UActorComponent Interface.
|
|
|
|
private:
|
|
|
|
int32 FrameIndex = 0;
|
|
|
|
void SendRenderTransformCommand();
|
|
|
|
FSparseVolumeTextureViewerSceneProxy* SparseVolumeTextureViewerSceneProxy;
|
|
};
|
|
|
|
|
|
/**
|
|
* A placeable actor that represents a participating media material around a planet, e.g. clouds.
|
|
*/
|
|
UCLASS(showcategories = (Movement, Rendering, Transformation, DataLayers, "Input|MouseInput", "Input|TouchInput"), ClassGroup = Fog, hidecategories = (Info, Object, Input), MinimalAPI)
|
|
class ASparseVolumeTextureViewer : public AInfo
|
|
{
|
|
GENERATED_UCLASS_BODY()
|
|
|
|
private:
|
|
|
|
UPROPERTY(BlueprintReadOnly, VisibleAnywhere, Category = Atmosphere, meta = (AllowPrivateAccess = "true"))
|
|
TObjectPtr<class USparseVolumeTextureViewerComponent> SparseVolumeTextureViewerComponent;
|
|
|
|
#if WITH_EDITOR
|
|
virtual bool ActorTypeSupportsDataLayer() const override { return true; }
|
|
#endif
|
|
|
|
};
|