Jump to content
  • Advertisement
Sign in to follow this  
Endemoniada

Texture Flickering

This topic is 3782 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, I made a skybox and render it with a star texture (all black with grey single pixel random dots), the 'stars' flicker when I rotate. If I use a solid color texture it's perfectly fine with no flicker. I use these settings: SetSamplerState(0,D3DSAMP_MINFILTER,D3DTEXF_LINEAR); SetSamplerState(0,D3DSAMP_MAGFILTER,D3DTEXF_LINEAR); SetSamplerState(0,D3DSAMP_MIPFILTER,D3DTEXF_LINEAR); SetTextureStageState(0,D3DTSS_COLOROP,D3DTOP_MODULATE); SetTextureStageState(0,D3DTSS_COLORARG1,D3DTA_TEXTURE); SetTextureStageState(0,D3DTSS_COLORARG2,D3DTA_DIFFUSE); SetTextureStageState(0,D3DTSS_ALPHAOP,D3DTOP_DISABLE); What should I do ? I'd leave it because it looks cool but when you're not rotating they don't flicker so it's not consistent. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
If the skybox is any distance away from the eyepoint, a single pixel in a texture may or may not be rendered. You're not seeing the sky texture full size so one screen pixel covers several (or perhaps many) texture pixels. If the center of the screen pixel projects to a texture pixel that's just a few texture pixels away from your "star," the star doesn't get fully rendered. It's only going to contribute a small fraction to the color of the screen pixel.

Unfortunately you'll have to make bigger stars or a bigger sky texture to increase the probability that the stars will get mapped to a screen pixel consistently.

Another possibility is to try rotating the skybox a very small amount back-and-forth all the time to see if will flicker all the time.

Share this post


Link to post
Share on other sites
You can also use :
d3dDevice->DrawPrimitive( D3DPT_POINTLIST, ..., ... );
That way you're sure it will be rendered (though I never used it...)

Share this post


Link to post
Share on other sites
Thanks a lot for the explanation, I thought I was maybe doing something wrong.

I found that if I apply a slight Gaussian Blur to my textures it minimizes the flickering quite a bit.

I like the idea of a very slight rotation to cause them to always flicker, I'm going to give that a shot; I never would have thought of doing that.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!