Archived

This topic is now archived and is closed to further replies.

anakiko

How to render without flickering?

Recommended Posts

anakiko    122
Hi, I have a boulevard walkthrough with trees at the sides of the boulevard. The trees consist very small leaves on their branches. I want to create a movie of the boulevard, but far tree leaves flicker very frequeny! Using mipmaps is out of the question to me, because it creates a halo around the leaf texture (because the trasparent texels are blended with the leaf texels). In addition the mipmaps magnify the leaves size when looking from not near distance. The reason for the flickering is the z-buffer, which has 24 bits (This is the maximum I have succeeded to get). In order to solve the problem I have decided to render my scene as follows: I splitted my frustum into very small sub frustums and rendered to each one of the frustums from back to front and accumulated the color buffer.
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);

  for(int = i; i < numOfFrustum; ++i)
  {
    glMatrixMode (GL_PROJECTION);
    glLoadIdentity ();
    setFrustum(subFrustum);
    renderScene();
    glClear(GL_DEPTH_BUFFER_BIT);
  }
[/CODE]

no matter how small how make my sub frustums the tree leaves don''t stop to flicker.

How can I stop the flickering without using mipmaps???    

Share this post


Link to post
Share on other sites
dmounty    122
erm.. the problem is known as spatial aliasing.... it''s the reason you use mipmaps... and the main reason why FSAA is so good. You can only get around it with the model based version of mipmapping.. that is to say.. have a lower detail version of the model to render at a distance. The other thing that can help is to turn on FSAA. The other possibility is to switch to billboards beyond a certain range. As for the textures... there is no real way to get around aliasing in these without mipmapping. If the blur is a real issue, then I suppose anisotropic filtering is the only answer, but it should be reasonably effective. Also, you don''t have to dynamically generate the mipmap images. In general it can look sharper to actually draw several versions of the image. In fact.. once I drew my textures in a structured drawing package.. and made version at each size with very successful results (ie, much better sharpness at a distance).

Share this post


Link to post
Share on other sites
anakiko    122
Hi dmounty,

First, thank you for replying
Mipmaps on the leaves will only solves the problem of aliasing of a leaf with itself. The problem of flickering BETWEEN DIFFERENT leaves won''t be solved.
I know LOD is a good thing, but I must use the original trees.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Try rendering the scene at a really high resolution, then use some app to go through the rendered frames and lower the resolution before encoding as a movie? Perhaps?

Share this post


Link to post
Share on other sites
anakiko    122
Hi,

I already try rendering the scene in really high resolution and lowered the resolution afterwards. It did not help..


tHiSiSbOb, What do you mean by using double buffering. I don''t understand. Could you give me more details.

Share this post


Link to post
Share on other sites
anakiko    122
hmm,

tHiSiSbOb, do you mean using GLUT_DOUBLE and glSwapBuffers()?
I use it, it is not the problem. The problem is the accuracy of the z-buffer.
However, thanks for trying.

Share this post


Link to post
Share on other sites
shadow_bobble    122
Hi anakiko. Are you sure the z-buffer is your problem? Once your geometry becomes sub-pixel in size, you cannot guarantee that the same piece of texture will be used for a given pixel from frame to frame.

If you have 2 leaves side by side, close together, you can''t guarantee that the same leaf will be used for a given pixel from one frame to the next either. This isn''t a z-buffer problem. It''s just a fact of life when we try and quantize a projection of the scene onto an image plane.

On the other hand, if you''re sure that one leaf is slightly farther away than the other, and they alternate being drawn from frame to frame, that is a z-buffer precision issue. I don''t see how you could be sure that is happening if the leaves are only 1-2 pixels in size?

Have you tried anti-aliasing? It should definitely improve, if not eliminate, the problem you''re describing, particularly if it is not the z-buffer.

Share this post


Link to post
Share on other sites