Search Unity

Custom Diffuse CG shader from wiki strange behaviour

Discussion in 'Shaders' started by melong, Nov 5, 2013.

  1. melong

    melong

    Joined:
    Sep 2, 2011
    Posts:
    22
    Hi,

    I recently tried to make a custom shader with cg which requires the use of unity lights and to achieve this i based my shader on the diffuse shader available on this wiki :

    http://en.wikibooks.org/wiki/Cg_Programming/Unity/Smooth_Specular_Highlights

    But then i found that this shader code was giving me unexpected strange results with point lights like here:

    $Diffuse_Cg.png

    I don't know if this is a normal stuff and the result i should expect or if i may do something wrong somewhere.

    Thank you for your help.