ReflectionProbeNode.cs 998 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using System.Reflection;
  2. using UnityEngine;
  3. namespace UnityEditor.ShaderGraph
  4. {
  5. [Title("Input", "Lighting", "Reflection Probe")]
  6. class ReflectionProbeNode : CodeFunctionNode
  7. {
  8. public ReflectionProbeNode()
  9. {
  10. name = "Reflection Probe";
  11. }
  12. public override bool hasPreview { get { return false; } }
  13. protected override MethodInfo GetFunctionToConvert()
  14. {
  15. return GetType().GetMethod("Unity_ReflectionProbe", BindingFlags.Static | BindingFlags.NonPublic);
  16. }
  17. static string Unity_ReflectionProbe(
  18. [Slot(0, Binding.ObjectSpaceViewDirection)] Vector3 ViewDir,
  19. [Slot(1, Binding.ObjectSpaceNormal)] Vector3 Normal,
  20. [Slot(2, Binding.None)] Vector1 LOD,
  21. [Slot(3, Binding.None)] out Vector3 Out)
  22. {
  23. Out = Vector3.one;
  24. return
  25. @"
  26. {
  27. Out = SHADERGRAPH_REFLECTION_PROBE(ViewDir, Normal, LOD);
  28. }
  29. ";
  30. }
  31. }
  32. }