Comment est il possible de faire apparaitre une image progressivement? Au début, qu'elle soit completement transparente et qu'a la fin completement opaque. Je pense pouvoir faire ca en adaptant progressivement la composante alpha de chaque texel, mais ca implique de locker la surface pour aller écrire dedans et ca prend du temps.
Mais j'ai trouvé ca:
[citation]
There are two ways to take advantage of alpha values. First, you can create your source graphics with an alpha component, allowing you to make a single bitmap with varying degrees of transparency throughout the image. Many graphics editors support alpha values, and you'll need to save in a file format that stores this data (.PNG or .TGA, for example). When you load your image into a texture which has an alpha value in its format, the alpha information is maintained. Then, when you use ID3DXSprite::Draw(), the alpha value is used to decide how to blend your image with the background graphics. The second way to take advantage of alpha values is to use the Color parameter of the ID3DXSprite::Draw() function, which "modulates" the color and alpha channels by the value provided. Ordinarily, you would specify 0xFFFFFFFF for this value to get a standard blit. By changing this to 0x80FFFFFF, you will draw your image at 50 percent transparency. It is also possible to change the other bytes to affect the color of your drawn image, making it very easy and fast to draw a single object in a variety of color shades.
[/citation]
Manifestement ID3DXSprite arrive a faire ca, comment fait-il?
J'ai trouvé ca dans le SDK de DirectX :
FinalColor = TexelColor × SourceBlendFactor + PixelColor × DestBlendFactor
A supposer que ID3DXSprite n'utilise pas lock, c'est donc qu'il existe un autre facteur , tel que :
FinalColor = TexelColor × SourceBlendFactor × facteur + PixelColor × DestBlendFactor
Comment modifier ce facteur, s'il existe?
Message édité par Ace17 le 25-06-2002 à 14:43:23