Sign in to follow this  
Endemoniada

Texture Flickering

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this