Texture transparency

Started by
2 comments, last by gommo 21 years, 2 months ago
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
------------------------------------------------------
50% of me is a huge nerd! How about you?
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.,
http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,
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
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

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

This topic is closed to new replies.

Advertisement