加入很多新内容,这波一块交了
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
Shader "Hidden/Bansonic/GlobalMonochrome"
|
||||
{
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderPipeline" = "UniversalPipeline" }
|
||||
ZWrite Off
|
||||
Cull Off
|
||||
ZTest Always
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "GlobalMonochrome"
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma vertex Vert
|
||||
#pragma fragment Frag
|
||||
#pragma target 4.5
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blit.hlsl"
|
||||
|
||||
float _MonochromeIntensity;
|
||||
|
||||
half4 Frag(Varyings input) : SV_Target
|
||||
{
|
||||
float2 uv = input.texcoord;
|
||||
half4 color = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv);
|
||||
half luminance = dot(color.rgb, half3(0.299h, 0.587h, 0.114h));
|
||||
half3 grayscale = luminance.xxx;
|
||||
color.rgb = lerp(color.rgb, grayscale, saturate(_MonochromeIntensity));
|
||||
return color;
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user