How to instantiate a float3 (Surface Shaders)

I’m writing a surface shader at the moment and I want the normal to always be pointing upwards.

I want to be able to do something equivalent to this:

void surf (Input IN, inout SurfaceOutput o)

{

half4 c = tex2D (_MainTex, IN.uv_MainTex);
o.Albedo = c.rgb;
o.Alpha = c.a;
o.Normal = new float3(0, 1, 0);

}

Any help greatly appreciated.

Never mind everyone - as it turns out you can just omit the ‘new’ keyword. This also works for half4 and the other types that shaderlab uses.

float3(0, 1, 0) is all that’s required.

Hope this helps anyone else unfamiliar with the language.