
C'est par là que cela se passe.


On trouve sur le Blog d'autres Shaders comme ce Sprite Outline :

PS :
Cela me rappelle les fabuleux effets de Kripto289 (à propos, son dernier pack est sorti ce jour)
https://www.youtube.com/watch?v=JzezSQdKJoA
Code : Tout sélectionner
Shader "Custom/Printer3D"
{
Properties
{
_MainTex ("Base (RGB)", 2D) = "white" {}
_ConstructY ("ConstructY", float) = 0
_ConstructColor ("ConstructColor", Color) = (255,255,255,255)
_ConstructGap ("ConstructGap", float) = 0
}
SubShader
{
Tags { "Queue" = "Geometry" "RenderType" = "Opaque" }
Cull Off
LOD 200
CGPROGRAM
//#pragma surface surf Lambert
#pragma target 3.0
#pragma only_renderers d3d9 d3d11
#pragma surface surf Unlit fullforwardshadows
sampler2D _MainTex;
half4 _ConstructColor;
float _ConstructY;
float _ConstructGap;
float3 viewDir;
int building;
struct Input
{
float2 uv_MainTex;
float3 worldPos;
float3 viewDir;
};
inline half4 LightingUnlit (SurfaceOutput s, half3 lightDir, half atten)
{
if(building) return _ConstructColor;
if(dot(s.Normal, viewDir) < 0 ) return _ConstructColor;
half4 c = half4(1,1,1,1);
c.rgb = s.Albedo;
c.a = s.Alpha;
return c;
}
void surf (Input IN, inout SurfaceOutput o)
{
viewDir = IN.viewDir;
// float s = +sin((IN.worldPos.x * IN.worldPos.z) * 10 + _Time[3] + o.Normal) / 120;
float3 localPos = IN.worldPos - mul(unity_ObjectToWorld, float4(0,0,0,1)).xyz;
float s = +sin((localPos.x * localPos.z) * 10 + _Time[3] + o.Normal) / 120;
// if (IN.worldPos.y > _ConstructY + s + _ConstructGap) discard;
if (localPos.y > _ConstructY + s + _ConstructGap) discard;
// if(IN.worldPos.y < _ConstructY)
if(localPos.y < _ConstructY)
{
half4 c = tex2D (_MainTex, IN.uv_MainTex);
o.Albedo = c.rgb;
o.Alpha = c.a;
building = 0;
}
else
{
o.Albedo = _ConstructColor.rgb;
o.Alpha = _ConstructColor.a;
o.Alpha = 1.0f;
building = 1;
}
}
ENDCG
}
FallBack "Diffuse"
}
mais c'est toi le sniper du Forum !! hahaha avec Max