*
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 692446ebfc8bf4745ad1f5c2e34061b3
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,44 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class CircleSurface : OpticalSurface2D
|
||||
{
|
||||
|
||||
public float Radius;
|
||||
public int ViewSamples = 15;
|
||||
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void OnValidate() {
|
||||
Shape = PointsToLines(GetGeometry(), true);
|
||||
}
|
||||
|
||||
private Vector2[] GetGeometry() {
|
||||
Vector2[] result = new Vector2[ViewSamples];
|
||||
float da = Mathf.PI * 2 / ViewSamples;
|
||||
for (int i = 0; i < ViewSamples; i++) {
|
||||
float angle = da * i;
|
||||
result[i] = new Vector2(Mathf.Cos(angle) * Radius, Mathf.Sin(angle) * Radius);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public override bool Raycast(Ray2D ray, ref RaycastMath.RaycastResult2D result) {
|
||||
var localSpaceRay = new Ray2D( transform.InverseTransformPoint(ray.origin), transform.InverseTransformVector(ray.direction).normalized);
|
||||
if (RaycastMath.RaycastCircle(localSpaceRay, Radius, ref result)) {
|
||||
result.Point = transform.TransformPoint(result.Point);
|
||||
result.Normal = transform.worldToLocalMatrix.MultiplyVector(result.Normal).normalized;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ae0b3433277d89248a6658e589b07b2e
|
||||
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public abstract class OpticalSurface2D : MonoBehaviour
|
||||
{
|
||||
[Serializable]
|
||||
public struct Line {
|
||||
public Vector2 P1;
|
||||
public Vector2 P2;
|
||||
}
|
||||
|
||||
public Line[] Shape;
|
||||
|
||||
|
||||
|
||||
public abstract bool Raycast(Ray2D ray, ref RaycastMath.RaycastResult2D result);
|
||||
|
||||
public static Line[] PointsToLines(Vector2[] points, bool closed) {
|
||||
Line[] result = new Line[points.Length - (closed ? 0 : 1)];
|
||||
|
||||
for (int i = 0; i < points.Length - 1; i++) {
|
||||
result[i] = new Line() { P1 = points[i], P2 = points[i + 1] };
|
||||
}
|
||||
|
||||
if (closed) {
|
||||
result[result.Length - 1] = new Line() { P1 = result[result.Length - 2].P2, P2 = result[0].P1 };
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private void OnDrawGizmos() {
|
||||
if (Shape == null) return;
|
||||
if (Shape.Length < 1) return;
|
||||
|
||||
Gizmos.matrix = transform.localToWorldMatrix;
|
||||
for (int i = 0; i < Shape.Length; i++) {
|
||||
|
||||
Gizmos.DrawLine(Shape[i].P1, Shape[i].P2);
|
||||
}
|
||||
Gizmos.matrix = Matrix4x4.identity;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2f6f4ffaf4e813543831f8b6fb081aef
|
||||
@@ -0,0 +1,162 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
public class PlanoConvexLens : OpticalSurface2D
|
||||
{
|
||||
public float LensRadius = 1.0f;
|
||||
public float CurveRadius = 1.0f;
|
||||
public int SamplesCount = 10;
|
||||
public float Height = 0.1f;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private RaycastMath.RaycastResult2D[] _raycasts;
|
||||
|
||||
public override bool Raycast(Ray2D ray, ref RaycastMath.RaycastResult2D result) {
|
||||
if(_raycasts == null) {
|
||||
_raycasts = new RaycastMath.RaycastResult2D[4];
|
||||
}
|
||||
|
||||
var localSpaceRay = ray;
|
||||
localSpaceRay.origin = transform.InverseTransformPoint(localSpaceRay.origin);
|
||||
localSpaceRay.direction = transform.InverseTransformVector(localSpaceRay.direction).normalized;
|
||||
|
||||
//cs = as + bs
|
||||
//bs = cs - as
|
||||
|
||||
|
||||
float h = Mathf.Sqrt(CurveRadius * CurveRadius - LensRadius * LensRadius);
|
||||
|
||||
|
||||
var sphereCastRay = localSpaceRay;
|
||||
sphereCastRay.origin += Vector2.up * (Mathf.Sign(CurveRadius) * h - Height);
|
||||
|
||||
int raycastsCount = 0;
|
||||
|
||||
bool curveIntersected = RaycastMath.RaycastCircle(sphereCastRay, Mathf.Abs( CurveRadius), ref _raycasts[raycastsCount]);
|
||||
if (curveIntersected) {
|
||||
_raycasts[raycastsCount].Point += Vector2.down * Mathf.Sign(CurveRadius) * (h);
|
||||
|
||||
if(CurveRadius >= 0) {
|
||||
if (_raycasts[raycastsCount].Point.y < 0) {
|
||||
curveIntersected = false;
|
||||
} else {
|
||||
_raycasts[raycastsCount].Point += Vector2.up * Height;
|
||||
raycastsCount++;
|
||||
}
|
||||
} else {
|
||||
if (_raycasts[raycastsCount].Point.y > 0) {
|
||||
curveIntersected = false;
|
||||
} else {
|
||||
_raycasts[raycastsCount].Point += Vector2.up * Height;
|
||||
_raycasts[raycastsCount].Normal = -_raycasts[raycastsCount].Normal;
|
||||
raycastsCount++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Vector2 leftHitPoint = Vector2.zero;
|
||||
if(Height > 0.0f && RaycastMath.RayLineSegmentIntersection(localSpaceRay.origin, localSpaceRay.direction, new Vector2(-LensRadius, 0), new Vector2(-LensRadius, Height), ref leftHitPoint)) {
|
||||
_raycasts[raycastsCount].Normal = Vector2.left;
|
||||
_raycasts[raycastsCount].Point = leftHitPoint;
|
||||
raycastsCount++;
|
||||
}
|
||||
|
||||
Vector2 rightHitPoint = Vector2.zero;
|
||||
if(Height > 0.0f && RaycastMath.RayLineSegmentIntersection(localSpaceRay.origin, localSpaceRay.direction, new Vector2(LensRadius, 0), new Vector2(LensRadius, Height), ref rightHitPoint)) {
|
||||
_raycasts[raycastsCount].Normal = Vector2.right;
|
||||
_raycasts[raycastsCount].Point = rightHitPoint;
|
||||
raycastsCount++;
|
||||
}
|
||||
|
||||
Vector2 bottomHitPoint = Vector2.zero;
|
||||
if(LensRadius > 0.0f && RaycastMath.RayLineSegmentIntersection(localSpaceRay.origin, localSpaceRay.direction, new Vector2(-LensRadius, 0), new Vector2(LensRadius, 0), ref bottomHitPoint)) {
|
||||
_raycasts[raycastsCount].Normal = Vector2.down;
|
||||
_raycasts[raycastsCount].Point = bottomHitPoint;
|
||||
raycastsCount++;
|
||||
}
|
||||
|
||||
|
||||
if(raycastsCount == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
result = _raycasts.Take(raycastsCount).OrderBy(x => Vector2.Distance(x.Point, localSpaceRay.origin)).First();
|
||||
|
||||
result.Point = transform.TransformPoint(result.Point);
|
||||
result.Normal = transform.InverseTransformVector(result.Normal).normalized;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void OnValidate() {
|
||||
|
||||
if(CurveRadius > 0 && CurveRadius < LensRadius) {
|
||||
CurveRadius = LensRadius;
|
||||
}
|
||||
|
||||
if (CurveRadius < 0 && CurveRadius > -LensRadius) {
|
||||
CurveRadius = -LensRadius;
|
||||
}
|
||||
|
||||
var points = RadialCurve(LensRadius, CurveRadius, SamplesCount);
|
||||
if(points.Length < 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
Shape = new Line[points.Length - 1 + 3];
|
||||
|
||||
for(int i = 0; i < points.Length - 1; i++) {
|
||||
Shape[i] = new Line() { P1 = points[i] + Vector2.up * Height, P2 = points[i + 1] + Vector2.up * Height };
|
||||
}
|
||||
|
||||
Vector2 p1 = new Vector2(-LensRadius, Height);
|
||||
Vector2 p2 = new Vector2(-LensRadius, 0);
|
||||
Vector2 p3 = new Vector2(LensRadius, 0);
|
||||
Vector2 p4 = new Vector2(LensRadius, Height);
|
||||
|
||||
Shape[Shape.Length - 3] = new Line() { P1 = p1, P2 = p2 };
|
||||
Shape[Shape.Length - 2] = new Line() { P1 = p2, P2 = p3 };
|
||||
Shape[Shape.Length - 1] = new Line() { P1 = p3, P2 = p4 };
|
||||
}
|
||||
|
||||
|
||||
public static Vector2[] RadialCurve(float lenseRadius, float curveRadius, int samplesCount) {
|
||||
|
||||
|
||||
//r*r = x*x + h*h
|
||||
//h*h = r*r - x*x
|
||||
|
||||
Vector2[] result = new Vector2[samplesCount];
|
||||
|
||||
float h = Mathf.Sqrt(curveRadius * curveRadius - lenseRadius * lenseRadius);
|
||||
|
||||
float dx = (-2.0f * lenseRadius) / (samplesCount - 1);
|
||||
|
||||
for (int i = 0; i < samplesCount; i++) {
|
||||
float x2 = lenseRadius + dx * i;
|
||||
float h2 = Mathf.Sqrt(curveRadius * curveRadius - x2 * x2);
|
||||
|
||||
|
||||
result[i] = new Vector2(x2, Mathf.Sign(curveRadius) * (h2 - h));
|
||||
|
||||
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d9a5a27b20e512840a47158afe4a4e7f
|
||||
@@ -0,0 +1,67 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class PointLight : MonoBehaviour
|
||||
{
|
||||
public int SamplesCount = 5;
|
||||
public float Angle = 45.0f;
|
||||
|
||||
|
||||
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public Ray2D[] GetRays() {
|
||||
float angleRad = Mathf.Deg2Rad * Angle;
|
||||
float halfAngleRad = angleRad / 2.0f;
|
||||
|
||||
if(SamplesCount == 1) {
|
||||
halfAngleRad = 0;
|
||||
}
|
||||
|
||||
float startAngle = 2.5f * Mathf.PI - halfAngleRad;
|
||||
float endAngle = 2.5f * Mathf.PI + halfAngleRad;
|
||||
|
||||
Ray2D[] result = new Ray2D[SamplesCount];
|
||||
|
||||
float step = angleRad / (SamplesCount - 1);
|
||||
|
||||
if (SamplesCount > 1) {
|
||||
for (int i = 0; i < SamplesCount; i++) {
|
||||
float a = startAngle + step * i;
|
||||
result[i] = new Ray2D(transform.position, transform.TransformVector(new Vector3(Mathf.Cos(a), Mathf.Sin(a), 0.0f)).normalized);
|
||||
}
|
||||
} else {
|
||||
result[0] = new Ray2D(transform.position, transform.TransformVector( new Vector3(Mathf.Cos(startAngle), Mathf.Sin(startAngle), 0.0f)).normalized);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public bool DrawGizmo = true;
|
||||
private void OnDrawGizmos() {
|
||||
if (!DrawGizmo) {
|
||||
return;
|
||||
}
|
||||
var rays = GetRays();
|
||||
|
||||
foreach (var ray in rays) {
|
||||
Gizmos.DrawLine(ray.origin, ray.origin + ray.direction * 0.5f);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d1f035f4ba278b7419c3b3565780f203
|
||||
@@ -0,0 +1,82 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using static OpticalSurface2D;
|
||||
|
||||
public class RaycastMath
|
||||
{
|
||||
public struct RaycastResult2D {
|
||||
public Vector2 Point;
|
||||
public Vector2 Normal;
|
||||
}
|
||||
|
||||
public static bool RaycastCircle(Ray2D ray, float radius, ref RaycastResult2D result) {
|
||||
var vToCircleCenter = Vector2.zero - ray.origin;
|
||||
|
||||
bool isInsideCircle = vToCircleCenter.magnitude < radius;
|
||||
|
||||
var d = Vector2.Dot(vToCircleCenter, ray.direction.normalized);
|
||||
|
||||
|
||||
if(d < 0 && ray.origin.magnitude > radius) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var p = ray.origin + ray.direction.normalized * d;
|
||||
|
||||
var v = Vector2.zero - p;
|
||||
|
||||
var rayCenterDistance = v.magnitude;
|
||||
if (rayCenterDistance > radius) {
|
||||
return false;
|
||||
} else if (rayCenterDistance == radius) {
|
||||
result.Point = p;
|
||||
result.Normal = p.normalized;
|
||||
} else {
|
||||
|
||||
float m = Mathf.Sqrt(radius * radius - rayCenterDistance * rayCenterDistance);
|
||||
|
||||
if (isInsideCircle) {
|
||||
result.Point = p + ray.direction.normalized * m;
|
||||
result.Normal = result.Point.normalized;
|
||||
} else {
|
||||
result.Point = p - ray.direction.normalized * m;
|
||||
result.Normal = result.Point.normalized;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public static bool RayLineIntersection(Vector2 rayOrigin, Vector2 rayDirection, Vector2 lineOrigin, Vector2 lineDirection, ref Vector2 hitPoint) {
|
||||
Vector2 rayTangent = new Vector2(-rayDirection.y, rayDirection.x);
|
||||
|
||||
float distanceToLine = Vector2.Dot(lineOrigin - rayOrigin, rayTangent);
|
||||
float origin2ExtensionDistance = distanceToLine / Vector2.Dot(-rayTangent, lineDirection);
|
||||
hitPoint = origin2ExtensionDistance * lineDirection + lineOrigin;
|
||||
|
||||
return Vector2.Dot(hitPoint - rayOrigin, rayDirection) > 0.0f;
|
||||
}
|
||||
|
||||
public static bool RayLineSegmentIntersection(Vector2 rayOrigin, Vector2 rayDirection, Vector2 lineOrigin, Vector2 lineP2, ref Vector2 hitPoint) {
|
||||
Vector2 rayTangent = new Vector2(-rayDirection.y, rayDirection.x);
|
||||
|
||||
Vector2 lineDirection = lineP2 - lineOrigin;
|
||||
|
||||
|
||||
float distanceToLine = Vector2.Dot(lineOrigin - rayOrigin, rayTangent);
|
||||
float origin2ExtensionDistance = distanceToLine / Vector2.Dot(-rayTangent, lineDirection);
|
||||
hitPoint = origin2ExtensionDistance * lineDirection + lineOrigin;
|
||||
|
||||
if (Vector2.Dot(hitPoint - rayOrigin, rayDirection) < 0.0f) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var d = Vector2.Dot(hitPoint - lineOrigin, lineDirection.normalized);
|
||||
if (d < 0.0f || d > lineDirection.magnitude) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 70197946adeea59448794e3fdf65586d
|
||||
@@ -0,0 +1,225 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.Windows;
|
||||
|
||||
public class Raytracer2D : MonoBehaviour
|
||||
{
|
||||
|
||||
public PointLight Light;
|
||||
public OpticalSurface2D[] Surfaces;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bool NearestIntersection(Vector2 rayOrigin, Vector2 rayDir, OpticalSurface2D.Line[] lines, int excludeLineIndex, ref int lineIndex, ref Vector2 intersectionPoint) {
|
||||
Dictionary<int, Vector2> intersections = new Dictionary<int, Vector2>();
|
||||
Vector2 hitPoint = new Vector2();
|
||||
for (int i = 0; i < lines.Length; i++) {
|
||||
if(i != excludeLineIndex) {
|
||||
var l = lines[i];
|
||||
if (RaycastMath.RayLineSegmentIntersection(rayOrigin, rayDir, l.P1, l.P2, ref hitPoint)) {
|
||||
intersections.Add(i, hitPoint);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(intersections.Count == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var result = intersections.OrderBy(x => Vector2.Distance(rayOrigin, x.Value)).First();
|
||||
lineIndex = result.Key;
|
||||
intersectionPoint = result.Value;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Vector2 Perpendicular(Vector2 vector) {
|
||||
return new Vector2(vector.y, -vector.x);
|
||||
}
|
||||
|
||||
Vector2 Reflect(Vector2 vector, Vector2 reflectionVector) {
|
||||
var l = Vector2.Dot(reflectionVector, vector );
|
||||
var p = reflectionVector * l;
|
||||
var p2 = p - vector;
|
||||
return p + p2;
|
||||
|
||||
}
|
||||
|
||||
bool Refract(Vector2 incident, Vector2 normal, float n1, float n2, out Vector2 result) {
|
||||
|
||||
//Snell's law: n1*sin(theta1) = n2*sin(theta2)
|
||||
|
||||
//n1/n2 = sin(theta2) / sin(theta1)
|
||||
|
||||
|
||||
//ior = sin(theta2) / sin(theta1)
|
||||
//sin(theta2) = ior * sin(theta1)
|
||||
|
||||
|
||||
float cosTheta1 = Vector2.Dot(incident, normal);
|
||||
|
||||
if(cosTheta1 < 0) {
|
||||
cosTheta1 = -cosTheta1;
|
||||
} else {
|
||||
|
||||
normal = -normal;
|
||||
var tmp = n1;
|
||||
n1 = n2; n2 = tmp;
|
||||
}
|
||||
float ior = n1 / n2;
|
||||
|
||||
|
||||
float sinTheta1Squared = 1.0f - (cosTheta1 * cosTheta1);
|
||||
float sinTheta2Squared = (ior * ior) * sinTheta1Squared;
|
||||
float cosTheta2Squared = 1.0f - sinTheta2Squared;
|
||||
|
||||
if(cosTheta2Squared < 0.0f) {
|
||||
result = Vector2.zero;
|
||||
|
||||
return false; //total internal reflection
|
||||
}
|
||||
|
||||
|
||||
float cosTheta2 = Mathf.Sqrt(cosTheta2Squared);
|
||||
|
||||
float s = cosTheta1 * ior - cosTheta2;
|
||||
|
||||
|
||||
result.x = ior * incident.x + s * normal.x;
|
||||
result.y = ior * incident.y + s * normal.y;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public int MaxTraceDepth = 2;
|
||||
|
||||
|
||||
private bool NearestRaycast(Ray2D ray, ref RaycastMath.RaycastResult2D result) {
|
||||
|
||||
int id = 0;
|
||||
foreach (var surface in Surfaces) {
|
||||
RaycastMath.RaycastResult2D raycast = new RaycastMath.RaycastResult2D();
|
||||
if (surface.Raycast(ray, ref raycast)) {
|
||||
if(id == 0) {
|
||||
result = raycast;
|
||||
} else {
|
||||
if(Vector2.Distance(ray.origin, raycast.Point) < Vector2.Distance(ray.origin, result.Point)) {
|
||||
result = raycast;
|
||||
}
|
||||
}
|
||||
id++;
|
||||
}
|
||||
}
|
||||
return id > 0;
|
||||
}
|
||||
|
||||
private void TraceRay(Ray2D ray, int depth, float n1, float n2, List<Ray2D> result) {
|
||||
if(depth >= MaxTraceDepth) {
|
||||
return;
|
||||
}
|
||||
|
||||
RaycastMath.RaycastResult2D cast = new RaycastMath.RaycastResult2D();
|
||||
if (NearestRaycast(ray, ref cast)) {
|
||||
|
||||
|
||||
// Gizmos.color = Color.blue;
|
||||
//Gizmos.DrawLine(cast.Point, cast.Point + cast.Normal * 0.5f);
|
||||
|
||||
|
||||
bool fromOutside = Vector2.Dot(cast.Normal, ray.direction) < 0.0f;
|
||||
|
||||
Vector2 offset = cast.Normal * 0.0001f;
|
||||
|
||||
|
||||
if (Refract(ray.direction.normalized, cast.Normal, n1, n2, out var refractedRay)) {
|
||||
|
||||
if (fromOutside) {
|
||||
offset = -offset;
|
||||
}
|
||||
|
||||
result.Add(new Ray2D(cast.Point, refractedRay.normalized));
|
||||
TraceRay(new Ray2D(cast.Point + offset, refractedRay.normalized), depth + 1, n1, n2, result);
|
||||
} else {
|
||||
var reflectionVector = Reflect(ray.direction.normalized, Perpendicular(cast.Normal));
|
||||
|
||||
//Total internal reflection
|
||||
result.Add(new Ray2D(cast.Point, reflectionVector));
|
||||
TraceRay(new Ray2D(cast.Point - offset, reflectionVector), depth + 1, n1, n2, result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private List<Vector2> Trace() {
|
||||
List<Vector2> result = new List<Vector2>();
|
||||
|
||||
var lightRays = Light.GetRays();
|
||||
// var lines = Surface.GetTransformedShape();
|
||||
|
||||
|
||||
foreach (var ray in lightRays) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
List<Ray2D> rayIntersections = new List<Ray2D>();
|
||||
rayIntersections.Add(ray);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
TraceRay(ray, 0, 1.0f, 1.5f, rayIntersections);
|
||||
|
||||
|
||||
|
||||
for(int i = 0; i < rayIntersections.Count - 1; ++i) {
|
||||
|
||||
if(i % 2 == 0) {
|
||||
Gizmos.color = Color.white;
|
||||
}
|
||||
else {
|
||||
Gizmos.color = Color.red;
|
||||
}
|
||||
|
||||
|
||||
Gizmos.DrawLine(rayIntersections[i].origin, rayIntersections[i + 1].origin);
|
||||
|
||||
|
||||
}
|
||||
|
||||
Gizmos.color = Color.yellow;
|
||||
Gizmos.DrawLine(rayIntersections[rayIntersections.Count-1].origin, rayIntersections[rayIntersections.Count-1].origin + rayIntersections[rayIntersections.Count - 1].direction * 100);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private void OnDrawGizmos() {
|
||||
Trace();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a7f3a1f22cffa8e43b8cbc5cd243101a
|
||||
@@ -0,0 +1,79 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
public class SellmeierEquatiionView : MonoBehaviour
|
||||
{
|
||||
|
||||
private SellmeierEquation _equation;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
private float[] SamplePlot(SellmeierEquation equation) {
|
||||
int samplesCount = 30;
|
||||
|
||||
float startLength = 0.3f;
|
||||
float endLength = 0.6f;
|
||||
|
||||
|
||||
float[] result = new float[samplesCount];
|
||||
|
||||
for (int i = 0; i < samplesCount; i++) {
|
||||
|
||||
if(i > 0) {
|
||||
float step = ((endLength - startLength) / (samplesCount - 1));
|
||||
result[i] = equation.Calc(startLength + step * i);
|
||||
} else {
|
||||
result[i] = equation.Calc(startLength);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private void OnDrawGizmos() {
|
||||
if (_equation == null) {
|
||||
var coeffs = new SellmeierEquation.Coefficients(
|
||||
new float[] { 0.99654f, 0.18964f, 0.00411f },
|
||||
new float[] { 0.00787f, 0.02191f, 3.85727f });
|
||||
_equation = new SellmeierEquation(coeffs);
|
||||
}
|
||||
|
||||
var samples = SamplePlot(_equation);
|
||||
|
||||
float minValue = samples.Min();
|
||||
float maxValue = samples.Max();
|
||||
|
||||
|
||||
float n365 = _equation.Calc(0.365f);
|
||||
float n395 = _equation.Calc(0.395f);
|
||||
float n405 = _equation.Calc(0.405f);
|
||||
|
||||
Debug.Log($"n365 = {n365}, n395 = {n395}, n405 = {n405}");
|
||||
|
||||
for (int i = 0; i < samples.Length - 1; i++) {
|
||||
var n1 = samples[i];
|
||||
var n2 = samples[i + 1];
|
||||
|
||||
float n1Scaled = (n1 - minValue) / (maxValue - minValue);
|
||||
float n2Scaled = (n2 - minValue) / (maxValue - minValue);
|
||||
|
||||
Gizmos.DrawLine(transform.position + Vector3.right * (i / (float)samples.Length) + Vector3.up * n1Scaled, transform.position + Vector3.right * ((i + 1) / (float)samples.Length) + Vector3.up * n2Scaled);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f017d192c43f1284c86c136425fcadb1
|
||||
@@ -0,0 +1,52 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class SellmeierEquation
|
||||
{
|
||||
public class Coefficients {
|
||||
public float[] B { get; private set; }
|
||||
public float[] C { get; private set; }
|
||||
|
||||
public Coefficients(float[] b, float[] c) {
|
||||
B = b;
|
||||
C = c;
|
||||
|
||||
if (b == null || c == null) {
|
||||
throw new System.Exception("Invalid args");
|
||||
}
|
||||
|
||||
if (b.Length == 0 || c.Length == 0) {
|
||||
throw new System.Exception("Invalid args");
|
||||
}
|
||||
|
||||
if (b.Length != c.Length) {
|
||||
throw new System.Exception("Invalid args");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Coefficients _coeffs;
|
||||
|
||||
public SellmeierEquation(Coefficients coeffs) {
|
||||
_coeffs = coeffs;
|
||||
}
|
||||
|
||||
public float Calc(float wavelength) {
|
||||
return Calc(_coeffs, wavelength);
|
||||
}
|
||||
|
||||
public static float Calc(Coefficients coeffs, float wavelength) {
|
||||
float lSquare = wavelength * wavelength;
|
||||
float resultSquared = 1.0f;
|
||||
|
||||
for (int i = 0; i < coeffs.B.Length; i++) {
|
||||
float bi = coeffs.B[i];
|
||||
float ci = coeffs.C[i];
|
||||
resultSquared += (bi * lSquare) / (lSquare - ci);
|
||||
}
|
||||
|
||||
return Mathf.Sqrt(resultSquared);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 90cb99ed8fefa8f4fba3c961a71fbe15
|
||||
@@ -0,0 +1,722 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 10
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 0
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0.18028378, g: 0.22571412, b: 0.30692285, a: 1}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 12
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 0
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 12
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_AtlasSize: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_ExtractAmbientOcclusion: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 2
|
||||
m_BakeBackend: 1
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 500
|
||||
m_PVRBounces: 2
|
||||
m_PVREnvironmentSampleCount: 500
|
||||
m_PVREnvironmentReferencePointCount: 2048
|
||||
m_PVRFilteringMode: 2
|
||||
m_PVRDenoiserTypeDirect: 0
|
||||
m_PVRDenoiserTypeIndirect: 0
|
||||
m_PVRDenoiserTypeAO: 0
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVREnvironmentMIS: 0
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_ExportTrainingData: 0
|
||||
m_TrainingDataDestination: TrainingData
|
||||
m_LightProbeSampleCountMultiplier: 4
|
||||
m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_LightingSettings: {fileID: 0}
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 3
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
buildHeightMesh: 0
|
||||
maxJobWorkers: 0
|
||||
preserveTilesOutsideBounds: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &53336276
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 53336278}
|
||||
- component: {fileID: 53336277}
|
||||
m_Layer: 0
|
||||
m_Name: Lens (1)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &53336277
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 53336276}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d9a5a27b20e512840a47158afe4a4e7f, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
Shape:
|
||||
- P1: {x: 1, y: 1}
|
||||
P2: {x: 0.8947368, y: 0.9141046}
|
||||
- P1: {x: 0.8947368, y: 0.9141046}
|
||||
P2: {x: 0.78947365, y: 0.8426002}
|
||||
- P1: {x: 0.78947365, y: 0.8426002}
|
||||
P2: {x: 0.68421054, y: 0.78317225}
|
||||
- P1: {x: 0.68421054, y: 0.78317225}
|
||||
P2: {x: 0.57894737, y: 0.7342638}
|
||||
- P1: {x: 0.57894737, y: 0.7342638}
|
||||
P2: {x: 0.4736842, y: 0.69479}
|
||||
- P1: {x: 0.4736842, y: 0.69479}
|
||||
P2: {x: 0.36842105, y: 0.6639825}
|
||||
- P1: {x: 0.36842105, y: 0.6639825}
|
||||
P2: {x: 0.2631579, y: 0.6412984}
|
||||
- P1: {x: 0.2631579, y: 0.6412984}
|
||||
P2: {x: 0.15789473, y: 0.62636745}
|
||||
- P1: {x: 0.15789473, y: 0.62636745}
|
||||
P2: {x: 0.052631572, y: 0.61895764}
|
||||
- P1: {x: 0.052631572, y: 0.61895764}
|
||||
P2: {x: -0.052631587, y: 0.61895764}
|
||||
- P1: {x: -0.052631587, y: 0.61895764}
|
||||
P2: {x: -0.15789475, y: 0.62636745}
|
||||
- P1: {x: -0.15789475, y: 0.62636745}
|
||||
P2: {x: -0.2631579, y: 0.6412984}
|
||||
- P1: {x: -0.2631579, y: 0.6412984}
|
||||
P2: {x: -0.36842108, y: 0.6639825}
|
||||
- P1: {x: -0.36842108, y: 0.6639825}
|
||||
P2: {x: -0.47368422, y: 0.69479}
|
||||
- P1: {x: -0.47368422, y: 0.69479}
|
||||
P2: {x: -0.57894737, y: 0.7342638}
|
||||
- P1: {x: -0.57894737, y: 0.7342638}
|
||||
P2: {x: -0.68421054, y: 0.78317225}
|
||||
- P1: {x: -0.68421054, y: 0.78317225}
|
||||
P2: {x: -0.7894737, y: 0.8426002}
|
||||
- P1: {x: -0.7894737, y: 0.8426002}
|
||||
P2: {x: -0.8947369, y: 0.9141046}
|
||||
- P1: {x: -0.8947369, y: 0.9141046}
|
||||
P2: {x: -1, y: 1}
|
||||
- P1: {x: -1, y: 1}
|
||||
P2: {x: -1, y: 0}
|
||||
- P1: {x: -1, y: 0}
|
||||
P2: {x: 1, y: 0}
|
||||
- P1: {x: 1, y: 0}
|
||||
P2: {x: 1, y: 1}
|
||||
LensRadius: 1
|
||||
CurveRadius: -1.5
|
||||
SamplesCount: 20
|
||||
Height: 1
|
||||
--- !u!4 &53336278
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 53336276}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 1, w: 0}
|
||||
m_LocalPosition: {x: -21.19, y: 3.356, z: 0}
|
||||
m_LocalScale: {x: 2.0312, y: 2.0312, z: 2.0312}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 180}
|
||||
--- !u!1 &452348741
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 452348743}
|
||||
- component: {fileID: 452348742}
|
||||
m_Layer: 0
|
||||
m_Name: Raytracer
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &452348742
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 452348741}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a7f3a1f22cffa8e43b8cbc5cd243101a, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
Light: {fileID: 1405359522}
|
||||
Surfaces:
|
||||
- {fileID: 1381917475}
|
||||
- {fileID: 1370315341}
|
||||
- {fileID: 53336277}
|
||||
MaxTraceDepth: 20
|
||||
--- !u!4 &452348743
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 452348741}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0.44028413, w: 0.8978585}
|
||||
m_LocalPosition: {x: 0.592, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: -52.244}
|
||||
--- !u!1 &888185469
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 888185471}
|
||||
- component: {fileID: 888185470}
|
||||
m_Layer: 0
|
||||
m_Name: Sellmeier
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
--- !u!114 &888185470
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 888185469}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f017d192c43f1284c86c136425fcadb1, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!4 &888185471
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 888185469}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &963194225
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 963194228}
|
||||
- component: {fileID: 963194227}
|
||||
- component: {fileID: 963194226}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &963194226
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 963194225}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &963194227
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 963194225}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||
m_projectionMatrixMode: 1
|
||||
m_GateFitMode: 2
|
||||
m_FOVAxisMode: 0
|
||||
m_Iso: 200
|
||||
m_ShutterSpeed: 0.005
|
||||
m_Aperture: 16
|
||||
m_FocusDistance: 10
|
||||
m_FocalLength: 50
|
||||
m_BladeCount: 5
|
||||
m_Curvature: {x: 2, y: 11}
|
||||
m_BarrelClipping: 0.25
|
||||
m_Anamorphism: 0
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 3
|
||||
m_HDR: 1
|
||||
m_AllowMSAA: 1
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!4 &963194228
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 963194225}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -8.199, y: 1, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1370315340
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1370315342}
|
||||
- component: {fileID: 1370315341}
|
||||
m_Layer: 0
|
||||
m_Name: Lens
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &1370315341
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1370315340}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d9a5a27b20e512840a47158afe4a4e7f, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
Shape:
|
||||
- P1: {x: 1.838, y: 0.2}
|
||||
P2: {x: 1.7629796, y: 0.27791578}
|
||||
- P1: {x: 1.7629796, y: 0.27791578}
|
||||
P2: {x: 1.6879592, y: 0.34949845}
|
||||
- P1: {x: 1.6879592, y: 0.34949845}
|
||||
P2: {x: 1.6129389, y: 0.4154603}
|
||||
- P1: {x: 1.6129389, y: 0.4154603}
|
||||
P2: {x: 1.5379184, y: 0.47636575}
|
||||
- P1: {x: 1.5379184, y: 0.47636575}
|
||||
P2: {x: 1.462898, y: 0.53267044}
|
||||
- P1: {x: 1.462898, y: 0.53267044}
|
||||
P2: {x: 1.3878776, y: 0.5847482}
|
||||
- P1: {x: 1.3878776, y: 0.5847482}
|
||||
P2: {x: 1.3128572, y: 0.6329097}
|
||||
- P1: {x: 1.3128572, y: 0.6329097}
|
||||
P2: {x: 1.2378368, y: 0.67741483}
|
||||
- P1: {x: 1.2378368, y: 0.67741483}
|
||||
P2: {x: 1.1628164, y: 0.7184848}
|
||||
- P1: {x: 1.1628164, y: 0.7184848}
|
||||
P2: {x: 1.087796, y: 0.75630754}
|
||||
- P1: {x: 1.087796, y: 0.75630754}
|
||||
P2: {x: 1.0127755, y: 0.79104394}
|
||||
- P1: {x: 1.0127755, y: 0.79104394}
|
||||
P2: {x: 0.9377551, y: 0.82283324}
|
||||
- P1: {x: 0.9377551, y: 0.82283324}
|
||||
P2: {x: 0.86273474, y: 0.85179466}
|
||||
- P1: {x: 0.86273474, y: 0.85179466}
|
||||
P2: {x: 0.7877143, y: 0.8780324}
|
||||
- P1: {x: 0.7877143, y: 0.8780324}
|
||||
P2: {x: 0.7126939, y: 0.9016356}
|
||||
- P1: {x: 0.7126939, y: 0.9016356}
|
||||
P2: {x: 0.6376735, y: 0.9226813}
|
||||
- P1: {x: 0.6376735, y: 0.9226813}
|
||||
P2: {x: 0.56265306, y: 0.94123596}
|
||||
- P1: {x: 0.56265306, y: 0.94123596}
|
||||
P2: {x: 0.4876327, y: 0.95735615}
|
||||
- P1: {x: 0.4876327, y: 0.95735615}
|
||||
P2: {x: 0.41261226, y: 0.97108954}
|
||||
- P1: {x: 0.41261226, y: 0.97108954}
|
||||
P2: {x: 0.33759186, y: 0.98247594}
|
||||
- P1: {x: 0.33759186, y: 0.98247594}
|
||||
P2: {x: 0.26257145, y: 0.9915473}
|
||||
- P1: {x: 0.26257145, y: 0.9915473}
|
||||
P2: {x: 0.18755104, y: 0.99832934}
|
||||
- P1: {x: 0.18755104, y: 0.99832934}
|
||||
P2: {x: 0.11253063, y: 1.0028405}
|
||||
- P1: {x: 0.11253063, y: 1.0028405}
|
||||
P2: {x: 0.037510216, y: 1.0050931}
|
||||
- P1: {x: 0.037510216, y: 1.0050931}
|
||||
P2: {x: -0.037510194, y: 1.0050931}
|
||||
- P1: {x: -0.037510194, y: 1.0050931}
|
||||
P2: {x: -0.112530604, y: 1.0028405}
|
||||
- P1: {x: -0.112530604, y: 1.0028405}
|
||||
P2: {x: -0.18755102, y: 0.99832934}
|
||||
- P1: {x: -0.18755102, y: 0.99832934}
|
||||
P2: {x: -0.26257142, y: 0.9915473}
|
||||
- P1: {x: -0.26257142, y: 0.9915473}
|
||||
P2: {x: -0.33759183, y: 0.98247594}
|
||||
- P1: {x: -0.33759183, y: 0.98247594}
|
||||
P2: {x: -0.41261226, y: 0.97108954}
|
||||
- P1: {x: -0.41261226, y: 0.97108954}
|
||||
P2: {x: -0.48763266, y: 0.95735615}
|
||||
- P1: {x: -0.48763266, y: 0.95735615}
|
||||
P2: {x: -0.56265306, y: 0.94123596}
|
||||
- P1: {x: -0.56265306, y: 0.94123596}
|
||||
P2: {x: -0.6376735, y: 0.9226813}
|
||||
- P1: {x: -0.6376735, y: 0.9226813}
|
||||
P2: {x: -0.71269387, y: 0.9016356}
|
||||
- P1: {x: -0.71269387, y: 0.9016356}
|
||||
P2: {x: -0.7877143, y: 0.8780324}
|
||||
- P1: {x: -0.7877143, y: 0.8780324}
|
||||
P2: {x: -0.8627347, y: 0.85179466}
|
||||
- P1: {x: -0.8627347, y: 0.85179466}
|
||||
P2: {x: -0.9377551, y: 0.82283324}
|
||||
- P1: {x: -0.9377551, y: 0.82283324}
|
||||
P2: {x: -1.0127755, y: 0.79104394}
|
||||
- P1: {x: -1.0127755, y: 0.79104394}
|
||||
P2: {x: -1.087796, y: 0.75630754}
|
||||
- P1: {x: -1.087796, y: 0.75630754}
|
||||
P2: {x: -1.1628163, y: 0.7184848}
|
||||
- P1: {x: -1.1628163, y: 0.7184848}
|
||||
P2: {x: -1.2378367, y: 0.67741483}
|
||||
- P1: {x: -1.2378367, y: 0.67741483}
|
||||
P2: {x: -1.3128572, y: 0.6329097}
|
||||
- P1: {x: -1.3128572, y: 0.6329097}
|
||||
P2: {x: -1.3878776, y: 0.5847482}
|
||||
- P1: {x: -1.3878776, y: 0.5847482}
|
||||
P2: {x: -1.462898, y: 0.53267044}
|
||||
- P1: {x: -1.462898, y: 0.53267044}
|
||||
P2: {x: -1.5379184, y: 0.47636575}
|
||||
- P1: {x: -1.5379184, y: 0.47636575}
|
||||
P2: {x: -1.6129388, y: 0.4154604}
|
||||
- P1: {x: -1.6129388, y: 0.4154604}
|
||||
P2: {x: -1.6879592, y: 0.34949845}
|
||||
- P1: {x: -1.6879592, y: 0.34949845}
|
||||
P2: {x: -1.7629796, y: 0.27791578}
|
||||
- P1: {x: -1.7629796, y: 0.27791578}
|
||||
P2: {x: -1.838, y: 0.2}
|
||||
- P1: {x: -1.838, y: 0.2}
|
||||
P2: {x: -1.838, y: 0}
|
||||
- P1: {x: -1.838, y: 0}
|
||||
P2: {x: 1.838, y: 0}
|
||||
- P1: {x: 1.838, y: 0}
|
||||
P2: {x: 1.838, y: 0.2}
|
||||
LensRadius: 1.838
|
||||
CurveRadius: 2.5
|
||||
SamplesCount: 50
|
||||
Height: 0.2
|
||||
--- !u!4 &1370315342
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1370315340}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 3.04, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1381917472
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1381917474}
|
||||
- component: {fileID: 1381917475}
|
||||
m_Layer: 0
|
||||
m_Name: Circle
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1381917474
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1381917472}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -16.92, y: 11.33, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1381917475
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1381917472}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ae0b3433277d89248a6658e589b07b2e, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
Shape:
|
||||
- P1: {x: 1, y: 0}
|
||||
P2: {x: 0.98078525, y: 0.19509032}
|
||||
- P1: {x: 0.98078525, y: 0.19509032}
|
||||
P2: {x: 0.9238795, y: 0.38268346}
|
||||
- P1: {x: 0.9238795, y: 0.38268346}
|
||||
P2: {x: 0.8314696, y: 0.55557024}
|
||||
- P1: {x: 0.8314696, y: 0.55557024}
|
||||
P2: {x: 0.70710677, y: 0.70710677}
|
||||
- P1: {x: 0.70710677, y: 0.70710677}
|
||||
P2: {x: 0.5555702, y: 0.83146966}
|
||||
- P1: {x: 0.5555702, y: 0.83146966}
|
||||
P2: {x: 0.38268343, y: 0.9238795}
|
||||
- P1: {x: 0.38268343, y: 0.9238795}
|
||||
P2: {x: 0.19509023, y: 0.9807853}
|
||||
- P1: {x: 0.19509023, y: 0.9807853}
|
||||
P2: {x: -0.00000004371139, y: 1}
|
||||
- P1: {x: -0.00000004371139, y: 1}
|
||||
P2: {x: -0.19509032, y: 0.98078525}
|
||||
- P1: {x: -0.19509032, y: 0.98078525}
|
||||
P2: {x: -0.38268352, y: 0.9238795}
|
||||
- P1: {x: -0.38268352, y: 0.9238795}
|
||||
P2: {x: -0.55557036, y: 0.83146954}
|
||||
- P1: {x: -0.55557036, y: 0.83146954}
|
||||
P2: {x: -0.70710677, y: 0.70710677}
|
||||
- P1: {x: -0.70710677, y: 0.70710677}
|
||||
P2: {x: -0.83146966, y: 0.5555702}
|
||||
- P1: {x: -0.83146966, y: 0.5555702}
|
||||
P2: {x: -0.9238796, y: 0.38268328}
|
||||
- P1: {x: -0.9238796, y: 0.38268328}
|
||||
P2: {x: -0.9807853, y: 0.19509031}
|
||||
- P1: {x: -0.9807853, y: 0.19509031}
|
||||
P2: {x: -1, y: -0.00000008742278}
|
||||
- P1: {x: -1, y: -0.00000008742278}
|
||||
P2: {x: -0.98078525, y: -0.19509049}
|
||||
- P1: {x: -0.98078525, y: -0.19509049}
|
||||
P2: {x: -0.9238795, y: -0.38268343}
|
||||
- P1: {x: -0.9238795, y: -0.38268343}
|
||||
P2: {x: -0.83146954, y: -0.5555703}
|
||||
- P1: {x: -0.83146954, y: -0.5555703}
|
||||
P2: {x: -0.70710665, y: -0.7071069}
|
||||
- P1: {x: -0.70710665, y: -0.7071069}
|
||||
P2: {x: -0.55557, y: -0.8314698}
|
||||
- P1: {x: -0.55557, y: -0.8314698}
|
||||
P2: {x: -0.38268313, y: -0.9238797}
|
||||
- P1: {x: -0.38268313, y: -0.9238797}
|
||||
P2: {x: -0.19509038, y: -0.98078525}
|
||||
- P1: {x: -0.19509038, y: -0.98078525}
|
||||
P2: {x: 0.000000011924881, y: -1}
|
||||
- P1: {x: 0.000000011924881, y: -1}
|
||||
P2: {x: 0.19509041, y: -0.98078525}
|
||||
- P1: {x: 0.19509041, y: -0.98078525}
|
||||
P2: {x: 0.3826836, y: -0.92387944}
|
||||
- P1: {x: 0.3826836, y: -0.92387944}
|
||||
P2: {x: 0.5555704, y: -0.8314695}
|
||||
- P1: {x: 0.5555704, y: -0.8314695}
|
||||
P2: {x: 0.707107, y: -0.70710653}
|
||||
- P1: {x: 0.707107, y: -0.70710653}
|
||||
P2: {x: 0.8314696, y: -0.5555703}
|
||||
- P1: {x: 0.8314696, y: -0.5555703}
|
||||
P2: {x: 0.92387956, y: -0.38268343}
|
||||
- P1: {x: 0.92387956, y: -0.38268343}
|
||||
P2: {x: 0.9807853, y: -0.19509023}
|
||||
- P1: {x: 0.9807853, y: -0.19509023}
|
||||
P2: {x: 1, y: 0}
|
||||
Radius: 1
|
||||
ViewSamples: 32
|
||||
--- !u!1 &1405359520
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1405359521}
|
||||
- component: {fileID: 1405359522}
|
||||
m_Layer: 0
|
||||
m_Name: Light
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 4162164826716764455, guid: 0000000000000000d000000000000000, type: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1405359521
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1405359520}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0.05, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1405359522
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1405359520}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d1f035f4ba278b7419c3b3565780f203, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
SamplesCount: 1500
|
||||
Angle: 60
|
||||
DrawGizmo: 1
|
||||
--- !u!1660057539 &9223372036854775807
|
||||
SceneRoots:
|
||||
m_ObjectHideFlags: 0
|
||||
m_Roots:
|
||||
- {fileID: 963194228}
|
||||
- {fileID: 888185471}
|
||||
- {fileID: 1405359521}
|
||||
- {fileID: 1381917474}
|
||||
- {fileID: 452348743}
|
||||
- {fileID: 1370315342}
|
||||
- {fileID: 53336278}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9fc0d4010bbf28b4594072e72b8655ab
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user