Jump to content
  • Advertisement
Sign in to follow this  
ctian

Weird stains on the object surface...

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

In my program, a scene is firstly rendered to a texture, and then the texture is mapped onto an object surface. Strangely, there are many irregular stains on the object surface:( But if I display the scene which is rendered to the texture on the screen, it seems fine. In other words, the scene mapped onto an object surface via a texture is stained... What can be the problem? My texture creation code is as follows: g_pd3dDevice->CreateTexture( 256, 256, 1, D3DUSAGE_RENDERTARGET|D3DUSAGE_AUTOGENMIPMAP, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &g_pIntermediateTexture, NULL ); Thanks a lot!

Share this post


Link to post
Share on other sites
Advertisement

you're creating a render target with only one surface (mimpap levels set to 1), but you are creting it with autogen_mipmaps, that's what might be causing the problem...

I suggest to set mipmap=0 (all levels created) or remove the autogen flag.

Share this post


Link to post
Share on other sites
vicviper, thank you for your kindly replay:)
Strangely, my program runs well now, but I don't think I have changed anything in my code (maybe it is due to the driver of my card...).

b.t.w, I think set mipmap = 1 is fine. And the sdk doc says "When creating an automatically generated mipmap, the Levels parameter must be set to zero or one."

Share this post


Link to post
Share on other sites
Quote:
Original post by ctian
vicviper, thank you for your kindly replay:)
Strangely, my program runs well now, but I don't think I have changed anything in my code (maybe it is due to the driver of my card...).

b.t.w, I think set mipmap = 1 is fine. And the sdk doc says "When creating an automatically generated mipmap, the Levels parameter must be set to zero or one."


Ctian: take a look at a question I posted a while back, it's partially related to your question too:

http://www.gamedev.net/community/forums/topic.asp?topic_id=292710

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!