Files
T-VIR-901_EpiLeARn/Assets/TextMesh Pro/Shaders/TMPro.cginc
clement 5ca3d16a29 Squashed commit of the following:
commit 807aa8c3c6
Merge: 34f74aa 3777d06
Author: Clement <clement@jo85.com>
Date:   Thu Jan 18 12:02:57 2024 +0100

    Merge pull request 'add Atomes Factory' (#10) from feature/AtomesFactory into develop

    Reviewed-on: #10
    Reviewed-by: Clement <clement@jo85.com>

commit 3777d06a0e
Author: Mathis <mathis.ragot@epitech.eu>
Date:   Thu Jan 18 12:00:00 2024 +0100

    Rename Classname

commit 16bd5bfb6c
Merge: da9d57b 34f74aa
Author: Mathis <mathis.ragot@epitech.eu>
Date:   Thu Jan 18 11:46:03 2024 +0100

    Merge remote-tracking branch 'origin/develop' into feature/AtomesFactory

commit da9d57b0bb
Author: Mathis <mathis.ragot@epitech.eu>
Date:   Thu Jan 18 11:44:22 2024 +0100

    vue foria config

commit 5346e596c8
Author: Mathis <mathis.ragot@epitech.eu>
Date:   Thu Jan 18 11:28:02 2024 +0100

    [feature/AtomesFactory] - remove testing file

commit f613217658
Author: Mathis <mathis.ragot@epitech.eu>
Date:   Thu Jan 18 10:38:59 2024 +0100

    [feature/AtomesFactory] - Add json for atomes

commit bc2b9e02fd
Author: Mathis <mathis.ragot@epitech.eu>
Date:   Fri Jan 12 15:37:09 2024 +0100

    add Atomes Factory

commit 34f74aa443
Merge: 8b6d07f f181fd9
Author: Nicolas <nicolas.sansd@gmail.com>
Date:   Fri Jan 12 11:50:43 2024 +0100

    Merge pull request 'feature/multi_targets' (#7) from feature/multi_targets into develop

    Reviewed-on: #7
    Reviewed-by: Clement <clement@jo85.com>

commit f181fd9935
Author: Nicolas <nicolas.sansd@gmail.com>
Date:   Fri Jan 12 11:50:10 2024 +0100

    fix du mauvais nom de scene dans le script ChangeScene.cs

commit 1c76868eee
Merge: f1ec062 8b6d07f
Author: Nicolas <nicolas.sansd@gmail.com>
Date:   Fri Jan 12 11:39:02 2024 +0100

    Merge remote-tracking branch 'origin/develop' into feature/multi_targets

commit f1ec062047
Author: Nicolas <nicolas.sansd@gmail.com>
Date:   Fri Jan 12 11:37:29 2024 +0100

    ajout du font fallback

commit 9c23975b20
Author: Nicolas <nicolas.sansd@gmail.com>
Date:   Fri Jan 12 11:36:49 2024 +0100

    rajouts des fonts text mesh pro

commit aff9df22cf
Merge: a791273 73394e5
Author: Nicolas <nicolas.sansd@gmail.com>
Date:   Fri Jan 12 11:03:32 2024 +0100

    Merge remote-tracking branch 'origin/develop' into feature/multi_targets

commit a7912733e5
Author: Nicolas <nicolas.sansd@gmail.com>
Date:   Fri Jan 12 10:54:51 2024 +0100

    Ajout dans le canvas d'éléments UI (nom, description....)

commit 0313fe28a1
Author: Nicolas <nicolas.sansd@gmail.com>
Date:   Fri Jan 12 09:57:07 2024 +0100

    Suppression du build de la CI

commit 5237a32bb4
Author: Nicolas <nicolas.sansd@gmail.com>
Date:   Thu Jan 11 16:18:35 2024 +0100

    ajout de la keystore de debug (user) + changement de la target version d'android

commit afa265dd31
Author: Nicolas <nicolas.sansd@gmail.com>
Date:   Thu Jan 11 11:26:53 2024 +0100

    Affichage des molécules unitairement et en mode fusion

commit 84136dcc5c
Author: Nicolas <nicolas.sansd@gmail.com>
Date:   Fri Dec 22 15:05:47 2023 +0100

    MAJ du fichier d'action build.yaml

commit ce3c956544
Author: Nicolas <nicolas.sansd@gmail.com>
Date:   Fri Dec 22 15:02:10 2023 +0100

    MAJ du fichier d'action build.yaml

commit 8f105732f7
Author: Nicolas <nicolas.sansd@gmail.com>
Date:   Fri Dec 22 14:36:52 2023 +0100

    Ajout de la multitarget pour générer un préfab
2024-01-18 14:00:09 +01:00

85 lines
2.2 KiB
HLSL

float2 UnpackUV(float uv)
{
float2 output;
output.x = floor(uv / 4096);
output.y = uv - 4096 * output.x;
return output * 0.001953125;
}
fixed4 GetColor(half d, fixed4 faceColor, fixed4 outlineColor, half outline, half softness)
{
half faceAlpha = 1-saturate((d - outline * 0.5 + softness * 0.5) / (1.0 + softness));
half outlineAlpha = saturate((d + outline * 0.5)) * sqrt(min(1.0, outline));
faceColor.rgb *= faceColor.a;
outlineColor.rgb *= outlineColor.a;
faceColor = lerp(faceColor, outlineColor, outlineAlpha);
faceColor *= faceAlpha;
return faceColor;
}
float3 GetSurfaceNormal(float4 h, float bias)
{
bool raisedBevel = step(1, fmod(_ShaderFlags, 2));
h += bias+_BevelOffset;
float bevelWidth = max(.01, _OutlineWidth+_BevelWidth);
// Track outline
h -= .5;
h /= bevelWidth;
h = saturate(h+.5);
if(raisedBevel) h = 1 - abs(h*2.0 - 1.0);
h = lerp(h, sin(h*3.141592/2.0), _BevelRoundness);
h = min(h, 1.0-_BevelClamp);
h *= _Bevel * bevelWidth * _GradientScale * -2.0;
float3 va = normalize(float3(1.0, 0.0, h.y - h.x));
float3 vb = normalize(float3(0.0, -1.0, h.w - h.z));
return cross(va, vb);
}
float3 GetSurfaceNormal(float2 uv, float bias, float3 delta)
{
// Read "height field"
float4 h = {tex2D(_MainTex, uv - delta.xz).a,
tex2D(_MainTex, uv + delta.xz).a,
tex2D(_MainTex, uv - delta.zy).a,
tex2D(_MainTex, uv + delta.zy).a};
return GetSurfaceNormal(h, bias);
}
float3 GetSpecular(float3 n, float3 l)
{
float spec = pow(max(0.0, dot(n, l)), _Reflectivity);
return _SpecularColor.rgb * spec * _SpecularPower;
}
float4 GetGlowColor(float d, float scale)
{
float glow = d - (_GlowOffset*_ScaleRatioB) * 0.5 * scale;
float t = lerp(_GlowInner, (_GlowOuter * _ScaleRatioB), step(0.0, glow)) * 0.5 * scale;
glow = saturate(abs(glow/(1.0 + t)));
glow = 1.0-pow(glow, _GlowPower);
glow *= sqrt(min(1.0, t)); // Fade off glow thinner than 1 screen pixel
return float4(_GlowColor.rgb, saturate(_GlowColor.a * glow * 2));
}
float4 BlendARGB(float4 overlying, float4 underlying)
{
overlying.rgb *= overlying.a;
underlying.rgb *= underlying.a;
float3 blended = overlying.rgb + ((1-overlying.a)*underlying.rgb);
float alpha = underlying.a + (1-underlying.a)*overlying.a;
return float4(blended, alpha);
}