- Home /
Antialiasing as Post Effect in Unity 3.5.0
I got this message every frame for Antialiasing as Post Effect:
Missing shader in Main Camera (AntialiasingAsPostEffect) UnityEngine.Debug:Log(Object) PostEffectsBase:CheckShaderAndCreateMaterial(Shader, Material) (at Assets/Standard Assets/Image Effects (Pro Only)/PostEffectsBase.js:13) AntialiasingAsPostEffect:CreateMaterials() (at Assets/Standard Assets/Image Effects (Pro Only)/AntialiasingAsPostEffect.js:37) AntialiasingAsPostEffect:OnRenderImage(RenderTexture, RenderTexture) (at Assets/Standard Assets/Image Effects (Pro Only)/AntialiasingAsPostEffect.js:51)
The effects worked fine before I upgraded my project to 3.5.0. I am using SSAO.
Is this Image Effect not supported any more? Any alternative if so?
Any help appreciated :)
Answer by ThibaultD · Sep 27, 2012 at 02:45 AM
When adding the AA component in the editor the shaders are automatically initialized, but when the component is added via scripting the shaders must be assigned, like so (C#):
AntialiasingAsPostEffect aa = go.AddComponent<AntialiasingAsPostEffect>();
aa.ssaaShader = Shader.Find("Hidden/SSAA");
aa.dlaaShader = Shader.Find("Hidden/DLAA");
aa.nfaaShader = Shader.Find("Hidden/NFAA");
aa.shaderFXAAPreset2 = Shader.Find("Hidden/FXAA Preset 2");
aa.shaderFXAAPreset3 = Shader.Find("Hidden/FXAA Preset 3");
aa.shaderFXAAII = Shader.Find("Hidden/FXAA II");
aa.shaderFXAAIII = Shader.Find("Hidden/FXAA III (Console)");
I am not sure it will help your particular case, but it might!
Thanks. You are right. $$anonymous$$y Effects are added in editor, but the gameobject that contains the component was initially set to inactive and was activated under a condition. Assigning shader via scripting solves the problem.
Answer by Sylafrs · Nov 28, 2014 at 03:54 PM
I didn't find where in the editor script those shaders were setted.. any idea?
Your answer
Follow this Question
Related Questions
There any way to disable anti-alias for a specific shader? 1 Answer
AntiAliasing and WebPlayer 1 Answer
How to apply antialiasing to UI text? 0 Answers
Add animation to a NavMeshAgent Character 1 Answer
Image effect on button down 1 Answer