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. Dismiss Notice

Shader/Material preview camera multicompile

Discussion in 'Shaders' started by Chaiker, Jun 15, 2019.

  1. Chaiker

    Chaiker

    Joined:
    Apr 14, 2014
    Posts:
    62
    Hello. Do i can write shader that will be rendered in preview window different from game camera or scene camera? For example i use deferred decals (projection on camera depth) and in preview window i need other display.
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,236
    No.
     
    Chaiker likes this.
  3. Chaiker

    Chaiker

    Joined:
    Apr 14, 2014
    Posts:
    62
    I found how i can do this.
    I create editor script which subscribes on camera.onPreRender and enable global shader keyword via commandbuffer and disable after camera done rendering.
     
    MattDavis, ElliotB and bgolus like this.