#Screen Space Snow

1 messages · Page 1 of 1 (latest)

night vector
#

the shader is supposed to show the objects in the scene covered in snow, what am i doing wrong?

#
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;

[System.Serializable, VolumeComponentMenu("Post-processing/Snow")]
public sealed class Snow : CustomPostProcessVolumeComponent, IPostProcessComponent
{
    public ClampedFloatParameter intensity = new(.5f, 0f, 1f);
    public ClampedFloatParameter coverage = new(1f, 0f, 1f);
    public ClampedFloatParameter noisePower = new(1f, 1f, 2f);
    public ClampedFloatParameter noiseTiling = new(1f, 0f, 2f);
    public ClampedFloatParameter windAngle = new(0f, 0f, 90f);
    public ClampedFloatParameter snowfallSpeed = new(.5f, 0f, 1f);

    Material m_Material;

    public override CustomPostProcessInjectionPoint injectionPoint => CustomPostProcessInjectionPoint.AfterPostProcess;

    public bool IsActive() => m_Material != null && intensity.value > 0f;

    public override void Setup() => m_Material = new Material(Shader.Find("Shader Graphs/Snow"));

    public override void Render(CommandBuffer cmd, HDCamera camera, RTHandle source, RTHandle destination)
    {
        m_Material.SetFloat("_Intensity", intensity.value);
        m_Material.SetFloat("_Coverage", coverage.value);
        m_Material.SetFloat("_Noise_Power", noisePower.value);
        m_Material.SetFloat("_Noise_Tiling", noiseTiling.value);
        m_Material.SetFloat("_Wind_Angle", windAngle.value);
        m_Material.SetFloat("_Snowfall_Speed", snowfallSpeed.value);

        // The HD Sample Buffer node will automatically get the screen texture
        HDUtils.DrawFullScreen(cmd, m_Material, destination);
    }

    public override void Cleanup() => CoreUtils.Destroy(m_Material);
}
pine topaz
#

Maybe you'd want to project the voronoi from above by adding a Swizzle node with "xz" before connecting to the UV. But I imagine you wouldn't want that snow texture moving so I find the speed/wind properties odd

night vector
#

The movement is supposed to be for falling snow but thats not very important rn

#

For starters i wanna show the objects in the scene covered in snow

night vector
#

new attempt but the result is still dogshit