you can see that in the realtime shadow the bumps look like dimples.
How can I fix that?
Note: it’s on a terrain
Shader "Ground Shader With Bliss - No Vertex Color" {
Properties
{
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
_BlissTexVeryBad ("Very Bad Bliss", 2D) = "red" {}
_BlissTexNeutral ("Neutral Bliss", 2D) = "white" {}
_BlissTexVeryGood ("Very Good Bliss", 2D) = "green" {}
_OutlineColor ("Outline Color", Color) = (0,0,0,1)
_Outline ("Outline width", float) = .005
_BlissBadNrm ("Bad Bliss Normal", 2D) = "red" {}
_BlissNeutralNrm ("Neutral Bliss Normal", 2D) = "white" {}
_BlissGoodNrm ("Good Bliss Normal", 2D) = "green" {}
}
// for desktop ------------
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 900
CGPROGRAM
#pragma surface surf Lambert halfasview vertex:vert addshadow fullforwardshadows
#pragma target 3.0
struct Input
{
half2 uv_BlissTexVeryBad;
float3 worldPos;
};
void vert (inout appdata_full v, out Input o) {
UNITY_INITIALIZE_OUTPUT(Input,o);
}
sampler2D _BlissMap;
sampler2D _BlissTexNeutral;
sampler2D _BlissTexVeryBad;
sampler2D _BlissTexVeryGood;
fixed _BlissMapSize;
sampler2D _BlissBadNrm, _BlissNeutralNrm, _BlissGoodNrm ;
float3 blend_udn(float4 n1, float4 n2)
{
float3 c = float3(2, 1, 0);
float3 r;
r = n2*c.yyz + n1.xyz;
r = r*c.xxx - c.xxy;
return normalize(r);
}
void surf (Input IN, inout SurfaceOutput o)
{
// bliss
fixed2 w = half2(_BlissMapSize*.5 + IN.worldPos.x, _BlissMapSize*.5 + IN.worldPos.z);
fixed2 pos = half2(w[0]/_BlissMapSize, w[1]/_BlissMapSize);
// take bliss value, add texture based on it
fixed bliss = tex2D(_BlissMap,pos).a;
half4 c1 = tex2D(_BlissTexVeryBad, IN.uv_BlissTexVeryBad);
fixed a1 = max(1 - bliss*2, 0);
// NEGATIVE BLISS EFFECT
// comment both for just blended - 1
fixed threshold = 1-c1.a;
a1 = max(step(threshold, a1), min(a1/threshold, 1)); // threshold, blended mk 2- 4
half4 c = c1*a1;
c1 = tex2D(_BlissTexVeryGood, IN.uv_BlissTexVeryBad);
fixed a5 = max(bliss*2-1,0);
// POSITIVE BLISS EFFECT
// comment both for just blended - 1
threshold = 1-c1.a;
a5 = max(step(threshold, a5), min(a5/threshold, 1)); // threshold, blended mk 2- 4
c += c1*a5;
c1=tex2D(_BlissTexNeutral, IN.uv_BlissTexVeryBad);
fixed a3 = max(1-(a1+a5),0);
c += c1*a3;
//total
o.Albedo = c.rgb*1;
o.Emission += c.a *c.rgb;
half4 cn;
//cn = tex2D (_BlissBadNrm, IN.uv_BlissTexVeryBad) * a1;
//cn += tex2D (_BlissGoodNrm, IN.uv_BlissTexVeryBad) * a5;
//cn += tex2D (_BlissNeutralNrm, IN.uv_BlissTexVeryBad) * a3;
cn = tex2D (_BlissGoodNrm, IN.uv_BlissTexVeryBad);
o.Normal = UnpackNormal (cn);
}
ENDCG
UsePass "Toon/Basic Outline/OUTLINE"
}