Hi guys i made a simple script to generate BillboardAssets from anything
Now the problem is that its too dark when facing away from light source.


This can be fixed if i crank up ambient lighting

So when ambient is at max it looks just like it should at normal
I am using a slightly cut down version of SpeedTreeBillboard shader
from which i removed crap like wind and hue,
now my idea is to force it to have max ambient value,
but i am unable to find the way to do so.
If i simply insert o.Emission = … it says its a wrong subscript, but the doc says use Emission,
so im out of ideas on how to achieve this.
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
Shader "BillboardMaker/Billboard"
{
Properties
{
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
[MaterialEnum(None,0,Fastest,1)] _WindQuality ("Wind Quality", Range(0,1)) = 0
}
// targeting SM3.0+
SubShader
{
Tags
{
"Queue"="AlphaTest"
"IgnoreProjector"="True"
"RenderType"="TransparentCutout"
"DisableBatching"="LODFading"
}
LOD 400
CGPROGRAM
#pragma surface surf Lambert vertex:SpeedTreeBillboardVert nolightmap addshadow dithercrossfade
#pragma target 3.0
#pragma multi_compile __ BILLBOARD_FACE_CAMERA_POS
#include "SpeedTreeBillboardCommon.cginc"
void surf(Input IN, inout SurfaceOutput OUT)
{
SpeedTreeFragOut o;
SpeedTreeFrag(IN, o);
SPEEDTREE_COPY_FRAG(OUT, o)
}
ENDCG
Pass
{
Tags { "LightMode" = "Deferred" }
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 3.0
#pragma multi_compile_fog
#pragma multi_compile __ LOD_FADE_CROSSFADE
#pragma multi_compile __ BILLBOARD_FACE_CAMERA_POS
#include "SpeedTreeBillboardCommon.cginc"
struct v2f
{
UNITY_POSITION(vertex);
UNITY_FOG_COORDS(0)
Input data : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
};
v2f vert(SpeedTreeBillboardData v)
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
SpeedTreeBillboardVert(v, o.data);
o.data.color.rgb *= ShadeVertexLightsFull(v.vertex, v.normal, 4, true);
//o.data.color.rgb *= unity_AmbientSky;
o.vertex = UnityObjectToClipPos(v.vertex);
UNITY_TRANSFER_FOG(o,o.vertex);
return o;
}
fixed4 frag(v2f i) : SV_Target
{
SpeedTreeFragOut o;
SpeedTreeFrag(i.data, o);
UNITY_APPLY_DITHER_CROSSFADE(i.vertex.xy);
fixed4 c = fixed4(o.Albedo, o.Alpha);
UNITY_APPLY_FOG(i.fogCoord, c);
return c;
}
ENDCG
}
}
FallBack "Transparent/Cutout/VertexLit"
}



