Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Question Shadergraph get gl_fragcoords

Discussion in 'Shader Graph' started by Pepn, Mar 3, 2023.

  1. Pepn

    Pepn

    Joined:
    Sep 27, 2017
    Posts:
    9
    Hi,

    I want to get the fragcoordinates of the screen the shader is currently writing to, is this possible in shadergraph? It seems that I need to access gl_fragCoord however, it is unclear how one would do so in a shadergraph, perhaps via a custom node?

    Thanks for pointing me in the right direction.
     
  2. Pepn

    Pepn

    Joined:
    Sep 27, 2017
    Posts:
    9
    Ah I found ScreenPosition which makes sense as it abstracts away the openGL stuff.