暫無描述
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UniversalFullscreenSubTarget.cs 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using UnityEditor.ShaderGraph;
  2. using UnityEngine;
  3. using static UnityEditor.Rendering.BuiltIn.ShaderUtils;
  4. using UnityEditor.Rendering.BuiltIn;
  5. using System;
  6. using UnityEditor.Rendering.Fullscreen.ShaderGraph;
  7. namespace UnityEditor.Rendering.Universal.ShaderGraph
  8. {
  9. class UniversalFullscreenSubTarget : FullscreenSubTarget<UniversalTarget>, IRequiresData<FullscreenData>, IHasMetadata
  10. {
  11. static readonly GUID kSourceCodeGuid = new GUID("48080a5025a54a84087e882e2f988642"); // UniversalFullscreenSubTarget.cs // TODO
  12. public override void Setup(ref TargetSetupContext context)
  13. {
  14. base.Setup(ref context);
  15. context.AddAssetDependency(kSourceCodeGuid, AssetCollection.Flags.SourceDependency);
  16. }
  17. protected override KeywordCollection GetPassKeywords(FullscreenCompatibility compatibility)
  18. {
  19. var modifiedKeywordCollection = base.GetPassKeywords(compatibility);
  20. modifiedKeywordCollection.Add(CoreKeywordDescriptors.GBufferNormalsOct);
  21. return modifiedKeywordCollection;
  22. }
  23. // We don't need the save context / update materials for now
  24. public override object saveContext => null;
  25. protected override string pipelineTag => UniversalTarget.kPipelineTag;
  26. const string kURPInput = "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl";
  27. protected override IncludeCollection pregraphIncludes => new IncludeCollection
  28. {
  29. { kURPInput, IncludeLocation.Pregraph }, // Include before kInstancing
  30. { kInstancing, IncludeLocation.Pregraph }, // For VR
  31. { CoreIncludes.CorePregraph },
  32. { CoreIncludes.ShaderGraphPregraph },
  33. };
  34. public UniversalFullscreenSubTarget()
  35. {
  36. displayName = "Fullscreen";
  37. }
  38. }
  39. }