we’re getting these nasty artifacts on our models, whenever a specular shader is used and anti-aliasing is enabled (Unity 3.5). The pixels jump around like crazy on the edges of the model when the camera or light moves.
It is definitely not a mipmapping or other texture problem (it happens without textures too).
The near or far plane of the camera does not affect the issue.
It rarely happens (but it does) on the default unity sphere, if I put a specular material on it.
I see it most often where there are lots of polygons (they don’t overlap or anything, see sphere). So I assume it has to do with the polygon density.
Does anyone know how to fix this? We’d really like to have specularity AND anti-aliasing, if that’s not asking too much
Unfortunately, it happens with light probes as well - with the added problem that normal maps don’t seem to work anymore, when only lightprobes light the model.
FYI it happens on ipad too, mostly near the corners of geometry. And we were using a specular shader. I think it’s due to unclamped values at angles or something.
I’d be great if you could post that fixed shader! I’m terrible with writing shaders.
Fortunately performance isn’t really an issue for us, since we only have 2 or 3 models to render, per scene. So having a shader that does the clamping would be great.
Switch to Bumped Specular. Put a flat normal map (that effectively does nothing, you can generate one if you go to an image, tick Generate Normal map in the settings of the image and turn down Bumpiness to 0). I think then the effect is greatly reduced or gone. I guess it’s because then the shader re-writes the normal calculation, which is where the problem is probably.
If that doesn’t help let me know and I’ll find the shader.
I had dismissed this solution, since we also get the artifact on meshes that already use a normal map (so that alone doesn’t fix it) - and we wouldn’t be able to use the normal map the mesh needs.
The solution to add o.Normal = fixed3(0,0,1); seems to give the best results so far and is easy to apply to the shaders that don’t use a normal map already. Not sure what to do with those -with- a normal map though.
The solution for me was to apply the (Pro-Only) Image Effects Anti-Aliasing Script on my camera. Works great and there are several options there…not sure of performance impact yet…
I would like to echo some significant frustration with this.
I use normal maps, so the workarounds are useless. I can’t use AA as a post-effect, as it messes up some of my shader use. I can use Catalyst Control Center to set Supersampling AA on the application to make it look nice, but that’s hardly a solution I can present to my customers. = (
Seeing the problem here too–this is with the standard Unity specular shader and no texture. Certain objects have a very distracting “glittering” as they move. (Even a standard Capsule object will sometimes do it a little.)