ARPG scene assets from old project are now correctly visualizing sectors generated by ZoneGenerator and updated by GameContext
68 lines
1.9 KiB
Text
68 lines
1.9 KiB
Text
Shader "Aetheria/Dithered Particles"
|
|
{
|
|
Properties
|
|
{
|
|
[HDR]_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 { "RenderType"="Opaque" }
|
|
LOD 200
|
|
|
|
CGPROGRAM
|
|
#include "Dither Functions.cginc"
|
|
// Physically based Standard lighting model, and enable shadows on all light types
|
|
#pragma surface surf Standard vertex:vert
|
|
|
|
// Use shader model 3.0 target, to get nicer looking lighting
|
|
#pragma target 3.0
|
|
|
|
sampler2D _MainTex;
|
|
|
|
struct appdata_particles {
|
|
float4 vertex : POSITION;
|
|
float3 normal : NORMAL;
|
|
float4 color : COLOR;
|
|
float4 texcoord : TEXCOORD0;
|
|
};
|
|
|
|
struct Input {
|
|
float2 uv_MainTex;
|
|
float2 ditherOffset;
|
|
float4 color;
|
|
float4 screenPos;
|
|
};
|
|
|
|
void vert(inout appdata_particles v, out Input o) {
|
|
UNITY_INITIALIZE_OUTPUT(Input,o);
|
|
o.uv_MainTex = v.texcoord.xy;
|
|
o.ditherOffset = v.texcoord.zw;
|
|
o.color = v.color;
|
|
}
|
|
|
|
half _Glossiness;
|
|
half _Metallic;
|
|
fixed4 _Color;
|
|
|
|
void surf (Input IN, inout SurfaceOutputStandard o)
|
|
{
|
|
// Albedo comes from a texture tinted by color
|
|
fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
|
|
|
|
// Apply screen space dithering
|
|
float2 screenUV = IN.screenPos.xy / IN.screenPos.w;
|
|
ditherClip(screenUV + IN.ditherOffset, c.a);
|
|
o.Emission = c.rgb;
|
|
|
|
// Metallic and smoothness come from slider variables
|
|
o.Metallic = _Metallic;
|
|
o.Smoothness = _Glossiness;
|
|
o.Alpha = 1;
|
|
}
|
|
ENDCG
|
|
}
|
|
FallBack "Diffuse"
|
|
}
|