A game about forced loneliness, made by TACStudios
1using System.Reflection;
2
3namespace UnityEditor.ShaderGraph
4{
5 [Title("Math", "Advanced", "Posterize")]
6 class PosterizeNode : CodeFunctionNode
7 {
8 public PosterizeNode()
9 {
10 name = "Posterize";
11 }
12
13 protected override MethodInfo GetFunctionToConvert()
14 {
15 return GetType().GetMethod("Unity_Posterize", BindingFlags.Static | BindingFlags.NonPublic);
16 }
17
18 static string Unity_Posterize(
19 [Slot(0, Binding.None, 0, 0, 0, 0)] DynamicDimensionVector In,
20 [Slot(1, Binding.None, 4, 4, 4, 4)] DynamicDimensionVector Steps,
21 [Slot(2, Binding.None)] out DynamicDimensionVector Out)
22 {
23 return
24@"
25{
26 Out = floor(In / (1 / Steps)) * (1 / Steps);
27}
28";
29 }
30 }
31}