• Advertisement

Archived

This topic is now archived and is closed to further replies.

Texture transparency

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

I''d like to a GUI that supports controls, panels, dialogs etc.. to fade in and out. Now, I have done that at the moment using ID3DXSprite interface. As this supports, in its Draw() method, the ability to overide the texture it draws with with a 32Bit colour value. So I can draw the sprite with say D3DCOLOR(255,255,255,alpha). and change the alpha component each frame to change the transparency of the image. If I were to use a Mesh based drawing technique instead, where I render a texture onto 2 triangles, is there a similar simple solution to change or overriding the alpha component of the texture I wish to draw when I call DrawPrimitive or DrawIndexedPrimitve() Thanks you

Share this post


Link to post
Share on other sites
Advertisement
hello,

you have a lot of options when using textured polys to have a transparent effect, you can use materials, diffuse vertex colors, textures etc.,

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
modify the diffuse alpha of the two triangles vertices

this actually requires locking/unlocking the vertex buffer each frame so I dont know if this would be the best way

Share this post


Link to post
Share on other sites
Or don''t lock/unlock anything and put the fade level in the TEXTUREFACTOR renderstate and change the alpha source in your texture stage state setup to select or modulate the alpha from TFACTOR...

it all depends what level of control you need - if you need to have uneven fades (e.g. top half fades off before bottom half) etc then fiddling with vertices or some sort of screen space effect are about the only methods. But with TFACTOR you can set the fade per Draw() command... on drivers which behave themselves (i.e. after ~1999).

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites

  • Advertisement