Added custom inspector for VolumeObject; Change the name of AoVolume to VolumeObject;
40 lines
908 B
C#
40 lines
908 B
C#
using System;
|
|
using UnityEngine;
|
|
using UnityEngine.Rendering;
|
|
|
|
namespace Misaki.AoVolume
|
|
{
|
|
[Serializable]
|
|
[GenerateHLSL(PackingRules.Exact, false)]
|
|
public struct VolumeData
|
|
{
|
|
[HideInInspector]
|
|
[NonSerialized]
|
|
public Matrix4x4 worldMatrix;
|
|
[HideInInspector]
|
|
[NonSerialized]
|
|
public Matrix4x4 inverseWorldMatrix;
|
|
|
|
public Vector3 size;
|
|
|
|
[Range(0.0f, 1.0f)]
|
|
public float intensity;
|
|
[Range(0.0f, 1.0f)]
|
|
public float falloff;
|
|
[Range(0.0f, 1.0f)]
|
|
public float normalFalloff;
|
|
|
|
public static VolumeData Default => new()
|
|
{
|
|
size = Vector3.one,
|
|
intensity = 1.0f,
|
|
falloff = 0.25f,
|
|
normalFalloff = 0.0f
|
|
};
|
|
}
|
|
|
|
internal unsafe static class VolumeDataPtr
|
|
{
|
|
public static VolumeData* Zero => (VolumeData*)0;
|
|
}
|
|
} |