NEW CLOUDS NEW CLOUDS NEW CLOUDS WHOOO

Added new clouds shader with improved raymarching loop
Currently only being used in main menu (rest is coming right up!)
Removed WWise (it's nice, but all it's doing is throwing exceptions rn since we ain't about to get a license)
This commit is contained in:
Reinier Vens 2022-07-10 02:53:09 +01:00
commit b08423b936
1066 changed files with 9806 additions and 58766 deletions

View file

@ -0,0 +1,36 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Yangrc.AtmosphereScattering {
[RequireComponent(typeof(Light))]
public class SunIntensityController : MonoBehaviour {
private new Light light;
//This is the "base" position, used to sample transmittance to sun, and set a final intensity.
//
//In real-life, objects at different position are affected by different sun intensity.
//But in Unity all objects share the same sun.
//So we need to set a base position, and assume all objects are at this position when affected by sun.
public Vector3 basePosition = new Vector3(0.0f, 50.0f, 0.0f);
private void Awake() {
light = GetComponent<Light>();
}
// Update is called once per frame
void Update() {
var t = AtmosphereScatteringLutManager.instance;
if (t != null) {
//Sun-zenith cos.
var mu_s = Vector3.Dot(Vector3.down, transform.forward);
var radianceAtZero = t.GetRadianceAt(mu_s, basePosition);
light.intensity = radianceAtZero.magnitude / (2 * Mathf.PI);
var normalized = radianceAtZero.normalized;
light.color = new Color(normalized.x, normalized.y, normalized.z);
}
}
}
}