1 Reply Latest reply on Aug 3, 2010 8:29 AM by pboudier

    cg shader for lights

    giuseppe500

      Hy.
      I would create a light phong shader with more than one light in cg.
      For each light , from 1 to 8 i must send to shader the position, direction , color ecc... via constant buffer.
      I think to use a matrix for send to the shader what are the lights that are active
      ,and in the shader i have an if else chain for get the color of pixel for the corrispondent light and type of light.
      Then I can disable/enable the light information , and send the information of the light to the shader only if exist(via costant buffer).

      Is a good solution?
      what advice to me if not?
      thanks