Re: IDirect3DSurface9 and alpha channels
- From: hamlatzis <hamlatzis@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 15 Jan 2006 09:13:04 -0800
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
> >>
> >>
> >>
>
.
- Follow-Ups:
- Re: IDirect3DSurface9 and alpha channels
- From: Wessam Bahnassi
- Re: IDirect3DSurface9 and alpha channels
- References:
- Re: IDirect3DSurface9 and alpha channels
- From: Wessam Bahnassi
- Re: IDirect3DSurface9 and alpha channels
- From: Eyal Teler
- Re: IDirect3DSurface9 and alpha channels
- Prev by Date: Re: IDirect3DSurface9 and alpha channels
- Next by Date: Re: IDirect3DSurface9 and alpha channels
- Previous by thread: Re: IDirect3DSurface9 and alpha channels
- Next by thread: Re: IDirect3DSurface9 and alpha channels
- Index(es):
Relevant Pages
|