Unified Volumetric Flow

Modified stardust & nebula shaders such that flow velocity is consistent: Volumetric:flow now represents global velocity in meters per second
This commit is contained in:
Reinier Vens 2022-07-17 05:27:50 +01:00
commit c3329cecc4
19 changed files with 527 additions and 67 deletions

View file

@ -43,7 +43,7 @@ public class FlowSettings
[JsonProperty("scale"), Key(0)] public float Scale;
[JsonProperty("amplitude"), Key(1)] public float Amplitude;
[JsonProperty("scrollSpeed"), Key(2)] public float ScrollSpeed;
[JsonProperty("velocity"), Key(3)] public float Speed;
[JsonProperty("period"), Key(3)] public float Period;
}
[Serializable, MessagePackObject, JsonObject(MemberSerialization.OptIn)]

View file

@ -110,7 +110,7 @@ public class VolumeCloudRenderer : EffectBase
/* Some code is from playdead TAA. */
//1. Pass1, Render a undersampled buffer. The buffer is dithered using bayer matrix(every 3x3 pixel) and halton sequence.
//1. Pass1, Render a undersampled buffer. The buffer is dithered using blue noise and halton sequence.
//If it's first frame, force a high quality sample to make the initial history buffer good enough.
if (firstFrame || quality == Quality.Ultra) {
mat.EnableKeyword("ULTRA_QUALITY");

View file

@ -67,6 +67,6 @@ public class VolumeSampling : MonoBehaviour
Shader.SetGlobalFloat("_FlowAmplitude", Settings.DefaultEnvironment.Flow.Amplitude);
_flowScroll += Settings.DefaultEnvironment.Flow.ScrollSpeed * Time.deltaTime;
Shader.SetGlobalFloat("_FlowScroll", _flowScroll);
Shader.SetGlobalFloat("_FlowSpeed", Settings.DefaultEnvironment.Flow.Speed);
Shader.SetGlobalFloat("_FlowPeriod", Settings.DefaultEnvironment.Flow.Period);
}
}