-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b8c6f8e
commit 89d9e94
Showing
36 changed files
with
270 additions
and
50 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public struct DirectionalLight | ||
{ | ||
private static List<DirectionalLight> directionallights = new List<DirectionalLight>(); | ||
public Vector3 direction; | ||
public Vector3 color; | ||
public float intensity; | ||
public static void BuildDirectionalLightList(IEnumerable<Light> lights) | ||
{ | ||
Vector4 z = new Vector4(0, 0, 1, 0); | ||
foreach (var light in lights) | ||
{ | ||
DirectionalLight newlight = new DirectionalLight | ||
{ | ||
direction = light.transform.localToWorldMatrix * z, | ||
color = new Vector3(light.color.r, light.color.g, light.color.b), | ||
intensity = light.intensity | ||
}; | ||
directionallights.Add(newlight); | ||
} | ||
} | ||
public static void SetObjectToBuffer() | ||
{ | ||
ComputeBufferHelper.CreateComputeBuffer("_DirectionalLights", directionallights); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Assets/Script/Common/GeometricObjects/DirectionalLight.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef DIRECTIONALLIGHT | ||
#define DIRECTIONALLIGHT | ||
#include "Utilitie.compute" | ||
struct DirectionalLight | ||
{ | ||
float3 direction; | ||
float3 color; | ||
float intensity; | ||
static void Init() | ||
{ | ||
|
||
} | ||
void Hit(Ray ray, inout RayHit bestHit) | ||
{ | ||
|
||
} | ||
float3 GetDirection(float3 eyeposition) | ||
{ | ||
return -direction; | ||
} | ||
float GetHitTime(Ray ray) | ||
{ | ||
return 1.#INF; | ||
} | ||
}; | ||
#endif |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.