Unity render pipeline upgrade, velocity based vignette system (may encounter problems on merge)

This commit is contained in:
joonasp
2022-03-12 21:38:42 +02:00
parent f48d160bd3
commit b42bfd3c5e
297 changed files with 28245 additions and 15069 deletions

View File

@@ -1,6 +1,8 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public class FlyWand : MonoBehaviour
{

View File

@@ -0,0 +1,32 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public class VignetteController : MonoBehaviour
{
private Rigidbody player;
public Volume vignette;
public float threshold = 5f;
public float maxValue = 1f;
void Start()
{
player = GameObject.FindGameObjectWithTag("Player").GetComponent<Rigidbody>();
}
// Update is called once per frame
void Update()
{
if(vignette.profile.TryGet(out Vignette vig)) //https://www.youtube.com/watch?v=8S22Qt_-nY8
{
float value = (Mathf.Abs(player.velocity.x) + Mathf.Abs(player.velocity.y) + Mathf.Abs(player.velocity.z)) / threshold;
if (value > maxValue) value = maxValue;
vig.intensity.Override(value);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 25d8a8d9dfb3e574f952521e9883724f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: