Hi:)
I’ve just upgraded my Unity to 3.5^^ (yaaay) and here’s my first problem
According to docs → http://unity3d.com/support/documentation/ScriptReference/Renderer-useLightProbes.html?from=LightProbes
My shader should works, but… I’ve got baked, probes, shader (probably with critical error:P) and still my GameObject is rendered as big black block
Then i tried surf shader and it works:) so can anyone help me with non surf one?
Shader "myShader/Probed/Diffuse" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Tags { "RenderType"="Opaque" }
Pass{
CGPROGRAM
#include "UnityCG.cginc"
#pragma vertex vert
#pragma fragment frag
#pragma fragmentoption ARB_precision_hint_fastest
struct v2f
{
half4 pos : SV_POSITION;
half4 uv : TEXCOORD0;
half4 shlight : TEXCOORD1;
};
fixed4 _Color;
sampler2D _MainTex;
float4 _MainTex_ST;
v2f vert(appdata_base v)
{
v2f o;
o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
o.uv.xy = TRANSFORM_TEX(v.texcoord,_MainTex);
float3 worldN = mul((float3x3)_Object2World, SCALED_NORMAL);
float3 shlight = ShadeSH9 (float4(worldN,1.0));
o.shlight.xyz = shlight;
return o;
}
fixed4 frag(v2f i): COLOR0
{
//fixed4 tex = tex2D (_MainTex, i.uv.xy); // cuz of debug
//tex *= _Color;
return i.shlight;
}
ENDCG
}
}
FallBack OFF
}