improve shadow process, now shadow can render according to the camera position

This commit is contained in:
2026-04-07 13:20:02 +08:00
parent 3c64abd77e
commit 230957f728
5 changed files with 309 additions and 274 deletions

View File

@ -1,22 +1,58 @@
Scene: Scene Name
Environment:
AssetHandle: 5211537204242875091
AssetHandle: 10745193190519058183
Entities:
- Entity: 8293051279669100759
- Entity: 4944419254382500800
Parent: 0
Children:
[]
TagComponent:
Tag: Directional Light
TransformComponent:
Position: [0, 0, 0]
Rotation: [-2.2312348, 0, 0]
Scale: [1, 1, 1]
DirectionalLightComponent:
Radiance: [1, 1, 1]
CastShadows: true
SoftShadows: true
LightSize: 0.5
- Entity: 5099152432245948441
Parent: 0
Children:
[]
TagComponent:
Tag: venice_dawn_1_4k
TransformComponent:
Position: [0, 0, 0]
Rotation: [0, 0, 0]
Scale: [1, 1, 1]
SkyLightComponent:
EnvironmentMap: 10745193190519058183
EnvironmentAssetPath: assets/env/venice_dawn_1_4k.hdr
Intensity: 1
Angle: 0
DynamicSky: false
TurbidityAzimuthInclination: [2, 0, 0]
- Entity: 10732070446010033158
Parent: 0
Children:
[]
TagComponent:
Tag: Cube
TransformComponent:
Position: [1.736814, 1.4724115, -4.2181306]
Position: [0, -2.6466873, 0]
Rotation: [0, 0, 0]
Scale: [1, 1, 1]
Scale: [100, 1, 100]
MeshComponent:
AssetID: 18328012085543462741
AssetID: 14957733959243172548
AssetPath: assets/meshes/Default/Cube.fbx
Materials:
Slot 0:
AssetHandle: 0
AssetPath: ""
RigidBodyComponent:
BodyType: 1
BodyType: 0
Mass: 1
LinearDrag: 0
AngularDrag: 0.05
@ -36,19 +72,50 @@ Entities:
IsTrigger: false
Material: 0
MaterialPath: ""
- Entity: 5834225236589765516
- Entity: 9267298328378270409
Parent: 0
Children:
[]
TagComponent:
Tag: Cube
Tag: Player
TransformComponent:
Position: [-2.6417403, 1.4724115, -7.9285727]
Rotation: [0.52199936, 0, 0]
Scale: [1, 1.0000001, 1.0000001]
Position: [0, 0.70693016, 0]
Rotation: [0, 0, 0]
Scale: [1, 1, 1]
ScriptComponent:
ModuleName: FPSExample.FPSPlayer
StoredFields:
- Name: m_Radius
Type: 1
Data: 0
- Name: WalkingSpeed
Type: 1
Data: 2
- Name: RunSpeed
Type: 1
Data: 5
- Name: JumpForce
Type: 1
Data: 1
- Name: TorqueStrength
Type: 1
Data: 0
- Name: MouseSensitivity
Type: 1
Data: 10
- Name: CameraForwardOffset
Type: 1
Data: -2
- Name: CameraYOffset
Type: 1
Data: 2
MeshComponent:
AssetID: 18328012085543462741
AssetPath: assets/meshes/Default/Cube.fbx
AssetID: 8763440120556133680
AssetPath: assets/meshes/Default/Capsule.fbx
Materials:
Slot 0:
AssetHandle: 0
AssetPath: ""
RigidBodyComponent:
BodyType: 1
Mass: 1
@ -57,6 +124,64 @@ Entities:
DisableGravity: false
IsKinematic: false
Layer: 0
Constraints:
LockPositionX: false
LockPositionY: false
LockPositionZ: false
LockRotationX: true
LockRotationY: false
LockRotationZ: true
MeshColliderComponent:
IsConvex: true
IsTrigger: false
OverrideMesh: false
Material: 0
MaterialPath: ""
- Entity: 8114736924719261351
Parent: 0
Children:
[]
TagComponent:
Tag: Camera
TransformComponent:
Position: [0, 0.8097433, 4.573171]
Rotation: [0, 0, 0]
Scale: [1, 1, 1]
CameraComponent:
Camera:
ProjectionType: 0
PerspectiveFOV: 45
PerspectiveNear: 0.01
PerspectiveFar: 10000
OrthographicSize: 10
OrthographicNear: -1
OrthographicFar: 1
Primary: true
- Entity: 4208267561919679628
Parent: 0
Children:
[]
TagComponent:
Tag: Cube
TransformComponent:
Position: [-2.6417403, 1.4724115, -4.8956265]
Rotation: [-0.4034239, 0, 0]
Scale: [1, 0.99999994, 0.99999994]
MeshComponent:
AssetID: 14957733959243172548
AssetPath: assets/meshes/Default/Cube.fbx
Materials:
Slot 0:
AssetHandle: 0
AssetPath: ""
RigidBodyComponent:
BodyType: 1
Mass: 1
LinearDrag: 0
AngularDrag: 0.05
DisableGravity: true
IsKinematic: false
Layer: 0
Constraints:
LockPositionX: false
LockPositionY: false
@ -70,19 +195,23 @@ Entities:
IsTrigger: false
Material: 0
MaterialPath: ""
- Entity: 8234256119181302872
- Entity: 3328246672296261054
Parent: 0
Children:
[]
TagComponent:
Tag: Cube
TransformComponent:
Position: [1.736814, 1.4724115, -7.9285727]
Position: [1.736814, 1.4724115, -0.88378817]
Rotation: [0, 0, 0]
Scale: [1, 1, 1]
MeshComponent:
AssetID: 18328012085543462741
AssetID: 14957733959243172548
AssetPath: assets/meshes/Default/Cube.fbx
Materials:
Slot 0:
AssetHandle: 0
AssetPath: ""
RigidBodyComponent:
BodyType: 1
Mass: 1
@ -115,8 +244,12 @@ Entities:
Rotation: [0, 0, 0]
Scale: [1, 1, 1]
MeshComponent:
AssetID: 18328012085543462741
AssetID: 14957733959243172548
AssetPath: assets/meshes/Default/Cube.fbx
Materials:
Slot 0:
AssetHandle: 0
AssetPath: ""
RigidBodyComponent:
BodyType: 1
Mass: 1
@ -138,19 +271,23 @@ Entities:
IsTrigger: false
Material: 0
MaterialPath: ""
- Entity: 3328246672296261054
- Entity: 8234256119181302872
Parent: 0
Children:
[]
TagComponent:
Tag: Cube
TransformComponent:
Position: [1.736814, 1.4724115, -0.88378817]
Position: [1.736814, 1.4724115, -7.9285727]
Rotation: [0, 0, 0]
Scale: [1, 1, 1]
MeshComponent:
AssetID: 18328012085543462741
AssetID: 14957733959243172548
AssetPath: assets/meshes/Default/Cube.fbx
Materials:
Slot 0:
AssetHandle: 0
AssetPath: ""
RigidBodyComponent:
BodyType: 1
Mass: 1
@ -172,25 +309,29 @@ Entities:
IsTrigger: false
Material: 0
MaterialPath: ""
- Entity: 4208267561919679628
- Entity: 5834225236589765516
Parent: 0
Children:
[]
TagComponent:
Tag: Cube
TransformComponent:
Position: [-2.6417403, 1.4724115, -4.8956265]
Rotation: [-0.4034239, 0, 0]
Scale: [1, 0.99999994, 0.99999994]
Position: [-2.6417403, 1.4724115, -7.9285727]
Rotation: [0.52199936, 0, 0]
Scale: [1, 1.0000001, 1.0000001]
MeshComponent:
AssetID: 18328012085543462741
AssetID: 14957733959243172548
AssetPath: assets/meshes/Default/Cube.fbx
Materials:
Slot 0:
AssetHandle: 0
AssetPath: ""
RigidBodyComponent:
BodyType: 1
Mass: 1
LinearDrag: 0
AngularDrag: 0.05
DisableGravity: true
DisableGravity: false
IsKinematic: false
Layer: 0
Constraints:
@ -206,96 +347,25 @@ Entities:
IsTrigger: false
Material: 0
MaterialPath: ""
- Entity: 8114736924719261351
Parent: 0
Children:
[]
TagComponent:
Tag: Camera
TransformComponent:
Position: [0, 0.8097433, 4.573171]
Rotation: [0, 0, 0]
Scale: [1, 1, 1]
CameraComponent:
Camera:
ProjectionType: 0
PerspectiveFOV: 45
PerspectiveNear: 0.01
PerspectiveFar: 10000
OrthographicSize: 10
OrthographicNear: -1
OrthographicFar: 1
Primary: true
- Entity: 9267298328378270409
Parent: 0
Children:
[]
TagComponent:
Tag: Player
TransformComponent:
Position: [0, 0.70693016, 0]
Rotation: [0, 0, 0]
Scale: [1, 1, 1]
ScriptComponent:
ModuleName: FPSExample.FPSPlayer
StoredFields:
- Name: WalkingSpeed
Type: 1
Data: 2
- Name: RunSpeed
Type: 1
Data: 5
- Name: JumpForce
Type: 1
Data: 1
- Name: MouseSensitivity
Type: 1
Data: 10
- Name: CameraForwardOffset
Type: 1
Data: -2
- Name: CameraYOffset
Type: 1
Data: 2
MeshComponent:
AssetID: 3043502408333723884
AssetPath: assets/meshes/Default/Capsule.fbx
RigidBodyComponent:
BodyType: 1
Mass: 1
LinearDrag: 0
AngularDrag: 0.05
DisableGravity: false
IsKinematic: false
Layer: 0
Constraints:
LockPositionX: false
LockPositionY: false
LockPositionZ: false
LockRotationX: true
LockRotationY: false
LockRotationZ: true
MeshColliderComponent:
IsConvex: true
IsTrigger: false
OverrideMesh: false
Material: 0
MaterialPath: ""
- Entity: 10732070446010033158
- Entity: 8293051279669100759
Parent: 0
Children:
[]
TagComponent:
Tag: Cube
TransformComponent:
Position: [0, -2.6466873, 0]
Position: [1.736814, 1.4724115, -4.2181306]
Rotation: [0, 0, 0]
Scale: [100, 1, 100]
Scale: [1, 1, 1]
MeshComponent:
AssetID: 18328012085543462741
AssetID: 14957733959243172548
AssetPath: assets/meshes/Default/Cube.fbx
Materials:
Slot 0:
AssetHandle: 0
AssetPath: ""
RigidBodyComponent:
BodyType: 0
BodyType: 1
Mass: 1
LinearDrag: 0
AngularDrag: 0.05
@ -315,22 +385,5 @@ Entities:
IsTrigger: false
Material: 0
MaterialPath: ""
- Entity: 5099152432245948441
Parent: 0
Children:
[]
TagComponent:
Tag: venice_dawn_1_4k
TransformComponent:
Position: [0, 0, 0]
Rotation: [0, 0, 0]
Scale: [1, 1, 1]
SkyLightComponent:
EnvironmentMap: 5211537204242875091
EnvironmentAssetPath: assets/env/venice_dawn_1_4k.hdr
Intensity: 1
Angle: 0
DynamicSky: false
TurbidityAzimuthInclination: [2, 0, 0]
PhysicsLayers:
[]