RE: How to do this with fixed pipeline

From: Dege (Dege_at_discussions.microsoft.com)
Date: 10/01/04

  • Next message: Eyal Teler: "Re: How to do this with fixed pipeline"
    Date: Fri, 1 Oct 2004 01:39:05 -0700
    
    

    Try using alpha testing: set the alpha of bright pink pixels to zero, then
    set up the fixed pipeline to get the texure alpha. Then, enable alpha
    testing, set alpha test reference value to 0, and alpha compare fnc to
    D3D_CMP_GREATER or so. Alpha testing takes effect before alpha blending. In
    this manner pink pixels should be omitted.

    Dege

    "John Burton" wrote:

    > I have some existing bitmaps I need to use as textures.
    > They have areas which are bright pink which are supposed to indicate that
    > that area is transparent.
    >
    > I've not done it yet but it seems that this is easy to do with a pixel
    > shader. Simply don't draw the pixel at all if it maps to a bright pink.
    > That would work?
    >
    > But how could I do this with the fixed pipeline?
    > I did some reading and found that the usualy way was to manipulate the alpha
    > of the pixel to 0.0 for transparent pixels.
    > But then in order to draw properly using a blend wouldn't I have to sort my
    > triangles into Z order before drawing them, which I'd really rather not have
    > to do as I can't imagine it would be at all speedy.
    >
    > Any suggestions? I'm really hoping there is a "dont draw 100% transparent
    > pixels at all" function in the fixed pipeline, but after reading the D3D9
    > help file from cover to cover I can't seem to find one.
    >
    >
    >


  • Next message: Eyal Teler: "Re: How to do this with fixed pipeline"

    Relevant Pages

    • Re: Wierd problem when alpha blitting image with text in it
      ... When the shadow is faded out, ... constant alpha is applied to the whole window. ... windows can have per-pixel but cannot have any child windows. ... So this leaves me with the image pixels being however opaque they ...
      (microsoft.public.win32.programmer.gdi)
    • Re: Alpha Channel from mask
      ... I am not familiar with the Flash API. ... Use CreateDIBSection with a BITMAPV5HEADER as you can specify an alpha ... For all other pixels set the alpha channel to 255. ... When Flash draws itself into my buffer, it takes the pixels in my buffer ...
      (microsoft.public.win32.programmer.gdi)
    • Re: How to deal with fully transparent ARGB pixels?
      ... GDI+ solves this by using pre-multiplied alpha images. ... resulting in final partialy red pixels. ...
      (microsoft.public.dotnet.framework.drawing)
    • Re: Question of Transparent Textures..
      ... Set the pixels' alpha to 0 and enable alpha blending and the relevant TSS ... setup (for FFP pixel pipeline). ...
      (microsoft.public.win32.programmer.directx.graphics)
    • Re: Unknown transparency mask color -- how to?
      ... You said anything that GDI touches gives an Alpha of 100, ... pixels GDI left untouched, and thus should be transparent, now have an alpha value of 0x0, and any pixels GDI drew will ...
      (microsoft.public.vb.winapi.graphics)