14. Post-Process Highlight

And alot more...
This commit is contained in:
Edward R. Gonzalez 2024-04-13 02:31:49 -04:00
parent 9d38b5f208
commit dd91451ec5
39 changed files with 473 additions and 78 deletions

2
.gitignore vendored
View File

@ -18,3 +18,5 @@ Project/.idea
Project/Saved/Screenshots Project/Saved/Screenshots
*/Binaries/Win64/*.patch_*.* */Binaries/Win64/*.patch_*.*
Project/Saved/ImGui
Project/Saved/ImGui/imgui.ini

View File

@ -58,6 +58,7 @@ bAuthorizeAutomaticWidgetVariableCreation=False
[/Script/Engine.Engine] [/Script/Engine.Engine]
+ActiveGameNameRedirects=(OldGameName="TP_BlankBP",NewGameName="/Script/Aura") +ActiveGameNameRedirects=(OldGameName="TP_BlankBP",NewGameName="/Script/Aura")
+ActiveGameNameRedirects=(OldGameName="/Script/TP_BlankBP",NewGameName="/Script/Aura") +ActiveGameNameRedirects=(OldGameName="/Script/TP_BlankBP",NewGameName="/Script/Aura")
LevelScriptActorClassName=/Script/Gasa.GasaLevelScriptActor
[/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings] [/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings]
bEnablePlugin=True bEnablePlugin=True
@ -73,3 +74,59 @@ ConnectionType=USBOnly
bUseManualIPAddress=False bUseManualIPAddress=False
ManualIPAddress= ManualIPAddress=
[/Script/Engine.CollisionProfile]
-Profiles=(Name="NoCollision",CollisionEnabled=NoCollision,ObjectTypeName="WorldStatic",CustomResponses=((Channel="Visibility",Response=ECR_Ignore),(Channel="Camera",Response=ECR_Ignore)),HelpMessage="No collision",bCanModify=False)
-Profiles=(Name="BlockAll",CollisionEnabled=QueryAndPhysics,ObjectTypeName="WorldStatic",CustomResponses=,HelpMessage="WorldStatic object that blocks all actors by default. All new custom channels will use its own default response. ",bCanModify=False)
-Profiles=(Name="OverlapAll",CollisionEnabled=QueryOnly,ObjectTypeName="WorldStatic",CustomResponses=((Channel="WorldStatic",Response=ECR_Overlap),(Channel="Pawn",Response=ECR_Overlap),(Channel="Visibility",Response=ECR_Overlap),(Channel="WorldDynamic",Response=ECR_Overlap),(Channel="Camera",Response=ECR_Overlap),(Channel="PhysicsBody",Response=ECR_Overlap),(Channel="Vehicle",Response=ECR_Overlap),(Channel="Destructible",Response=ECR_Overlap)),HelpMessage="WorldStatic object that overlaps all actors by default. All new custom channels will use its own default response. ",bCanModify=False)
-Profiles=(Name="BlockAllDynamic",CollisionEnabled=QueryAndPhysics,ObjectTypeName="WorldDynamic",CustomResponses=,HelpMessage="WorldDynamic object that blocks all actors by default. All new custom channels will use its own default response. ",bCanModify=False)
-Profiles=(Name="OverlapAllDynamic",CollisionEnabled=QueryOnly,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="WorldStatic",Response=ECR_Overlap),(Channel="Pawn",Response=ECR_Overlap),(Channel="Visibility",Response=ECR_Overlap),(Channel="WorldDynamic",Response=ECR_Overlap),(Channel="Camera",Response=ECR_Overlap),(Channel="PhysicsBody",Response=ECR_Overlap),(Channel="Vehicle",Response=ECR_Overlap),(Channel="Destructible",Response=ECR_Overlap)),HelpMessage="WorldDynamic object that overlaps all actors by default. All new custom channels will use its own default response. ",bCanModify=False)
-Profiles=(Name="IgnoreOnlyPawn",CollisionEnabled=QueryOnly,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="Pawn",Response=ECR_Ignore),(Channel="Vehicle",Response=ECR_Ignore)),HelpMessage="WorldDynamic object that ignores Pawn and Vehicle. All other channels will be set to default.",bCanModify=False)
-Profiles=(Name="OverlapOnlyPawn",CollisionEnabled=QueryOnly,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="Pawn",Response=ECR_Overlap),(Channel="Vehicle",Response=ECR_Overlap),(Channel="Camera",Response=ECR_Ignore)),HelpMessage="WorldDynamic object that overlaps Pawn, Camera, and Vehicle. All other channels will be set to default. ",bCanModify=False)
-Profiles=(Name="Pawn",CollisionEnabled=QueryAndPhysics,ObjectTypeName="Pawn",CustomResponses=((Channel="Visibility",Response=ECR_Ignore)),HelpMessage="Pawn object. Can be used for capsule of any playerable character or AI. ",bCanModify=False)
-Profiles=(Name="Spectator",CollisionEnabled=QueryOnly,ObjectTypeName="Pawn",CustomResponses=((Channel="WorldStatic",Response=ECR_Block),(Channel="Pawn",Response=ECR_Ignore),(Channel="Visibility",Response=ECR_Ignore),(Channel="WorldDynamic",Response=ECR_Ignore),(Channel="Camera",Response=ECR_Ignore),(Channel="PhysicsBody",Response=ECR_Ignore),(Channel="Vehicle",Response=ECR_Ignore),(Channel="Destructible",Response=ECR_Ignore)),HelpMessage="Pawn object that ignores all other actors except WorldStatic.",bCanModify=False)
-Profiles=(Name="CharacterMesh",CollisionEnabled=QueryOnly,ObjectTypeName="Pawn",CustomResponses=((Channel="Pawn",Response=ECR_Ignore),(Channel="Vehicle",Response=ECR_Ignore),(Channel="Visibility",Response=ECR_Ignore)),HelpMessage="Pawn object that is used for Character Mesh. All other channels will be set to default.",bCanModify=False)
-Profiles=(Name="PhysicsActor",CollisionEnabled=QueryAndPhysics,ObjectTypeName="PhysicsBody",CustomResponses=,HelpMessage="Simulating actors",bCanModify=False)
-Profiles=(Name="Destructible",CollisionEnabled=QueryAndPhysics,ObjectTypeName="Destructible",CustomResponses=,HelpMessage="Destructible actors",bCanModify=False)
-Profiles=(Name="InvisibleWall",CollisionEnabled=QueryAndPhysics,ObjectTypeName="WorldStatic",CustomResponses=((Channel="Visibility",Response=ECR_Ignore)),HelpMessage="WorldStatic object that is invisible.",bCanModify=False)
-Profiles=(Name="InvisibleWallDynamic",CollisionEnabled=QueryAndPhysics,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="Visibility",Response=ECR_Ignore)),HelpMessage="WorldDynamic object that is invisible.",bCanModify=False)
-Profiles=(Name="Trigger",CollisionEnabled=QueryOnly,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="WorldStatic",Response=ECR_Overlap),(Channel="Pawn",Response=ECR_Overlap),(Channel="Visibility",Response=ECR_Ignore),(Channel="WorldDynamic",Response=ECR_Overlap),(Channel="Camera",Response=ECR_Overlap),(Channel="PhysicsBody",Response=ECR_Overlap),(Channel="Vehicle",Response=ECR_Overlap),(Channel="Destructible",Response=ECR_Overlap)),HelpMessage="WorldDynamic object that is used for trigger. All other channels will be set to default.",bCanModify=False)
-Profiles=(Name="Ragdoll",CollisionEnabled=QueryAndPhysics,ObjectTypeName="PhysicsBody",CustomResponses=((Channel="Pawn",Response=ECR_Ignore),(Channel="Visibility",Response=ECR_Ignore)),HelpMessage="Simulating Skeletal Mesh Component. All other channels will be set to default.",bCanModify=False)
-Profiles=(Name="Vehicle",CollisionEnabled=QueryAndPhysics,ObjectTypeName="Vehicle",CustomResponses=,HelpMessage="Vehicle object that blocks Vehicle, WorldStatic, and WorldDynamic. All other channels will be set to default.",bCanModify=False)
-Profiles=(Name="UI",CollisionEnabled=QueryOnly,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="WorldStatic",Response=ECR_Overlap),(Channel="Pawn",Response=ECR_Overlap),(Channel="Visibility",Response=ECR_Block),(Channel="WorldDynamic",Response=ECR_Overlap),(Channel="Camera",Response=ECR_Overlap),(Channel="PhysicsBody",Response=ECR_Overlap),(Channel="Vehicle",Response=ECR_Overlap),(Channel="Destructible",Response=ECR_Overlap)),HelpMessage="WorldStatic object that overlaps all actors by default. All new custom channels will use its own default response. ",bCanModify=False)
+Profiles=(Name="NoCollision",CollisionEnabled=NoCollision,bCanModify=False,ObjectTypeName="WorldStatic",CustomResponses=((Channel="Visibility",Response=ECR_Ignore),(Channel="Camera",Response=ECR_Ignore)),HelpMessage="No collision")
+Profiles=(Name="BlockAll",CollisionEnabled=QueryAndPhysics,bCanModify=False,ObjectTypeName="WorldStatic",CustomResponses=,HelpMessage="WorldStatic object that blocks all actors by default. All new custom channels will use its own default response. ")
+Profiles=(Name="OverlapAll",CollisionEnabled=QueryOnly,bCanModify=False,ObjectTypeName="WorldStatic",CustomResponses=((Channel="WorldStatic",Response=ECR_Overlap),(Channel="Pawn",Response=ECR_Overlap),(Channel="Visibility",Response=ECR_Overlap),(Channel="WorldDynamic",Response=ECR_Overlap),(Channel="Camera",Response=ECR_Overlap),(Channel="PhysicsBody",Response=ECR_Overlap),(Channel="Vehicle",Response=ECR_Overlap),(Channel="Destructible",Response=ECR_Overlap)),HelpMessage="WorldStatic object that overlaps all actors by default. All new custom channels will use its own default response. ")
+Profiles=(Name="BlockAllDynamic",CollisionEnabled=QueryAndPhysics,bCanModify=False,ObjectTypeName="WorldDynamic",CustomResponses=,HelpMessage="WorldDynamic object that blocks all actors by default. All new custom channels will use its own default response. ")
+Profiles=(Name="OverlapAllDynamic",CollisionEnabled=QueryOnly,bCanModify=False,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="WorldStatic",Response=ECR_Overlap),(Channel="Pawn",Response=ECR_Overlap),(Channel="Visibility",Response=ECR_Overlap),(Channel="WorldDynamic",Response=ECR_Overlap),(Channel="Camera",Response=ECR_Overlap),(Channel="PhysicsBody",Response=ECR_Overlap),(Channel="Vehicle",Response=ECR_Overlap),(Channel="Destructible",Response=ECR_Overlap)),HelpMessage="WorldDynamic object that overlaps all actors by default. All new custom channels will use its own default response. ")
+Profiles=(Name="IgnoreOnlyPawn",CollisionEnabled=QueryOnly,bCanModify=False,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="Pawn",Response=ECR_Ignore),(Channel="Vehicle",Response=ECR_Ignore)),HelpMessage="WorldDynamic object that ignores Pawn and Vehicle. All other channels will be set to default.")
+Profiles=(Name="OverlapOnlyPawn",CollisionEnabled=QueryOnly,bCanModify=False,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="Pawn",Response=ECR_Overlap),(Channel="Vehicle",Response=ECR_Overlap),(Channel="Camera",Response=ECR_Ignore)),HelpMessage="WorldDynamic object that overlaps Pawn, Camera, and Vehicle. All other channels will be set to default. ")
+Profiles=(Name="Pawn",CollisionEnabled=QueryAndPhysics,bCanModify=False,ObjectTypeName="Pawn",CustomResponses=((Channel="Visibility",Response=ECR_Ignore)),HelpMessage="Pawn object. Can be used for capsule of any playerable character or AI. ")
+Profiles=(Name="Spectator",CollisionEnabled=QueryOnly,bCanModify=False,ObjectTypeName="Pawn",CustomResponses=((Channel="WorldStatic"),(Channel="Pawn",Response=ECR_Ignore),(Channel="Visibility",Response=ECR_Ignore),(Channel="WorldDynamic",Response=ECR_Ignore),(Channel="Camera",Response=ECR_Ignore),(Channel="PhysicsBody",Response=ECR_Ignore),(Channel="Vehicle",Response=ECR_Ignore),(Channel="Destructible",Response=ECR_Ignore)),HelpMessage="Pawn object that ignores all other actors except WorldStatic.")
+Profiles=(Name="CharacterMesh",CollisionEnabled=QueryOnly,bCanModify=False,ObjectTypeName="Pawn",CustomResponses=((Channel="Pawn",Response=ECR_Ignore),(Channel="Vehicle",Response=ECR_Ignore),(Channel="Visibility",Response=ECR_Ignore)),HelpMessage="Pawn object that is used for Character Mesh. All other channels will be set to default.")
+Profiles=(Name="PhysicsActor",CollisionEnabled=QueryAndPhysics,bCanModify=False,ObjectTypeName="PhysicsBody",CustomResponses=,HelpMessage="Simulating actors")
+Profiles=(Name="Destructible",CollisionEnabled=QueryAndPhysics,bCanModify=False,ObjectTypeName="Destructible",CustomResponses=,HelpMessage="Destructible actors")
+Profiles=(Name="InvisibleWall",CollisionEnabled=QueryAndPhysics,bCanModify=False,ObjectTypeName="WorldStatic",CustomResponses=((Channel="Visibility",Response=ECR_Ignore)),HelpMessage="WorldStatic object that is invisible.")
+Profiles=(Name="InvisibleWallDynamic",CollisionEnabled=QueryAndPhysics,bCanModify=False,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="Visibility",Response=ECR_Ignore)),HelpMessage="WorldDynamic object that is invisible.")
+Profiles=(Name="Trigger",CollisionEnabled=QueryOnly,bCanModify=False,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="WorldStatic",Response=ECR_Overlap),(Channel="Pawn",Response=ECR_Overlap),(Channel="Visibility",Response=ECR_Ignore),(Channel="WorldDynamic",Response=ECR_Overlap),(Channel="Camera",Response=ECR_Overlap),(Channel="PhysicsBody",Response=ECR_Overlap),(Channel="Vehicle",Response=ECR_Overlap),(Channel="Destructible",Response=ECR_Overlap)),HelpMessage="WorldDynamic object that is used for trigger. All other channels will be set to default.")
+Profiles=(Name="Ragdoll",CollisionEnabled=QueryAndPhysics,bCanModify=False,ObjectTypeName="PhysicsBody",CustomResponses=((Channel="Pawn",Response=ECR_Ignore),(Channel="Visibility",Response=ECR_Ignore)),HelpMessage="Simulating Skeletal Mesh Component. All other channels will be set to default.")
+Profiles=(Name="Vehicle",CollisionEnabled=QueryAndPhysics,bCanModify=False,ObjectTypeName="Vehicle",CustomResponses=,HelpMessage="Vehicle object that blocks Vehicle, WorldStatic, and WorldDynamic. All other channels will be set to default.")
+Profiles=(Name="UI",CollisionEnabled=QueryOnly,bCanModify=False,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="WorldStatic",Response=ECR_Overlap),(Channel="Pawn",Response=ECR_Overlap),(Channel="Visibility"),(Channel="WorldDynamic",Response=ECR_Overlap),(Channel="Camera",Response=ECR_Overlap),(Channel="PhysicsBody",Response=ECR_Overlap),(Channel="Vehicle",Response=ECR_Overlap),(Channel="Destructible",Response=ECR_Overlap)),HelpMessage="WorldStatic object that overlaps all actors by default. All new custom channels will use its own default response. ")
-ProfileRedirects=(OldName="BlockingVolume",NewName="InvisibleWall")
-ProfileRedirects=(OldName="InterpActor",NewName="IgnoreOnlyPawn")
-ProfileRedirects=(OldName="StaticMeshComponent",NewName="BlockAllDynamic")
-ProfileRedirects=(OldName="SkeletalMeshActor",NewName="PhysicsActor")
-ProfileRedirects=(OldName="InvisibleActor",NewName="InvisibleWallDynamic")
+ProfileRedirects=(OldName="BlockingVolume",NewName="InvisibleWall")
+ProfileRedirects=(OldName="InterpActor",NewName="IgnoreOnlyPawn")
+ProfileRedirects=(OldName="StaticMeshComponent",NewName="BlockAllDynamic")
+ProfileRedirects=(OldName="SkeletalMeshActor",NewName="PhysicsActor")
+ProfileRedirects=(OldName="InvisibleActor",NewName="InvisibleWallDynamic")
-CollisionChannelRedirects=(OldName="Static",NewName="WorldStatic")
-CollisionChannelRedirects=(OldName="Dynamic",NewName="WorldDynamic")
-CollisionChannelRedirects=(OldName="VehicleMovement",NewName="Vehicle")
-CollisionChannelRedirects=(OldName="PawnMovement",NewName="Pawn")
+CollisionChannelRedirects=(OldName="Static",NewName="WorldStatic")
+CollisionChannelRedirects=(OldName="Dynamic",NewName="WorldDynamic")
+CollisionChannelRedirects=(OldName="VehicleMovement",NewName="Vehicle")
+CollisionChannelRedirects=(OldName="PawnMovement",NewName="Pawn")

View File

@ -6,3 +6,7 @@ Description=GASATHON
ProjectName=GASATHON ProjectName=GASATHON
CopyrightNotice= CopyrightNotice=
[/Script/Gasa.GasaDevOptions]
Tag_PPV=Global_PPV
Tag_GlobalPPV=Global_PPV

BIN
Project/Content/Actors/BP_CameraMount.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Project/Content/Levels/StartupMap.umap (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,2 +1,3 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CppCodeStyle/OverridingFunctionStyle/@EntryValue">Override</s:String></wpf:ResourceDictionary> <s:String x:Key="/Default/CodeStyle/CodeFormatting/CppCodeStyle/OverridingFunctionStyle/@EntryValue">Override</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Gasa/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

View File

@ -1,29 +0,0 @@
[Window][DockSpaceViewport_11111111]
Pos=0,0
Size=1614,1271
Collapsed=0
[Window][Debug##Default]
Pos=60,60
Size=400,400
Collapsed=0
[Window][Inspector##Inspector]
Pos=910,136
Size=641,1061
Collapsed=1
[Table][0x7E0CA29E,2]
Column 0 Weight=1.0000
Column 1 Weight=1.0000
[Docking][Data]
DockSpace ID=0x8B93E3BD Window=0xA787BDB4 Pos=0,0 Size=1614,1271 CentralNode=1
[Cog][Windows]
0xD0F6B9F9
[Cog][Widgets]
0x348EE4A5 0
0x63A19979 0

View File

@ -0,0 +1,30 @@
#include "CameraMount.h"
#include "Camera/CameraComponent.h"
#include "GameFramework/SpringArmComponent.h"
ACameraMount::ACameraMount()
{
PrimaryActorTick.bCanEverTick = true;
RootComponent = CreateDefaultSubobject<USceneComponent>("Root");
CamSpringArm = CreateDefaultSubobject<USpringArmComponent>("Camera Spring Arm");
CamSpringArm->SetupAttachment(RootComponent);
CamSpringArm->SetRelativeRotation( FQuat::MakeFromEuler(FVector(0.0, -35.0, 0.0)));
CamSpringArm->TargetArmLength = 400.0f;
CamSpringArm->bDoCollisionTest = true;
CamSpringArm->bInheritPitch = false;
CamSpringArm->bInheritYaw = false;
CamSpringArm->bInheritRoll = false;
Camera = CreateDefaultSubobject<UCameraComponent>("Camera");
Camera->SetupAttachment(CamSpringArm);
}
void ACameraMount::PostInitializeComponents()
{
Super::PostInitializeComponents();
}

View File

@ -0,0 +1,25 @@
#pragma once
#include "GasaCommon.h"
#include "CameraMount.generated.h"
UCLASS(Blueprintable)
class GASA_API ACameraMount : public AActor
{
GENERATED_BODY()
public:
#pragma region Camera
UPROPERTY(EditAnywhere, Category="Camera")
TObjectPtr<UCameraComponent> Camera;
UPROPERTY(EditAnywhere, Category="Camera")
TObjectPtr<USpringArmComponent> CamSpringArm;
#pragma endregion Camera
ACameraMount();
#pragma region Actor
void PostInitializeComponents() override;
#pragma endregion Actor
};

View File

@ -1,5 +1,6 @@
#include "GasaCharacter.h" #include "GasaCharacter.h"
#include "GasaLevelScriptActor.h"
#include "Camera/CameraComponent.h" #include "Camera/CameraComponent.h"
#include "Components/CapsuleComponent.h" #include "Components/CapsuleComponent.h"
#include "GameFramework/CharacterMovementComponent.h" #include "GameFramework/CharacterMovementComponent.h"
@ -31,18 +32,6 @@ AGasaCharacter::AGasaCharacter()
USceneComponent* root_component = GetRootComponent(); USceneComponent* root_component = GetRootComponent();
USkeletalMeshComponent* mesh = GetMesh(); USkeletalMeshComponent* mesh = GetMesh();
CamSpringArm = CreateDefaultSubobject<USpringArmComponent>("Camera Spring Arm");
CamSpringArm->SetupAttachment(root_component);
CamSpringArm->SetRelativeRotation( FQuat::MakeFromEuler(FVector(0.0, -35.0, 0.0)));
CamSpringArm->TargetArmLength = 400.0f;
CamSpringArm->bInheritPitch = false;
CamSpringArm->bInheritYaw = false;
CamSpringArm->bInheritRoll = false;
Camera = CreateDefaultSubobject<UCameraComponent>("Camera");
Camera->SetupAttachment(CamSpringArm);
Weapon = CreateDefaultSubobject<USkeletalMeshComponent>("Weapon"); Weapon = CreateDefaultSubobject<USkeletalMeshComponent>("Weapon");
Weapon->SetupAttachment(mesh, FName("WeaponAttach")); Weapon->SetupAttachment(mesh, FName("WeaponAttach"));
Weapon->SetCollisionEnabled(ECollisionEnabled::NoCollision); Weapon->SetCollisionEnabled(ECollisionEnabled::NoCollision);
@ -57,23 +46,41 @@ void AGasaCharacter::Tick(float DeltaSeconds)
{ {
Super::Tick(DeltaSeconds); Super::Tick(DeltaSeconds);
USkeletalMeshComponent* mesh = GetMesh();
switch (HighlightState) switch (HighlightState)
{ {
case EHighlight::Disabled: case EHighlight::Disabled:
{
mesh->SetRenderCustomDepth(false);
mesh->SetCustomDepthStencilValue(0.f);
Weapon->SetRenderCustomDepth(false);
Weapon->SetCustomDepthStencilValue(0.f);
}
break; break;
case EHighlight::Enabled: case EHighlight::Enabled:
{ {
UCapsuleComponent* Capsule = GetCapsuleComponent(); mesh->SetRenderCustomDepth(true);
mesh->SetCustomDepthStencilValue(HighlightStencilDepth);
Weapon->SetRenderCustomDepth(true);
Weapon->SetCustomDepthStencilValue(HighlightStencilDepth);
APostProcessVolume* PPV = Gasa::GetLevelActor(this)->GlobalPPV;
TObjectPtr<UObject> Blendable = PPV->Settings.WeightedBlendables.Array[0].Object;
UMaterialInstanceDynamic*
MID = Cast<UMaterialInstanceDynamic>(Blendable);
MID->SetVectorParameterValue("Depth Highlight Color", HighlightColor);
#if 0
UCapsuleComponent* Capsule = GetCapsuleComponent();
UKismetSystemLibrary::DrawDebugCapsule(this UKismetSystemLibrary::DrawDebugCapsule(this
, Capsule->GetComponentLocation() , Capsule->GetComponentLocation()
, Capsule->GetScaledCapsuleHalfHeight() , Capsule->GetScaledCapsuleHalfHeight()^
, Capsule->GetScaledCapsuleRadius() , Capsule->GetScaledCapsuleRadius()
, Capsule->GetComponentRotation() , Capsule->GetComponentRotation()
, HighlightColor , HighlightColor
, 0.f , 0.f
, 1.f , 1.f
); );
#endif
} }
break; break;
} }

View File

@ -17,23 +17,14 @@ class GASA_API AGasaCharacter : public ACharacter
{ {
GENERATED_BODY() GENERATED_BODY()
public: public:
// TODO(Ed): Either make a toggle ore move to player controller if it gets expensive
// There is no need to have this lodged int PlayerCharacter anyway. It can attach to pawn on posses.
#pragma region Camera
UPROPERTY(EditAnywhere, Category="Camera")
UCameraComponent* Camera;
UPROPERTY(EditAnywhere, Category="Camera")
USpringArmComponent* CamSpringArm;
#pragma endregion Camera
#pragma region Combat #pragma region Combat
UPROPERTY(EditAnywhere, Category="Combat") UPROPERTY(EditAnywhere, Category="Combat")
TObjectPtr<USkeletalMeshComponent> Weapon; TObjectPtr<USkeletalMeshComponent> Weapon;
#pragma endregion Combat #pragma endregion Combat
// This will be implemented in the base until it needs to be lifted into an abstraction.
#pragma region Highlighting #pragma region Highlighting
static constexpr float HighlightStencilDepth = 256.0;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Highlighting") UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Highlighting")
EHighlight HighlightState; EHighlight HighlightState;

View File

@ -23,6 +23,7 @@ public class Gasa : ModuleRules
"AIModule", "AIModule",
"CoreUObject", "CoreUObject",
"DeveloperSettings",
"Engine", "Engine",
"EnhancedInput", "EnhancedInput",
"GameplayAbilities", "GameplayAbilities",

View File

@ -1,13 +1,18 @@
 
#pragma once
#include "CoreMinimal.h" #include "CoreMinimal.h"
// #define private protected // #define private protected
#include "CogCommon.h" #define global
#define internal static
#define local_persist static
#pragma region Engine Forwards #pragma region Engine Forwards
struct FInputActionValue;
class UCameraComponent; class UCameraComponent;
class UInputAction; class UInputAction;
struct FInputActionValue;
class UInputMappingContext; class UInputMappingContext;
class USpringArmComponent; class USpringArmComponent;
#pragma endregion Engine Forwards #pragma endregion Engine Forwards
@ -16,7 +21,12 @@ class USpringArmComponent;
class UCogWindowManager; class UCogWindowManager;
#pragma endregion Engine Plugin Forwards #pragma endregion Engine Plugin Forwards
#pragma region Gasa Forwards // Gasa
class AGasaCharacter;
#pragma endregion Gasa Forwards
#pragma region Forwards
class ACameraMount;
class AGasaCharacter;
class AGasaLevelScriptActor;
class UGasaDevOptions;
#pragma endregion Forwards

View File

@ -0,0 +1,18 @@
#include "GasaDevOptions.h"
#include "GasaDevOptionsCache.h"
namespace Gasa
{
global FName Tag_GlobalPPV;
}
void FGasaDevOptionsCache::CachedDevOptions()
{
using namespace Gasa;
UGasaDevOptions const* DevOs = GetDevOptions();
Tag_GlobalPPV = DevOs->Tag_GlobalPPV;
}

View File

@ -0,0 +1,29 @@
#pragma once
#include "Engine/DeveloperSettings.h"
#include "GasaDevOptions.generated.h"
UCLASS(Config=Game, DefaultConfig, meta=(DisplayName="Gasa"))
class GASA_API UGasaDevOptions : public UDeveloperSettings
{
GENERATED_BODY()
public:
UPROPERTY(Config, EditAnywhere, BlueprintReadOnly, Category="Tags")
FName Tag_GlobalPPV;
};
namespace Gasa
{
extern FName Tag_GlobalPPV;
FORCEINLINE
UGasaDevOptions const* GetDevOptions() {
return GetDefault<UGasaDevOptions>();
}
FORCEINLINE
UGasaDevOptions* GetMutDevOptions() {
return GetMutableDefault<UGasaDevOptions>();
}
}

View File

@ -0,0 +1,13 @@
#pragma once
#include "GasaCommon.h"
#include "GasaDevOptionsCache.generated.h"
USTRUCT()
struct GASA_API FGasaDevOptionsCache
{
GENERATED_BODY()
void CachedDevOptions();
};

View File

@ -0,0 +1,8 @@
#include "GasaGameInstance.h"
void UGasaGameInstance::Init()
{
Super::Init();
DevOptionsCache.CachedDevOptions();
}

View File

@ -0,0 +1,29 @@
#pragma once
#include "GasaCommon.h"
#include "GasaDevOptionsCache.h"
#include "GasaGameInstance.generated.h"
UCLASS(Blueprintable)
class GASA_API UGasaGameInstance : public UGameInstance
{
GENERATED_BODY()
public:
UPROPERTY(VisibleAnywhere, Category="Dev Cache")
FGasaDevOptionsCache DevOptionsCache;
#pragma region GameInstance
void Init() override;
#pragma endregion GameInstance
};
namespace Gasa
{
FORCEINLINE
UGasaGameInstance* GetGameInstance(UObject* Context) {
// TODO(Ed): Do this with proper checks
return Context->GetWorld()->GetGameInstance<UGasaGameInstance>();
}
}

View File

@ -9,3 +9,11 @@ class GASA_API AGasaGameMode : public AGameMode
GENERATED_BODY() GENERATED_BODY()
public: public:
}; };
namespace Gasa
{
FORCEINLINE
AGasaGameMode* GetGameMode(UObject* Context) {
return Context->GetWorld()->GetAuthGameMode<AGasaGameMode>();
}
}

View File

@ -28,3 +28,11 @@ public:
void Tick(float DeltaSeconds) override; void Tick(float DeltaSeconds) override;
#pragma endregion GameState #pragma endregion GameState
}; };
namespace Gasa
{
FORCEINLINE
AGasaGameState* GetGameState(UObject* Context) {
return Context->GetWorld()->GetGameState<AGasaGameState>();
}
}

View File

@ -0,0 +1,2 @@
#include "GasaGameplayTags.h"

View File

@ -0,0 +1,3 @@
#pragma once
#include "NativeGameplayTags.h"

View File

@ -0,0 +1,25 @@
#include "GasaLevelScriptActor.h"
#include "GasaDevOptions.h"
#include "GasaGameplayTags.h"
#include "Kismet/GameplayStatics.h"
#include "GasaLibrary.h"
void AGasaLevelScriptActor::BeginPlay()
{
Super::BeginPlay();
TArray<AActor*> TaggedActors;
UGameplayStatics::GetAllActorsWithTag(GetWorld(), Gasa::GetDevOptions()->Tag_GlobalPPV,TaggedActors);
for (AActor* Actor : TaggedActors)
{
GlobalPPV = Cast<APostProcessVolume>(Actor);
APostProcessVolume* PPV = Gasa::GetLevelActor(this)->GlobalPPV;
UMaterialInstance* Blendable = Cast<UMaterialInstance>(PPV->Settings.WeightedBlendables.Array[0].Object);
UMaterialInstanceDynamic* MID = UMaterialInstanceDynamic::Create(Blendable, this);
PPV->Settings.WeightedBlendables.Array[0].Object = MID;
break;
}
}

View File

@ -0,0 +1,27 @@
#pragma once
#include "Engine/LevelScriptActor.h"
#include "GasaLevelScriptActor.generated.h"
UCLASS(Blueprintable)
class GASA_API AGasaLevelScriptActor : public ALevelScriptActor
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Post Process")
TObjectPtr<APostProcessVolume> GlobalPPV;
#pragma region Actor
void BeginPlay() override;
#pragma region endActor
};
namespace Gasa
{
inline
AGasaLevelScriptActor* GetLevelActor(UObject* Context, ULevel* OwnerLevel = nullptr) {
UWorld* World = GEngine->GetWorldFromContextObjectChecked(Context);
return Cast<AGasaLevelScriptActor>(World->GetLevelScriptActor(OwnerLevel));
}
}

View File

@ -0,0 +1,9 @@
#include "GasaLibrary.h"
#include "GasaDevOptions.h"
#include "GasaLevelScriptActor.h"
#include "Engine/LevelScriptActor.h"
UGasaDevOptions* UGasaLib::GetDevOptions(UObject* Context) {
return Gasa::GetMutDevOptions();
}

View File

@ -0,0 +1,23 @@
#pragma once
#include "GasaCommon.h"
#include "GasaLibrary.Generated.h"
// UINTERFACE()
// class
UCLASS(BlueprintType)
class GASA_API UGasaLib : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
#pragma region Game
UFUNCTION(BlueprintCallable, Category="Gasa|Game", BlueprintPure, meta=(WorldContext="Context"))
static UGasaDevOptions* GetDevOptions(UObject* Context);
#pragma endregion Game
};

View File

@ -3,10 +3,19 @@
#include "Engine/LocalPlayer.h" #include "Engine/LocalPlayer.h"
#include "EnhancedInputComponent.h" #include "EnhancedInputComponent.h"
#include "EnhancedInputSubsystems.h" #include "EnhancedInputSubsystems.h"
#include "Character/GasaCharacter.h" #include "Actors/CameraMount.h"
#include "Camera/CameraComponent.h"
#include "Characters/GasaCharacter.h"
#include "Components/CapsuleComponent.h"
#include "GameFramework/SpringArmComponent.h"
#include "Kismet/KismetSystemLibrary.h"
AGasaPlayerController::AGasaPlayerController() AGasaPlayerController::AGasaPlayerController()
{ {
PrimaryActorTick.bCanEverTick = true;
bAutoManageActiveCameraTarget = false;
// Replication
bReplicates = true; bReplicates = true;
} }
@ -53,6 +62,18 @@ void AGasaPlayerController::Move(FInputActionValue const& ActionValue)
#endif #endif
} }
void AGasaPlayerController::OnPossess(APawn* InPawn)
{
Super::OnPossess(InPawn);
Cam->AttachToActor(InPawn, FAttachmentTransformRules::KeepRelativeTransform);
}
void AGasaPlayerController::OnUnPossess()
{
Super::OnUnPossess();
}
#pragma region PlayerController #pragma region PlayerController
void AGasaPlayerController::PlayerTick(float DeltaTime) void AGasaPlayerController::PlayerTick(float DeltaTime)
{ {
@ -110,6 +131,7 @@ void AGasaPlayerController::BeginPlay()
Super::BeginPlay(); Super::BeginPlay();
check(IMC); check(IMC);
UEnhancedInputLocalPlayerSubsystem* UEnhancedInputLocalPlayerSubsystem*
EILP_Subsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(GetLocalPlayer()); EILP_Subsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(GetLocalPlayer());
check(EILP_Subsystem); check(EILP_Subsystem);
@ -123,4 +145,40 @@ void AGasaPlayerController::BeginPlay()
SetInputMode(MouseMode); SetInputMode(MouseMode);
} }
} }
void AGasaPlayerController::PostInitializeComponents()
{
Super::PostInitializeComponents();
Cam = GetWorld()->SpawnActor<ACameraMount>(CamClass, FActorSpawnParameters() );
SetViewTarget(Cam);
}
void AGasaPlayerController::Tick(float DeltaSeconds)
{
Super::Tick(DeltaSeconds);
#if 0
switch (HighlightState)
{
case EHighlight::Disabled:
break;
case EHighlight::Enabled:
{
UCapsuleComponent* Capsule = GetCapsuleComponent();
UKismetSystemLibrary::DrawDebugCapsule(this
, Capsule->GetComponentLocation()
, Capsule->GetScaledCapsuleHalfHeight()
, Capsule->GetScaledCapsuleRadius()
, Capsule->GetComponentRotation()
, HighlightColor
, 0.f
, 1.f
);
}
break;
}
#endif
}
#pragma endregion Actor #pragma endregion Actor

View File

@ -11,13 +11,37 @@ class GASA_API AGasaPlayerController : public APlayerController
{ {
GENERATED_BODY() GENERATED_BODY()
public: public:
#pragma region Camera
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TSubclassOf<ACameraMount> CamClass;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TObjectPtr<ACameraMount> Cam;
#pragma endregion Camera
// This will be implemented in the base until it needs to be lifted into an abstraction.
#if 0
#pragma region Highlighting
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Highlighting")
EHighlight HighlightState;
UFUNCTION(BlueprintCallable, Category="Highlighting")
void SetHighlight( EHighlight Desired );
UFUNCTION(BlueprintCallable, Category="Highlighting")
FORCEINLINE void Highlight() { SetHighlight(EHighlight::Enabled); };
UFUNCTION(BlueprintCallable, Category="Highlighting")
FORCEINLINE void Dehighlight() { SetHighlight(EHighlight::Disabled); };
#pragma endregion Highlighting
#endif
#pragma region Input #pragma region Input
UPROPERTY(VisibleAnywhere, BlueprintReadOnly) UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
AGasaCharacter* HoverPrev; TObjectPtr<AGasaCharacter> HoverPrev;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly) UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
AGasaCharacter* HoverCurr; TObjectPtr<AGasaCharacter> HoverCurr;
UPROPERTY(EditAnywhere, Category="Input") UPROPERTY(EditAnywhere, Category="Input")
TObjectPtr<UInputMappingContext> IMC; TObjectPtr<UInputMappingContext> IMC;
@ -31,6 +55,10 @@ public:
void Move(FInputActionValue const& ActionValue); void Move(FInputActionValue const& ActionValue);
#pragma region PlayerController #pragma region PlayerController
void OnPossess(APawn* InPawn) override;
void OnUnPossess() override;
void PlayerTick(float DeltaTime) override; void PlayerTick(float DeltaTime) override;
void SetupInputComponent() override; void SetupInputComponent() override;
@ -38,5 +66,9 @@ public:
#pragma region Actor #pragma region Actor
void BeginPlay() override; void BeginPlay() override;
void PostInitializeComponents() override;
void Tick(float DeltaSeconds) override;
#pragma endregion Actor #pragma endregion Actor
}; };

View File

@ -12,6 +12,7 @@ public class GasaEditorTarget : TargetRules
DefaultBuildSettings = BuildSettingsVersion.Latest; DefaultBuildSettings = BuildSettingsVersion.Latest;
bUseUnityBuild = false; bUseUnityBuild = false;
bUseXGEController = false;
ExtraModuleNames.Add("Gasa"); ExtraModuleNames.Add("Gasa");
ExtraModuleNames.Add("GasaEditor"); ExtraModuleNames.Add("GasaEditor");