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.
79 lines
1.9 KiB
79 lines
1.9 KiB
Shader "Hidden/PostProcessing/SubpixelMorphologicalAntialiasing"
|
|
{
|
|
Properties
|
|
{
|
|
[HideInInspector] _StencilRef("_StencilRef", Int) = 4
|
|
[HideInInspector] _StencilMask("_StencilMask", Int) = 4
|
|
}
|
|
|
|
HLSLINCLUDE
|
|
|
|
#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch switch2
|
|
#pragma multi_compile_fragment SMAA_PRESET_LOW SMAA_PRESET_MEDIUM SMAA_PRESET_HIGH
|
|
#pragma editor_sync_compilation
|
|
|
|
ENDHLSL
|
|
|
|
SubShader
|
|
{
|
|
Tags{ "RenderPipeline" = "HDRenderPipeline" }
|
|
|
|
Cull Off ZWrite Off ZTest Always
|
|
|
|
// Edge detection
|
|
Pass
|
|
{
|
|
Name "Edge detection"
|
|
Stencil
|
|
{
|
|
WriteMask [_StencilMask]
|
|
Ref [_StencilRef]
|
|
Comp Always
|
|
Pass Replace
|
|
}
|
|
|
|
HLSLPROGRAM
|
|
|
|
#pragma vertex VertEdge
|
|
#pragma fragment FragEdge
|
|
#include "SubpixelMorphologicalAntialiasingBridge.hlsl"
|
|
|
|
ENDHLSL
|
|
}
|
|
|
|
// Blend Weights Calculation
|
|
Pass
|
|
{
|
|
Name "Blend Weights Calculation"
|
|
Stencil
|
|
{
|
|
WriteMask[_StencilMask]
|
|
ReadMask [_StencilMask]
|
|
Ref [_StencilRef]
|
|
Comp Equal
|
|
Pass Replace
|
|
}
|
|
|
|
HLSLPROGRAM
|
|
|
|
#pragma vertex VertBlend
|
|
#pragma fragment FragBlend
|
|
#include "SubpixelMorphologicalAntialiasingBridge.hlsl"
|
|
|
|
ENDHLSL
|
|
}
|
|
|
|
// Neighborhood Blending
|
|
Pass
|
|
{
|
|
Name "Neighborhood Blending"
|
|
HLSLPROGRAM
|
|
|
|
#pragma vertex VertNeighbor
|
|
#pragma fragment FragNeighbor
|
|
#include "SubpixelMorphologicalAntialiasingBridge.hlsl"
|
|
|
|
ENDHLSL
|
|
}
|
|
}
|
|
}
|