FogNode.cs 850 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System.Reflection;
  2. using UnityEngine;
  3. namespace UnityEditor.ShaderGraph
  4. {
  5. [Title("Input", "Scene", "Fog")]
  6. class FogNode : CodeFunctionNode
  7. {
  8. public FogNode()
  9. {
  10. name = "Fog";
  11. }
  12. public override bool hasPreview { get { return false; } }
  13. protected override MethodInfo GetFunctionToConvert()
  14. {
  15. return GetType().GetMethod("Unity_Fog", BindingFlags.Static | BindingFlags.NonPublic);
  16. }
  17. static string Unity_Fog(
  18. [Slot(2, Binding.ObjectSpacePosition)] Vector3 Position,
  19. [Slot(0, Binding.None)] out Vector4 Color,
  20. [Slot(1, Binding.None)] out Vector1 Density)
  21. {
  22. Color = Vector4.zero;
  23. return
  24. @"
  25. {
  26. SHADERGRAPH_FOG(Position, Color, Density);
  27. }
  28. ";
  29. }
  30. }
  31. }