Jump to content
  • Advertisement
Sign in to follow this  
Maxim Skachkov

[MDX] Ripple and flickering artefacts on textured objects (fine screenshot)

This topic is 4421 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

Good day for you! We are working on a drive simulator. Please see on the sidewalk on the right bottom of screenshot. Even on small distants you can see the distortions that increases as far. Also there are flickering in dinamics. I'm using VS2003 and SampleFramework with thear default render parameters. Some info about hardware displayed in the screenshot. Yesterday to midnight I'm "attack" gamedev.net with keywords "artefacts", "distortions", "defects", "flickering" and so on. As result I'm guess the solution may be in : 1. Z-buffer 2. BackBuffer 3. PRESENT PARAMETERS: PresentationInterval (ONE or IMMEDIATE) 4. PRESENT PARAMETERS: SwapEffect 5. Device.Clear 6. may be TextureStageStates SampleFramework has incapsulated many features and as be honest now I don't khow how for example change SwapEffect. May be there is enough only one you sight to this screenshot to help me in the right way. Thx!

Share this post


Link to post
Share on other sites
Advertisement
Well, the first thing that comes to mind is the texture filtering. If you're not explicitly setting any filtering options in MDX, you'll only get point filtering. As a result, textures that are minified often look 'grainy' and may show small 'flickers' in the distance like you seem to be experiencing.

The easiest way to solve this is to use a linear texture filter. You can do this by adding the following code to your OnResetDevice method if you're using the SampleFramework:

[source lang=csharp]
if (e.Device.DeviceCaps.TextureFilterCaps.SupportsMinifyLinear)
{
e.Device.SamplerState[0].MinFilter = TextureFilter.Linear;
}

if (e.Device.DeviceCaps.TextureFilterCaps.SupportsMagnifyLinear)
{
e.Device.SamplerState[0].MagFilter = TextureFilter.Linear;
}

if (e.Device.DeviceCaps.TextureFilterCaps.SupportsMipMapLinear)
{
e.Device.SamplerState[0].MipFilter = TextureFilter.Linear;
}





Hope this helps & a good day to you too :)

Share this post


Link to post
Share on other sites
Also, if you see flickering without motion, then you are probably experiencing z-fighting. This is an artifact of having too little resolution in your Z direction. Try reducing the far clipping plane to reduce the error.

Share this post


Link to post
Share on other sites
Hi Maxim,
In addition to the other suggestions..
Does the texture you are using for the sidewalk contain several mip levels?
If not, try creating the texture with maximum, or at least several mip levels and see if that improves the appearance of the sidewalk.

In the past I have found that using mip mapping gives better results for "repeating" textures rendered from near to far.

HTH,
Cambo_frog

Share this post


Link to post
Share on other sites
Hello, remigius!
When i set MipFilter to Linear and run apps i have seen absolutely new picture!!! Thanks a lot! [smile]

It's all ok with GeForce 5200.


[Edited by - Maxim Skachkov on April 5, 2006 6:12:39 PM]

Share this post


Link to post
Share on other sites
Hello, Supernat02 and gamedev community!

Really!
When I testing my apps on computer with RIVA TNT2/TNT2 PRO graphic card i see "flickering without motion" on the lawn (grass). Moreover, i see the effect like "alive bog movement " of even "earthquake with 9 points on the Richter scale". Also i have find similar defects on roads and borders. But i think that the users of my simulator and inhabitants of my virtual houses should sleep easy and i intend to correct this artefact!

How? Please, see the images:





and


Can you help me to be in mind and stand tough? What to me to do with "earthquake artefacts" from which granite borders crack even!?

Quote:
Original post by Supernat02
Also, if you see flickering without motion, then you are probably experiencing z-fighting. This is an artifact of having too little resolution in your Z direction. Try reducing the far clipping plane to reduce the error.


Supernat02!
I have tried to reducing/increasing the far clipping plane as you have advised.

My code:

camera.SetProjectionParameters( ( float )Math.PI / 4.0f, aspectRatio, 0.01f, <b>3000.0f</b> );






I have not found out any effect.


Writing to Cambo_frog ...

[Edited by - Maxim Skachkov on April 5, 2006 6:10:12 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by Cambo_frog
try creating the texture with maximum, or at least several mip levels and see if that improves the appearance of the sidewalk.

In the past I have found that using mip mapping gives better results for "repeating" textures rendered from near to far.

HTH,
Cambo_frog


Thanks, I shall try.

Share this post


Link to post
Share on other sites
Night ...

remigius very much helped me with smoothing texture within the limits of one object. What about smoothing or filtering for all scene?

And what about this artefact?



I'd like to see the continuous curve for a marking on turn on the road. The marking and the road are different objects. The marking and the road vertices are stored in different vertex buffers with PositionNormalColored and PositionNormalTextured vertex formats аccordingly.

Is this artefact takes place because of an error of calculations on distance? Resolution 1024*768!
I have looked finished simulator of driving on Moscow streets - same defects. But my intuition whispers to me, that there is a decision. But what?
I am grateful for your attention to my questions.

Share this post


Link to post
Share on other sites
Well, I think your Z range between the near and far clipping planes has a lot to do with this last artifact (and possibly with the TNT2 one too), as Supernat02 also pointed out. Your near clipping plane is a bit too close and your far clipping plane seems a bit too far away, giving you a too small 'resolution' in the zbuffer, which is a probable cause of these artifacts. You might want to try if a more common range from 0.1f or 1f (near) to 1000f (far) works for you.

I can't explain this properly this early, but here is an excellent article that explains this issue in great detail [smile] It basically comes down to the advice to make the range between your near and far clipping planes as small as possible:

Quote:
Always put zNear as far from the eye as you can tolerate.

Share this post


Link to post
Share on other sites
You could also try selecting a Z-buffer format with more resolution.

Make sure your device is using D3DFMT_D24S8 not D3DFMT_D16.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!