Removed hard zone boundaries Fixed stuff that broke because of hard zone boundary assumption (stardust placement, vertical fog) Added a skybox! Removed density-based albedo boost (_TintExponent) to improve perceptual uniformity at different step sizes, reconfigured shader to achieve / surpass previous looks and performance Cell Brush has a material editor now to enable variant selection Enabled Caching Shader Preprocessor Moved raymarching loop into CloudShader Get environment settings from game manager to enable configuration / variation Introduced slope-based nebulae damping and volumetric flow Hid optional volumetric features behind preprocessor branches Created shader variants selected by global keywords for all shaders depending on volumetrics Environment settings used to configure shader variant selection Moved dynamic lighting settings to own subclass Dynamically adjust gravity map isoline contour depth range according to zone contents
77 lines
1.6 KiB
Text
77 lines
1.6 KiB
Text
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
|
|
|
|
Shader "Brushes/Simplex Brush"
|
|
{
|
|
Properties {
|
|
_Depth ("Depth", Float) = 0.5
|
|
_Power("Envelope Power", Float) = 1.25
|
|
_Frequency("Frequency", Float) = 2
|
|
_Speed("Speed", Float) = 1
|
|
_Constant ("Constant", Float) = 0.5
|
|
}
|
|
|
|
Category {
|
|
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" }
|
|
Blend One One
|
|
ColorMask RGB
|
|
Cull Off Lighting Off ZWrite Off
|
|
|
|
SubShader {
|
|
Pass {
|
|
|
|
CGPROGRAM
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
#pragma target 2.0
|
|
|
|
#include "UnityCG.cginc"
|
|
#include "Assets/Plugins/GPU Noise/SimplexNoise3D.cginc"
|
|
|
|
float _Depth;
|
|
float _Power;
|
|
float _Frequency;
|
|
float _Speed;
|
|
float _Constant;
|
|
|
|
struct appdata_t {
|
|
float4 vertex : POSITION;
|
|
fixed4 color : COLOR;
|
|
float2 texcoord : TEXCOORD0;
|
|
};
|
|
|
|
struct v2f {
|
|
float4 vertex : SV_POSITION;
|
|
fixed4 color : COLOR;
|
|
float2 texcoord : TEXCOORD0;
|
|
float2 texcoord1 : TEXCOORD1;
|
|
};
|
|
|
|
float4 _MainTex_ST;
|
|
|
|
v2f vert (appdata_t v)
|
|
{
|
|
v2f o;
|
|
o.vertex = UnityObjectToClipPos(v.vertex);
|
|
o.color = v.color;
|
|
o.texcoord = v.texcoord;
|
|
o.texcoord1 = mul(unity_ObjectToWorld, v.vertex).xz;
|
|
return o;
|
|
}
|
|
|
|
|
|
float powerPulse( float x, float power )
|
|
{
|
|
x = saturate(abs(x));
|
|
return pow((x + 1.0f) * (1.0f - x), power);
|
|
}
|
|
|
|
fixed4 frag (v2f i) : SV_Target
|
|
{
|
|
float dist = length(i.texcoord - float2(.5,.5));
|
|
return powerPulse(dist * 2,_Power) * (_Depth * abs(snoise(float3(i.texcoord1.xy*_Frequency,_Time.y*_Speed)))+_Constant);
|
|
}
|
|
ENDCG
|
|
}
|
|
}
|
|
}
|
|
}
|