Professional Web Applications Themes

Flash as interactive texture with alpha channel viacopyPixels - Macromedia Director 3D

I want to use Flash member as interactive 3D texture. When I copy Flash sprite image to texture (via copyPixels) a lose the alpha channel of Flash movie. theMember = member(1, 1) pImage = image(380,600,32) pImage.copyPixels((the stage).image, pImage.rect, sprite(flashsprite).rect) theTexture2 = theMember.newTexture("flash2",#fromImageObject,pIm age) theShader = member(1, 1).shader("flash_mat") theShader.texture = theTexture2 theShader.useDiffuseWithTexture = 0 Help please how to prevent this (losing of flash transparency)?...

  1. #1

    Default Flash as interactive texture with alpha channel viacopyPixels

    I want to use Flash member as interactive 3D texture.
    When I copy Flash sprite image to texture (via copyPixels) a lose the alpha
    channel of Flash movie.

    theMember = member(1, 1)
    pImage = image(380,600,32)
    pImage.copyPixels((the stage).image, pImage.rect, sprite(flashsprite).rect)
    theTexture2 = theMember.newTexture("flash2",#fromImageObject,pIm age)
    theShader = member(1, 1).shader("flash_mat")
    theShader.texture = theTexture2
    theShader.useDiffuseWithTexture = 0
    Help please how to prevent this (losing of flash transparency)?

    eone Guest

  2. #2

    Default Re: Flash as interactive texture with alpha channel viacopyPixels

    You need to set the #renderFormat property of your texture to a value which
    takes into account the alpha channel. You will get the best quality display
    with #rgba8888. This comes at the price of greater memory usage and slower
    performance:

    -- <snipped code>
    theTexture2 = theMember.newTexture("flash2",#fromImageObject,pIm age)
    theTexture2.renderFormat = #rgba8888
    -- <more snipped code>

    Other values which activate the alpha channel are:

    #rgba5551 -- alpha is opaque or transparent
    #rgba4444 -- limited range of colors and transparency


    openspark Guest

  3. #3

    Default Re: Flash as interactive texture with alpha channel viacopyPixels

    That didn't work for me. If the Flash Sprite ink is set to background
    transparent, the final image will include the part of the stage beneath the
    flash sprite.

    Should I place the Flash Sprite above a specific place of the stage? or place
    something underneath it?

    I wish I could use the flash cast member instead of the sprite, but, then the
    texture wouldn't be updated, right?

    foq Guest

  4. #4

    Default Re: Flash as interactive texture with alpha channel viacopyPixels

    Originally posted by: eone
    I want to use Flash member as interactive 3D texture.
    When I copy Flash sprite image to texture (via copyPixels) a lose the alpha
    channel of Flash movie.
    This is not a good idea because the frame rate is going down too much ("SWF +
    copyPixels" = a method hungry for resources).
    Export each SWF keyframe as bitmap (if not too many ...) and include them in
    the W3D file.
    cheers



    necromanthus Guest

  5. #5

    Default Re: Flash as interactive texture with alpha channel viacopyPixels

    Thank you for replying.

    The problem is that the flash is interactive... so it's impossible to export every keyframe, as the images change according to the user's interaction.
    foq Guest

Similar Threads

  1. texture blend whit alpha channel
    By belin-chu in forum Macromedia Director 3D
    Replies: 2
    Last Post: July 12th, 12:39 PM
  2. Alpha Channel from B&W layer
    By Lesley_Flanigan@adobeforums.com in forum Adobe Photoshop Mac CS, CS2 & CS3
    Replies: 2
    Last Post: April 30th, 04:08 PM
  3. Replies: 2
    Last Post: March 1st, 06:15 AM
  4. DTS, multi-texture & alpha channel
    By fivan webforumsuser@macromedia.com in forum Macromedia Director 3D
    Replies: 3
    Last Post: December 11th, 08:11 AM
  5. Alpha Channel and CopyPixels
    By Daniel Pliscoff in forum Macromedia Director Lingo
    Replies: 1
    Last Post: August 13th, 11:15 AM

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