80 lines
2.3 KiB
Plaintext
80 lines
2.3 KiB
Plaintext
Shader "VolumetricFogAndMist/VolumetricFog" {
|
|
Properties {
|
|
_MainTex ("Base (RGB)", 2D) = "white" {}
|
|
_NoiseTex ("Noise (RGB)", 2D) = "white" {}
|
|
_FogAlpha ("Alpha", Range(0, 1)) = 1
|
|
_FogDistance ("Distance", Vector) = (0,1,1000,0)
|
|
_FogData ("Fog Data", Vector) = (0,1,1,1)
|
|
_Color ("Fog Color", Vector) = (0.9,0.9,0.9,1)
|
|
_FogSkyColor ("Sky Color", Vector) = (0.9,0.9,0.9,0.8)
|
|
_FogSkyData ("Sky Haze Data", Vector) = (50,0,0.3,0.999)
|
|
_FogWindDir ("Wind Direction", Vector) = (1,0,0,1)
|
|
_FogStepping ("Fog andStepping", Vector) = (0.0833333,1,0.0005,1)
|
|
_FogVoidPosition ("Fog Void Position", Vector) = (0,0,0,1)
|
|
_FogVoidData ("Fog Void Data", Vector) = (0,0,0,1)
|
|
_FogAreaPosition ("Fog Area Position", Vector) = (0,0,0,1)
|
|
_FogAreaData ("Fog Area Data", Vector) = (0,0,0,1)
|
|
_FogOfWarCenter ("Fog Of War Center", Vector) = (0,0,0,1)
|
|
_FogOfWarCenterAdjusted ("Fog Of War Center Adj", Vector) = (0,0,0,1)
|
|
_FogOfWarSize ("Fog Of War Size", Vector) = (1,1,1,1)
|
|
_FogOfWar ("Fog of War Mask", 2D) = "white" {}
|
|
_SunPosition ("Sun Position", Vector) = (0,0,0,1)
|
|
_SunDir ("Sun Direction", Vector) = (0,0,0,1)
|
|
_SunColor ("Sun Color", Vector) = (1,1,1,1)
|
|
_ClipDir ("Camera View Dir", Vector) = (0,0,1,1)
|
|
_Jitter ("Jittering", Float) = 0
|
|
_PointLightInsideAtten ("Point Light Inside Atten", Float) = 5
|
|
}
|
|
//DummyShaderTextExporter
|
|
SubShader{
|
|
Tags { "RenderType"="Opaque" }
|
|
LOD 200
|
|
|
|
Pass
|
|
{
|
|
HLSLPROGRAM
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
float4x4 unity_ObjectToWorld;
|
|
float4x4 unity_MatrixVP;
|
|
float4 _MainTex_ST;
|
|
|
|
struct Vertex_Stage_Input
|
|
{
|
|
float4 pos : POSITION;
|
|
float2 uv : TEXCOORD0;
|
|
};
|
|
|
|
struct Vertex_Stage_Output
|
|
{
|
|
float2 uv : TEXCOORD0;
|
|
float4 pos : SV_POSITION;
|
|
};
|
|
|
|
Vertex_Stage_Output vert(Vertex_Stage_Input input)
|
|
{
|
|
Vertex_Stage_Output output;
|
|
output.uv = (input.uv.xy * _MainTex_ST.xy) + _MainTex_ST.zw;
|
|
output.pos = mul(unity_MatrixVP, mul(unity_ObjectToWorld, input.pos));
|
|
return output;
|
|
}
|
|
|
|
Texture2D<float4> _MainTex;
|
|
SamplerState sampler_MainTex;
|
|
float4 _Color;
|
|
|
|
struct Fragment_Stage_Input
|
|
{
|
|
float2 uv : TEXCOORD0;
|
|
};
|
|
|
|
float4 frag(Fragment_Stage_Input input) : SV_TARGET
|
|
{
|
|
return _MainTex.Sample(sampler_MainTex, input.uv.xy) * _Color;
|
|
}
|
|
|
|
ENDHLSL
|
|
}
|
|
}
|
|
} |