Spine-Outline-Pass-URP.hlsl 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef SPINE_OUTLINE_PASS_URP_INCLUDED
  2. #define SPINE_OUTLINE_PASS_URP_INCLUDED
  3. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  4. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/CommonMaterial.hlsl"
  5. #include "SpineCoreShaders/Spine-Outline-Common.cginc"
  6. struct VertexInput {
  7. float4 positionOS : POSITION;
  8. float2 uv : TEXCOORD0;
  9. float4 vertexColor : COLOR;
  10. UNITY_VERTEX_INPUT_INSTANCE_ID
  11. };
  12. struct VertexOutput {
  13. float4 pos : SV_POSITION;
  14. float2 uv : TEXCOORD0;
  15. float vertexColorAlpha : COLOR;
  16. UNITY_VERTEX_OUTPUT_STEREO
  17. };
  18. VertexOutput vertOutline(VertexInput v) {
  19. VertexOutput o;
  20. UNITY_SETUP_INSTANCE_ID(v);
  21. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  22. o.pos = TransformObjectToHClip(v.positionOS.xyz);
  23. o.uv = v.uv;
  24. o.vertexColorAlpha = v.vertexColor.a;
  25. return o;
  26. }
  27. float4 fragOutline(VertexOutput i) : SV_Target{
  28. float4 texColor = computeOutlinePixel(_MainTex, _MainTex_TexelSize.xy, i.uv, i.vertexColorAlpha,
  29. _OutlineWidth, _OutlineReferenceTexWidth, _OutlineMipLevel,
  30. _OutlineSmoothness, _ThresholdEnd, _OutlineColor);
  31. return texColor;
  32. }
  33. #endif