VJ Master 1.3
Real-time audio analysis and visualisation.
 
Loading...
Searching...
No Matches
ST_VisComputeBase.h
1// Copyright (c) 2025 Aaron Trotter (ShaderTech). All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "ST_VisBase.h"
7#if WITH_EDITOR
8#include "DrawDebugHelpers.h"
9#include "Components/BillboardComponent.h"
10#endif
11#include "Compute/Utils/ST_VJ_RPCSManager.h"
12#include "Compute/Utils/ST_VJ_ManagedRPCSInterface.h"
13#include "RHICommandList.h"
14#include "Data/ST_AudioReactiveBoidsLib.h"
15#include "ST_VisComputeBase.generated.h"
16
21UCLASS(Abstract)
22class ST_AUDIOVISUALISATION_API AST_VisComputeBase : public AST_VisBase, public IST_VJ_ManagedRPCSInterface
23{
24 GENERATED_BODY()
25
26public:
29
30protected:
32 virtual void BeginPlay() override;
33
35 virtual void BeginDestroy() override;
36
38 virtual void InitComputeShader_GameThread() override;
39
41 virtual void InitComputeShader_RenderThread(FRHICommandListImmediate& RHICmdList) override;
42
44 virtual void ExecuteComputeShader_GameThread(float DeltaTime) override;
45
47 virtual void ExecuteComputeShader_RenderThread(FRHICommandListImmediate& RHICmdList) override;
48
50 virtual void DisposeComputeShader_GameThread() override;
51
53 virtual void DisposeComputeShader_RenderThread(FRHICommandListImmediate& RHICmdList) override;
54
55public:
57 virtual void Tick(float DeltaTime) override;
58
60 UFUNCTION(BlueprintPure, Category = "ShaderTech|AudioVisualisation", meta = (BlueprintThreadSafe, WorldContext = "WorldContextObject"))
61 static bool IsPlaying(const UObject* WorldContextObject);
62
63protected:
65 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ShaderTech|Bounds|Debug")
66 bool bDebugSprite = true;
67
69 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ShaderTech|Bounds|Debug")
70 bool bDebugBounds = true;
71
73 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ShaderTech|Bounds|Debug")
75
77 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ShaderTech|Bounds|Constants")
79
80#if WITH_EDITORONLY_DATA
81public:
83 virtual bool ShouldTickIfViewportsOnly() const override;
84
86 virtual void SelectedTick();
87
89 virtual void OnSelected();
90
92 virtual void OnUnselected();
93
94protected:
96 UPROPERTY(BlueprintReadOnly, Category = "Bounds")
97 UBillboardComponent* Billboard = nullptr;
98
100 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ShaderTech|Bounds|Debug")
101 FColor BoundsColor = FColor::Yellow;
102
104 UPROPERTY(Transient)
105 FColor CurrentBoundsColor = FColor::Black;
106
108 bool bPreviouslySelected = false;
109#endif
110
111protected:
113 float LastDeltaTime = 0.0f;
114
116 UPROPERTY(Transient)
118
120 virtual FString GetOwnerName() const;
121};
122
123inline FString AST_VisComputeBase::GetOwnerName() const
124{
125 return "";
126}
AST_VisBase()
Definition ST_VisBase.cpp:8
static bool IsPlaying(const UObject *WorldContextObject)
Definition ST_VisComputeBase.cpp:41
virtual void InitComputeShader_RenderThread(FRHICommandListImmediate &RHICmdList) override
Definition ST_VisComputeBase.cpp:130
virtual void BeginPlay() override
Definition ST_VisComputeBase.cpp:18
virtual void DisposeComputeShader_GameThread() override
Definition ST_VisComputeBase.cpp:140
bool bDebugDisplayInRuntime
Definition ST_VisComputeBase.h:74
float LastDeltaTime
Definition ST_VisComputeBase.h:113
virtual FString GetOwnerName() const
Definition ST_VisComputeBase.h:123
virtual void ExecuteComputeShader_RenderThread(FRHICommandListImmediate &RHICmdList) override
Definition ST_VisComputeBase.cpp:138
AST_VisComputeBase()
Definition ST_VisComputeBase.cpp:7
virtual void BeginDestroy() override
Definition ST_VisComputeBase.cpp:31
UST_VJ_RPCSManager * cachedRPCSManager
Definition ST_VisComputeBase.h:117
virtual void ExecuteComputeShader_GameThread(float DeltaTime) override
Definition ST_VisComputeBase.cpp:132
virtual void InitComputeShader_GameThread() override
Definition ST_VisComputeBase.cpp:129
bool bDebugSprite
Definition ST_VisComputeBase.h:66
virtual void Tick(float DeltaTime) override
Definition ST_VisComputeBase.cpp:55
FST_VJ_BoundsConstantParameters BoundsConstantParameters
Definition ST_VisComputeBase.h:78
virtual void DisposeComputeShader_RenderThread(FRHICommandListImmediate &RHICmdList) override
Definition ST_VisComputeBase.cpp:141
bool bDebugBounds
Definition ST_VisComputeBase.h:70
Interface class for managed RPCs related to compute shader lifecycle handling.
Definition ST_VJ_ManagedRPCSInterface.h:26
Manages runtime compute shader execution for registered objects.
Definition ST_VJ_RPCSManager.h:21
Struct to hold constant parameters for VJ bounds, such as sphere radius or extent of the bounding box...
Definition ST_AudioReactiveBoidsLib.h:16