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

Question Export A Texture From Shader Graph

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

  1. Carterryan1990

    Carterryan1990

    Joined:
    Dec 29, 2016
    Posts:
    79
    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:
    232
    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:
    79
    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:
    79
    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:
    501
    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.
     
  6. vuthang

    vuthang

    Joined:
    Mar 7, 2017
    Posts:
    50