   Transparecy and Gradient Transparecy
  Hello!I''ve got two questions:1) I''ve an object, loaded from *.x. In some moment I want to change it''s transparecy (for example set alpha to 45 or 23 or 87 etc.) How can I do that?2) I''ve an object, loaded from *.x. This object can move on the screen. When tha object''s x-coordinate > nBorder I want to make the object''s part that is > nBorder transparent and the other part (that is still < nBorder) visible. I''d like to make a gradient transparecy: from right edge of the object (alpha = 0) to the nBorder (alpha = 100). How can I do that? 
  For #1 you have two solutions:1) Make a very simple vertex shader in which you just send in a new alpha variable and then move that into the vertex''s alpha colour or2) Send the vertex array back into the cpu, run a loop in which you change each vertex''s alpha colour individually, then send the vertex array into the gpu.For #2...hmm...that''s a doozy. One option (although not very effective as I feel it''s still too slow) is to have some volumetric fog along the nBorder...can''t really help you there though. ;  Possible solution for the first problem:I haven't done this, but I was wondering if it would work.  Could you set alpha blending enabled then set the render state to get it's alpha value from D3DTSS_ALPHAARG1, and set D3DTSS_ALPHAARG1 to D3DTA_CONSTANT and change the constant to the alpha value?i.e. here the alpha is 22 hex.  Of course, you would change it each frame in the form of a variable.// I'm not sure about the first line, MSN just went down when I was looking it up!SetRenderState(D3DSRS_ALPHAOP, D3DSRS_SELECTALPHAARG1);SetTextureStageState(0, D3DTSS_CONSTANT, &(0x22000000));SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_CONSTANT);This, if it does work, would not be supported by all hardware because of the constant.Chris   [edited by - Supernat02 on February 4, 2004 12:32:42 PM];  I want to have a method that will work with most (or even all) hardware.Concerning a vertex shader - where can I get more information about it? Mabe tutorial? Or some code?ThisSetRenderState(D3DSRS_ALPHAOP, D3DSRS_SELECTALPHAARG1);SetTextureStageState(0, D3DTSS_CONSTANT, &(0x22000000));SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_CONSTANT);I''ll check and tell, how it works. ;  If this constant thing works, it will probably work with almost all hardware out there.  I don''t think it''s very "high-tech" and recent.  Shaders on the other hand are a different story.  I bought 2 video cards within the last year, both around 200.00, one supported shaders, the other didn''t, 1 was ATI the other was NVIDIA.  So, if you want well accepted support, I wouldn''t go with shaders just yet.  Would anyone agree with that?  I don''t know what the percentage is on the market that supports them, I just know that I got 50% statistics for myself so far.  Chris 