A game about forced loneliness, made by TACStudios
1using System;
2using Unity.Mathematics;
3
4namespace UnityEngine.Rendering
5{
6 [GenerateHLSL]
7 class APVDefinitions
8 {
9 public static int probeIndexChunkSize = ProbeBrickIndex.kIndexChunkSize;
10 public const float probeValidityThreshold = 0.05f;
11
12 public static int probeMaxRegionCount = 4;
13 public static Color32[] layerMaskColors = new Color32[] {
14 new Color32(230, 159, 0, 255),
15 new Color32(0, 158, 115, 255),
16 new Color32(0, 114, 178, 255),
17 new Color32(204, 121, 167, 255),
18 };
19
20 public static Color debugEmptyColor = new Color(0.388f, 0.812f, 0.804f, 1.0f);
21 }
22
23 /// <summary>
24 /// Defines the constant buffer register that will be used as binding point for the Adaptive Probe Volumes constant buffer.
25 /// </summary>
26 public enum APVConstantBufferRegister
27 {
28 /// <summary>
29 /// Global register
30 /// </summary>
31 GlobalRegister = 6
32 }
33
34 /// <summary>
35 /// Defines the method used to reduce leaking.
36 /// </summary>
37 [GenerateHLSL]
38 public enum APVLeakReductionMode
39 {
40 /// <summary>
41 /// Nothing is done to prevent leaking. Cheapest option in terms of cost of sampling.
42 /// </summary>
43 None = 0,
44 /// <summary>
45 /// The uvw used to sample APV data are warped to try to have invalid probe not contributing to lighting.
46 /// This samples APV a single time so it's a cheap option but will only work in the simplest cases.
47 /// </summary>
48 Performance = 1,
49 /// <summary>
50 /// This option samples APV between 1 and 3 times to provide the smoothest result without introducing artifacts.
51 /// This is as expensive as Performance mode in the simplest cases, and is better and more expensive in the most complex cases.
52 /// </summary>
53 Quality = 2,
54
55 /// <summary>
56 /// Obsolete, kept for migration.
57 /// </summary>
58 [Obsolete("Performance")]
59 ValidityBased = Performance,
60 /// <summary>
61 /// Obsolete, kept for migration.
62 /// </summary>
63 [Obsolete("Quality")]
64 ValidityAndNormalBased = Quality,
65 }
66
67 [GenerateHLSL(needAccessors = false, generateCBuffer = true, constantRegister = (int)APVConstantBufferRegister.GlobalRegister)]
68 internal unsafe struct ShaderVariablesProbeVolumes
69 {
70 public Vector4 _Offset_LayerCount;
71 public Vector4 _MinLoadedCellInEntries_IndirectionEntryDim;
72 public Vector4 _MaxLoadedCellInEntries_RcpIndirectionEntryDim;
73 public Vector4 _PoolDim_MinBrickSize;
74 public Vector4 _RcpPoolDim_XY;
75 public Vector4 _MinEntryPos_Noise;
76 public uint4 _EntryCount_X_XY_LeakReduction;
77 public Vector4 _Biases_NormalizationClamp;
78 public Vector4 _FrameIndex_Weights;
79 public uint4 _ProbeVolumeLayerMask;
80 }
81}