Add shaders

This commit is contained in:
Williams
2026-05-19 15:33:18 +02:00
committed by Lucien
parent 593c2e75b2
commit cd9df45d08
1358 changed files with 2429155 additions and 0 deletions
@@ -1,341 +0,0 @@
Shader "Standard_Backface"
{
Properties
{
_Color("Color", Color) = (1,1,1,1)
_MainTex("Albedo", 2D) = "white" {}
_Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5
_Glossiness("Smoothness", Range(0.0, 1.0)) = 0.5
_GlossMapScale("Smoothness Scale", Range(0.0, 1.0)) = 1.0
[Enum(Metallic Alpha,0,Albedo Alpha,1)] _SmoothnessTextureChannel ("Smoothness texture channel", Float) = 0
[Gamma] _Metallic("Metallic", Range(0.0, 1.0)) = 0.0
_MetallicGlossMap("Metallic", 2D) = "white" {}
[ToggleOff] _SpecularHighlights("Specular Highlights", Float) = 1.0
[ToggleOff] _GlossyReflections("Glossy Reflections", Float) = 1.0
_BumpScale("Scale", Float) = 1.0
_BumpMap("Normal Map", 2D) = "bump" {}
_Parallax ("Height Scale", Range (0.005, 0.08)) = 0.02
_ParallaxMap ("Height Map", 2D) = "black" {}
_OcclusionStrength("Strength", Range(0.0, 1.0)) = 1.0
_OcclusionMap("Occlusion", 2D) = "white" {}
_EmissionColor("Color", Color) = (0,0,0)
_EmissionMap("Emission", 2D) = "white" {}
_DetailMask("Detail Mask", 2D) = "white" {}
_DetailAlbedoMap("Detail Albedo x2", 2D) = "grey" {}
_DetailNormalMapScale("Scale", Float) = 1.0
_DetailNormalMap("Normal Map", 2D) = "bump" {}
[Enum(UV0,0,UV1,1)] _UVSec ("UV Set for secondary textures", Float) = 0
// Blending state
[HideInInspector] _Mode ("__mode", Float) = 0.0
[HideInInspector] _SrcBlend ("__src", Float) = 1.0
[HideInInspector] _DstBlend ("__dst", Float) = 0.0
[HideInInspector] _ZWrite ("__zw", Float) = 1.0
}
CGINCLUDE
#define UNITY_SETUP_BRDF_INPUT MetallicSetup
ENDCG
SubShader
{
Tags { "RenderType"="Opaque" "PerformanceChecks"="False" }
LOD 300
// ------------------------------------------------------------------
// Base forward pass (directional light, emission, lightmaps, ...)
Pass
{
Name "FORWARD"
Tags { "LightMode" = "ForwardBase" }
Blend [_SrcBlend] [_DstBlend]
ZWrite [_ZWrite]
Cull Off
CGPROGRAM
#pragma target 3.0
// -------------------------------------
#pragma shader_feature _NORMALMAP
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
#pragma shader_feature _EMISSION
#pragma shader_feature _METALLICGLOSSMAP
#pragma shader_feature ___ _DETAIL_MULX2
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
#pragma shader_feature _ _GLOSSYREFLECTIONS_OFF
#pragma shader_feature _PARALLAXMAP
#pragma multi_compile_fwdbase
#pragma multi_compile_fog
#pragma vertex vertBase
#pragma fragment fragBase
#include "UnityStandardCoreForward.cginc"
ENDCG
}
// ------------------------------------------------------------------
// Additive forward pass (one light per pass)
Pass
{
Name "FORWARD_DELTA"
Tags { "LightMode" = "ForwardAdd" }
Blend [_SrcBlend] One
Fog { Color (0,0,0,0) } // in additive pass fog should be black
ZWrite Off
ZTest LEqual
CGPROGRAM
#pragma target 3.0
// -------------------------------------
#pragma shader_feature _NORMALMAP
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
#pragma shader_feature _METALLICGLOSSMAP
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
#pragma shader_feature ___ _DETAIL_MULX2
#pragma shader_feature _PARALLAXMAP
#pragma multi_compile_fwdadd_fullshadows
#pragma multi_compile_fog
#pragma vertex vertAdd
#pragma fragment fragAdd
#include "UnityStandardCoreForward.cginc"
ENDCG
}
// ------------------------------------------------------------------
// Shadow rendering pass
Pass {
Name "ShadowCaster"
Tags { "LightMode" = "ShadowCaster" }
ZWrite On ZTest LEqual
CGPROGRAM
#pragma target 3.0
// -------------------------------------
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
#pragma shader_feature _METALLICGLOSSMAP
#pragma shader_feature _PARALLAXMAP
#pragma multi_compile_shadowcaster
#pragma vertex vertShadowCaster
#pragma fragment fragShadowCaster
#include "UnityStandardShadow.cginc"
ENDCG
}
// ------------------------------------------------------------------
// Deferred pass
Pass
{
Name "DEFERRED"
Tags { "LightMode" = "Deferred" }
Cull Off
CGPROGRAM
#pragma target 3.0
#pragma exclude_renderers nomrt
// -------------------------------------
#pragma shader_feature _NORMALMAP
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
#pragma shader_feature _EMISSION
#pragma shader_feature _METALLICGLOSSMAP
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
#pragma shader_feature ___ _DETAIL_MULX2
#pragma shader_feature _PARALLAXMAP
#pragma multi_compile ___ UNITY_HDR_ON
#pragma multi_compile ___ LIGHTMAP_ON
#pragma multi_compile ___ DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE
#pragma multi_compile ___ DYNAMICLIGHTMAP_ON
#pragma vertex vertDeferred
#pragma fragment fragDeferred
#include "UnityStandardCore.cginc"
ENDCG
}
// ------------------------------------------------------------------
// Extracts information for lightmapping, GI (emission, albedo, ...)
// This pass it not used during regular rendering.
Pass
{
Name "META"
Tags { "LightMode"="Meta" }
Cull Off
CGPROGRAM
#pragma vertex vert_meta
#pragma fragment frag_meta
#pragma shader_feature _EMISSION
#pragma shader_feature _METALLICGLOSSMAP
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
#pragma shader_feature ___ _DETAIL_MULX2
#include "UnityStandardMeta.cginc"
ENDCG
}
}
SubShader
{
Tags { "RenderType"="Opaque" "PerformanceChecks"="False" }
LOD 150
// ------------------------------------------------------------------
// Base forward pass (directional light, emission, lightmaps, ...)
Pass
{
Name "FORWARD"
Tags { "LightMode" = "ForwardBase" }
Cull Off
Blend [_SrcBlend] [_DstBlend]
ZWrite [_ZWrite]
CGPROGRAM
#pragma target 2.0
#pragma shader_feature _NORMALMAP
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
#pragma shader_feature _EMISSION
#pragma shader_feature _METALLICGLOSSMAP
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
#pragma shader_feature _ _GLOSSYREFLECTIONS_OFF
// SM2.0: NOT SUPPORTED shader_feature ___ _DETAIL_MULX2
// SM2.0: NOT SUPPORTED shader_feature _PARALLAXMAP
#pragma skip_variants SHADOWS_SOFT DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE
#pragma multi_compile_fwdbase
#pragma multi_compile_fog
#pragma vertex vertBase
#pragma fragment fragBase
#include "UnityStandardCoreForward.cginc"
ENDCG
}
// ------------------------------------------------------------------
// Additive forward pass (one light per pass)
Pass
{
Name "FORWARD_DELTA"
Tags { "LightMode" = "ForwardAdd" }
Blend [_SrcBlend] One
Fog { Color (0,0,0,0) } // in additive pass fog should be black
ZWrite Off
ZTest LEqual
CGPROGRAM
#pragma target 2.0
#pragma shader_feature _NORMALMAP
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
#pragma shader_feature _METALLICGLOSSMAP
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
#pragma shader_feature ___ _DETAIL_MULX2
// SM2.0: NOT SUPPORTED shader_feature _PARALLAXMAP
#pragma skip_variants SHADOWS_SOFT
#pragma multi_compile_fwdadd_fullshadows
#pragma multi_compile_fog
#pragma vertex vertAdd
#pragma fragment fragAdd
#include "UnityStandardCoreForward.cginc"
ENDCG
}
// ------------------------------------------------------------------
// Shadow rendering pass
Pass {
Name "ShadowCaster"
Tags { "LightMode" = "ShadowCaster" }
ZWrite On ZTest LEqual
CGPROGRAM
#pragma target 2.0
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
#pragma shader_feature _METALLICGLOSSMAP
#pragma skip_variants SHADOWS_SOFT
#pragma multi_compile_shadowcaster
#pragma vertex vertShadowCaster
#pragma fragment fragShadowCaster
#include "UnityStandardShadow.cginc"
ENDCG
}
// ------------------------------------------------------------------
// Extracts information for lightmapping, GI (emission, albedo, ...)
// This pass it not used during regular rendering.
Pass
{
Name "META"
Tags { "LightMode"="Meta" }
Cull Off
CGPROGRAM
#pragma vertex vert_meta
#pragma fragment frag_meta
#pragma shader_feature _EMISSION
#pragma shader_feature _METALLICGLOSSMAP
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
#pragma shader_feature ___ _DETAIL_MULX2
#include "UnityStandardMeta.cginc"
ENDCG
}
}
FallBack "VertexLit"
CustomEditor "StandardShaderGUI"
}
@@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 119ac94a72f186a42a8a5f96ba6ce254
timeCreated: 1505848045
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -1,163 +0,0 @@
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
// Simple 2 Pass Hair Shader
// This shader blends a solid cutout and fade shader to try and produce reasonable looking hair.
// Made with components from the: Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "UMA/Hair Fade Cutout"
{
Properties
{
[HideInInspector] __dirty( "", Int ) = 1
_MainTex("Diffuse/Alpha Map", 2D) = "white" {}
_MaskClipValue( "Cotout Clip Value", Range( 0 , 1) ) = 0.7
_BumpMap("Normal Map", 2D) = "bump" {}
_BumpStrength("Bump Strength", Range( 0 , 1)) = 0.4
_MetallicStrength("Metallic Strength", Range (0,1) ) = 0.5
_MetallicAdd("Metallic Add", Range (0,1) ) = 0.0
_SmoothnessStrength("Smoothness Strength", Range (0,1)) = 0.5
_SmoothnessAdd("Smoothness Add",Range(0,1)) = 0.0
_MetallicGlossMap("Metallic Gloss Map", 2D) = "white" {}
_FadeFactor("Fade Factor", Range(0,2)) = 2.0
[HideInInspector] _texcoord( "", 2D ) = "white" {}
}
SubShader
{
Tags{ "RenderType" = "TransparentCutout" "Queue" = "AlphaTest+0" }
Cull Back
CGINCLUDE
#include "UnityStandardUtils.cginc"
#include "UnityPBSLighting.cginc"
#include "Lighting.cginc"
#pragma target 3.0
struct Input
{
float2 uv_texcoord;
};
uniform float _MetallicAdd;
uniform float _MetallicStrength;
uniform float _SmoothnessStrength;
uniform float _SmoothnessAdd;
uniform float _BumpStrength;
uniform sampler2D _BumpMap;
uniform float4 _BumpMap_ST;
uniform sampler2D _MainTex;
uniform float4 _MainTex_ST;
uniform sampler2D _MetallicGlossMap;
uniform float4 _MetallicGlossMap_ST;
uniform float _MaskClipValue = 0.5;
uniform float _FadeFactor;
void surf( Input i , inout SurfaceOutputStandard o )
{
float2 uv_BumpMap = i.uv_texcoord * _BumpMap_ST.xy + _BumpMap_ST.zw;
o.Normal = UnpackScaleNormal( tex2D( _BumpMap,uv_BumpMap) ,_BumpStrength );
float2 uv_MainTex = i.uv_texcoord * _MainTex_ST.xy + _MainTex_ST.zw;
float4 tex2DNode1 = tex2D( _MainTex,uv_MainTex);
o.Albedo = tex2DNode1.xyz;
float2 uv_MetallicGlossMap = i.uv_texcoord * _MetallicGlossMap_ST.xy + _MetallicGlossMap_ST.zw;
o.Metallic = _MetallicAdd + (tex2D( _MetallicGlossMap,uv_MetallicGlossMap).x * _MetallicStrength);
o.Smoothness = _SmoothnessAdd + (tex2D(_MetallicGlossMap, uv_MetallicGlossMap).a * _SmoothnessStrength);
o.Alpha = tex2DNode1.a;
clip( tex2DNode1.a - _MaskClipValue );
}
ENDCG
CGPROGRAM
#pragma surface surf Standard keepalpha
ENDCG
Tags{ "RenderType" = "Transparent" "Queue" = "Transparent+0" "IgnoreProjector" = "True" }
Cull Off
ZTEST Less
CGINCLUDE
#include "UnityStandardUtils.cginc"
#include "UnityPBSLighting.cginc"
#include "Lighting.cginc"
#pragma target 3.0
void surf2( Input i , inout SurfaceOutputStandard o )
{
float2 uv_BumpMap = i.uv_texcoord * _BumpMap_ST.xy + _BumpMap_ST.zw;
o.Normal = UnpackScaleNormal( tex2D( _BumpMap,uv_BumpMap) ,_BumpStrength );
float2 uv_MainTex = i.uv_texcoord * _MainTex_ST.xy + _MainTex_ST.zw;
float4 tex2DNode1 = tex2D( _MainTex,uv_MainTex);
o.Albedo = tex2DNode1.xyz;
float2 uv_MetallicGlossMap = i.uv_texcoord * _MetallicGlossMap_ST.xy + _MetallicGlossMap_ST.zw;
// o.Metallic = tex2D( _MetallicGlossMap,uv_MetallicGlossMap).x * _MetallicStrength;
o.Metallic = _MetallicAdd + (tex2D(_MetallicGlossMap, uv_MetallicGlossMap).x * _MetallicStrength);
o.Smoothness = _SmoothnessAdd + (tex2D(_MetallicGlossMap, uv_MetallicGlossMap).a * _SmoothnessStrength);
o.Alpha = tex2DNode1.a * _FadeFactor;
}
ENDCG
CGPROGRAM
#pragma surface surf2 Standard alpha:fade keepalpha
ENDCG
Pass
{
Name "ShadowCaster"
Tags{ "LightMode" = "ShadowCaster" }
ZWrite On
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 3.0
#pragma multi_compile_shadowcaster
#pragma multi_compile UNITY_PASS_SHADOWCASTER
#pragma skip_variants FOG_LINEAR FOG_EXP FOG_EXP2
# include "HLSLSupport.cginc"
#include "UnityCG.cginc"
#include "Lighting.cginc"
#include "UnityPBSLighting.cginc"
sampler3D _DitherMaskLOD;
struct v2f
{
V2F_SHADOW_CASTER;
float3 worldPos : TEXCOORD6;
float4 tSpace0 : TEXCOORD1;
float4 tSpace1 : TEXCOORD2;
float4 tSpace2 : TEXCOORD3;
float4 texcoords01 : TEXCOORD4;
};
v2f vert( appdata_full v )
{
v2f o;
UNITY_INITIALIZE_OUTPUT( v2f, o );
float3 worldPos = mul( unity_ObjectToWorld, v.vertex ).xyz;
half3 worldNormal = UnityObjectToWorldNormal( v.normal );
fixed3 worldTangent = UnityObjectToWorldDir( v.tangent.xyz );
fixed tangentSign = v.tangent.w * unity_WorldTransformParams.w;
fixed3 worldBinormal = cross( worldNormal, worldTangent ) * tangentSign;
o.tSpace0 = float4( worldTangent.x, worldBinormal.x, worldNormal.x, worldPos.x );
o.tSpace1 = float4( worldTangent.y, worldBinormal.y, worldNormal.y, worldPos.y );
o.tSpace2 = float4( worldTangent.z, worldBinormal.z, worldNormal.z, worldPos.z );
o.texcoords01 = float4( v.texcoord.xy, v.texcoord1.xy );
o.worldPos = worldPos;
TRANSFER_SHADOW_CASTER_NORMALOFFSET( o )
return o;
}
fixed4 frag( v2f IN ) : SV_Target
{
Input surfIN;
UNITY_INITIALIZE_OUTPUT( Input, surfIN );
surfIN.uv_texcoord = IN.texcoords01.xy;
float3 worldPos = IN.worldPos;
fixed3 worldViewDir = normalize( UnityWorldSpaceViewDir( worldPos ) );
SurfaceOutputStandard o;
UNITY_INITIALIZE_OUTPUT( SurfaceOutputStandard, o )
surf( surfIN, o );
SHADOW_CASTER_FRAGMENT( IN )
}
ENDCG
}
}
FallBack "Legacy Shaders/Transparent/Cutout/Bumped Diffuse"
}
@@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: d56eff61c40904d78becb18c718ce22e
timeCreated: 1488417028
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -1,100 +0,0 @@
// Simple 2 Pass Hair Shader
// This shader blends a solid cutout and fade shader to try and produce reasonable looking hair.
// Made with components from the: Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "UMA/Hair Fade2 Cutout"
{
Properties
{
[HideInInspector] __dirty( "", Int ) = 1
_MainTex("Diffuse/Alpha Map", 2D) = "white" {}
_MaskClipValue( "Cotout Clip Value", Range( 0 , 1) ) = 0.7
_BumpMap("Normal Map", 2D) = "bump" {}
_BumpStrength("Bump Strength", Range( 0 , 1)) = 0.4
_MetallicStrength("Metallic Strength", Range (0,1) ) = 0.5
_MetallicAdd("Metallic Add", Range (0,1) ) = 0.0
_SmoothnessStrength("Smoothness Strength", Range (0,1)) = 0.5
_SmoothnessAdd("Smoothness Add",Range(0,1)) = 0.0
_MetallicGlossMap("Metallic Gloss Map", 2D) = "white" {}
[HideInInspector] _texcoord( "", 2D ) = "white" {}
}
SubShader
{
Tags{ "RenderType" = "TransparentCutout" "Queue" = "AlphaTest+0" }
Cull Back
CGINCLUDE
#include "UnityStandardUtils.cginc"
#include "UnityPBSLighting.cginc"
#include "Lighting.cginc"
#pragma target 3.0
struct Input
{
float2 uv_texcoord;
};
uniform float _MetallicAdd;
uniform float _MetallicStrength;
uniform float _SmoothnessStrength;
uniform float _SmoothnessAdd;
uniform float _BumpStrength;
uniform sampler2D _BumpMap;
uniform float4 _BumpMap_ST;
uniform sampler2D _MainTex;
uniform float4 _MainTex_ST;
uniform sampler2D _MetallicGlossMap;
uniform float4 _MetallicGlossMap_ST;
uniform float _MaskClipValue = 0.5;
void surf( Input i , inout SurfaceOutputStandard o )
{
float2 uv_BumpMap = i.uv_texcoord;// *_BumpMap_ST.xy + _BumpMap_ST.zw;
o.Normal = UnpackScaleNormal( tex2D( _BumpMap,uv_BumpMap) ,_BumpStrength );
float2 uv_MainTex = i.uv_texcoord;// *_MainTex_ST.xy + _MainTex_ST.zw;
float4 tex2DNode1 = tex2D( _MainTex,uv_MainTex);
o.Albedo = tex2DNode1.xyz;
float2 uv_MetallicGlossMap = i.uv_texcoord;// *_MetallicGlossMap_ST.xy + _MetallicGlossMap_ST.zw;
o.Metallic = _MetallicAdd + (tex2D( _MetallicGlossMap,uv_MetallicGlossMap).x * _MetallicStrength);
// o.Metallic = _MetallicAdd + (tex2D(_MetallicGlossMap, uv_MetallicGlossMap).x * _MetallicStrength);
o.Smoothness = _SmoothnessAdd + (tex2D(_MetallicGlossMap, uv_MetallicGlossMap).a * _SmoothnessStrength);
o.Alpha = tex2DNode1.a;
clip( tex2DNode1.a - _MaskClipValue );
}
ENDCG
CGPROGRAM
#pragma surface surf Standard addshadow
ENDCG
Tags{ "RenderType" = "Transparent" "Queue" = "Transparent+0" "IgnoreProjector" = "True" }
Cull Back
CGINCLUDE
#include "UnityStandardUtils.cginc"
#include "UnityPBSLighting.cginc"
#include "Lighting.cginc"
#pragma target 3.0
void surf2( Input i , inout SurfaceOutputStandard o )
{
float2 uv_BumpMap = i.uv_texcoord;// *_BumpMap_ST.xy + _BumpMap_ST.zw;
o.Normal = UnpackScaleNormal( tex2D( _BumpMap,uv_BumpMap) ,_BumpStrength );
float2 uv_MainTex = i.uv_texcoord;// *_MainTex_ST.xy + _MainTex_ST.zw;
float4 tex2DNode1 = tex2D( _MainTex,uv_MainTex);
o.Albedo = tex2DNode1.xyz;
float2 uv_MetallicGlossMap = i.uv_texcoord;// *_MetallicGlossMap_ST.xy + _MetallicGlossMap_ST.zw;
o.Metallic = _MetallicAdd + (tex2D(_MetallicGlossMap, uv_MetallicGlossMap).x * _MetallicStrength);
o.Smoothness = _SmoothnessAdd + (tex2D(_MetallicGlossMap, uv_MetallicGlossMap).a * _SmoothnessStrength);
o.Alpha = tex2DNode1.a;
}
ENDCG
CGPROGRAM
#pragma surface surf2 Standard alpha:fade keepalpha addshadow
ENDCG
}
FallBack "Legacy Shaders/Transparent/Cutout/Bumped Diffuse"
}
@@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 5efdaebb940ef7b4bb5dcad3bf6b78d8
timeCreated: 1498161407
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -1,102 +0,0 @@
// Simple 2 Pass Hair Shader (Single Sided)
// This shader blends a solid cutout and fade shader to try and produce reasonable looking hair.
// Made with components from the: Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "UMA/Hair Fade Cutout (Single Sided)"
{
Properties
{
[HideInInspector] __dirty( "", Int ) = 1
_MainTex("Diffuse/Alpha Map", 2D) = "white" {}
_MaskClipValue( "Cotout Clip Value", Range( 0 , 1) ) = 0.7
_BumpMap("Normal Map", 2D) = "bump" {}
_BumpStrength("Bump Strength", Range( 0 , 1)) = 0.4
_MetallicStrength("Metallic Strength", Range (0,1) ) = 0.5
_MetallicAdd("Metallic Add", Range (0,1) ) = 0.0
_SmoothnessStrength("Smoothness Strength", Range (0,1)) = 0.5
_SmoothnessAdd("Smoothness Add",Range(0,1)) = 0.0
_MetallicGlossMap("Metallic Gloss Map", 2D) = "white" {}
_FadeFactor("Fade Factor", Range(0,2)) = 2.0
[HideInInspector] _texcoord( "", 2D ) = "white" {}
}
SubShader
{
Tags{ "RenderType" = "TransparentCutout" "Queue" = "AlphaTest+0" }
Cull Back
CGINCLUDE
#include "UnityStandardUtils.cginc"
#include "UnityPBSLighting.cginc"
#include "Lighting.cginc"
#pragma target 3.0
struct Input
{
float2 uv_texcoord;
};
uniform float _MetallicAdd;
uniform float _MetallicStrength;
uniform float _SmoothnessStrength;
uniform float _SmoothnessAdd;
uniform float _BumpStrength;
uniform sampler2D _BumpMap;
uniform float4 _BumpMap_ST;
uniform sampler2D _MainTex;
uniform float4 _MainTex_ST;
uniform sampler2D _MetallicGlossMap;
uniform float4 _MetallicGlossMap_ST;
uniform float _MaskClipValue = 0.5;
uniform float _FadeFactor;
void surf( Input i , inout SurfaceOutputStandard o )
{
float2 uv_BumpMap = i.uv_texcoord;// *_BumpMap_ST.xy + _BumpMap_ST.zw;
o.Normal = UnpackScaleNormal( tex2D( _BumpMap,uv_BumpMap) ,_BumpStrength );
float2 uv_MainTex = i.uv_texcoord;// *_MainTex_ST.xy + _MainTex_ST.zw;
float4 tex2DNode1 = tex2D( _MainTex,uv_MainTex);
o.Albedo = tex2DNode1.xyz;
float2 uv_MetallicGlossMap = i.uv_texcoord;// *_MetallicGlossMap_ST.xy + _MetallicGlossMap_ST.zw;
o.Metallic = _MetallicAdd + (tex2D( _MetallicGlossMap,uv_MetallicGlossMap).x * _MetallicStrength);
// o.Metallic = _MetallicAdd + (tex2D(_MetallicGlossMap, uv_MetallicGlossMap).x * _MetallicStrength);
o.Smoothness = _SmoothnessAdd + (tex2D(_MetallicGlossMap, uv_MetallicGlossMap).a * _SmoothnessStrength);
o.Alpha = tex2DNode1.a;
clip( tex2DNode1.a - _MaskClipValue );
}
ENDCG
CGPROGRAM
#pragma surface surf Standard addshadow
ENDCG
Tags{ "RenderType" = "Transparent" "Queue" = "Transparent+0" "IgnoreProjector" = "True" }
Cull Back
CGINCLUDE
#include "UnityStandardUtils.cginc"
#include "UnityPBSLighting.cginc"
#include "Lighting.cginc"
#pragma target 3.0
void surf2( Input i , inout SurfaceOutputStandard o )
{
float2 uv_BumpMap = i.uv_texcoord;// *_BumpMap_ST.xy + _BumpMap_ST.zw;
o.Normal = UnpackScaleNormal( tex2D( _BumpMap,uv_BumpMap) ,_BumpStrength );
float2 uv_MainTex = i.uv_texcoord;// *_MainTex_ST.xy + _MainTex_ST.zw;
float4 tex2DNode1 = tex2D( _MainTex,uv_MainTex);
o.Albedo = tex2DNode1.xyz;
float2 uv_MetallicGlossMap = i.uv_texcoord;// *_MetallicGlossMap_ST.xy + _MetallicGlossMap_ST.zw;
o.Metallic = _MetallicAdd + (tex2D(_MetallicGlossMap, uv_MetallicGlossMap).x * _MetallicStrength);
o.Smoothness = _SmoothnessAdd + (tex2D(_MetallicGlossMap, uv_MetallicGlossMap).a * _SmoothnessStrength);
o.Alpha = tex2DNode1.a * _FadeFactor;
}
ENDCG
CGPROGRAM
#pragma surface surf2 Standard alpha:fade keepalpha addshadow
ENDCG
}
FallBack "Legacy Shaders/Transparent/Cutout/Bumped Diffuse"
}
@@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 0b87e405f94845c4b81d32f132cda54b
timeCreated: 1499382514
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -1,163 +0,0 @@
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
// Simple 2 Pass Hair Shader
// This shader blends a solid cutout and fade shader to try and produce reasonable looking hair.
// Made with components from the: Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Hair Pack/Hair Fade Cutout"
{
Properties
{
[HideInInspector] __dirty( "", Int ) = 1
_MainTex("Diffuse/Alpha Map", 2D) = "white" {}
_MaskClipValue( "Cotout Clip Value", Range( 0 , 1) ) = 0.7
_BumpMap("Normal Map", 2D) = "bump" {}
_BumpStrength("Bump Strength", Range( 0 , 1)) = 0.4
_MetallicStrength("Metallic Strength", Range (0,1) ) = 0.5
_MetallicAdd("Metallic Add", Range (0,1) ) = 0.0
_SmoothnessStrength("Smoothness Strength", Range (0,1)) = 0.5
_SmoothnessAdd("Smoothness Add",Range(0,1)) = 0.0
_MetallicGlossMap("Metallic Gloss Map", 2D) = "white" {}
_FadeFactor("Fade Factor", Range(0,2)) = 2.0
[HideInInspector] _texcoord( "", 2D ) = "white" {}
}
SubShader
{
Tags{ "RenderType" = "TransparentCutout" "Queue" = "AlphaTest+0" }
Cull Back
CGINCLUDE
#include "UnityStandardUtils.cginc"
#include "UnityPBSLighting.cginc"
#include "Lighting.cginc"
#pragma target 3.0
struct Input
{
float2 uv_texcoord;
};
uniform float _MetallicAdd;
uniform float _MetallicStrength;
uniform float _SmoothnessStrength;
uniform float _SmoothnessAdd;
uniform float _BumpStrength;
uniform sampler2D _BumpMap;
uniform float4 _BumpMap_ST;
uniform sampler2D _MainTex;
uniform float4 _MainTex_ST;
uniform sampler2D _MetallicGlossMap;
uniform float4 _MetallicGlossMap_ST;
uniform float _MaskClipValue = 0.5;
uniform float _FadeFactor;
void surf( Input i , inout SurfaceOutputStandard o )
{
float2 uv_BumpMap = i.uv_texcoord * _BumpMap_ST.xy + _BumpMap_ST.zw;
o.Normal = UnpackScaleNormal( tex2D( _BumpMap,uv_BumpMap) ,_BumpStrength );
float2 uv_MainTex = i.uv_texcoord * _MainTex_ST.xy + _MainTex_ST.zw;
float4 tex2DNode1 = tex2D( _MainTex,uv_MainTex);
o.Albedo = tex2DNode1.xyz;
float2 uv_MetallicGlossMap = i.uv_texcoord * _MetallicGlossMap_ST.xy + _MetallicGlossMap_ST.zw;
o.Metallic = _MetallicAdd + (tex2D( _MetallicGlossMap,uv_MetallicGlossMap).x * _MetallicStrength);
o.Smoothness = _SmoothnessAdd + (tex2D(_MetallicGlossMap, uv_MetallicGlossMap).a * _SmoothnessStrength);
o.Alpha = tex2DNode1.a;
clip( tex2DNode1.a - _MaskClipValue );
}
ENDCG
CGPROGRAM
#pragma surface surf Standard keepalpha
ENDCG
Tags{ "RenderType" = "Transparent" "Queue" = "Transparent+0" "IgnoreProjector" = "True" }
Cull Off
ZTEST Less
CGINCLUDE
#include "UnityStandardUtils.cginc"
#include "UnityPBSLighting.cginc"
#include "Lighting.cginc"
#pragma target 3.0
void surf2( Input i , inout SurfaceOutputStandard o )
{
float2 uv_BumpMap = i.uv_texcoord * _BumpMap_ST.xy + _BumpMap_ST.zw;
o.Normal = UnpackScaleNormal( tex2D( _BumpMap,uv_BumpMap) ,_BumpStrength );
float2 uv_MainTex = i.uv_texcoord * _MainTex_ST.xy + _MainTex_ST.zw;
float4 tex2DNode1 = tex2D( _MainTex,uv_MainTex);
o.Albedo = tex2DNode1.xyz;
float2 uv_MetallicGlossMap = i.uv_texcoord * _MetallicGlossMap_ST.xy + _MetallicGlossMap_ST.zw;
// o.Metallic = tex2D( _MetallicGlossMap,uv_MetallicGlossMap).x * _MetallicStrength;
o.Metallic = _MetallicAdd + (tex2D(_MetallicGlossMap, uv_MetallicGlossMap).x * _MetallicStrength);
o.Smoothness = _SmoothnessAdd + (tex2D(_MetallicGlossMap, uv_MetallicGlossMap).a * _SmoothnessStrength);
o.Alpha = tex2DNode1.a * _FadeFactor;
}
ENDCG
CGPROGRAM
#pragma surface surf2 Standard alpha:fade keepalpha
ENDCG
Pass
{
Name "ShadowCaster"
Tags{ "LightMode" = "ShadowCaster" }
ZWrite On
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 3.0
#pragma multi_compile_shadowcaster
#pragma multi_compile UNITY_PASS_SHADOWCASTER
#pragma skip_variants FOG_LINEAR FOG_EXP FOG_EXP2
# include "HLSLSupport.cginc"
#include "UnityCG.cginc"
#include "Lighting.cginc"
#include "UnityPBSLighting.cginc"
sampler3D _DitherMaskLOD;
struct v2f
{
V2F_SHADOW_CASTER;
float3 worldPos : TEXCOORD6;
float4 tSpace0 : TEXCOORD1;
float4 tSpace1 : TEXCOORD2;
float4 tSpace2 : TEXCOORD3;
float4 texcoords01 : TEXCOORD4;
};
v2f vert( appdata_full v )
{
v2f o;
UNITY_INITIALIZE_OUTPUT( v2f, o );
float3 worldPos = mul( unity_ObjectToWorld, v.vertex ).xyz;
half3 worldNormal = UnityObjectToWorldNormal( v.normal );
fixed3 worldTangent = UnityObjectToWorldDir( v.tangent.xyz );
fixed tangentSign = v.tangent.w * unity_WorldTransformParams.w;
fixed3 worldBinormal = cross( worldNormal, worldTangent ) * tangentSign;
o.tSpace0 = float4( worldTangent.x, worldBinormal.x, worldNormal.x, worldPos.x );
o.tSpace1 = float4( worldTangent.y, worldBinormal.y, worldNormal.y, worldPos.y );
o.tSpace2 = float4( worldTangent.z, worldBinormal.z, worldNormal.z, worldPos.z );
o.texcoords01 = float4( v.texcoord.xy, v.texcoord1.xy );
o.worldPos = worldPos;
TRANSFER_SHADOW_CASTER_NORMALOFFSET( o )
return o;
}
fixed4 frag( v2f IN ) : SV_Target
{
Input surfIN;
UNITY_INITIALIZE_OUTPUT( Input, surfIN );
surfIN.uv_texcoord = IN.texcoords01.xy;
float3 worldPos = IN.worldPos;
fixed3 worldViewDir = normalize( UnityWorldSpaceViewDir( worldPos ) );
SurfaceOutputStandard o;
UNITY_INITIALIZE_OUTPUT( SurfaceOutputStandard, o )
surf( surfIN, o );
SHADOW_CASTER_FRAGMENT( IN )
}
ENDCG
}
}
FallBack "Legacy Shaders/Transparent/Cutout/Bumped Diffuse"
}
@@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 3eed4732656879043a425298da909c90
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant: