Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Is it possible to get particles lit with spotlights well?

Discussion in 'General Graphics' started by vegenarie, Dec 2, 2014.

  1. vegenarie

    vegenarie

    Joined:
    Jan 5, 2011
    Posts:
    287
    When i use a spot light over any object it gives a normal rounded shape but when i focus on particles i get a square, happens the same than here. At least i would like to know if it is possible in Unity, as seems nothing works.



    https://shaderforge.userecho.com/topic/381684-custom-particles-shader-vertex-lighting/

    I tried the LIGHT_ATTENUATION used normally for spot lights in Unity shaders but doesnt work and neither using for the light attenuation for the spot light what is explained in this tutorial http://en.wikibooks.org/wiki/Cg_Programming/Unity/Cookies

    Code (CSharp):
    1. cookieAttenuation = tex2D(_LightTexture0,
    2.                   input.posLight.xy / input.posLight.w
    3.                   + float2(0.5, 0.5)).a;