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

Unity image effects: how do they load shaders?

Discussion in 'Scripting' started by neginfinity, Apr 25, 2015.

  1. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    When I add stock unity image effects from "Effects" package via context menu
    they attach themselves to object AND automatically select their shaders.

    Exactly HOW do they do that?

    There is no shader loading code in any of them (meaning there is no m_shader = new Shader("/file/path/to/shader.shader") or anything like that), and they do not appear to be prefabs.

    So, why each one of them has correct shader selected and not null right after attaching?

    I'd like to know how that works.
     
  2. mholub

    mholub

    Joined:
    Oct 3, 2012
    Posts:
    123
    Select Component (C# Script) in Project View. Look at the top of Inspector. You will see there default values for Textures/Shaders/etc.
     
    neginfinity likes this.
  3. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    Alright, thanks, good to know.

    That is incredibly non-obvious, though.