#### Archived

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

# How to render without flickering?

## Recommended Posts

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);
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 on other sites
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 on other sites
Hi dmounty,

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 on other sites
Use doublebuffering.

##### Share on other sites
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 on other sites
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 on other sites
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 on other sites
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.

• ### Forum Statistics

• Total Topics
628400
• Total Posts
2982450

• 9
• 10
• 9
• 19
• 24