Professional Web Applications Themes

'add' blendfunction causes alpha problem - Macromedia Director 3D

Hi people, I'm hoping someone will tell me this is possible! I have 2 textures. I want to use one as a regular diffuse texture on my object, and another texture in a higher channel, using the #add blend function. This works fine, except when my regular diffuse texture has transparent areas (i.e. it uses an alpha channel), in which case it becomes opaque when the #add texture layer is applied in a higher channel. Using the #multiply blend function seems to work fine over a diffuse texture with an alpha channel, but using the #add function appears to completely ...

  1. #1

    Default 'add' blendfunction causes alpha problem

    Hi people,

    I'm hoping someone will tell me this is possible!

    I have 2 textures. I want to use one as a regular diffuse texture on my
    object, and another texture in a
    higher channel, using the #add blend function.

    This works fine, except when my regular diffuse texture has transparent areas
    (i.e. it uses an alpha
    channel), in which case it becomes opaque when the #add texture layer is
    applied in a higher channel.

    Using the #multiply blend function seems to work fine over a diffuse texture
    with an alpha channel, but
    using the #add function appears to completely prevent the diffuse texture
    below from appearing
    transparent at all.

    Here's a demo (with source) showing the problem:

    http://www.robotduck.com/misc/alphaAddProblem/

    Anyone else come up against this problem? Have any solutions?

    thanks in advance :-)

    - Ben


    duckets Guest

  2. #2

    Default Re: 'add' blendfunction causes alpha problem

    Update, which just makes it weirder, it seems the transparency is preserved if
    the 3D renderer is set to #directX5_2 or #software. I guess this is something
    to do with the fact that both of those modes only support one texture layer, so
    the 2nd layer is drawn in a second renderer pass.

    - Ben


    duckets Guest

  3. #3

    Default Re: 'add' blendfunction causes alpha problem

    Are all your texture members 32 bit depth?

    This fixed a strange issue I had ages ago with multilayered textures by
    making all layers (even layers only using color info) have an alpha channel.

    Richard Smith
    www.FUNPODS.com


    Richard Guest

  4. #4

    Default Re: 'add' blendfunction causes alpha problem

    Interesting idea - I'll give it a go
    duckets Guest

  5. #5

    Default Re: 'add' blendfunction causes alpha problem

    duckets wrote: 

    I've done some playing around with the additive blending in director.
    Forcing director to render one of the textures in a 2nd pass is the
    only way I've found to get it to work. You can do it using the
    #directx7 (or whatever the "newest" one is) by making a texture list
    that is 1 larger than the renderer's (and your video card's) texture
    list size. 8 is usually a safe bet, although if this is on the web,
    any given user can have a different configuration.

    So what you would need to do is (assuming 8 is your setup's one-pass
    texture list size), is make a 9 texture texture-list. The first 7 can
    be filled with a completely blank texture. The 8th would be your first
    actual texture, and the 9th would be your additive texture.

    It's probably not the most efficient way to do it, but it's a neat way
    to do it with the latest renderers in director.


    -Vix

    Vix Guest

Similar Threads

  1. Texture problem with alpha channel
    By Lamefif in forum Macromedia Director 3D
    Replies: 6
    Last Post: November 17th, 12:28 PM
  2. Shader.blendFunction doesn't work
    By 3Dimka in forum Macromedia Director 3D
    Replies: 5
    Last Post: January 24th, 07:02 PM
  3. Alpha or zbuffer problem ???
    By Angel3D in forum Macromedia Director 3D
    Replies: 1
    Last Post: August 8th, 09:41 PM
  4. alpha problem using Dynamic text in a movie clip
    By dang in forum Macromedia Flash
    Replies: 2
    Last Post: February 20th, 02:52 PM
  5. #24686 [NEW]: PREG /^[[:alpha:]]+$/ - accentuated char problem ?
    By mhaury at igc dot gulbenkian dot pt in forum PHP Development
    Replies: 0
    Last Post: July 16th, 10:08 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139