Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Get Object's World Position From Shader

Discussion in 'Shaders' started by Emre, May 9, 2013.

  1. Emre

    Emre

    Joined:
    Jul 8, 2012
    Posts:
    21
    Is there a way to get an object's (not vertices) world position from shader?
     
  2. musikit

    musikit

    Joined:
    Jan 30, 2012
    Posts:
    160
    correct me if i am wrong but isnt that just the last row(column) of the model view matrix (i.e. the translation vector)?
     
  3. Emre

    Emre

    Joined:
    Jul 8, 2012
    Posts:
    21
    Ok, now I am really confused. Is it UNITY_MATRIX_MV or _Object2World?
     
unityunity