Added elapsedTime and shiny Highlight along with Level 3 asset and scene

This commit is contained in:
Glence 2023-02-25 21:56:49 +08:00
parent a27b3fb80e
commit 027a2c490b
26 changed files with 10782 additions and 49 deletions

View File

@ -0,0 +1,8 @@
- VertexShader: 39210065
FragmentShader: 46377769
SubPass: G-Buffer Write
Properties:
data.color: {x: 1, y: 1, z: 1, w: 1}
data.textureIndex: 50821588
data.alpha: 1
data.beta: {x: 1, y: 1, z: 1}

View File

@ -0,0 +1,3 @@
Name: MT_HousePaletteLevel3
ID: 126223465
Type: 7

170
Assets/Models/MD_Box.gltf Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1,7 @@
Name: MD_Box
ID: 70818427
Type: 4
Sub Assets:
Name: Box
ID: 140639624
Type: 8

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1,64 @@
Name: MD_Level3Furnitures
ID: 81985261
Type: 4
Sub Assets:
Name: DrawerSmall01.001
ID: 149702955
Type: 8
Name: CupboardEmpty
ID: 144058424
Type: 8
Name: DoorDoubleRight
ID: 140394654
Type: 8
Name: DoorDoubleLeft
ID: 149432297
Type: 8
Name: TV_Screen
ID: 139805143
Type: 8
Name: CupboardSolidBlock
ID: 143365399
Type: 8
Name: MetalShelf02
ID: 140244884
Type: 8
Name: Speaker
ID: 150497074
Type: 8
Name: Table02
ID: 142652392
Type: 8
Name: CupboardSinkPiece
ID: 144544365
Type: 8
Name: Couch_Cushion_Bouncy
ID: 135719689
Type: 8
Name: Couch_Right
ID: 138531188
Type: 8
Name: Couch_Left
ID: 137589234
Type: 8
Name: Couch_Mid
ID: 147766199
Type: 8
Name: Couch_Cushion_Reg
ID: 143809811
Type: 8
Name: Chair03
ID: 137183283
Type: 8
Name: Couch_Cushion_Casting
ID: 148097428
Type: 8
Name: Couch_Right_Casting
ID: 136550658
Type: 8
Name: Couch_Left_Casting
ID: 137021820
Type: 8
Name: Couch_Mid_Casting
ID: 141205478
Type: 8

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1,115 @@
Name: MD_ModularWallsLevel3
ID: 72946969
Type: 4
Sub Assets:
Name: Pillar_GroundLevel
ID: 142355539
Type: 8
Name: WallEnd_GroundLevel
ID: 135098906
Type: 8
Name: Pillar_UpperLevel
ID: 140176723
Type: 8
Name: WallEnd_UpperLevel
ID: 135608625
Type: 8
Name: Railings_Single
ID: 143247134
Type: 8
Name: Stairs_Nine
ID: 150659431
Type: 8
Name: Stairs_Single
ID: 149660801
Type: 8
Name: WallDoorHole_GroundLevel
ID: 143660070
Type: 8
Name: Door
ID: 140827566
Type: 8
Name: DoorFrame
ID: 148230390
Type: 8
Name: WallDoorHole_UpperLevel
ID: 148075107
Type: 8
Name: FloorLarge
ID: 142686872
Type: 8
Name: FloorSmall
ID: 146483541
Type: 8
Name: FloorLongV2
ID: 142103206
Type: 8
Name: FloorLongV1
ID: 137355351
Type: 8
Name: WallCorner_GroundLevel
ID: 135381806
Type: 8
Name: WallCorner_UpperLevel
ID: 142118787
Type: 8
Name: WallDefault_GroundLevel
ID: 140523061
Type: 8
Name: WallDefault_UpperLevel
ID: 148065788
Type: 8
Name: WallLarge_GroundLevel
ID: 138571126
Type: 8
Name: WallLarge_UpperLevel
ID: 141321653
Type: 8
Name: WallTBlock_GroundLevel
ID: 144033065
Type: 8
Name: WallTBlock_UpperLevel
ID: 143422750
Type: 8
Name: WindowLargeClosedV1_GroundLevel
ID: 144185196
Type: 8
Name: WindowLargeClosedV1_UpperLevel
ID: 139481766
Type: 8
Name: WindowLargeClosedV2_UpperLevel
ID: 148869790
Type: 8
Name: WindowSmallOpenedV1_GroundLevel
ID: 139767865
Type: 8
Name: WindowSmallOpenedV1_UpperLevel
ID: 149358260
Type: 8
Name: WindowSmallClosedV1_GroundLevel
ID: 142546138
Type: 8
Name: WindowSmallClosedV1_UpperLevel
ID: 145491414
Type: 8
Name: WindowSmallClosedV2_UpperLevel
ID: 135806521
Type: 8
Name: WindowLargeOpenV1_GroundLevel
ID: 141867906
Type: 8
Name: WindowLargeOpenV1_UpperLevel
ID: 146405629
Type: 8
Name: Beam_Bar
ID: 146273456
Type: 8
Name: Beam_Lights
ID: 150210189
Type: 8
Name: Railings_Three
ID: 137150602
Type: 8
Name: FloorMassive
ID: 147993277
Type: 8

View File

@ -4507,6 +4507,7 @@
currCategory: 1
density: 1
dontReturn: false
soundDistance: 10
- EID: 227
Name: Mesh_Cheese
IsActive: true
@ -4554,6 +4555,7 @@
currCategory: 2
density: 1
dontReturn: false
soundDistance: 10
- EID: 65778
Name: Mesh_Apple
IsActive: true
@ -4601,6 +4603,7 @@
currCategory: 0
density: 1
dontReturn: false
soundDistance: 10
- EID: 216
Name: Mesh_Apple
IsActive: true
@ -4648,6 +4651,7 @@
currCategory: 0
density: 1
dontReturn: false
soundDistance: 10
- EID: 229
Name: ====ScoreZonePool====
IsActive: true
@ -5104,6 +5108,7 @@
maxJumpHeight: 2
maxJumpTime: 0.75
fallMultipler: 3
jumpPadMultiplayer: 2
lightMultiper: 0.75
mediumMultiper: 0.5
heavyMultiper: 0.25
@ -5115,6 +5120,9 @@
aimingLength: 0.899999976
throwItem: false
rayDistance: 0.5
rayHeight: 0.100000001
aimingFOV: 50
defaultFOV: 45
- EID: 65733
Name: HoldingPoint
IsActive: true
@ -5142,10 +5150,10 @@
Yaw: 360
Roll: 1.28065994e-06
Width: 1920
Height: 1080
Near: 0.00999999978
Far: 10000
Perspective: true
FOV: 90
IsActive: true
Camera Arm Component:
Arm Pitch: 0
@ -5161,10 +5169,10 @@
armLength: 2
turnSpeedPitch: 0.300000012
turnSpeedYaw: 0.5
pitchClamp: 45
inverseXControls: true
inverseYControls: true
lowerClamp: 5
pitchUpperClamp: 45
pitchLowerClamp: 5
- EID: 65731
Name: PlayerBag
IsActive: true

4937
Assets/Scenes/Level3.shade Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,3 @@
Name: Level3
ID: 88928066
Type: 5

View File

@ -8505,7 +8505,7 @@
IsActive: true
Renderable Component:
Mesh: 136892700
Material: 131956078
Material: 122370915
IsActive: true
RigidBody Component:
Type: Dynamic
@ -8541,6 +8541,9 @@
density: 1
dontReturn: false
soundDistance: 10
highlightSpeed: 300
highlightThickness: 250
highlightRatio: 0.699999988
- EID: 157
Name: Mesh_Meat
IsActive: true
@ -8553,7 +8556,7 @@
IsActive: true
Renderable Component:
Mesh: 136892700
Material: 131956078
Material: 122370915
IsActive: true
RigidBody Component:
Type: Dynamic
@ -8589,6 +8592,9 @@
density: 1
dontReturn: false
soundDistance: 10
highlightSpeed: 300
highlightThickness: 250
highlightRatio: 0.699999988
- EID: 156
Name: Mesh_Meat
IsActive: true
@ -8637,6 +8643,9 @@
density: 1
dontReturn: false
soundDistance: 10
highlightSpeed: 300
highlightThickness: 250
highlightRatio: 0.699999988
- EID: 155
Name: Mesh_Cheese
IsActive: true
@ -8649,7 +8658,7 @@
IsActive: true
Renderable Component:
Mesh: 141841143
Material: 131956078
Material: 122370915
IsActive: true
RigidBody Component:
Type: Dynamic
@ -8685,6 +8694,9 @@
density: 1
dontReturn: false
soundDistance: 10
highlightSpeed: 300
highlightThickness: 250
highlightRatio: 0.699999988
- EID: 154
Name: Mesh_Cheese
IsActive: true
@ -8697,7 +8709,7 @@
IsActive: true
Renderable Component:
Mesh: 141841143
Material: 131956078
Material: 122370915
IsActive: true
RigidBody Component:
Type: Dynamic
@ -8733,6 +8745,9 @@
density: 1
dontReturn: false
soundDistance: 10
highlightSpeed: 300
highlightThickness: 250
highlightRatio: 0.699999988
- EID: 153
Name: Mesh_Cheese
IsActive: true
@ -8745,7 +8760,7 @@
IsActive: true
Renderable Component:
Mesh: 141841143
Material: 131956078
Material: 122370915
IsActive: true
RigidBody Component:
Type: Dynamic
@ -8781,6 +8796,9 @@
density: 1
dontReturn: false
soundDistance: 10
highlightSpeed: 300
highlightThickness: 250
highlightRatio: 0.699999988
- EID: 65778
Name: Mesh_Apple
IsActive: true
@ -8793,7 +8811,7 @@
IsActive: true
Renderable Component:
Mesh: 144128170
Material: 131956078
Material: 122370915
IsActive: true
RigidBody Component:
Type: Dynamic
@ -8829,6 +8847,9 @@
density: 1
dontReturn: false
soundDistance: 10
highlightSpeed: 300
highlightThickness: 250
highlightRatio: 0.699999988
- EID: 152
Name: Mesh_Apple
IsActive: true
@ -8841,7 +8862,7 @@
IsActive: true
Renderable Component:
Mesh: 144128170
Material: 131956078
Material: 122370915
IsActive: true
RigidBody Component:
Type: Dynamic
@ -8877,6 +8898,9 @@
density: 1
dontReturn: false
soundDistance: 10
highlightSpeed: 300
highlightThickness: 250
highlightRatio: 0.699999988
- EID: 151
Name: Mesh_Apple
IsActive: true
@ -8889,7 +8913,7 @@
IsActive: true
Renderable Component:
Mesh: 144128170
Material: 131956078
Material: 122370915
IsActive: true
RigidBody Component:
Type: Dynamic
@ -8925,19 +8949,22 @@
density: 1
dontReturn: false
soundDistance: 10
highlightSpeed: 300
highlightThickness: 250
highlightRatio: 0.699999988
- EID: 65686
Name: Watermelon
IsActive: true
NumberOfChildren: 5
Components:
Transform Component:
Translate: {x: 1.65356398, y: 0.333341181, z: 7.14459705}
Translate: {x: 1.65356398, y: 0.333341181, z: 5.9183445}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 0.999979734, y: 1, z: 0.999979734}
IsActive: true
Renderable Component:
Mesh: 134305891
Material: 131956078
Material: 122370915
IsActive: true
RigidBody Component:
Type: Dynamic
@ -8977,6 +9004,9 @@
density: 1
dontReturn: false
soundDistance: 10
highlightSpeed: 300
highlightThickness: 250
highlightRatio: 0.699999988
- EID: 131220
Name: Piece1
IsActive: true
@ -8989,7 +9019,7 @@
IsActive: true
Renderable Component:
Mesh: 144023586
Material: 131956078
Material: 122370915
IsActive: true
RigidBody Component:
Type: Dynamic
@ -9025,6 +9055,9 @@
density: 3
dontReturn: false
soundDistance: 10
highlightSpeed: 300
highlightThickness: 250
highlightRatio: 0.699999988
- EID: 131219
Name: Piece2
IsActive: true
@ -9037,7 +9070,7 @@
IsActive: true
Renderable Component:
Mesh: 142132679
Material: 131956078
Material: 122370915
IsActive: true
RigidBody Component:
Type: Dynamic
@ -9073,6 +9106,9 @@
density: 3
dontReturn: false
soundDistance: 10
highlightSpeed: 300
highlightThickness: 250
highlightRatio: 0.699999988
- EID: 131221
Name: Piece3
IsActive: true
@ -9085,7 +9121,7 @@
IsActive: true
Renderable Component:
Mesh: 138231239
Material: 131956078
Material: 122370915
IsActive: true
RigidBody Component:
Type: Dynamic
@ -9121,6 +9157,9 @@
density: 3
dontReturn: false
soundDistance: 10
highlightSpeed: 300
highlightThickness: 250
highlightRatio: 0.699999988
- EID: 145
Name: Piece4
IsActive: true
@ -9133,7 +9172,7 @@
IsActive: true
Renderable Component:
Mesh: 135293480
Material: 131956078
Material: 122370915
IsActive: true
RigidBody Component:
Type: Dynamic
@ -9169,6 +9208,9 @@
density: 3
dontReturn: false
soundDistance: 10
highlightSpeed: 300
highlightThickness: 250
highlightRatio: 0.699999988
- EID: 196754
Name: Piece5
IsActive: true
@ -9181,7 +9223,7 @@
IsActive: true
Renderable Component:
Mesh: 146157335
Material: 131956078
Material: 122370915
IsActive: true
RigidBody Component:
Type: Dynamic
@ -9217,6 +9259,9 @@
density: 3
dontReturn: false
soundDistance: 10
highlightSpeed: 300
highlightThickness: 250
highlightRatio: 0.699999988
- EID: 144
Name: Egg
IsActive: true
@ -9229,7 +9274,7 @@
IsActive: true
Renderable Component:
Mesh: 147457317
Material: 131956078
Material: 122370915
IsActive: true
RigidBody Component:
Type: Dynamic
@ -9269,6 +9314,9 @@
density: 2
dontReturn: false
soundDistance: 10
highlightSpeed: 300
highlightThickness: 250
highlightRatio: 0.699999988
- EID: 143
Name: Piece1
IsActive: true
@ -9610,9 +9658,6 @@
Text: My name is Brandon.
Font: 176667660
IsActive: true
UI Component:
Canvas ID: 199
IsActive: true
Scripts: ~
- EID: 206
Name: Timer
@ -9628,9 +9673,6 @@
Text: My name is Brandon.
Font: 176667660
IsActive: true
UI Component:
Canvas ID: 199
IsActive: true
Scripts: ~
- EID: 139
Name: Multiplier
@ -9646,9 +9688,6 @@
Text: TEST
Font: 176667660
IsActive: true
UI Component:
Canvas ID: 199
IsActive: true
Scripts: ~
- EID: 11
Name: GamePause
@ -9765,7 +9804,6 @@
Yaw: 360
Roll: 1.28065994e-06
Width: 1055
Height: 604
Near: 0.00999999978
Far: 10000
Perspective: true
@ -10533,18 +10571,18 @@
Scripts: ~
- EID: 158
Name: ====AI=====
IsActive: true
IsActive: false
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 0, z: -2.64324665}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
IsActive: false
Renderable Component:
Mesh: 140697366
Material: 129495479
IsActive: true
IsActive: false
RigidBody Component:
Type: Dynamic
Drag: 0.00999999978
@ -10558,7 +10596,7 @@
Freeze Rotation X: true
Freeze Rotation Y: false
Freeze Rotation Z: true
IsActive: true
IsActive: false
Collider Component:
Colliders:
- Is Trigger: false
@ -10570,7 +10608,7 @@
Density: 1
Position Offset: {x: 0, y: 0.899999976, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
IsActive: false
Scripts:
- Type: Homeowner1
Enabled: true
@ -10585,18 +10623,18 @@
footstepSFXIntervalMultiplier: 0.5
- EID: 12
Name: Mesh_Meat
IsActive: true
IsActive: false
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 2.30459714, y: 0.209537908, z: 6.371418}
Translate: {x: 0.964969039, y: 0.103873327, z: 6.05876541}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
IsActive: false
Renderable Component:
Mesh: 136892700
Material: 131956078
IsActive: true
Material: 122370915
IsActive: false
RigidBody Component:
Type: Dynamic
Drag: 0.00999999978
@ -10610,7 +10648,7 @@
Freeze Rotation X: false
Freeze Rotation Y: false
Freeze Rotation Z: false
IsActive: true
IsActive: false
Collider Component:
Colliders:
- Is Trigger: false
@ -10622,7 +10660,7 @@
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
IsActive: false
Scripts:
- Type: Item
Enabled: true
@ -10631,16 +10669,19 @@
density: 1
dontReturn: false
soundDistance: 10
highlightSpeed: 300
highlightThickness: 250
highlightRatio: 0.699999988
- EID: 16
Name: JumpPad
IsActive: false
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 3.43332767, y: 0.149463654, z: 6.84711409}
Translate: {x: 3.52692485, y: 0, z: 6.85981083}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 1, y: 1, z: 1}
IsActive: false
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
@ -10652,7 +10693,7 @@
Density: 1
Position Offset: {x: 0, y: 0, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: false
IsActive: true
Scripts:
- Type: JumpPad
Enabled: true
@ -10664,6 +10705,7 @@
Canvas Component:
Canvas Width: 1920
Canvas Height: 1080
Scale by canvas width: false
IsActive: true
Scripts: ~
- EID: 8
@ -10687,6 +10729,8 @@
IsActive: true
UI Component:
Canvas ID: 10
Hovered: false
Clicked: false
IsActive: true
Scripts: ~
- EID: 0
@ -10710,6 +10754,8 @@
IsActive: true
UI Component:
Canvas ID: 10
Hovered: false
Clicked: false
IsActive: true
Scripts: ~
- EID: 461
@ -10733,5 +10779,7 @@
IsActive: true
UI Component:
Canvas ID: 10
Hovered: false
Clicked: false
IsActive: true
Scripts: ~

View File

@ -27,6 +27,12 @@ public class Item : Script
private bool checkSound = false;
public float soundDistance = 10;
private float highlightPos = 0.0f;
private Renderable rend;
public float highlightSpeed = 200.0f;
public float highlightThickness = 600.0f;
public float highlightLowerClamp = 0.25f;
protected override void awake()
{
@ -36,6 +42,10 @@ public class Item : Script
if(collider)
collider.GetCollisionShape(0).Density = density;
rend = GetComponent<Renderable>();
if (!rend)
Debug.Log("NO RENDERABLE");
returnBack = false;
AudioHandler.audioClipHandlers["SFXImpactElastic"] = Audio.CreateAudioClip("event:/Props/impact_elastic");
@ -49,6 +59,16 @@ public class Item : Script
protected override void update()
{
if (rend)
{
Vector3 dis = Camera.GetMainCamera().Position - transform.LocalPosition;
float disSqr = dis.GetSqrMagnitude();
float ratio = System.Math.Clamp(1 - (disSqr / (1 + disSqr)), highlightLowerClamp, 1.0f);
highlightPos += highlightSpeed * Time.DeltaTimeF * ratio;
rend.Material.SetProperty<float>("data.highlightPosition", highlightPos);
rend.Material.SetProperty<float>("data.thickness", highlightThickness);
}
if (returnBack && !dontReturn)
{
if(transform)

View File

@ -56,9 +56,9 @@ namespace SHADE_Scripting
arm.Pitch += vel.y * turnSpeedPitch * Time.DeltaTimeF;
if (inverseXControls)
arm.Yaw += vel.x * turnSpeedYaw * Time.DeltaTimeF;
else
arm.Yaw -= vel.x * turnSpeedYaw * Time.DeltaTimeF;
else
arm.Yaw += vel.x * turnSpeedYaw * Time.DeltaTimeF;
if (arm.Pitch > pitchUpperClamp)
{

View File

@ -7,6 +7,7 @@ struct MatPropData
{
int textureIndex;
float highlightPosition;
float thickness;
};
struct GenericData
@ -77,9 +78,9 @@ void main()
outEntityID = In2.eid;
lightLayerIndices = In2.lightLayerIndex;
float vpHeight = (float (In2.screenSpacePos.y) - (genericDataBuffer.data.elapsedTime * 4000.0f * (1.0f - In2.screenSpacePos.z)));
float vpHeight = float (In2.screenSpacePos.y) - MatProp.data[In2.materialIndex].highlightPosition;
vpHeight = float (int (vpHeight) % genericDataBuffer.data.viewportHeight);
float scanlineScale = 2500.0f * (1.0f - In2.screenSpacePos.z);
float scanlineScale = MatProp.data[In2.materialIndex].thickness * (1.0f - In2.screenSpacePos.z) * 100.0f;
float lowerLimit = vpHeight - scanlineScale;
float upperLimit = vpHeight + scanlineScale;

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
Name: TX_HouseInterior_Palette5
ID: 50821588
Type: 3

View File

@ -21,6 +21,7 @@
namespace SHADE
{
double SHFrameRateController::rawDeltaTime = 0.0;
double SHFrameRateController::elapsedTime = 0.0;
std::chrono::steady_clock::time_point SHFrameRateController::prevFrameTime = std::chrono::high_resolution_clock::now();
void SHFrameRateController::UpdateFRC() noexcept
@ -29,6 +30,7 @@ namespace SHADE
deltaTime = std::chrono::high_resolution_clock::now() - prevFrameTime;
prevFrameTime = std::chrono::high_resolution_clock::now();
rawDeltaTime = deltaTime.count();
elapsedTime += rawDeltaTime;
}
}

View File

@ -25,6 +25,8 @@ namespace SHADE
static double rawDeltaTime;
static std::chrono::steady_clock::time_point prevFrameTime;
static double elapsedTime;
public:
//Gets the raw delta time
@ -33,6 +35,11 @@ namespace SHADE
return rawDeltaTime;
}
static inline double GetElapsedTime() noexcept
{
return elapsedTime;
}
//Updates the raw delta time accordingly
static void UpdateFRC() noexcept;

View File

@ -30,6 +30,10 @@ namespace SHADE
return SHFrameRateController::GetRawDeltaTime();
}
double Time::ElapsedTime::get()
{
return SHFrameRateController::GetElapsedTime();
}
float Time::DeltaTimeF::get()
{

View File

@ -50,5 +50,12 @@ namespace SHADE
{
double get();
}
/// <summary>
/// Time elapsed since apllication started
/// </summary>
static property double ElapsedTime
{
double get();
}
};
}