- Home /
How does the editor know what shader to use when adding an ImageEffect script?
When adding an image effect (e.g. GrayscaleEffect) to a camera game object, Unity automatically fills in the shader property on the ancestor ImageEffectBase. I don't see any code in the GrayscaleEffect class that tells Unity which shader to use by default, so how does Unity know this?
I see, it's a little bit old question. I also wonder. I edited the GrayscaleEffect and some other shaders saved them with other name, then I wrote the script. But I wasn't able to make it automatically assign the shader. This is annoying. Could you figure it out already?
Answer by Dakwamine · Jan 01, 2013 at 09:11 PM
Does my answer in this question gives you the info you needed? http://answers.unity3d.com/questions/372629/how-unity-assigns-image-effect-shaders-to-their-sc.html
Thank you! I've never noticed that you can set properties on a script asset like that. Looks like it only supports certain data types though - at least many of the public properties I have don't show up as properties I can set there. Probably just ScriptableObject or $$anonymous$$onoBehaviour properties I would guess.
Your answer
Follow this Question
Related Questions
Edge detect color 2 Answers
Different between tex2D and SAMPLE_TEXTURE2D (Post Processing effect) 0 Answers
Assigning default shader to a script 3 Answers
Documentation on the bloom filter 0 Answers
Image-Effect Shading the GUI? 1 Answer