Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. 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

Help Wanted Export A Texture From Shader Graph

Discussion in 'Shader Graph' started by Carterryan1990, Apr 13, 2019.

  1. Carterryan1990

    Carterryan1990

    Joined:
    Dec 29, 2016
    Posts:
    78
    Hi there, I've been trying to find a way to export a normal map texture that is created by using the texture to normal texture node which then plugs into the normal node on the master. I wanted to somehow get that normal map and save it, is this possible? Any help is greatly appreciated, thanks!
     
  2. ph_

    ph_

    Joined:
    Sep 5, 2013
    Posts:
    226
    Hi there,
    It's not possible at the moment without some scripts and custom nodes API (which is 2018.x only).
    If you're interested, I've release an asset which allows you to bake the result of any node into a texture (among other features): ShaderGraph Essentials on the asset store.
     
    Last edited: Apr 26, 2019
    NeatWolf and Carterryan1990 like this.
  3. Carterryan1990

    Carterryan1990

    Joined:
    Dec 29, 2016
    Posts:
    78
    Thanks, It seems like your tool could be very useful. Though, Im still interested in hearing from someone who may know a solution.
     
  4. Carterryan1990

    Carterryan1990

    Joined:
    Dec 29, 2016
    Posts:
    78
    For those of you that stumble across this issue one day. Look into the post processing stack, custom nodes and how to use depth render textures to output the texture to a camera which your then able to capture.
     
  5. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    489
    A slightly more ghetto way is to do the operation in screenspace UV, and apply the material to a giant Quad right in front of the main camera. Then set the screen resolution within Unity to 1024x1024 (top-left of the game window) and Printscreen the result. For highers resolutions you might need a screenshot script on the main camera to save a 2k or 4k pic.

    Works with things that fit nicely in the 0-1 range, not so much HDR stuff and high-color-depth things. Make sure you don't have tonemapping, bloom, etc on the camera otherwise it'll mess up the output. Also check if you're in the correct colour space, you don't want to double-gamma-correct something you shouldn't.
     
unityunity