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

Camera position in Shader Graph

Discussion in 'Cinemachine' started by nehvaleem, Jun 15, 2020.

  1. nehvaleem

    nehvaleem

    Joined:
    Dec 13, 2012
    Posts:
    429
    I am wondering what is the correct way of accessing camera position when cinemachine drives it? As cinemachine doesn't actually move the main camera around?

    My shaders that relies on a camera position are broken when using cinemachine :(
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    Cinemachine does move the main camera around. Everything should work normally. Maybe you have an execution order issue? CM moves the main camera in CinemachineBrain.LateUpdate().
     
  3. marc_tanenbaum

    marc_tanenbaum

    Unity Technologies

    Joined:
    Oct 22, 2014
    Posts:
    637
    It most certainly does! Watch the position and rotation of any scene using Cinemachine to convince yourself that this is so. Virtual Cameras work by driving the "real" camera around. As such, you can use the same camera tools as you use elsewhere. If something is going wrong, I'd suggest that the folks in the Shader Graph forum are in a better position to help you.
     
  4. nehvaleem

    nehvaleem

    Joined:
    Dec 13, 2012
    Posts:
    429
    well, crap. Idk why I've assumed that. The transform values are changing indeed. I've got to dig deeper into my issue and figure it out whether it is related with the cinemachine or shader graph. Sorry for the inconvenience!
     
    Last edited: Jun 15, 2020