Lightning

Created Lightning Gun effect (Uses LineRenderer, very slow)
Created GPU Lightning renderer (very fast, still needs integration)
This commit is contained in:
Reinier Vens 2021-02-04 04:37:47 +00:00
commit bb297bf84c
100 changed files with 7105 additions and 13 deletions

View file

@ -0,0 +1,26 @@
using UnityEngine;
using System.Collections;
public class GPUTrailSpline : MonoBehaviour
{
/// <summary>
/// start~end をつなぐ曲線上の点をtに応じて求める
/// http://t-pot.com/program/2_3rdcurve/index.html
/// </summary>
/// <param name="t">0f~1f</param>
/// <param name="prev"></param>
/// <param name="start"></param>
/// <param name="end"></param>
/// <returns></returns>
public static Vector3 CatmullRom(float t, Vector3 prev, Vector3 start, Vector3 end)
{
var t2 = t * t;
return
0.5f * (
t2 * (prev - 2f * start + end)
+ t * (-prev + end)
)
+ start;
}
}