Re: IDirect3DSurface9 and alpha channels

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



For the moment I can partially answer your questions. Regarding the hardware
I'll take a raincheck for tomorrow, when I'll be at the office. I work from
home over the weekend.

Now as far as your question about the images and their alpha channel, I
believe it's up to me to decide which image to draw first and which image's
alpha channel I should use. A graphic designer provides me with the images
along with some guidelines around the special effect, in this case blending
percentage of the two images.

"Eyal Teler" wrote:

> What kind of hardware graphics card are you using? For years cards
> have been able to use non-power-of-2 textures (with some conditions).
> Also, what kind of per-pixel operations does this card support?
>
> Also, what kind of blending do you want? I can understand blending two
> images with one alpha channel (determining who much of each to
> choose), but if both have alpha channels, how are you planning to use
> this?
>
> Eyal
>
> hamlatzis wrote:
> > Thanks alot.
> >
> > The reason I'm loading the images onto surfaces has to do with memory
> > consumption and frame rates. I'm implementing a game that runs full screen
> > 800x600 and I am given a minimum hardware that has to run onto. This PC has
> > an onboard AGP card and it supports textures with power of 2 dimensions. When
> > I've tested the software even without blending (for special effects) but
> > using textures, the frame rate dropped to a point that there were no fps to
> > apply the game's logic. On the other hand when using surfaces, again
> > obviously without any blending, the rendering speed was acceptable to perform
> > the game's logic.
> >
> > I thought there was a way to do blending with surfaces, as I can use
> > D3DXLoadSurfaceFromFile to load the image without losing the alpha channel on
> > a surface, I've tested this as I saved the image back to a temp file using
> > D3DXSaveSurfaceToFile and haven't lost the alpha channel.
> >
> > If using GDI I could do a crude transparency with:
> >
> > BitBlt(hdcTemp, 0, 0, ptSize.x, ptSize.y, hdcBack, 0, 0, SRCAND);
> > BitBlt(hdcMem, 0, 0, ptSize.x, ptSize.y, hdcTemp, 0, 0, SRCPAINT);
> >
> > why shouldn't I be able to do the same or even a more sophisticated
> > (semi)transparency with alpha channels using directX?
> >
> > Back to drawing board.
> >
> > "Wessam Bahnassi" wrote:
> >
> >
> >>There isn't a HW-accelerated way to blend two IDirect3DSurface9 objects
> >>together.
> >>You can however lock them and do the blending by hand if you don't need
> >>real-time operation. BTW, even if your images are 800x600, I don't see any
> >>reason stopping you from putting them into textures... You can either
> >>stretch them to cover a full 1024x1024 texture or just make them use a sub
> >>rect of that texture...
> >>
> >>--
> >>Wessam Bahnassi
> >>Microsoft DirectX MVP,
> >>Lead Programmer
> >>In|Framez
> >>
> >>"hamlatzis" <hamlatzis@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> >>news:9ADB122D-6C5E-4EBA-BE1F-E61EC0B4B037@xxxxxxxxxxxxxxxx
> >>
> >>>I'm loading two images that have alpha channels using
> >>
> >>D3DXLoadSurfaceFromFile
> >>
> >>>and want to use each image's alpha channel to blend them together, but
> >>>obviously I'm doint something wrong as I only see the top image. I dont'
> >>
> >>want
> >>
> >>>to use textures as my images are 800x600 pixels.
> >>>
> >>>Can someone help me?
> >>>
> >>>Thanks
> >>>
> >>>Iosif
> >>
> >>
> >>
>
.



Relevant Pages

  • Re: IDirect3DSurface9 and alpha channels
    ... For years cards have been able to use non-power-of-2 textures. ... I can understand blending two images with one alpha channel, but if both have alpha channels, how are you planning to use this? ... The reason I'm loading the images onto surfaces has to do with memory consumption and frame rates. ... I thought there was a way to do blending with surfaces, as I can use D3DXLoadSurfaceFromFile to load the image without losing the alpha channel on a surface, I've tested this as I saved the image back to a temp file using D3DXSaveSurfaceToFile and haven't lost the alpha channel. ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: IDirect3DSurface9 and alpha channels
    ... what kind of per-pixel operations does this card support? ... I can understand blending two ... >> an onboard AGP card and it supports textures with power of 2 dimensions. ... >> D3DXLoadSurfaceFromFile to load the image without losing the alpha channel on ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: IDirect3DSurface9 and alpha channels
    ... textures rendering, then rest assured it doesn't support alpha blending at ... > Now as far as your question about the images and their alpha channel, ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: multitexturing and combiners problems
    ... The polygon is lit first and he wants to apply textures ... The "requirement" of lighting last was imposed by you, ... The OP mentions his texture1 has an alpha channel, ... expressed an interest in blending the texture1 with the ...
    (comp.graphics.api.opengl)
  • Re: not the least of ...
    ... Judeo-Christian thought and figures, and images borrowed from ... Wheatley's later blending in her poems of solar imagery, ... Commitment to her African heritage. ...
    (alt.usage.english)