UniversalStructFields.cs 2.6 KB

123456789101112131415161718192021222324252627282930
  1. using UnityEditor.ShaderGraph;
  2. namespace UnityEditor.Rendering.Universal.ShaderGraph
  3. {
  4. static class UniversalStructFields
  5. {
  6. public struct Varyings
  7. {
  8. public static string name = "Varyings";
  9. public static FieldDescriptor staticLightmapUV = new FieldDescriptor(Varyings.name, "staticLightmapUV", "", ShaderValueType.Float2,
  10. preprocessor: "defined(LIGHTMAP_ON)", subscriptOptions: StructFieldOptions.Optional);
  11. public static FieldDescriptor dynamicLightmapUV = new FieldDescriptor(Varyings.name, "dynamicLightmapUV", "", ShaderValueType.Float2,
  12. preprocessor: "defined(DYNAMICLIGHTMAP_ON)", subscriptOptions: StructFieldOptions.Optional);
  13. public static FieldDescriptor sh = new FieldDescriptor(Varyings.name, "sh", "", ShaderValueType.Float3,
  14. preprocessor: "!defined(LIGHTMAP_ON)", subscriptOptions: StructFieldOptions.Optional);
  15. public static FieldDescriptor fogFactorAndVertexLight = new FieldDescriptor(Varyings.name, "fogFactorAndVertexLight", "VARYINGS_NEED_FOG_AND_VERTEX_LIGHT", ShaderValueType.Float4,
  16. subscriptOptions: StructFieldOptions.Optional);
  17. public static FieldDescriptor shadowCoord = new FieldDescriptor(Varyings.name, "shadowCoord", "VARYINGS_NEED_SHADOWCOORD", ShaderValueType.Float4,
  18. subscriptOptions: StructFieldOptions.Optional, preprocessor: "defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)");
  19. public static FieldDescriptor stereoTargetEyeIndexAsRTArrayIdx = new FieldDescriptor(Varyings.name, "stereoTargetEyeIndexAsRTArrayIdx", "", ShaderValueType.Uint,
  20. "SV_RenderTargetArrayIndex", "(defined(UNITY_STEREO_INSTANCING_ENABLED))", StructFieldOptions.Generated);
  21. public static FieldDescriptor stereoTargetEyeIndexAsBlendIdx0 = new FieldDescriptor(Varyings.name, "stereoTargetEyeIndexAsBlendIdx0", "", ShaderValueType.Uint,
  22. "BLENDINDICES0", "(defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE)))");
  23. public static FieldDescriptor curPositionCS = new FieldDescriptor(Varyings.name, "curPositionCS", "VARYINGS_NEED_CURRENT_POSITION_CS", ShaderValueType.Float4,
  24. subscriptOptions: StructFieldOptions.Optional);
  25. public static FieldDescriptor prevPositionCS = new FieldDescriptor(Varyings.name, "prevPositionCS", "VARYINGS_NEED_PREVIOUS_POSITION_CS", ShaderValueType.Float4,
  26. subscriptOptions: StructFieldOptions.Optional);
  27. }
  28. }
  29. }