Jump to content
  • Advertisement
Sign in to follow this  
Endemoniada

Small Details are Flickering

This topic is 2637 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys,

Even though I'm rendering in 3D I have an essentially 2D game, objects can only move along X and Y and rotate around Z.

I'm applying a simple per-pixel phong shader (diffuse, specular) to my objects which looks nice but is causing flickering when the objects move slowly. Anything under multisampling 8x flickers a lot, even 8x causes visual problems.

If I used normal maps for the details instead of actual geometry would it flicker less ? Would a post-processing anti-alaising technique minimize this ? What about a different, better shader ? Maybe you guys have some ideas ?

Also, is it safe to say most semi-modern vidcards are capable of multisampling 8x or better ?

I really need to fix this somehow.

Thanks.

Share this post


Link to post
Share on other sites
Advertisement
What kind of texture filter are you using? Should be linear for best results.
Are you using mipmaps? You should be.


L. Spiro

Share this post


Link to post
Share on other sites

What kind of texture filter are you using? Should be linear for best results.
Are you using mipmaps? You should be.


L. Spiro


I'm not using textures. Also, the objects are at a fixed distance, it's pretty much a 2D game.

Share this post


Link to post
Share on other sites
flickering as in z fighting? What are you using for your graphics (opengl/dx/etc)? If you put them in seperate "layers" as in having them all with different z values, does the flickering stop?

Share this post


Link to post
Share on other sites
Here is an image. This is a model, not a texture. I am using per-triangle normals, I don't what 'smooth vertex' normals are (maybe they will help, please tell me about them.)

When it moves slowly the highlighted edges flicker. I'm pretty sure the flickering is caused by triangles being smaller than a pixel.


0001xa.jpg


Thanks for helping.

Share this post


Link to post
Share on other sites
That's a bit hard to fix without changing the model, as two triangles with different lighting might compete to fill a pixel, and when the model moves the "winner" can change. Especially if the model contains vertices or edges that don't line up perfectly with neighboring triangles that becomes a problem. Are you using a Z-buffer and depth-testing?
That's the first thing to try.
Smooth vertex normals are when you assign the three vertices of a triangle different normals, which will cause them to be interpolated over the triangle and cause it to be smooth-shaded (fade from one shade to another) rather than flat-shaded (same color over the entire triangle). If you have two or more triangles that share a vertex, give that vertex the same normal for all triangles. This will cause the edges to blend nicely into each other. It's particularly good for curved edges. If you want hard shading edges, such as for a 90-degree corner, then you should not use smooth shading for that edge.
Here's a comparison image from Wikipedia: http://upload.wikimedia.org/wikipedia/commons/8/84/Phong-shading-sample.jpg

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!