Search Unity

Specular Bump not working

Discussion in 'Shaders' started by LegendCat, Aug 23, 2014.

  1. LegendCat

    LegendCat

    Joined:
    Oct 1, 2013
    Posts:
    3
  2. LegendCat

    LegendCat

    Joined:
    Oct 1, 2013
    Posts:
    3
    All right, it seem the o.Gloss and o.Specular didn't work and i 'd found a way arround this:

    Code (CSharp):
    1. void surf (Input IN, inout SurfaceOutput o) {
    2.     fixed4 tex = tex2D(_MainTex, IN.uv_MainTex);
    3.     fixed4 specTex = tex2D(_SpecMap, IN.uv_SpecMap);
    4.     o.Albedo = tex.rgb * _Color.rgb +  _Shininess * specTex.g;
    5.     o.Alpha = tex.a * _Color.a;
    6.     o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
    7. }
    instead of:
    Code (CSharp):
    1. void surf (Input IN, inout SurfaceOutput o) {
    2.     fixed4 tex = tex2D(_MainTex, IN.uv_MainTex);
    3.     fixed4 specTex = tex2D(_SpecMap, IN.uv_SpecMap);
    4.     o.Albedo = tex.rgb * _Color.rgb;
    5.     o.Gloss = specTex.r;
    6.     o.Alpha = tex.a * _Color.a;
    7.     o.Specular = _Shininess * specTex.g;
    8.     o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
    9. }
    but i have no idea with the Gloss and Specular use for.