Add shaders
This commit is contained in:
@@ -1,56 +0,0 @@
|
||||
Shader "Enviro/Particles/Lit Weather" {
|
||||
Properties{
|
||||
_TintColor("Tint Color", Color) = (1,1,1,1)
|
||||
_MainTex("Particle Texture", 2D) = "white" {}
|
||||
_Intensity("Intensity", Range(1,100)) = 10
|
||||
|
||||
}
|
||||
SubShader{
|
||||
Tags{ "RenderType" = "Transparent" "Queue" = "Transparent" }
|
||||
LOD 200
|
||||
|
||||
CGPROGRAM
|
||||
#pragma surface surf Standard alpha:fade finalcolor:ApplyFog
|
||||
#pragma target 3.0
|
||||
|
||||
sampler2D _MainTex;
|
||||
#include "../../Resources/Shaders/Core/EnviroFogCore.cginc"
|
||||
struct Input {
|
||||
float2 uv_MainTex;
|
||||
fixed4 color : COLOR;
|
||||
float4 screenPos;
|
||||
float3 worldPos;
|
||||
};
|
||||
|
||||
fixed4 _TintColor;
|
||||
float _Intensity;
|
||||
|
||||
void ApplyFog(Input IN, SurfaceOutputStandard o, inout fixed4 color)
|
||||
{
|
||||
//Get ScreenPosition
|
||||
float3 uvscreen = IN.screenPos.xyz / IN.screenPos.w;
|
||||
// Calculate Linear Depth
|
||||
half linear01Depth = Linear01Depth(uvscreen.z);
|
||||
//get World Position
|
||||
float3 wPos = IN.worldPos.xyz;
|
||||
// Calculate Fog and apply volume lighting tex
|
||||
float4 fogClr = TransparentFog(color, wPos, uvscreen.xy, linear01Depth);
|
||||
|
||||
#if _ALPHAPREMULTIPLY_ON
|
||||
fogClr.rgb *= o.Alpha;
|
||||
#endif
|
||||
|
||||
#ifndef UNITY_PASS_FORWARDADD
|
||||
color.rgb = fogClr.rgb;
|
||||
#endif
|
||||
}
|
||||
|
||||
void surf(Input IN, inout SurfaceOutputStandard o) {
|
||||
fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * (IN.color * _TintColor);
|
||||
o.Albedo = c.rgb * _Intensity;
|
||||
o.Alpha = c.a;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
FallBack "Diffuse"
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 12af3ffc6c4bf5242a04cc4d8dea12e1
|
||||
timeCreated: 1541339377
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,90 +0,0 @@
|
||||
Shader "Enviro/Particles/Additive" {
|
||||
Properties {
|
||||
_MainTex ("Particle Texture", 2D) = "white" {}
|
||||
_InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0
|
||||
}
|
||||
|
||||
Category {
|
||||
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" }
|
||||
Blend One OneMinusSrcColor
|
||||
ColorMask RGB
|
||||
Cull Off Lighting Off ZWrite Off
|
||||
|
||||
SubShader {
|
||||
Pass {
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma target 2.0
|
||||
#pragma exclude_renderers gles
|
||||
#pragma multi_compile_particles
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "../../Resources/Shaders/Core/EnviroFogCore.cginc"
|
||||
|
||||
sampler2D _MainTex;
|
||||
fixed4 _TintColor;
|
||||
|
||||
struct appdata_t {
|
||||
float4 vertex : POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct v2f {
|
||||
float4 vertex : SV_POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
UNITY_FOG_COORDS(1)
|
||||
float4 projPos : TEXCOORD2;
|
||||
float3 posWorld : TEXCOORD3;
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.posWorld = mul(unity_ObjectToWorld, v.vertex);
|
||||
o.projPos = ComputeScreenPos (o.vertex);
|
||||
COMPUTE_EYEDEPTH(o.projPos.z);
|
||||
o.color = v.color;
|
||||
o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex);
|
||||
UNITY_TRANSFER_FOG(o,o.vertex);
|
||||
return o;
|
||||
}
|
||||
|
||||
UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture);
|
||||
float _InvFade;
|
||||
|
||||
fixed4 frag (v2f i) : SV_Target
|
||||
{
|
||||
float sceneZ = LinearEyeDepth (SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos)));
|
||||
|
||||
#ifdef SOFTPARTICLES_ON
|
||||
float partZ = i.projPos.z;
|
||||
float fade = saturate (_InvFade * (sceneZ-partZ));
|
||||
i.color.a *= fade;
|
||||
#endif
|
||||
|
||||
half4 col = i.color * tex2D(_MainTex, i.texcoord);
|
||||
col.rgb *= col.a;
|
||||
UNITY_APPLY_FOG_COLOR(i.fogCoord, col, fixed4(0,0,0,0)); // fog towards black due to our blend mode
|
||||
|
||||
//half linear01Depth = LinearEyeDepth(i.projPos.z);
|
||||
float4 fog = TransparentFog(col,i.posWorld,i.projPos.xy,sceneZ);
|
||||
fog.rgb *= col.rgb;
|
||||
return fog;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 83de0fc6fdb60ae4f879ec2a0d1e18fd
|
||||
timeCreated: 1506252156
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
-90
@@ -1,90 +0,0 @@
|
||||
Shader "Enviro/Particles/Alpha Blended" {
|
||||
Properties {
|
||||
_TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5)
|
||||
_MainTex ("Particle Texture", 2D) = "white" {}
|
||||
_InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0
|
||||
}
|
||||
|
||||
Category {
|
||||
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" }
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
ColorMask RGB
|
||||
Cull Off Lighting Off ZWrite Off
|
||||
|
||||
SubShader {
|
||||
Pass {
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma target 2.0
|
||||
#pragma multi_compile_particles
|
||||
#pragma multi_compile_fog
|
||||
#pragma exclude_renderers gles
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "../../Resources/Shaders/Core/EnviroFogCore.cginc"
|
||||
|
||||
sampler2D _MainTex;
|
||||
fixed4 _TintColor;
|
||||
|
||||
struct appdata_t {
|
||||
float4 vertex : POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct v2f {
|
||||
float4 vertex : SV_POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
UNITY_FOG_COORDS(1)
|
||||
float4 projPos : TEXCOORD2;
|
||||
float3 posWorld : TEXCOORD3;
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.posWorld = mul(unity_ObjectToWorld, v.vertex);
|
||||
o.projPos = ComputeScreenPos (o.vertex);
|
||||
COMPUTE_EYEDEPTH(o.projPos.z);
|
||||
o.color = v.color * _TintColor;
|
||||
o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex);
|
||||
UNITY_TRANSFER_FOG(o,o.vertex);
|
||||
return o;
|
||||
}
|
||||
|
||||
UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture);
|
||||
float _InvFade;
|
||||
|
||||
fixed4 frag (v2f i) : SV_Target
|
||||
{
|
||||
|
||||
float sceneZ = LinearEyeDepth (SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos)));
|
||||
|
||||
#ifdef SOFTPARTICLES_ON
|
||||
float partZ = i.projPos.z;
|
||||
float fade = saturate (_InvFade * (sceneZ-partZ));
|
||||
i.color.a *= fade;
|
||||
#endif
|
||||
|
||||
fixed4 col = 2.0f * i.color * tex2D(_MainTex, i.texcoord);
|
||||
UNITY_APPLY_FOG(i.fogCoord, col);
|
||||
|
||||
float4 fog = TransparentFog(col,i.posWorld,i.projPos.xy,sceneZ);
|
||||
|
||||
return float4(fog.rgb,col.a);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4b46c5cd78fad2b4bb7e182ea4f565d4
|
||||
timeCreated: 1506436501
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
-95
@@ -1,95 +0,0 @@
|
||||
Shader "Enviro/Particles/Lightning" {
|
||||
Properties {
|
||||
_MainTex ("Particle Texture", 2D) = "white" {}
|
||||
_InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0
|
||||
_Intensity("Brightness", float) = 250
|
||||
|
||||
}
|
||||
|
||||
Category {
|
||||
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" }
|
||||
Blend One OneMinusSrcColor
|
||||
ColorMask RGB
|
||||
Cull Off Lighting Off ZWrite Off
|
||||
|
||||
SubShader {
|
||||
Pass {
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma target 2.0
|
||||
#pragma multi_compile_particles
|
||||
#pragma multi_compile_fog
|
||||
#pragma exclude_renderers gles
|
||||
#include "UnityCG.cginc"
|
||||
#include "../../Resources/Shaders/Core/EnviroFogCore.cginc"
|
||||
|
||||
sampler2D _MainTex;
|
||||
fixed4 _TintColor;
|
||||
|
||||
struct appdata_t {
|
||||
float4 vertex : POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct v2f {
|
||||
float4 vertex : SV_POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
UNITY_FOG_COORDS(1)
|
||||
float4 projPos : TEXCOORD2;
|
||||
float3 posWorld : TEXCOORD3;
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.posWorld = mul(unity_ObjectToWorld, v.vertex);
|
||||
o.projPos = ComputeScreenPos (o.vertex);
|
||||
COMPUTE_EYEDEPTH(o.projPos.z);
|
||||
o.color = v.color;
|
||||
o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex);
|
||||
UNITY_TRANSFER_FOG(o,o.vertex);
|
||||
return o;
|
||||
}
|
||||
|
||||
UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture);
|
||||
float _InvFade;
|
||||
float _Intensity;
|
||||
|
||||
fixed4 frag (v2f i) : SV_Target
|
||||
{
|
||||
float sceneZ = LinearEyeDepth (SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos)));
|
||||
|
||||
#ifdef SOFTPARTICLES_ON
|
||||
float partZ = i.projPos.z;
|
||||
float fade = saturate (_InvFade * (sceneZ-partZ));
|
||||
i.color.a *= fade;
|
||||
#endif
|
||||
|
||||
half4 col = i.color * tex2D(_MainTex, i.texcoord);
|
||||
col.rgb *= _Intensity;
|
||||
col.rgb *= col.a;
|
||||
UNITY_APPLY_FOG_COLOR(i.fogCoord, col, fixed4(0,0,0,0)); // fog towards black due to our blend mode
|
||||
|
||||
//half linear01Depth = LinearEyeDepth(i.projPos.z);
|
||||
float4 fog = TransparentFog(col,i.posWorld, i.projPos.xy,sceneZ);
|
||||
fog.rgb *= col.rgb;
|
||||
return fog;
|
||||
|
||||
//return col;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: db239a9a1eba8f3459e2cb60bd1ec552
|
||||
timeCreated: 1506252156
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,94 +0,0 @@
|
||||
Shader "Enviro/Particles/WeatherParticles" {
|
||||
Properties {
|
||||
_TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5)
|
||||
_MainTex ("Particle Texture", 2D) = "white" {}
|
||||
//_InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0
|
||||
_lightIntensity ("Light Intensity", Range(0.0,1.0)) = 1.0
|
||||
}
|
||||
|
||||
Category {
|
||||
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
ColorMask RGBA
|
||||
Cull Off Lighting Off ZWrite Off
|
||||
|
||||
SubShader {
|
||||
Pass {
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma target 3.0
|
||||
#pragma multi_compile_particles
|
||||
#pragma multi_compile_fog
|
||||
#pragma exclude_renderers gles
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "../../Resources/Shaders/Core/EnviroFogCore.cginc"
|
||||
|
||||
sampler2D _MainTex;
|
||||
fixed4 _TintColor;
|
||||
float4 _EnviroLighting;
|
||||
float _lightIntensity;
|
||||
|
||||
struct appdata_t {
|
||||
float4 vertex : POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct v2f {
|
||||
float4 vertex : SV_POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
UNITY_FOG_COORDS(1)
|
||||
float4 projPos : TEXCOORD2;
|
||||
float3 posWorld : TEXCOORD3;
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.posWorld = mul(unity_ObjectToWorld, v.vertex);
|
||||
o.projPos = ComputeScreenPos (o.vertex);
|
||||
COMPUTE_EYEDEPTH(o.projPos.z);
|
||||
o.color = v.color;
|
||||
o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex);
|
||||
UNITY_TRANSFER_FOG(o,o.vertex);
|
||||
return o;
|
||||
}
|
||||
|
||||
UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture);
|
||||
//float _InvFade;
|
||||
|
||||
fixed4 frag (v2f i) : SV_Target
|
||||
{
|
||||
|
||||
float sceneZ = LinearEyeDepth (SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos)));
|
||||
|
||||
#ifdef SOFTPARTICLES_ON
|
||||
float partZ = i.projPos.z;
|
||||
float fade = saturate (0.5 * (sceneZ-partZ));
|
||||
i.color.a *= fade;
|
||||
#endif
|
||||
|
||||
fixed4 col = 2.0f * i.color * _TintColor * tex2D(_MainTex, i.texcoord);
|
||||
col *= _EnviroLighting * _lightIntensity;
|
||||
UNITY_APPLY_FOG(i.fogCoord, col);
|
||||
|
||||
float4 fog = TransparentFog(col,i.posWorld,i.projPos.xy,sceneZ);
|
||||
|
||||
return float4(fog.rgb,col.a);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: acc6584263b225742a2e39740a470be8
|
||||
timeCreated: 1472601408
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
-97
@@ -1,97 +0,0 @@
|
||||
Shader "Enviro/Particles/WeatherParticlesAdditive" {
|
||||
Properties {
|
||||
_TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5)
|
||||
_MainTex ("Particle Texture", 2D) = "white" {}
|
||||
_InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0
|
||||
_lightIntensity ("Light Intensity", Range(0.0,1.0)) = 1.0
|
||||
}
|
||||
|
||||
Category {
|
||||
Tags{ "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" "PreviewType" = "Plane" }
|
||||
Blend One OneMinusSrcColor
|
||||
ColorMask RGB
|
||||
Cull Off Lighting Off ZWrite Off
|
||||
|
||||
SubShader {
|
||||
Pass {
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma target 3.0
|
||||
#pragma multi_compile_particles
|
||||
#pragma multi_compile_fog
|
||||
#pragma exclude_renderers gles
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "../../Resources/Shaders/Core/EnviroFogCore.cginc"
|
||||
|
||||
sampler2D _MainTex;
|
||||
fixed4 _TintColor;
|
||||
float4 _EnviroLighting;
|
||||
float _lightIntensity;
|
||||
float _InvFade;
|
||||
|
||||
struct appdata_t {
|
||||
float4 vertex : POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct v2f {
|
||||
float4 vertex : SV_POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
UNITY_FOG_COORDS(1)
|
||||
float4 projPos : TEXCOORD2;
|
||||
float3 posWorld : TEXCOORD3;
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.posWorld = mul(unity_ObjectToWorld, v.vertex);
|
||||
o.projPos = ComputeScreenPos (o.vertex);
|
||||
COMPUTE_EYEDEPTH(o.projPos.z);
|
||||
o.color = v.color;
|
||||
o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex);
|
||||
UNITY_TRANSFER_FOG(o,o.vertex);
|
||||
return o;
|
||||
}
|
||||
|
||||
UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture);
|
||||
//float _InvFade;
|
||||
|
||||
fixed4 frag (v2f i) : SV_Target
|
||||
{
|
||||
float sceneZ = LinearEyeDepth(SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos)));
|
||||
|
||||
#ifdef SOFTPARTICLES_ON
|
||||
float partZ = i.projPos.z;
|
||||
float fade = saturate(_InvFade * (sceneZ - partZ));
|
||||
i.color.a *= fade;
|
||||
#endif
|
||||
|
||||
half4 col = i.color * tex2D(_MainTex, i.texcoord);
|
||||
col.rgb *= _EnviroLighting * 1.5;
|
||||
col.rgb *= col.a;
|
||||
|
||||
UNITY_APPLY_FOG_COLOR(i.fogCoord, col, fixed4(0, 0, 0, 0)); // fog towards black due to our blend mode
|
||||
|
||||
//half linear01Depth = LinearEyeDepth(i.projPos.z);
|
||||
float4 fog = TransparentFog(col, i.posWorld, i.projPos.xy, sceneZ);
|
||||
fog.rgb *= col.rgb;
|
||||
return fog;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7887324a897cd4d4b89d3e52af0d1e46
|
||||
timeCreated: 1472601408
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,66 +0,0 @@
|
||||
Shader "Enviro/StandardAlphaBlended"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_Color ("Color", Color) = (1,1,1,1)
|
||||
_MainTex ("Albedo (RGB)", 2D) = "white" {}
|
||||
_Glossiness ("Smoothness", Range(0,1)) = 0.5
|
||||
_Metallic ("Metallic", Range(0,1)) = 0.0
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Tags {"Queue" = "Transparent" "RenderType"="Transparent" }
|
||||
LOD 200
|
||||
|
||||
CGPROGRAM
|
||||
#include "../../Resources/Shaders/Core/EnviroFogCore.cginc"
|
||||
#pragma surface surf Standard fullforwardshadows alpha finalcolor:ApplyFog
|
||||
#pragma target 3.0
|
||||
|
||||
|
||||
|
||||
sampler2D _MainTex;
|
||||
sampler2D _CameraDepthTexture;
|
||||
|
||||
struct Input {
|
||||
float2 uv_MainTex;
|
||||
float4 screenPos;
|
||||
float3 worldPos;
|
||||
};
|
||||
|
||||
void ApplyFog(Input IN, SurfaceOutputStandard o, inout fixed4 color)
|
||||
{
|
||||
//Get ScreenPosition
|
||||
float3 uvscreen = IN.screenPos.xyz/IN.screenPos.w;
|
||||
// Calculate Linear Depth
|
||||
half linear01Depth = Linear01Depth(uvscreen.z);
|
||||
//get World Position
|
||||
float3 wPos = IN.worldPos.xyz;
|
||||
// Calculate Fog and apply volume lighting tex
|
||||
float4 fogClr = TransparentFog(color,wPos, uvscreen.xy, linear01Depth);
|
||||
|
||||
#if _ALPHAPREMULTIPLY_ON
|
||||
fogClr.rgb *= o.Alpha;
|
||||
#endif
|
||||
|
||||
#ifndef UNITY_PASS_FORWARDADD
|
||||
color.rgb = fogClr.rgb;
|
||||
#endif
|
||||
}
|
||||
|
||||
half _Glossiness;
|
||||
half _Metallic;
|
||||
fixed4 _Color;
|
||||
|
||||
void surf (Input IN, inout SurfaceOutputStandard o)
|
||||
{
|
||||
fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
|
||||
o.Albedo = c.rgb;
|
||||
o.Metallic = _Metallic;
|
||||
o.Smoothness = _Glossiness;
|
||||
o.Alpha = c.a;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
FallBack "Standard"
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 58f17004d23396448827417fe395f149
|
||||
timeCreated: 1506388388
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user