Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
10
Question by yosh · Dec 14, 2010 at 08:27 AM · buggraphicsqualityantialias

Pixelartifacts on edges when activating Antialiasing...

Hi,

ive already sent a bug report to unity but unfortunately ive no response yet. I get artifacts when activating AA in my scene (editorview, webplayer, standalone).

Theres a mesh with a reflective/specular shader with a cubemap and i get this white pixels on pc and mac, too. (latest display driver, different machines).

Does anybody have the same problems? Any ideas on that? Would be great. Thanks a lot.

alt text

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Helix · Dec 14, 2010 at 01:50 PM 0
Share

I also get these annoying artifacts. Would be nice to see this one solved!

avatar image tingham · Dec 14, 2010 at 03:49 PM 0
Share

Would love to have someone from Unity weigh in on this.

avatar image Statement · Dec 16, 2010 at 02:01 PM 1
Share

If you were to use another shader, would the white glitches be removed? Is that black border running behind the reflective material? Would it help if it did? (I'm thinking the AA might cause a small gap between the black frame and your reflective shader)

avatar image dissidently · Dec 17, 2010 at 03:27 PM 0
Share

I can make this happen with a non reflective specular shader as well. Right on the border between edges of same object. Both black and white, seems to go to nearest polar of white or black.

avatar image Steven-1 · Feb 18, 2011 at 12:52 PM 0
Share

I got this too, didn't knew it's only with combination of AA and specular

4 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by -chris · Aug 21, 2012 at 08:18 AM

The built-in specular shader is the culprit. To remove the white artifacts, add `o.Normal = fixed3(0,0,1);` after `o.Specular = _Shininess;` in the `surf` function from the built-in specular shader. This line is omitted due to performance reasons apparently. (discussions here and here)

The shader code below is for plain ol' Specular, from the "Normal-Glossy.shader" file from http://unity3d.com/support/resources/assets/built-in-shaders.html, but with the added fix:

 Shader "Specular (Fixed)" {
 Properties {
     _Color ("Main Color", Color) = (1,1,1,1)
     _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1)
     _Shininess ("Shininess", Range (0.01, 1)) = 0.078125
     _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {}
 }
 
 SubShader {
     Tags { "RenderType"="Opaque" }
     LOD 300
     
 CGPROGRAM
 #pragma surface surf BlinnPhong
 
 sampler2D _MainTex;
 fixed4 _Color;
 half _Shininess;
 
 struct Input {
     float2 uv_MainTex;
 };
 
 void surf (Input IN, inout SurfaceOutput o) {
     fixed4 tex = tex2D(_MainTex, IN.uv_MainTex);
     o.Albedo = tex.rgb * _Color.rgb;
     o.Gloss = tex.a;
     o.Alpha = tex.a * _Color.a;
     o.Specular = _Shininess;
     o.Normal = fixed3(0,0,1);
 }
 ENDCG
 }
 
 Fallback "VertexLit"
 }
 

As for the Reflective/Specular shader, adding `o.Normal = fixed3(0,0,1);` gives a compiler error.

It's also been suggested to use Bumped Specular (maybe with Reflective too?) with a flat normalmap to fix the white artifacts.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image cregox · Aug 21, 2012 at 02:20 PM 1
Share

If you have to add a "rule" to the shader, I can't agree the culprit is the shader. That, to me, says you can fix the problem in the shader and it's probably the easier place to fix it for us - mortal unity developers. Having said that, I tried both suggestions and both work great! Hope this answer gets accepted eventually. :-)

avatar image cregox · Aug 21, 2012 at 06:57 PM 0
Share

Actually, I noticed now, only the second suggestion (about using Bumped Specular) worked great. The first (and main one, on modifying the shader) one seem to work at first, but later I can notice the hack and the artifacts are still there. So, not so good.

avatar image
-1

Answer by synapsemassage · Mar 29, 2011 at 08:22 PM

Take a look at this post http://forum.unity3d.com/threads/83260-Unity-3.3-MSAA-and-particles...

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by cregox · Apr 11, 2012 at 02:03 PM

I can't reproduce this. Maybe it has been resolved... Even though I couldn't find any mention about this on the release notes since 2.6, except for a brief worrying on 3.2.

Or, most likely, it's an artifact from your specific scene set up, generated because our current algorithms just can't handle everything, specially under OpenGL ES 2.0, like Mr Statement grasped on the comments.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Orion 1 · Apr 12, 2012 at 09:41 AM 1
Share

Unfortunately it still happens (as we speak). The specific scene set up being a character mesh with a Specular shader, a directional light and a regular camera. See http://orion5.net/images/white_pixel_artifact.png for an example. It's embarassing to show to people. Custom shaders from 3rd parties (e.g. skin shaders and the like) seem to solve it, so it's definitely the shader and it's definitely anti-aliasing (turning it off will remove the artifacts).

avatar image cregox · Aug 21, 2012 at 01:49 PM 0
Share

@Orion complex problems are usually a combination of many things and then removing 1 factor that triggers it may seem to resolve. But thanks for the hint, at least I can reproduce it now...

avatar image
0

Answer by marsian · Oct 19, 2012 at 02:57 PM

For imported Models, i was able to minnimize artifacts by tweaking the smoothing angle in the importsettings.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Deferred lighting: How to improve quality and anti-aliasing? 4 Answers

Anti Aliasing on Mobile 3 Answers

Graphical bug 0 Answers

My new computer can't render Unity GameObjects 0 Answers

Set AA Quality besides the other settings. 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges