Copie depuis Unity VCS vers GitHub

This commit is contained in:
Denis L.
2025-12-10 18:51:40 +01:00
parent 5cfd9de581
commit 7383621db3
902 changed files with 588195 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c71f37d0280f9e24cb1028bf5f5a4318
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: ab249bb4f6c5bad41afde3165b0f98b9
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}

View File

@@ -0,0 +1,117 @@
Shader "Custom/UI_Masque"
{
Properties
{
_MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
// Propriétés requises pour l'UI Unity
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
}
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
"ForceStereoDrawCall"="True"
}
// C'est ici qu'on force l'écriture dans le Pochoir (Stencil)
Stencil
{
Ref 1 // On écrit le chiffre 1
Comp Always // Toujours (peu importe ce qu'il y avait avant)
Pass Replace // On remplace la valeur existante par 1
}
Cull Off
Lighting Off
ZWrite Off
ZTest [unity_GUIZTestMode]
Blend SrcAlpha OneMinusSrcAlpha
// MAGIE : ColorMask 0 empêche le dessin des couleurs (Rend l'objet invisible)
ColorMask 0
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#include "UnityShaderVariables.cginc"
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
float4 worldPosition : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
};
sampler2D _MainTex;
fixed4 _Color;
float4 _MainTex_ST;
fixed4 _TextureSampleAdd;
v2f vert(appdata_t v)
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
o.worldPosition = v.vertex;
o.vertex = UnityObjectToClipPos(o.worldPosition);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
o.color = v.color * _Color;
return o;
}
fixed4 frag(v2f i) : SV_Target
{
// On lit la texture (le sprite flou)
half4 color = (tex2D(_MainTex, i.texcoord) + _TextureSampleAdd) * i.color;
// Ancien code : Détecte le bord et lisse la coupure avec une largeur dynamique.
// float alphaWidth = fwidth(color.a) * 0.5;
// NOUVEAU CODE : Rayon de flou plus grand pour le smoothstep.
// Nous définissons une largeur de lissage fixe et légèrement plus grande (0.001)
// pour garantir la présence du lissage.
float alphaWidth = fwidth(color.a) * 3.0; // Multiplier fwidth par 1.5 ou 2.0
if (alphaWidth < 0.001) alphaWidth = 0.001; // S'assurer qu'il y a toujours un minimum de flou
// Utilise smoothstep pour lisser la coupure alpha
float smoothedAlpha = smoothstep(0.0, alphaWidth, color.a);
// Coupure finale pour le Stencil (on ne veut pas écrire dans le pochoir si c'est transparent)
// On utilise la valeur lissée.
clip (smoothedAlpha - 0.01);
return color; // ColorMask 0 empêche le dessin de la couleur
}
ENDCG
}
}
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: ca8928164d5f11042802759025fe69a7
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,94 @@
Shader "Custom/UI_Peinture"
{
Properties
{
_MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1) // Réglez votre Alpha (54/255) ici dans le matériau
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
}
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
"ForceStereoDrawCall"="True"
}
// C'est ici qu'on vérifie le Pochoir
Stencil
{
Ref 1 // On cherche le chiffre 1
Comp Equal // On dessine SEULEMENT si la valeur est égale à 1
}
Cull Off
Lighting Off
ZWrite Off
ZTest [unity_GUIZTestMode]
Blend SrcAlpha OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#include "UnityShaderVariables.cginc"
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
float4 worldPosition : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
};
fixed4 _Color;
v2f vert(appdata_t v)
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
o.worldPosition = v.vertex;
o.vertex = UnityObjectToClipPos(o.worldPosition);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.texcoord = v.texcoord;
o.color = _Color;
return o;
}
fixed4 frag(v2f i) : SV_Target
{
// On renvoie la couleur passée par le vertex shader
return i.color;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 26fffa4494d1573488412b39b243dd4a
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant: