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

Is there a way to "unwrap" the result of a shader, without rewriting that shader?

Discussion in 'General Graphics' started by neoshaman, Jan 19, 2022.

  1. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    Basically I need to bake the result of a shader as texture, say a lambert with a phong specular, so far what I do is I rewrite the shader to output the vertices UV position to screen coordinate, but keep calculation with worldspace, but ideally I would like to automate it for any arbitrary shader, notably those I didn't write myself.

    I thought I could do it by using drawmeshnow with rendertexture, but I was silly and realized I'm passing the whole shader so it's not doing it for everyshader. Unwrapping the model manually change the vertices position, so that was not smart either.

    It's probably not possible, but asking in case I missed something I didn't knew. Hope to have at least a response along those line lol