Weird stains on the object surface...

Started by
2 comments, last by vicviper 19 years, 3 months ago
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!
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.
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."
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

This topic is closed to new replies.

Advertisement