[MY] Shader et LightWeightedRenderPipeline
Publié : 07 Sep 2019 11:19
Salut à tous,
J'essaie d'utiliser ce shader avec le Light Weighted Render Pipeline mais il ne fonctionne pas..
Aucune erreur n’apparaît donc je comprend pas la raison...
Le shader :
Il fonctionne très bien avec le pipeline normal...
J'essaie d'utiliser ce shader avec le Light Weighted Render Pipeline mais il ne fonctionne pas..
Aucune erreur n’apparaît donc je comprend pas la raison...
Le shader :
Code : Tout sélectionner
Shader "Custom/Sin Wave" {
Properties{
_Tile("Tile", Range(0.0,1.0)) = 0.5
_Color ("Color", Color) = (1.0,1.0,1.0,0.5)
_ForegroundColor("Foreground Color", Color) = (1,1,1,0)
_BackgroundColor("Background Color", Color) = (0,0,0,0)
_ForegroundMask("Foreground Mask", 2D) = "white" {}
_ForegroundCutoff("Foreground Cutoff", Range(0,1)) = 0.5
_BackgroundCutoff("Background Cutoff", Range(0,1)) = 0.5
_Radius("Radius", Range(0.0,1.0)) = 0.5
}
SubShader
{
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
Lighting Off
LOD 100
ZWrite Off
Blend SrcAlpha OneMinusSrcAlpha
CGPROGRAM
#pragma surface surf Standard alpha:fade
#pragma target 3.0
sampler2D _ForegroundMask;
struct Input {
float2 uv_ForegroundMask;
};
fixed4 _ForegroundColor;
fixed4 _BackgroundColor;
fixed4 _Color;
half _ForegroundCutoff;
half _BackgroundCutoff;
half _Radius;
half _Tile;
void surf(Input IN, inout SurfaceOutputStandard color:alpha)
{
fixed x = (-0.5 + IN.uv_ForegroundMask.x) * _Tile;
fixed y = (-0.5 + IN.uv_ForegroundMask.y) * 2;
fixed radius = 0.5 + sin(x * 3.1415926535) * _Radius;
radius -= (0.5 * y + 0.5);
clip(radius - _BackgroundCutoff);
clip(_ForegroundCutoff - radius);
color.Albedo = _Color;
color.Alpha = _Color.a;
}
ENDCG
}
FallBack "Unlit/Transparent"
}